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OulJ,EAAOxnJ,UAAW,EAAQ,OAEtC1B,EAAOC,QAAUipJ,kBC5UjB,IAAIixF,EAAgB,EAAQ,MACxBxG,EAAM,EAAQ,MAEd6iC,EAAc,CAChB,cACA,WACA,gBACA,YACA,aACA,SACA,QACA,SACA,OACA,kBACA,gBACA,gBACA,iBACA,kBACA,aACA,MACA,gBACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,aACA,oBACA,cACA,kBACA,aACA,gBACA,aACA,MACA,iBACA,KACA,UACA,WACA,oBACA,kBACA,cACA,aACA,cACA,aACA,wBACA,uBACA,0BACA,aACA,WACA,WACA,UACA,oBACA,UACA,OACA,SACA,SACA,eACA,UACA,SACA,cACA,cACA,QACA,kBACA,YACA,OACA,QACA,eACA,QACA,MACA,aACA,aACA,gBACA,eACA,kBACA,YACA,uBACA,eACA,OACA,0BACA,mBAGEC,EAAgB,CAClB,SACA,WACA,UACA,WACA,aACA,aACA,eACA,aACA,aACA,kBACA,eACA,mBACA,kBACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,eACA,aACA,QACA,YACA,WACA,kBACA,eAGET,EAAiB77B,EAAc7lM,OAEjC,CAUEr4C,YAAa,SAAUg1C,GACrB90C,KAAKwkP,QAAU1vM,EACf90C,KAAKu6Q,UAAY,EACjBv6Q,KAAKw6Q,iBAAmB,EAGxBx6Q,KAAKsnP,SAAW,CAAC,CACnB,EASAqyB,YAAa,SAAUn4O,EAAQi5O,EAAWC,GACxCl5O,EAASA,GAAU,CAAC,EACpBi5O,EAAYA,GAAa,GACzB,IAAK,IAAIzpQ,EAAI,EAAGA,EAAIypQ,EAAUxzQ,OAAQ+J,IAAK,CACzC,IAAI04B,EAAQ+wO,EAAUzpQ,GAEtB,IAAIwwB,EAAOkI,GAAX,CACA,IAAIslF,EAAa6qJ,EAAe7H,QAAQtoO,GAExC,GAAI1pC,KAAKwkP,Q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1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OACtC20O,EAAK1yO,OAAOulJ,EAAOxnJ,UAAW,EAAQ,OAEtC1B,EAAOC,QAAUipJ,kBCrVjB,IAAIixF,EAAgB,EAAQ,MACxBxG,EAAM,EAAQ,MAEd6iC,EAAc,CAChB,cACA,WACA,gBACA,YACA,aACA,SACA,QACA,SACA,OACA,kBACA,gBACA,gBACA,iBACA,kBACA,aACA,MACA,gBACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,aACA,oBACA,cACA,kBACA,aACA,gBACA,aACA,MACA,iBACA,KACA,UACA,WACA,oBACA,kBACA,cACA,aACA,cACA,aACA,aACA,WACA,WACA,UACA,oBACA,UACA,OACA,SACA,SACA,eACA,UACA,SACA,cACA,cACA,QACA,kBACA,YACA,OACA,QACA,eACA,QACA,MACA,aACA,aACA,gBACA,eACA,kBACA,YACA,uBACA,eACA,OACA,0BACA,mBAGEC,EAAgB,CAClB,SACA,WACA,UACA,WACA,aACA,aACA,eACA,aACA,aACA,kBACA,eACA,mBACA,kBACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,eACA,aACA,QACA,YACA,WACA,kBACA,eAGET,EAAiB77B,EAAc7lM,OAEjC,CAUEr4C,YAAa,SAAUg1C,GACrB90C,KAAKwkP,QAAU1vM,EACf90C,KAAKu6Q,UAAY,EACjBv6Q,KAAKw6Q,iBAAmB,EAGxBx6Q,KAAKsnP,SAAW,CAAC,CACnB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E,eAAgB,CAAC,WAAY,eAC7B,cAAe,CAAC,WAAY,mBAAoB,gBAAiB,WAAY,kBAAmB,eAEhG,QAAS,CAAC,gBAAiB,WAAY,uBAAwB,eAAgB,uBAAwB,gBAAiB,UAAW,aAAc,aAAc,UAAW,aAAc,mBAExL,0BAA2B,CACzB,cACA,WACA,WACA,gBACA,QACA,OACA,UACA,WACA,mBACA,WACA,aACA,aACA,aACA,aACA,UACA,oBACA,MACA,iBACA,KACA,cACA,kBACA,aACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,QAEF,yBAA0B,CAAC,kBAC3B,wBAAyB,CAAC,QAAS,OAAQ,eAC3C,yBAA0B,CAAC,kBAC3B,0BAA2B,CAAC,eAE5B,iBAAkB,CAAC,GAIrBK,WAAY,CACV,iBAAkB,CAAC,aAIrBC,gBAAiB,CACftlQ,SAAU,CACR,YACA,QACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,MACA,WACA,WACA,iBACA,YACA,kBACA,cAKJ08P,QAAS,CACP6I,cAAe,mBACfzJ,SAAU,cACV0J,SAAU,cACV1b,IAAK,qBACL9/J,gBAAiB,qBACjBy7K,cAAe,mBACfnJ,cAAe,cACfh4N,QAAS,aACTohO,WAAY,gBACZp+E,WAAY,gBACZxlG,UAAW,eACXlrF,MAAO,WACP+uQ,OAAQ,YACRtJ,KAAM,YACNX,cAAe,cACfxpB,eAAgB,oBAChB0zB,gBAAiB,qBACjB34K,WAAY,cACZpe,cAAe,mBACfpkF,OAAQ,gBACRgnP,IAAK,SACLo0B,cAAe,mBACfC,WAAY,gBACZtV,SAAU,cACVuV,kBAAmB,uBACnB5zB,gBAAiB,qBACjBoe,YAAa,iBACbyV,gBAAiB,qBACjBC,YAAa,iBACbjc,QAAS,aACTkc,WAAY,gBACZC,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,EAAK4zD,WAClBC,GAAe7zD,EAAK6zD,aACpBC,GAAS9zD,EAAK8zD,OAEdE,KAAen4S,MAAK,WAClBe,OAAOswC,UAAW,CACpB,IACAtwC,OAAOK,QAAUA,EACnB,GACF,IC3HE,GAAG,IACL,IACAL,OAAOy0S,iBAAmBA,EAC5B","sources":["webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/chromecast/ChromecastSessionManager.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/components/ChromecastButton.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/enableChromecast.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/index.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/preloadWebComponents.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/tech/ChromecastTech.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/src/js/tech/ChromecastTechUI.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/conventions.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/dom-parser.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/dom.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/entities.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/index.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@xmldom/xmldom/lib/sax.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/mux.js/lib/tools/parse-sidx.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/mux.js/lib/utils/clock.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/mux.js/lib/utils/numbers.js","webpack://r7-player/./node_modules/@videojs/xhr/lib/http-handler.js","webpack://r7-player/./node_modules/@videojs/xhr/lib/index.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/conventions.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/dom-parser.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/dom.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/entities.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/index.js","webpack://r7-player/./node_modules/@xmldom/xmldom/lib/sax.js","webpack://r7-player/./src/assets/javascripts/ads/adblock.js","webpack://r7-player/./src/assets/javascripts/utils/default-params.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://r7-player/./src/assets/javascripts/helpers/browser-detector.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack://r7-player/./src/assets/javascripts/helpers/helpers.js","webpack://r7-player/./src/assets/javascripts/helpers/messages.js","webpack://r7-player/./src/assets/javascripts/lang/pt.js","webpack://r7-player/./src/assets/javascripts/utils/get-params.js","webpack://r7-player/./src/assets/javascripts/utils/config-params.js","webpack://r7-player/./node_modules/videojs-errors/dist/videojs-errors.es.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-errors.js","webpack://r7-player/./node_modules/videojs-contrib-quality-levels/dist/videojs-contrib-quality-levels.es.js","webpack://r7-player/./node_modules/videojs-hls-quality-selector/dist/videojs-hls-quality-selector.es.js","webpack://r7-player/./node_modules/vanilla-sharing/dist/vanilla-sharing.esm.js","webpack://r7-player/./node_modules/videojs-share/dist/videojs-share.es.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-share.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-suggested-overlay.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-suggested-container.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-suggested-next.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-title-overlay.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-age-rating-overlay.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-playlist.js","webpack://r7-player/./src/assets/javascripts/helpers/script-loader.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-chromecast.js","webpack://r7-player/./node_modules/videojs-overlay/dist/videojs-overlay.es.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-auto-play.js","webpack://r7-player/./src/assets/javascripts/plugins/index.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-errors-treat.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-quality-selector.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-sprite-thumbnails.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-seek-buttons.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-logo.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-pause-on-touch.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-landscape.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-overlay-manager.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-time-stamp.js","webpack://r7-player/./src/assets/javascripts/plugins/vjs-loop.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/index.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/start.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/share.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/skip.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/quality.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/fullscreen.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/picture-in-picture.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/error.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/end.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/adsevents.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/suggested.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/next.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/replay.js","webpack://r7-player/./src/assets/javascripts/utils/event-tracking/volume.js","webpack://r7-player/./src/assets/javascripts/analytics/google_analytics.js","webpack://r7-player/./node_modules/videojs-contrib-ads/dist/videojs-contrib-ads.es.js","webpack://r7-player/./node_modules/videojs-ima/dist/videojs.ima.es.js","webpack://r7-player/./src/assets/javascripts/ads/tailTarget.js","webpack://r7-player/./src/assets/javascripts/ads/imaSampleTags.js","webpack://r7-player/./src/assets/javascripts/ads/ads.js","webpack://r7-player/./src/assets/javascripts/analytics/youbora.js","webpack://r7-player/./src/assets/javascripts/analytics/comscore.js","webpack://r7-player/./src/assets/javascripts/helpers/jsonp.js","webpack://r7-player/./src/assets/javascripts/analytics/kibana.js","webpack://r7-player/./src/assets/javascripts/utils/get-metadatas.js","webpack://r7-player/./src/public-path.js","webpack://r7-player/./node_modules/clipboard/dist/clipboard.js","webpack://r7-player/./node_modules/@silvermine/videojs-chromecast/dist/silvermine-videojs-chromecast.css","webpack://r7-player/./src/assets/stylesheets/main.scss","webpack://r7-player/./node_modules/video.js/dist/video-js.min.css","webpack://r7-player/./node_modules/videojs-contrib-ads/dist/videojs.ads.css","webpack://r7-player/./node_modules/videojs-errors/dist/videojs-errors.css","webpack://r7-player/./node_modules/videojs-ima/dist/videojs.ima.css","webpack://r7-player/./node_modules/videojs-logo/dist/videojs-logo.css","webpack://r7-player/./node_modules/videojs-overlay/dist/videojs-overlay.css","webpack://r7-player/./node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.css","webpack://r7-player/./node_modules/videojs-share/dist/videojs-share.css","webpack://r7-player/./node_modules/css-loader/dist/runtime/api.js","webpack://r7-player/./node_modules/css-loader/dist/runtime/getUrl.js","webpack://r7-player/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://r7-player/./node_modules/delegate/src/closest.js","webpack://r7-player/./node_modules/delegate/src/delegate.js","webpack://r7-player/./node_modules/global/document.js","webpack://r7-player/./node_modules/global/window.js","webpack://r7-player/./node_modules/good-listener/src/is.js","webpack://r7-player/./node_modules/good-listener/src/listen.js","webpack://r7-player/./node_modules/is-function/index.js","webpack://r7-player/./node_modules/keycode/index.js","webpack://r7-player/./node_modules/mux.js/lib/tools/parse-sidx.js","webpack://r7-player/./node_modules/mux.js/lib/utils/clock.js","webpack://r7-player/./node_modules/mux.js/lib/utils/numbers.js","webpack://r7-player/./node_modules/safe-json-parse/tuple.js","webpack://r7-player/./node_modules/select/src/select.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://r7-player/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://r7-player/./node_modules/tiny-emitter/index.js","webpack://r7-player/./node_modules/url-toolkit/src/url-toolkit.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/resolve-url.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/stream.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js","webpack://r7-player/./node_modules/m3u8-parser/dist/m3u8-parser.es.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/byte-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/mp4-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/codecs.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/media-types.js","webpack://r7-player/./node_modules/mpd-parser/dist/mpd-parser.es.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/media-groups.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/id3-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/opus-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/ebml-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/nal-helpers.js","webpack://r7-player/./node_modules/@videojs/vhs-utils/es/containers.js","webpack://r7-player/./node_modules/video.js/dist/video.es.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://r7-player/./node_modules/videojs-landscape-fullscreen/dist/videojs-landscape-fullscreen.min.js","webpack://r7-player/./node_modules/videojs-logo/dist/videojs-logo.js","webpack://r7-player/./node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.js","webpack://r7-player/./node_modules/videojs-share/node_modules/clipboard/lib/clipboard-action.js","webpack://r7-player/./node_modules/videojs-share/node_modules/clipboard/lib/clipboard.js","webpack://r7-player/./node_modules/videojs-sprite-thumbnails/dist/videojs-sprite-thumbnails.js","webpack://r7-player/./node_modules/videojs-vtt.js/lib/browser-index.js","webpack://r7-player/./node_modules/videojs-vtt.js/lib/vtt.js","webpack://r7-player/./node_modules/videojs-vtt.js/lib/vttcue.js","webpack://r7-player/./node_modules/videojs-vtt.js/lib/vttregion.js","webpack://r7-player/./node_modules/webcomponents.js/webcomponents-lite.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/adapter+ads.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/adapter+content.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/adapter.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/playbackchronos.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/playbackflags.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/playheadmonitor.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/adapter/statemonitor.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/chrono.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/communication.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/request.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/flow.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/offline.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resource.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnSwitch.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparser.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/akamai.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/amazon.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/balancer.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/cloudfront.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/edgecast.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/fastly.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/highwinds.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/level3.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/nosott.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/telefonica.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/dashparser.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/hlsparser.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/locationheaderparser.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/parser.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/transform.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/view.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/comm/transform/wrong.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/adInsertionType.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/adPosition.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/adapter.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/event.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/manifestError.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/requestMethod.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/service.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/streamingProtocols.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/transportFormat.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/constants/willSendEvent.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/detectors/backgroundDetector.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/detectors/deviceDetector.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/detectors/resizeScrollDetector.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/deviceUUID/dataextractor.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/deviceUUID/hashgenerator.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/deviceUUID/md5.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/emitter.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/infinity/infinity.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/log.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/mixins/assign.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/mixins/create.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/mixins/isarray.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/monitors/browserLoadTimes.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/monitors/hybridnetwork.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/monitors/speedIndex.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/object.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/deprecatedOptions.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/offlineStorage.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/options.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+ads+getters.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+ads.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+content+getters.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+content.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+fire.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+getters.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+infinity+getters.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+infinity.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin+pings.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/plugin.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/requestbuilder.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/plugin/storage.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/polyfills.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/timer.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/util.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/version.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/node_modules/youboralib/src/youboralib.js","webpack://r7-player/./node_modules/youbora-adapter-freewheel/src/adapter.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/adapter.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/bcove-freewheel.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/bcove-ima.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/freewheel.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/generic.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/ima.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/ads/onceux.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/tech/contrib-hls.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/tech/dash-shaka.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/tech/dash.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/tech/hls-js.js","webpack://r7-player/./node_modules/youbora-adapter-videojs/src/tech/shaka.js","webpack://r7-player/./node_modules/youboralib/src/adapter/adapter+ads.js","webpack://r7-player/./node_modules/youboralib/src/adapter/adapter+content.js","webpack://r7-player/./node_modules/youboralib/src/adapter/adapter.js","webpack://r7-player/./node_modules/youboralib/src/adapter/playbackchronos.js","webpack://r7-player/./node_modules/youboralib/src/adapter/playbackflags.js","webpack://r7-player/./node_modules/youboralib/src/adapter/playheadmonitor.js","webpack://r7-player/./node_modules/youboralib/src/adapter/statemonitor.js","webpack://r7-player/./node_modules/youboralib/src/chrono.js","webpack://r7-player/./node_modules/youboralib/src/comm/communication.js","webpack://r7-player/./node_modules/youboralib/src/comm/request.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/flow.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/offline.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resource.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnSwitch.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparser.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/akamai.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/amazon.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/balancer.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/cloudfront.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/edgecast.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/fastly.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/highwinds.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/level3.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/nosott.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/cdnparsers/telefonica.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/dashparser.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/hlsparser.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/locationheaderparser.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/resourceparsers/formatparsers/parser.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/transform.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/view.js","webpack://r7-player/./node_modules/youboralib/src/comm/transform/wrong.js","webpack://r7-player/./node_modules/youboralib/src/constants.js","webpack://r7-player/./node_modules/youboralib/src/constants/adInsertionType.js","webpack://r7-player/./node_modules/youboralib/src/constants/adPosition.js","webpack://r7-player/./node_modules/youboralib/src/constants/adapter.js","webpack://r7-player/./node_modules/youboralib/src/constants/event.js","webpack://r7-player/./node_modules/youboralib/src/constants/manifestError.js","webpack://r7-player/./node_modules/youboralib/src/constants/requestMethod.js","webpack://r7-player/./node_modules/youboralib/src/constants/service.js","webpack://r7-player/./node_modules/youboralib/src/constants/streamingProtocols.js","webpack://r7-player/./node_modules/youboralib/src/constants/transportFormat.js","webpack://r7-player/./node_modules/youboralib/src/constants/willSendEvent.js","webpack://r7-player/./node_modules/youboralib/src/detectors/backgroundDetector.js","webpack://r7-player/./node_modules/youboralib/src/detectors/deviceDetector.js","webpack://r7-player/./node_modules/youboralib/src/detectors/resizeScrollDetector.js","webpack://r7-player/./node_modules/youboralib/src/deviceUUID/dataextractor.js","webpack://r7-player/./node_modules/youboralib/src/deviceUUID/hashgenerator.js","webpack://r7-player/./node_modules/youboralib/src/deviceUUID/md5.js","webpack://r7-player/./node_modules/youboralib/src/emitter.js","webpack://r7-player/./node_modules/youboralib/src/infinity/infinity.js","webpack://r7-player/./node_modules/youboralib/src/log.js","webpack://r7-player/./node_modules/youboralib/src/mixins/assign.js","webpack://r7-player/./node_modules/youboralib/src/mixins/create.js","webpack://r7-player/./node_modules/youboralib/src/mixins/isarray.js","webpack://r7-player/./node_modules/youboralib/src/monitors/browserLoadTimes.js","webpack://r7-player/./node_modules/youboralib/src/monitors/hybridnetwork.js","webpack://r7-player/./node_modules/youboralib/src/monitors/speedIndex.js","webpack://r7-player/./node_modules/youboralib/src/object.js","webpack://r7-player/./node_modules/youboralib/src/plugin/deprecatedOptions.js","webpack://r7-player/./node_modules/youboralib/src/plugin/offlineStorage.js","webpack://r7-player/./node_modules/youboralib/src/plugin/options.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+ads+getters.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+ads.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+content+getters.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+content.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+fire.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+getters.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+infinity+getters.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+infinity.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin+pings.js","webpack://r7-player/./node_modules/youboralib/src/plugin/plugin.js","webpack://r7-player/./node_modules/youboralib/src/plugin/requestbuilder.js","webpack://r7-player/./node_modules/youboralib/src/plugin/storage.js","webpack://r7-player/./node_modules/youboralib/src/polyfills.js","webpack://r7-player/./node_modules/youboralib/src/productanalytics/productanalytics.js","webpack://r7-player/./node_modules/youboralib/src/productanalytics/productanalytics_config.js","webpack://r7-player/./node_modules/youboralib/src/productanalytics/productanalytics_userstate.js","webpack://r7-player/./node_modules/youboralib/src/timer.js","webpack://r7-player/./node_modules/youboralib/src/util.js","webpack://r7-player/./node_modules/youboralib/src/version.js","webpack://r7-player/./node_modules/youboralib/src/youboralib.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/extends.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/typeof.js","webpack://r7-player/./node_modules/@babel/runtime/regenerator/index.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://r7-player/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://r7-player/webpack/bootstrap","webpack://r7-player/webpack/runtime/compat get default export","webpack://r7-player/webpack/runtime/define property getters","webpack://r7-player/webpack/runtime/global","webpack://r7-player/webpack/runtime/hasOwnProperty shorthand","webpack://r7-player/webpack/runtime/make namespace object","webpack://r7-player/webpack/runtime/publicPath","webpack://r7-player/webpack/runtime/jsonp chunk loading","webpack://r7-player/webpack/runtime/nonce","webpack://r7-player/./src/assets/stylesheets/main.scss?ac4c","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/resolve-url.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/m3u8-parser/node_modules/@videojs/vhs-utils/es/stream.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/m3u8-parser/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/m3u8-parser/dist/m3u8-parser.es.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/codecs.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/byte-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/media-types.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/mpd-parser/dist/mpd-parser.es.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/media-groups.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/mp4-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/id3-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/opus-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/ebml-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/nal-helpers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/node_modules/@videojs/vhs-utils/es/containers.js","webpack://r7-player/./node_modules/@videojs/http-streaming/dist/videojs-http-streaming.es.js","webpack://r7-player/./src/assets/javascripts/ads/ima.js","webpack://r7-player/./src/assets/javascripts/analytics/chartbeat.js","webpack://r7-player/./src/assets/javascripts/start-player.js","webpack://r7-player/./src/assets/javascripts/main.js"],"sourcesContent":["/** @lends ChromecastSessionManager.prototype **/\nclass ChromecastSessionManager {\n\n   /**\n    * Stores the state of the current Chromecast session and its associated objects such\n    * as the\n    * [RemotePlayerController](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController),\n    * and the\n    * [RemotePlayer](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayer).\n    *\n    * WARNING: Do not instantiate this class until the\n    * [CastContext](https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext)\n    * has been configured.\n    *\n    * For an undocumented (and thus unknown) reason, RemotePlayer and\n    * RemotePlayerController instances created before the cast context has been configured\n    * or after requesting a session or loading media will not stay in sync with media\n    * items that are loaded later.\n    *\n    * For example, the first item that you cast will work as expected: events on\n    * RemotePlayerController will fire and the state (currentTime, duration, etc) of the\n    * RemotePlayer instance will update as the media item plays. However, if a new media\n    * item is loaded via a `loadMedia` request, the media item will play, but the\n    * remotePlayer will be in a \"media unloaded\" state where the duration is 0, the\n    * currentTime does not update, and no change events are fired (except, strangely,\n    * displayStatus updates).\n    *\n    * @param player {object} Video.js Player\n    * @constructs ChromecastSessionManager\n    */\n   constructor(player) {\n      this.player = player;\n\n      this._sessionListener = this._onSessionStateChange.bind(this);\n      this._castListener = this._onCastStateChange.bind(this);\n\n      this._addCastContextEventListeners();\n\n      // Remove global event listeners when this player instance is destroyed to prevent\n      // memory leaks.\n      this.player.on('dispose', this._removeCastContextEventListeners.bind(this));\n\n      this._notifyPlayerOfDevicesAvailabilityChange(this.getCastContext().getCastState());\n\n      this.remotePlayer = new cast.framework.RemotePlayer();\n      this.remotePlayerController = new cast.framework.RemotePlayerController(this.remotePlayer);\n   }\n\n   static hasConnected = false;\n\n   /**\n    * Add event listeners for events triggered on the current CastContext.\n    *\n    * @private\n    */\n   _addCastContextEventListeners() {\n      var sessionStateChangedEvt = cast.framework.CastContextEventType.SESSION_STATE_CHANGED,\n          castStateChangedEvt = cast.framework.CastContextEventType.CAST_STATE_CHANGED;\n\n      this.getCastContext().addEventListener(sessionStateChangedEvt, this._sessionListener);\n      this.getCastContext().addEventListener(castStateChangedEvt, this._castListener);\n   }\n\n   /**\n    * Remove event listeners that were added in {@link\n    * ChromecastSessionManager#_addCastContextEventListeners}.\n    *\n    * @private\n    */\n   _removeCastContextEventListeners() {\n      var sessionStateChangedEvt = cast.framework.CastContextEventType.SESSION_STATE_CHANGED,\n          castStateChangedEvt = cast.framework.CastContextEventType.CAST_STATE_CHANGED;\n\n      this.getCastContext().removeEventListener(sessionStateChangedEvt, this._sessionListener);\n      this.getCastContext().removeEventListener(castStateChangedEvt, this._castListener);\n   }\n\n   /**\n    * Handle the CastContext's SessionState change event.\n    *\n    * @private\n    */\n   _onSessionStateChange(event) {\n      if (event.sessionState === cast.framework.SessionState.SESSION_ENDED) {\n         this.player.trigger('chromecastDisconnected');\n         this._reloadTech();\n      }\n   }\n\n   /**\n    * Handle the CastContext's CastState change event.\n    *\n    * @private\n    */\n   _onCastStateChange(event) {\n      this._notifyPlayerOfDevicesAvailabilityChange(event.castState);\n   }\n\n   /**\n    * Triggers player events that notifies listeners that Chromecast devices are\n    * either available or unavailable.\n    *\n    * @private\n    */\n   _notifyPlayerOfDevicesAvailabilityChange(castState) {\n      if (this.hasAvailableDevices(castState)) {\n         this.player.trigger('chromecastDevicesAvailable');\n      } else {\n         this.player.trigger('chromecastDevicesUnavailable');\n      }\n   }\n\n   /**\n    * Returns whether or not there are Chromecast devices available to cast to.\n    *\n    * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework#.CastState\n    * @param {String} castState\n    * @return {boolean} true if there are Chromecast devices available to cast to.\n    */\n   hasAvailableDevices(castState) {\n      castState = castState || this.getCastContext().getCastState();\n\n      return castState === cast.framework.CastState.NOT_CONNECTED ||\n         castState === cast.framework.CastState.CONNECTING ||\n         castState === cast.framework.CastState.CONNECTED;\n   }\n\n   /**\n    * Opens the Chromecast casting menu by requesting a CastSession. Does nothing if the\n    * Video.js player does not have a source.\n    */\n   openCastMenu() {\n      var onSessionSuccess;\n\n      if (!this.player.currentSource()) {\n         // Do not cast if there is no media item loaded in the player\n         return;\n      }\n      onSessionSuccess = function() {\n         ChromecastSessionManager.hasConnected = true;\n         this.player.trigger('chromecastConnected');\n         this._reloadTech();\n      }.bind(this);\n\n      // It is the `requestSession` function call that actually causes the cast menu to\n      // open.\n      // The second parameter to `.then` is an error handler. We use a noop function here\n      // because we handle errors in the ChromecastTech class and we do not want an\n      // error to bubble up to the console. This error handler is also triggered when\n      // the user closes out of the chromecast selector pop-up without choosing a\n      // casting destination.\n      this.getCastContext().requestSession()\n         .then(onSessionSuccess, function() { /* noop */ });\n   }\n\n   /**\n    * Reloads the Video.js player's Tech. This causes the player to re-evaluate which\n    * Tech should be used for the current source by iterating over available Tech and\n    * calling `Tech.isSupported` and `Tech.canPlaySource`. Video.js uses the first\n    * Tech that returns true from both of those functions. This is what allows us to\n    * switch back and forth between the Chromecast Tech and other available Tech when a\n    * CastSession is connected or disconnected.\n    *\n    * @private\n    */\n   _reloadTech() {\n      var player = this.player,\n          currentTime = player.currentTime(),\n          wasPaused = player.paused(),\n          sources = player.currentSources();\n\n      // Reload the current source(s) to re-lookup and use the currently available Tech.\n      // The chromecast Tech gets used if `ChromecastSessionManager.isChromecastConnected`\n      // is true (effectively, if a chromecast session is currently in progress),\n      // otherwise Video.js continues to search through the Tech list for other eligible\n      // Tech to use, such as the HTML5 player.\n      player.src(sources);\n\n      player.ready(function() {\n         if (wasPaused) {\n            player.pause();\n         } else {\n            player.play();\n         }\n         player.currentTime(currentTime || 0);\n      });\n   }\n\n   /**\n    * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext\n    * @returns {object} the current CastContext, if one exists\n    */\n\n   getCastContext() {\n      return cast.framework.CastContext.getInstance();\n   }\n\n   /**\n    * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayer\n    * @returns {object} the current RemotePlayer, if one exists\n    */\n   getRemotePlayer() {\n      return this.remotePlayer;\n   }\n\n   /**\n    * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController\n    * @returns {object} the current RemotePlayerController, if one exists\n    */\n   getRemotePlayerController() {\n      return this.remotePlayerController;\n   }\n\n   /**\n    * Returns whether or not the current Chromecast API is available (that is,\n    * `window.chrome`, `window.chrome.cast`, and `window.cast` exist).\n    *\n    * @static\n    * @returns {boolean} true if the Chromecast API is available\n    */\n   static isChromecastAPIAvailable() {\n      return window.chrome && window.chrome.cast && window.cast;\n   }\n\n   /**\n    * Returns whether or not there is a current CastSession and it is connected.\n    *\n    * @static\n    * @returns {boolean} true if the current CastSession exists and is connected\n    */\n   static isChromecastConnected() {\n      // We must also check the `hasConnected` flag because\n      // `getCastContext().getCastState()` returns `CONNECTED` even when the current\n      // casting session was initiated by another tab in the browser or by another process\n      return ChromecastSessionManager.isChromecastAPIAvailable() &&\n         (cast.framework.CastContext.getInstance().getCastState() === cast.framework.CastState.CONNECTED) &&\n         ChromecastSessionManager.hasConnected;\n   }\n}\n\nmodule.exports = ChromecastSessionManager;\n","module.exports = function(videojs) {\n\n   /**\n    * Registers the ChromecastButton Component with Video.js. Calls\n    * {@link http://docs.videojs.com/Component.html#.registerComponent}, which will add a\n    * component called `chromecastButton` to the list of globally registered Video.js\n    * components. The `chromecastButton` is added to the player's control bar UI\n    * automatically once {@link module:enableChromecast} has been called. If you would\n    * like to specify the order of the buttons that appear in the control bar, including\n    * this button, you can do so in the options that you pass to the `videojs` function\n    * when creating a player:\n    *\n    * ```\n    * videojs('playerID', {\n    *    controlBar: {\n    *       children: [\n    *          'playToggle',\n    *          'progressControl',\n    *          'volumePanel',\n    *          'fullscreenToggle',\n    *          'chromecastButton',\n    *       ],\n    *    }\n    * });\n    * ```\n    *\n    * @param videojs {object} A reference to {@link http://docs.videojs.com/module-videojs.html|Video.js}\n    * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n    */\n\n   /**\n    * The Video.js Button class is the base class for UI button components.\n    *\n    * @external Button\n    * @see {@link http://docs.videojs.com/Button.html|Button}\n    */\n   const ButtonComponent = videojs.getComponent('Button');\n\n   /**\n    * The ChromecastButton module contains both the ChromecastButton class definition and\n    * the function used to register the button as a Video.js Component.\n    * @module ChromecastButton\n    */\n\n\n   /** @lends ChromecastButton.prototype **/\n   class ChromecastButton extends ButtonComponent {\n\n      /**\n       * This class is a button component designed to be displayed in the\n       * player UI's control bar. It opens the Chromecast menu when clicked.\n       *\n       * @constructs\n       * @extends external:Button\n       * @param player {Player} the video.js player instance\n       */\n      constructor(player, options) {\n         super(player, options);\n\n         player.on('chromecastConnected', this._onChromecastConnected.bind(this));\n         player.on('chromecastDisconnected', this._onChromecastDisconnected.bind(this));\n         player.on('chromecastDevicesAvailable', this._onChromecastDevicesAvailable.bind(this));\n         player.on('chromecastDevicesUnavailable', this._onChromecastDevicesUnavailable.bind(this));\n\n         // Use the initial state of `hasAvailableDevices` to call the corresponding event\n         // handlers because the corresponding events may have already been emitted before\n         // binding the listeners above.\n         if (player.chromecastSessionManager && player.chromecastSessionManager.hasAvailableDevices()) {\n            this._onChromecastDevicesAvailable();\n         } else {\n            this._onChromecastDevicesUnavailable();\n         }\n\n         if (options.addCastLabelToButton) {\n            this.el().classList.add('vjs-chromecast-button-lg');\n\n            this._labelEl = document.createElement('span');\n            this._labelEl.classList.add('vjs-chromecast-button-label');\n            this._updateCastLabelText();\n\n            this.el().appendChild(this._labelEl);\n         } else {\n            this.controlText('Open Chromecast menu');\n         }\n      }\n\n      /**\n       * Overrides Button#buildCSSClass to return the classes used on the button element.\n       *\n       * @param el {DOMElement}\n       * @see {@link http://docs.videojs.com/Button.html#buildCSSClass|Button#buildCSSClass}\n       */\n      buildCSSClass() {\n         return 'vjs-chromecast-button ' +\n            (this._isChromecastConnected ? 'vjs-chromecast-casting-state ' : '') +\n            (this.options_.addCastLabelToButton ? 'vjs-chromecast-button-lg ' : '') +\n            ButtonComponent.prototype.buildCSSClass();\n      }\n\n      /**\n       * Overrides Button#handleClick to handle button click events. Chromecast\n       * functionality is handled outside of this class, which should be limited\n       * to UI related logic.  This function simply triggers an event on the player.\n       *\n       * @fires ChromecastButton#chromecastRequested\n       * @param el {DOMElement}\n       * @see {@link http://docs.videojs.com/Button.html#handleClick|Button#handleClick}\n       */\n      handleClick() {\n         this.player().trigger('chromecastRequested');\n      }\n\n      /**\n       * Handles `chromecastConnected` player events.\n       *\n       * @private\n       */\n      _onChromecastConnected() {\n         this._isChromecastConnected = true;\n         this._reloadCSSClasses();\n         this._updateCastLabelText();\n      }\n\n      /**\n       * Handles `chromecastDisconnected` player events.\n       *\n       * @private\n       */\n      _onChromecastDisconnected() {\n         this._isChromecastConnected = false;\n         this._reloadCSSClasses();\n         this._updateCastLabelText();\n      }\n\n      /**\n       * Handles `chromecastDevicesAvailable` player events.\n       *\n       * @private\n       */\n      _onChromecastDevicesAvailable() {\n         this.show();\n      }\n\n      /**\n       * Handles `chromecastDevicesUnavailable` player events.\n       *\n       * @private\n       */\n      _onChromecastDevicesUnavailable() {\n         this.hide();\n      }\n\n      /**\n       * Re-calculates which CSS classes the button needs and sets them on the buttons'\n       * DOMElement.\n       *\n       * @private\n       */\n      _reloadCSSClasses() {\n         if (!this.el_) {\n            return;\n         }\n         this.el_.className = this.buildCSSClass();\n      }\n\n      /**\n       * Updates the optional cast label text based on whether the chromecast is connected\n       * or disconnected.\n       *\n       * @private\n       */\n      _updateCastLabelText() {\n         if (!this._labelEl) {\n            return;\n         }\n         this._labelEl.textContent = this._isChromecastConnected ? this.localize('Disconnect Cast') : this.localize('Cast');\n      }\n   }\n\n   videojs.registerComponent('chromecastButton', ChromecastButton);\n};\n","/**\n * @module enableChromecast\n */\n\nvar ChromecastSessionManager = require('./chromecast/ChromecastSessionManager'),\n    CHECK_AVAILABILITY_INTERVAL = 1000, // milliseconds\n    CHECK_AVAILABILITY_TIMEOUT = 30 * 1000; // milliseconds\n\n\n/**\n * Configures the Chromecast\n * [casting context](https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext),\n * which is required before casting.\n *\n * @private\n * @param options {object} the plugin options\n */\nfunction configureCastContext(options) {\n   var context = cast.framework.CastContext.getInstance();\n\n   context.setOptions({\n      receiverApplicationId: options.receiverAppID || chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,\n      // Setting autoJoinPolicy to ORIGIN_SCOPED prevents this plugin from automatically\n      // trying to connect to a preexisting Chromecast session, if one exists. The user\n      // must end any existing session before trying to cast from this player instance.\n      autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,\n   });\n}\n\n/**\n * Handles the `chromecastRequested` event. Delegates to a `chromecastSessionManager`\n * instance.\n *\n * @private\n * @param player {object} a Video.js player instance\n */\nfunction onChromecastRequested(player) {\n   player.chromecastSessionManager.openCastMenu();\n}\n\n/**\n * Adds the Chromecast button to the player's control bar, if one does not already exist,\n * then starts listening for the `chromecastRequested` event.\n *\n * @private\n * @param player {object} a Video.js player instance\n * @param options {object} the plugin options\n */\nfunction setUpChromecastButton(player, options) {\n   var indexOpt;\n\n   // Ensure Chromecast button exists\n   if (options.addButtonToControlBar && !player.controlBar.getChild('chromecastButton')) {\n      // Figure out Chromecast button's index\n      indexOpt = player.controlBar.children().length;\n      if (typeof options.buttonPositionIndex !== 'undefined') {\n         indexOpt = options.buttonPositionIndex >= 0\n            ? options.buttonPositionIndex\n            : player.controlBar.children().length + options.buttonPositionIndex;\n      }\n      player.controlBar.addChild('chromecastButton', options, indexOpt);\n   }\n   // Respond to requests for casting. The ChromecastButton component triggers this event\n   // when the user clicks the Chromecast button.\n   player.on('chromecastRequested', onChromecastRequested.bind(null, player));\n}\n\n/**\n * Creates a {@link ChromecastSessionManager} and assigns it to the player.\n *\n * @private\n * @param player {object} a Video.js player instance\n */\nfunction createSessionManager(player) {\n   if (!player.chromecastSessionManager) {\n      player.chromecastSessionManager = new ChromecastSessionManager(player);\n   }\n}\n\n/**\n * Sets up and configures the casting context and Chromecast button.\n *\n * @private\n * @param options {object} the plugin options\n */\nfunction enableChromecast(player, options) {\n   configureCastContext(options);\n   createSessionManager(player);\n   setUpChromecastButton(player, options);\n}\n\n/**\n * Waits for the Chromecast APIs to become available, then configures the casting context\n * and configures the Chromecast button. The Chromecast APIs are loaded asynchronously,\n * so we must wait until they are available before initializing the casting context and\n * Chromecast button.\n *\n * @private\n * @param player {object} a Video.js player instance\n * @param options {object} the plugin options\n */\nfunction waitUntilChromecastAPIsAreAvailable(player, options) {\n   var maxTries = CHECK_AVAILABILITY_TIMEOUT / CHECK_AVAILABILITY_INTERVAL,\n       tries = 1,\n       intervalID;\n\n   // The Chromecast APIs are loaded asynchronously, so they may not be loaded and\n   // initialized at this point. The Chromecast APIs do provide a callback function that\n   // is called after the framework has loaded, but it requires you to define the callback\n   // function **before** loading the APIs. That would require us to expose some callback\n   // function to `window` here, and would require users of this plugin to define a\n   // Chromecast API callback on `window` that calls our callback function in their HTML\n   // file. To avoid all of this, we simply check to see if the Chromecast API is\n   // available periodically, and stop after a timeout threshold has passed.\n   //\n   // See https://developers.google.com/cast/docs/chrome_sender_integrate#initialization\n   intervalID = setInterval(function() {\n      if (tries > maxTries) {\n         clearInterval(intervalID);\n         return;\n      }\n      if (ChromecastSessionManager.isChromecastAPIAvailable()) {\n         clearInterval(intervalID);\n         enableChromecast(player, options);\n      }\n      tries = tries + 1;\n   }, CHECK_AVAILABILITY_INTERVAL);\n\n}\n\n/**\n * Registers the Chromecast plugin with Video.js. Calls\n * [videojs#registerPlugin](http://docs.videojs.com/module-videojs.html#~registerPlugin),\n * which will add a plugin function called `chromecast` to any instance of a Video.js\n * player that is created after calling this function. Call `player.chromecast(options)`,\n * passing in configuration options, to enable the Chromecast plugin on your Player\n * instance.\n *\n * Currently, there are only two configuration options:\n *\n *    * **`receiverAppID`** - the string ID of a [Chromecast receiver\n *      app](https://developers.google.com/cast/docs/receiver_apps) to use. Defaults to\n *      the [default Media Receiver\n *      ID](https://developers.google.com/cast/docs/receiver_apps#default).\n *    * **`addButtonToControlBar`** - flag that tells the plugin\n *      whether or not it should automatically add the Chromecast button the the Video.js\n *      player's control bar component. Defaults to `true`.\n *\n * Other configuration options are set through the player's Chromecast Tech configuration:\n *\n * ```\n * var playerOptions, player, pluginOptions;\n *\n * playerOptions = {\n *    chromecast: {\n *       requestTitleFn: function(source) {\n *          return titles[source.url];\n *       },\n *       requestSubtitleFn: function(source) {\n *          return subtitles[source.url];\n *       },\n *       requestCustomDataFn: function(source) {\n *          return customData[source.url];\n *       }\n *    }\n * };\n *\n * pluginOptions = {\n *    receiverAppID: '1234',\n *    addButtonToControlBar: false,\n * };\n *\n * player = videojs(document.getElementById('myVideoElement'), playerOptions);\n * player.chromecast(pluginOptions); // initializes the Chromecast plugin\n * ```\n *\n * @param {object} videojs\n * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n */\nmodule.exports = function(videojs) {\n   videojs.registerPlugin('chromecast', function(options) {\n      var pluginOptions = Object.assign({ addButtonToControlBar: true }, options || {});\n\n      // `this` is an instance of a Video.js Player.\n      // Wait until the player is \"ready\" so that the player's control bar component has\n      // been created.\n      this.ready(function() {\n         if (!this.controlBar) {\n            return;\n         }\n         if (ChromecastSessionManager.isChromecastAPIAvailable()) {\n            enableChromecast(this, pluginOptions);\n         } else {\n            waitUntilChromecastAPIsAreAvailable(this, pluginOptions);\n         }\n      }.bind(this));\n   });\n};\n","/* eslint-disable global-require */\nvar preloadWebComponents = require('./preloadWebComponents'),\n    createChromecastButton = require('./components/ChromecastButton'),\n    createChromecastTech = require('./tech/ChromecastTech'),\n    enableChromecast = require('./enableChromecast');\n\n/**\n * @module index\n */\n\n/**\n * Registers the Chromecast plugin and ChromecastButton Component with Video.js. See\n * {@link module:ChromecastButton} and {@link module:enableChromecast} for more details\n * about how the plugin and button are registered and configured.\n *\n * @param videojs {object} the videojs library. If `undefined`, this plugin\n * will look to `window.videojs`.\n * @param userOpts {object} the options to use for configuration\n * @see module:enableChromecast\n * @see module:ChromecastButton\n */\nmodule.exports = function(videojs, userOpts) {\n   var options = Object.assign({ preloadWebComponents: false }, userOpts);\n\n   if (options.preloadWebComponents) {\n      preloadWebComponents();\n   }\n\n   videojs = videojs || window.videojs;\n   createChromecastButton(videojs);\n   createChromecastTech(videojs);\n   enableChromecast(videojs);\n};\n","function doesUserAgentContainString(str) {\n   return typeof window.navigator.userAgent === 'string' && window.navigator.userAgent.indexOf(str) >= 0;\n}\n\n// For information as to why this is needed, please see:\n// https://github.com/silvermine/videojs-chromecast/issues/17\n// https://github.com/silvermine/videojs-chromecast/issues/22\n\nmodule.exports = function() {\n   var needsWebComponents = !document.registerElement,\n       iosChrome = doesUserAgentContainString('CriOS'),\n       androidChrome;\n\n   androidChrome = doesUserAgentContainString('Android')\n      && doesUserAgentContainString('Chrome/')\n      && window.navigator.presentation;\n\n   // These checks are based on the checks found in `cast_sender.js` which\n   // determine if `cast_framework.js` needs to be loaded\n   if ((androidChrome || iosChrome) && needsWebComponents) {\n      // This is requiring webcomponents.js@0.7.24 because that's what was used\n      // by the Chromecast framework at the time this was added.\n      // We are using webcomponents-lite.js because it doesn't interfere with jQuery as\n      // badly (e.g. it doesn't interfere with jQuery's fix for consistently bubbling\n      // events, see #21). While the \"lite\" version does not include the shadow DOM\n      // polyfills that the Chromecast framework may need for the <google-cast-button>\n      // component to work properly, this plugin does not use the <google-cast-button>\n      // component.\n      require('webcomponents.js/webcomponents-lite.js'); // eslint-disable-line global-require\n   }\n};\n","var ChromecastSessionManager = require('../chromecast/ChromecastSessionManager'),\n    ChromecastTechUI = require('./ChromecastTechUI');\n\n/**\n * Registers the ChromecastTech Tech with Video.js. Calls {@link\n * http://docs.videojs.com/Tech.html#.registerTech}, which will add a Tech called\n * `chromecast` to the list of globally registered Video.js Tech implementations.\n *\n * [Video.js Tech](http://docs.videojs.com/Tech.html) are initialized and used\n * automatically by Video.js Player instances. Whenever a new source is set on the player,\n * the player iterates through the list of available Tech to determine which to use to\n * play the source.\n *\n * @param videojs {object} A reference to\n * {@link http://docs.videojs.com/module-videojs.html|Video.js}\n * @see http://docs.videojs.com/Tech.html#.registerTech\n */\nmodule.exports = function(videojs) {\n   var Tech = videojs.getComponent('Tech'),\n       SESSION_TIMEOUT = 10 * 1000; // milliseconds\n\n   /**\n    * @module ChomecastTech\n    */\n\n   /**\n    * The Video.js Tech class is the base class for classes that provide media playback\n    * technology implementations to Video.js such as HTML5, Flash and HLS.\n    *\n    * @external Tech\n    * @see {@link http://docs.videojs.com/Tech.html|Tech}\n    */\n\n   /** @lends ChromecastTech.prototype */\n   class ChromecastTech extends Tech {\n\n      /**\n       * Implements Video.js playback {@link http://docs.videojs.com/tutorial-tech_.html|Tech}\n       * for {@link https://developers.google.com/cast/|Google's Chromecast}.\n       *\n       * @constructs ChromecastTech\n       * @extends external:Tech\n       * @param options {object} The options to use for configuration\n       * @see {@link https://developers.google.com/cast/|Google Cast}\n       */\n      constructor(options) {\n         super(options);\n\n         this.featuresVolumeControl = true;\n         this.featuresPlaybackRate = false;\n         this.movingMediaElementInDOM = false;\n         this.featuresFullscreenResize = true;\n         this.featuresTimeupdateEvents = true;\n         this.featuresProgressEvents = false;\n         // Text tracks are not supported in this version\n         this.featuresNativeTextTracks = false;\n         this.featuresNativeAudioTracks = false;\n         this.featuresNativeVideoTracks = false;\n\n         // Give ChromecastTech class instances a reference to videojs\n         this.videojs = videojs;\n         this._eventListeners = [];\n\n         this.videojsPlayer = this.videojs(options.playerId);\n         this._chromecastSessionManager = this.videojsPlayer.chromecastSessionManager;\n\n         this._ui.updatePoster(this.videojsPlayer.poster());\n\n         this._remotePlayer = this._chromecastSessionManager.getRemotePlayer();\n         this._remotePlayerController = this._chromecastSessionManager.getRemotePlayerController();\n         this._listenToPlayerControllerEvents();\n         this.on('dispose', this._removeAllEventListeners.bind(this));\n\n         this._hasPlayedAnyItem = false;\n         this._requestTitle = options.requestTitleFn || function() { /* noop */ };\n         this._requestSubtitle = options.requestSubtitleFn || function() { /* noop */ };\n         this._requestCustomData = options.requestCustomDataFn || function() { /* noop */ };\n         this._modifyLoadRequestFn = options.modifyLoadRequestFn || function(request) {\n            return request;\n         };\n         // See `currentTime` function\n         this._initialStartTime = options.startTime || 0;\n\n         this._playSource(options.source, this._initialStartTime);\n         this.ready(function() {\n            this.setMuted(options.muted);\n         }.bind(this));\n      }\n\n      /**\n       * Creates a DOMElement that Video.js displays in its player UI while this Tech is\n       * active.\n       *\n       * @returns {DOMElement}\n       * @see {@link http://docs.videojs.com/Tech.html#createEl}\n       */\n      createEl() {\n         // We have to initialize the UI here, because the super.constructor\n         // calls `createEl`, which references `this._ui`.\n         this._ui = this._ui || new ChromecastTechUI();\n\n         return this._ui.getDOMElement();\n      }\n\n      /**\n       * Resumes playback if a media item is paused or restarts an item from\n       * its beginning if the item has played and ended.\n       *\n       * @see {@link http://docs.videojs.com/Player.html#play}\n       */\n      play() {\n         if (!this.paused()) {\n            return;\n         }\n         if (this.ended() && !this._isMediaLoading) {\n            // Restart the current item from the beginning\n            this._playSource({ src: this.videojsPlayer.src() }, 0);\n         } else {\n            this._remotePlayerController.playOrPause();\n         }\n      }\n\n      /**\n       * Pauses playback if the player is not already paused and if the current media item\n       * has not ended yet.\n       *\n       * @see {@link http://docs.videojs.com/Player.html#pause}\n       */\n      pause() {\n         if (!this.paused() && this._remotePlayer.canPause) {\n            this._remotePlayerController.playOrPause();\n         }\n      }\n\n      /**\n       * Returns whether or not the player is \"paused\". Video.js'\n       * definition of \"paused\" is \"playback paused\" OR \"not playing\".\n       *\n       * @returns {boolean} true if playback is paused\n       * @see {@link http://docs.videojs.com/Player.html#paused}\n       */\n      paused() {\n         return this._remotePlayer.isPaused || this.ended() || this._remotePlayer.playerState === null;\n      }\n\n      /**\n       * Stores the given source and begins playback, starting at the beginning\n       * of the media item.\n       *\n       * @param source {object} the source to store and play\n       * @see {@link http://docs.videojs.com/Player.html#src}\n       */\n      setSource(source) {\n         if (this._currentSource && this._currentSource.src === source.src && this._currentSource.type === source.type) {\n            // Skip setting the source if the `source` argument is the\n            // same as what's already been set. This `setSource` function\n            // calls `this._playSource` which sends a \"load media\" request\n            // to the Chromecast PlayerController. Because this function\n            // may be called multiple times in rapid succession with the same `source`\n            // argument, we need to de-duplicate calls with the same `source` argument to\n            // prevent overwhelming the Chromecast PlayerController with expensive \"load\n            // media\" requests, which it itself does not de-duplicate.\n            return;\n         }\n         // We cannot use `this.videojsPlayer.currentSource()` because the\n         // value returned by that function is not the same as what's returned\n         // by the Video.js Player's middleware after they are run. Also, simply\n         // using `this.videojsPlayer.src()` does not include mimetype information\n         // which we pass to the Chromecast player.\n         this._currentSource = source;\n         this._playSource(source, 0);\n      }\n\n      /**\n       * Plays the given source, beginning at an optional starting time.\n       *\n       * @private\n       * @param source {object} the source to play\n       * @param [startTime] The time to start playback at, in seconds\n       * @see {@link http://docs.videojs.com/Player.html#src}\n       */\n      _playSource(source, startTime) {\n         var castSession = this._getCastSession(),\n             mediaInfo = new chrome.cast.media.MediaInfo(source.src, source.type),\n             title = this._requestTitle(source),\n             subtitle = this._requestSubtitle(source),\n             poster = this.poster(),\n             customData = this._requestCustomData(source),\n             request;\n\n         this.trigger('waiting');\n         this._clearSessionTimeout();\n\n         mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();\n         mediaInfo.metadata.metadataType = chrome.cast.media.MetadataType.GENERIC;\n         mediaInfo.metadata.title = title;\n         mediaInfo.metadata.subtitle = subtitle;\n         mediaInfo.streamType = this.videojsPlayer.liveTracker && this.videojsPlayer.liveTracker.isLive()\n            ? chrome.cast.media.StreamType.LIVE\n            : chrome.cast.media.StreamType.BUFFERED;\n\n         if (poster) {\n            mediaInfo.metadata.images = [ { url: poster } ];\n         }\n         if (customData) {\n            mediaInfo.customData = customData;\n         }\n\n         this._ui.updateTitle(title);\n         this._ui.updateSubtitle(subtitle);\n\n         request = new chrome.cast.media.LoadRequest(mediaInfo);\n         request.autoplay = true;\n         request.currentTime = startTime;\n         request = this._modifyLoadRequestFn(request);\n\n         this._isMediaLoading = true;\n         this._hasPlayedCurrentItem = false;\n         castSession.loadMedia(request)\n            .then(function() {\n               this._clearSessionTimeout();\n               if (!this._hasPlayedAnyItem) {\n                  // `triggerReady` is required here to notify the Video.js\n                  // player that the Tech has been initialized and is ready.\n                  this.triggerReady();\n               }\n               this.trigger('loadstart');\n               this.trigger('loadeddata');\n               this.trigger('play');\n               this.trigger('playing');\n               this._hasPlayedAnyItem = true;\n               this._isMediaLoading = false;\n               this._getMediaSession().addUpdateListener(this._onMediaSessionStatusChanged.bind(this));\n            }.bind(this), this._triggerErrorEvent.bind(this));\n      }\n\n      /**\n       * Manually updates the current time. The playback position will jump to\n       * the given time and continue playing if the item was playing when `setCurrentTime`\n       * was called, or remain paused if the item was paused.\n       *\n       * @param time {number} the playback time position to jump to\n       * @see {@link http://docs.videojs.com/Tech.html#setCurrentTime}\n       */\n      setCurrentTime(time) {\n         var duration = this.duration();\n\n         if (time > duration || !this._remotePlayer.canSeek) {\n            return;\n         }\n         // Seeking to any place within (approximately) 1 second of the end of the item\n         // causes the Video.js player to get stuck in a BUFFERING state. To work around\n         // this, we only allow seeking to within 1 second of the end of an item.\n         this._remotePlayer.currentTime = Math.min(duration - 1, time);\n         this._remotePlayerController.seek();\n         this._triggerTimeUpdateEvent();\n      }\n\n      /**\n       * Returns the current playback time position.\n       *\n       * @returns {number} the current playback time position\n       * @see {@link http://docs.videojs.com/Player.html#currentTime}\n       */\n      currentTime() {\n         // There is a brief period of time when Video.js has switched to the chromecast\n         // Tech, but chromecast has not yet loaded its first media item. During\n         // that time, Video.js calls this `currentTime` function to update\n         // its player UI. In that period, `this._remotePlayer.currentTime`\n         // will be 0 because the media has not loaded yet. To prevent the\n         // UI from using a 0 second currentTime, we use the currentTime passed\n         // in to the first media item that was provided to the Tech until\n         // chromecast plays its first item.\n         if (!this._hasPlayedAnyItem) {\n            return this._initialStartTime;\n         }\n         return this._remotePlayer.currentTime;\n      }\n\n      /**\n       * Returns the duration of the current media item, or `0` if the source\n       * is not set or if the duration of the item is not available from the\n       * Chromecast API yet.\n       *\n       * @returns {number} the duration of the current media item\n       * @see {@link http://docs.videojs.com/Player.html#duration}\n       */\n      duration() {\n         // There is a brief period of time when Video.js has switched to the chromecast\n         // Tech, but chromecast has not yet loaded its first media item.\n         // During that time, Video.js calls this `duration` function to update its player\n         // UI. In that period, `this._remotePlayer.duration` will be 0 because the media\n         // has not loaded yet. To prevent the UI from using a 0 second duration, we\n         // use the duration passed in to the first media item that was provided to\n         // the Tech until chromecast plays its first item.\n         if (!this._hasPlayedAnyItem) {\n            return this.videojsPlayer.duration();\n         }\n         return this._remotePlayer.duration;\n      }\n\n      /**\n       * Returns whether or not the current media item has finished playing.\n       * Returns `false` if a media item has not been loaded, has not been played,\n       * or has not yet finished playing.\n       *\n       * @returns {boolean} true if the current media item has finished playing\n       * @see {@link http://docs.videojs.com/Player.html#ended}\n       */\n      ended() {\n         var mediaSession = this._getMediaSession();\n\n         if (!mediaSession && this._hasMediaSessionEnded) {\n            return true;\n         }\n\n         return mediaSession ? (mediaSession.idleReason === chrome.cast.media.IdleReason.FINISHED) : false;\n      }\n\n      /**\n       * Returns the current volume level setting as a decimal number between `0` and `1`.\n       *\n       * @returns {number} the current volume level\n       * @see {@link http://docs.videojs.com/Player.html#volume}\n       */\n      volume() {\n         return this._remotePlayer.volumeLevel;\n      }\n\n      /**\n       * Sets the current volume level. Volume level is a decimal number\n       * between `0` and `1`, where `0` is muted and `1` is the loudest volume level.\n       *\n       * @param volumeLevel {number}\n       * @returns {number} the current volume level\n       * @see {@link http://docs.videojs.com/Player.html#volume}\n       */\n      setVolume(volumeLevel) {\n         this._remotePlayer.volumeLevel = volumeLevel;\n         this._remotePlayerController.setVolumeLevel();\n         // This event is triggered by the listener on\n         // `RemotePlayerEventType.VOLUME_LEVEL_CHANGED`, but waiting for\n         // that event to fire in response to calls to `setVolume` introduces\n         // noticeable lag in the updating of the player UI's volume slider bar,\n         // which makes user interaction with the volume slider choppy.\n         this._triggerVolumeChangeEvent();\n      }\n\n      /**\n       * Returns whether or not the player is currently muted.\n       *\n       * @returns {boolean} true if the player is currently muted\n       * @see {@link http://docs.videojs.com/Player.html#muted}\n       */\n      muted() {\n         return this._remotePlayer.isMuted;\n      }\n\n      /**\n       * Mutes or un-mutes the player. Does nothing if the player is currently\n       * muted and the `isMuted` parameter is true or if the player is not muted and\n       * `isMuted` is false.\n       *\n       * @param isMuted {boolean} whether or not the player should be muted\n       * @see {@link http://docs.videojs.com/Html5.html#setMuted} for an example\n       */\n      setMuted(isMuted) {\n         if ((this._remotePlayer.isMuted && !isMuted) || (!this._remotePlayer.isMuted && isMuted)) {\n            this._remotePlayerController.muteOrUnmute();\n         }\n      }\n\n      /**\n       * Gets the URL to the current poster image.\n       *\n       * @returns {string} URL to the current poster image or `undefined` if none exists\n       * @see {@link http://docs.videojs.com/Player.html#poster}\n       */\n      poster() {\n         return this._ui.getPoster();\n      }\n\n      /**\n       * Sets the URL to the current poster image. The poster image shown\n       * in the Chromecast Tech UI view is updated with this new URL.\n       *\n       * @param poster {string} the URL to the new poster image\n       * @see {@link http://docs.videojs.com/Tech.html#setPoster}\n       */\n      setPoster(poster) {\n         this._ui.updatePoster(poster);\n      }\n\n      /**\n       * This function is \"required\" when implementing {@link external:Tech}\n       * and is supposed to return a mock\n       * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|TimeRanges}\n       * object that represents the portions of the current media item that have been\n       * buffered. However, the Chromecast API does not currently provide a way\n       * to determine how much the media item has buffered, so we always\n       * return `undefined`.\n       *\n       * Returning `undefined` is safe: the player will simply not display\n       * the buffer amount indicator in the scrubber UI.\n       *\n       * @returns {undefined} always returns `undefined`\n       * @see {@link http://docs.videojs.com/Player.html#buffered}\n       */\n      buffered() {\n         return undefined;\n      }\n\n      /**\n       * This function is \"required\" when implementing {@link external:Tech}\n       * and is supposed to return a mock\n       * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|TimeRanges}\n       * object that represents the portions of the current media item that has playable\n       * content. However, the Chromecast API does not currently provide a\n       * way to determine how much the media item has playable content, so\n       * we'll just assume the entire video is an available seek target.\n       *\n       * The risk here lies with live streaming, where there may exist a sliding window of\n       * playable content and seeking is only possible within the last X number of\n       * minutes, rather than for the entire video.\n       *\n       * Unfortunately we have no way of detecting when this is the case. Returning\n       * anything other than the full range of the video means that we lose the ability\n       * to seek during VOD.\n       *\n       * @returns {TimeRanges} always returns a `TimeRanges` object with one\n       * `TimeRange` that starts at `0` and ends at the `duration` of the\n       * current media item\n       * @see {@link http://docs.videojs.com/Player.html#seekable}\n       */\n      seekable() {\n         // TODO Investigate if there's a way to detect\n         // if the source is live, so that we can\n         // possibly adjust the seekable `TimeRanges` accordingly.\n         return this.videojs.createTimeRange(0, this.duration());\n      }\n\n      /**\n       * Returns whether the native media controls should be shown (`true`) or hidden\n       * (`false`). Not applicable to this Tech.\n       *\n       * @returns {boolean} always returns `false`\n       * @see {@link http://docs.videojs.com/Html5.html#controls} for an example\n       */\n      controls() {\n         return false;\n      }\n\n      /**\n       * Returns whether or not the browser should show the player\n       * \"inline\" (non-fullscreen) by default. This function always\n       * returns true to tell the browser that non-fullscreen playback is preferred.\n       *\n       * @returns {boolean} always returns `true`\n       * @see {@link http://docs.videojs.com/Html5.html#playsinline} for an example\n       */\n      playsinline() {\n         return true;\n      }\n\n      /**\n       * Returns whether or not fullscreen is supported by this Tech.\n       * Always returns `true` because fullscreen is always supported.\n       *\n       * @returns {boolean} always returns `true`\n       * @see {@link http://docs.videojs.com/Html5.html#supportsFullScreen} for an example\n       */\n      supportsFullScreen() {\n         return true;\n      }\n\n      /**\n       * Sets a flag that determines whether or not the media should automatically begin\n       * playing on page load. This is not supported because a Chromecast session must be\n       * initiated by casting via the casting menu and cannot autoplay.\n       *\n       * @see {@link http://docs.videojs.com/Html5.html#setAutoplay} for an example\n       */\n      setAutoplay() {\n         // Not supported\n      }\n\n      /**\n       * @returns {number} the chromecast player's playback rate, if available. Otherwise,\n       * the return value defaults to `1`.\n       */\n      playbackRate() {\n         var mediaSession = this._getMediaSession();\n\n         return mediaSession ? mediaSession.playbackRate : 1;\n      }\n\n      /**\n       * Does nothing. Changing the playback rate is not supported.\n       */\n      setPlaybackRate() {\n         // Not supported\n      }\n\n      /**\n       * Does nothing. Satisfies calls to the missing preload method.\n       */\n      preload() {\n         // Not supported\n      }\n\n      /**\n       * Causes the Tech to begin loading the current source. `load`\n       * is not supported in this ChromecastTech because setting the\n       * source on the `Chromecast` automatically causes it to begin loading.\n       */\n      load() {\n         // Not supported\n      }\n\n      /**\n       * Gets the Chromecast equivalent of HTML5 Media Element's `readyState`.\n       *\n       * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n       */\n      readyState() {\n         if (this._remotePlayer.playerState === 'IDLE' || this._remotePlayer.playerState === 'BUFFERING') {\n            return 0; // HAVE_NOTHING\n         }\n         return 4;\n      }\n\n      /**\n       * Wires up event listeners for\n       * [RemotePlayerController](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController)\n       * events.\n       *\n       * @private\n       */\n      _listenToPlayerControllerEvents() {\n         var eventTypes = cast.framework.RemotePlayerEventType;\n\n         this._addEventListener(this._remotePlayerController, eventTypes.PLAYER_STATE_CHANGED, this._onPlayerStateChanged, this);\n         this._addEventListener(this._remotePlayerController, eventTypes.VOLUME_LEVEL_CHANGED, this._triggerVolumeChangeEvent, this);\n         this._addEventListener(this._remotePlayerController, eventTypes.IS_MUTED_CHANGED, this._triggerVolumeChangeEvent, this);\n         this._addEventListener(this._remotePlayerController, eventTypes.CURRENT_TIME_CHANGED, this._triggerTimeUpdateEvent, this);\n         this._addEventListener(this._remotePlayerController, eventTypes.DURATION_CHANGED, this._triggerDurationChangeEvent, this);\n      }\n\n      /**\n       * Registers an event listener on the given target object.\n       * Because many objects in the Chromecast API are either singletons\n       * or must be shared between instances of `ChromecastTech` for the\n       * lifetime of the player, we must unbind the listeners when this Tech\n       * instance is destroyed to prevent memory leaks. To do that, we need to keep\n       * a reference to listeners that are added to global objects so that we can\n       * use those references to remove the listener when this Tech is destroyed.\n       *\n       * @param target {object} the object to register the event listener on\n       * @param type {string} the name of the event\n       * @param callback {Function} the listener's callback function that\n       * executes when the event is emitted\n       * @param context {object} the `this` context to use when executing the `callback`\n       * @private\n       */\n      _addEventListener(target, type, callback, context) {\n         var listener;\n\n         listener = {\n            target: target,\n            type: type,\n            callback: callback,\n            context: context,\n            listener: callback.bind(context),\n         };\n         target.addEventListener(type, listener.listener);\n         this._eventListeners.push(listener);\n      }\n\n      /**\n       * Removes all event listeners that were registered with global objects during the\n       * lifetime of this Tech. See {@link _addEventListener} for more information\n       * about why this is necessary.\n       *\n       * @private\n       */\n      _removeAllEventListeners() {\n         while (this._eventListeners.length > 0) {\n            this._removeEventListener(this._eventListeners[0]);\n         }\n         this._eventListeners = [];\n      }\n\n      /**\n       * Removes a single event listener that was registered with global objects\n       * during the lifetime of this Tech. See {@link _addEventListener} for\n       * more information about why this is necessary.\n       *\n       * @private\n       */\n      _removeEventListener(listener) {\n         var index = -1,\n             pass = false,\n             i;\n\n         listener.target.removeEventListener(listener.type, listener.listener);\n\n         for (i = 0; i < this._eventListeners.length; i++) {\n            pass = this._eventListeners[i].target === listener.target &&\n                  this._eventListeners[i].type === listener.type &&\n                  this._eventListeners[i].callback === listener.callback &&\n                  this._eventListeners[i].context === listener.context;\n\n            if (pass) {\n               index = i;\n               break;\n            }\n         }\n\n         if (index !== -1) {\n            this._eventListeners.splice(index, 1);\n         }\n      }\n\n      /**\n       * Handles Chromecast player state change events. The player may \"change state\" when\n       * paused, played, buffering, etc.\n       *\n       * @private\n       */\n      _onPlayerStateChanged() {\n         var states = chrome.cast.media.PlayerState,\n             playerState = this._remotePlayer.playerState;\n\n         if (playerState === states.PLAYING) {\n            this._hasPlayedCurrentItem = true;\n            this.trigger('play');\n            this.trigger('playing');\n         } else if (playerState === states.PAUSED) {\n            this.trigger('pause');\n         } else if ((playerState === states.IDLE && this.ended()) || (playerState === null && this._hasPlayedCurrentItem)) {\n            this._hasPlayedCurrentItem = false;\n            this._closeSessionOnTimeout();\n            this.trigger('ended');\n            this._triggerTimeUpdateEvent();\n         } else if (playerState === states.BUFFERING) {\n            this.trigger('waiting');\n         }\n      }\n\n      /**\n       * Handles Chromecast MediaSession state change events. The only property sent\n       * to this event is whether the session is alive. This is useful for determining\n       * if an item has ended as the MediaSession will fire this event with `false` then\n       * be immediately destroyed. This means that we cannot trust `idleReason` to show\n       * whether an item has ended since we may no longer have access to the MediaSession.\n       *\n       * @private\n       */\n      _onMediaSessionStatusChanged(isAlive) {\n         this._hasMediaSessionEnded = !!isAlive;\n      }\n\n      /**\n       * Ends the session after a certain number of seconds of inactivity.\n       *\n       * If the Chromecast player is in the \"IDLE\" state after an item has ended, and no\n       * further items are queued up to play, the session is considered inactive. Once a\n       * period of time (currently 10 seconds) has elapsed with no activity, we manually\n       * end the session to prevent long periods of a blank Chromecast screen that is\n       * shown at the end of item playback.\n       *\n       * @private\n       */\n      _closeSessionOnTimeout() {\n         // Ensure that there's never more than one session timeout active\n         this._clearSessionTimeout();\n         this._sessionTimeoutID = setTimeout(function() {\n            var castSession = this._getCastSession();\n\n            if (castSession) {\n               castSession.endSession(true);\n            }\n            this._clearSessionTimeout();\n         }.bind(this), SESSION_TIMEOUT);\n      }\n\n      /**\n       * Stops the timeout that is waiting during a period of inactivity in order to close\n       * the session.\n       *\n       * @private\n       * @see _closeSessionOnTimeout\n       */\n      _clearSessionTimeout() {\n         if (this._sessionTimeoutID) {\n            clearTimeout(this._sessionTimeoutID);\n            this._sessionTimeoutID = false;\n         }\n      }\n\n      /**\n       * @private\n       * @return {object} the current CastContext, if one exists\n       */\n      _getCastContext() {\n         return this._chromecastSessionManager.getCastContext();\n      }\n\n      /**\n       * @private\n       * @return {object} the current CastSession, if one exists\n       */\n      _getCastSession() {\n         return this._getCastContext().getCurrentSession();\n      }\n\n      /**\n       * @private\n       * @return {object} the current MediaSession, if one exists\n       * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media\n       */\n      _getMediaSession() {\n         var castSession = this._getCastSession();\n\n         return castSession ? castSession.getMediaSession() : null;\n      }\n\n      /**\n       * Triggers a 'volumechange' event\n       * @private\n       * @see http://docs.videojs.com/Player.html#event:volumechange\n       */\n      _triggerVolumeChangeEvent() {\n         this.trigger('volumechange');\n      }\n\n      /**\n       * Triggers a 'timeupdate' event\n       * @private\n       * @see http://docs.videojs.com/Player.html#event:timeupdate\n       */\n      _triggerTimeUpdateEvent() {\n         this.trigger('timeupdate');\n      }\n\n      /**\n       * Triggers a 'durationchange' event\n       * @private\n       * @see http://docs.videojs.com/Player.html#event:durationchange\n       */\n      _triggerDurationChangeEvent() {\n         this.trigger('durationchange');\n      }\n\n      /**\n       * Triggers an 'error' event\n       * @private\n       * @see http://docs.videojs.com/Player.html#event:error\n       */\n      _triggerErrorEvent() {\n         this.trigger('error');\n      }\n   }\n\n   // Required for Video.js Tech implementations.\n   // TODO Consider a more comprehensive check based on mimetype.\n   ChromecastTech.canPlaySource = () => {\n      return ChromecastSessionManager.isChromecastConnected();\n   };\n\n   ChromecastTech.isSupported = () => {\n      return ChromecastSessionManager.isChromecastConnected();\n   };\n\n   videojs.registerTech('chromecast', ChromecastTech);\n};\n","/**\n * This class represents the UI that is shown in the player while the Chromecast Tech is\n * active. The UI has a single root DOM element that displays the poster image of the\n * current item and title and subtitle. This class receives updates to the poster, title\n * and subtitle when the media item that the player is playing changes.\n *\n * @class ChromecastTechUI\n */\nclass ChromecastTechUI {\n   constructor() {\n      this._el = this._createDOMElement();\n   }\n\n   /**\n    * Creates and returns a single DOMElement that contains the UI. This implementation\n    * of the Chromecast Tech's UI displays a poster image, a title and a subtitle.\n    *\n    * @private\n    * @returns {DOMElement}\n    */\n   _createDOMElement() {\n      var el = this._createElement('div', 'vjs-tech vjs-tech-chromecast'),\n          posterContainerEl = this._createElement('div', 'vjs-tech-chromecast-poster'),\n          posterImageEl = this._createElement('img', 'vjs-tech-chromecast-poster-img'),\n          titleEl = this._createElement('div', 'vjs-tech-chromecast-title'),\n          subtitleEl = this._createElement('div', 'vjs-tech-chromecast-subtitle'),\n          titleContainer = this._createElement('div', 'vjs-tech-chromecast-title-container');\n\n      posterContainerEl.appendChild(posterImageEl);\n      titleContainer.appendChild(titleEl);\n      titleContainer.appendChild(subtitleEl);\n\n      el.appendChild(titleContainer);\n      el.appendChild(posterContainerEl);\n\n      return el;\n   }\n\n   /**\n    * A helper method for creating DOMElements of the given type and with the given class\n    * name(s).\n    *\n    * @param type {string} the kind of DOMElement to create (ex: 'div')\n    * @param className {string} the class name(s) to give to the DOMElement. May also be\n    * a space-delimited list of class names.\n    * @returns {DOMElement}\n    */\n   _createElement(type, className) {\n      var el = document.createElement(type);\n\n      el.className = className;\n      return el;\n   }\n\n   /**\n    * Gets the root DOMElement to be shown in the player's UI.\n    *\n    * @returns {DOMElement}\n    */\n   getDOMElement() {\n      return this._el;\n   }\n\n   /**\n    * Finds the poster's DOMElement in the root UI element.\n    *\n    * @private\n    * @returns {DOMElement}\n    */\n   _findPosterEl() {\n      return this._el.querySelector('.vjs-tech-chromecast-poster');\n   }\n\n   /**\n    * Finds the poster's <img> DOMElement in the root UI element.\n    *\n    * @private\n    * @returns {DOMElement}\n    */\n   _findPosterImageEl() {\n      return this._el.querySelector('.vjs-tech-chromecast-poster-img');\n   }\n\n   /**\n    * Finds the title's DOMElement in the root UI element.\n    *\n    * @private\n    * @returns {DOMElement}\n    */\n   _findTitleEl() {\n      return this._el.querySelector('.vjs-tech-chromecast-title');\n   }\n\n   /**\n    * Finds the subtitle's DOMElement in the root UI element.\n    *\n    * @private\n    * @returns {DOMElement}\n    */\n   _findSubtitleEl() {\n      return this._el.querySelector('.vjs-tech-chromecast-subtitle');\n   }\n\n   /**\n    * Sets the current poster image URL and updates the poster image DOMElement with the\n    * new poster image URL.\n    *\n    * @param poster {string} a URL for a poster image\n    */\n   updatePoster(poster) {\n      var posterImageEl = this._findPosterImageEl();\n\n      this._poster = poster ? poster : null;\n      if (poster) {\n         posterImageEl.setAttribute('src', poster);\n         posterImageEl.classList.remove('vjs-tech-chromecast-poster-img-empty');\n      } else {\n         posterImageEl.removeAttribute('src');\n         posterImageEl.classList.add('vjs-tech-chromecast-poster-img-empty');\n      }\n   }\n\n   /**\n    * Gets the current poster image URL.\n    *\n    * @returns {string} the URL for th current poster image\n    */\n   getPoster() {\n      return this._poster;\n   }\n\n   /**\n    * Sets the current title and updates the title's DOMElement with the new text.\n    *\n    * @param title {string} a title to show\n    */\n   updateTitle(title) {\n      var titleEl = this._findTitleEl();\n\n      this._title = title;\n      if (title) {\n         titleEl.innerHTML = title;\n         titleEl.classList.remove('vjs-tech-chromecast-title-empty');\n      } else {\n         titleEl.classList.add('vjs-tech-chromecast-title-empty');\n      }\n   }\n\n   /**\n    * Sets the current subtitle and updates the subtitle's DOMElement with the new text.\n    *\n    * @param subtitle {string} a subtitle to show\n    */\n   updateSubtitle(subtitle) {\n      var subtitleEl = this._findSubtitleEl();\n\n      this._subtitle = subtitle;\n      if (subtitle) {\n         subtitleEl.innerHTML = subtitle;\n         subtitleEl.classList.remove('vjs-tech-chromecast-subtitle-empty');\n      } else {\n         subtitleEl.classList.add('vjs-tech-chromecast-subtitle-empty');\n      }\n   }\n}\n\nmodule.exports = ChromecastTechUI;\n","'use strict'\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array<T> | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly<T>}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * Since we can not rely on `Object.assign` we provide a simplified version\n * that is sufficient for our needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n *\n * @returns {Object} target\n * @throws TypeError if target is not an object\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object')\n\t}\n\tfor (var key in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\ttarget[key] = source[key]\n\t\t}\n\t}\n\treturn target\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","var conventions = require(\"./conventions\");\nvar dom = require('./dom')\nvar entities = require('./entities');\nvar sax = require('./sax');\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\n/**\n * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:\n *\n * > XML parsed entities are often stored in computer files which,\n * > for editing convenience, are organized into lines.\n * > These lines are typically separated by some combination\n * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).\n * >\n * > To simplify the tasks of applications, the XML processor must behave\n * > as if it normalized all line breaks in external parsed entities (including the document entity)\n * > on input, before parsing, by translating all of the following to a single #xA character:\n * >\n * > 1. the two-character sequence #xD #xA\n * > 2. the two-character sequence #xD #x85\n * > 3. the single character #x85\n * > 4. the single character #x2028\n * > 5. any #xD character that is not immediately followed by #xA or #x85.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeLineEndings(input) {\n\treturn input\n\t\t.replace(/\\r[\\n\\u0085]/g, '\\n')\n\t\t.replace(/[\\r\\u0085\\u2028]/g, '\\n')\n}\n\n/**\n * @typedef Locator\n * @property {number} [columnNumber]\n * @property {number} [lineNumber]\n */\n\n/**\n * @typedef DOMParserOptions\n * @property {DOMHandler} [domBuilder]\n * @property {Function} [errorHandler]\n * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing\n * \t\t\t\t\t\tdefaults to `normalizeLineEndings`\n * @property {Locator} [locator]\n * @property {Record<string, string>} [xmlns]\n *\n * @see normalizeLineEndings\n */\n\n/**\n * The DOMParser interface provides the ability to parse XML or HTML source code\n * from a string into a DOM `Document`.\n *\n * _xmldom is different from the spec in that it allows an `options` parameter,\n * to override the default behavior._\n *\n * @param {DOMParserOptions} [options]\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization\n */\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax =  new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n  \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tvar normalize = options.normalizeLineEndings || normalizeLineEndings;\n\tif (source && typeof source === 'string') {\n\t\tsax.parse(\n\t\t\tnormalize(source),\n\t\t\tdefaultNSMap,\n\t\t\tentityMap\n\t\t)\n\t} else {\n\t\tsax.errorHandler.error('invalid doc source')\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n    this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n    \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n    \tif (this.locator) {\n        \tthis.doc.documentURI = this.locator.systemId;\n    \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t    var el = doc.createElementNS(namespaceURI, qName||localName);\n\t    var len = attrs.length;\n\t    appendElement(this, el);\n\t    this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t    for (var i = 0 ; i < len; i++) {\n\t        var namespaceURI = attrs.getURI(i);\n\t        var value = attrs.getValue(i);\n\t        var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t    }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t    var ins = this.doc.createProcessingInstruction(target, data);\n\t    this.locator && position(this.locator,ins)\n\t    appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t    if(this.locator = locator){// && !('lineNumber' in locator)){\n\t    \tlocator.lineNumber = 0;\n\t    }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t    var comm = this.doc.createComment(chars);\n\t    this.locator && position(this.locator,comm)\n\t    appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t    //used in characters() methods\n\t    this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t    this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t    if (impl && impl.createDocumentType) {\n\t        var dt = impl.createDocumentType(name, publicId, systemId);\n\t        this.locator && position(this.locator,dt)\n\t        appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t    }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n *  #comment(chars, start, length)\n *  #startCDATA()\n *  #endCDATA()\n *  #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n *  #endDTD()\n *  #startEntity(name)\n *  #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n *  #elementDecl(name, model)\n *  #externalEntityDecl(name, publicId, systemId)\n *  #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n *  #resolveEntity(String name,String publicId,String baseURI,String systemId)\n *  #resolveEntity(publicId, systemId)\n *  #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n *  #notationDecl(name, publicId, systemId) {};\n *  #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n    if (!hander.currentElement) {\n        hander.doc.appendChild(node);\n    } else {\n        hander.currentElement.appendChild(node);\n    }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.normalizeLineEndings = normalizeLineEndings;\nexports.DOMParser = DOMParser;\n","var conventions = require(\"./conventions\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record<string, boolean | undefined>} current\n * @param {string} element\n * @returns {Record<string, boolean | undefined>}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE                = NodeType.ELEMENT_NODE                = 1;\nvar ATTRIBUTE_NODE              = NodeType.ATTRIBUTE_NODE              = 2;\nvar TEXT_NODE                   = NodeType.TEXT_NODE                   = 3;\nvar CDATA_SECTION_NODE          = NodeType.CDATA_SECTION_NODE          = 4;\nvar ENTITY_REFERENCE_NODE       = NodeType.ENTITY_REFERENCE_NODE       = 5;\nvar ENTITY_NODE                 = NodeType.ENTITY_NODE                 = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE                = NodeType.COMMENT_NODE                = 8;\nvar DOCUMENT_NODE               = NodeType.DOCUMENT_NODE               = 9;\nvar DOCUMENT_TYPE_NODE          = NodeType.DOCUMENT_TYPE_NODE          = 10;\nvar DOCUMENT_FRAGMENT_NODE      = NodeType.DOCUMENT_FRAGMENT_NODE      = 11;\nvar NOTATION_NODE               = NodeType.NOTATION_NODE               = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR              = ExceptionCode.INDEX_SIZE_ERR              = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR          = ExceptionCode.DOMSTRING_SIZE_ERR          = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR       = ExceptionCode.HIERARCHY_REQUEST_ERR       = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR          = ExceptionCode.WRONG_DOCUMENT_ERR          = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR       = ExceptionCode.INVALID_CHARACTER_ERR       = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR         = ExceptionCode.NO_DATA_ALLOWED_ERR         = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR               = ExceptionCode.NOT_FOUND_ERR               = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR           = ExceptionCode.NOT_SUPPORTED_ERR           = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR         = ExceptionCode.INUSE_ATTRIBUTE_ERR         = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR        \t= ExceptionCode.INVALID_STATE_ERR        \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR               \t= ExceptionCode.SYNTAX_ERR               \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR            \t= ExceptionCode.NAMESPACE_ERR           \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR       \t= ExceptionCode.INVALID_ACCESS_ERR      \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index  unsigned long\n\t *   Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn this[index] || null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i<this.length;i++){\n\t\t\tserializeToString(this[i],buf,isHTML,nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t},\n\t/**\n\t * @private\n\t * @param {function (Node):boolean} predicate\n\t * @returns {Node[]}\n\t */\n\tfilter: function (predicate) {\n\t\treturn Array.prototype.filter.call(this, predicate);\n\t},\n\t/**\n\t * @private\n\t * @param {Node} item\n\t * @returns {number}\n\t */\n\tindexOf: function (item) {\n\t\treturn Array.prototype.indexOf.call(this, item);\n\t},\n};\n\nfunction LiveNodeList(node,refresh){\n\tthis._node = node;\n\tthis._refresh = refresh\n\t_updateLiveList(this);\n}\nfunction _updateLiveList(list){\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif(list._inc != inc){\n\t\tvar ls = list._refresh(list._node);\n\t\t//console.log(ls.length)\n\t\t__set__(list,'length',ls.length);\n\t\tcopy(ls,list);\n\t\tlist._inc = inc;\n\t}\n}\nLiveNodeList.prototype.item = function(i){\n\t_updateLiveList(this);\n\treturn this[i];\n}\n\n_extends(LiveNodeList,NodeList);\n\n/**\n * Objects implementing the NamedNodeMap interface are used\n * to represent collections of nodes that can be accessed by name.\n * Note that NamedNodeMap does not inherit from NodeList;\n * NamedNodeMaps are not maintained in any particular order.\n * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,\n * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,\n * and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities\n */\nfunction NamedNodeMap() {\n};\n\nfunction _findNodeIndex(list,node){\n\tvar i = list.length;\n\twhile(i--){\n\t\tif(list[i] === node){return i}\n\t}\n}\n\nfunction _addNamedNode(el,list,newAttr,oldAttr){\n\tif(oldAttr){\n\t\tlist[_findNodeIndex(list,oldAttr)] = newAttr;\n\t}else{\n\t\tlist[list.length++] = newAttr;\n\t}\n\tif(el){\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif(doc){\n\t\t\toldAttr && _onRemoveAttribute(doc,el,oldAttr);\n\t\t\t_onAddAttribute(doc,el,newAttr);\n\t\t}\n\t}\n}\nfunction _removeNamedNode(el,list,attr){\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list,attr);\n\tif(i>=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i<lastIndex){\n\t\t\tlist[i] = list[++i]\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif(el){\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif(doc){\n\t\t\t\t_onRemoveAttribute(doc,el,attr);\n\t\t\t\tattr.ownerElement = null;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tthrow new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength:0,\n\titem:NodeList.prototype.item,\n\tgetNamedItem: function(key) {\n//\t\tif(key.indexOf(':')>0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t *   (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument  DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI,  qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t *   (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t  or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n  \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n    // Introduced in DOM Level 2:\n    hasAttributes:function(){\n    \treturn this.attributes.length>0;\n    },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n    lookupPrefix:function(namespaceURI){\n    \tvar el = this;\n    \twhile(el){\n    \t\tvar map = el._nsMap;\n    \t\t//console.dir(map)\n    \t\tif(map){\n    \t\t\tfor(var n in map){\n\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\t\treturn n;\n\t\t\t\t\t\t}\n    \t\t\t}\n    \t\t}\n    \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n    \t}\n    \treturn null;\n    },\n    // Introduced in DOM Level 3:\n    lookupNamespaceURI:function(prefix){\n    \tvar el = this;\n    \twhile(el){\n    \t\tvar map = el._nsMap;\n    \t\t//console.dir(map)\n    \t\tif(map){\n    \t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n    \t\t\t\treturn map[prefix] ;\n    \t\t\t}\n    \t\t}\n    \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n    \t}\n    \treturn null;\n    },\n    // Introduced in DOM Level 3:\n    isDefaultNamespace:function(namespaceURI){\n    \tvar prefix = this.lookupPrefix(namespaceURI);\n    \treturn prefix == null;\n    }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '&lt;' ||\n         c == '>' && '&gt;' ||\n         c == '&' && '&amp;' ||\n         c == '\"' && '&quot;' ||\n         '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n        }while(node=node.nextSibling)\n    }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\n/**\n * Updates `el.childNodes`, updating the indexed items and it's `length`.\n * Passing `newChild` means it will be appended.\n * Otherwise it's assumed that an item has been removed,\n * and `el.firstNode` and it's `.nextSibling` are used\n * to walk the current list of child nodes.\n *\n * @param {Document} doc\n * @param {Node} el\n * @param {Node} [newChild]\n * @private\n */\nfunction _onUpdateChild (doc, el, newChild) {\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif (newChild) {\n\t\t\tcs[cs.length++] = newChild;\n\t\t} else {\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n *\n * @param {Node} parentNode\n * @param {Node} child\n * @returns {Node} the child that was removed.\n * @private\n */\nfunction _removeChild (parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\n\n/**\n * Appends `newChild` to `parentNode`.\n * If `newChild` is already connected to a `parentNode` it is first removed from it.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n * @param {Node} parentNode\n * @param {Node} newChild\n * @returns {Node}\n * @private\n */\nfunction _appendSingleChild (parentNode, newChild) {\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t} else {\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName :  '#document',\n\tnodeType :  DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype :  null,\n\tdocumentElement :  null,\n\t_inc : 1,\n\n\tinsertBefore :  function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild :  function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.target = target;\n\t\tnode.nodeValue= node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n *\n * Literal whitespace other than space that appear in attribute values\n * are serialized as their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces)\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\t// add namespaces for attributes\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\tvisibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });\n\t\t\t}else if(attr.nodeName == 'xmlns'){\n\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t}\n\t\t}\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = attr.prefix||'';\n\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t\t}\n\t\t\tserializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t}\n\n\t\t// add namespace for current node\n\t\tif (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {\n\t\t\tvar prefix = node.prefix||'';\n\t\t\tvar uri = node.namespaceURI;\n\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t}\n\n\t\tif(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){\n\t\t\tbuf.push('>');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('</',prefixedNodeName,'>');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&amp;` and `&lt;` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" &gt; \", and must, for compatibility,\n\t\t * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&>]/g,_xmlEncoder)\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '<![CDATA[',node.data,']]>');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"<!--\",node.data,\"-->\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('<!DOCTYPE ',node.name);\n\t\tif(pubid){\n\t\t\tbuf.push(' PUBLIC ', pubid);\n\t\t\tif (sysid && sysid!='.') {\n\t\t\t\tbuf.push(' ', sysid);\n\t\t\t}\n\t\t\tbuf.push('>');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"<?\",node.target,\" \",node.data,\"?>\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tbreak;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t\tbreak;\n\t//case ENTITY_REFERENCE_NODE:\n\t//case PROCESSING_INSTRUCTION_NODE:\n\t////case TEXT_NODE:\n\t//case CDATA_SECTION_NODE:\n\t//case COMMENT_NODE:\n\t//\tdeep = false;\n\t//\tbreak;\n\t//case DOCUMENT_NODE:\n\t//case DOCUMENT_TYPE_NODE:\n\t//cannot be imported.\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\t//can not hit in level3\n\t//default:throw e;\n\t}\n\tif(!node2){\n\t\tnode2 = node.cloneNode(false);//false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(importNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n//\n//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,\n//\t\t\t\t\tattributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};\nfunction cloneNode(doc,node,deep){\n\tvar node2 = new node.constructor();\n\tfor (var n in node) {\n\t\tif (Object.prototype.hasOwnProperty.call(node, n)) {\n\t\t\tvar v = node[n];\n\t\t\tif (typeof v != \"object\") {\n\t\t\t\tif (v != node2[n]) {\n\t\t\t\t\tnode2[n] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(node.childNodes){\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tvar attrs\t= node.attributes;\n\t\tvar attrs2\t= node2.attributes = new NamedNodeMap();\n\t\tvar len = attrs.length\n\t\tattrs2._ownerElement = node2;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tnode2.setAttributeNode(cloneNode(doc,attrs.item(i),true));\n\t\t}\n\t\tbreak;;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t}\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(cloneNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object,key,value){\n\tobject[key] = value\n}\n//do dynamic\ntry{\n\tif(Object.defineProperty){\n\t\tObject.defineProperty(LiveNodeList.prototype,'length',{\n\t\t\tget:function(){\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t}\n\t\t});\n\n\t\tObject.defineProperty(Node.prototype,'textContent',{\n\t\t\tget:function(){\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\n\t\t\tset:function(data){\n\t\t\t\tswitch(this.nodeType){\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\twhile(this.firstChild){\n\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif(data || String(data)){\n\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.data = data;\n\t\t\t\t\tthis.value = data;\n\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tfunction getTextContent(node){\n\t\t\tswitch(node.nodeType){\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\tvar buf = [];\n\t\t\t\tnode = node.firstChild;\n\t\t\t\twhile(node){\n\t\t\t\t\tif(node.nodeType!==7 && node.nodeType !==8){\n\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t}\n\t\t\t\treturn buf.join('');\n\t\t\tdefault:\n\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\n\t\t__set__ = function(object,key,value){\n\t\t\t//console.log(value)\n\t\t\tobject['$$'+key] = value\n\t\t}\n\t}\n}catch(e){//ie8\n}\n\n//if(typeof require == 'function'){\n\texports.DocumentType = DocumentType;\n\texports.DOMException = DOMException;\n\texports.DOMImplementation = DOMImplementation;\n\texports.Element = Element;\n\texports.Node = Node;\n\texports.NodeList = NodeList;\n\texports.XMLSerializer = XMLSerializer;\n//}\n","var freeze = require('./conventions').freeze;\n\n/**\n * The entities that are predefined in every XML document.\n *\n * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia\n */\nexports.XML_ENTITIES = freeze({amp:'&', apos:\"'\", gt:'>', lt:'<', quot:'\"'})\n\n/**\n * A map of currently 241 entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n       lt: '<',\n       gt: '>',\n       amp: '&',\n       quot: '\"',\n       apos: \"'\",\n       Agrave: \"À\",\n       Aacute: \"Á\",\n       Acirc: \"Â\",\n       Atilde: \"Ã\",\n       Auml: \"Ä\",\n       Aring: \"Å\",\n       AElig: \"Æ\",\n       Ccedil: \"Ç\",\n       Egrave: \"È\",\n       Eacute: \"É\",\n       Ecirc: \"Ê\",\n       Euml: \"Ë\",\n       Igrave: \"Ì\",\n       Iacute: \"Í\",\n       Icirc: \"Î\",\n       Iuml: \"Ï\",\n       ETH: \"Ð\",\n       Ntilde: \"Ñ\",\n       Ograve: \"Ò\",\n       Oacute: \"Ó\",\n       Ocirc: \"Ô\",\n       Otilde: \"Õ\",\n       Ouml: \"Ö\",\n       Oslash: \"Ø\",\n       Ugrave: \"Ù\",\n       Uacute: \"Ú\",\n       Ucirc: \"Û\",\n       Uuml: \"Ü\",\n       Yacute: \"Ý\",\n       THORN: \"Þ\",\n       szlig: \"ß\",\n       agrave: \"à\",\n       aacute: \"á\",\n       acirc: \"â\",\n       atilde: \"ã\",\n       auml: \"ä\",\n       aring: \"å\",\n       aelig: \"æ\",\n       ccedil: \"ç\",\n       egrave: \"è\",\n       eacute: \"é\",\n       ecirc: \"ê\",\n       euml: \"ë\",\n       igrave: \"ì\",\n       iacute: \"í\",\n       icirc: \"î\",\n       iuml: \"ï\",\n       eth: \"ð\",\n       ntilde: \"ñ\",\n       ograve: \"ò\",\n       oacute: \"ó\",\n       ocirc: \"ô\",\n       otilde: \"õ\",\n       ouml: \"ö\",\n       oslash: \"ø\",\n       ugrave: \"ù\",\n       uacute: \"ú\",\n       ucirc: \"û\",\n       uuml: \"ü\",\n       yacute: \"ý\",\n       thorn: \"þ\",\n       yuml: \"ÿ\",\n       nbsp: \"\\u00a0\",\n       iexcl: \"¡\",\n       cent: \"¢\",\n       pound: \"£\",\n       curren: \"¤\",\n       yen: \"¥\",\n       brvbar: \"¦\",\n       sect: \"§\",\n       uml: \"¨\",\n       copy: \"©\",\n       ordf: \"ª\",\n       laquo: \"«\",\n       not: \"¬\",\n       shy: \"­­\",\n       reg: \"®\",\n       macr: \"¯\",\n       deg: \"°\",\n       plusmn: \"±\",\n       sup2: \"²\",\n       sup3: \"³\",\n       acute: \"´\",\n       micro: \"µ\",\n       para: \"¶\",\n       middot: \"·\",\n       cedil: \"¸\",\n       sup1: \"¹\",\n       ordm: \"º\",\n       raquo: \"»\",\n       frac14: \"¼\",\n       frac12: \"½\",\n       frac34: \"¾\",\n       iquest: \"¿\",\n       times: \"×\",\n       divide: \"÷\",\n       forall: \"∀\",\n       part: \"∂\",\n       exist: \"∃\",\n       empty: \"∅\",\n       nabla: \"∇\",\n       isin: \"∈\",\n       notin: \"∉\",\n       ni: \"∋\",\n       prod: \"∏\",\n       sum: \"∑\",\n       minus: \"−\",\n       lowast: \"∗\",\n       radic: \"√\",\n       prop: \"∝\",\n       infin: \"∞\",\n       ang: \"∠\",\n       and: \"∧\",\n       or: \"∨\",\n       cap: \"∩\",\n       cup: \"∪\",\n       'int': \"∫\",\n       there4: \"∴\",\n       sim: \"∼\",\n       cong: \"≅\",\n       asymp: \"≈\",\n       ne: \"≠\",\n       equiv: \"≡\",\n       le: \"≤\",\n       ge: \"≥\",\n       sub: \"⊂\",\n       sup: \"⊃\",\n       nsub: \"⊄\",\n       sube: \"⊆\",\n       supe: \"⊇\",\n       oplus: \"⊕\",\n       otimes: \"⊗\",\n       perp: \"⊥\",\n       sdot: \"⋅\",\n       Alpha: \"Α\",\n       Beta: \"Β\",\n       Gamma: \"Γ\",\n       Delta: \"Δ\",\n       Epsilon: \"Ε\",\n       Zeta: \"Ζ\",\n       Eta: \"Η\",\n       Theta: \"Θ\",\n       Iota: \"Ι\",\n       Kappa: \"Κ\",\n       Lambda: \"Λ\",\n       Mu: \"Μ\",\n       Nu: \"Ν\",\n       Xi: \"Ξ\",\n       Omicron: \"Ο\",\n       Pi: \"Π\",\n       Rho: \"Ρ\",\n       Sigma: \"Σ\",\n       Tau: \"Τ\",\n       Upsilon: \"Υ\",\n       Phi: \"Φ\",\n       Chi: \"Χ\",\n       Psi: \"Ψ\",\n       Omega: \"Ω\",\n       alpha: \"α\",\n       beta: \"β\",\n       gamma: \"γ\",\n       delta: \"δ\",\n       epsilon: \"ε\",\n       zeta: \"ζ\",\n       eta: \"η\",\n       theta: \"θ\",\n       iota: \"ι\",\n       kappa: \"κ\",\n       lambda: \"λ\",\n       mu: \"μ\",\n       nu: \"ν\",\n       xi: \"ξ\",\n       omicron: \"ο\",\n       pi: \"π\",\n       rho: \"ρ\",\n       sigmaf: \"ς\",\n       sigma: \"σ\",\n       tau: \"τ\",\n       upsilon: \"υ\",\n       phi: \"φ\",\n       chi: \"χ\",\n       psi: \"ψ\",\n       omega: \"ω\",\n       thetasym: \"ϑ\",\n       upsih: \"ϒ\",\n       piv: \"ϖ\",\n       OElig: \"Œ\",\n       oelig: \"œ\",\n       Scaron: \"Š\",\n       scaron: \"š\",\n       Yuml: \"Ÿ\",\n       fnof: \"ƒ\",\n       circ: \"ˆ\",\n       tilde: \"˜\",\n       ensp: \" \",\n       emsp: \" \",\n       thinsp: \" \",\n       zwnj: \"‌\",\n       zwj: \"‍\",\n       lrm: \"‎\",\n       rlm: \"‏\",\n       ndash: \"–\",\n       mdash: \"—\",\n       lsquo: \"‘\",\n       rsquo: \"’\",\n       sbquo: \"‚\",\n       ldquo: \"“\",\n       rdquo: \"”\",\n       bdquo: \"„\",\n       dagger: \"†\",\n       Dagger: \"‡\",\n       bull: \"•\",\n       hellip: \"…\",\n       permil: \"‰\",\n       prime: \"′\",\n       Prime: \"″\",\n       lsaquo: \"‹\",\n       rsaquo: \"›\",\n       oline: \"‾\",\n       euro: \"€\",\n       trade: \"™\",\n       larr: \"←\",\n       uarr: \"↑\",\n       rarr: \"→\",\n       darr: \"↓\",\n       harr: \"↔\",\n       crarr: \"↵\",\n       lceil: \"⌈\",\n       rceil: \"⌉\",\n       lfloor: \"⌊\",\n       rfloor: \"⌋\",\n       loz: \"◊\",\n       spades: \"♠\",\n       clubs: \"♣\",\n       hearts: \"♥\",\n       diams: \"♦\"\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES\n","var dom = require('./dom')\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = require('./dom-parser').DOMParser\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4]   \tNameStartChar\t   ::=   \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a]   \tNameChar\t   ::=   \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5]   \tName\t   ::=   \tNameStartChar (NameChar)*\nvar nameStartChar = /[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]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el<el />\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t    \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t    \t\t\tdoc.appendChild(text);\n\t    \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t        \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t        \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t        \t\tend = tagStart+1+tagName.length;\n\t        \t}else if(tagName.match(/\\s</)){\n\t        \t\ttagName = tagName.replace(/[\\s<].*/,'');\n\t        \t\terrorHandler.error(\"end tag name: \"+tagName+' maybe not complete');\n\t        \t\tend = tagStart+1+tagName.length;\n\t\t\t\t}\n\t\t\t\tvar localNSMap = config.localNSMap;\n\t\t\t\tvar endMatch = config.tagName == tagName;\n\t\t\t\tvar endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()\n\t\t        if(endIgnoreCaseMach){\n\t\t        \tdomBuilder.endElement(config.uri,config.localName,tagName);\n\t\t\t\t\tif(localNSMap){\n\t\t\t\t\t\tfor (var prefix in localNSMap) {\n\t\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!endMatch){\n\t\t            \terrorHandler.fatalError(\"end tag name: \"+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case\n\t\t\t\t\t}\n\t\t        }else{\n\t\t        \tparseStack.push(config)\n\t\t        }\n\n\t\t\t\tend++;\n\t\t\t\tbreak;\n\t\t\t\t// end elment\n\t\t\tcase '?':// <?...?>\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// <!doctype,<![CDATA,<!--\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseDCC(source,tagStart,domBuilder,errorHandler);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tvar el = new ElementAttributes();\n\t\t\t\tvar currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\t\t\t\t//elStartEnd\n\t\t\t\tvar end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);\n\t\t\t\tvar len = el.length;\n\n\n\t\t\t\tif(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tif(!entityMap.nbsp){\n\t\t\t\t\t\terrorHandler.warning('unclosed xml attribute');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(locator && len){\n\t\t\t\t\tvar locator2 = copyLocator(locator,{});\n\t\t\t\t\t//try{//attribute position fixed\n\t\t\t\t\tfor(var i = 0;i<len;i++){\n\t\t\t\t\t\tvar a = el[i];\n\t\t\t\t\t\tposition(a.offset);\n\t\t\t\t\t\ta.locator = copyLocator(locator,{});\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator2\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator;\n\t\t\t\t}else{\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (NAMESPACE.isHTML(el.uri) && !el.closed) {\n\t\t\t\t\tend = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)\n\t\t\t\t} else {\n\t\t\t\t\tend++;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(e){\n\t\t\tif (e instanceof ParseError) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\terrorHandler.error('element parse error: '+e)\n\t\t\tend = -1;\n\t\t}\n\t\tif(end>start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed  = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName =  el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart =  source.indexOf('</'+tagName+'>',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos =  source.lastIndexOf('</'+tagName+'>')\n\t\tif(pos<elStartEnd){//忘记闭合\n\t\t\tpos = source.lastIndexOf('</'+tagName)\n\t\t}\n\t\tcloseMap[tagName] =pos\n\t}\n\treturn pos<elStartEnd;\n\t//}\n}\n\nfunction _copy (source, target) {\n\tfor (var n in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, n)) {\n\t\t\ttarget[n] = source[n];\n\t\t}\n\t}\n}\n\nfunction parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'\n\tvar next= source.charAt(start+2)\n\tswitch(next){\n\tcase '-':\n\t\tif(source.charAt(start + 3) === '-'){\n\t\t\tvar end = source.indexOf('-->',start+4);\n\t\t\t//append comment source.substring(4,end)//<!--\n\t\t\tif(end>start){\n\t\t\t\tdomBuilder.comment(source,start+4,end-start-4);\n\t\t\t\treturn end+3;\n\t\t\t}else{\n\t\t\t\terrorHandler.error(\"Unclosed comment\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}else{\n\t\t\t//error\n\t\t\treturn -1;\n\t\t}\n\tdefault:\n\t\tif(source.substr(start+3,6) == 'CDATA['){\n\t\t\tvar end = source.indexOf(']]>',start+9);\n\t\t\tdomBuilder.startCDATA();\n\t\t\tdomBuilder.characters(source,start+9,end-start-9);\n\t\t\tdomBuilder.endCDATA()\n\t\t\treturn end+3;\n\t\t}\n\t\t//<!DOCTYPE\n\t\t//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)\n\t\tvar matchs = split(source,start);\n\t\tvar len = matchs.length;\n\t\tif(len>1 && /!doctype/i.test(matchs[0][0])){\n\t\t\tvar name = matchs[1][0];\n\t\t\tvar pubid = false;\n\t\t\tvar sysid = false;\n\t\t\tif(len>3){\n\t\t\t\tif(/^public$/i.test(matchs[2][0])){\n\t\t\t\t\tpubid = matchs[3][0];\n\t\t\t\t\tsysid = len>4 && matchs[4][0];\n\t\t\t\t}else if(/^system$/i.test(matchs[2][0])){\n\t\t\t\t\tsysid = matchs[3][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastMatch = matchs[len-1]\n\t\t\tdomBuilder.startDTD(name, pubid, sysid);\n\t\t\tdomBuilder.endDTD();\n\n\t\t\treturn lastMatch.index+lastMatch[0].length\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n\nfunction parseInstruction(source,start,domBuilder){\n\tvar end = source.indexOf('?>',start);\n\tif(end){\n\t\tvar match = source.substring(start,end).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);\n\t\tif(match){\n\t\t\tvar len = match[0].length;\n\t\t\tdomBuilder.processingInstruction(match[1], match[2]) ;\n\t\t\treturn end+2;\n\t\t}else{//error\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction ElementAttributes(){\n\tthis.attributeNames = {}\n}\nElementAttributes.prototype = {\n\tsetTagName:function(tagName){\n\t\tif(!tagNamePattern.test(tagName)){\n\t\t\tthrow new Error('invalid tagName:'+tagName)\n\t\t}\n\t\tthis.tagName = tagName\n\t},\n\taddValue:function(qName, value, offset) {\n\t\tif(!tagNamePattern.test(qName)){\n\t\t\tthrow new Error('invalid attribute:'+qName)\n\t\t}\n\t\tthis.attributeNames[qName] = this.length;\n\t\tthis[this.length++] = {qName:qName,value:value,offset:offset}\n\t},\n\tlength:0,\n\tgetLocalName:function(i){return this[i].localName},\n\tgetLocator:function(i){return this[i].locator},\n\tgetQName:function(i){return this[i].qName},\n\tgetURI:function(i){return this[i].uri},\n\tgetValue:function(i){return this[i].value}\n//\t,getIndex:function(uri, localName)){\n//\t\tif(localName){\n//\n//\t\t}else{\n//\t\t\tvar qName = uri\n//\t\t}\n//\t},\n//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\n//\tgetType:function(uri,localName){}\n//\tgetType:function(i){},\n}\n\n\n\nfunction split(source,start){\n\tvar match;\n\tvar buf = [];\n\tvar reg = /'[^']+'|\"[^\"]+\"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;\n\treg.lastIndex = start;\n\treg.exec(source);//skip <\n\twhile(match = reg.exec(source)){\n\t\tbuf.push(match);\n\t\tif(match[1])return buf;\n\t}\n}\n\nexports.XMLReader = XMLReader;\nexports.ParseError = ParseError;\n","var getUint64 = require('../utils/numbers.js').getUint64;\n\nvar parseSidx = function(data) {\n  var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n      result = {\n        version: data[0],\n        flags: new Uint8Array(data.subarray(1, 4)),\n        references: [],\n        referenceId: view.getUint32(4),\n        timescale: view.getUint32(8)\n      },\n    i = 12;\n\n  if (result.version === 0) {\n    result.earliestPresentationTime = view.getUint32(i);\n    result.firstOffset = view.getUint32(i + 4);\n    i += 8;\n  } else {\n    // read 64 bits\n    result.earliestPresentationTime = getUint64(data.subarray(i));\n    result.firstOffset = getUint64(data.subarray(i + 8));\n    i += 16;\n  }\n\n  i += 2; // reserved\n\n  var referenceCount = view.getUint16(i);\n\n  i += 2; // start of references\n\n  for (; referenceCount > 0; i += 12, referenceCount--) {\n    result.references.push({\n      referenceType: (data[i] & 0x80) >>> 7,\n      referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n      subsegmentDuration: view.getUint32(i + 4),\n      startsWithSap: !!(data[i + 8] & 0x80),\n      sapType: (data[i + 8] & 0x70) >>> 4,\n      sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n    });\n  }\n\n  return result;\n};\n\n\nmodule.exports = parseSidx;\n","/**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\nvar\n  ONE_SECOND_IN_TS = 90000, // 90kHz clock\n  secondsToVideoTs,\n  secondsToAudioTs,\n  videoTsToSeconds,\n  audioTsToSeconds,\n  audioTsToVideoTs,\n  videoTsToAudioTs,\n  metadataTsToSeconds;\n\nsecondsToVideoTs = function(seconds) {\n  return seconds * ONE_SECOND_IN_TS;\n};\n\nsecondsToAudioTs = function(seconds, sampleRate) {\n  return seconds * sampleRate;\n};\n\nvideoTsToSeconds = function(timestamp) {\n  return timestamp / ONE_SECOND_IN_TS;\n};\n\naudioTsToSeconds = function(timestamp, sampleRate) {\n  return timestamp / sampleRate;\n};\n\naudioTsToVideoTs = function(timestamp, sampleRate) {\n  return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n};\n\nvideoTsToAudioTs = function(timestamp, sampleRate) {\n  return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n};\n\n/**\n * Adjust ID3 tag or caption timing information by the timeline pts values\n * (if keepOriginalTimestamps is false) and convert to seconds\n */\nmetadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {\n  return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n};\n\nmodule.exports = {\n  ONE_SECOND_IN_TS: ONE_SECOND_IN_TS,\n  secondsToVideoTs: secondsToVideoTs,\n  secondsToAudioTs: secondsToAudioTs,\n  videoTsToSeconds: videoTsToSeconds,\n  audioTsToSeconds: audioTsToSeconds,\n  audioTsToVideoTs: audioTsToVideoTs,\n  videoTsToAudioTs: videoTsToAudioTs,\n  metadataTsToSeconds: metadataTsToSeconds\n};\n","var MAX_UINT32 = Math.pow(2, 32);\n\nvar getUint64 = function(uint8) {\n  var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);\n  var value;\n\n  if (dv.getBigUint64) {\n    value = dv.getBigUint64(0);\n\n    if (value < Number.MAX_SAFE_INTEGER) {\n      return Number(value);\n    }\n\n    return value;\n  }\n\n  return (dv.getUint32(0) * MAX_UINT32) + dv.getUint32(4);\n};\n\nmodule.exports = {\n  getUint64: getUint64,\n  MAX_UINT32: MAX_UINT32\n};\n","\"use strict\";\n\nvar window = require('global/window');\n\nvar httpResponseHandler = function httpResponseHandler(callback, decodeResponseBody) {\n  if (decodeResponseBody === void 0) {\n    decodeResponseBody = false;\n  }\n\n  return function (err, response, responseBody) {\n    // if the XHR failed, return that error\n    if (err) {\n      callback(err);\n      return;\n    } // if the HTTP status code is 4xx or 5xx, the request also failed\n\n\n    if (response.statusCode >= 400 && response.statusCode <= 599) {\n      var cause = responseBody;\n\n      if (decodeResponseBody) {\n        if (window.TextDecoder) {\n          var charset = getCharset(response.headers && response.headers['content-type']);\n\n          try {\n            cause = new TextDecoder(charset).decode(responseBody);\n          } catch (e) {}\n        } else {\n          cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));\n        }\n      }\n\n      callback({\n        cause: cause\n      });\n      return;\n    } // otherwise, request succeeded\n\n\n    callback(null, responseBody);\n  };\n};\n\nfunction getCharset(contentTypeHeader) {\n  if (contentTypeHeader === void 0) {\n    contentTypeHeader = '';\n  }\n\n  return contentTypeHeader.toLowerCase().split(';').reduce(function (charset, contentType) {\n    var _contentType$split = contentType.split('='),\n        type = _contentType$split[0],\n        value = _contentType$split[1];\n\n    if (type.trim() === 'charset') {\n      return value.trim();\n    }\n\n    return charset;\n  }, 'utf-8');\n}\n\nmodule.exports = httpResponseHandler;","\"use strict\";\n\nvar window = require(\"global/window\");\n\nvar _extends = require(\"@babel/runtime/helpers/extends\");\n\nvar isFunction = require('is-function');\n\ncreateXHR.httpHandler = require('./http-handler.js');\n/**\n * @license\n * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>\n * Copyright (c) 2014 David Björklund\n * Available under the MIT license\n * <https://github.com/kesla/parse-headers/blob/master/LICENCE>\n */\n\nvar parseHeaders = function parseHeaders(headers) {\n  var result = {};\n\n  if (!headers) {\n    return result;\n  }\n\n  headers.trim().split('\\n').forEach(function (row) {\n    var index = row.indexOf(':');\n    var key = row.slice(0, index).trim().toLowerCase();\n    var value = row.slice(index + 1).trim();\n\n    if (typeof result[key] === 'undefined') {\n      result[key] = value;\n    } else if (Array.isArray(result[key])) {\n      result[key].push(value);\n    } else {\n      result[key] = [result[key], value];\n    }\n  });\n  return result;\n};\n\nmodule.exports = createXHR; // Allow use of default import syntax in TypeScript\n\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop;\ncreateXHR.XDomainRequest = \"withCredentials\" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window.XDomainRequest;\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function (method) {\n  createXHR[method === \"delete\" ? \"del\" : method] = function (uri, options, callback) {\n    options = initParams(uri, options, callback);\n    options.method = method.toUpperCase();\n    return _createXHR(options);\n  };\n});\n\nfunction forEachArray(array, iterator) {\n  for (var i = 0; i < array.length; i++) {\n    iterator(array[i]);\n  }\n}\n\nfunction isEmpty(obj) {\n  for (var i in obj) {\n    if (obj.hasOwnProperty(i)) return false;\n  }\n\n  return true;\n}\n\nfunction initParams(uri, options, callback) {\n  var params = uri;\n\n  if (isFunction(options)) {\n    callback = options;\n\n    if (typeof uri === \"string\") {\n      params = {\n        uri: uri\n      };\n    }\n  } else {\n    params = _extends({}, options, {\n      uri: uri\n    });\n  }\n\n  params.callback = callback;\n  return params;\n}\n\nfunction createXHR(uri, options, callback) {\n  options = initParams(uri, options, callback);\n  return _createXHR(options);\n}\n\nfunction _createXHR(options) {\n  if (typeof options.callback === \"undefined\") {\n    throw new Error(\"callback argument missing\");\n  }\n\n  var called = false;\n\n  var callback = function cbOnce(err, response, body) {\n    if (!called) {\n      called = true;\n      options.callback(err, response, body);\n    }\n  };\n\n  function readystatechange() {\n    if (xhr.readyState === 4) {\n      setTimeout(loadFunc, 0);\n    }\n  }\n\n  function getBody() {\n    // Chrome with requestType=blob throws errors arround when even testing access to responseText\n    var body = undefined;\n\n    if (xhr.response) {\n      body = xhr.response;\n    } else {\n      body = xhr.responseText || getXml(xhr);\n    }\n\n    if (isJson) {\n      try {\n        body = JSON.parse(body);\n      } catch (e) {}\n    }\n\n    return body;\n  }\n\n  function errorFunc(evt) {\n    clearTimeout(timeoutTimer);\n\n    if (!(evt instanceof Error)) {\n      evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\"));\n    }\n\n    evt.statusCode = 0;\n    return callback(evt, failureResponse);\n  } // will load the data & process the response in a special response object\n\n\n  function loadFunc() {\n    if (aborted) return;\n    var status;\n    clearTimeout(timeoutTimer);\n\n    if (options.useXDR && xhr.status === undefined) {\n      //IE8 CORS GET successful response doesn't have a status field, but body is fine\n      status = 200;\n    } else {\n      status = xhr.status === 1223 ? 204 : xhr.status;\n    }\n\n    var response = failureResponse;\n    var err = null;\n\n    if (status !== 0) {\n      response = {\n        body: getBody(),\n        statusCode: status,\n        method: method,\n        headers: {},\n        url: uri,\n        rawRequest: xhr\n      };\n\n      if (xhr.getAllResponseHeaders) {\n        //remember xhr can in fact be XDR for CORS in IE\n        response.headers = parseHeaders(xhr.getAllResponseHeaders());\n      }\n    } else {\n      err = new Error(\"Internal XMLHttpRequest Error\");\n    }\n\n    return callback(err, response, response.body);\n  }\n\n  var xhr = options.xhr || null;\n\n  if (!xhr) {\n    if (options.cors || options.useXDR) {\n      xhr = new createXHR.XDomainRequest();\n    } else {\n      xhr = new createXHR.XMLHttpRequest();\n    }\n  }\n\n  var key;\n  var aborted;\n  var uri = xhr.url = options.uri || options.url;\n  var method = xhr.method = options.method || \"GET\";\n  var body = options.body || options.data;\n  var headers = xhr.headers = options.headers || {};\n  var sync = !!options.sync;\n  var isJson = false;\n  var timeoutTimer;\n  var failureResponse = {\n    body: undefined,\n    headers: {},\n    statusCode: 0,\n    method: method,\n    url: uri,\n    rawRequest: xhr\n  };\n\n  if (\"json\" in options && options.json !== false) {\n    isJson = true;\n    headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n    if (method !== \"GET\" && method !== \"HEAD\") {\n      headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n      body = JSON.stringify(options.json === true ? body : options.json);\n    }\n  }\n\n  xhr.onreadystatechange = readystatechange;\n  xhr.onload = loadFunc;\n  xhr.onerror = errorFunc; // IE9 must have onprogress be set to a unique function.\n\n  xhr.onprogress = function () {// IE must die\n  };\n\n  xhr.onabort = function () {\n    aborted = true;\n  };\n\n  xhr.ontimeout = errorFunc;\n  xhr.open(method, uri, !sync, options.username, options.password); //has to be after open\n\n  if (!sync) {\n    xhr.withCredentials = !!options.withCredentials;\n  } // Cannot set timeout with sync request\n  // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n  // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n\n\n  if (!sync && options.timeout > 0) {\n    timeoutTimer = setTimeout(function () {\n      if (aborted) return;\n      aborted = true; //IE9 may still call readystatechange\n\n      xhr.abort(\"timeout\");\n      var e = new Error(\"XMLHttpRequest timeout\");\n      e.code = \"ETIMEDOUT\";\n      errorFunc(e);\n    }, options.timeout);\n  }\n\n  if (xhr.setRequestHeader) {\n    for (key in headers) {\n      if (headers.hasOwnProperty(key)) {\n        xhr.setRequestHeader(key, headers[key]);\n      }\n    }\n  } else if (options.headers && !isEmpty(options.headers)) {\n    throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n  }\n\n  if (\"responseType\" in options) {\n    xhr.responseType = options.responseType;\n  }\n\n  if (\"beforeSend\" in options && typeof options.beforeSend === \"function\") {\n    options.beforeSend(xhr);\n  } // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n  // XMLHttpRequest spec says to pass null as body to indicate no body\n  // See https://github.com/naugtur/xhr/issues/100.\n\n\n  xhr.send(body || null);\n  return xhr;\n}\n\nfunction getXml(xhr) {\n  // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n  // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n  try {\n    if (xhr.responseType === \"document\") {\n      return xhr.responseXML;\n    }\n\n    var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\";\n\n    if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n      return xhr.responseXML;\n    }\n  } catch (e) {}\n\n  return null;\n}\n\nfunction noop() {}","'use strict'\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array<T> | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly<T>}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","var conventions = require(\"./conventions\");\nvar dom = require('./dom')\nvar entities = require('./entities');\nvar sax = require('./sax');\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax =  new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n  \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tif(source && typeof source === 'string'){\n\t\tsax.parse(source,defaultNSMap,entityMap);\n\t}else{\n\t\tsax.errorHandler.error(\"invalid doc source\");\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n    this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n    \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n    \tif (this.locator) {\n        \tthis.doc.documentURI = this.locator.systemId;\n    \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t    var el = doc.createElementNS(namespaceURI, qName||localName);\n\t    var len = attrs.length;\n\t    appendElement(this, el);\n\t    this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t    for (var i = 0 ; i < len; i++) {\n\t        var namespaceURI = attrs.getURI(i);\n\t        var value = attrs.getValue(i);\n\t        var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t    }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t    var ins = this.doc.createProcessingInstruction(target, data);\n\t    this.locator && position(this.locator,ins)\n\t    appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t    if(this.locator = locator){// && !('lineNumber' in locator)){\n\t    \tlocator.lineNumber = 0;\n\t    }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t    var comm = this.doc.createComment(chars);\n\t    this.locator && position(this.locator,comm)\n\t    appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t    //used in characters() methods\n\t    this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t    this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t    if (impl && impl.createDocumentType) {\n\t        var dt = impl.createDocumentType(name, publicId, systemId);\n\t        this.locator && position(this.locator,dt)\n\t        appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t    }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n *  #comment(chars, start, length)\n *  #startCDATA()\n *  #endCDATA()\n *  #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n *  #endDTD()\n *  #startEntity(name)\n *  #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n *  #elementDecl(name, model)\n *  #externalEntityDecl(name, publicId, systemId)\n *  #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n *  #resolveEntity(String name,String publicId,String baseURI,String systemId)\n *  #resolveEntity(publicId, systemId)\n *  #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n *  #notationDecl(name, publicId, systemId) {};\n *  #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n    if (!hander.currentElement) {\n        hander.doc.appendChild(node);\n    } else {\n        hander.currentElement.appendChild(node);\n    }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.DOMParser = DOMParser;\n\n/**\n * @deprecated Import/require from main entry point instead\n */\nexports.DOMImplementation = dom.DOMImplementation;\n\n/**\n * @deprecated Import/require from main entry point instead\n */\nexports.XMLSerializer = dom.XMLSerializer;\n","var conventions = require(\"./conventions\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record<string, boolean | undefined>} current\n * @param {string} element\n * @returns {Record<string, boolean | undefined>}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE                = NodeType.ELEMENT_NODE                = 1;\nvar ATTRIBUTE_NODE              = NodeType.ATTRIBUTE_NODE              = 2;\nvar TEXT_NODE                   = NodeType.TEXT_NODE                   = 3;\nvar CDATA_SECTION_NODE          = NodeType.CDATA_SECTION_NODE          = 4;\nvar ENTITY_REFERENCE_NODE       = NodeType.ENTITY_REFERENCE_NODE       = 5;\nvar ENTITY_NODE                 = NodeType.ENTITY_NODE                 = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE                = NodeType.COMMENT_NODE                = 8;\nvar DOCUMENT_NODE               = NodeType.DOCUMENT_NODE               = 9;\nvar DOCUMENT_TYPE_NODE          = NodeType.DOCUMENT_TYPE_NODE          = 10;\nvar DOCUMENT_FRAGMENT_NODE      = NodeType.DOCUMENT_FRAGMENT_NODE      = 11;\nvar NOTATION_NODE               = NodeType.NOTATION_NODE               = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR              = ExceptionCode.INDEX_SIZE_ERR              = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR          = ExceptionCode.DOMSTRING_SIZE_ERR          = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR       = ExceptionCode.HIERARCHY_REQUEST_ERR       = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR          = ExceptionCode.WRONG_DOCUMENT_ERR          = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR       = ExceptionCode.INVALID_CHARACTER_ERR       = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR         = ExceptionCode.NO_DATA_ALLOWED_ERR         = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR               = ExceptionCode.NOT_FOUND_ERR               = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR           = ExceptionCode.NOT_SUPPORTED_ERR           = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR         = ExceptionCode.INUSE_ATTRIBUTE_ERR         = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR        \t= ExceptionCode.INVALID_STATE_ERR        \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR               \t= ExceptionCode.SYNTAX_ERR               \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR            \t= ExceptionCode.NAMESPACE_ERR           \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR       \t= ExceptionCode.INVALID_ACCESS_ERR      \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index  unsigned long\n\t *   Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn this[index] || null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i<this.length;i++){\n\t\t\tserializeToString(this[i],buf,isHTML,nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t},\n\t/**\n\t * @private\n\t * @param {function (Node):boolean} predicate\n\t * @returns {Node[]}\n\t */\n\tfilter: function (predicate) {\n\t\treturn Array.prototype.filter.call(this, predicate);\n\t},\n\t/**\n\t * @private\n\t * @param {Node} item\n\t * @returns {number}\n\t */\n\tindexOf: function (item) {\n\t\treturn Array.prototype.indexOf.call(this, item);\n\t},\n};\n\nfunction LiveNodeList(node,refresh){\n\tthis._node = node;\n\tthis._refresh = refresh\n\t_updateLiveList(this);\n}\nfunction _updateLiveList(list){\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif(list._inc != inc){\n\t\tvar ls = list._refresh(list._node);\n\t\t//console.log(ls.length)\n\t\t__set__(list,'length',ls.length);\n\t\tcopy(ls,list);\n\t\tlist._inc = inc;\n\t}\n}\nLiveNodeList.prototype.item = function(i){\n\t_updateLiveList(this);\n\treturn this[i];\n}\n\n_extends(LiveNodeList,NodeList);\n\n/**\n * Objects implementing the NamedNodeMap interface are used\n * to represent collections of nodes that can be accessed by name.\n * Note that NamedNodeMap does not inherit from NodeList;\n * NamedNodeMaps are not maintained in any particular order.\n * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,\n * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,\n * and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities\n */\nfunction NamedNodeMap() {\n};\n\nfunction _findNodeIndex(list,node){\n\tvar i = list.length;\n\twhile(i--){\n\t\tif(list[i] === node){return i}\n\t}\n}\n\nfunction _addNamedNode(el,list,newAttr,oldAttr){\n\tif(oldAttr){\n\t\tlist[_findNodeIndex(list,oldAttr)] = newAttr;\n\t}else{\n\t\tlist[list.length++] = newAttr;\n\t}\n\tif(el){\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif(doc){\n\t\t\toldAttr && _onRemoveAttribute(doc,el,oldAttr);\n\t\t\t_onAddAttribute(doc,el,newAttr);\n\t\t}\n\t}\n}\nfunction _removeNamedNode(el,list,attr){\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list,attr);\n\tif(i>=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i<lastIndex){\n\t\t\tlist[i] = list[++i]\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif(el){\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif(doc){\n\t\t\t\t_onRemoveAttribute(doc,el,attr);\n\t\t\t\tattr.ownerElement = null;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tthrow new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength:0,\n\titem:NodeList.prototype.item,\n\tgetNamedItem: function(key) {\n//\t\tif(key.indexOf(':')>0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t *   (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument  DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI,  qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t *   (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t  or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n  \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n    // Introduced in DOM Level 2:\n    hasAttributes:function(){\n    \treturn this.attributes.length>0;\n    },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n    lookupPrefix:function(namespaceURI){\n    \tvar el = this;\n    \twhile(el){\n    \t\tvar map = el._nsMap;\n    \t\t//console.dir(map)\n    \t\tif(map){\n    \t\t\tfor(var n in map){\n\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\treturn n;\n\t\t\t\t\t}\n    \t\t\t}\n    \t\t}\n    \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n    \t}\n    \treturn null;\n    },\n    // Introduced in DOM Level 3:\n    lookupNamespaceURI:function(prefix){\n    \tvar el = this;\n    \twhile(el){\n    \t\tvar map = el._nsMap;\n    \t\t//console.dir(map)\n    \t\tif(map){\n    \t\t\tif(prefix in map){\n\t\t\t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n\t\t\t\t\t\treturn map[prefix] ;\n\t\t\t\t\t}\n    \t\t\t}\n    \t\t}\n    \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n    \t}\n    \treturn null;\n    },\n    // Introduced in DOM Level 3:\n    isDefaultNamespace:function(namespaceURI){\n    \tvar prefix = this.lookupPrefix(namespaceURI);\n    \treturn prefix == null;\n    }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '&lt;' ||\n         c == '>' && '&gt;' ||\n         c == '&' && '&amp;' ||\n         c == '\"' && '&quot;' ||\n         '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n        }while(node=node.nextSibling)\n    }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\nfunction _onUpdateChild(doc,el,newChild){\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif(newChild){\n\t\t\tcs[cs.length++] = newChild;\n\t\t}else{\n\t\t\t//console.log(1)\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile(child){\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild =child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * attributes;\n * children;\n *\n * writeable properties:\n * nodeValue,Attr:value,CharacterData:data\n * prefix\n */\nfunction _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\nfunction _appendSingleChild(parentNode,newChild){\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t}else{\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument,parentNode,newChild);\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName :  '#document',\n\tnodeType :  DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype :  null,\n\tdocumentElement :  null,\n\t_inc : 1,\n\n\tinsertBefore :  function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild :  function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.target = target;\n\t\tnode.nodeValue= node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml/#CleanAttrVals\n * @see https://www.w3.org/TR/xml/#NT-AttValue\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<&\"]/g,_xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\t// add namespaces for attributes\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\tvisibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });\n\t\t\t}else if(attr.nodeName == 'xmlns'){\n\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t}\n\t\t}\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = attr.prefix||'';\n\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t\t}\n\t\t\tserializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t}\n\n\t\t// add namespace for current node\n\t\tif (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {\n\t\t\tvar prefix = node.prefix||'';\n\t\t\tvar uri = node.namespaceURI;\n\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t}\n\n\t\tif(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){\n\t\t\tbuf.push('>');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('</',prefixedNodeName,'>');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&amp;` and `&lt;` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" &gt; \", and must, for compatibility,\n\t\t * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&]/g,_xmlEncoder)\n\t\t\t.replace(/]]>/g, ']]&gt;')\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '<![CDATA[',node.data,']]>');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"<!--\",node.data,\"-->\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('<!DOCTYPE ',node.name);\n\t\tif(pubid){\n\t\t\tbuf.push(' PUBLIC ', pubid);\n\t\t\tif (sysid && sysid!='.') {\n\t\t\t\tbuf.push(' ', sysid);\n\t\t\t}\n\t\t\tbuf.push('>');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"<?\",node.target,\" \",node.data,\"?>\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tbreak;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t\tbreak;\n\t//case ENTITY_REFERENCE_NODE:\n\t//case PROCESSING_INSTRUCTION_NODE:\n\t////case TEXT_NODE:\n\t//case CDATA_SECTION_NODE:\n\t//case COMMENT_NODE:\n\t//\tdeep = false;\n\t//\tbreak;\n\t//case DOCUMENT_NODE:\n\t//case DOCUMENT_TYPE_NODE:\n\t//cannot be imported.\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\t//can not hit in level3\n\t//default:throw e;\n\t}\n\tif(!node2){\n\t\tnode2 = node.cloneNode(false);//false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(importNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n//\n//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,\n//\t\t\t\t\tattributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};\nfunction cloneNode(doc,node,deep){\n\tvar node2 = new node.constructor();\n\tfor (var n in node) {\n\t\tif (Object.prototype.hasOwnProperty.call(node, n)) {\n\t\t\tvar v = node[n];\n\t\t\tif (typeof v != \"object\") {\n\t\t\t\tif (v != node2[n]) {\n\t\t\t\t\tnode2[n] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(node.childNodes){\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tvar attrs\t= node.attributes;\n\t\tvar attrs2\t= node2.attributes = new NamedNodeMap();\n\t\tvar len = attrs.length\n\t\tattrs2._ownerElement = node2;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tnode2.setAttributeNode(cloneNode(doc,attrs.item(i),true));\n\t\t}\n\t\tbreak;;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t}\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(cloneNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object,key,value){\n\tobject[key] = value\n}\n//do dynamic\ntry{\n\tif(Object.defineProperty){\n\t\tObject.defineProperty(LiveNodeList.prototype,'length',{\n\t\t\tget:function(){\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t}\n\t\t});\n\n\t\tObject.defineProperty(Node.prototype,'textContent',{\n\t\t\tget:function(){\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\n\t\t\tset:function(data){\n\t\t\t\tswitch(this.nodeType){\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\twhile(this.firstChild){\n\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif(data || String(data)){\n\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.data = data;\n\t\t\t\t\tthis.value = data;\n\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tfunction getTextContent(node){\n\t\t\tswitch(node.nodeType){\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\tvar buf = [];\n\t\t\t\tnode = node.firstChild;\n\t\t\t\twhile(node){\n\t\t\t\t\tif(node.nodeType!==7 && node.nodeType !==8){\n\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t}\n\t\t\t\treturn buf.join('');\n\t\t\tdefault:\n\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\n\t\t__set__ = function(object,key,value){\n\t\t\t//console.log(value)\n\t\t\tobject['$$'+key] = value\n\t\t}\n\t}\n}catch(e){//ie8\n}\n\n//if(typeof require == 'function'){\n\texports.DocumentType = DocumentType;\n\texports.DOMException = DOMException;\n\texports.DOMImplementation = DOMImplementation;\n\texports.Element = Element;\n\texports.Node = Node;\n\texports.NodeList = NodeList;\n\texports.XMLSerializer = XMLSerializer;\n//}\n","var freeze = require('./conventions').freeze;\n\n/**\n * The entities that are predefined in every XML document.\n *\n * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia\n */\nexports.XML_ENTITIES = freeze({amp:'&', apos:\"'\", gt:'>', lt:'<', quot:'\"'})\n\n/**\n * A map of currently 241 entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n       lt: '<',\n       gt: '>',\n       amp: '&',\n       quot: '\"',\n       apos: \"'\",\n       Agrave: \"À\",\n       Aacute: \"Á\",\n       Acirc: \"Â\",\n       Atilde: \"Ã\",\n       Auml: \"Ä\",\n       Aring: \"Å\",\n       AElig: \"Æ\",\n       Ccedil: \"Ç\",\n       Egrave: \"È\",\n       Eacute: \"É\",\n       Ecirc: \"Ê\",\n       Euml: \"Ë\",\n       Igrave: \"Ì\",\n       Iacute: \"Í\",\n       Icirc: \"Î\",\n       Iuml: \"Ï\",\n       ETH: \"Ð\",\n       Ntilde: \"Ñ\",\n       Ograve: \"Ò\",\n       Oacute: \"Ó\",\n       Ocirc: \"Ô\",\n       Otilde: \"Õ\",\n       Ouml: \"Ö\",\n       Oslash: \"Ø\",\n       Ugrave: \"Ù\",\n       Uacute: \"Ú\",\n       Ucirc: \"Û\",\n       Uuml: \"Ü\",\n       Yacute: \"Ý\",\n       THORN: \"Þ\",\n       szlig: \"ß\",\n       agrave: \"à\",\n       aacute: \"á\",\n       acirc: \"â\",\n       atilde: \"ã\",\n       auml: \"ä\",\n       aring: \"å\",\n       aelig: \"æ\",\n       ccedil: \"ç\",\n       egrave: \"è\",\n       eacute: \"é\",\n       ecirc: \"ê\",\n       euml: \"ë\",\n       igrave: \"ì\",\n       iacute: \"í\",\n       icirc: \"î\",\n       iuml: \"ï\",\n       eth: \"ð\",\n       ntilde: \"ñ\",\n       ograve: \"ò\",\n       oacute: \"ó\",\n       ocirc: \"ô\",\n       otilde: \"õ\",\n       ouml: \"ö\",\n       oslash: \"ø\",\n       ugrave: \"ù\",\n       uacute: \"ú\",\n       ucirc: \"û\",\n       uuml: \"ü\",\n       yacute: \"ý\",\n       thorn: \"þ\",\n       yuml: \"ÿ\",\n       nbsp: \"\\u00a0\",\n       iexcl: \"¡\",\n       cent: \"¢\",\n       pound: \"£\",\n       curren: \"¤\",\n       yen: \"¥\",\n       brvbar: \"¦\",\n       sect: \"§\",\n       uml: \"¨\",\n       copy: \"©\",\n       ordf: \"ª\",\n       laquo: \"«\",\n       not: \"¬\",\n       shy: \"­­\",\n       reg: \"®\",\n       macr: \"¯\",\n       deg: \"°\",\n       plusmn: \"±\",\n       sup2: \"²\",\n       sup3: \"³\",\n       acute: \"´\",\n       micro: \"µ\",\n       para: \"¶\",\n       middot: \"·\",\n       cedil: \"¸\",\n       sup1: \"¹\",\n       ordm: \"º\",\n       raquo: \"»\",\n       frac14: \"¼\",\n       frac12: \"½\",\n       frac34: \"¾\",\n       iquest: \"¿\",\n       times: \"×\",\n       divide: \"÷\",\n       forall: \"∀\",\n       part: \"∂\",\n       exist: \"∃\",\n       empty: \"∅\",\n       nabla: \"∇\",\n       isin: \"∈\",\n       notin: \"∉\",\n       ni: \"∋\",\n       prod: \"∏\",\n       sum: \"∑\",\n       minus: \"−\",\n       lowast: \"∗\",\n       radic: \"√\",\n       prop: \"∝\",\n       infin: \"∞\",\n       ang: \"∠\",\n       and: \"∧\",\n       or: \"∨\",\n       cap: \"∩\",\n       cup: \"∪\",\n       'int': \"∫\",\n       there4: \"∴\",\n       sim: \"∼\",\n       cong: \"≅\",\n       asymp: \"≈\",\n       ne: \"≠\",\n       equiv: \"≡\",\n       le: \"≤\",\n       ge: \"≥\",\n       sub: \"⊂\",\n       sup: \"⊃\",\n       nsub: \"⊄\",\n       sube: \"⊆\",\n       supe: \"⊇\",\n       oplus: \"⊕\",\n       otimes: \"⊗\",\n       perp: \"⊥\",\n       sdot: \"⋅\",\n       Alpha: \"Α\",\n       Beta: \"Β\",\n       Gamma: \"Γ\",\n       Delta: \"Δ\",\n       Epsilon: \"Ε\",\n       Zeta: \"Ζ\",\n       Eta: \"Η\",\n       Theta: \"Θ\",\n       Iota: \"Ι\",\n       Kappa: \"Κ\",\n       Lambda: \"Λ\",\n       Mu: \"Μ\",\n       Nu: \"Ν\",\n       Xi: \"Ξ\",\n       Omicron: \"Ο\",\n       Pi: \"Π\",\n       Rho: \"Ρ\",\n       Sigma: \"Σ\",\n       Tau: \"Τ\",\n       Upsilon: \"Υ\",\n       Phi: \"Φ\",\n       Chi: \"Χ\",\n       Psi: \"Ψ\",\n       Omega: \"Ω\",\n       alpha: \"α\",\n       beta: \"β\",\n       gamma: \"γ\",\n       delta: \"δ\",\n       epsilon: \"ε\",\n       zeta: \"ζ\",\n       eta: \"η\",\n       theta: \"θ\",\n       iota: \"ι\",\n       kappa: \"κ\",\n       lambda: \"λ\",\n       mu: \"μ\",\n       nu: \"ν\",\n       xi: \"ξ\",\n       omicron: \"ο\",\n       pi: \"π\",\n       rho: \"ρ\",\n       sigmaf: \"ς\",\n       sigma: \"σ\",\n       tau: \"τ\",\n       upsilon: \"υ\",\n       phi: \"φ\",\n       chi: \"χ\",\n       psi: \"ψ\",\n       omega: \"ω\",\n       thetasym: \"ϑ\",\n       upsih: \"ϒ\",\n       piv: \"ϖ\",\n       OElig: \"Œ\",\n       oelig: \"œ\",\n       Scaron: \"Š\",\n       scaron: \"š\",\n       Yuml: \"Ÿ\",\n       fnof: \"ƒ\",\n       circ: \"ˆ\",\n       tilde: \"˜\",\n       ensp: \" \",\n       emsp: \" \",\n       thinsp: \" \",\n       zwnj: \"‌\",\n       zwj: \"‍\",\n       lrm: \"‎\",\n       rlm: \"‏\",\n       ndash: \"–\",\n       mdash: \"—\",\n       lsquo: \"‘\",\n       rsquo: \"’\",\n       sbquo: \"‚\",\n       ldquo: \"“\",\n       rdquo: \"”\",\n       bdquo: \"„\",\n       dagger: \"†\",\n       Dagger: \"‡\",\n       bull: \"•\",\n       hellip: \"…\",\n       permil: \"‰\",\n       prime: \"′\",\n       Prime: \"″\",\n       lsaquo: \"‹\",\n       rsaquo: \"›\",\n       oline: \"‾\",\n       euro: \"€\",\n       trade: \"™\",\n       larr: \"←\",\n       uarr: \"↑\",\n       rarr: \"→\",\n       darr: \"↓\",\n       harr: \"↔\",\n       crarr: \"↵\",\n       lceil: \"⌈\",\n       rceil: \"⌉\",\n       lfloor: \"⌊\",\n       rfloor: \"⌋\",\n       loz: \"◊\",\n       spades: \"♠\",\n       clubs: \"♣\",\n       hearts: \"♥\",\n       diams: \"♦\"\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES\n","var dom = require('./dom')\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = require('./dom-parser').DOMParser\n","var NAMESPACE = require(\"./conventions\").NAMESPACE;\n\n//[4]   \tNameStartChar\t   ::=   \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a]   \tNameChar\t   ::=   \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5]   \tName\t   ::=   \tNameStartChar (NameChar)*\nvar nameStartChar = /[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]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring \nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el<el />\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\t\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif(k in entityMap){\n\t\t\treturn entityMap[k]; \n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\t\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t    \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t    \t\t\tdoc.appendChild(text);\n\t    \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\t\t\t\t\t\n\t        \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t        \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t        \t\tend = tagStart+1+tagName.length;\n\t        \t}else if(tagName.match(/\\s</)){\n\t        \t\ttagName = tagName.replace(/[\\s<].*/,'');\n\t        \t\terrorHandler.error(\"end tag name: \"+tagName+' maybe not complete');\n\t        \t\tend = tagStart+1+tagName.length;\n\t\t\t\t}\n\t\t\t\tvar localNSMap = config.localNSMap;\n\t\t\t\tvar endMatch = config.tagName == tagName;\n\t\t\t\tvar endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()\n\t\t        if(endIgnoreCaseMach){\n\t\t        \tdomBuilder.endElement(config.uri,config.localName,tagName);\n\t\t\t\t\tif(localNSMap){\n\t\t\t\t\t\tfor(var prefix in localNSMap) {\n\t\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!endMatch){\n\t\t            \terrorHandler.fatalError(\"end tag name: \"+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case\n\t\t\t\t\t}\n\t\t        }else{\n\t\t        \tparseStack.push(config)\n\t\t        }\n\t\t\t\t\n\t\t\t\tend++;\n\t\t\t\tbreak;\n\t\t\t\t// end elment\n\t\t\tcase '?':// <?...?>\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// <!doctype,<![CDATA,<!--\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseDCC(source,tagStart,domBuilder,errorHandler);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tvar el = new ElementAttributes();\n\t\t\t\tvar currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\t\t\t\t//elStartEnd\n\t\t\t\tvar end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);\n\t\t\t\tvar len = el.length;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tif(!entityMap.nbsp){\n\t\t\t\t\t\terrorHandler.warning('unclosed xml attribute');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(locator && len){\n\t\t\t\t\tvar locator2 = copyLocator(locator,{});\n\t\t\t\t\t//try{//attribute position fixed\n\t\t\t\t\tfor(var i = 0;i<len;i++){\n\t\t\t\t\t\tvar a = el[i];\n\t\t\t\t\t\tposition(a.offset);\n\t\t\t\t\t\ta.locator = copyLocator(locator,{});\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator2\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator;\n\t\t\t\t}else{\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (NAMESPACE.isHTML(el.uri) && !el.closed) {\n\t\t\t\t\tend = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)\n\t\t\t\t} else {\n\t\t\t\t\tend++;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(e){\n\t\t\tif (e instanceof ParseError) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\terrorHandler.error('element parse error: '+e)\n\t\t\tend = -1;\n\t\t}\n\t\tif(end>start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(qname, value, startIndex)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t//console.log(attrName,value,start,p)\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\t//console.dir(el)\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed  = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value.replace(/&#?\\w+;/g,entityReplacer), start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName =  el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute \n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value) \n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\t\t\t\t\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart =  source.indexOf('</'+tagName+'>',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\t\t\t\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos =  source.lastIndexOf('</'+tagName+'>')\n\t\tif(pos<elStartEnd){//忘记闭合\n\t\t\tpos = source.lastIndexOf('</'+tagName)\n\t\t}\n\t\tcloseMap[tagName] =pos\n\t}\n\treturn pos<elStartEnd;\n\t//} \n}\n\nfunction _copy (source, target) {\n\tfor (var n in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, n)) {\n\t\t\ttarget[n] = source[n];\n\t\t}\n\t}\n}\n\nfunction parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'\n\tvar next= source.charAt(start+2)\n\tswitch(next){\n\tcase '-':\n\t\tif(source.charAt(start + 3) === '-'){\n\t\t\tvar end = source.indexOf('-->',start+4);\n\t\t\t//append comment source.substring(4,end)//<!--\n\t\t\tif(end>start){\n\t\t\t\tdomBuilder.comment(source,start+4,end-start-4);\n\t\t\t\treturn end+3;\n\t\t\t}else{\n\t\t\t\terrorHandler.error(\"Unclosed comment\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}else{\n\t\t\t//error\n\t\t\treturn -1;\n\t\t}\n\tdefault:\n\t\tif(source.substr(start+3,6) == 'CDATA['){\n\t\t\tvar end = source.indexOf(']]>',start+9);\n\t\t\tdomBuilder.startCDATA();\n\t\t\tdomBuilder.characters(source,start+9,end-start-9);\n\t\t\tdomBuilder.endCDATA() \n\t\t\treturn end+3;\n\t\t}\n\t\t//<!DOCTYPE\n\t\t//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) \n\t\tvar matchs = split(source,start);\n\t\tvar len = matchs.length;\n\t\tif(len>1 && /!doctype/i.test(matchs[0][0])){\n\t\t\tvar name = matchs[1][0];\n\t\t\tvar pubid = false;\n\t\t\tvar sysid = false;\n\t\t\tif(len>3){\n\t\t\t\tif(/^public$/i.test(matchs[2][0])){\n\t\t\t\t\tpubid = matchs[3][0];\n\t\t\t\t\tsysid = len>4 && matchs[4][0];\n\t\t\t\t}else if(/^system$/i.test(matchs[2][0])){\n\t\t\t\t\tsysid = matchs[3][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastMatch = matchs[len-1]\n\t\t\tdomBuilder.startDTD(name, pubid, sysid);\n\t\t\tdomBuilder.endDTD();\n\t\t\t\n\t\t\treturn lastMatch.index+lastMatch[0].length\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n\nfunction parseInstruction(source,start,domBuilder){\n\tvar end = source.indexOf('?>',start);\n\tif(end){\n\t\tvar match = source.substring(start,end).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);\n\t\tif(match){\n\t\t\tvar len = match[0].length;\n\t\t\tdomBuilder.processingInstruction(match[1], match[2]) ;\n\t\t\treturn end+2;\n\t\t}else{//error\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction ElementAttributes(){\n\tthis.attributeNames = {}\n}\nElementAttributes.prototype = {\n\tsetTagName:function(tagName){\n\t\tif(!tagNamePattern.test(tagName)){\n\t\t\tthrow new Error('invalid tagName:'+tagName)\n\t\t}\n\t\tthis.tagName = tagName\n\t},\n\taddValue:function(qName, value, offset) {\n\t\tif(!tagNamePattern.test(qName)){\n\t\t\tthrow new Error('invalid attribute:'+qName)\n\t\t}\n\t\tthis.attributeNames[qName] = this.length;\n\t\tthis[this.length++] = {qName:qName,value:value,offset:offset}\n\t},\n\tlength:0,\n\tgetLocalName:function(i){return this[i].localName},\n\tgetLocator:function(i){return this[i].locator},\n\tgetQName:function(i){return this[i].qName},\n\tgetURI:function(i){return this[i].uri},\n\tgetValue:function(i){return this[i].value}\n//\t,getIndex:function(uri, localName)){\n//\t\tif(localName){\n//\t\t\t\n//\t\t}else{\n//\t\t\tvar qName = uri\n//\t\t}\n//\t},\n//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\n//\tgetType:function(uri,localName){}\n//\tgetType:function(i){},\n}\n\n\n\nfunction split(source,start){\n\tvar match;\n\tvar buf = [];\n\tvar reg = /'[^']+'|\"[^\"]+\"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;\n\treg.lastIndex = start;\n\treg.exec(source);//skip <\n\twhile(match = reg.exec(source)){\n\t\tbuf.push(match);\n\t\tif(match[1])return buf;\n\t}\n}\n\nexports.XMLReader = XMLReader;\nexports.ParseError = ParseError;\n","import { showErrorMsg, TYPE_OF_MSG } from '../helpers/messages';\n\nlet globalAdBlock;\n\nconst REQUEST_URL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';\nconst REQUEST_CONFIG = {\n  method: 'HEAD',\n  mode: 'no-cors',\n};\n\nconst checkAdsBlocked = () =>\n  fetch(REQUEST_URL, REQUEST_CONFIG)\n    .then(\n      (response) => response.redirected // ads are blocked if request is redirected\n    ) // (we assume the REQUEST_URL doesn't use redirections)\n    .catch(\n      () => true // ads are blocked if request fails\n    ); // (we do not consider connction problems)\n\nconst setupAdBlock = async () => {\n  if (globalAdBlock === undefined || globalAdBlock === '') {\n    globalAdBlock = await checkAdsBlocked();\n  }\n  return globalAdBlock;\n};\n\nconst hasAdBlock = () => globalAdBlock;\n\nconst showAdBlockBreaker = (player) => {\n  player.on('ready', () => {\n    player.trigger('tracking:adBlocked');\n    showErrorMsg(player, TYPE_OF_MSG.NO_AD);\n  });\n};\n\nexport { hasAdBlock, showAdBlockBreaker, setupAdBlock };\n","const DEFAULT_PARAMS = {\n  p: true,\n  autoPlay: false,\n  logo: true,\n  playlistId: false,\n  calhau: false,\n  share: true,\n  sz: false,\n  full: true,\n  customAdHash: '',\n  referrerUrl: '',\n  externalLinks: true,\n  debug: false,\n  debugHash: false,\n  debugRelated: false,\n  timerRelated: true,\n  logoRecord: false,\n  contextModal: false,\n  parentUrl: 'https://record.r7.com/',\n  t: '0',\n  noTitle: false,\n  endBehavior: 'default',\n};\n\nexport default DEFAULT_PARAMS;\n","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n  }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  Object.defineProperty(Constructor, \"prototype\", {\n    writable: false\n  });\n  return Constructor;\n}","/**\n * BrowserDetector\n *\n * This util checks the current browser name and version and offers a\n * convinient API to test for specific versions or browsers and whether\n * the current visitor uses a supported browser or not.\n */\nexport default class BrowserDetector {\n  constructor() {\n    this.browser = {};\n    this.unsupportedBrowsers = {\n      Chrome: 80,\n      Firefox: 70,\n      IE: 10,\n      Edge: 80,\n      Opera: 60,\n      Safari: 10,\n    };\n\n    this.detectBrowser();\n  }\n\n  /**\n   * Detects the current browser and its version number.\n   *\n   * @returns {Object} An object with keys for browser `name` and `version`.\n   */\n  detectBrowser() {\n    this.browser = (() => {\n      const ua = navigator.userAgent;\n      let tem;\n      let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n\n      if (/trident/i.test(M[1])) {\n        tem = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n        return { name: 'IE', version: tem[1] || '' };\n      }\n\n      if (M[1] === 'Chrome') {\n        tem = ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n        if (tem != null) {\n          return { name: tem[1].replace('OPR', 'Opera'), version: tem[2] };\n        }\n      }\n\n      M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];\n\n      tem = ua.match(/version\\/(\\d+)/i);\n      if (tem != null) {\n        M.splice(1, 1, tem[1]);\n      }\n\n      return { name: M[0], version: M[1] };\n    })();\n  }\n\n  /**\n   * Checks if the current browser is Internet Explorer.\n   *\n   * @returns {Boolean}\n   */\n  get isIE() {\n    return this.browser.name === 'IE';\n  }\n\n  /**\n   * Checks if the current browser is Edge.\n   *\n   * @returns {Boolean}\n   */\n  get isEdge() {\n    return this.browser.name === 'Edge';\n  }\n\n  /**\n   * Checks if the current browser is from Microsoft (Edge\n   * or Internet Explorer).\n   *\n   * @returns {Boolean}\n   */\n  get isMicrosoft() {\n    return this.isIE || this.isEdge;\n  }\n\n  /**\n   * Checks if the current browser is Firefox.\n   *\n   * @returns {Boolean}\n   */\n  get isFirefox() {\n    return this.browser.name === 'Firefox';\n  }\n\n  /**\n   * Checks if the current browser is Chrome.\n   *\n   * @returns {Boolean}\n   */\n  get isChrome() {\n    return this.browser.name === 'Chrome';\n  }\n\n  /**\n   * Checks if the current browser is Safari.\n   *\n   * @returns {Boolean}\n   */\n  get isSafari() {\n    return this.browser.name === 'Safari';\n  }\n\n  /**\n   * Checks if the current browser is from an Android device.\n   *\n   * @returns {Boolean}\n   */\n  get isAndroid() {\n    this.android = /Android/i.test(navigator.userAgent);\n    return this.android;\n  }\n\n  /**\n   * Checks if the current browser is from a BlackBerry device.\n   *\n   * @returns {Boolean}\n   */\n  get isBlackBerry() {\n    this.blackberry = /BlackBerry/i.test(navigator.userAgent);\n    return this.blackberry;\n  }\n\n  /**\n   * Checks if the current browser is from a Windows Mobile device.\n   *\n   * @returns {Boolean}\n   */\n  get isWindowsMobile() {\n    this.windowsMobile = /IEMobile/i.test(navigator.userAgent);\n    return this.windowsMobile;\n  }\n\n  /**\n   * Checks if the current browser is Mobile Safari.\n   *\n   * @returns {Boolean}\n   */\n  get isIOS() {\n    this.ios = /iPhone|iPad|iPod/i.test(navigator.userAgent);\n    return this.ios;\n  }\n\n  /**\n   * Checks if the current browser is a mobile browser.\n   *\n   * @returns {Boolean}\n   */\n  get isMobile() {\n    return this.isAndroid || this.isBlackBerry || this.isWindowsMobile || this.isIOS;\n  }\n\n  /**\n   * Checks if the current browser is supported by\n   * our environment.\n   *\n   * @returns {Boolean}\n   */\n  isSupported() {\n    if (this.unsupportedBrowsers[this.browser.name]) {\n      if (+this.browser.version > this.unsupportedBrowsers[this.browser.name]) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n}\n","export default function _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}","import DEFAULT_PARAMS from '../utils/default-params';\nimport BrowserDetector from './browser-detector';\n\nlet relatedVideos = [];\n\nexport const BOOLEAN_MAP = {\n  truthy: [true, 'true', 1, '1', 'on', 'yes'],\n  falsy: [false, 'false', 0, '0', 'off', 'no'],\n};\n\nexport const toBoolean = (param) => BOOLEAN_MAP.truthy.includes(param);\n\nexport const isBoolean = (param) => [...BOOLEAN_MAP.truthy, ...BOOLEAN_MAP.falsy].includes(param);\n\nexport const isArcEnviroment = () => document.querySelector('[data-arc]') !== null;\n\nexport const isArcLive = () => document.querySelector('[data-arc-video=\"live\"]') !== null;\n\nexport const arcGeoBlock = (player) =>\n  player.el_.dataset.arcGeoblocked &&\n  (player.el_.dataset.arcGeoblocked === true || player.el_.dataset.arcGeoblocked === 'true');\n\nexport const completeWithDefaultParams = (playerParams) => {\n  const defaultParams = DEFAULT_PARAMS;\n\n  const newParams = {};\n\n  Object.keys(defaultParams).forEach((param) => {\n    let paramToUse = defaultParams[param];\n\n    if (Object.prototype.hasOwnProperty.call(playerParams, param)) {\n      paramToUse = playerParams[param];\n    }\n\n    newParams[param] = paramToUse;\n  });\n\n  return newParams;\n};\n\nexport const updateParamsFromUrl = (urlParams, targetParams) => {\n  const newParams = { ...targetParams };\n\n  if (urlParams) {\n    Object.keys(urlParams).forEach((param) => {\n      const isValidParam = Object.prototype.hasOwnProperty.call(targetParams, param);\n      if (isValidParam) {\n        newParams[param] = isBoolean(urlParams[param]) ? toBoolean(urlParams[param]) : urlParams[param];\n      }\n    });\n  }\n  return newParams;\n};\n\nexport const toNumber = (param) => parseInt(param, 10);\n\nexport const toString = (param) => (param === '' ? false : param);\n\nexport const formatTwoDigits = (value) => `0${value}`.slice(-2);\n\nexport const verifyUrl = (url) => {\n  const defaultUrl = '#';\n  return url.includes('r7.com') ? url : defaultUrl;\n};\n\nexport const getBaseWebbUrl = (link) => {\n  const regExpUrl = link.match(/((qa)[\\d])/g);\n  if (regExpUrl) {\n    const qaNumber = parseInt(regExpUrl.toString().split('').reverse().join(''), 10);\n    return `//cms-media-api-qa${qaNumber}.ir7.com.br`;\n  }\n  return '//cms-media-api.r7.com';\n};\n\nexport const verifyLocal = (link) => {\n  const url = getBaseWebbUrl(link);\n  return `${url}/video/`;\n};\n\nexport const isSuportedBrowser = () => {\n  const browserDetector = new BrowserDetector();\n  return browserDetector.isSupported();\n};\n\nexport const isMobile = () => {\n  const browserDetector = new BrowserDetector();\n  return browserDetector.isMobile;\n};\n\nexport const isChromeAndroid = () => {\n  const browserDetector = new BrowserDetector();\n\n  return browserDetector.isAndroid && browserDetector.isChrome;\n};\n\nexport const isSafariIos = () => {\n  const browserDetector = new BrowserDetector();\n\n  return browserDetector.isIOS || browserDetector.isSafari;\n};\n\nexport const formatDate = (date) => {\n  const newDate = new Date(date);\n\n  const getDay = formatTwoDigits(newDate.getDate());\n  const getMonth = formatTwoDigits(newDate.getMonth() + 1);\n  const getYear = newDate.getFullYear();\n  const getFullDate = `${getDay}/${getMonth}/${getYear}`;\n  const getHour = formatTwoDigits(newDate.getHours());\n  const getMinutes = formatTwoDigits(newDate.getMinutes());\n  const getFullTime = `${getHour}:${getMinutes}`;\n\n  return {\n    getDay,\n    getMonth,\n    getYear,\n    getFullDate,\n    getFullTime,\n  };\n};\n\nexport const isLiveVideo = (duration) => isArcLive() || duration === Infinity;\n\nexport const fetchRelatedVideos = (player, videoId, callbackFunc, useMostViewedInstead) => {\n  if (relatedVideos.length === 3) {\n    callbackFunc(player, relatedVideos);\n    return false;\n  }\n\n  const pathname = useMostViewedInstead ? '/videos/most_viewed' : `/videos/related/${videoId}`;\n  const locationUrl = getBaseWebbUrl(window.location.href);\n  const url = locationUrl + pathname;\n\n  fetch(url)\n    .then((data) => data.json())\n    .then((data) => {\n      relatedVideos = data.filter((obj, idx) => obj && idx < 3);\n      callbackFunc(player, relatedVideos);\n    })\n    .catch(() => !useMostViewedInstead && fetchRelatedVideos(player, videoId, callbackFunc, true));\n\n  return true;\n};\n\nexport const isLocalhost = () => /(cma-dev|localhost)/.test(window.location.hostname);\n\nexport const isDevelopEnv = () => /(^\\d{1,3}|ir7\\.com|localhost)/.test(window.location.hostname);\n\nexport const isInIframe = () => window.location !== window.parent.location;\n\nexport const disableDefaultAutoplay = () => {\n  const videos = document.querySelectorAll('.video-js');\n  videos.forEach((video) => {\n    const v = video;\n    v.autoplay = false;\n    v.controls = false;\n  });\n};\n\n// em performance, melhora o perspectiva do usuário em relação\n// ao carregamento da imagem\nexport const preloadImage = (src) => {\n  const img = new Image();\n  img.src = src;\n};\n\nexport const searchToObject = () => {\n  const pairs = window.location.search.substring(1).split('&');\n  if (pairs[0] !== '') {\n    const obj = {};\n\n    pairs.forEach((pair) => {\n      const [key, value] = pair.split('=');\n      const decodeKey = decodeURIComponent(key);\n      obj[decodeKey] = decodeURIComponent(value);\n    });\n\n    return obj;\n  }\n\n  return false;\n};\n\nexport const isEmbeded = () => window.self !== window.top;\n\nexport const getPlayerDurationSegments = (duration) => {\n  const segments = {\n    firstQuarter: 0,\n    secondQuarter: 0,\n    thirdQuarter: 0,\n  };\n  if (duration > 0) {\n    // A duração vem em milisegundos para garantir que\n    // ao dividir os quartos deem valores 'inteiros'\n    // é necessario converter de milisegundos para segundos.\n    const durationInSeconds = duration / 1000;\n\n    const quarterInSeconds = (durationInSeconds / 4).toFixed(0);\n\n    // O valor inteiro em segundos do quarto de duração\n    // é convertido de volta para milisegundos para garantir\n    // a consistencia com a duração vinda do player\n    const quarterInMiliseconds = quarterInSeconds * 1000;\n\n    segments.firstQuarter = +quarterInMiliseconds;\n    segments.secondQuarter = +quarterInMiliseconds * 2;\n    segments.thirdQuarter = +quarterInMiliseconds * 3;\n  }\n\n  return segments;\n};\n\nexport const formatDurationFromMetadata = (duration) => {\n  const durationInSeconds = parseInt(duration / 1000, 10);\n\n  const hour = Math.floor(durationInSeconds / 3600);\n  const minute = Math.floor((durationInSeconds % 3600) / 60);\n  const second = Math.floor((durationInSeconds % 3600) % 60);\n\n  const formatedDuration = {\n    hour: formatTwoDigits(hour),\n    minute: formatTwoDigits(minute),\n    second: formatTwoDigits(second),\n  };\n\n  if (formatedDuration.hour > 0) {\n    return `${formatedDuration.hour}:${formatedDuration.minute}:${formatedDuration.second}`;\n  }\n\n  return `${formatedDuration.minute}:${formatedDuration.second}`;\n};\n\nexport const getAdPlacement = (player) => {\n  const fullDuration = player.duration();\n  const currTime = player.currentTime();\n\n  const percentToUse = 5;\n  const threshold = (fullDuration * percentToUse) / 100;\n  const prerollThreshold = threshold;\n  const postrollThreshold = fullDuration - threshold;\n\n  switch (true) {\n    case currTime <= prerollThreshold:\n      return 'pre-roll';\n    case currTime > prerollThreshold && currTime < postrollThreshold:\n      return 'mid-roll';\n    case currTime >= postrollThreshold:\n      return 'post-roll';\n    default:\n      return undefined;\n  }\n};\n\nexport const showChromecastBtn = (player, show = true) => {\n  const timer = setInterval(() => {\n    const chromecastBtn = player.controlBar.getChild('chromecastButton');\n\n    if (chromecastBtn) {\n      if (show) {\n        chromecastBtn.enable();\n      } else {\n        chromecastBtn.disable();\n      }\n      clearInterval(timer);\n    }\n  }, 500);\n};\n\nexport const verifyEndCasting = (player) => {\n  const duration = parseInt(player.duration().toFixed(0), 10);\n  const currentTime = parseInt(player.currentTime().toFixed(0), 10);\n\n  const floorTime = currentTime - 1;\n  const ceilTime = currentTime + 1;\n\n  const verifiedDuration = duration !== 0;\n  const verifiedTime = currentTime === duration || floorTime === duration || ceilTime === duration;\n\n  return !(verifiedDuration && verifiedTime);\n};\n\nexport const getMediaInfo = (videoId, callback) => {\n  try {\n    const locationUrl = verifyLocal(window.location.href);\n    const url = locationUrl + videoId;\n\n    if (videoId) {\n      fetch(url)\n        .then((data) => data.json())\n        .then((response) => callback(response));\n    }\n  } catch (e) {\n    window.console.log(e);\n  }\n};\n\nexport const cleanUrl = (url) => {\n  const protocolRegex = /((https?:)?\\/\\/)/g;\n  const cleanedProtocol = url.replace(protocolRegex, '');\n  const portRegex = /:\\d+/g;\n\n  return cleanedProtocol.replace(portRegex, '');\n};\n\nexport const fixUrlProtocol = (url) => {\n  const cleanedUrl = cleanUrl(url);\n\n  return `https://${cleanedUrl}`;\n};\n\nexport const removeSpecialChar = (sentence) => sentence.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n\nexport const replaceSpaces = (sentence) => sentence.replace(/\\s/gi, '-');\n\nexport const sanitizeSectionName = (sectionName) => {\n  let sanitizedSectionName = removeSpecialChar(sectionName);\n  sanitizedSectionName = replaceSpaces(sanitizedSectionName).toLowerCase();\n\n  return sanitizedSectionName;\n};\n\nexport const getEventByContext = () => (isMobile() ? 'touchend' : 'click');\n\nexport const isLegacyVideo = (player) => {\n  const playerUrl = player.tagAttributes['data-player-url'] || player.tagAttributes.player_url;\n\n  return playerUrl === 'legacy';\n};\n\nexport const getRelatedVideos = (player) =>\n  player.tagAttributes['data-related-videos'] ? JSON.parse(player.tagAttributes['data-related-videos']) : [];\n\nexport const getVideoId = (player) => {\n  if (isArcEnviroment() && !isLegacyVideo(player)) {\n    const playerUrl = player.tagAttributes['data-player-url'];\n    const regex = /\\/player\\/([^/]+)/;\n    const match = playerUrl.match(regex);\n    const arcVideoId = match ? match[1] : '0';\n\n    return arcVideoId;\n  }\n  const src = player.src();\n  const url = new URL(src);\n  const vId = url.pathname.split('/').find((p, i, a) => i > 0 && a[i - 1] === 'i');\n\n  return vId;\n};\n\nexport const fixLegacyUrl = (url) => {\n  if (!/^https?:\\/\\//i.test(url)) {\n    return `//${url}`;\n  }\n  return url;\n};\n\nexport const changeCurrentUrl = (newUrl) => {\n  const formatedUrl = newUrl.includes('http') ? newUrl : `https://${newUrl}`;\n  window.location.href = formatedUrl;\n};\n","let currentPlayer;\nlet modal;\nlet modalType;\n\nconst MODAL_CLASS = 'vjs-r7-block-msg';\n\nconst getDefaultTemplate = (data) => {\n  const { href } = data.href ? data : window.location;\n  const { buttonLabel } = data.buttonLabel ? data : { buttonLabel: 'Recarregar' };\n  const button = `<a href=\"${href}\" title=\"Recarregar\" class=\"${MODAL_CLASS}__button\" target=\"_self\" rel=\"noreferrer noopener\" data-layer-dispatch-cancel>${buttonLabel}</a>`;\n  const ctaButton = data.button ? button : '';\n  const outlineIconClass = data.outlineIcon ? `${MODAL_CLASS}__icon--outline` : '';\n  const outlineContainedClass = data.outlineContained ? `${MODAL_CLASS}__icon--contained` : '';\n\n  const template = `\n    <div class=\"${MODAL_CLASS}__icon ${outlineIconClass} ${outlineContainedClass}\">${data.icon}</div>\n    <div class=\"${MODAL_CLASS}__title\">${data.title}</div>\n    <div class=\"${MODAL_CLASS}__desc\">${data.desc}</div>\n    ${ctaButton}`;\n\n  const container = document.createElement('div');\n  container.classList.add(`${MODAL_CLASS}__container`);\n  container.innerHTML = template;\n\n  return container;\n};\n\nconst getBlockContent = () =>\n  getDefaultTemplate({\n    icon: 'lock',\n    outlineContained: true,\n    title: 'Conteúdo bloqueado',\n    desc: 'O conteúdo desse vídeo não pode ser exibido nessa página. Assista-o em uma página R7.COM',\n    button: true,\n    buttonLabel: 'Assistir no R7',\n    href: 'https://www.r7.com',\n  });\n\nconst getGeoBlockContent = () =>\n  getDefaultTemplate({\n    icon: 'explore',\n    outlineIcon: true,\n    title: 'Conteúdo bloqueado',\n    desc: 'Lamentamos, mas o vídeo que está tentando assisitr é de exibição exclusiva em território brasileiro :-(',\n    button: false,\n  });\n\nconst getErrorContent = () =>\n  getDefaultTemplate({\n    icon: 'error_outline',\n    title: 'Oops! Algo deu errado',\n    desc: 'Por favor, recarregue a página.',\n    button: true,\n  });\n\nconst getBlockAdsContent = () =>\n  getDefaultTemplate({\n    icon: 'block',\n    outlineIcon: true,\n    title: 'Anúncios bloqueados',\n    desc: 'Para continuar assistindo esse vídeo, por favor desabilite seu bloqueador de anúncios e recarregue a página.',\n    button: true,\n  });\n\nconst getOldBrowserContent = () =>\n  getDefaultTemplate({\n    icon: 'browser_not_supported',\n    title: 'Navegador desatualizado',\n    desc: 'Seu navegador parece não nos entender! Por favor, atualize-o para reproduzir este conteúdo.',\n    button: false,\n  });\n\nconst TYPE_OF_MSG = {\n  BLOCK: getBlockContent,\n  GEO_BLOCK: getGeoBlockContent,\n  ERROR: getErrorContent,\n  NO_AD: getBlockAdsContent,\n  OLD_BROWSER: getOldBrowserContent,\n};\n\nconst getModalOptions = () => ({\n  label: '',\n  fillAlways: true,\n  temporary: false,\n});\n\nconst getSuggestedContent = (type) => (type ? type() : TYPE_OF_MSG.ERROR());\n\nconst showDialog = () => {\n  const modalOptions = getModalOptions();\n  const suggestedContent = getSuggestedContent(modalType);\n\n  modal = currentPlayer.createModal(suggestedContent, modalOptions);\n  modal.addClass(MODAL_CLASS);\n  modal.closeable(false);\n};\n\nconst showErrorMsg = (player, type) => {\n  // A partir de 28/10/2020, não deve ser mais exibida ess tela de bloqueio\n  // Somente deve ser registrado o evento no analytics (etapa anterior)\n  if (type === TYPE_OF_MSG.OLD_BROWSER) {\n    return undefined;\n  }\n\n  currentPlayer = player;\n  modalType = type;\n  return showDialog();\n};\n\nexport { showErrorMsg, TYPE_OF_MSG };\n","const pt = {\n  pt: {\n    Quality: 'Qualidade',\n    Auto: 'Automática',\n    Mute: 'Mudo',\n    Unmute: 'Ativar Som',\n    Share: 'Compartilhar',\n    Copy: 'Copiar',\n    Copied: 'Copiado',\n    LIVE: 'AO VIVO',\n    'Seek back 10 seconds': 'Voltar 10 segundos',\n    'Seek forward 10 seconds': 'Avançar 10 segundos',\n    'Direct Link': 'Incorporar',\n    'Playback Rate': 'Velocidade',\n    'Open Chromecast menu': 'Abrir no Chromecast',\n    'No video has been loaded': 'Nenhum vídeo foi carregado',\n    'Could not download the video': 'Não foi possível realizar o download do vídeo',\n    'The video connection was lost, please confirm you are connected to the internet':\n      'A conexão com o vídeo foi perdida. Por favor, confirme que está conectado a internet',\n    'The video is bad or in a format that cannot be played on your browser':\n      'O vídeo está em um formato que o seu browser não suporta',\n    'This video is either unavailable or not supported in this browser':\n      'O vídeo não está disponível ou não é suportado pelo seu browser',\n    'Error Code': 'Código do Erro',\n    'Technical details': 'Detalhes técnicos',\n    'The video download was cancelled': 'O download do vídeo foi cancelado',\n    'The video you are trying to watch is encrypted and we do not know how to decrypt it':\n      'O vídeo que você está tentando assistir é criptografado e nós não sabemos como decodificá-lo',\n    'An unanticipated problem was encountered, check back soon and try again':\n      'Aconteceu um erro inesperado, tente novamente mais tarde',\n    'The media could not be loaded, either because the server or network failed or because the format is not supported.':\n      'O vídeo não pode ser carregado, ou porque houve um problema na rede ou no servidor, ou porque formato do vídeo não é compatível.',\n    'subtitles settings': 'Configurações',\n    'subtitles off': 'Desativar',\n    Text: 'Texto da legenda',\n    Background: 'Fundo da legenda',\n    Window: 'Moldura da legenda',\n    White: 'Branco',\n    Black: 'Preto',\n    Red: 'Vermelho',\n    Green: 'Verde',\n    Blue: 'Azul',\n    Yellow: 'Amarelo',\n    Magenta: 'Magenta',\n    Cyan: 'Ciano',\n    Opaque: 'Opaco',\n    'Semi-Transparent': 'Semi-Transparente',\n    Transparent: 'Transparente',\n    'Font Size': 'Tamanho da Fonte',\n    'Text Edge Style': 'Estilo da Fonte',\n    None: 'Nenhum',\n    Raised: 'Elevado',\n    Depressed: 'Afundado',\n    Uniform: 'Uniforme',\n    Dropshadow: 'Sombreado',\n    'Font Family': 'Fonte da legenda',\n    Reset: 'Resetar',\n    Done: 'Salvar',\n  },\n};\n\nexport default pt;\n","/**\n * Returns an object with the player's parameters\n * sent by the <video> tag.\n *\n * Example Usage:\n * const params = getParams(player)\n *\n * @function getParams\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport {\n  updateParamsFromUrl,\n  searchToObject,\n  toBoolean,\n  toString,\n  toNumber,\n  completeWithDefaultParams,\n} from '../helpers/helpers';\n\nconst getParams = (player) => {\n  const r7player = player;\n  const rawParams = r7player.tagAttributes['data-player-params'] || r7player.tagAttributes.player_params;\n\n  const playerParams = JSON.parse(rawParams);\n  const urlParams = searchToObject();\n\n  const verifiedParams = completeWithDefaultParams(playerParams);\n\n  const paramsToUse = updateParamsFromUrl(urlParams, verifiedParams);\n\n  const {\n    autoPlay,\n    calhau,\n    customAdHash,\n    debug,\n    debugHash,\n    debugRelated,\n    externalLinks,\n    full,\n    logo,\n    p,\n    share,\n    timerRelated,\n    playlistId,\n    referrerUrl,\n    logoRecord,\n    contextModal,\n    parentUrl,\n    t,\n    noTitle,\n    endBehavior,\n  } = paramsToUse;\n\n  const useTrueToUndefinedField = (field) => toBoolean(field);\n\n  const dataParams = {\n    ads: useTrueToUndefinedField(p),\n    autoPlay: toBoolean(autoPlay),\n    calhau: toBoolean(calhau),\n    customAdHash: toString(customAdHash),\n    debug: toBoolean(debug),\n    debugHash: toBoolean(debugHash),\n    debugRelated: toBoolean(debugRelated),\n    externalLinks: toBoolean(externalLinks),\n    full: toBoolean(full),\n    logo: useTrueToUndefinedField(logo),\n    playlistId: toBoolean(playlistId),\n    referrerUrl: toString(referrerUrl),\n    share: useTrueToUndefinedField(share),\n    timerRelated: useTrueToUndefinedField(timerRelated),\n    logoRecord: toBoolean(logoRecord),\n    contextModal: toBoolean(contextModal),\n    parentUrl: toString(parentUrl),\n    timeStamp: toNumber(t),\n    noTitle: toBoolean(noTitle),\n    endBehavior: toString(endBehavior),\n  };\n\n  return dataParams;\n};\n\nexport default getParams;\n","/**\n * Configures the player's behavior according to the parameters\n *\n * Example Usage:\n * configParams(player, params)\n *\n * @function configParams\n * @param    {Object} [player={}]\n *           An object of player instance.\n * @param    {Object} [params={}]\n *           An object of player's parameters.\n */\n\nconst configParams = (player, params) => {\n  const r7player = player;\n  const { calhau, customAdHash, externalLinks, full, playlistId, referrerUrl, timerRelated, debugRelated } = params;\n\n  if (calhau) r7player.log('Calhau ativo', calhau);\n  if (customAdHash) r7player.log('Custom Hash:', customAdHash);\n  if (debugRelated) r7player.log('Debug Related ativo:', debugRelated);\n  if (!externalLinks) r7player.log('Não há external links:', externalLinks);\n  if (!full) r7player.controlBar.fullscreenToggle.dispose();\n  if (playlistId) r7player.log('playlist Id:', playlistId);\n  if (referrerUrl) r7player.log('Referrer Url:', referrerUrl);\n  if (timerRelated) r7player.log('Timer Related ativo', timerRelated);\n};\n\nexport default configParams;\n","/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */\nimport videojs from 'video.js';\nimport document from 'global/document';\n\nvar version = \"6.0.0\";\n\nconst FlashObj = videojs.getComponent('Flash');\nconst defaultDismiss = !videojs.browser.IS_IPHONE; // Video.js 5/6 cross-compatibility.\n\nconst registerPlugin = videojs.registerPlugin || videojs.plugin; // Default options for the plugin.\n\nconst defaults = {\n  header: '',\n  code: '',\n  message: '',\n  timeout: 45 * 1000,\n  backgroundTimeout: 300 * 1000,\n  dismiss: defaultDismiss,\n  errors: {\n    '1': {\n      type: 'MEDIA_ERR_ABORTED',\n      headline: 'The video download was cancelled'\n    },\n    '2': {\n      type: 'MEDIA_ERR_NETWORK',\n      headline: 'The video connection was lost, please confirm you are ' + 'connected to the internet'\n    },\n    '3': {\n      type: 'MEDIA_ERR_DECODE',\n      headline: 'The video is bad or in a format that cannot be played on your browser'\n    },\n    '4': {\n      type: 'MEDIA_ERR_SRC_NOT_SUPPORTED',\n      headline: 'This video is either unavailable or not supported in this browser'\n    },\n    '5': {\n      type: 'MEDIA_ERR_ENCRYPTED',\n      headline: 'The video you are trying to watch is encrypted and we do not know how ' + 'to decrypt it'\n    },\n    'unknown': {\n      type: 'MEDIA_ERR_UNKNOWN',\n      headline: 'An unanticipated problem was encountered, check back soon and try again'\n    },\n    '-1': {\n      type: 'PLAYER_ERR_NO_SRC',\n      headline: 'No video has been loaded'\n    },\n    '-2': {\n      type: 'PLAYER_ERR_TIMEOUT',\n      headline: 'It looks like you\\'re having playback issues. Reloading the video may help.'\n    },\n    'PLAYER_ERR_DOMAIN_RESTRICTED': {\n      headline: 'This video is restricted from playing on your current domain'\n    },\n    'PLAYER_ERR_IP_RESTRICTED': {\n      headline: 'This video is restricted at your current IP address'\n    },\n    'PLAYER_ERR_GEO_RESTRICTED': {\n      headline: 'This video is restricted from playing in your current geographic region'\n    },\n    'FLASHLS_ERR_CROSS_DOMAIN': {\n      headline: 'The video could not be loaded: crossdomain access denied.'\n    }\n  }\n};\n\nconst initPlugin = function (player, options) {\n  let monitor;\n  let waiting;\n  let isStalling;\n  const listeners = [];\n\n  const updateErrors = function (updates) {\n    options.errors = videojs.mergeOptions(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).\n\n    Object.keys(options.errors).forEach(k => {\n      const err = options.errors[k];\n\n      if (!err.type) {\n        err.type = k;\n      }\n    });\n  }; // Make sure we flesh out initially-provided errors.\n\n\n  updateErrors(); // clears the previous monitor timeout and sets up a new one\n\n  const resetMonitor = function () {\n    // clear out any existing player error now that playback has recovered\n    if (player.error() && player.error().code === -2) {\n      player.error(null);\n    }\n\n    player.clearTimeout(waiting);\n    player.clearTimeout(monitor);\n\n    if (isStalling) {\n      isStalling = false;\n      player.removeClass('vjs-waiting');\n    } // Disable timeouts in the background altogether according to the backgroundTimeout\n    // option, or if the player is muted, as browsers may throttle javascript timers to\n    // 1 minute in that case\n\n\n    const disableValues = [Infinity, -1];\n\n    const disableValueMatch = (valArray, option) => valArray.indexOf(option) !== -1;\n\n    if (document.visibilityState === 'hidden' && (player.muted() || disableValueMatch(disableValues, options.backgroundTimeout)) || document.visibilityState === 'visible' && disableValueMatch(disableValues, options.timeout)) {\n      return;\n    } // start the loading spinner if player has stalled\n\n\n    waiting = player.setTimeout(function () {\n      // player already has an error\n      // or is not playing under normal conditions\n      if (player.error() || player.paused() || player.ended()) {\n        return;\n      }\n\n      isStalling = true;\n      player.addClass('vjs-waiting');\n    }, 1000);\n    monitor = player.setTimeout(function () {\n      // player already has an error\n      // or is not playing under normal conditions\n      if (player.error() || player.paused() || player.ended()) {\n        return;\n      }\n\n      player.error({\n        code: -2,\n        type: 'PLAYER_ERR_TIMEOUT'\n      });\n    }, document.visibilityState === 'hidden' ? options.backgroundTimeout : options.timeout);\n  }; // clear any previously registered listeners\n\n\n  const cleanup = function () {\n    let listener;\n\n    while (listeners.length) {\n      listener = listeners.shift();\n      player.off(listener[0], listener[1]);\n    }\n\n    player.clearTimeout(monitor);\n    player.clearTimeout(waiting);\n  }; // creates and tracks a player listener if the player looks alive\n\n\n  const healthcheck = function (type, fn) {\n    const check = function () {\n      // if there's an error do not reset the monitor and\n      // clear the error unless time is progressing\n      if (!player.error()) {\n        // error if using Flash and its API is unavailable\n        const tech = player.$('.vjs-tech');\n\n        if (tech && tech.type === 'application/x-shockwave-flash' && !tech.vjs_getProperty) {\n          player.error({\n            code: -2,\n            type: 'PLAYER_ERR_TIMEOUT'\n          });\n          return;\n        } // playback isn't expected if the player is paused\n\n\n        if (player.paused()) {\n          return resetMonitor();\n        } // playback isn't expected once the video has ended\n\n\n        if (player.ended()) {\n          return resetMonitor();\n        }\n      }\n\n      fn.call(this);\n    };\n\n    player.on(type, check);\n    listeners.push([type, check]);\n  };\n\n  const onPlayStartMonitor = function () {\n    let lastTime = 0;\n    cleanup(); // if no playback is detected for long enough, trigger a timeout error\n\n    resetMonitor();\n    healthcheck(['timeupdate', 'adtimeupdate'], function () {\n      const currentTime = player.currentTime(); // playback is operating normally or has recovered\n\n      if (currentTime !== lastTime) {\n        lastTime = currentTime;\n        resetMonitor();\n      }\n    }); // Restart timeout monitor when the document transitions between the\n    // foreground and background\n\n    player.off(document, 'visibilitychange', onPlayStartMonitor);\n    player.on(document, 'visibilitychange', onPlayStartMonitor);\n  };\n\n  const onPlayNoSource = function () {\n    if (!player.currentSrc()) {\n      player.error({\n        code: -1,\n        type: 'PLAYER_ERR_NO_SRC'\n      });\n    }\n  };\n\n  const onErrorHandler = function () {\n    let details = '';\n    let error = player.error();\n    const content = document.createElement('div');\n    let dialogContent = ''; // In the rare case when `error()` does not return an error object,\n    // defensively escape the handler function.\n\n    if (!error) {\n      return;\n    } // Stop restarting the monitor on visibilitychanges now that an error has occurred\n\n\n    player.off(document, 'visibilitychange', onPlayStartMonitor);\n    error = videojs.mergeOptions(error, options.errors[error.code || error.type || 0]);\n\n    if (error.message) {\n      details = `<div class=\"vjs-errors-details\">${player.localize('Technical details')}\n        : <div class=\"vjs-errors-message\">${player.localize(error.message)}</div>\n        </div>`;\n    }\n\n    if (error.code === 4 && FlashObj && !FlashObj.isSupported()) {\n      const flashMessage = player.localize('If you are using an older browser please try upgrading or installing Flash.');\n      details += `<span class=\"vjs-errors-flashmessage\">${flashMessage}</span>`;\n    }\n\n    const display = player.getChild('errorDisplay');\n    content.className = 'vjs-errors-dialog';\n    const errorCode = `<div class=\"vjs-errors-code\"><b>${this.localize('Error Code')}:</b> ${error.type || error.code}</div>`;\n    const isTimeoutError = error.code === -2;\n    dialogContent = `<div class=\"vjs-errors-content-container\">\n        <h2 class=\"vjs-errors-headline\">${this.localize(error.headline)}</h2>\n        ${isTimeoutError ? '' : errorCode}\n        ${isTimeoutError ? '' : details}\n      </div>`;\n    const closeable = display.closeable(!('dismiss' in error) || error.dismiss);\n\n    if (isTimeoutError) {\n      dialogContent += `<div class=\"vjs-errors-timeout-button-container\">\n         <button>${this.localize('Reload Video')}</button>\n         <button>${this.localize('Dismiss')}</button>\n       </div>`;\n      content.innerHTML = dialogContent;\n      display.fillWith(content);\n      display.getChild('closeButton').hide();\n      const reloadButton = display.el().querySelector('.vjs-errors-timeout-button-container > button:first-child');\n      const dismissButton = display.el().querySelector('.vjs-errors-timeout-button-container > button:last-child');\n      player.on(reloadButton, 'click', function () {\n        const source = player.currentSource();\n        player.reset();\n        player.src(source);\n      });\n      player.on(dismissButton, 'click', function () {\n        display.close();\n      });\n      display.one('modalclose', () => {\n        player.off(reloadButton);\n        player.off(dismissButton);\n      });\n    } else if (closeable) {\n      // We should get a close button\n      dialogContent += `<div class=\"vjs-errors-ok-button-container\">\n          <button class=\"vjs-errors-ok-button\">${this.localize('OK')}</button>\n        </div>`;\n      content.innerHTML = dialogContent;\n      display.fillWith(content); // Get the close button inside the error display\n\n      display.contentEl().firstChild.appendChild(display.getChild('closeButton').el());\n      const okButton = display.el().querySelector('.vjs-errors-ok-button');\n      player.on(okButton, 'click', function () {\n        display.close();\n      });\n    } else {\n      content.innerHTML = dialogContent;\n      display.fillWith(content);\n    }\n\n    if (player.currentWidth() <= 600 || player.currentHeight() <= 250) {\n      display.addClass('vjs-xs');\n    }\n\n    display.one('modalclose', () => player.error(null));\n  };\n\n  const onDisposeHandler = function () {\n    cleanup();\n    player.removeClass('vjs-errors');\n    player.off('play', onPlayStartMonitor);\n    player.off(document, 'visibilitychange', onPlayStartMonitor);\n    player.off('play', onPlayNoSource);\n    player.off('dispose', onDisposeHandler);\n    player.off(['aderror', 'error'], onErrorHandler);\n  };\n\n  const reInitPlugin = function (newOptions) {\n    onDisposeHandler();\n    initPlugin(player, videojs.mergeOptions(defaults, newOptions));\n  };\n\n  reInitPlugin.extend = errors => updateErrors(errors);\n\n  reInitPlugin.getAll = () => videojs.mergeOptions(options.errors); // Get / set timeout value. Restart monitor if changed.\n\n\n  reInitPlugin.timeout = function (timeout) {\n    if (typeof timeout === 'undefined') {\n      return options.timeout;\n    }\n\n    if (timeout !== options.timeout) {\n      options.timeout = timeout;\n\n      if (!player.paused()) {\n        onPlayStartMonitor();\n      }\n    }\n  }; // Get / set backgroundTimeout value. Restart monitor if changed.\n\n\n  reInitPlugin.backgroundTimeout = function (timeout) {\n    if (typeof timeout === 'undefined') {\n      return options.backgroundTimeout;\n    }\n\n    if (timeout !== options.backgroundTimeout) {\n      options.backgroundTimeout = timeout;\n\n      if (!player.paused()) {\n        onPlayStartMonitor();\n      }\n    }\n  }; // no-op API\n  // TODO: remove in a major version\n\n\n  reInitPlugin.disableProgress = () => {};\n\n  player.on('play', onPlayStartMonitor);\n  player.on('play', onPlayNoSource);\n  player.on('dispose', onDisposeHandler);\n  player.on(['aderror', 'contenterror', 'error'], onErrorHandler);\n  player.ready(() => {\n    player.addClass('vjs-errors');\n  }); // if the plugin is re-initialised during playback, start the timeout handler.\n\n  if (!player.paused()) {\n    onPlayStartMonitor();\n  } // Include the version number.\n\n\n  reInitPlugin.VERSION = version;\n  player.errors = reInitPlugin;\n};\n\nconst errors = function (options) {\n  initPlugin(this, videojs.mergeOptions(defaults, options));\n};\n\n['extend', 'getAll'].forEach(k => {\n  errors[k] = function () {\n    videojs.log.warn(`The errors.${k}() method is not available until the plugin has been initialized!`);\n  };\n}); // Include the version number.\n\nerrors.VERSION = version; // Register the plugin with video.js.\n\nregisterPlugin('errors', errors);\n\nexport { errors as default };\n","import 'videojs-errors';\nimport { arcGeoBlock, isSuportedBrowser } from '../helpers/helpers';\nimport { showErrorMsg, TYPE_OF_MSG } from '../helpers/messages';\n\nconst ERROR_CODES = {\n  MEDIA_ERR_ABORTED: 1,\n  MEDIA_ERR_NETWORK: 2,\n  MEDIA_ERR_DECODE: 3,\n  MEDIA_ERR_SRC_NOT_SUPPORTED: 4,\n  MEDIA_ERR_ENCRYPTED: 5,\n  PLAYER_ERR_NO_SRC: -1,\n  PLAYER_ERR_TIMEOUT: -2,\n  PLAYER_ERR_DOMAIN_RESTRICTED: 'PLAYER_ERR_DOMAIN_RESTRICTED',\n  PLAYER_ERR_GEO_RESTRICTED: 'PLAYER_ERR_GEO_RESTRICTED',\n  PLAYER_ERR_IP_RESTRICTED: 'PLAYER_ERR_IP_RESTRICTED',\n  MEDIA_ERR_UNKNOWN: 'unknown',\n};\n\nconst getErrorCodes = () => Object.values(ERROR_CODES);\n\nconst isNotGeoblock = (errorCode) => {\n  const filteredErrorCodes = getErrorCodes().filter((value) => value !== 'PLAYER_ERR_GEO_RESTRICTED');\n\n  return filteredErrorCodes.includes(errorCode);\n};\n\nconst vjsErrors = (player) => {\n  player.errors();\n  const hasArcGeoBlock = arcGeoBlock(player);\n\n  if (hasArcGeoBlock) {\n    showErrorMsg(player, TYPE_OF_MSG.GEO_BLOCK);\n  }\n\n  const isSupported = isSuportedBrowser();\n  if (!isSupported) {\n    showErrorMsg(player, TYPE_OF_MSG.OLD_BROWSER);\n  }\n\n  const errorTracking = () => {\n    const mediaError = player.error();\n\n    if (mediaError && isNotGeoblock(mediaError.code)) {\n      return false;\n    }\n\n    const errorHeadline = 'Conteúdo bloqueado';\n    const errorMessage =\n      'Lamentamos, mas o vídeo que está tentando assistir é de exibição exclusiva em território brasileiro :-(';\n\n    player.errors.extend({\n      PLAYER_ERR_GEO_RESTRICTED: {\n        headline: errorHeadline,\n        message: errorMessage,\n      },\n    });\n\n    player.error({\n      code: 'PLAYER_ERR_GEO_RESTRICTED',\n      dismiss: false,\n    });\n\n    showErrorMsg(player, TYPE_OF_MSG.GEO_BLOCK);\n    return true;\n  };\n\n  player.one('error', errorTracking);\n};\n\nexport default vjsErrors;\n","/*! @name videojs-contrib-quality-levels @version 2.2.1 @license Apache-2.0 */\nimport videojs from 'video.js';\n\nfunction _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n  subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return self;\n}\n\n/**\n * A single QualityLevel.\n *\n * interface QualityLevel {\n *   readonly attribute DOMString id;\n *            attribute DOMString label;\n *   readonly attribute long width;\n *   readonly attribute long height;\n *   readonly attribute long bitrate;\n *            attribute boolean enabled;\n * };\n *\n * @class QualityLevel\n */\nvar QualityLevel =\n/**\n * Creates a QualityLevel\n *\n * @param {Representation|Object} representation The representation of the quality level\n * @param {string}   representation.id        Unique id of the QualityLevel\n * @param {number=}  representation.width     Resolution width of the QualityLevel\n * @param {number=}  representation.height    Resolution height of the QualityLevel\n * @param {number}   representation.bandwidth Bitrate of the QualityLevel\n * @param {number=}  representation.frameRate Frame-rate of the QualityLevel\n * @param {Function} representation.enabled   Callback to enable/disable QualityLevel\n */\nfunction QualityLevel(representation) {\n  var level = this; // eslint-disable-line\n\n  level.id = representation.id;\n  level.label = level.id;\n  level.width = representation.width;\n  level.height = representation.height;\n  level.bitrate = representation.bandwidth;\n  level.frameRate = representation.frameRate;\n  level.enabled_ = representation.enabled;\n  Object.defineProperty(level, 'enabled', {\n    /**\n     * Get whether the QualityLevel is enabled.\n     *\n     * @return {boolean} True if the QualityLevel is enabled.\n     */\n    get: function get() {\n      return level.enabled_();\n    },\n\n    /**\n     * Enable or disable the QualityLevel.\n     *\n     * @param {boolean} enable true to enable QualityLevel, false to disable.\n     */\n    set: function set(enable) {\n      level.enabled_(enable);\n    }\n  });\n  return level;\n};\n\n/**\n * A list of QualityLevels.\n *\n * interface QualityLevelList : EventTarget {\n *   getter QualityLevel (unsigned long index);\n *   readonly attribute unsigned long length;\n *   readonly attribute long selectedIndex;\n *\n *   void addQualityLevel(QualityLevel qualityLevel)\n *   void removeQualityLevel(QualityLevel remove)\n *   QualityLevel? getQualityLevelById(DOMString id);\n *\n *   attribute EventHandler onchange;\n *   attribute EventHandler onaddqualitylevel;\n *   attribute EventHandler onremovequalitylevel;\n * };\n *\n * @extends videojs.EventTarget\n * @class QualityLevelList\n */\n\nvar QualityLevelList =\n/*#__PURE__*/\nfunction (_videojs$EventTarget) {\n  _inheritsLoose(QualityLevelList, _videojs$EventTarget);\n\n  function QualityLevelList() {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this;\n\n    var list = _assertThisInitialized(_assertThisInitialized(_this)); // eslint-disable-line\n\n\n    list.levels_ = [];\n    list.selectedIndex_ = -1;\n    /**\n     * Get the index of the currently selected QualityLevel.\n     *\n     * @returns {number} The index of the selected QualityLevel. -1 if none selected.\n     * @readonly\n     */\n\n    Object.defineProperty(list, 'selectedIndex', {\n      get: function get() {\n        return list.selectedIndex_;\n      }\n    });\n    /**\n     * Get the length of the list of QualityLevels.\n     *\n     * @returns {number} The length of the list.\n     * @readonly\n     */\n\n    Object.defineProperty(list, 'length', {\n      get: function get() {\n        return list.levels_.length;\n      }\n    });\n    return list || _assertThisInitialized(_this);\n  }\n  /**\n   * Adds a quality level to the list.\n   *\n   * @param {Representation|Object} representation The representation of the quality level\n   * @param {string}   representation.id        Unique id of the QualityLevel\n   * @param {number=}  representation.width     Resolution width of the QualityLevel\n   * @param {number=}  representation.height    Resolution height of the QualityLevel\n   * @param {number}   representation.bandwidth Bitrate of the QualityLevel\n   * @param {number=}  representation.frameRate Frame-rate of the QualityLevel\n   * @param {Function} representation.enabled   Callback to enable/disable QualityLevel\n   * @return {QualityLevel} the QualityLevel added to the list\n   * @method addQualityLevel\n   */\n\n\n  var _proto = QualityLevelList.prototype;\n\n  _proto.addQualityLevel = function addQualityLevel(representation) {\n    var qualityLevel = this.getQualityLevelById(representation.id); // Do not add duplicate quality levels\n\n    if (qualityLevel) {\n      return qualityLevel;\n    }\n\n    var index = this.levels_.length;\n    qualityLevel = new QualityLevel(representation);\n\n    if (!('' + index in this)) {\n      Object.defineProperty(this, index, {\n        get: function get() {\n          return this.levels_[index];\n        }\n      });\n    }\n\n    this.levels_.push(qualityLevel);\n    this.trigger({\n      qualityLevel: qualityLevel,\n      type: 'addqualitylevel'\n    });\n    return qualityLevel;\n  };\n  /**\n   * Removes a quality level from the list.\n   *\n   * @param {QualityLevel} remove QualityLevel to remove to the list.\n   * @return {QualityLevel|null} the QualityLevel removed or null if nothing removed\n   * @method removeQualityLevel\n   */\n\n\n  _proto.removeQualityLevel = function removeQualityLevel(qualityLevel) {\n    var removed = null;\n\n    for (var i = 0, l = this.length; i < l; i++) {\n      if (this[i] === qualityLevel) {\n        removed = this.levels_.splice(i, 1)[0];\n\n        if (this.selectedIndex_ === i) {\n          this.selectedIndex_ = -1;\n        } else if (this.selectedIndex_ > i) {\n          this.selectedIndex_--;\n        }\n\n        break;\n      }\n    }\n\n    if (removed) {\n      this.trigger({\n        qualityLevel: qualityLevel,\n        type: 'removequalitylevel'\n      });\n    }\n\n    return removed;\n  };\n  /**\n   * Searches for a QualityLevel with the given id.\n   *\n   * @param {string} id The id of the QualityLevel to find.\n   * @return {QualityLevel|null} The QualityLevel with id, or null if not found.\n   * @method getQualityLevelById\n   */\n\n\n  _proto.getQualityLevelById = function getQualityLevelById(id) {\n    for (var i = 0, l = this.length; i < l; i++) {\n      var level = this[i];\n\n      if (level.id === id) {\n        return level;\n      }\n    }\n\n    return null;\n  };\n  /**\n   * Resets the list of QualityLevels to empty\n   *\n   * @method dispose\n   */\n\n\n  _proto.dispose = function dispose() {\n    this.selectedIndex_ = -1;\n    this.levels_.length = 0;\n  };\n\n  return QualityLevelList;\n}(videojs.EventTarget);\n/**\n * change - The selected QualityLevel has changed.\n * addqualitylevel - A QualityLevel has been added to the QualityLevelList.\n * removequalitylevel - A QualityLevel has been removed from the QualityLevelList.\n */\n\n\nQualityLevelList.prototype.allowedEvents_ = {\n  change: 'change',\n  addqualitylevel: 'addqualitylevel',\n  removequalitylevel: 'removequalitylevel'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var event in QualityLevelList.prototype.allowedEvents_) {\n  QualityLevelList.prototype['on' + event] = null;\n}\n\nvar version = \"2.2.1\";\n\nvar registerPlugin = videojs.registerPlugin || videojs.plugin;\n/**\n * Initialization function for the qualityLevels plugin. Sets up the QualityLevelList and\n * event handlers.\n *\n * @param {Player} player Player object.\n * @param {Object} options Plugin options object.\n * @function initPlugin\n */\n\nvar initPlugin = function initPlugin(player, options) {\n  var originalPluginFn = player.qualityLevels;\n  var qualityLevelList = new QualityLevelList();\n\n  var disposeHandler = function disposeHandler() {\n    qualityLevelList.dispose();\n    player.qualityLevels = originalPluginFn;\n    player.off('dispose', disposeHandler);\n  };\n\n  player.on('dispose', disposeHandler);\n\n  player.qualityLevels = function () {\n    return qualityLevelList;\n  };\n\n  player.qualityLevels.VERSION = version;\n  return qualityLevelList;\n};\n/**\n * A video.js plugin.\n *\n * In the plugin function, the value of `this` is a video.js `Player`\n * instance. You cannot rely on the player being in a \"ready\" state here,\n * depending on how the plugin is invoked. This may or may not be important\n * to you; if not, remove the wait for \"ready\"!\n *\n * @param {Object} options Plugin options object\n * @function qualityLevels\n */\n\n\nvar qualityLevels = function qualityLevels(options) {\n  return initPlugin(this, videojs.mergeOptions({}, options));\n}; // Register the plugin with video.js.\n\n\nregisterPlugin('qualityLevels', qualityLevels); // Include the version number.\n\nqualityLevels.VERSION = version;\n\nexport default qualityLevels;\n","import videojs from 'video.js';\n\nvar version = \"1.1.4\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n  return typeof obj;\n} : function (obj) {\n  return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\nvar asyncGenerator = function () {\n  function AwaitValue(value) {\n    this.value = value;\n  }\n\n  function AsyncGenerator(gen) {\n    var front, back;\n\n    function send(key, arg) {\n      return new Promise(function (resolve, reject) {\n        var request = {\n          key: key,\n          arg: arg,\n          resolve: resolve,\n          reject: reject,\n          next: null\n        };\n\n        if (back) {\n          back = back.next = request;\n        } else {\n          front = back = request;\n          resume(key, arg);\n        }\n      });\n    }\n\n    function resume(key, arg) {\n      try {\n        var result = gen[key](arg);\n        var value = result.value;\n\n        if (value instanceof AwaitValue) {\n          Promise.resolve(value.value).then(function (arg) {\n            resume(\"next\", arg);\n          }, function (arg) {\n            resume(\"throw\", arg);\n          });\n        } else {\n          settle(result.done ? \"return\" : \"normal\", result.value);\n        }\n      } catch (err) {\n        settle(\"throw\", err);\n      }\n    }\n\n    function settle(type, value) {\n      switch (type) {\n        case \"return\":\n          front.resolve({\n            value: value,\n            done: true\n          });\n          break;\n\n        case \"throw\":\n          front.reject(value);\n          break;\n\n        default:\n          front.resolve({\n            value: value,\n            done: false\n          });\n          break;\n      }\n\n      front = front.next;\n\n      if (front) {\n        resume(front.key, front.arg);\n      } else {\n        back = null;\n      }\n    }\n\n    this._invoke = send;\n\n    if (typeof gen.return !== \"function\") {\n      this.return = undefined;\n    }\n  }\n\n  if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n    AsyncGenerator.prototype[Symbol.asyncIterator] = function () {\n      return this;\n    };\n  }\n\n  AsyncGenerator.prototype.next = function (arg) {\n    return this._invoke(\"next\", arg);\n  };\n\n  AsyncGenerator.prototype.throw = function (arg) {\n    return this._invoke(\"throw\", arg);\n  };\n\n  AsyncGenerator.prototype.return = function (arg) {\n    return this._invoke(\"return\", arg);\n  };\n\n  return {\n    wrap: function (fn) {\n      return function () {\n        return new AsyncGenerator(fn.apply(this, arguments));\n      };\n    },\n    await: function (value) {\n      return new AwaitValue(value);\n    }\n  };\n}();\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\n\n\n\n\n\n\n\n\n\n\nvar inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar VideoJsButtonClass = videojs.getComponent('MenuButton');\nvar VideoJsMenuClass = videojs.getComponent('Menu');\nvar VideoJsComponent = videojs.getComponent('Component');\nvar Dom = videojs.dom;\n\n/**\n * Convert string to title case.\n *\n * @param {string} string - the string to convert\n * @return {string} the returned titlecase string\n */\nfunction toTitleCase(string) {\n  if (typeof string !== 'string') {\n    return string;\n  }\n\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\n/**\n * Extend vjs button class for quality button.\n */\n\nvar ConcreteButton = function (_VideoJsButtonClass) {\n  inherits(ConcreteButton, _VideoJsButtonClass);\n\n  /**\n   * Button constructor.\n   *\n   * @param {Player} player - videojs player instance\n   */\n  function ConcreteButton(player) {\n    classCallCheck(this, ConcreteButton);\n    return possibleConstructorReturn(this, _VideoJsButtonClass.call(this, player, {\n      title: player.localize('Quality'),\n      name: 'QualityButton'\n    }));\n  }\n\n  /**\n   * Creates button items.\n   *\n   * @return {Array} - Button items\n   */\n\n\n  ConcreteButton.prototype.createItems = function createItems() {\n    return [];\n  };\n\n  /**\n   * Create the menu and add all items to it.\n   *\n   * @return {Menu}\n   *         The constructed menu\n   */\n\n\n  ConcreteButton.prototype.createMenu = function createMenu() {\n    var menu = new VideoJsMenuClass(this.player_, { menuButton: this });\n\n    this.hideThreshold_ = 0;\n\n    // Add a title list item to the top\n    if (this.options_.title) {\n      var titleEl = Dom.createEl('li', {\n        className: 'vjs-menu-title',\n        innerHTML: toTitleCase(this.options_.title),\n        tabIndex: -1\n      });\n      var titleComponent = new VideoJsComponent(this.player_, { el: titleEl });\n\n      this.hideThreshold_ += 1;\n\n      menu.addItem(titleComponent);\n    }\n\n    this.items = this.createItems();\n\n    if (this.items) {\n      // Add menu items to the menu\n      for (var i = 0; i < this.items.length; i++) {\n        menu.addItem(this.items[i]);\n      }\n    }\n\n    return menu;\n  };\n\n  return ConcreteButton;\n}(VideoJsButtonClass);\n\n// Concrete classes\nvar VideoJsMenuItemClass = videojs.getComponent('MenuItem');\n\n/**\n * Extend vjs menu item class.\n */\n\nvar ConcreteMenuItem = function (_VideoJsMenuItemClass) {\n  inherits(ConcreteMenuItem, _VideoJsMenuItemClass);\n\n  /**\n   * Menu item constructor.\n   *\n   * @param {Player} player - vjs player\n   * @param {Object} item - Item object\n   * @param {ConcreteButton} qualityButton - The containing button.\n   * @param {HlsQualitySelectorPlugin} plugin - This plugin instance.\n   */\n  function ConcreteMenuItem(player, item, qualityButton, plugin) {\n    classCallCheck(this, ConcreteMenuItem);\n\n    var _this = possibleConstructorReturn(this, _VideoJsMenuItemClass.call(this, player, {\n      label: item.label,\n      selectable: true,\n      selected: item.selected || false\n    }));\n\n    _this.item = item;\n    _this.qualityButton = qualityButton;\n    _this.plugin = plugin;\n    return _this;\n  }\n\n  /**\n   * Click event for menu item.\n   */\n\n\n  ConcreteMenuItem.prototype.handleClick = function handleClick() {\n\n    // Reset other menu items selected status.\n    for (var i = 0; i < this.qualityButton.items.length; ++i) {\n      this.qualityButton.items[i].selected(false);\n    }\n\n    // Set this menu item to selected, and set quality.\n    this.plugin.setQuality(this.item.value);\n    this.selected(true);\n  };\n\n  return ConcreteMenuItem;\n}(VideoJsMenuItemClass);\n\n// Default options for the plugin.\nvar defaults = {};\n\n// Cross-compatibility for Video.js 5 and 6.\nvar registerPlugin = videojs.registerPlugin || videojs.plugin;\n// const dom = videojs.dom || videojs;\n\n/**\n * VideoJS HLS Quality Selector Plugin class.\n */\n\nvar HlsQualitySelectorPlugin = function () {\n\n  /**\n   * Plugin Constructor.\n   *\n   * @param {Player} player - The videojs player instance.\n   * @param {Object} options - The plugin options.\n   */\n  function HlsQualitySelectorPlugin(player, options) {\n    classCallCheck(this, HlsQualitySelectorPlugin);\n\n    this.player = player;\n    this.config = options;\n\n    // If there is quality levels plugin and the HLS tech exists\n    // then continue.\n    if (this.player.qualityLevels && this.getHls()) {\n      // Create the quality button.\n      this.createQualityButton();\n      this.bindPlayerEvents();\n    }\n  }\n\n  /**\n   * Returns HLS Plugin\n   *\n   * @return {*} - videojs-hls-contrib plugin.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.getHls = function getHls() {\n    return this.player.tech({ IWillNotUseThisInPlugins: true }).hls;\n  };\n\n  /**\n   * Binds listener for quality level changes.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.bindPlayerEvents = function bindPlayerEvents() {\n    this.player.qualityLevels().on('addqualitylevel', this.onAddQualityLevel.bind(this));\n  };\n\n  /**\n   * Adds the quality menu button to the player control bar.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.createQualityButton = function createQualityButton() {\n\n    var player = this.player;\n\n    this._qualityButton = new ConcreteButton(player);\n\n    var placementIndex = player.controlBar.children().length - 2;\n    var concreteButtonInstance = player.controlBar.addChild(this._qualityButton, { componentClass: 'qualitySelector' }, this.config.placementIndex || placementIndex);\n\n    concreteButtonInstance.addClass('vjs-quality-selector');\n    if (!this.config.displayCurrentQuality) {\n      var icon = ' ' + (this.config.vjsIconClass || 'vjs-icon-hd');\n\n      concreteButtonInstance.menuButton_.$('.vjs-icon-placeholder').className += icon;\n    } else {\n      this.setButtonInnerText('auto');\n    }\n    concreteButtonInstance.removeClass('vjs-hidden');\n  };\n\n  /**\n   *Set inner button text.\n   *\n   * @param {string} text - the text to display in the button.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.setButtonInnerText = function setButtonInnerText(text) {\n    this._qualityButton.menuButton_.$('.vjs-icon-placeholder').innerHTML = text;\n  };\n\n  /**\n   * Builds individual quality menu items.\n   *\n   * @param {Object} item - Individual quality menu item.\n   * @return {ConcreteMenuItem} - Menu item\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.getQualityMenuItem = function getQualityMenuItem(item) {\n    var player = this.player;\n\n    return new ConcreteMenuItem(player, item, this._qualityButton, this);\n  };\n\n  /**\n   * Executed when a quality level is added from HLS playlist.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.onAddQualityLevel = function onAddQualityLevel() {\n    var _this = this;\n\n    var player = this.player;\n    var qualityList = player.qualityLevels();\n    var levels = qualityList.levels_ || [];\n    var levelItems = [];\n\n    var _loop = function _loop(i) {\n      if (!levelItems.filter(function (_existingItem) {\n        return _existingItem.item && _existingItem.item.value === levels[i].height;\n      }).length) {\n        var levelItem = _this.getQualityMenuItem.call(_this, {\n          label: levels[i].height + 'p',\n          value: levels[i].height\n        });\n\n        levelItems.push(levelItem);\n      }\n    };\n\n    for (var i = 0; i < levels.length; ++i) {\n      _loop(i);\n    }\n\n    levelItems.sort(function (current, next) {\n      if ((typeof current === 'undefined' ? 'undefined' : _typeof(current)) !== 'object' || (typeof next === 'undefined' ? 'undefined' : _typeof(next)) !== 'object') {\n        return -1;\n      }\n      if (current.item.value < next.item.value) {\n        return -1;\n      }\n      if (current.item.value > next.item.value) {\n        return 1;\n      }\n      return 0;\n    });\n\n    levelItems.push(this.getQualityMenuItem.call(this, {\n      label: player.localize('Auto'),\n      value: 'auto',\n      selected: true\n    }));\n\n    if (this._qualityButton) {\n      this._qualityButton.createItems = function () {\n        return levelItems;\n      };\n      this._qualityButton.update();\n    }\n  };\n\n  /**\n   * Sets quality (based on media height)\n   *\n   * @param {number} height - A number representing HLS playlist.\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.setQuality = function setQuality(height) {\n    var qualityList = this.player.qualityLevels();\n\n    // Set quality on plugin\n    this._currentQuality = height;\n\n    if (this.config.displayCurrentQuality) {\n      this.setButtonInnerText(height === 'auto' ? height : height + 'p');\n    }\n\n    for (var i = 0; i < qualityList.length; ++i) {\n      var quality = qualityList[i];\n\n      quality.enabled = quality.height === height || height === 'auto';\n    }\n    this._qualityButton.unpressButton();\n  };\n\n  /**\n   * Return the current set quality or 'auto'\n   *\n   * @return {string} the currently set quality\n   */\n\n\n  HlsQualitySelectorPlugin.prototype.getCurrentQuality = function getCurrentQuality() {\n    return this._currentQuality || 'auto';\n  };\n\n  return HlsQualitySelectorPlugin;\n}();\n\n/**\n * Function to invoke when the player is ready.\n *\n * This is a great place for your plugin to initialize itself. When this\n * function is called, the player will have its DOM and child components\n * in place.\n *\n * @function onPlayerReady\n * @param    {Player} player\n *           A Video.js player object.\n *\n * @param    {Object} [options={}]\n *           A plain object containing options for the plugin.\n */\n\n\nvar onPlayerReady = function onPlayerReady(player, options) {\n  player.addClass('vjs-hls-quality-selector');\n  player.hlsQualitySelector = new HlsQualitySelectorPlugin(player, options);\n};\n\n/**\n * A video.js plugin.\n *\n * In the plugin function, the value of `this` is a video.js `Player`\n * instance. You cannot rely on the player being in a \"ready\" state here,\n * depending on how the plugin is invoked. This may or may not be important\n * to you; if not, remove the wait for \"ready\"!\n *\n * @function hlsQualitySelector\n * @param    {Object} [options={}]\n *           An object of options left to the plugin author to define.\n */\nvar hlsQualitySelector = function hlsQualitySelector(options) {\n  var _this2 = this;\n\n  this.ready(function () {\n    onPlayerReady(_this2, videojs.mergeOptions(defaults, options));\n  });\n};\n\n// Register the plugin with video.js.\nregisterPlugin('hlsQualitySelector', hlsQualitySelector);\n\n// Include the version number.\nhlsQualitySelector.VERSION = version;\n\nexport default hlsQualitySelector;\n","var WIN_PARAMS = 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0'; // eslint-disable-line import/prefer-default-export\n\nfunction encodeParams(obj) {\n  return Object.keys(obj).filter(function (k) {\n    return typeof obj[k] !== 'undefined' && obj[k] !== '';\n  }).map(function (k) {\n    return \"\".concat(encodeURIComponent(k), \"=\").concat(encodeURIComponent(obj[k]));\n  }).join('&');\n}\n\nfunction getFbFeedUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var fbAppId = options.fbAppId,\n      url = options.url,\n      redirectUri = options.redirectUri;\n\n  if (!fbAppId) {\n    throw new Error('fbAppId is not defined');\n  }\n\n  var params = encodeParams({\n    app_id: fbAppId,\n    display: 'popup',\n    redirect_uri: redirectUri,\n    link: url\n  });\n  return \"https://www.facebook.com/dialog/feed?\".concat(params);\n}\nfunction fbFeed() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getFbFeedUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction getFbShareUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var fbAppId = options.fbAppId,\n      url = options.url,\n      hashtag = options.hashtag,\n      redirectUri = options.redirectUri;\n\n  if (!fbAppId) {\n    throw new Error('fbAppId is not defined');\n  }\n\n  var params = encodeParams({\n    app_id: fbAppId,\n    display: 'popup',\n    redirect_uri: redirectUri,\n    href: url,\n    hashtag: hashtag\n  });\n  return \"https://www.facebook.com/dialog/share?\".concat(params);\n}\nfunction fbShare() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getFbShareUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction getFbButtonUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url;\n\n  if (!url) {\n    throw new Error('url is not defined');\n  }\n\n  var params = encodeParams({\n    kid_directed_site: '0',\n    sdk: 'joey',\n    u: url,\n    display: 'popup',\n    ref: 'plugin',\n    src: 'share_button'\n  });\n  return \"https://www.facebook.com/sharer/sharer.php?\".concat(params);\n}\nfunction fbButton() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getFbButtonUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction gp() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url;\n  var params = encodeParams({\n    url: url\n  });\n  return window.open(\"https://plus.google.com/share?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction mail() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title,\n      description = options.description,\n      image = options.image;\n  var params = encodeParams({\n    share_url: url,\n    title: title,\n    description: description,\n    imageurl: image\n  });\n  return window.open(\"http://connect.mail.ru/share?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction getEmailUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var to = options.to,\n      url = options.url,\n      title = options.title,\n      description = options.description,\n      subject = options.subject;\n  var params = encodeParams({\n    subject: subject,\n    body: \"\".concat(title || '', \"\\r\\n\").concat(description || '', \"\\r\\n\").concat(url || '')\n  });\n  return \"mailto:\".concat(to || '', \"?\").concat(params);\n}\nfunction email() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.location.assign(getEmailUrl(options));\n}\n\nfunction getOkUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title,\n      image = options.image;\n  var params = encodeParams({\n    url: url,\n    title: title,\n    imageUrl: image\n  });\n  return \"https://connect.ok.ru/offer?\".concat(params);\n}\nfunction ok() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getOkUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction getTelegramUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title;\n  var params = encodeParams({\n    url: url,\n    text: title\n  });\n  return \"https://t.me/share/url?\".concat(params);\n}\nfunction telegram() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getTelegramUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction getTwUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var title = options.title,\n      url = options.url,\n      _options$hashtags = options.hashtags,\n      hashtags = _options$hashtags === void 0 ? [] : _options$hashtags;\n  var params = encodeParams({\n    text: title,\n    url: url,\n    hashtags: hashtags.join(',')\n  });\n  return \"https://twitter.com/intent/tweet?\".concat(params);\n}\nfunction tw() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getTwUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction reddit() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title;\n  var params = encodeParams({\n    url: url,\n    title: title\n  });\n  return window.open(\"https://www.reddit.com/submit?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction pinterest() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var description = options.description,\n      url = options.url,\n      media = options.media;\n  var params = encodeParams({\n    url: url,\n    description: description,\n    media: media\n  });\n  return window.open(\"https://pinterest.com/pin/create/button/?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction tumblr() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title,\n      caption = options.caption,\n      _options$tags = options.tags,\n      tags = _options$tags === void 0 ? [] : _options$tags,\n      _options$posttype = options.posttype,\n      posttype = _options$posttype === void 0 ? 'link' : _options$posttype;\n  var params = encodeParams({\n    canonicalUrl: url,\n    title: title,\n    caption: caption,\n    tags: tags.join(','),\n    posttype: posttype\n  });\n  return window.open(\"https://www.tumblr.com/widgets/share/tool?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction isMobileSafari() {\n  return !!window.navigator.userAgent.match(/Version\\/[\\d.]+.*Safari/);\n}\n\nfunction mobileShare(link) {\n  return isMobileSafari() ? window.open(link) : window.location.assign(link);\n}\n\nfunction getViberUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      title = options.title;\n\n  if (!url && !title) {\n    throw new Error('url and title not specified');\n  }\n\n  var params = encodeParams({\n    text: [title, url].filter(function (item) {\n      return item;\n    }).join(' ')\n  });\n  return \"viber://forward?\".concat(params);\n}\nfunction viber() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return mobileShare(getViberUrl(options));\n}\n\nvar VK_MAX_LENGTH = 80;\nfunction getVkUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var url = options.url,\n      image = options.image,\n      isVkParse = options.isVkParse;\n  var description = options.description,\n      title = options.title;\n\n  if (description && description.length > VK_MAX_LENGTH) {\n    description = \"\".concat(description.substr(0, VK_MAX_LENGTH), \"...\");\n  }\n\n  if (title && title.length > VK_MAX_LENGTH) {\n    title = \"\".concat(title.substr(0, VK_MAX_LENGTH), \"...\");\n  }\n\n  var params;\n\n  if (isVkParse) {\n    params = encodeParams({\n      url: url\n    });\n  } else {\n    params = encodeParams({\n      url: url,\n      title: title,\n      description: description,\n      image: image,\n      noparse: true\n    });\n  }\n\n  return \"https://vk.com/share.php?\".concat(params);\n}\nfunction vk() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getVkUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction getWhatsappUrl() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var phone = options.phone,\n      title = options.title,\n      url = options.url;\n  var params = encodeParams({\n    text: [title, url].filter(function (item) {\n      return item;\n    }).join(' '),\n    phone: phone\n  });\n  return \"https://api.whatsapp.com/send?\".concat(params);\n}\nfunction whatsapp() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  return window.open(getWhatsappUrl(options), '_blank', WIN_PARAMS);\n}\n\nfunction linkedin() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var title = options.title,\n      url = options.url,\n      description = options.description;\n  var params = encodeParams({\n    title: title,\n    summary: description,\n    url: url\n  });\n  return window.open(\"https://www.linkedin.com/shareArticle?mini=true&\".concat(params), '_blank', WIN_PARAMS);\n}\n\nfunction messenger() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var fbAppId = options.fbAppId,\n      url = options.url;\n\n  if (!fbAppId) {\n    throw new Error('fbAppId is not defined');\n  }\n\n  var params = encodeParams({\n    app_id: fbAppId,\n    link: url\n  });\n  return window.location.assign(\"fb-messenger://share?\".concat(params));\n}\n\nfunction line() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  var title = options.title,\n      url = options.url;\n\n  if (!url) {\n    throw new Error('url is not defined');\n  }\n\n  var params = encodeURIComponent(\"\".concat(url));\n\n  if (title) {\n    params = \"\".concat(encodeURIComponent(\"\".concat(title, \" \"))).concat(params);\n  }\n\n  return window.open(\"https://line.me/R/msg/text/?\".concat(params), '_blank', WIN_PARAMS);\n}\n\nexport { email, fbButton, fbFeed, fbShare, getEmailUrl, getFbButtonUrl, getFbFeedUrl, getFbShareUrl, getOkUrl, getTelegramUrl, getTwUrl, getViberUrl, getVkUrl, getWhatsappUrl, gp, line, linkedin, mail, messenger, ok, pinterest, reddit, telegram, tumblr, tw, viber, vk, whatsapp };\n","import videojs from 'video.js';\nimport Clipboard from 'clipboard';\nimport * as sharing from 'vanilla-sharing';\n\nvar version = \"3.2.1\";\n\nvar url = getUrl();\n\nfunction getUrl() {\n  if (typeof window === 'undefined') {\n    return '';\n  }\n  return window.location.href;\n}\n\nfunction getRedirectUri() {\n  return url + '#close_window';\n}\n\nfunction getEmbedCode() {\n  return '<iframe src=\\'' + url + '\\' width=\\'560\\' height=\\'315\\' frameborder=\\'0\\' allowfullscreen></iframe>';\n}\n\nfunction getSocials() {\n  return ['fbFeed', 'tw', 'reddit', 'gp', 'messenger', 'linkedin', 'vk', 'ok', 'mail', 'email', 'telegram', 'whatsapp', 'viber'];\n}\n\nvar defaults = {\n  mobileVerification: true,\n  title: 'Video',\n  url: url,\n  socials: getSocials(),\n  embedCode: getEmbedCode(),\n  redirectUri: getRedirectUri()\n};\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\nvar createClass = function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n}();\n\n\n\n\n\n\n\n\n\nvar inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar Button = videojs.getComponent('Button');\n\n/**\n * Share button.\n */\n\nvar ShareButton = function (_Button) {\n  inherits(ShareButton, _Button);\n\n  function ShareButton(player, options) {\n    classCallCheck(this, ShareButton);\n\n    var _this = possibleConstructorReturn(this, _Button.call(this, player, options));\n\n    _this.addClass('vjs-menu-button');\n    _this.addClass('vjs-share-control');\n    _this.addClass('vjs-icon-share');\n    _this.controlText(player.localize('Share'));\n    return _this;\n  }\n\n  ShareButton.prototype.handleClick = function handleClick() {\n    this.player().getChild('ShareOverlay').open();\n  };\n\n  return ShareButton;\n}(Button);\n\n/**\n * @return {boolean}\n */\nfunction isTouchDevice() {\n  return 'ontouchstart' in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\n}\n\n/**\n * Checks if the player opened on iOS or Android device.\n *\n * @return {boolean}\n */\nfunction isMobileDevice() {\n  return (/Android/.test(window.navigator.userAgent) || /iP(hone|ad|od)/i.test(window.navigator.userAgent)\n  );\n}\n\nvar EXCLUDED_SOCIALS = ['whatsapp', 'viber', 'messenger'];\n\n/**\n * Filters socials list depending on platform.\n *\n * @param  {Array} socials\n *         List of socials to filter.\n * @return {Array}\n *         Filtered list of socials.\n */\nfunction filterSocials() {\n  var socials = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n  var mobileVerification = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n  return mobileVerification ? isMobileDevice() ? socials : socials.filter(function (social) {\n    return !EXCLUDED_SOCIALS.includes(social);\n  }) : socials;\n}\n\nvar fbFeed = \"<svg width=\\\"8\\\" height=\\\"16\\\" viewbox=\\\"0 0 8 16\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M5.937 2.752h1.891V.01L5.223 0c-2.893 0-3.55 2.047-3.55 3.353v1.829H0v2.824h1.673V16H5.19V8.006h2.375l.308-2.824H5.19v-1.66c0-.624.44-.77.747-.77\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar tw = \"<svg width=\\\"18\\\" height=\\\"15\\\" viewbox=\\\"0 0 18 15\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M0 12.616a10.657 10.657 0 0 0 5.661 1.615c6.793 0 10.507-5.476 10.507-10.223 0-.156-.003-.31-.01-.464A7.38 7.38 0 0 0 18 1.684a7.461 7.461 0 0 1-2.12.564A3.621 3.621 0 0 0 17.503.262c-.713.411-1.505.71-2.345.871A3.739 3.739 0 0 0 12.462 0C10.422 0 8.77 1.607 8.77 3.59c0 .283.033.556.096.82A10.578 10.578 0 0 1 1.254.656a3.506 3.506 0 0 0-.5 1.807c0 1.246.65 2.346 1.642 2.99a3.731 3.731 0 0 1-1.673-.45v.046c0 1.74 1.274 3.193 2.962 3.523a3.756 3.756 0 0 1-.972.126c-.239 0-.47-.022-.695-.064.469 1.428 1.833 2.467 3.449 2.494A7.531 7.531 0 0 1 .88 12.665c-.298 0-.591-.014-.881-.049\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar reddit = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"24\\\" height=\\\"24\\\" viewbox=\\\"0 0 24 24\\\">\\n  <path d=\\\"M24 11.779a2.654 2.654 0 0 0-4.497-1.899c-1.81-1.191-4.259-1.949-6.971-2.046l1.483-4.669 4.016.941-.006.058a2.17 2.17 0 0 0 2.174 2.163c1.198 0 2.172-.97 2.172-2.163a2.171 2.171 0 0 0-4.193-.785l-4.329-1.015a.37.37 0 0 0-.44.249L11.755 7.82c-2.838.034-5.409.798-7.3 2.025a2.643 2.643 0 0 0-1.799-.712A2.654 2.654 0 0 0 0 11.779c0 .97.533 1.811 1.317 2.271a4.716 4.716 0 0 0-.086.857C1.231 18.818 6.039 22 11.95 22s10.72-3.182 10.72-7.093c0-.274-.029-.544-.075-.81A2.633 2.633 0 0 0 24 11.779zM6.776 13.595c0-.868.71-1.575 1.582-1.575.872 0 1.581.707 1.581 1.575s-.709 1.574-1.581 1.574-1.582-.706-1.582-1.574zm9.061 4.669c-.797.793-2.048 1.179-3.824 1.179L12 19.44l-.013.003c-1.777 0-3.028-.386-3.824-1.179a.369.369 0 0 1 0-.523.372.372 0 0 1 .526 0c.65.647 1.729.961 3.298.961l.013.003.013-.003c1.569 0 2.648-.315 3.298-.962a.373.373 0 0 1 .526 0 .37.37 0 0 1 0 .524zm-.189-3.095a1.58 1.58 0 0 1-1.581-1.574c0-.868.709-1.575 1.581-1.575s1.581.707 1.581 1.575-.709 1.574-1.581 1.574z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"/>\\n</svg>\\n\";\n\nvar gp = \"<svg width=\\\"21\\\" height=\\\"14\\\" viewbox=\\\"0 0 21 14\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M6.816.006C8.5-.071 10.08.646 11.37 1.655a24.11 24.11 0 0 1-1.728 1.754C8.091 2.36 5.89 2.06 4.34 3.272c-2.217 1.503-2.317 5.05-.186 6.668 2.073 1.843 5.991.928 6.564-1.895-1.298-.02-2.6 0-3.899-.042-.003-.76-.006-1.518-.003-2.278 2.17-.006 4.341-.01 6.516.007.13 1.786-.11 3.688-1.23 5.164-1.696 2.34-5.1 3.022-7.756 2.02C1.681 11.921-.207 9.161.018 6.348.077 2.905 3.305-.11 6.816.006zm10.375 3.812h1.893c.004.634.007 1.27.014 1.903.632.007 1.27.007 1.902.013v1.893l-1.902.016c-.007.636-.01 1.27-.014 1.902h-1.896c-.006-.632-.006-1.266-.013-1.899l-1.902-.02V5.735c.633-.006 1.266-.01 1.902-.013.004-.636.01-1.27.016-1.903z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar messenger = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 223 223\\\" width=\\\"512\\\" height=\\\"512\\\">\\n  <path d=\\\"M111.5 0C50.5 0 0.8 47 0.8 104.7c0 31.1 14.5 60.3 39.7 80.3 3.3 2.6 8 2 10.5-1.2 2.6-3.2 2-8-1.2-10.5 -21.6-17.1-34-42.1-34-68.5C15.8 55.2 58.7 15 111.5 15c52.8 0 95.7 40.2 95.7 89.7 0 49.4-42.9 89.7-95.7 89.7 -9.2 0-18.3-1.2-27.1-3.6 -1.9-0.5-4-0.3-5.7 0.7l-31.1 17.6c-3.6 2-4.9 6.6-2.8 10.2 1.4 2.4 3.9 3.8 6.5 3.8 1.3 0 2.5-0.3 3.7-1l28.4-16.1c9.1 2.2 18.5 3.4 28 3.4 61.1 0 110.7-47 110.7-104.7C222.3 47 172.6 0 111.5 0z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"/>\\n  <path d=\\\"M114.7 71.9c-2.6-1.2-5.8-0.8-8 1.1l-57.9 49.1c-3.2 2.7-3.6 7.4-0.9 10.6 2.7 3.2 7.4 3.6 10.6 0.9l45.5-38.6v35.9c0 2.9 1.7 5.6 4.3 6.8 1 0.5 2.1 0.7 3.2 0.7 1.7 0 3.5-0.6 4.9-1.8l57.9-49.1c3.2-2.7 3.6-7.4 0.9-10.6   -2.7-3.2-7.4-3.6-10.6-0.9l-45.5 38.6V78.7C119 75.7 117.3 73.1 114.7 71.9z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"/>\\n</svg>\\n\";\n\nvar linkedin = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"24\\\" height=\\\"24\\\">\\n  <path fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\" d=\\\"M4.98 3.5C4.98 4.881 3.87 6 2.5 6S.02 4.881.02 3.5C.02 2.12 1.13 1 2.5 1s2.48 1.12 2.48 2.5zM5 8H0v16h5V8zm7.982 0H8.014v16h4.969v-8.399c0-4.67 6.029-5.052 6.029 0V24H24V13.869c0-7.88-8.922-7.593-11.018-3.714V8z\\\"/>\\n</svg>\\n\";\n\nvar vk = \"<svg width=\\\"22\\\" height=\\\"12\\\" viewbox=\\\"0 0 22 12\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M10.764 11.94h1.315s.397-.042.6-.251c.187-.192.18-.552.18-.552s-.025-1.685.794-1.934c.807-.245 1.844 1.629 2.942 2.35.832.545 1.463.425 1.463.425l2.938-.039s1.537-.09.808-1.244c-.06-.095-.425-.855-2.184-2.415-1.843-1.633-1.596-1.37.623-4.195 1.351-1.72 1.892-2.771 1.722-3.22-.16-.43-1.154-.316-1.154-.316l-3.308.02s-.246-.033-.427.071c-.178.102-.292.34-.292.34s-.524 1.33-1.222 2.463C14.09 5.833 13.5 5.96 13.26 5.81c-.56-.346-.42-1.388-.42-2.13 0-2.315.368-3.28-.716-3.531-.36-.082-.624-.137-1.544-.146C9.4-.01 8.4.006 7.835.27c-.377.176-.668.568-.49.59.218.029.713.128.976.47.339.44.327 1.43.327 1.43s.195 2.725-.455 3.064c-.446.232-1.057-.242-2.371-2.41-.673-1.11-1.18-2.338-1.18-2.338S4.542.848 4.368.725C4.157.576 3.86.529 3.86.529L.717.549S.245.562.072.757c-.155.175-.012.536-.012.536s2.46 5.5 5.247 8.271c2.556 2.542 5.457 2.375 5.457 2.375\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar ok = \"<svg width=\\\"12\\\" height=\\\"18\\\" viewbox=\\\"0 0 12 18\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M6.843 8.83c2.17-.468 4.162-2.626 3.521-5.3C9.863 1.442 7.561-.599 4.742.161c-6.148 1.662-3.661 9.912 2.1 8.668zm-1.6-6.458c1.39-.375 2.504.554 2.788 1.57.363 1.305-.592 2.394-1.618 2.657-2.913.747-4.16-3.43-1.17-4.227zM9.05 9.536c.41-.23.748-.608 1.367-.577.832.044 2.514 1.404-.445 2.824-1.624.778-1.699.558-2.972.926.22.411 2.55 2.453 3.214 3.082 1.103 1.046.164 2.234-.967 2.115-.718-.077-2.971-2.352-3.38-2.82-.92.438-2.541 2.674-3.431 2.81-1.175.182-2.155-1.091-.96-2.19L4.65 12.73c-.287-.145-1.171-.261-1.59-.389C-1.57 10.93.08 8.838 1.405 8.963c.478.046.907.42 1.274.621 1.931 1.05 4.463 1.029 6.37-.048z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar mail = \"<svg width=\\\"17\\\" height=\\\"16\\\" viewbox=\\\"0 0 17 16\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M8.205 3.322c1.3 0 2.521.563 3.418 1.445v.003c0-.423.29-.742.694-.742l.101-.001c.631 0 .76.586.76.771l.004 6.584c-.045.431.454.653.73.377 1.077-1.086 2.366-5.585-.67-8.192-2.831-2.43-6.629-2.03-8.649-.664-2.146 1.453-3.52 4.668-2.185 7.688 1.455 3.294 5.617 4.276 8.091 3.296 1.253-.496 1.832 1.165.53 1.708-1.965.822-7.438.74-9.994-3.605C-.692 9.057-.6 3.896 3.98 1.222c3.505-2.046 8.125-1.48 10.91 1.374 2.913 2.985 2.743 8.572-.097 10.745-1.288.986-3.199.025-3.187-1.413l-.013-.47a4.827 4.827 0 0 1-3.388 1.381c-2.566 0-4.825-2.215-4.825-4.733 0-2.543 2.259-4.784 4.825-4.784zm3.231 4.602C11.34 6.08 9.944 4.97 8.26 4.97h-.063c-1.945 0-3.023 1.5-3.023 3.204 0 1.908 1.305 3.113 3.015 3.113 1.907 0 3.162-1.37 3.252-2.992l-.004-.372z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar email = \"<svg width=\\\"17\\\" height=\\\"16\\\" viewbox=\\\"0 0 17 16\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M8.205 3.322c1.3 0 2.521.563 3.418 1.445v.003c0-.423.29-.742.694-.742l.101-.001c.631 0 .76.586.76.771l.004 6.584c-.045.431.454.653.73.377 1.077-1.086 2.366-5.585-.67-8.192-2.831-2.43-6.629-2.03-8.649-.664-2.146 1.453-3.52 4.668-2.185 7.688 1.455 3.294 5.617 4.276 8.091 3.296 1.253-.496 1.832 1.165.53 1.708-1.965.822-7.438.74-9.994-3.605C-.692 9.057-.6 3.896 3.98 1.222c3.505-2.046 8.125-1.48 10.91 1.374 2.913 2.985 2.743 8.572-.097 10.745-1.288.986-3.199.025-3.187-1.413l-.013-.47a4.827 4.827 0 0 1-3.388 1.381c-2.566 0-4.825-2.215-4.825-4.733 0-2.543 2.259-4.784 4.825-4.784zm3.231 4.602C11.34 6.08 9.944 4.97 8.26 4.97h-.063c-1.945 0-3.023 1.5-3.023 3.204 0 1.908 1.305 3.113 3.015 3.113 1.907 0 3.162-1.37 3.252-2.992l-.004-.372z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar telegram = \"<svg width=\\\"21\\\" height=\\\"17\\\" viewbox=\\\"0 0 21 17\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M10.873 13.323c-.784.757-1.56 1.501-2.329 2.252-.268.262-.57.407-.956.387-.263-.014-.41-.13-.49-.378-.589-1.814-1.187-3.626-1.773-5.44a.425.425 0 0 0-.322-.317A417.257 417.257 0 0 1 .85 8.541a2.37 2.37 0 0 1-.59-.265c-.309-.203-.353-.527-.07-.762.26-.216.57-.397.886-.522C2.828 6.304 4.59 5.638 6.35 4.964L19.039.101c.812-.311 1.442.12 1.366.988-.05.572-.2 1.137-.32 1.702-.938 4.398-1.88 8.794-2.82 13.191l-.003.026c-.23 1.006-.966 1.28-1.806.668-1.457-1.065-2.91-2.134-4.366-3.201-.068-.05-.14-.098-.217-.152zm-3.22 1.385c.023-.103.038-.151.043-.2.092-.989.189-1.977.27-2.967a.732.732 0 0 1 .256-.534c2.208-1.968 4.41-3.943 6.613-5.917.626-.561 1.256-1.12 1.876-1.688.065-.06.08-.174.117-.263-.095-.027-.203-.095-.285-.072-.189.052-.38.127-.545.23C12.722 5.343 9.45 7.395 6.175 9.44c-.167.104-.214.19-.147.389.518 1.547 1.022 3.098 1.531 4.648.02.061.048.12.094.23z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar whatsapp = \"<svg width=\\\"22\\\" height=\\\"22\\\" viewbox=\\\"0 0 22 22\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M7.926 5.587c-.213-.51-.375-.53-.698-.543a6.234 6.234 0 0 0-.369-.013c-.42 0-.86.123-1.125.395-.323.33-1.125 1.1-1.125 2.677 0 1.578 1.15 3.104 1.306 3.318.162.213 2.244 3.498 5.476 4.837 2.528 1.048 3.278.95 3.853.828.84-.181 1.894-.802 2.16-1.552.265-.75.265-1.39.187-1.527-.078-.135-.291-.213-.614-.375-.323-.161-1.894-.937-2.192-1.04-.29-.11-.569-.072-.788.239-.31.433-.614.873-.86 1.138-.194.207-.511.233-.776.123-.356-.149-1.351-.498-2.58-1.591-.95-.847-1.596-1.901-1.784-2.218-.187-.323-.02-.511.13-.685.161-.201.316-.343.478-.53.161-.188.252-.285.355-.505.11-.214.033-.434-.045-.595-.078-.162-.724-1.74-.99-2.38zM10.996 0C4.934 0 0 4.934 0 11c0 2.405.776 4.636 2.095 6.447L.724 21.534l4.228-1.351A10.913 10.913 0 0 0 11.003 22C17.067 22 22 17.066 22 11S17.067 0 11.003 0h-.006z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar viber = \"<svg width=\\\"21\\\" height=\\\"21\\\" viewbox=\\\"0 0 21 21\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n  <path d=\\\"M18.639 14.904c-.628-.506-1.3-.96-1.96-1.423-1.318-.926-2.523-.997-3.506.491-.552.836-1.325.873-2.133.506-2.228-1.01-3.949-2.567-4.956-4.831-.446-1.002-.44-1.9.603-2.609.552-.375 1.108-.818 1.064-1.637C7.693 4.334 5.1.765 4.077.39 3.653.233 3.23.243 2.8.388.4 1.195-.594 3.169.358 5.507c2.84 6.974 7.84 11.829 14.721 14.792.392.169.828.236 1.049.297 1.567.015 3.402-1.494 3.932-2.992.51-1.441-.568-2.013-1.421-2.7zm-7.716-13.8c-.417-.064-1.052.026-1.02-.525.046-.817.8-.513 1.165-.565 4.833.163 8.994 4.587 8.935 9.359-.006.468.162 1.162-.536 1.149-.668-.013-.493-.717-.553-1.185-.64-5.067-2.96-7.46-7.991-8.233zm.984 1.39c3.104.372 5.64 3.065 5.615 6.024-.047.35.157.95-.409 1.036-.764.116-.615-.583-.69-1.033-.511-3.082-1.593-4.213-4.7-4.907-.458-.102-1.17-.03-1.052-.736.113-.671.752-.443 1.236-.385zm.285 2.419c1.377-.034 2.992 1.616 2.969 3.044.014.39-.028.802-.49.857-.333.04-.552-.24-.586-.585-.128-1.272-.798-2.023-2.073-2.228-.382-.061-.757-.184-.579-.7.12-.345.436-.38.76-.388z\\\" fill=\\\"#FFF\\\" fill-rule=\\\"evenodd\\\"></path>\\n</svg>\\n\";\n\nvar icons = {\n  fbFeed: fbFeed,\n  tw: tw,\n  reddit: reddit,\n  gp: gp,\n  messenger: messenger,\n  linkedin: linkedin,\n  vk: vk,\n  ok: ok,\n  mail: mail,\n  email: email,\n  telegram: telegram,\n  whatsapp: whatsapp,\n  viber: viber\n};\n\nvar ShareModalContent = function () {\n  function ShareModalContent(player, options) {\n    classCallCheck(this, ShareModalContent);\n\n    this.player = player;\n\n    this.options = options;\n    this.socials = filterSocials(options.socials, options.mobileVerification);\n\n    this.copyBtnTextClass = 'vjs-share__btn-text';\n    this.socialBtnClass = 'vjs-share__social';\n\n    this._createContent();\n    this._initToggle();\n    this._initClipboard();\n    this._initSharing();\n  }\n\n  ShareModalContent.prototype.getContent = function getContent() {\n    return this.content;\n  };\n\n  ShareModalContent.prototype._createContent = function _createContent() {\n    var copyBtn = '\\n      <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"20\">\\n        <path fill=\"#FFF\" fill-rule=\"evenodd\" d=\"M10.07 20H1.318A1.325 1.325 0 0 1 0 18.67V6.025c0-.712.542-1.21 1.318-1.21h7.294l2.776 2.656v11.2c0 .734-.59 1.33-1.318 1.33zm6.46-15.926v9.63h-3.673v1.48h3.825c.727 0 1.318-.595 1.318-1.328v-11.2L15.225 0H7.93c-.776 0-1.318.497-1.318 1.21v2.123h1.47V1.48h5.877v2.594h2.57zm-.73-1.48l-.37-.357v.356h.37zM9.918 8.888v9.63H1.47V6.295h5.878V8.89h2.57zm-.73-1.483l-.372-.355v.355h.37z\"></path>\\n      </svg>\\n      <span class=\"' + this.copyBtnTextClass + '\">' + this.player.localize('Copy') + '</span>\\n    ';\n    var wrapper = document.createElement('div');\n\n    var embedContainer = '';\n\n    // Embed code container should be optional if there is no Embed Code formatter available\n    if (this.options.embedCode) {\n      embedContainer = '\\n        <div class=\"vjs-share__subtitle hidden-xs\">' + this.player.localize('Embed Code') + ':</div>\\n        <div class=\"vjs-share__short-link-wrapper hidden-xs\">\\n          <input class=\"vjs-share__short-link\" type=\"text\" readonly=\"true\" value=\"' + this.options.embedCode + '\">\\n          <div class=\"vjs-share__btn\">\\n            ' + copyBtn + '\\n          </div>\\n        </div>';\n    }\n\n    wrapper.innerHTML = '<div class=\"vjs-share\">\\n      <div class=\"vjs-share__top hidden-sm\">\\n        <div class=\"vjs-share__title\">' + this.player.localize('Share') + '</div>\\n      </div>\\n\\n      <div class=\"vjs-share__middle\">\\n        <div class=\"vjs-share__subtitle hidden-xs\">' + this.player.localize('Direct Link') + ':</div>\\n        <div class=\"vjs-share__short-link-wrapper\">\\n          <input class=\"vjs-share__short-link\" type=\"text\" readonly=\"true\" value=\"' + this.options.url + '\">\\n          <div class=\"vjs-share__btn\">\\n            ' + copyBtn + '\\n          </div>\\n        </div>\\n\\n        ' + embedContainer + '\\n      </div>\\n\\n      <div class=\"vjs-share__bottom\">\\n        <div class=\"vjs-share__socials\">\\n          ' + this._getSocialItems().join('') + '\\n        </div>\\n      </div>\\n    </div>';\n\n    this.content = wrapper.firstChild;\n  };\n\n  ShareModalContent.prototype._initClipboard = function _initClipboard() {\n    var _this = this;\n\n    var clipboard = new Clipboard('.vjs-share__btn', {\n      target: function target(trigger) {\n        return trigger.previousElementSibling;\n      }\n    });\n\n    clipboard.on('success', function (e) {\n      var textContainer = e.trigger.querySelector('.' + _this.copyBtnTextClass);\n      var restore = function restore() {\n        textContainer.innerText = _this.player.localize('Copy');\n        e.clearSelection();\n      };\n\n      textContainer.innerText = _this.player.localize('Copied');\n\n      if (isTouchDevice()) {\n        setTimeout(restore, 1000);\n      } else {\n        textContainer.parentElement.addEventListener('mouseleave', function () {\n          setTimeout(restore, 300);\n        });\n      }\n    });\n  };\n\n  ShareModalContent.prototype._initSharing = function _initSharing() {\n    var _this2 = this;\n\n    var btns = this.content.querySelectorAll('.' + this.socialBtnClass);\n\n    Array.from(btns).forEach(function (btn) {\n      btn.addEventListener('click', function (e) {\n        var social = e.currentTarget.getAttribute('data-social');\n        var sharingFN = sharing[social];\n\n        if (typeof sharingFN === 'function') {\n          sharingFN(_this2.socialOptions);\n        }\n      });\n    });\n  };\n\n  ShareModalContent.prototype._initToggle = function _initToggle() {\n    var iconsList = this.content.querySelector('.vjs-share__socials');\n\n    if (this.socials.length > 10 || window.innerWidth <= 180 && this.socials.length > 6) {\n      iconsList.style.height = 'calc((2em + 5px) * 2)';\n    } else {\n      iconsList.classList.add('horizontal');\n    }\n  };\n\n  ShareModalContent.prototype._getSocialItems = function _getSocialItems() {\n    var socialItems = [];\n\n    this.socials.forEach(function (social) {\n      if (icons[social]) {\n        socialItems.push('\\n          <button class=\"vjs-share__social vjs-share__social_' + social + '\" data-social=\"' + social + '\">\\n            ' + icons[social] + '\\n          </button>\\n        ');\n      }\n    });\n\n    return socialItems;\n  };\n\n  createClass(ShareModalContent, [{\n    key: 'socialOptions',\n    get: function get$$1() {\n      var _options = this.options,\n          url = _options.url,\n          title = _options.title,\n          description = _options.description,\n          image = _options.image,\n          fbAppId = _options.fbAppId,\n          isVkParse = _options.isVkParse,\n          redirectUri = _options.redirectUri;\n\n\n      return {\n        url: url,\n        title: title,\n        description: description,\n        image: image,\n        fbAppId: fbAppId,\n        isVkParse: isVkParse,\n        redirectUri: redirectUri\n      };\n    }\n  }]);\n  return ShareModalContent;\n}();\n\nvar ModalDialog = videojs.getComponent('ModalDialog');\n\n/**\n * Share modal.\n */\n\nvar ShareModal = function (_ModalDialog) {\n  inherits(ShareModal, _ModalDialog);\n\n  function ShareModal(player, options) {\n    classCallCheck(this, ShareModal);\n\n    var _this = possibleConstructorReturn(this, _ModalDialog.call(this, player, options));\n\n    _this.playerClassName = 'vjs-videojs-share_open';\n    return _this;\n  }\n\n  ShareModal.prototype.open = function open() {\n    var player = this.player();\n\n    player.addClass(this.playerClassName);\n    _ModalDialog.prototype.open.call(this);\n    player.trigger('sharing:opened');\n  };\n\n  ShareModal.prototype.close = function close() {\n    var player = this.player();\n\n    player.removeClass(this.playerClassName);\n    _ModalDialog.prototype.close.call(this);\n    player.trigger('sharing:closed');\n  };\n\n  return ShareModal;\n}(ModalDialog);\n\nvar Component = videojs.getComponent('Component');\n\n/**\n * Share overlay.\n */\n\nvar ShareOverlay = function (_Component) {\n  inherits(ShareOverlay, _Component);\n\n  function ShareOverlay(player, options) {\n    classCallCheck(this, ShareOverlay);\n\n    var _this = possibleConstructorReturn(this, _Component.call(this, player, options));\n\n    _this.player = player;\n    _this.options = options;\n    return _this;\n  }\n\n  ShareOverlay.prototype._createModal = function _createModal() {\n    var content = new ShareModalContent(this.player, this.options).getContent();\n\n    this.modal = new ShareModal(this.player, {\n      content: content,\n      temporary: true\n    });\n\n    this.el = this.modal.contentEl();\n\n    this.player.addChild(this.modal);\n  };\n\n  ShareOverlay.prototype.open = function open() {\n    this._createModal();\n    this.modal.open();\n  };\n\n  return ShareOverlay;\n}(Component);\n\nvar Plugin = videojs.getPlugin('plugin');\n\n// Default options for the plugin.\n/**\n * An advanced Video.js plugin. For more information on the API\n *\n * See: https://blog.videojs.com/feature-spotlight-advanced-plugins/\n */\n\nvar Share = function (_Plugin) {\n  inherits(Share, _Plugin);\n\n  /**\n   * Create a Share plugin instance.\n   *\n   * @param  {Player} player\n   *         A Video.js Player instance.\n   *\n   * @param  {Object} [options]\n   *         An optional options object.\n   *\n   *         While not a core part of the Video.js plugin architecture, a\n   *         second argument of options is a convenient way to accept inputs\n   *         from your plugin's caller.\n   */\n  function Share(player, options) {\n    classCallCheck(this, Share);\n\n    var _this = possibleConstructorReturn(this, _Plugin.call(this, player));\n    // the parent class will add player under this.player\n\n\n    _this.options = videojs.mergeOptions(defaults, options);\n\n    _this.player.ready(function () {\n      _this.player.addClass('vjs-share');\n      player.addClass('vjs-videojs-share');\n      player.getChild('controlBar').addChild('ShareButton', options);\n      player.addChild('ShareOverlay', options);\n    });\n    return _this;\n  }\n\n  return Share;\n}(Plugin);\n\n// Define default values for the plugin's `state` object here.\n\n\nShare.defaultState = {};\n\n// Include the version number.\nShare.VERSION = version;\n\n// Register the plugin with video.js.\nvideojs.registerComponent('ShareButton', ShareButton);\nvideojs.registerComponent('ShareOverlay', ShareOverlay);\nvideojs.registerPlugin('share', Share);\n\nexport default Share;\n","import 'videojs-share';\nimport ClipboardJS from 'clipboard';\nimport {\n  fixUrlProtocol,\n  getEventByContext,\n  getMediaInfo,\n  getVideoId,\n  isArcEnviroment,\n  isLegacyVideo,\n  isMobile,\n} from '../helpers/helpers';\nimport getMetadatas from '../utils/get-metadatas';\n\nconst newTwitterSvg = `\n  <svg width=\"32\" height=\"32\" viewBox=\"0 0 1200 1227\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path xmlns=\"http://www.w3.org/2000/svg\" d=\"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z\" fill=\"white\"/>\n  </svg>\n`;\n\nconst shareLinkSvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"none\"><path d=\"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z\" fill=\"white\"/></svg>`;\n\nconst configureShareEmbed = (player) => {\n  const { el_ } = player;\n  const wrappers = el_.querySelectorAll('.vjs-share__short-link-wrapper');\n  const inputs = el_.querySelectorAll('.vjs-share__short-link');\n  const wrapper = wrappers[1];\n  const input = inputs[1];\n  const iframe = input.value && input.value.replace(/'/g, '\"');\n  input.value = iframe;\n  const textarea = document.createElement('textarea');\n  textarea.value = iframe;\n  textarea.cols = '1';\n  textarea.rows = '1';\n  textarea.readOnly = true;\n  textarea.classList.add('vjs-share__short-link--small');\n  wrapper.insertBefore(textarea, input);\n};\n\nconst overrideTwitterLogo = (player) => {\n  const { el_ } = player;\n  const socialShareTwitter = el_.querySelector('.vjs-share__social_tw');\n\n  const range = document.createRange();\n  const fragment = range.createContextualFragment(newTwitterSvg);\n\n  socialShareTwitter.replaceChildren(fragment);\n};\n\nconst modifyShareOverlay = (element) => {\n  const wrapper = element.querySelector('.vjs-share');\n\n  wrapper.classList.add('vjs-share--arc');\n};\n\nconst clickShareButton = (player) => {\n  const { el_ } = player;\n\n  if (isLegacyVideo(player)) {\n    modifyShareOverlay(el_);\n  } else {\n    configureShareEmbed(player);\n  }\n\n  // Adding url copy button\n  const { mainSectionUrl } = getMetadatas(player);\n  const urlToUse = fixUrlProtocol(mainSectionUrl);\n\n  const socialShareWrapper = el_.querySelector('.vjs-share__socials');\n  const urlButtonTemplate = `\n    <button class=\"vjs-share__social vjs-share__social_url\" data-clipboard-text='${urlToUse}' data-social-share-url>\n      ${shareLinkSvg}\n    </button>`;\n  socialShareWrapper.insertAdjacentHTML('beforeend', urlButtonTemplate);\n\n  const urlClipboardButton = new ClipboardJS('[data-social-share-url]');\n  urlClipboardButton.on('success', () => {\n    const urlBtn = el_.querySelector('.vjs-share__social_url');\n    urlBtn.classList.add('vjs-share__social_url--copied');\n    setTimeout(() => {\n      urlBtn.classList.remove('vjs-share__social_url--copied');\n    }, 2000);\n\n    player.trigger('tracking:share', { sharedMedia: 'link-copiado' });\n  });\n\n  // update plugin twitter logo for the x logo\n  overrideTwitterLogo(player);\n};\n\nconst overrideMobileEvents = () => {\n  document.addEventListener('touchend', (event) => {\n    const { target } = event;\n\n    if (target.classList.contains('vjs-share__social') || target.classList.contains('vjs-share__btn')) {\n      event.preventDefault();\n\n      const clickEvent = new MouseEvent('click', {\n        bubbles: true,\n        cancelable: true,\n        view: window,\n      });\n\n      target.dispatchEvent(clickEvent);\n    }\n  });\n};\n\nconst initShareModification = (player) => {\n  try {\n    const { el_ } = player;\n    const shareButton = el_.querySelector('.vjs-share-control');\n\n    const eventToUse = getEventByContext();\n\n    shareButton.addEventListener(eventToUse, () => clickShareButton(player));\n\n    if (isMobile()) {\n      overrideMobileEvents();\n    }\n  } catch (unused) {\n    /* unecessary catch */\n  }\n};\n\nconst getEmbedTemplate = (url) =>\n  `\n <iframe title='R7 Video Player' src='${url}' width='640' height='360' frameborder='0' loading='lazy' allowfullscreen></iframe>\n`.trim();\n\nconst initSharePlugin = (player, shareOptions) => {\n  player.share(shareOptions, false);\n\n  player.ready(() => initShareModification(player));\n};\n\nconst vjsShare = (player) => {\n  if (player.share) {\n    // eslint-disable-next-line camelcase\n    const playerUrl = player.tagAttributes['data-player-url'] || player.tagAttributes.player_url;\n\n    const { mainSectionUrl } = getMetadatas(player);\n\n    const shareOptions = {\n      socials: ['fbFeed', 'tw', 'whatsapp'],\n      fbAppId: '966242223397117',\n      mobileVerification: false,\n    };\n\n    if (isArcEnviroment()) {\n      const urlShare = fixUrlProtocol(mainSectionUrl);\n      shareOptions.url = urlShare;\n\n      if (!isLegacyVideo(player)) {\n        const embed = getEmbedTemplate(playerUrl);\n        shareOptions.embedCode = embed;\n      }\n\n      initSharePlugin(player, shareOptions);\n    } else {\n      const [videoUrlSplit] = playerUrl.split('?');\n      const videoId = getVideoId(player);\n      if (videoId) {\n        getMediaInfo(videoId, (data) => {\n          const urlShare = data.shortened_url ? fixUrlProtocol(data.shortened_url) : fixUrlProtocol(mainSectionUrl);\n\n          const embed = getEmbedTemplate(videoUrlSplit);\n\n          shareOptions.url = urlShare;\n\n          shareOptions.embedCode = embed;\n\n          initSharePlugin(player, shareOptions);\n        });\n      }\n    }\n  }\n};\n\nexport default vjsShare;\n","import { preloadImage, isDevelopEnv, getEventByContext, getRelatedVideos, fixLegacyUrl } from '../helpers/helpers';\nimport getParams from '../utils/get-params';\n\nconst OVERLAY_CLASS = 'vjs-r7-suggestedoverlay';\nlet suggestedOverlayConfigs = [];\nlet showSuggested = true;\n\nconst getSuggestedOverlayConfig = () => suggestedOverlayConfigs;\n\nconst cleanSuggestedOverlayConfig = () => {\n  suggestedOverlayConfigs = [];\n};\n\nconst setSuggestedContent = (player) => {\n  const content = [];\n  const isDevEnvironment = isDevelopEnv();\n  const linkTarget = isDevEnvironment ? '_blank' : '_top';\n\n  const relatedVideos = getRelatedVideos(player);\n\n  relatedVideos.forEach((v) => {\n    preloadImage(v.thumb);\n\n    const suggest = `\n    <a href=\"${fixLegacyUrl(v.url)}\" \n      title=\"${v.title}\" \n      class=\"${OVERLAY_CLASS}__item-link\" \n      target=\"${linkTarget}\" \n      rel=\"noreferrer noopener\" \n      data-suggested \n      data-layer-dispatch-cancel>\n      <img src=\"${v.thumb}\" \n        alt=\"${v.title}\" \n        loading=\"lazy\" \n        class=\"${OVERLAY_CLASS}__item-img\" \n        data-suggested-img>\n      <div class=\"${OVERLAY_CLASS}__item-desc\" \n      data-suggested-desc>\n        ${v.title}\n      </div>\n    </a>\n    <button class=\"vjs-control vjs-button ${OVERLAY_CLASS}__close-button\" \n      type=\"button\" \n      title=\"Fechar vídeo sugerido\" \n      aria-disabled=\"false\" \n      data-suggested-close-btn></button>\n    `;\n    content.push(suggest);\n  });\n\n  const currentElement = player.children_[0].parentElement || player.el_;\n\n  const container = currentElement.querySelector('[data-suggested-container]');\n  container.innerHTML = content.length > 0 ? content[0] : '';\n\n  return container;\n};\n\nconst getContainerTemplate = () => `<div class=\"${OVERLAY_CLASS}__item-container\" data-suggested-container></div>`;\n\nconst createSuggestedOverlay = () => {\n  cleanSuggestedOverlayConfig();\n  const content = getContainerTemplate();\n\n  suggestedOverlayConfigs.push({\n    class: OVERLAY_CLASS,\n    content,\n    showBackground: false,\n    start: 'suggestOverlay',\n    end: 'suggestOverlayEnd',\n    align: 'top-right',\n  });\n};\n\nconst initSuggestedOverlay = (player) => {\n  const defaultStart = 20000; // after 20 seconds (in miliseconds)\n\n  let timer = null;\n  setSuggestedContent(player);\n\n  player.on('timeupdate', () => {\n    const curTime = +(player.currentTime().toFixed(0) * 1000);\n\n    if (curTime >= defaultStart && showSuggested) {\n      showSuggested = false;\n      player.trigger('suggestOverlay');\n    } else if (curTime < defaultStart) {\n      showSuggested = true;\n      player.trigger('suggestOverlayEnd');\n    }\n  });\n\n  player.on('suggestOverlay', () => {\n    timer = setTimeout(() => {\n      player.trigger('suggestOverlayEnd');\n    }, 15000);\n  });\n\n  player.on('suggestOverlayEnd', () => {\n    if (timer) {\n      clearTimeout(timer);\n    }\n  });\n\n  const currentElement = player.children_[0].parentElement || player.el_;\n\n  const suggestOverlayContainer = currentElement.querySelector('.vjs-r7-suggestedoverlay');\n  const eventToUse = getEventByContext();\n\n  suggestOverlayContainer.addEventListener(eventToUse, (event) => {\n    if (event.target.dataset.suggestedCloseBtn !== undefined) {\n      player.trigger('suggestOverlayEnd');\n    }\n  });\n};\n\nconst vjsSuggestedOverlay = (player) => {\n  createSuggestedOverlay();\n\n  const params = getParams(player);\n  const { timerRelated } = params;\n\n  if (!timerRelated) {\n    return false;\n  }\n\n  player.on('ready', () => initSuggestedOverlay(player));\n  return true;\n};\n\nexport { vjsSuggestedOverlay, getSuggestedOverlayConfig };\n","import {\n  preloadImage,\n  isDevelopEnv,\n  getEventByContext,\n  getRelatedVideos,\n  fixLegacyUrl,\n  isInIframe,\n} from '../helpers/helpers';\nimport getParams from '../utils/get-params';\n\nconst MODAL_CLASS = 'vjs-r7-suggestedvideos';\n\nlet currentPlayer;\nlet myModal;\n\nconst getModalOptions = () => ({\n  label: 'Vídeos Relacionados',\n  fillAlways: true,\n  temporary: false,\n});\n\nconst getSuggestedContent = (data) => {\n  const content = [];\n  const isDevEnrionment = isDevelopEnv();\n  const linkTarget = isDevEnrionment ? '_blank' : '_top';\n\n  (data || []).forEach((d) => {\n    preloadImage(d.thumb);\n\n    const suggest = `\n      <a href=\"${fixLegacyUrl(d.url)}\" title=\"${d.title}\" class=\"${MODAL_CLASS}__item-container\" target=\"${linkTarget}\" rel=\"noreferrer noopener\" data-layer-dispatch-cancel>\n        <img src=\"${d.thumb}\" alt=\"${d.title}\" loading=\"lazy\" class=\"${MODAL_CLASS}__item-img\">\n        <div class=\"${MODAL_CLASS}__item-desc\">${d.title}</div>\n      </a>\n    `;\n    content.push(suggest);\n  });\n\n  const reviewattr = 'data-review';\n  const reviewBtn = `<button type=\"button\" ${reviewattr} class=\"${MODAL_CLASS}__review\">Rever</button>`;\n  content.push(reviewBtn);\n\n  const container = document.createElement('div');\n  container.innerHTML = content.join('');\n  const eventToUse = getEventByContext();\n\n  container.querySelector(`[${reviewattr}]`).addEventListener(eventToUse, () => {\n    currentPlayer.trigger('tracking:replay');\n    myModal.close();\n    currentPlayer.play();\n  });\n\n  return container;\n};\n\nconst createSuggestedContainer = (player, data) => {\n  const modalOptions = getModalOptions();\n  const suggestedContent = getSuggestedContent(data);\n\n  const { endBehavior } = getParams(player);\n  const relatedVideos = getRelatedVideos(player);\n  const hasNextVideo = relatedVideos.length > 0 && relatedVideos[0].embedUrl;\n\n  const shouldShowRelated = endBehavior === 'default' || !(isInIframe() && endBehavior !== 'default') || !hasNextVideo;\n\n  myModal = player.createModal(shouldShowRelated ? suggestedContent : '', modalOptions);\n  myModal.addClass(MODAL_CLASS);\n  myModal.closeable(false);\n};\n\nconst vjsSuggestedVideos = (player) => {\n  const params = getParams(player);\n  const { timerRelated } = params;\n  if (!timerRelated) {\n    return false;\n  }\n\n  currentPlayer = player;\n  const relatedVideos = getRelatedVideos(player);\n  createSuggestedContainer(player, relatedVideos);\n\n  return true;\n};\n\nexport default vjsSuggestedVideos;\n","import {\n  isDevelopEnv,\n  isInIframe,\n  verifyEndCasting,\n  getRelatedVideos,\n  fixLegacyUrl,\n  changeCurrentUrl,\n} from '../helpers/helpers';\nimport vjsSuggestedVideos from './vjs-suggested-container';\nimport getParams from '../utils/get-params';\nimport getMetadatas from '../utils/get-metadatas';\n\nconst MODAL_CLASS = 'vjs-r7-suggestednext';\nconst isDevEnrionment = isDevelopEnv();\nconst NEXT_VIDEO_TIMEOUT = isDevEnrionment ? 60000 : 5000;\n\nlet myModal;\nlet nextVideoData;\nlet triggerNextVideo = true;\nlet endVideo = false;\nlet endAd = false;\nlet endedAdOnce = false;\n\nconst toNextVideo = () => {\n  if (triggerNextVideo && !isDevEnrionment && !isInIframe()) {\n    const { url } = nextVideoData;\n    changeCurrentUrl(url);\n  } else {\n    myModal.close();\n  }\n};\n\nconst getModalOptions = () => ({\n  label: '',\n  fillAlways: true,\n  temporary: false,\n});\n\nconst getSuggestedContent = (data) => {\n  if (!data || data.length === 0) {\n    return undefined;\n  }\n\n  const nextVideo = data[0];\n  const container = document.createElement('div');\n  const linkTarget = isDevEnrionment ? '_blank' : '_top';\n\n  container.innerHTML = `\n    <a href=\"${fixLegacyUrl(nextVideo.url)}\" title=\"Tocar: ${nextVideo.title}\" class=\"${MODAL_CLASS}__play\" target=\"${linkTarget}\" rel=\"noreferrer noopener\" data-next data-layer-dispatch-cancel>\n      Tocar Próximo Vídeo\n    </a>\n    <span class=\"${MODAL_CLASS}__title\">${nextVideo.title}</span>\n  `;\n  nextVideoData = nextVideo;\n\n  return container;\n};\n\nconst suggestedNextContainer = (player, suggestedContent) => {\n  const modalOptions = getModalOptions();\n  const { endBehavior } = getParams(player);\n  const shouldShowNext = endBehavior === 'default';\n\n  myModal = player.createModal(shouldShowNext ? suggestedContent : '', modalOptions);\n  myModal.addClass(MODAL_CLASS);\n\n  if (shouldShowNext) {\n    myModal.setTimeout(toNextVideo, NEXT_VIDEO_TIMEOUT);\n    myModal.on('modalclose', () => {\n      triggerNextVideo = false;\n      vjsSuggestedVideos(player);\n    });\n  } else {\n    const { url } = nextVideoData;\n    changeCurrentUrl(url);\n  }\n};\n\nconst createSuggestedContainer = (player, data) => {\n  const suggestedContent = getSuggestedContent(data);\n  return suggestedContent ? suggestedNextContainer(player, suggestedContent) : vjsSuggestedVideos(player);\n};\n\nconst initSuggestedNextVideo = (player) => {\n  const relatedVideos = getRelatedVideos(player);\n  createSuggestedContainer(player, relatedVideos);\n};\n\nconst vjsSuggestedNext = (player) => {\n  const { ads, timerRelated } = getParams(player);\n  const { disableAdv } = getMetadatas(player);\n\n  endAd = !ads || disableAdv;\n\n  if (!timerRelated) {\n    return false;\n  }\n\n  const checkEndOfVideo = () => {\n    if (endVideo && endAd) {\n      const isIframe = isInIframe();\n      if (isIframe) {\n        vjsSuggestedVideos(player);\n      } else {\n        initSuggestedNextVideo(player);\n      }\n    }\n  };\n\n  player.on('ready', () => {\n    player.on('adserror', () => {\n      if (!endAd && player.ima && player.ima.addContentAndAdsEndedListener) {\n        endAd = true;\n      }\n    });\n\n    player.on('tracking:end', () => {\n      endVideo = true;\n      const isAfterCast = verifyEndCasting(player);\n      if (!isAfterCast) {\n        checkEndOfVideo(player);\n      }\n    });\n\n    if (!endAd) {\n      if (player.ima && player.ima.addContentAndAdsEndedListener) {\n        player.ima.addContentAndAdsEndedListener(() => {\n          endAd = true;\n          if (!endedAdOnce) {\n            endedAdOnce = true;\n            checkEndOfVideo(player);\n          }\n        });\n      } else {\n        endAd = true;\n        checkEndOfVideo(player);\n      }\n    }\n  });\n\n  return true;\n};\n\nexport default vjsSuggestedNext;\n","import { fixUrlProtocol, isArcLive } from '../helpers/helpers';\nimport getMetadatas from '../utils/get-metadatas';\nimport getParams from '../utils/get-params';\n\nlet titleOverlayConfigs = [];\n\nconst getTitleOverlayConfig = () => titleOverlayConfigs;\n\nconst cleanTitleOverlayConfig = () => {\n  titleOverlayConfigs = [];\n};\n\nconst vjsTitleOverlay = (player) => {\n  const { title, mainSection, mainSectionUrl, sectionPath } = getMetadatas(player);\n  const { logo, noTitle } = getParams(player);\n  const urlToUse = fixUrlProtocol(mainSectionUrl);\n  cleanTitleOverlayConfig();\n\n  if (!noTitle) {\n    const noLogoClass = logo ? '' : ' vjs-title-overlay-wrap--no-logo';\n\n    const linkTemplate = `<a class=\"vjs-title-text__link\" href=\"${urlToUse}\" target=\"_top\" data-layer-dispatch-cancel>${title}</a>`;\n\n    const titleLink = isArcLive() ? title : linkTemplate;\n\n    const overlayTitleContent = `\n    <div class=\"vjs-title-overlay-wrap${noLogoClass}\">\n      <span class=\"vjs-title-text\">${titleLink}</span>\n      <span class=\"vjs-title-description\">por <a class=\"vjs-title-description__link\" href=\"${sectionPath}\" target=\"_top\" data-layer-dispatch-cancel>${mainSection}</a></span>\n    </div>\n    `;\n\n    titleOverlayConfigs.push(\n      {\n        content: overlayTitleContent,\n        start: 'loadstart',\n        end: 'playing',\n        align: 'top-left',\n      },\n      {\n        content: overlayTitleContent,\n        start: 'pause',\n        end: 'playing',\n        align: 'top-left',\n      }\n    );\n  }\n};\n\nexport { vjsTitleOverlay, getTitleOverlayConfig };\n","import getMetadatas from '../utils/get-metadatas';\nimport getParams from '../utils/get-params';\n\nlet ageOverlayConfigs = [];\n\nconst AGE_RATINGS = {\n  L: {\n    className: 'age-free',\n    flag: 'L',\n    text: 'Livre',\n  },\n  10: {\n    className: 'age-10',\n    flag: '10',\n    text: '10 anos',\n  },\n  12: {\n    className: 'age-12',\n    flag: '12',\n    text: '12 anos',\n  },\n  14: {\n    className: 'age-14',\n    flag: '14',\n    text: '14 anos',\n  },\n  16: {\n    className: 'age-16',\n    flag: '16',\n    text: '16 anos',\n  },\n  18: {\n    className: 'age-18',\n    flag: '18',\n    text: '18 anos',\n  },\n};\n\nconst OVERLAY_DURATION = {\n  seconds: 8,\n  miliseconds: 8000,\n};\n\nconst SELECTORS = {\n  overlayOpenClass: 'vjs-age-overlay-wrap--open',\n  hiddenIconClass: 'vjs-age-icon--hidden',\n  ageRatingIcon: '[data-age-rating-icon]',\n  ageRatingContainer: '[data-age-rating-containter-full]',\n};\n\nconst getAgeOverlayConfig = () => ageOverlayConfigs;\n\nconst cleanAgeOverlayConfig = () => {\n  ageOverlayConfigs = [];\n};\n\nconst isAutoRating = (rating) => rating.indexOf('A') !== -1;\n\nconst getRating = (rating) => {\n  if (isAutoRating(rating)) {\n    return AGE_RATINGS[rating.substring(1)];\n  }\n  return AGE_RATINGS[rating];\n};\n\nconst vjsAgeRatingOverlay = (player) => {\n  const { ageRating, ageRatingDescription } = getMetadatas(player);\n  const { timeStamp } = getParams(player);\n  const overlayAgeContent = {\n    full: '',\n    icon: '',\n  };\n\n  cleanAgeOverlayConfig();\n\n  if (ageRating !== '') {\n    const ageRatingToUse = getRating(ageRating);\n    const ageClassToUse = ageRatingToUse.className;\n\n    const prefix = isAutoRating(ageRating) ? 'auto' : '';\n    const ratingToUse = ageRatingToUse.text;\n\n    const defaultDescriptionText = `Este conteúdo possui ${prefix}classificação ${ratingToUse}`;\n\n    const ageDescriptionToUse = ageRatingDescription || defaultDescriptionText;\n\n    overlayAgeContent.full = `\n    <div class=\"vjs-age-overlay-wrap\" data-age-rating-containter-full>\n      <div class=\"vjs-age-icon vjs-age-icon--${ageClassToUse}\">\n        <p class=\"vjs-age-icon__text\">${ageRating}</p>\n      </div>\n      <div class=\"vjs-age-description vjs-age-description--${ageClassToUse}\">\n        <p class=\"vjs-age-description__text\">${ageDescriptionToUse}</p>\n      </div>\n    </div>\n    `;\n\n    overlayAgeContent.icon = `\n    <div class=\"vjs-age-overlay-wrap\" data-age-rating-containter-icon>\n      <div class=\"vjs-age-icon vjs-age-icon--${ageClassToUse} vjs-age-icon--hidden\" data-age-rating-icon>\n        <p class=\"vjs-age-icon__text\">${ageRating}</p>\n      </div>\n    </div>\n    `;\n\n    // ajusta com tempo vindo do parametro t para o fim o overlay full\n    const fixedTimeStampStart = timeStamp || 0;\n\n    ageOverlayConfigs.push(\n      {\n        content: overlayAgeContent.full,\n        start: 'loadstart',\n        end: OVERLAY_DURATION.seconds + fixedTimeStampStart,\n        align: 'top-right',\n      },\n      {\n        content: overlayAgeContent.icon,\n        start: 'pause',\n        end: 'playing',\n        align: 'top-right',\n      }\n    );\n\n    let timer = null;\n\n    const currentElement = player.children_[0].parentElement || player.el_;\n\n    player.on('playing', () => {\n      const $container = currentElement.querySelector(SELECTORS.ageRatingContainer);\n      const $singleIcon = currentElement.querySelector(SELECTORS.ageRatingIcon);\n\n      if (!$container.classList.contains(SELECTORS.overlayOpenClass)) {\n        $container.classList.add(SELECTORS.overlayOpenClass);\n      }\n\n      if ($singleIcon.classList.contains(SELECTORS.hiddenIconClass)) {\n        timer = setTimeout(() => {\n          $singleIcon.classList.remove(SELECTORS.hiddenIconClass);\n        }, OVERLAY_DURATION.miliseconds);\n      } else if (timer) {\n        clearTimeout(timer);\n      }\n    });\n  }\n};\n\nexport { vjsAgeRatingOverlay, getAgeOverlayConfig };\n","import { isInIframe, isEmbeded, verifyEndCasting, getRelatedVideos, changeCurrentUrl } from '../helpers/helpers';\nimport getMetadatas from '../utils/get-metadatas';\nimport getParams from '../utils/get-params';\n\nlet endVideo = false;\nlet endAd = false;\nlet endedAdOnce = false;\nlet shouldPlayNext = false;\n\nconst sendMessageToParentFrame = (msg) => {\n  const iframe = isInIframe();\n  if (!iframe) {\n    return false;\n  }\n\n  const embeded = isEmbeded();\n  if (embeded) {\n    window.parent.postMessage(msg, '*');\n  }\n  return true;\n};\n\nconst playlistSendMessage = (nextVideoSrc) => {\n  if (endVideo && endAd && shouldPlayNext && nextVideoSrc) {\n    if (isInIframe()) {\n      sendMessageToParentFrame({ type: 'MainMediaFinish', newSrc: nextVideoSrc });\n    } else {\n      changeCurrentUrl(nextVideoSrc);\n    }\n  }\n};\n\nconst vjsPlaylist = (player) => {\n  const { ads, endBehavior } = getParams(player);\n  const { disableAdv } = getMetadatas(player);\n  shouldPlayNext = endBehavior === 'next';\n\n  const relatedVideos = getRelatedVideos(player);\n  const originUrlParams = window.location.search;\n  const nextVideoSrc =\n    relatedVideos.length > 0 && relatedVideos[0].embedUrl ? `${relatedVideos[0].embedUrl}${originUrlParams}` : null;\n\n  endAd = !ads || disableAdv;\n\n  player.on('ready', () => {\n    player.on('adserror', () => {\n      if (!endAd && player.ima && player.ima.addContentAndAdsEndedListener) {\n        endAd = true;\n      }\n    });\n\n    player.on('tracking:end', () => {\n      endVideo = true;\n      const isAfterCast = verifyEndCasting(player);\n      if (!isAfterCast) {\n        playlistSendMessage(nextVideoSrc);\n      }\n    });\n\n    if (!endAd) {\n      if (player.ima && player.ima.addContentAndAdsEndedListener) {\n        player.ima.addContentAndAdsEndedListener(() => {\n          endAd = true;\n          if (!endedAdOnce) {\n            endedAdOnce = true;\n            playlistSendMessage(nextVideoSrc);\n          }\n        });\n      } else {\n        endAd = true;\n        playlistSendMessage(nextVideoSrc);\n      }\n    }\n  });\n};\n\nexport default vjsPlaylist;\n","const TAG_TYPE = {\n  script: 'script',\n  link: 'link',\n};\n\nconst loadScript = (src, type = TAG_TYPE.script, async = true) => {\n  const scriptTag = document.createElement(type);\n\n  switch (type) {\n    case TAG_TYPE.script:\n      scriptTag.src = src;\n      scriptTag.type = 'text/javascript';\n      scriptTag.async = async;\n      break;\n    case TAG_TYPE.link:\n      scriptTag.type = 'text/css';\n      scriptTag.rel = 'stylesheet';\n      scriptTag.href = src;\n      break;\n    default:\n      break;\n  }\n\n  if (scriptTag) document.head.appendChild(scriptTag);\n};\n\nexport { loadScript, TAG_TYPE };\n","import videojs from 'video.js';\nimport chromecast from '@silvermine/videojs-chromecast';\nimport { isMobile, showChromecastBtn } from '../helpers/helpers';\nimport { loadScript, TAG_TYPE } from '../helpers/script-loader';\n\nlet firstPlay = true;\n\nconst loadChromecast = () => {\n  const castSenderSrc = 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1';\n\n  return loadScript(castSenderSrc, TAG_TYPE.script);\n};\n\nconst vjsChromecast = (player) => {\n  loadChromecast();\n  chromecast(videojs, { preloadWebComponents: true });\n\n  const isHttpsProtocol = window.location.protocol === 'https:';\n\n  if (isHttpsProtocol) {\n    const desktopPosition = 18;\n    const mobilePosition = 17;\n    const buttonPosition = isMobile() ? mobilePosition : desktopPosition;\n\n    player.on('ready', () => {\n      player.chromecast({\n        buttonPositionIndex: buttonPosition,\n      });\n\n      if (firstPlay) {\n        showChromecastBtn(player, false);\n        firstPlay = false;\n      }\n    });\n  }\n};\n\nexport default vjsChromecast;\n","/*! @name videojs-overlay @version 3.1.0 @license Apache-2.0 */\nimport videojs from 'video.js';\nimport window from 'global/window';\n\nvar version = \"3.1.0\";\n\nconst defaults = {\n  align: 'top-left',\n  class: '',\n  content: 'This overlay will show up while the video is playing',\n  debug: false,\n  showBackground: true,\n  attachToControlBar: false,\n  overlays: [{\n    start: 'playing',\n    end: 'paused'\n  }]\n};\nconst Component = videojs.getComponent('Component');\nconst dom = videojs.dom || videojs;\nconst registerPlugin = videojs.registerPlugin || videojs.plugin;\n\n/**\n * Whether the value is a `Number`.\n *\n * Both `Infinity` and `-Infinity` are accepted, but `NaN` is not.\n *\n * @param  {Number} n\n * @return {Boolean}\n */\n\n/* eslint-disable no-self-compare */\nconst isNumber = n => typeof n === 'number' && n === n;\n/* eslint-enable no-self-compare */\n\n/**\n * Whether a value is a string with no whitespace.\n *\n * @param  {string} s\n * @return {boolean}\n */\nconst hasNoWhitespace = s => typeof s === 'string' && /^\\S+$/.test(s);\n\n/**\n * Overlay component.\n *\n * @class   Overlay\n * @extends {videojs.Component}\n */\nclass Overlay extends Component {\n  constructor(player, options) {\n    super(player, options);\n    ['start', 'end'].forEach(key => {\n      const value = this.options_[key];\n      if (isNumber(value)) {\n        this[key + 'Event_'] = 'timeupdate';\n      } else if (hasNoWhitespace(value)) {\n        this[key + 'Event_'] = value;\n\n        // An overlay MUST have a start option. Otherwise, it's pointless.\n      } else if (key === 'start') {\n        throw new Error('invalid \"start\" option; expected number or string');\n      }\n    });\n\n    // video.js does not like components with multiple instances binding\n    // events to the player because it tracks them at the player level,\n    // not at the level of the object doing the binding. This could also be\n    // solved with Function.prototype.bind (but not videojs.bind because of\n    // its GUID magic), but the anonymous function approach avoids any issues\n    // caused by crappy libraries clobbering Function.prototype.bind.\n    // - https://github.com/videojs/video.js/issues/3097\n    ['endListener_', 'rewindListener_', 'startListener_'].forEach(name => {\n      this[name] = e => Overlay.prototype[name].call(this, e);\n    });\n\n    // If the start event is a timeupdate, we need to watch for rewinds (i.e.,\n    // when the user seeks backward).\n    if (this.startEvent_ === 'timeupdate') {\n      this.on(player, 'timeupdate', this.rewindListener_);\n    }\n    this.debug(`created, listening to \"${this.startEvent_}\" for \"start\" and \"${this.endEvent_ || 'nothing'}\" for \"end\"`);\n    this.hide();\n  }\n  createEl() {\n    const options = this.options_;\n    const content = options.content;\n    const background = options.showBackground ? 'vjs-overlay-background' : 'vjs-overlay-no-background';\n    const el = dom.createEl('div', {\n      className: `\n        vjs-overlay\n        vjs-overlay-${options.align}\n        ${options.class}\n        ${background}\n        vjs-hidden\n      `\n    });\n    if (typeof content === 'string') {\n      el.innerHTML = content;\n    } else if (content instanceof window.DocumentFragment) {\n      el.appendChild(content);\n    } else {\n      dom.appendContent(el, content);\n    }\n    return el;\n  }\n\n  /**\n   * Logs debug errors\n   *\n   * @param  {...[type]} args [description]\n   * @return {[type]}         [description]\n   */\n  debug(...args) {\n    if (!this.options_.debug) {\n      return;\n    }\n    const log = videojs.log;\n    let fn = log;\n\n    // Support `videojs.log.foo` calls.\n    if (log.hasOwnProperty(args[0]) && typeof log[args[0]] === 'function') {\n      fn = log[args.shift()];\n    }\n    fn(...[`overlay#${this.id()}: `, ...args]);\n  }\n\n  /**\n   * Overrides the inherited method to perform some event binding\n   *\n   * @return {Overlay}\n   */\n  hide() {\n    super.hide();\n    this.debug('hidden');\n    this.debug(`bound \\`startListener_\\` to \"${this.startEvent_}\"`);\n\n    // Overlays without an \"end\" are valid.\n    if (this.endEvent_) {\n      this.debug(`unbound \\`endListener_\\` from \"${this.endEvent_}\"`);\n      this.off(this.player(), this.endEvent_, this.endListener_);\n    }\n    this.on(this.player(), this.startEvent_, this.startListener_);\n    return this;\n  }\n\n  /**\n   * Determine whether or not the overlay should hide.\n   *\n   * @param  {number} time\n   *         The current time reported by the player.\n   * @param  {string} type\n   *         An event type.\n   * @return {boolean}\n   */\n  shouldHide_(time, type) {\n    const end = this.options_.end;\n    return isNumber(end) ? time >= end : end === type;\n  }\n\n  /**\n   * Overrides the inherited method to perform some event binding\n   *\n   * @return {Overlay}\n   */\n  show() {\n    super.show();\n    this.off(this.player(), this.startEvent_, this.startListener_);\n    this.debug('shown');\n    this.debug(`unbound \\`startListener_\\` from \"${this.startEvent_}\"`);\n\n    // Overlays without an \"end\" are valid.\n    if (this.endEvent_) {\n      this.debug(`bound \\`endListener_\\` to \"${this.endEvent_}\"`);\n      this.on(this.player(), this.endEvent_, this.endListener_);\n    }\n    return this;\n  }\n\n  /**\n   * Determine whether or not the overlay should show.\n   *\n   * @param  {number} time\n   *         The current time reported by the player.\n   * @param  {string} type\n   *         An event type.\n   * @return {boolean}\n   */\n  shouldShow_(time, type) {\n    const start = this.options_.start;\n    const end = this.options_.end;\n    if (isNumber(start)) {\n      if (isNumber(end)) {\n        return time >= start && time < end;\n\n        // In this case, the start is a number and the end is a string. We need\n        // to check whether or not the overlay has shown since the last seek.\n      } else if (!this.hasShownSinceSeek_) {\n        this.hasShownSinceSeek_ = true;\n        return time >= start;\n      }\n\n      // In this case, the start is a number and the end is a string, but\n      // the overlay has shown since the last seek. This means that we need\n      // to be sure we aren't re-showing it at a later time than it is\n      // scheduled to appear.\n      return Math.floor(time) === start;\n    }\n    return start === type;\n  }\n\n  /**\n   * Event listener that can trigger the overlay to show.\n   *\n   * @param  {Event} e\n   */\n  startListener_(e) {\n    const time = this.player().currentTime();\n    if (this.shouldShow_(time, e.type)) {\n      this.show();\n    }\n  }\n\n  /**\n   * Event listener that can trigger the overlay to show.\n   *\n   * @param  {Event} e\n   */\n  endListener_(e) {\n    const time = this.player().currentTime();\n    if (this.shouldHide_(time, e.type)) {\n      this.hide();\n    }\n  }\n\n  /**\n   * Event listener that can looks for rewinds - that is, backward seeks\n   * and may hide the overlay as needed.\n   *\n   * @param  {Event} e\n   */\n  rewindListener_(e) {\n    const time = this.player().currentTime();\n    const previous = this.previousTime_;\n    const start = this.options_.start;\n    const end = this.options_.end;\n\n    // Did we seek backward?\n    if (time < previous) {\n      this.debug('rewind detected');\n\n      // The overlay remains visible if two conditions are met: the end value\n      // MUST be an integer and the the current time indicates that the\n      // overlay should NOT be visible.\n      if (isNumber(end) && !this.shouldShow_(time)) {\n        this.debug(`hiding; ${end} is an integer and overlay should not show at this time`);\n        this.hasShownSinceSeek_ = false;\n        this.hide();\n\n        // If the end value is an event name, we cannot reliably decide if the\n        // overlay should still be displayed based solely on time; so, we can\n        // only queue it up for showing if the seek took us to a point before\n        // the start time.\n      } else if (hasNoWhitespace(end) && time < start) {\n        this.debug(`hiding; show point (${start}) is before now (${time}) and end point (${end}) is an event`);\n        this.hasShownSinceSeek_ = false;\n        this.hide();\n      }\n    }\n    this.previousTime_ = time;\n  }\n}\nvideojs.registerComponent('Overlay', Overlay);\n\n/**\n * Initialize the plugin.\n *\n * @function plugin\n * @param    {Object} [options={}]\n */\nconst plugin = function (options) {\n  const player = this;\n  const settings = videojs.mergeOptions(defaults, options);\n\n  // De-initialize the plugin if it already has an array of overlays.\n  if (Array.isArray(this.overlays_)) {\n    this.overlays_.forEach(overlay => {\n      this.removeChild(overlay);\n      if (this.controlBar) {\n        this.controlBar.removeChild(overlay);\n      }\n      overlay.dispose();\n    });\n  }\n  const overlays = settings.overlays;\n\n  // We don't want to keep the original array of overlay options around\n  // because it doesn't make sense to pass it to each Overlay component.\n  delete settings.overlays;\n  const mapOverlays = items => {\n    return items.map(o => {\n      const mergeOptions = videojs.mergeOptions(settings, o);\n      const attachToControlBar = typeof mergeOptions.attachToControlBar === 'string' || mergeOptions.attachToControlBar === true;\n      if (!this.controls() || !this.controlBar) {\n        return this.addChild('overlay', mergeOptions);\n      }\n      if (attachToControlBar && mergeOptions.align.indexOf('bottom') !== -1) {\n        let referenceChild = this.controlBar.children()[0];\n        if (this.controlBar.getChild(mergeOptions.attachToControlBar) !== undefined) {\n          referenceChild = this.controlBar.getChild(mergeOptions.attachToControlBar);\n        }\n        if (referenceChild) {\n          const referenceChildIndex = this.controlBar.children().indexOf(referenceChild);\n          const controlBarChild = this.controlBar.addChild('overlay', mergeOptions, referenceChildIndex);\n          return controlBarChild;\n        }\n      }\n      const playerChild = this.addChild('overlay', mergeOptions);\n      this.el().insertBefore(playerChild.el(), this.controlBar.el());\n      return playerChild;\n    });\n  };\n  this.overlays_ = mapOverlays(overlays);\n\n  /**\n   * Adds one or more items to the existing list of overlays.\n   *\n   * @param {Object|Array} item\n   *        An item (or an array of items) to be added as overlay/s\n   *\n   * @return {Array[Overlay]}\n   *         The array of overlay objects that were added\n   */\n  function add(item) {\n    if (!Array.isArray(item)) {\n      item = [item];\n    }\n    const addedOverlays = mapOverlays(item);\n    player.overlays_ = player.overlays_.concat(addedOverlays);\n    return addedOverlays;\n  }\n\n  /**\n   *\n   * @param {Overlay} item\n   *        An item to be removed from the array of overlays\n   *\n   * @throws {Error}\n   *        Item to remove must be present in the array of overlays\n   *\n   */\n  function remove(item) {\n    const index = player.overlays_.indexOf(item);\n    if (index !== -1) {\n      item.el().parentNode.removeChild(item.el());\n      player.overlays_.splice(index, 1);\n    } else {\n      player.log.warn('overlay does not exist and cannot be removed');\n    }\n  }\n\n  /**\n   * Gets the array of overlays used for the current video\n   *\n   * @return The array of overlay objects currently used by the plugin\n   */\n  function get() {\n    return player.overlays_;\n  }\n  return {\n    add,\n    remove,\n    get\n  };\n};\nplugin.VERSION = version;\nregisterPlugin('overlay', plugin);\n\nexport { plugin as default };\n","import { hasAdBlock } from '../ads/adblock';\nimport { isArcEnviroment, isChromeAndroid, isLiveVideo, isSafariIos } from '../helpers/helpers';\nimport getParams from '../utils/get-params';\n\nconst forcePlayAfterAds = (player) => {\n  const isPaused = player.paused();\n\n  const adEndEvents = ['tracking:adEnd', 'tracking:adSkip'];\n  adEndEvents.forEach((event) => {\n    player.on(event, () => {\n      if (isPaused) {\n        player.play();\n      }\n    });\n  });\n};\n\nconst forcePlay = (player) => {\n  setTimeout(() => {\n    player.play();\n  }, 1000);\n\n  forcePlayAfterAds(player);\n};\n\nconst vjsAutoPlay = (player) => {\n  const { autoPlay } = getParams(player);\n\n  if (!hasAdBlock()) {\n    player.options({\n      autoplay: autoPlay,\n    });\n  }\n\n  if (!autoPlay) {\n    player.options({\n      muted: false,\n    });\n    player.volume(0.5);\n  } else {\n    player.on('ready', () => {\n      if (isChromeAndroid() || isSafariIos()) {\n        // force play due some mobile browser policies\n        forcePlay(player);\n      } else {\n        // force play due arc browser policies\n        const isPaused = player.paused();\n        if (isArcEnviroment() && isPaused) {\n          forcePlay(player);\n        }\n\n        player.on('loadedmetadata', () => {\n          if (isLiveVideo(player.duration())) {\n            // force play after ads\n            forcePlayAfterAds(player);\n          }\n        });\n      }\n    });\n  }\n};\n\nexport default vjsAutoPlay;\n","/**\n * Initializes all player's plugins.\n *\n * Example Usage:\n * initPlugins(player, params)\n *\n * @function initPlugins\n * @param    {Object} [player={}]\n *           An object of player instance.\n * @param    {Object} [params={}]\n *           An object of player's parameters.\n */\n\nimport vjsErrors from './vjs-errors';\nimport vjsQualitySelector from './vjs-quality-selector';\nimport vjsSpriteThumbnails from './vjs-sprite-thumbnails';\nimport vjsSeekButtons from './vjs-seek-buttons';\nimport vjsShare from './vjs-share';\nimport vjsLogo from './vjs-logo';\nimport { vjsSuggestedOverlay } from './vjs-suggested-overlay';\nimport vjsSuggestedNext from './vjs-suggested-next';\nimport { vjsTitleOverlay } from './vjs-title-overlay';\nimport { vjsAgeRatingOverlay } from './vjs-age-rating-overlay';\nimport vjsPlaylist from './vjs-playlist';\nimport vjsPauseOnTouch from './vjs-pause-on-touch';\nimport vjsErrorsTreat from './vjs-errors-treat';\nimport vjsLandscapeOnRotate from './vjs-landscape';\nimport vjsChromecast from './vjs-chromecast';\nimport vjsOverlayManager from './vjs-overlay-manager';\nimport vjsTimeStamp from './vjs-time-stamp';\nimport vjsAutoPlay from './vjs-auto-play';\nimport vjsLoop from './vjs-loop';\n\nconst initPlugins = (player, params) => {\n  const { ads, debug, debugHash, share } = params;\n\n  vjsChromecast(player);\n  vjsErrorsTreat(player);\n  vjsErrors(player);\n  vjsQualitySelector(player);\n  vjsSpriteThumbnails(player);\n  vjsSeekButtons(player);\n  vjsSuggestedOverlay(player);\n  vjsSuggestedNext(player);\n  vjsTitleOverlay(player);\n  vjsAgeRatingOverlay(player);\n  vjsPlaylist(player);\n  vjsLogo(player);\n  vjsPauseOnTouch(player);\n  vjsLandscapeOnRotate(player);\n  vjsOverlayManager(player);\n  vjsTimeStamp(player);\n  vjsAutoPlay(player);\n  vjsLoop(player);\n\n  if (share) vjsShare(player);\n\n  if (!ads) player.log('Não Exibir Publicidade');\n\n  if (debug && debugHash) {\n    player.log('Debug e DebugHash ativos, vamos depurar algo aqui', debug);\n    player.log.level('debug');\n    player.log.debug();\n  }\n};\n\nexport default initPlugins;\n","import { showErrorMsg, TYPE_OF_MSG } from '../helpers/messages';\n\nconst vjsErrorsTreat = (player) => {\n  player.on('error', () => {\n    const error = player.error();\n    if (error) {\n      window.console.log('[player]', 'error:', error);\n      showErrorMsg(player, TYPE_OF_MSG.ERROR);\n    }\n  });\n};\n\nexport default vjsErrorsTreat;\n","import 'videojs-contrib-quality-levels';\nimport 'videojs-hls-quality-selector';\n\nconst vjsQualitySelector = (player) => {\n  if (player.hlsQualitySelector) {\n    player.hlsQualitySelector({\n      displayCurrentQuality: false,\n      vjsIconClass: 'vjs-icon-cog',\n      placementIndex: 13,\n    });\n  }\n  player.on('ready', () => {\n    player.hlsQualitySelector.createQualityButton();\n    player.hlsQualitySelector.bindPlayerEvents();\n\n    setTimeout(() => {\n      const qualityLevels = document.querySelectorAll(\n        '.vjs-quality-selector .vjs-menu .vjs-menu-content .vjs-menu-item'\n      );\n      for (let i = 0; i < qualityLevels.length; i += 1) {\n        const qualityItem = qualityLevels[i];\n        if (qualityItem.textContent !== 'undefinedp') {\n          qualityItem.classList.add('vjs-valid-quality');\n        }\n      }\n    }, 1000);\n  });\n};\n\nexport default vjsQualitySelector;\n","import 'videojs-sprite-thumbnails';\n\nconst vjsSpriteThumbnails = (player) => {\n  if (player.spriteThumbnails) {\n    const spriteUrl = player.tagAttributes['data-sprite-url'] || player.tagAttributes.sprite_url;\n\n    player.spriteThumbnails({\n      interval: 1.45,\n      url: spriteUrl,\n      width: 112,\n      height: 63,\n    });\n  }\n};\n\nexport default vjsSpriteThumbnails;\n","import 'videojs-seek-buttons';\n\nconst vjsSeekButtons = (player) => {\n  if (player.seekButtons) {\n    player.seekButtons({\n      forward: 10,\n      back: 10,\n      forwardIndex: 2,\n      backIndex: 2,\n    });\n  }\n};\n\nexport default vjsSeekButtons;\n","import 'videojs-logo';\nimport getParams from '../utils/get-params';\n\nconst vjsLogo = (player) => {\n  const { logo, logoRecord } = getParams(player);\n  const urlToUse = logoRecord ? 'https://sc.r7.com/videojs/logo-record.svg' : 'https://sc.r7.com/videojs/logo-r7.svg';\n\n  if (logo) {\n    player.logo({\n      image: urlToUse,\n      width: '30',\n      height: '26',\n      position: 'top-left',\n      offsetH: 15,\n      offsetV: 15,\n      fadeDelay: null,\n      opacity: '.8',\n    });\n\n    player.on('pause', () => {\n      player.logo().show();\n    });\n\n    player.on('play', () => {\n      player.logo().hide();\n    });\n  }\n};\n\nexport default vjsLogo;\n","const vjsPauseOnTouch = (player) => {\n  player.on('touchend', (e) => {\n    e.preventDefault();\n\n    if (e.target.nodeName === 'VIDEO') {\n      if (player.paused()) {\n        player.play();\n      } else {\n        player.pause();\n      }\n    }\n  });\n};\n\nexport default vjsPauseOnTouch;\n","import 'videojs-landscape-fullscreen';\nimport { isInIframe } from '../helpers/helpers';\n\nconst vjsLandscapeOnRotate = (player) => {\n  const options = {\n    fullscreen: {\n      enterOnRotate: true,\n      alwaysInLandscapeMode: true,\n      iOS: true,\n    },\n  };\n  // Condição para corrigir e deixar nativo o fullscreen para devices ios (PER-3654)\n  const isIframe = isInIframe();\n  if (isIframe) {\n    options.fullscreen.iOS = false;\n  }\n  player.landscapeFullscreen(options);\n};\n\nexport default vjsLandscapeOnRotate;\n","import 'videojs-overlay';\nimport { getAgeOverlayConfig } from './vjs-age-rating-overlay';\nimport { getSuggestedOverlayConfig } from './vjs-suggested-overlay';\nimport { getTitleOverlayConfig } from './vjs-title-overlay';\n\nconst vjsOverlayManager = (player) => {\n  const allOverlays = [...getTitleOverlayConfig(), ...getAgeOverlayConfig(), ...getSuggestedOverlayConfig()];\n\n  player.overlay({\n    overlays: allOverlays,\n  });\n};\n\nexport default vjsOverlayManager;\n","import getParams from '../utils/get-params';\n\nconst vjsTimeStamp = (player) => {\n  const { timeStamp } = getParams(player);\n\n  if (timeStamp) {\n    player.on('loadstart', () => {\n      player.currentTime(timeStamp);\n    });\n\n    player.on('ready', () => {\n      player.on('loadedmetadata', () => {\n        player.muted(true);\n        player.play();\n      });\n    });\n  }\n};\n\nexport default vjsTimeStamp;\n","import getParams from '../utils/get-params';\n\nconst vjsLoop = (player) => {\n  const { endBehavior } = getParams(player);\n  const shouldLoop = endBehavior === 'loop';\n\n  player.loop(shouldLoop);\n};\n\nexport default vjsLoop;\n","/**\n * Event Tracking for VideoJS\n *\n * Based on: https://github.com/spodlecki/videojs-event-tracking.\n *\n * @function eventTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport startTracking from './start';\nimport shareTracking from './share';\nimport skipTracking from './skip';\nimport qualityChangeTracking from './quality';\nimport fullscreenTracking from './fullscreen';\nimport pictureInPictureTracking from './picture-in-picture';\nimport errorTracking from './error';\nimport endTracking from './end';\nimport adsEventsTracking from './adsevents';\nimport suggestedTracking from './suggested';\nimport nextTracking from './next';\nimport replayTracking from './replay';\nimport volumeTracking from './volume';\n\nconst eventTracking = (player) => {\n  startTracking(player);\n  shareTracking(player);\n  skipTracking(player);\n  qualityChangeTracking(player);\n  fullscreenTracking(player);\n  pictureInPictureTracking(player);\n  errorTracking(player);\n  endTracking(player);\n  adsEventsTracking(player);\n  suggestedTracking(player);\n  nextTracking(player);\n  replayTracking(player);\n  volumeTracking(player);\n};\n\nexport default eventTracking;\n","/**\n * Track Initial Play Event => start\n * Track Play Events => play\n *\n * Example Usage:\n * player.on('tracking:start', (e, data) => console.log(data))\n * player.on('tracking:play', (e, data) => console.log(data))\n *\n * @function startTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { showChromecastBtn } from '../../helpers/helpers';\n\nconst startTracking = (player) => {\n  let firstplay = false;\n\n  const onPlaying = () => {\n    if (!firstplay) {\n      firstplay = true;\n      player.trigger('tracking:start');\n      player.trigger('tracking:main_media_started');\n\n      showChromecastBtn(player, true);\n    }\n  };\n\n  player.on('playing', onPlaying);\n};\n\nexport default startTracking;\n","import { getEventByContext } from '../../helpers/helpers';\n\nconst shareButtons = (player) => {\n  const eventToUse = getEventByContext();\n\n  player.controlBar.childNameIndex_.shareButton.on(eventToUse, () => {\n    const currentElement = player.children_[0].parentElement || player.el_;\n\n    const socialBtns = currentElement.querySelectorAll('.vjs-share__social');\n    const linkWrapper = currentElement.querySelector('.vjs-share__middle');\n\n    linkWrapper.addEventListener(eventToUse, (event) => {\n      if (event.target.classList.contains('vjs-share__btn')) {\n        player.trigger('tracking:share', { sharedMedia: 'link-incorporado' });\n      }\n    });\n\n    Array.from(socialBtns).forEach((btn) => {\n      const socialBtn = btn;\n\n      socialBtn.addEventListener(eventToUse, (e) => {\n        const social = e.currentTarget.getAttribute('data-social');\n        const socialMedias = {\n          tw: 'twitter',\n          fbFeed: 'facebook',\n          whatsapp: 'whatsapp',\n        };\n        player.trigger('tracking:share', { sharedMedia: socialMedias[social] });\n      });\n    });\n  });\n};\n\n/**\n * Tracks when users share the video.\n *\n * Example Usage:\n * player.on('tracking:share', (e, data) => console.log(data))\n *\n * Data Attributes:\n * => sharedMedia:       share selected name\n *\n * @function shareTracking\n * @param    {Object} [player={}]\n *            An object of player instance.\n */\n\nconst shareTracking = (player) => {\n  player.on('ready', () => {\n    const interval = setInterval(() => {\n      if (player.controlBar.childNameIndex_.shareButton) {\n        clearInterval(interval);\n        shareButtons(player);\n      }\n    }, 0);\n  });\n};\n\nexport default shareTracking;\n","/**\n * Tracks when users Skip the video.\n *\n * Example Usage:\n * player.on('tracking:Skip', (e, data) => console.log(data))\n *\n * Data Attributes:\n * => SkipSet:       Skip selected name\n *\n * @function skipTracking\n * @param    {Object} [player={}]\n *             An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\n\nconst skipTracking = (player) => {\n  player.on('ready', () => {\n    const eventToUse = getEventByContext();\n\n    player.controlBar.seekBack.on(eventToUse, () => {\n      player.trigger('tracking:skipBack');\n    });\n\n    player.controlBar.seekForward.on(eventToUse, () => {\n      player.trigger('tracking:skipForward');\n    });\n  });\n};\n\nexport default skipTracking;\n","/**\n * Tracks when users quality the video.\n *\n * Example Usage:\n * player.on('tracking:quality', (e, data) => console.log(data))\n *\n * Data Attributes:\n * => qualitySet:       Quality selected name\n *\n * @function qualityChangeTracking\n * @param    {Object} [player={}]\n *            An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\n\nconst qualityChangeTracking = (player) => {\n  player.on('ready', () => {\n    const hasQualityButton = !!player.hlsQualitySelector._qualityButton;\n    const eventToUse = getEventByContext();\n\n    if (hasQualityButton) {\n      const timer = setInterval(() => {\n        const qualityButtons = player.hlsQualitySelector._qualityButton.items;\n\n        if (qualityButtons.length > 0) {\n          qualityButtons.map((button) =>\n            button.on(eventToUse, () => {\n              player.trigger('tracking:quality', { qualitySet: button.item.label });\n            })\n          );\n          clearInterval(timer);\n        }\n      }, 500);\n    }\n  });\n};\n\nexport default qualityChangeTracking;\n","/**\n * Tracks when fullscreen video changes.\n *\n * Example Usage:\n * player.on('tracking:fullscreen', (e, data) => console.log(data))\n *\n * @function fullscreenTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nconst fullscreenTracking = (player) => {\n  player.on('fullscreenchange', () => {\n    player.trigger('tracking:fullScreen');\n  });\n};\n\nexport default fullscreenTracking;\n","/**\n * Tracks when user clicks in picture-in-picture button.\n *\n * Example Usage:\n * player.on('tracking:background', (e, data) => console.log(data))\n *\n * @function pictureInPictureTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nconst pictureInPictureTracking = (player) => {\n  player.on('enterpictureinpicture', () => {\n    player.trigger('tracking:background');\n  });\n\n  player.on('leavepictureinpicture', () => {\n    player.trigger('tracking:background');\n  });\n};\n\nexport default pictureInPictureTracking;\n","/**\n * Tracks video errors.\n *\n * Is based in code MediaError, these references may be useful for you:\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/MediaError/code\n * https://github.com/brightcove/videojs-errors\n *\n * Example Usage:\n * player.on('tracking:error', (e, data) => console.log(data))\n * player.on('tracking:blockedContentPage', (e, data) => console.log(data))\n * player.on('tracking:blockedContentRegion', (e, data) => console.log(data))\n * player.on('tracking:outDatedBrowser', (e, data) => console.log(data))\n *\n * @function errorTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { isSuportedBrowser } from '../../helpers/helpers';\n\nconst errorTracking = (player) => {\n  player.on('ready', () => {\n    try {\n      const isSupported = isSuportedBrowser();\n      if (!isSupported) {\n        player.trigger('tracking:outDatedBrowser');\n      }\n    } catch (unused) {\n      /* exception unused */\n    }\n  });\n  player.on('error', () => {\n    const codeError = player.error().code;\n\n    switch (codeError) {\n      case 1:\n        player.trigger('tracking:blockedContentPage');\n        break;\n      case 2:\n        player.trigger('tracking:error');\n        break;\n      case 3:\n        player.trigger('tracking:outDatedBrowser');\n        break;\n      case 4:\n        player.trigger('tracking:outDatedBrowser');\n        break;\n      case 'PLAYER_ERR_GEO_RESTRICTED':\n        player.trigger('tracking:blockedContentRegion');\n        break;\n      default:\n        player.trigger('tracking:error');\n    }\n  });\n};\n\nexport default errorTracking;\n","/**\n * Tracks when video ends.\n *\n * Example Usage:\n * player.on('tracking:end', (e, data) => console.log(data))\n *\n * @function endTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nconst endTracking = (player) => {\n  player.one('ended', () => {\n    player.trigger('tracking:end');\n  });\n};\n\nexport default endTracking;\n","/**\n * Tracks the ads plays, ands and are skipped.\n *\n * Example Usage:\n * player.on('tracking:adStart', (e, data) => console.log(data))\n * player.on('tracking:adEnd', (e, data) => console.log(data))\n * player.on('tracking:adSkip', (e, data) => console.log(data))\n *\n * @function adsEventsTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { getAdPlacement } from '../../helpers/helpers';\n\nconst adsEventsTracking = (player) => {\n  player.on('ads-manager', (response) => {\n    const { adsManager } = response;\n    const adsTrackEvents = [\n      {\n        name: 'adStart',\n        event: window.google.ima.AdEvent.Type.STARTED,\n      },\n      {\n        name: 'adEnd',\n        event: window.google.ima.AdEvent.Type.COMPLETE,\n      },\n      {\n        name: 'adSkip',\n        event: window.google.ima.AdEvent.Type.SKIPPED,\n      },\n    ];\n\n    const getPlacement = () => {\n      const placementValues = {\n        'pre-roll': 'pre-video',\n        'mid-roll': 'durante-video',\n        'post-roll': 'pos-video',\n      };\n      const adPlacementType = getAdPlacement(player);\n      return adPlacementType ? placementValues[adPlacementType] : placementValues['pre-roll'];\n    };\n\n    const trackAdsEvent = (evt, evtName) => {\n      const ad = evt.getAd();\n      const adsData = {\n        adTitle: ad.getTitle(),\n        adPlacement: getPlacement(),\n      };\n      player.trigger(`tracking:${evtName}`, adsData);\n    };\n\n    adsTrackEvents.forEach((obj) => {\n      adsManager.addEventListener(obj.event, (evt) => {\n        trackAdsEvent(evt, obj.name);\n      });\n    });\n  });\n};\n\nexport default adsEventsTracking;\n","/**\n * Tracks when users clicks on the suggested the video.\n *\n * Example Usage:\n * player.on('tracking:suggestedVideo', (e, data) => console.log(data))\n *\n *\n * @function suggestedTracking\n * @param    {Object} [player={}]\n *             An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\nimport getParams from '../get-params';\n\nconst suggestedTracking = (player) => {\n  const { timerRelated } = getParams(player);\n  if (timerRelated) {\n    const eventToUse = getEventByContext();\n\n    document.addEventListener(eventToUse, (event) => {\n      if (event.target.dataset.suggested !== undefined) {\n        player.trigger('tracking:suggestedVideo');\n      }\n    });\n  }\n};\n\nexport default suggestedTracking;\n","/**\n * Tracks when users clicks on the next video.\n *\n * Example Usage:\n * player.on('tracking:nextVideo', (e, data) => console.log(data))\n *\n *\n * @function nextTracking\n * @param    {Object} [player={}]\n *             An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\nimport getParams from '../get-params';\n\nconst nextTracking = (player) => {\n  const { timerRelated } = getParams(player);\n  if (timerRelated) {\n    const eventToUse = getEventByContext();\n\n    document.addEventListener(eventToUse, (event) => {\n      if (event.target.dataset.next !== undefined) {\n        player.trigger('tracking:nextVideo');\n      }\n    });\n  }\n};\n\nexport default nextTracking;\n","/**\n * Tracks when users clicks on the replay after video is played.\n *\n * Example Usage:\n * player.on('tracking:replay', (e, data) => console.log(data))\n *\n * @function replayTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\n\nconst replayTracking = (player) => {\n  player.on('ready', () => {\n    const currentElement = player.children_[0].parentElement || player.el_;\n    const playButton = currentElement.querySelector('.vjs-play-control');\n    const eventToUse = getEventByContext();\n\n    playButton.addEventListener(eventToUse, () => {\n      if (playButton.title.toLowerCase() === 'replay') {\n        player.trigger('tracking:replay');\n      }\n    });\n  });\n};\n\nexport default replayTracking;\n","/**\n * Tracks when volume in video changes.\n *\n * Example Usage:\n * player.on('tracking:mute', (e, data) => console.log(data))\n *\n * @function volumeTracking\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { getEventByContext } from '../../helpers/helpers';\n\nconst volumeTracking = (player) => {\n  player.on('ready', () => {\n    const currentElement = player.children_[0].parentElement || player.el_;\n\n    const volumeButton = currentElement.querySelector('.vjs-mute-control');\n    const eventToUse = getEventByContext();\n\n    volumeButton.addEventListener(eventToUse, () => {\n      const isMuted = player.muted();\n\n      if (isMuted) {\n        player.trigger('tracking:mute');\n      } else {\n        player.trigger('tracking:unmute');\n      }\n    });\n  });\n};\n\nexport default volumeTracking;\n","/**\n * Tracks and sends events to Google Analytics\n * using GTM r7dataLayer\n *\n * Example Usage:\n * googleAnalytics(player, metadatas)\n *\n *\n * @function googleAnalytics\n * @param    {Object} [player={}]\n *           An object of player instance.\n * @param    {Object} [metadatas={}]\n *           An object of video metadatas.\n */\n\nimport { formatDurationFromMetadata, isArcEnviroment, isLiveVideo } from '../helpers/helpers';\nimport getParams from '../utils/get-params';\n\nconst googleAnalytics = (player, metadatas) => {\n  let lastPlaytime = 0;\n  let watchedDuration = 0;\n  const timestamps = [];\n\n  player.on('ready', () => {\n    const { title, mainSection, subSection, createdDate, createdHour, ageRating, duration } = metadatas;\n    const params = getParams(player);\n    const { contextModal, parentUrl } = params;\n\n    const getDaysPublication = (date) => {\n      const publicationDate = date;\n      const today = new Date();\n      const formatCreatedDate = new Date(publicationDate.split('/').reverse().join('/'));\n      return Math.floor((today - formatCreatedDate) / (1000 * 3600 * 24));\n    };\n\n    const video = {\n      title,\n      type: 'video',\n      origin: 'R7',\n      editoria: mainSection,\n      subeditoria: subSection || undefined,\n      product: undefined,\n      genre: undefined,\n      author: undefined,\n      audienceRating: undefined,\n      date: createdDate,\n      hour: createdHour,\n      daysPublication: getDaysPublication(createdDate),\n      playtime: undefined,\n      qualitySet: 'Automática',\n      duration: formatDurationFromMetadata(duration),\n      subtitleOption: 'desativada',\n      classificacao_indicativa: ageRating,\n      url_parent: contextModal ? parentUrl : undefined,\n    };\n\n    player.on('loadedmetadata', () => {\n      const qualityLevels = player.qualityLevels();\n      const hasHeight =\n        qualityLevels[qualityLevels.selectedIndex] !== undefined &&\n        qualityLevels[qualityLevels.selectedIndex].height !== undefined;\n\n      if (hasHeight) {\n        video.qualitySet = `${qualityLevels[qualityLevels.selectedIndex].height}p`;\n      }\n\n      if (isLiveVideo(player.duration())) {\n        video.type = 'video-live';\n        video.duration = undefined;\n      }\n    });\n\n    player.on('timeupdate', () => {\n      const curTime = +player.currentTime().toFixed(0);\n\n      if (timestamps.indexOf(curTime) < 0) {\n        timestamps.push(curTime);\n      }\n      watchedDuration = timestamps.length;\n    });\n\n    const trackPlaytime = () => {\n      const newPlaytime = watchedDuration - lastPlaytime;\n      video.playtime = newPlaytime;\n      lastPlaytime = watchedDuration;\n    };\n\n    const track = (evt, label) => {\n      trackPlaytime();\n\n      try {\n        const currentEvent = {\n          event: `player.${evt}`,\n          video: { ...video, ...label },\n        };\n\n        if (isArcEnviroment() && window.dataLayer) {\n          window.dataLayer.push(currentEvent);\n        } else if (window.r7dataLayer) {\n          window.r7dataLayer.push(currentEvent);\n        }\n      } catch (unused) {\n        /* exception unused */\n      }\n    };\n\n    const eventsTracking = [\n      'background',\n      'blockedContentPage',\n      'blockedContentRegion',\n      'outDatedBrowser',\n      'end',\n      'error',\n      'fullScreen',\n      'quality',\n      'share',\n      'skipBack',\n      'skipForward',\n      'start',\n      'adStart',\n      'adEnd',\n      'adSkip',\n      'adBlocked',\n      'suggestedVideo',\n      'nextVideo',\n      'replay',\n      'mute',\n      'unmute',\n      'open',\n    ];\n\n    eventsTracking.map((event) =>\n      player.on(`tracking:${event}`, (e, data) => {\n        track(event, data);\n      })\n    );\n  });\n};\n\nexport default googleAnalytics;\n","/*! @name videojs-contrib-ads @version 6.9.0 @license Apache-2.0 */\nimport videojs from 'video.js';\nimport window from 'global/window';\nimport document from 'global/document';\n\nvar version = \"6.9.0\";\n\n/*\n * Implements the public API available in `player.ads` as well as application state.\n */\nfunction getAds(player) {\n  return {\n    disableNextSnapshotRestore: false,\n    // This is true if we have finished actual content playback but haven't\n    // dealt with postrolls and officially ended yet\n    _contentEnding: false,\n    // This is set to true if the content has officially ended at least once.\n    // After that, the user can seek backwards and replay content, but _contentHasEnded\n    // remains true.\n    _contentHasEnded: false,\n    // Tracks if loadstart has happened yet for the initial source. It is not reset\n    // on source changes because loadstart is the event that signals to the ad plugin\n    // that the source has changed. Therefore, no special signaling is needed to know\n    // that there has been one for subsequent sources.\n    _hasThereBeenALoadStartDuringPlayerLife: false,\n    // Tracks if loadeddata has happened yet for the current source.\n    _hasThereBeenALoadedData: false,\n    // Tracks if loadedmetadata has happened yet for the current source.\n    _hasThereBeenALoadedMetaData: false,\n    // Are we after startLinearAdMode and before endLinearAdMode?\n    _inLinearAdMode: false,\n    // Should we block calls to play on the content player?\n    _shouldBlockPlay: false,\n    // Was play blocked by the plugin's playMiddleware feature?\n    _playBlocked: false,\n    // Tracks whether play has been requested for this source,\n    // either by the play method or user interaction\n    _playRequested: false,\n    // This is an estimation of the current ad type being played\n    // This is experimental currently. Do not rely on its presence or behavior!\n    adType: null,\n    VERSION: version,\n    reset: function reset() {\n      player.ads.disableNextSnapshotRestore = false;\n      player.ads._contentEnding = false;\n      player.ads._contentHasEnded = false;\n      player.ads.snapshot = null;\n      player.ads.adType = null;\n      player.ads._hasThereBeenALoadedData = false;\n      player.ads._hasThereBeenALoadedMetaData = false;\n      player.ads._cancelledPlay = false;\n      player.ads._shouldBlockPlay = false;\n      player.ads._playBlocked = false;\n      player.ads.nopreroll_ = false;\n      player.ads.nopostroll_ = false;\n      player.ads._playRequested = false;\n    },\n    // Call this when an ad response has been received and there are\n    // linear ads ready to be played.\n    startLinearAdMode: function startLinearAdMode() {\n      player.ads._state.startLinearAdMode();\n    },\n    // Call this when a linear ad pod has finished playing.\n    endLinearAdMode: function endLinearAdMode() {\n      player.ads._state.endLinearAdMode();\n    },\n    // Call this when an ad response has been received but there are no\n    // linear ads to be played (i.e. no ads available, or overlays).\n    // This has no effect if we are already in an ad break.  Always\n    // use endLinearAdMode() to exit from linear ad-playback state.\n    skipLinearAdMode: function skipLinearAdMode() {\n      player.ads._state.skipLinearAdMode();\n    },\n    // With no arguments, returns a boolean value indicating whether or not\n    // contrib-ads is set to treat ads as stitched with content in a single\n    // stream. With arguments, treated as a setter, but this behavior is\n    // deprecated.\n    stitchedAds: function stitchedAds(arg) {\n      if (arg !== undefined) {\n        videojs.log.warn('Using player.ads.stitchedAds() as a setter is deprecated, ' + 'it should be set as an option upon initialization of contrib-ads.'); // Keep the private property and the settings in sync. When this\n        // setter is removed, we can probably stop using the private property.\n\n        this.settings.stitchedAds = !!arg;\n      }\n\n      return this.settings.stitchedAds;\n    },\n    // Returns whether the video element has been modified since the\n    // snapshot was taken.\n    // We test both src and currentSrc because changing the src attribute to a URL that\n    // AdBlocker is intercepting doesn't update currentSrc.\n    videoElementRecycled: function videoElementRecycled() {\n      if (player.ads.shouldPlayContentBehindAd(player)) {\n        return false;\n      }\n\n      if (!this.snapshot) {\n        throw new Error('You cannot use videoElementRecycled while there is no snapshot.');\n      }\n\n      var srcChanged = player.tech_.src() !== this.snapshot.src;\n      var currentSrcChanged = player.currentSrc() !== this.snapshot.currentSrc;\n      return srcChanged || currentSrcChanged;\n    },\n    // Returns a boolean indicating if given player is in live mode.\n    // One reason for this: https://github.com/videojs/video.js/issues/3262\n    // Also, some live content can have a duration.\n    isLive: function isLive(somePlayer) {\n      if (somePlayer === void 0) {\n        somePlayer = player;\n      }\n\n      if (typeof somePlayer.ads.settings.contentIsLive === 'boolean') {\n        return somePlayer.ads.settings.contentIsLive;\n      } else if (somePlayer.duration() === Infinity) {\n        return true;\n      } else if (videojs.browser.IOS_VERSION === '8' && somePlayer.duration() === 0) {\n        return true;\n      }\n\n      return false;\n    },\n    // Return true if content playback should mute and continue during ad breaks.\n    // This is only done during live streams on platforms where it's supported.\n    // This improves speed and accuracy when returning from an ad break.\n    shouldPlayContentBehindAd: function shouldPlayContentBehindAd(somePlayer) {\n      if (somePlayer === void 0) {\n        somePlayer = player;\n      }\n\n      if (!somePlayer) {\n        throw new Error('shouldPlayContentBehindAd requires a player as a param');\n      } else if (!somePlayer.ads.settings.liveCuePoints) {\n        return false;\n      } else {\n        return !videojs.browser.IS_IOS && !videojs.browser.IS_ANDROID && somePlayer.duration() === Infinity;\n      }\n    },\n    // Return true if the ads plugin should save and restore snapshots of the\n    // player state when moving into and out of ad mode.\n    shouldTakeSnapshots: function shouldTakeSnapshots(somePlayer) {\n      if (somePlayer === void 0) {\n        somePlayer = player;\n      }\n\n      return !this.shouldPlayContentBehindAd(somePlayer) && !this.stitchedAds();\n    },\n    // Returns true if player is in ad mode.\n    //\n    // Ad mode definition:\n    // If content playback is blocked by the ad plugin.\n    //\n    // Examples of ad mode:\n    //\n    // * Waiting to find out if an ad is going to play while content would normally be\n    //   playing.\n    // * Waiting for an ad to start playing while content would normally be playing.\n    // * An ad is playing (even if content is also playing)\n    // * An ad has completed and content is about to resume, but content has not resumed\n    //   yet.\n    //\n    // Examples of not ad mode:\n    //\n    // * Content playback has not been requested\n    // * Content playback is paused\n    // * An asynchronous ad request is ongoing while content is playing\n    // * A non-linear ad is active\n    isInAdMode: function isInAdMode() {\n      return this._state.isAdState();\n    },\n    // Returns true if in ad mode but an ad break hasn't started yet.\n    isWaitingForAdBreak: function isWaitingForAdBreak() {\n      return this._state.isWaitingForAdBreak();\n    },\n    // Returns true if content is resuming after an ad. This is part of ad mode.\n    isContentResuming: function isContentResuming() {\n      return this._state.isContentResuming();\n    },\n    // Deprecated because the name was misleading. Use inAdBreak instead.\n    isAdPlaying: function isAdPlaying() {\n      return this._state.inAdBreak();\n    },\n    // Returns true if an ad break is ongoing. This is part of ad mode.\n    // An ad break is the time between startLinearAdMode and endLinearAdMode.\n    inAdBreak: function inAdBreak() {\n      return this._state.inAdBreak();\n    },\n\n    /*\n     * Remove the poster attribute from the video element tech, if present. When\n     * reusing a video element for multiple videos, the poster image will briefly\n     * reappear while the new source loads. Removing the attribute ahead of time\n     * prevents the poster from showing up between videos.\n     *\n     * @param {Object} player The videojs player object\n     */\n    removeNativePoster: function removeNativePoster() {\n      var tech = player.$('.vjs-tech');\n\n      if (tech) {\n        tech.removeAttribute('poster');\n      }\n    },\n    debug: function debug() {\n      if (this.settings.debug) {\n        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n          args[_key] = arguments[_key];\n        }\n\n        if (args.length === 1 && typeof args[0] === 'string') {\n          videojs.log('ADS: ' + args[0]);\n        } else {\n          videojs.log.apply(videojs, ['ADS:'].concat(args));\n        }\n      }\n    }\n  };\n}\n\n/*\nThe goal of this feature is to make player events work as an integrator would\nexpect despite the presense of ads. For example, an integrator would expect\nan `ended` event to happen once the content is ended. If an `ended` event is sent\nas a result of a preroll ending, that is a bug. The `redispatch` method should recognize\nsuch `ended` events and prefix them so they are sent as `adended`, and so on with\nall other player events.\n*/\n// Cancel an event.\n// Video.js wraps native events. This technique stops propagation for the Video.js event\n// (AKA player event or wrapper event) while native events continue propagating.\nvar cancelEvent = function cancelEvent(player, event) {\n  event.isImmediatePropagationStopped = function () {\n    return true;\n  };\n\n  event.cancelBubble = true;\n\n  event.isPropagationStopped = function () {\n    return true;\n  };\n}; // Redispatch an event with a prefix.\n// Cancels the event, then sends a new event with the type of the original\n// event with the given prefix added.\n// The inclusion of the \"state\" property should be removed in a future\n// major version update with instructions to migrate any code that relies on it.\n// It is an implementation detail and relying on it creates fragility.\n\n\nvar prefixEvent = function prefixEvent(player, prefix, event) {\n  cancelEvent(player, event);\n  player.trigger({\n    type: prefix + event.type,\n    originalEvent: event\n  });\n}; // Playing event\n// Requirements:\n// * Normal playing event when there is no preroll\n// * No playing event before preroll\n// * At least one playing event after preroll\n\n\nvar handlePlaying = function handlePlaying(player, event) {\n  if (player.ads.isInAdMode()) {\n    if (player.ads.isContentResuming()) {\n      // Prefix playing event when switching back to content after postroll.\n      if (player.ads._contentEnding) {\n        prefixEvent(player, 'content', event);\n      } // Prefix all other playing events during ads.\n\n    } else {\n      prefixEvent(player, 'ad', event);\n    }\n  }\n}; // Ended event\n// Requirements:\n// * A single ended event when there is no postroll\n// * No ended event before postroll\n// * A single ended event after postroll\n\n\nvar handleEnded = function handleEnded(player, event) {\n  if (player.ads.isInAdMode()) {\n    // Cancel ended events during content resuming. Normally we would\n    // prefix them, but `contentended` has a special meaning. In the\n    // future we'd like to rename the existing `contentended` to\n    // `readyforpostroll`, then we could remove the special `resumeended`\n    // and do a conventional content prefix here.\n    if (player.ads.isContentResuming()) {\n      cancelEvent(player, event); // Important: do not use this event outside of videojs-contrib-ads.\n      // It will be removed and your code will break.\n      // Ideally this would simply be `contentended`, but until\n      // `contentended` no longer has a special meaning it cannot be\n      // changed.\n\n      player.trigger('resumeended'); // Ad prefix in ad mode\n    } else {\n      prefixEvent(player, 'ad', event);\n    } // Prefix ended due to content ending before postroll check\n\n  } else if (!player.ads._contentHasEnded && !player.ads.stitchedAds()) {\n    // This will change to cancelEvent after the contentended deprecation\n    // period (contrib-ads 7)\n    prefixEvent(player, 'content', event); // Content ended for the first time, time to check for postrolls\n\n    player.trigger('readyforpostroll');\n  }\n}; // handleLoadEvent is used for loadstart, loadeddata, and loadedmetadata\n// Requirements:\n// * Initial event is not prefixed\n// * Event due to ad loading is prefixed\n// * Event due to content source change is not prefixed\n// * Event due to content resuming is prefixed\n\n\nvar handleLoadEvent = function handleLoadEvent(player, event) {\n  // Initial event\n  if (event.type === 'loadstart' && !player.ads._hasThereBeenALoadStartDuringPlayerLife || event.type === 'loadeddata' && !player.ads._hasThereBeenALoadedData || event.type === 'loadedmetadata' && !player.ads._hasThereBeenALoadedMetaData) {\n    return; // Ad playing\n  } else if (player.ads.inAdBreak()) {\n    prefixEvent(player, 'ad', event); // Source change\n  } else if (player.currentSrc() !== player.ads.contentSrc) {\n    return; // Content resuming\n  } else {\n    prefixEvent(player, 'content', event);\n  }\n}; // Play event\n// Requirements:\n// * Play events have the \"ad\" prefix when an ad is playing\n// * Play events have the \"content\" prefix when content is resuming\n// Play requests are unique because they represent user intention to play. They happen\n// because the user clicked play, or someone called player.play(), etc. It could happen\n// multiple times during ad loading, regardless of where we are in the process. With our\n// current architecture, this could cause the content to start playing.\n// Therefore, contrib-ads must always either:\n//   - cancelContentPlay if there is any possible chance the play caused the\n//     content to start playing, even if we are technically in ad mode. In order for\n//     that to happen, play events need to be unprefixed until the last possible moment.\n//   - use playMiddleware to stop the play from reaching the Tech so there is no risk\n//     of the content starting to play.\n// Currently, playMiddleware is only supported on desktop browsers with\n// video.js after version 6.7.1.\n\n\nvar handlePlay = function handlePlay(player, event) {\n  if (player.ads.inAdBreak()) {\n    prefixEvent(player, 'ad', event); // Content resuming\n  } else if (player.ads.isContentResuming()) {\n    prefixEvent(player, 'content', event);\n  }\n}; // Handle a player event, either by redispatching it with a prefix, or by\n// letting it go on its way without any meddling.\n\n\nfunction redispatch(event) {\n  // Events with special treatment\n  if (event.type === 'playing') {\n    handlePlaying(this, event);\n  } else if (event.type === 'ended') {\n    handleEnded(this, event);\n  } else if (event.type === 'loadstart' || event.type === 'loadeddata' || event.type === 'loadedmetadata') {\n    handleLoadEvent(this, event);\n  } else if (event.type === 'play') {\n    handlePlay(this, event); // Standard handling for all other events\n  } else if (this.ads.isInAdMode()) {\n    if (this.ads.isContentResuming()) {\n      // Event came from snapshot restore after an ad, use \"content\" prefix\n      prefixEvent(this, 'content', event);\n    } else {\n      // Event came from ad playback, use \"ad\" prefix\n      prefixEvent(this, 'ad', event);\n    }\n  }\n}\n\n/*\nThis feature sends a `contentupdate` event when the player source changes.\n*/\n// Start sending contentupdate events\nfunction initializeContentupdate(player) {\n  // Keep track of the current content source\n  // If you want to change the src of the video without triggering\n  // the ad workflow to restart, you can update this variable before\n  // modifying the player's source\n  player.ads.contentSrc = player.currentSrc();\n  player.ads._seenInitialLoadstart = false; // Check if a new src has been set, if so, trigger contentupdate\n\n  var checkSrc = function checkSrc() {\n    if (!player.ads.inAdBreak()) {\n      var src = player.currentSrc();\n\n      if (src !== player.ads.contentSrc) {\n        if (player.ads._seenInitialLoadstart) {\n          player.trigger({\n            type: 'contentchanged'\n          });\n        }\n\n        player.trigger({\n          type: 'contentupdate',\n          oldValue: player.ads.contentSrc,\n          newValue: src\n        });\n        player.ads.contentSrc = src;\n      }\n\n      player.ads._seenInitialLoadstart = true;\n    }\n  }; // loadstart reliably indicates a new src has been set\n\n\n  player.on('loadstart', checkSrc);\n}\n\n/**\n * Current tcfData returned from CMP\n * Updated on event listener rather than having to make an asyc\n * check within the macro resolver\n */\n\nvar tcData = {};\n/**\n * Sets up a proxy for the TCF API in an iframed player, if a parent frame\n * that has implemented the TCF API is detected\n * https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#is-there-a-sample-iframe-script-call-to-the-cmp-api\n */\n\nvar proxyTcfApi = function proxyTcfApi(_) {\n  if (videojs.dom.isInFrame() && typeof window.__tcfapi !== 'function') {\n    var frame = window;\n    var cmpFrame;\n    var cmpCallbacks = {};\n\n    while (frame) {\n      try {\n        if (frame.frames.__tcfapiLocator) {\n          cmpFrame = frame;\n          break;\n        }\n      } catch (ignore) {// empty\n      }\n\n      if (frame === window.top) {\n        break;\n      }\n\n      frame = frame.parent;\n    }\n\n    if (!cmpFrame) {\n      return;\n    }\n\n    window.__tcfapi = function (cmd, version, callback, arg) {\n      var callId = Math.random() + '';\n      var msg = {\n        __tcfapiCall: {\n          command: cmd,\n          parameter: arg,\n          version: version,\n          callId: callId\n        }\n      };\n      cmpCallbacks[callId] = callback;\n      cmpFrame.postMessage(msg, '*');\n    };\n\n    window.addEventListener('message', function (event) {\n      var json = {};\n\n      try {\n        json = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;\n      } catch (ignore) {// empty\n      }\n\n      var payload = json.__tcfapiReturn;\n\n      if (payload) {\n        if (typeof cmpCallbacks[payload.callId] === 'function') {\n          cmpCallbacks[payload.callId](payload.returnValue, payload.success);\n          cmpCallbacks[payload.callId] = null;\n        }\n      }\n    }, false);\n  }\n};\n/**\n * Sets up event listener for changes to consent data.\n */\n\n\nvar listenToTcf = function listenToTcf() {\n  proxyTcfApi();\n\n  if (typeof window.__tcfapi === 'function') {\n    window.__tcfapi('addEventListener', 2, function (data, success) {\n      if (success) {\n        tcData = data;\n      }\n    });\n  }\n};\n\n/*\nThis feature provides an optional method for ad plugins to insert run-time values\ninto an ad server URL or configuration.\n*/\n\nvar uriEncodeIfNeeded = function uriEncodeIfNeeded(value, uriEncode) {\n  if (uriEncode) {\n    return encodeURIComponent(value);\n  }\n\n  return value;\n}; // Add custom field macros to macros object\n// based on given name for custom fields property of mediainfo object.\n\n\nvar customFields = function customFields(mediainfo, macros, customFieldsName) {\n  if (mediainfo && mediainfo[customFieldsName]) {\n    var fields = mediainfo[customFieldsName];\n    var fieldNames = Object.keys(fields);\n\n    for (var i = 0; i < fieldNames.length; i++) {\n      var tag = '{mediainfo.' + customFieldsName + '.' + fieldNames[i] + '}';\n      macros[tag] = fields[fieldNames[i]];\n    }\n  }\n}; // Public method that ad plugins use for ad macros.\n// \"string\" is any string with macros to be replaced\n// \"uriEncode\" if true will uri encode macro values when replaced\n// \"customMacros\" is a object with custom macros and values to map them to\n//  - For example: {'{five}': 5}\n// Return value is is \"string\" with macros replaced\n//  - For example: adMacroReplacement('{player.id}') returns a string of the player id\n\n\nfunction adMacroReplacement(string, uriEncode, customMacros) {\n  var _this = this;\n\n  var defaults = {}; // Get macros with defaults e.g. {x=y}, store values and replace with standard macros\n\n  string = string.replace(/{([^}=]+)=([^}]+)}/g, function (match, name, defaultVal) {\n    defaults[\"{\" + name + \"}\"] = defaultVal;\n    return \"{\" + name + \"}\";\n  });\n\n  if (uriEncode === undefined) {\n    uriEncode = false;\n  }\n\n  var macros = {};\n\n  if (customMacros !== undefined) {\n    macros = customMacros;\n  } // Static macros\n\n\n  macros['{player.id}'] = this.options_['data-player'] || this.id_;\n  macros['{player.height}'] = this.currentHeight();\n  macros['{player.width}'] = this.currentWidth();\n  macros['{mediainfo.id}'] = this.mediainfo ? this.mediainfo.id : '';\n  macros['{mediainfo.name}'] = this.mediainfo ? this.mediainfo.name : '';\n  macros['{mediainfo.duration}'] = this.mediainfo ? this.mediainfo.duration : '';\n  macros['{player.duration}'] = this.duration();\n  macros['{player.pageUrl}'] = videojs.dom.isInFrame() ? document.referrer : window.location.href;\n  macros['{playlistinfo.id}'] = this.playlistinfo ? this.playlistinfo.id : '';\n  macros['{playlistinfo.name}'] = this.playlistinfo ? this.playlistinfo.name : '';\n  macros['{timestamp}'] = new Date().getTime();\n  macros['{document.referrer}'] = document.referrer;\n  macros['{window.location.href}'] = window.location.href;\n  macros['{random}'] = Math.floor(Math.random() * 1000000000000);\n  ['description', 'tags', 'reference_id', 'ad_keys'].forEach(function (prop) {\n    if (_this.mediainfo && _this.mediainfo[prop]) {\n      macros[\"{mediainfo.\" + prop + \"}\"] = _this.mediainfo[prop];\n    } else if (defaults[\"{mediainfo.\" + prop + \"}\"]) {\n      macros[\"{mediainfo.\" + prop + \"}\"] = defaults[\"{mediainfo.\" + prop + \"}\"];\n    } else {\n      macros[\"{mediainfo.\" + prop + \"}\"] = '';\n    }\n  }); // Custom fields in mediainfo\n\n  customFields(this.mediainfo, macros, 'custom_fields');\n  customFields(this.mediainfo, macros, 'customFields'); // tcf macros\n\n  Object.keys(tcData).forEach(function (key) {\n    macros[\"{tcf.\" + key + \"}\"] = tcData[key];\n  }); // Ad servers commonly want this bool as an int\n\n  macros['{tcf.gdprAppliesInt}'] = tcData.gdprApplies ? 1 : 0; // Go through all the replacement macros and apply them to the string.\n  // This will replace all occurrences of the replacement macros.\n\n  for (var i in macros) {\n    string = string.split(i).join(uriEncodeIfNeeded(macros[i], uriEncode));\n  } // Page variables\n\n\n  string = string.replace(/{pageVariable\\.([^}]+)}/g, function (match, name) {\n    var value;\n    var context = window;\n    var names = name.split('.'); // Iterate down multiple levels of selector without using eval\n    // This makes things like pageVariable.foo.bar work\n\n    for (var _i = 0; _i < names.length; _i++) {\n      if (_i === names.length - 1) {\n        value = context[names[_i]];\n      } else {\n        context = context[names[_i]];\n      }\n    }\n\n    var type = typeof value; // Only allow certain types of values. Anything else is probably a mistake.\n\n    if (value === null) {\n      return 'null';\n    } else if (value === undefined) {\n      if (defaults[\"{pageVariable.\" + name + \"}\"]) {\n        return defaults[\"{pageVariable.\" + name + \"}\"];\n      }\n\n      videojs.log.warn(\"Page variable \\\"\" + name + \"\\\" not found\");\n      return '';\n    } else if (type !== 'string' && type !== 'number' && type !== 'boolean') {\n      videojs.log.warn(\"Page variable \\\"\" + name + \"\\\" is not a supported type\");\n      return '';\n    }\n\n    return uriEncodeIfNeeded(String(value), uriEncode);\n  }); // Replace defaults\n\n  for (var defaultVal in defaults) {\n    string = string.replace(defaultVal, defaults[defaultVal]);\n  }\n\n  return string;\n}\n\n/*\n* This feature allows metadata text tracks to be manipulated once available\n* @see processMetadataTracks.\n* It also allows ad implementations to leverage ad cues coming through\n* text tracks, @see processAdTrack\n**/\nvar cueTextTracks = {};\n/*\n* This feature allows metadata text tracks to be manipulated once they are available,\n* usually after the 'loadstart' event is observed on the player\n* @param player A reference to a player\n* @param processMetadataTrack A callback that performs some operations on a\n* metadata text track\n**/\n\ncueTextTracks.processMetadataTracks = function (player, processMetadataTrack) {\n  var tracks = player.textTracks();\n\n  var setModeAndProcess = function setModeAndProcess(track) {\n    if (track.kind === 'metadata') {\n      player.ads.cueTextTracks.setMetadataTrackMode(track);\n      processMetadataTrack(player, track);\n    }\n  }; // Text tracks are available\n\n\n  for (var i = 0; i < tracks.length; i++) {\n    setModeAndProcess(tracks[i]);\n  } // Wait until text tracks are added\n\n\n  tracks.addEventListener('addtrack', function (event) {\n    setModeAndProcess(event.track);\n  });\n};\n/*\n* Sets the track mode to one of 'disabled', 'hidden' or 'showing'\n* @see https://github.com/videojs/video.js/blob/master/docs/guides/text-tracks.md\n* Default behavior is to do nothing, @override if this is not desired\n* @param track The text track to set the mode on\n*/\n\n\ncueTextTracks.setMetadataTrackMode = function (track) {\n  return;\n};\n/*\n* Determines whether cue is an ad cue and returns the cue data.\n* @param player A reference to the player\n* @param cue The full cue object\n* Returns the given cue by default @override if futher processing is required\n* @return {Object} a useable ad cue or null if not supported\n**/\n\n\ncueTextTracks.getSupportedAdCue = function (player, cue) {\n  return cue;\n};\n/*\n* Defines whether a cue is supported or not, potentially\n* based on the player settings\n* @param player A reference to the player\n* @param cue The cue to be checked\n* Default behavior is to return true, @override if this is not desired\n* @return {Boolean}\n*/\n\n\ncueTextTracks.isSupportedAdCue = function (player, cue) {\n  return true;\n};\n/*\n* Gets the id associated with a cue.\n* @param cue The cue to extract an ID from\n* @returns The first occurance of 'id' in the object,\n* @override if this is not the desired cue id\n**/\n\n\ncueTextTracks.getCueId = function (player, cue) {\n  return cue.id;\n};\n/*\n* Checks whether a cue has already been used\n* @param cueId The Id associated with a cue\n**/\n\n\nvar cueAlreadySeen = function cueAlreadySeen(player, cueId) {\n  return cueId !== undefined && player.ads.includedCues[cueId];\n};\n/*\n* Indicates that a cue has been used\n* @param cueId The Id associated with a cue\n**/\n\n\nvar setCueAlreadySeen = function setCueAlreadySeen(player, cueId) {\n  if (cueId !== undefined && cueId !== '') {\n    player.ads.includedCues[cueId] = true;\n  }\n};\n/*\n* This feature allows ad metadata tracks to be manipulated in ad implementations\n* @param player A reference to the player\n* @param cues The set of cues to work with\n* @param processCue A method that uses a cue to make some\n* ad request in the ad implementation\n* @param [cancelAdsHandler] A method that dynamically cancels ads in the ad implementation\n**/\n\n\ncueTextTracks.processAdTrack = function (player, cues, processCue, cancelAdsHandler) {\n  player.ads.includedCues = {}; // loop over set of cues\n\n  for (var i = 0; i < cues.length; i++) {\n    var cue = cues[i];\n    var cueData = this.getSupportedAdCue(player, cue); // Exit if this is not a supported cue\n\n    if (!this.isSupportedAdCue(player, cue)) {\n      videojs.log.warn('Skipping as this is not a supported ad cue.', cue);\n      return;\n    } // Continue processing supported cue\n\n\n    var cueId = this.getCueId(player, cue);\n    var startTime = cue.startTime; // Skip ad if cue was already used\n\n    if (cueAlreadySeen(player, cueId)) {\n      videojs.log('Skipping ad already seen with ID ' + cueId);\n      return;\n    } // Optional dynamic ad cancellation\n\n\n    if (cancelAdsHandler) {\n      cancelAdsHandler(player, cueData, cueId, startTime);\n    } // Process cue as an ad cue\n\n\n    processCue(player, cueData, cueId, startTime); // Indicate that this cue has been used\n\n    setCueAlreadySeen(player, cueId);\n  }\n};\n\nfunction initCancelContentPlay(player, debug) {\n  if (debug) {\n    videojs.log('Using cancelContentPlay to block content playback');\n  } // Listen to play events to \"cancel\" them afterward\n\n\n  player.on('play', cancelContentPlay);\n}\n/*\nThis feature makes sure the player is paused during ad loading.\n\nIt does this by pausing the player immediately after a \"play\" where ads will be requested,\nthen signalling that we should play after the ad is done.\n*/\n\nfunction cancelContentPlay() {\n  // this function is in the player's context\n  if (this.ads._shouldBlockPlay === false) {\n    // Only block play if the ad plugin is in a state when content\n    // playback should be blocked. This currently means during\n    // BeforePrerollState and PrerollState.\n    return;\n  } // pause playback so ads can be handled.\n\n\n  if (!this.paused()) {\n    this.ads.debug('Playback was canceled by cancelContentPlay');\n    this.pause();\n  } // When the 'content-playback' state is entered, this will let us know to play.\n  // This is needed if there is no preroll or if it errors, times out, etc.\n\n\n  this.ads._cancelledPlay = true;\n}\n\nvar obj = {}; // This reference allows videojs to be mocked in unit tests\n// while still using the available videojs import in the source code\n// @see obj.testHook\n\nvar videojsReference = videojs;\n/**\n * Checks if middleware mediators are available and\n * can be used on this platform.\n * Currently we can only use mediators on desktop platforms.\n */\n\nobj.isMiddlewareMediatorSupported = function () {\n  if (videojsReference.browser.IS_IOS || videojsReference.browser.IS_ANDROID) {\n    return false;\n  } else if ( // added when middleware was introduced in video.js\n  videojsReference.use && // added when mediators were introduced in video.js\n  videojsReference.middleware && videojsReference.middleware.TERMINATOR) {\n    return true;\n  }\n\n  return false;\n};\n\nobj.playMiddleware = function (player) {\n  return {\n    setSource: function setSource(srcObj, next) {\n      next(null, srcObj);\n    },\n    callPlay: function callPlay() {\n      // Block play calls while waiting for an ad, only if this is an\n      // ad supported player\n      if (player.ads && player.ads._shouldBlockPlay === true) {\n        player.ads.debug('Using playMiddleware to block content playback');\n        player.ads._playBlocked = true;\n        return videojsReference.middleware.TERMINATOR;\n      }\n    },\n    play: function play(terminated, playPromise) {\n      if (player.ads && player.ads._playBlocked && terminated) {\n        player.ads.debug('Play call to Tech was terminated.'); // Trigger play event to match the user's intent to play.\n        // The call to play on the Tech has been blocked, so triggering\n        // the event on the Player will not affect the Tech's playback state.\n\n        player.trigger('play'); // At this point the player has technically started\n\n        player.addClass('vjs-has-started'); // Reset playBlocked\n\n        player.ads._playBlocked = false; // Safari issues a pause event when autoplay is blocked but other browsers\n        // do not, so we send a pause for consistency in those cases. This keeps the\n        // play button in the correct state if play is rejected.\n      } else if (playPromise && playPromise.catch) {\n        playPromise.catch(function (e) {\n          if (e.name === 'NotAllowedError' && !videojs.browser.IS_SAFARI) {\n            player.trigger('pause');\n          }\n        });\n      }\n    }\n  };\n};\n\nobj.testHook = function (testVjs) {\n  videojsReference = testVjs;\n};\n\nvar playMiddleware = obj.playMiddleware,\n    isMiddlewareMediatorSupported = obj.isMiddlewareMediatorSupported;\n/**\n * Whether or not this copy of Video.js has the ads plugin.\n *\n * @return {boolean}\n *         If `true`, has the plugin. `false` otherwise.\n */\n\nvar hasAdsPlugin = function hasAdsPlugin() {\n  // Video.js 6 and 7 have a getPlugin method.\n  if (videojs.getPlugin) {\n    return Boolean(videojs.getPlugin('ads'));\n  } // Video.js 5 does not have a getPlugin method, so check the player prototype.\n\n\n  var Player = videojs.getComponent('Player');\n  return Boolean(Player && Player.prototype.ads);\n};\n/**\n * Register contrib-ads with Video.js, but provide protection for duplicate\n * copies of the plugin. This could happen if, for example, a stitched ads\n * plugin and a client-side ads plugin are included simultaneously with their\n * own copies of contrib-ads.\n *\n * If contrib-ads detects a pre-existing duplicate, it will not register\n * itself.\n *\n * Ad plugins using contrib-ads and anticipating that this could come into\n * effect should verify that the contrib-ads they are using is of a compatible\n * version.\n *\n * @param  {Function} contribAdsPlugin\n *         The plugin function.\n *\n * @return {boolean}\n *         When `true`, the plugin was registered. When `false`, the plugin\n *         was not registered.\n */\n\n\nfunction register(contribAdsPlugin) {\n  // If the ads plugin already exists, do not overwrite it.\n  if (hasAdsPlugin(videojs)) {\n    return false;\n  } // Cross-compatibility with Video.js 6/7 and 5.\n\n\n  var registerPlugin = videojs.registerPlugin || videojs.plugin; // Register this plugin with Video.js.\n\n  registerPlugin('ads', contribAdsPlugin); // Register the play middleware with Video.js on script execution,\n  // to avoid a new playMiddleware factory being added for each player.\n  // The `usingContribAdsMiddleware_` flag is used to ensure that we only ever\n  // register the middleware once - despite the ability to de-register and\n  // re-register the plugin itself.\n\n  if (isMiddlewareMediatorSupported() && !videojs.usingContribAdsMiddleware_) {\n    // Register the play middleware\n    videojs.use('*', playMiddleware);\n    videojs.usingContribAdsMiddleware_ = true;\n    videojs.log.debug('Play middleware has been registered with videojs');\n  }\n\n  return true;\n}\n\nvar States =\n/*#__PURE__*/\nfunction () {\n  function States() {}\n\n  States.getState = function getState(name) {\n    if (!name) {\n      return;\n    }\n\n    if (States.states_ && States.states_[name]) {\n      return States.states_[name];\n    }\n  };\n\n  States.registerState = function registerState(name, StateToRegister) {\n    if (typeof name !== 'string' || !name) {\n      throw new Error(\"Illegal state name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n    }\n\n    if (!States.states_) {\n      States.states_ = {};\n    }\n\n    States.states_[name] = StateToRegister;\n    return StateToRegister;\n  };\n\n  return States;\n}();\n\nvar State =\n/*#__PURE__*/\nfunction () {\n  State._getName = function _getName() {\n    return 'Anonymous State';\n  };\n\n  function State(player) {\n    this.player = player;\n  }\n  /*\n   * This is the only allowed way to perform state transitions. State transitions usually\n   * happen in player event handlers. They can also happen recursively in `init`. They\n   * should _not_ happen in `cleanup`.\n   */\n\n\n  var _proto = State.prototype;\n\n  _proto.transitionTo = function transitionTo(NewState) {\n    var player = this.player; // Since State is an abstract class, this will refer to\n    // the state that is extending this class\n\n    this.cleanup(player);\n    var newState = new NewState(player);\n    player.ads._state = newState;\n    player.ads.debug(this.constructor._getName() + ' -> ' + newState.constructor._getName());\n\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    newState.init.apply(newState, [player].concat(args));\n  }\n  /*\n   * Implemented by subclasses to provide initialization logic when transitioning\n   * to a new state.\n   */\n  ;\n\n  _proto.init = function init() {}\n  /*\n   * Implemented by subclasses to provide cleanup logic when transitioning\n   * to a new state.\n   */\n  ;\n\n  _proto.cleanup = function cleanup() {}\n  /*\n   * Default event handlers. Different states can override these to provide behaviors.\n   */\n  ;\n\n  _proto.onPlay = function onPlay() {};\n\n  _proto.onPlaying = function onPlaying() {};\n\n  _proto.onEnded = function onEnded() {};\n\n  _proto.onAdEnded = function onAdEnded() {};\n\n  _proto.onAdsReady = function onAdsReady() {\n    videojs.log.warn('Unexpected adsready event');\n  };\n\n  _proto.onAdsError = function onAdsError() {};\n\n  _proto.onAdsCanceled = function onAdsCanceled() {};\n\n  _proto.onAdTimeout = function onAdTimeout() {};\n\n  _proto.onAdStarted = function onAdStarted() {};\n\n  _proto.onContentChanged = function onContentChanged() {};\n\n  _proto.onContentResumed = function onContentResumed() {};\n\n  _proto.onReadyForPostroll = function onReadyForPostroll() {\n    videojs.log.warn('Unexpected readyforpostroll event');\n  };\n\n  _proto.onNoPreroll = function onNoPreroll() {};\n\n  _proto.onNoPostroll = function onNoPostroll() {}\n  /*\n   * Method handlers. Different states can override these to provide behaviors.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    videojs.log.warn('Unexpected startLinearAdMode invocation ' + '(State via ' + this.constructor._getName() + ')');\n  };\n\n  _proto.endLinearAdMode = function endLinearAdMode() {\n    videojs.log.warn('Unexpected endLinearAdMode invocation ' + '(State via ' + this.constructor._getName() + ')');\n  };\n\n  _proto.skipLinearAdMode = function skipLinearAdMode() {\n    videojs.log.warn('Unexpected skipLinearAdMode invocation ' + '(State via ' + this.constructor._getName() + ')');\n  }\n  /*\n   * Overridden by ContentState and AdState. Should not be overriden elsewhere.\n   */\n  ;\n\n  _proto.isAdState = function isAdState() {\n    throw new Error('isAdState unimplemented for ' + this.constructor._getName());\n  }\n  /*\n   * Overridden by Preroll and Postroll. Midrolls jump right into the ad break\n   * so there is no \"waiting\" state for them.\n   */\n  ;\n\n  _proto.isWaitingForAdBreak = function isWaitingForAdBreak() {\n    return false;\n  }\n  /*\n   * Overridden by Preroll, Midroll, and Postroll.\n   */\n  ;\n\n  _proto.isContentResuming = function isContentResuming() {\n    return false;\n  };\n\n  _proto.inAdBreak = function inAdBreak() {\n    return false;\n  }\n  /*\n   * Invoke event handler methods when events come in.\n   */\n  ;\n\n  _proto.handleEvent = function handleEvent(type) {\n    var player = this.player;\n\n    if (type === 'play') {\n      this.onPlay(player);\n    } else if (type === 'adsready') {\n      this.onAdsReady(player);\n    } else if (type === 'adserror') {\n      this.onAdsError(player);\n    } else if (type === 'adscanceled') {\n      this.onAdsCanceled(player);\n    } else if (type === 'adtimeout') {\n      this.onAdTimeout(player);\n    } else if (type === 'ads-ad-started') {\n      this.onAdStarted(player);\n    } else if (type === 'contentchanged') {\n      this.onContentChanged(player);\n    } else if (type === 'contentresumed') {\n      this.onContentResumed(player);\n    } else if (type === 'readyforpostroll') {\n      this.onReadyForPostroll(player);\n    } else if (type === 'playing') {\n      this.onPlaying(player);\n    } else if (type === 'ended') {\n      this.onEnded(player);\n    } else if (type === 'nopreroll') {\n      this.onNoPreroll(player);\n    } else if (type === 'nopostroll') {\n      this.onNoPostroll(player);\n    } else if (type === 'adended') {\n      this.onAdEnded(player);\n    }\n  };\n\n  return State;\n}();\n\nStates.registerState('State', State);\n\nfunction _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n  subClass.__proto__ = superClass;\n}\n\n/*\n * This class contains logic for all ads, be they prerolls, midrolls, or postrolls.\n * Primarily, this involves handling startLinearAdMode and endLinearAdMode.\n * It also handles content resuming.\n */\n\nvar AdState =\n/*#__PURE__*/\nfunction (_State) {\n  _inheritsLoose(AdState, _State);\n\n  function AdState(player) {\n    var _this;\n\n    _this = _State.call(this, player) || this;\n    _this.contentResuming = false;\n    _this.waitingForAdBreak = false;\n    return _this;\n  }\n  /*\n   * Overrides State.isAdState\n   */\n\n\n  var _proto = AdState.prototype;\n\n  _proto.isAdState = function isAdState() {\n    return true;\n  }\n  /*\n   * We end the content-resuming process on the playing event because this is the exact\n   * moment that content playback is no longer blocked by ads.\n   */\n  ;\n\n  _proto.onPlaying = function onPlaying() {\n    var ContentPlayback = States.getState('ContentPlayback');\n\n    if (this.contentResuming) {\n      this.transitionTo(ContentPlayback);\n    }\n  }\n  /*\n   * If the ad plugin does not result in a playing event when resuming content after an\n   * ad, they should instead trigger a contentresumed event to signal that content should\n   * resume. The main use case for this is when ads are stitched into the content video.\n   */\n  ;\n\n  _proto.onContentResumed = function onContentResumed() {\n    var ContentPlayback = States.getState('ContentPlayback');\n\n    if (this.contentResuming) {\n      this.transitionTo(ContentPlayback);\n    }\n  }\n  /*\n   * Check if we are in an ad state waiting for the ad plugin to start\n   * an ad break.\n   */\n  ;\n\n  _proto.isWaitingForAdBreak = function isWaitingForAdBreak() {\n    return this.waitingForAdBreak;\n  }\n  /*\n   * Allows you to check if content is currently resuming after an ad break.\n   */\n  ;\n\n  _proto.isContentResuming = function isContentResuming() {\n    return this.contentResuming;\n  }\n  /*\n   * Allows you to check if an ad break is in progress.\n   */\n  ;\n\n  _proto.inAdBreak = function inAdBreak() {\n    return this.player.ads._inLinearAdMode === true;\n  };\n\n  return AdState;\n}(State);\n\nStates.registerState('AdState', AdState);\n\nvar ContentState =\n/*#__PURE__*/\nfunction (_State) {\n  _inheritsLoose(ContentState, _State);\n\n  function ContentState() {\n    return _State.apply(this, arguments) || this;\n  }\n\n  var _proto = ContentState.prototype;\n\n  /*\n   * Overrides State.isAdState\n   */\n  _proto.isAdState = function isAdState() {\n    return false;\n  }\n  /*\n   * Source change sends you back to preroll checks. contentchanged does not\n   * fire during ad breaks, so we don't need to worry about that.\n   */\n  ;\n\n  _proto.onContentChanged = function onContentChanged(player) {\n    var BeforePreroll = States.getState('BeforePreroll');\n    var Preroll = States.getState('Preroll');\n    player.ads.debug('Received contentchanged event (ContentState)');\n\n    if (player.paused()) {\n      this.transitionTo(BeforePreroll);\n    } else {\n      this.transitionTo(Preroll, false);\n      player.pause();\n      player.ads._pausedOnContentupdate = true;\n    }\n  };\n\n  return ContentState;\n}(State);\n\nStates.registerState('ContentState', ContentState);\n\nvar ContentState$1 = States.getState('ContentState');\n\nvar AdsDone =\n/*#__PURE__*/\nfunction (_ContentState) {\n  _inheritsLoose(AdsDone, _ContentState);\n\n  function AdsDone() {\n    return _ContentState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  AdsDone._getName = function _getName() {\n    return 'AdsDone';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = AdsDone.prototype;\n\n  _proto.init = function init(player) {\n    // From now on, `ended` events won't be redispatched\n    player.ads._contentHasEnded = true;\n    player.trigger('ended');\n  }\n  /*\n   * Midrolls do not play after ads are done.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    videojs.log.warn('Unexpected startLinearAdMode invocation (AdsDone)');\n  };\n\n  return AdsDone;\n}(ContentState$1);\n\nStates.registerState('AdsDone', AdsDone);\n\n/*\nThe snapshot feature is responsible for saving the player state before an ad, then\nrestoring the player state after an ad.\n*/\nvar tryToResumeTimeout_;\n/*\n * Returns an object that captures the portions of player state relevant to\n * video playback. The result of this function can be passed to\n * restorePlayerSnapshot with a player to return the player to the state it\n * was in when this function was invoked.\n * @param {Object} player The videojs player object\n */\n\nfunction getPlayerSnapshot(player) {\n  var currentTime;\n\n  if (videojs.browser.IS_IOS && player.ads.isLive(player)) {\n    // Record how far behind live we are\n    if (player.seekable().length > 0) {\n      currentTime = player.currentTime() - player.seekable().end(0);\n    } else {\n      currentTime = player.currentTime();\n    }\n  } else {\n    currentTime = player.currentTime();\n  }\n\n  var tech = player.$('.vjs-tech');\n  var tracks = player.textTracks ? player.textTracks() : [];\n  var suppressedTracks = [];\n  var snapshotObject = {\n    ended: player.ended(),\n    currentSrc: player.currentSrc(),\n    sources: player.currentSources(),\n    src: player.tech_.src(),\n    currentTime: currentTime,\n    type: player.currentType()\n  };\n\n  if (tech) {\n    snapshotObject.style = tech.getAttribute('style');\n  }\n\n  for (var i = 0; i < tracks.length; i++) {\n    var track = tracks[i];\n    suppressedTracks.push({\n      track: track,\n      mode: track.mode\n    });\n    track.mode = 'disabled';\n  }\n\n  snapshotObject.suppressedTracks = suppressedTracks;\n  return snapshotObject;\n}\n/*\n * Attempts to modify the specified player so that its state is equivalent to\n * the state of the snapshot.\n * @param {Object} player - the videojs player object\n * @param {Object} snapshotObject - the player state to apply\n */\n\nfunction restorePlayerSnapshot(player, callback) {\n  var snapshotObject = player.ads.snapshot;\n\n  if (callback === undefined) {\n    callback = function callback() {};\n  }\n\n  if (player.ads.disableNextSnapshotRestore === true) {\n    player.ads.disableNextSnapshotRestore = false;\n    delete player.ads.snapshot;\n    callback();\n    return;\n  } // The playback tech\n\n\n  var tech = player.$('.vjs-tech'); // the number of[ remaining attempts to restore the snapshot\n\n  var attempts = 20;\n  var suppressedTracks = snapshotObject.suppressedTracks;\n  var trackSnapshot;\n\n  var restoreTracks = function restoreTracks() {\n    for (var i = 0; i < suppressedTracks.length; i++) {\n      trackSnapshot = suppressedTracks[i];\n      trackSnapshot.track.mode = trackSnapshot.mode;\n    }\n  }; // Finish restoring the playback state.\n  // This only happens if the content video element was reused for ad playback.\n\n\n  var resume = function resume() {\n    var currentTime; // Live video on iOS has special logic to try to seek to the right place after\n    // an ad.\n\n    if (videojs.browser.IS_IOS && player.ads.isLive(player)) {\n      if (snapshotObject.currentTime < 0) {\n        // Playback was behind real time, so seek backwards to match\n        if (player.seekable().length > 0) {\n          currentTime = player.seekable().end(0) + snapshotObject.currentTime;\n        } else {\n          currentTime = player.currentTime();\n        }\n\n        player.currentTime(currentTime);\n      } // iOS live play after restore if player was paused (would not be paused if\n      // ad played muted behind ad)\n\n\n      if (player.paused()) {\n        var playPromise = player.play();\n\n        if (playPromise && playPromise.catch) {\n          playPromise.catch(function (error) {\n            videojs.log.warn('Play promise rejected in IOS snapshot resume', error);\n          });\n        }\n      } // Restore the video position after an ad.\n      // We check snapshotObject.ended because the content starts at the beginning again\n      // after being restored.\n\n    } else if (snapshotObject.ended) {\n      // For postrolls, seek to the player's current duration.\n      // It could be different from the snapshot's currentTime due to\n      // inaccuracy in HLS.\n      player.currentTime(player.duration());\n    } else {\n      // Prerolls and midrolls, just seek to the player time before the ad.\n      player.currentTime(snapshotObject.currentTime);\n\n      var _playPromise = player.play();\n\n      if (_playPromise && _playPromise.catch) {\n        _playPromise.catch(function (error) {\n          videojs.log.warn('Play promise rejected in snapshot resume', error);\n        });\n      }\n    } // if we added autoplay to force content loading on iOS, remove it now\n    // that it has served its purpose\n\n\n    if (player.ads.shouldRemoveAutoplay_) {\n      player.autoplay(false);\n      player.ads.shouldRemoveAutoplay_ = false;\n    }\n  }; // Determine if the video element has loaded enough of the snapshot source\n  // to be ready to apply the rest of the state.\n  // This only happens if the content video element was reused for ad playback.\n\n\n  var tryToResume = function tryToResume() {\n    // tryToResume can either have been called through the `contentcanplay`\n    // event or fired through setTimeout.\n    // When tryToResume is called, we should make sure to clear out the other\n    // way it could've been called by removing the listener and clearing out\n    // the timeout.\n    player.off('contentcanplay', tryToResume);\n\n    if (tryToResumeTimeout_) {\n      player.clearTimeout(tryToResumeTimeout_);\n    } // Tech may have changed depending on the differences in sources of the\n    // original video and that of the ad\n\n\n    tech = player.el().querySelector('.vjs-tech');\n\n    if (tech.readyState > 1) {\n      // some browsers and media aren't \"seekable\".\n      // readyState greater than 1 allows for seeking without exceptions\n      return resume();\n    }\n\n    if (tech.seekable === undefined) {\n      // if the tech doesn't expose the seekable time ranges, try to\n      // resume playback immediately\n      return resume();\n    }\n\n    if (tech.seekable.length > 0) {\n      // if some period of the video is seekable, resume playback\n      return resume();\n    } // delay a bit and then check again unless we're out of attempts\n\n\n    if (attempts--) {\n      player.setTimeout(tryToResume, 50);\n    } else {\n      try {\n        resume();\n      } catch (e) {\n        videojs.log.warn('Failed to resume the content after an advertisement', e);\n      }\n    }\n  };\n\n  if ('style' in snapshotObject) {\n    // overwrite all css style properties to restore state precisely\n    tech.setAttribute('style', snapshotObject.style || '');\n  } // Determine whether the player needs to be restored to its state\n  // before ad playback began. With a custom ad display or burned-in\n  // ads, the content player state hasn't been modified and so no\n  // restoration is required\n\n\n  if (player.ads.videoElementRecycled()) {\n    // Snapshot restore is done, so now we're really finished.\n    player.one('resumeended', function () {\n      delete player.ads.snapshot;\n      callback();\n    }); // on ios7, fiddling with textTracks too early will cause safari to crash\n\n    player.one('contentloadedmetadata', restoreTracks); // adding autoplay guarantees that Safari will load the content so we can\n    // seek back to the correct time after ads\n\n    if (videojs.browser.IS_IOS && !player.autoplay()) {\n      player.autoplay(true); // if we get here, the player was not originally configured to autoplay,\n      // so we should remove it after it has served its purpose\n\n      player.ads.shouldRemoveAutoplay_ = true;\n    } // if the src changed for ad playback, reset it\n\n\n    player.src(snapshotObject.sources); // and then resume from the snapshots time once the original src has loaded\n    // in some browsers (firefox) `canplay` may not fire correctly.\n    // Reace the `canplay` event with a timeout.\n\n    player.one('contentcanplay', tryToResume);\n    tryToResumeTimeout_ = player.setTimeout(tryToResume, 2000);\n  } else {\n    // if we didn't change the src, just restore the tracks\n    restoreTracks(); // we don't need to check snapshotObject.ended here because the content video\n    // element wasn't recycled\n\n    if (!player.ended()) {\n      // the src didn't change and this wasn't a postroll\n      // just resume playback at the current time.\n      var playPromise = player.play();\n\n      if (playPromise && playPromise.catch) {\n        playPromise.catch(function (error) {\n          videojs.log.warn('Play promise rejected in snapshot restore', error);\n        });\n      }\n    } // snapshot restore is complete\n\n\n    delete player.ads.snapshot;\n    callback();\n  }\n}\n\n/*\n * Encapsulates logic for starting and ending ad breaks. An ad break\n * is the time between startLinearAdMode and endLinearAdMode. The ad\n * plugin may play 0 or more ads during this time.\n */\n\nfunction start(player) {\n  player.ads.debug('Starting ad break');\n  player.ads._inLinearAdMode = true; // No longer does anything, used to move us to ad-playback\n\n  player.trigger('adstart'); // Capture current player state snapshot\n\n  if (player.ads.shouldTakeSnapshots()) {\n    player.ads.snapshot = getPlayerSnapshot(player);\n  } // Mute the player behind the ad\n\n\n  if (player.ads.shouldPlayContentBehindAd(player)) {\n    player.ads.preAdVolume_ = player.volume();\n    player.volume(0);\n  } // Add css to the element to indicate and ad is playing.\n\n\n  player.addClass('vjs-ad-playing'); // We should remove the vjs-live class if it has been added in order to\n  // show the adprogress control bar on Android devices for falsely\n  // determined LIVE videos due to the duration incorrectly reported as Infinity\n\n  if (player.hasClass('vjs-live')) {\n    player.removeClass('vjs-live');\n  } // This removes the native poster so the ads don't show the content\n  // poster if content element is reused for ad playback.\n\n\n  player.ads.removeNativePoster();\n}\n\nfunction end(player, callback) {\n  player.ads.debug('Ending ad break');\n\n  if (callback === undefined) {\n    callback = function callback() {};\n  }\n\n  player.ads.adType = null;\n  player.ads._inLinearAdMode = false; // Signals the end of the ad break to anyone listening.\n\n  player.trigger('adend');\n  player.removeClass('vjs-ad-playing'); // We should add the vjs-live class back if the video is a LIVE video\n  // If we dont do this, then for a LIVE Video, we will get an incorrect\n  // styled control, which displays the time for the video\n\n  if (player.ads.isLive(player)) {\n    player.addClass('vjs-live');\n  } // Restore snapshot\n\n\n  if (player.ads.shouldTakeSnapshots()) {\n    restorePlayerSnapshot(player, callback); // Reset the volume to pre-ad levels\n  } else {\n    player.volume(player.ads.preAdVolume_);\n    callback();\n  }\n}\n\nvar obj$1 = {\n  start: start,\n  end: end\n};\n\nvar AdState$1 = States.getState('AdState');\n/*\n * This state encapsulates waiting for prerolls, preroll playback, and\n * content restoration after a preroll.\n */\n\nvar Preroll =\n/*#__PURE__*/\nfunction (_AdState) {\n  _inheritsLoose(Preroll, _AdState);\n\n  function Preroll() {\n    return _AdState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  Preroll._getName = function _getName() {\n    return 'Preroll';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = Preroll.prototype;\n\n  _proto.init = function init(player, adsReady, shouldResumeToContent) {\n    this.waitingForAdBreak = true; // Loading spinner from now until ad start or end of ad break.\n\n    player.addClass('vjs-ad-loading'); // If adserror, adscanceled, nopreroll or skipLinearAdMode already\n    // ocurred, resume to content immediately\n\n    if (shouldResumeToContent || player.ads.nopreroll_) {\n      return this.resumeAfterNoPreroll(player);\n    } // Determine preroll timeout based on plugin settings\n\n\n    var timeout = player.ads.settings.timeout;\n\n    if (typeof player.ads.settings.prerollTimeout === 'number') {\n      timeout = player.ads.settings.prerollTimeout;\n    } // Start the clock ticking for ad timeout\n\n\n    this._timeout = player.setTimeout(function () {\n      player.trigger('adtimeout');\n    }, timeout); // If adsready already happened, lets get started. Otherwise,\n    // wait until onAdsReady.\n\n    if (adsReady) {\n      this.handleAdsReady();\n    } else {\n      this.adsReady = false;\n    }\n  }\n  /*\n   * Adsready event after play event.\n   */\n  ;\n\n  _proto.onAdsReady = function onAdsReady(player) {\n    if (!player.ads.inAdBreak()) {\n      player.ads.debug('Received adsready event (Preroll)');\n      this.handleAdsReady();\n    } else {\n      videojs.log.warn('Unexpected adsready event (Preroll)');\n    }\n  }\n  /*\n   * Ad plugin is ready. Let's get started on this preroll.\n   */\n  ;\n\n  _proto.handleAdsReady = function handleAdsReady() {\n    this.adsReady = true;\n    this.readyForPreroll();\n  }\n  /*\n   * Helper to call a callback only after a loadstart event.\n   * If we start content or ads before loadstart, loadstart\n   * will not be prefixed correctly.\n   */\n  ;\n\n  _proto.afterLoadStart = function afterLoadStart(callback) {\n    var player = this.player;\n\n    if (player.ads._hasThereBeenALoadStartDuringPlayerLife) {\n      callback();\n    } else {\n      player.ads.debug('Waiting for loadstart...');\n      player.one('loadstart', function () {\n        player.ads.debug('Received loadstart event');\n        callback();\n      });\n    }\n  }\n  /*\n   * If there is no preroll, play content instead.\n   */\n  ;\n\n  _proto.noPreroll = function noPreroll() {\n    var _this = this;\n\n    this.afterLoadStart(function () {\n      _this.player.ads.debug('Skipping prerolls due to nopreroll event (Preroll)');\n\n      _this.resumeAfterNoPreroll(_this.player);\n    });\n  }\n  /*\n   * Fire the readyforpreroll event. If loadstart hasn't happened yet,\n   * wait until loadstart first.\n   */\n  ;\n\n  _proto.readyForPreroll = function readyForPreroll() {\n    var player = this.player;\n    this.afterLoadStart(function () {\n      player.ads.debug('Triggered readyforpreroll event (Preroll)');\n      player.trigger('readyforpreroll');\n    });\n  }\n  /*\n   * adscanceled cancels all ads for the source. Play content now.\n   */\n  ;\n\n  _proto.onAdsCanceled = function onAdsCanceled(player) {\n    var _this2 = this;\n\n    player.ads.debug('adscanceled (Preroll)');\n    this.afterLoadStart(function () {\n      _this2.resumeAfterNoPreroll(player);\n    });\n  }\n  /*\n   * An ad error occured. Play content instead.\n   */\n  ;\n\n  _proto.onAdsError = function onAdsError(player) {\n    var _this3 = this;\n\n    videojs.log('adserror (Preroll)'); // In the future, we may not want to do this automatically.\n    // Ad plugins should be able to choose to continue the ad break\n    // if there was an error.\n\n    if (this.inAdBreak()) {\n      player.ads.endLinearAdMode();\n    } else {\n      this.afterLoadStart(function () {\n        _this3.resumeAfterNoPreroll(player);\n      });\n    }\n  }\n  /*\n   * Ad plugin invoked startLinearAdMode, the ad break starts now.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    var player = this.player;\n\n    if (this.adsReady && !player.ads.inAdBreak() && !this.isContentResuming()) {\n      this.clearTimeout(player);\n      player.ads.adType = 'preroll';\n      this.waitingForAdBreak = false;\n      obj$1.start(player); // We don't need to block play calls anymore\n\n      player.ads._shouldBlockPlay = false;\n    } else {\n      videojs.log.warn('Unexpected startLinearAdMode invocation (Preroll)');\n    }\n  }\n  /*\n   * An ad has actually started playing.\n   * Remove the loading spinner.\n   */\n  ;\n\n  _proto.onAdStarted = function onAdStarted(player) {\n    player.removeClass('vjs-ad-loading');\n  }\n  /*\n   * Ad plugin invoked endLinearAdMode, the ad break ends now.\n   */\n  ;\n\n  _proto.endLinearAdMode = function endLinearAdMode() {\n    var player = this.player;\n\n    if (this.inAdBreak()) {\n      player.removeClass('vjs-ad-loading');\n      player.addClass('vjs-ad-content-resuming');\n      this.contentResuming = true;\n      obj$1.end(player);\n    }\n  }\n  /*\n   * Ad skipped by ad plugin. Play content instead.\n   */\n  ;\n\n  _proto.skipLinearAdMode = function skipLinearAdMode() {\n    var _this4 = this;\n\n    var player = this.player;\n\n    if (player.ads.inAdBreak() || this.isContentResuming()) {\n      videojs.log.warn('Unexpected skipLinearAdMode invocation');\n    } else {\n      this.afterLoadStart(function () {\n        player.trigger('adskip');\n        player.ads.debug('skipLinearAdMode (Preroll)');\n\n        _this4.resumeAfterNoPreroll(player);\n      });\n    }\n  }\n  /*\n   * Prerolls took too long! Play content instead.\n   */\n  ;\n\n  _proto.onAdTimeout = function onAdTimeout(player) {\n    var _this5 = this;\n\n    this.afterLoadStart(function () {\n      player.ads.debug('adtimeout (Preroll)');\n\n      _this5.resumeAfterNoPreroll(player);\n    });\n  }\n  /*\n   * Check if nopreroll event was too late before handling it.\n   */\n  ;\n\n  _proto.onNoPreroll = function onNoPreroll(player) {\n    if (player.ads.inAdBreak() || this.isContentResuming()) {\n      videojs.log.warn('Unexpected nopreroll event (Preroll)');\n    } else {\n      this.noPreroll();\n    }\n  };\n\n  _proto.resumeAfterNoPreroll = function resumeAfterNoPreroll(player) {\n    // Resume to content and unblock play as there is no preroll ad\n    this.contentResuming = true;\n    player.ads._shouldBlockPlay = false;\n    this.cleanupPartial(player); // Play the content if we had requested play or we paused on 'contentupdate'\n    // and we haven't played yet. This happens if there was no preroll or if it\n    // errored, timed out, etc. Otherwise snapshot restore would play.\n\n    if (player.ads._playRequested || player.ads._pausedOnContentupdate) {\n      if (player.paused()) {\n        player.ads.debug('resumeAfterNoPreroll: attempting to resume playback (Preroll)');\n        var playPromise = player.play();\n\n        if (playPromise && playPromise.then) {\n          playPromise.then(null, function (e) {});\n        }\n      } else {\n        player.ads.debug('resumeAfterNoPreroll: already playing (Preroll)');\n        player.trigger('play');\n        player.trigger('playing');\n      }\n    }\n  }\n  /*\n   * Cleanup timeouts and spinner.\n   */\n  ;\n\n  _proto.cleanup = function cleanup(player) {\n    if (!player.ads._hasThereBeenALoadStartDuringPlayerLife) {\n      videojs.log.warn('Leaving Preroll state before loadstart event can cause issues.');\n    }\n\n    this.cleanupPartial(player);\n  }\n  /*\n   * Performs cleanup tasks without depending on a state transition. This is\n   * used mainly in cases where a preroll failed.\n   */\n  ;\n\n  _proto.cleanupPartial = function cleanupPartial(player) {\n    player.removeClass('vjs-ad-loading');\n    player.removeClass('vjs-ad-content-resuming');\n    this.clearTimeout(player);\n  }\n  /*\n   * Clear the preroll timeout and nulls out the pointer.\n   */\n  ;\n\n  _proto.clearTimeout = function clearTimeout(player) {\n    player.clearTimeout(this._timeout);\n    this._timeout = null;\n  };\n\n  return Preroll;\n}(AdState$1);\n\nStates.registerState('Preroll', Preroll);\n\nvar ContentState$2 = States.getState('ContentState');\n/*\n * This is the initial state for a player with an ad plugin. Normally, it remains in this\n * state until a \"play\" event is seen. After that, we enter the Preroll state to check for\n * prerolls. This happens regardless of whether or not any prerolls ultimately will play.\n * Errors and other conditions may lead us directly from here to ContentPlayback.\n */\n\nvar BeforePreroll =\n/*#__PURE__*/\nfunction (_ContentState) {\n  _inheritsLoose(BeforePreroll, _ContentState);\n\n  function BeforePreroll() {\n    return _ContentState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  BeforePreroll._getName = function _getName() {\n    return 'BeforePreroll';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = BeforePreroll.prototype;\n\n  _proto.init = function init(player) {\n    this.adsReady = false;\n    this.shouldResumeToContent = false; // Content playback should be blocked by callPlay() middleware if the allowVjsAutoplay\n    // option hasn't been provided and autoplay is not desired.\n\n    player.ads._shouldBlockPlay = player.ads.settings.allowVjsAutoplay ? !player.autoplay() : true;\n  }\n  /*\n   * The ad plugin may trigger adsready before the play request. If so,\n   * we record that adsready already happened so the Preroll state will know.\n   */\n  ;\n\n  _proto.onAdsReady = function onAdsReady(player) {\n    player.ads.debug('Received adsready event (BeforePreroll)');\n    this.adsReady = true;\n  }\n  /*\n   * Ad mode officially begins on the play request, because at this point\n   * content playback is blocked by the ad plugin.\n   */\n  ;\n\n  _proto.onPlay = function onPlay(player) {\n    var Preroll = States.getState('Preroll');\n    player.ads.debug('Received play event (BeforePreroll)'); // Check for prerolls\n\n    this.transitionTo(Preroll, this.adsReady, this.shouldResumeToContent);\n  }\n  /*\n   * All ads for the entire video are canceled.\n   */\n  ;\n\n  _proto.onAdsCanceled = function onAdsCanceled(player) {\n    player.ads.debug('adscanceled (BeforePreroll)');\n    this.shouldResumeToContent = true;\n  }\n  /*\n   * An ad error occured. Play content instead.\n   */\n  ;\n\n  _proto.onAdsError = function onAdsError() {\n    this.player.ads.debug('adserror (BeforePreroll)');\n    this.shouldResumeToContent = true;\n  }\n  /*\n   * If there is no preroll, don't wait for a play event to move forward.\n   */\n  ;\n\n  _proto.onNoPreroll = function onNoPreroll() {\n    this.player.ads.debug('Skipping prerolls due to nopreroll event (BeforePreroll)');\n    this.shouldResumeToContent = true;\n  }\n  /*\n   * Prerolls skipped by ad plugin. Play content instead.\n   */\n  ;\n\n  _proto.skipLinearAdMode = function skipLinearAdMode() {\n    var player = this.player;\n    player.trigger('adskip');\n    player.ads.debug('skipLinearAdMode (BeforePreroll)');\n    this.shouldResumeToContent = true;\n  };\n\n  _proto.onContentChanged = function onContentChanged() {\n    this.init(this.player);\n  };\n\n  return BeforePreroll;\n}(ContentState$2);\n\nStates.registerState('BeforePreroll', BeforePreroll);\n\nvar AdState$2 = States.getState('AdState');\n\nvar Midroll =\n/*#__PURE__*/\nfunction (_AdState) {\n  _inheritsLoose(Midroll, _AdState);\n\n  function Midroll() {\n    return _AdState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  Midroll._getName = function _getName() {\n    return 'Midroll';\n  }\n  /*\n   * Midroll breaks happen when the ad plugin calls startLinearAdMode,\n   * which can happen at any time during content playback.\n   */\n  ;\n\n  var _proto = Midroll.prototype;\n\n  _proto.init = function init(player) {\n    player.ads.adType = 'midroll';\n    obj$1.start(player);\n    player.addClass('vjs-ad-loading');\n  }\n  /*\n   * An ad has actually started playing.\n   * Remove the loading spinner.\n   */\n  ;\n\n  _proto.onAdStarted = function onAdStarted(player) {\n    player.removeClass('vjs-ad-loading');\n  }\n  /*\n   * Midroll break is done.\n   */\n  ;\n\n  _proto.endLinearAdMode = function endLinearAdMode() {\n    var player = this.player;\n\n    if (this.inAdBreak()) {\n      this.contentResuming = true;\n      player.addClass('vjs-ad-content-resuming');\n      player.removeClass('vjs-ad-loading');\n      obj$1.end(player);\n    }\n  }\n  /*\n   * End midroll break if there is an error.\n   */\n  ;\n\n  _proto.onAdsError = function onAdsError(player) {\n    // In the future, we may not want to do this automatically.\n    // Ad plugins should be able to choose to continue the ad break\n    // if there was an error.\n    if (this.inAdBreak()) {\n      player.ads.endLinearAdMode();\n    }\n  }\n  /*\n   * Cleanup CSS classes.\n   */\n  ;\n\n  _proto.cleanup = function cleanup(player) {\n    player.removeClass('vjs-ad-loading');\n    player.removeClass('vjs-ad-content-resuming');\n  };\n\n  return Midroll;\n}(AdState$2);\n\nStates.registerState('Midroll', Midroll);\n\nvar AdState$3 = States.getState('AdState');\n\nvar Postroll =\n/*#__PURE__*/\nfunction (_AdState) {\n  _inheritsLoose(Postroll, _AdState);\n\n  function Postroll() {\n    return _AdState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  Postroll._getName = function _getName() {\n    return 'Postroll';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = Postroll.prototype;\n\n  _proto.init = function init(player) {\n    this.waitingForAdBreak = true; // Legacy name that now simply means \"handling postrolls\".\n\n    player.ads._contentEnding = true; // Start postroll process.\n\n    if (!player.ads.nopostroll_) {\n      player.addClass('vjs-ad-loading'); // Determine postroll timeout based on plugin settings\n\n      var timeout = player.ads.settings.timeout;\n\n      if (typeof player.ads.settings.postrollTimeout === 'number') {\n        timeout = player.ads.settings.postrollTimeout;\n      }\n\n      this._postrollTimeout = player.setTimeout(function () {\n        player.trigger('adtimeout');\n      }, timeout); // No postroll, ads are done\n    } else {\n      this.resumeContent(player);\n      var AdsDone = States.getState('AdsDone');\n      this.transitionTo(AdsDone);\n    }\n  }\n  /*\n   * Start the postroll if it's not too late.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    var player = this.player;\n\n    if (!player.ads.inAdBreak() && !this.isContentResuming()) {\n      player.ads.adType = 'postroll';\n      player.clearTimeout(this._postrollTimeout);\n      this.waitingForAdBreak = false;\n      obj$1.start(player);\n    } else {\n      videojs.log.warn('Unexpected startLinearAdMode invocation (Postroll)');\n    }\n  }\n  /*\n   * An ad has actually started playing.\n   * Remove the loading spinner.\n   */\n  ;\n\n  _proto.onAdStarted = function onAdStarted(player) {\n    player.removeClass('vjs-ad-loading');\n  }\n  /*\n   * Ending a postroll triggers the ended event.\n   */\n  ;\n\n  _proto.endLinearAdMode = function endLinearAdMode() {\n    var _this = this;\n\n    var player = this.player;\n    var AdsDone = States.getState('AdsDone');\n\n    if (this.inAdBreak()) {\n      player.removeClass('vjs-ad-loading');\n      this.resumeContent(player);\n      obj$1.end(player, function () {\n        _this.transitionTo(AdsDone);\n      });\n    }\n  }\n  /*\n   * Postroll skipped, time to clean up.\n   */\n  ;\n\n  _proto.skipLinearAdMode = function skipLinearAdMode() {\n    var player = this.player;\n\n    if (player.ads.inAdBreak() || this.isContentResuming()) {\n      videojs.log.warn('Unexpected skipLinearAdMode invocation');\n    } else {\n      player.ads.debug('Postroll abort (skipLinearAdMode)');\n      player.trigger('adskip');\n      this.abort(player);\n    }\n  }\n  /*\n   * Postroll timed out, time to clean up.\n   */\n  ;\n\n  _proto.onAdTimeout = function onAdTimeout(player) {\n    player.ads.debug('Postroll abort (adtimeout)');\n    this.abort(player);\n  }\n  /*\n   * Postroll errored out, time to clean up.\n   */\n  ;\n\n  _proto.onAdsError = function onAdsError(player) {\n    player.ads.debug('Postroll abort (adserror)'); // In the future, we may not want to do this automatically.\n    // Ad plugins should be able to choose to continue the ad break\n    // if there was an error.\n\n    if (player.ads.inAdBreak()) {\n      player.ads.endLinearAdMode();\n    } else {\n      this.abort(player);\n    }\n  }\n  /*\n   * Handle content change if we're not in an ad break.\n   */\n  ;\n\n  _proto.onContentChanged = function onContentChanged(player) {\n    // Content resuming after Postroll. Content is paused\n    // at this point, since it is done playing.\n    if (this.isContentResuming()) {\n      var BeforePreroll = States.getState('BeforePreroll');\n      this.transitionTo(BeforePreroll); // Waiting for postroll to start. Content is considered playing\n      // at this point, since it had to be playing to start the postroll.\n    } else if (!this.inAdBreak()) {\n      var Preroll = States.getState('Preroll');\n      this.transitionTo(Preroll);\n    }\n  }\n  /*\n   * Wrap up if there is no postroll.\n   */\n  ;\n\n  _proto.onNoPostroll = function onNoPostroll(player) {\n    if (!this.isContentResuming() && !this.inAdBreak()) {\n      this.abort(player);\n    } else {\n      videojs.log.warn('Unexpected nopostroll event (Postroll)');\n    }\n  };\n\n  _proto.resumeContent = function resumeContent(player) {\n    this.contentResuming = true;\n    player.addClass('vjs-ad-content-resuming');\n  }\n  /*\n   * Helper for ending Postrolls. In the future we may want to\n   * refactor this class so that `cleanup` handles all of this.\n   */\n  ;\n\n  _proto.abort = function abort(player) {\n    var AdsDone = States.getState('AdsDone');\n    this.resumeContent(player);\n    player.removeClass('vjs-ad-loading');\n    this.transitionTo(AdsDone);\n  }\n  /*\n   * Cleanup timeouts and state.\n   */\n  ;\n\n  _proto.cleanup = function cleanup(player) {\n    player.removeClass('vjs-ad-content-resuming');\n    player.clearTimeout(this._postrollTimeout);\n    player.ads._contentEnding = false;\n  };\n\n  return Postroll;\n}(AdState$3);\n\nStates.registerState('Postroll', Postroll);\n\nvar ContentState$3 = States.getState('ContentState');\n/*\n * This state represents content playback the first time through before\n * content ends. After content has ended once, we check for postrolls and\n * move on to the AdsDone state rather than returning here.\n */\n\nvar ContentPlayback =\n/*#__PURE__*/\nfunction (_ContentState) {\n  _inheritsLoose(ContentPlayback, _ContentState);\n\n  function ContentPlayback() {\n    return _ContentState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  ContentPlayback._getName = function _getName() {\n    return 'ContentPlayback';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = ContentPlayback.prototype;\n\n  _proto.init = function init(player) {\n    // Don't block calls to play in content playback\n    player.ads._shouldBlockPlay = false;\n  }\n  /*\n   * In the case of a timeout, adsready might come in late. This assumes the behavior\n   * that if an ad times out, it could still interrupt the content and start playing.\n   * An ad plugin could behave otherwise by ignoring this event.\n   */\n  ;\n\n  _proto.onAdsReady = function onAdsReady(player) {\n    player.ads.debug('Received adsready event (ContentPlayback)');\n\n    if (!player.ads.nopreroll_) {\n      player.ads.debug('Triggered readyforpreroll event (ContentPlayback)');\n      player.trigger('readyforpreroll');\n    }\n  }\n  /*\n   * Content ended before postroll checks.\n   */\n  ;\n\n  _proto.onReadyForPostroll = function onReadyForPostroll(player) {\n    var Postroll = States.getState('Postroll');\n    player.ads.debug('Received readyforpostroll event');\n    this.transitionTo(Postroll);\n  }\n  /*\n   * This is how midrolls start.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    var Midroll = States.getState('Midroll');\n    this.transitionTo(Midroll);\n  };\n\n  return ContentPlayback;\n}(ContentState$3);\n\nStates.registerState('ContentPlayback', ContentPlayback);\n\nvar ContentState$4 = States.getState('ContentState');\n/*\n * This state represents content playback when stitched ads are in play.\n */\n\nvar StitchedContentPlayback =\n/*#__PURE__*/\nfunction (_ContentState) {\n  _inheritsLoose(StitchedContentPlayback, _ContentState);\n\n  function StitchedContentPlayback() {\n    return _ContentState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  StitchedContentPlayback._getName = function _getName() {\n    return 'StitchedContentPlayback';\n  }\n  /*\n   * For state transitions to work correctly, initialization should\n   * happen here, not in a constructor.\n   */\n  ;\n\n  var _proto = StitchedContentPlayback.prototype;\n\n  _proto.init = function init() {\n    // Don't block calls to play in stitched ad players, ever.\n    this.player.ads._shouldBlockPlay = false;\n  }\n  /*\n   * Source change does not do anything for stitched ad players.\n   * contentchanged does not fire during ad breaks, so we don't need to\n   * worry about that.\n   */\n  ;\n\n  _proto.onContentChanged = function onContentChanged() {\n    this.player.ads.debug(\"Received contentchanged event (\" + this.constructor._getName() + \")\");\n  }\n  /*\n   * This is how stitched ads start.\n   */\n  ;\n\n  _proto.startLinearAdMode = function startLinearAdMode() {\n    var StitchedAdRoll = States.getState('StitchedAdRoll');\n    this.transitionTo(StitchedAdRoll);\n  };\n\n  return StitchedContentPlayback;\n}(ContentState$4);\n\nStates.registerState('StitchedContentPlayback', StitchedContentPlayback);\n\nvar AdState$4 = States.getState('AdState');\n\nvar StitchedAdRoll =\n/*#__PURE__*/\nfunction (_AdState) {\n  _inheritsLoose(StitchedAdRoll, _AdState);\n\n  function StitchedAdRoll() {\n    return _AdState.apply(this, arguments) || this;\n  }\n\n  /*\n   * Allows state name to be logged even after minification.\n   */\n  StitchedAdRoll._getName = function _getName() {\n    return 'StitchedAdRoll';\n  }\n  /*\n   * StitchedAdRoll breaks happen when the ad plugin calls startLinearAdMode,\n   * which can happen at any time during content playback.\n   */\n  ;\n\n  var _proto = StitchedAdRoll.prototype;\n\n  _proto.init = function init() {\n    this.waitingForAdBreak = false;\n    this.contentResuming = false;\n    this.player.ads.adType = 'stitched';\n    obj$1.start(this.player);\n  }\n  /*\n   * For stitched ads, there is no \"content resuming\" scenario, so a \"playing\"\n   * event is not relevant.\n   */\n  ;\n\n  _proto.onPlaying = function onPlaying() {}\n  /*\n   * For stitched ads, there is no \"content resuming\" scenario, so a\n   * \"contentresumed\" event is not relevant.\n   */\n  ;\n\n  _proto.onContentResumed = function onContentResumed() {}\n  /*\n   * When we see an \"adended\" event, it means that we are in a postroll that\n   * has ended (because the media ended and we are still in an ad state).\n   *\n   * In these cases, we transition back to content mode and fire ended.\n   */\n  ;\n\n  _proto.onAdEnded = function onAdEnded() {\n    this.endLinearAdMode();\n    this.player.trigger('ended');\n  }\n  /*\n   * StitchedAdRoll break is done.\n   */\n  ;\n\n  _proto.endLinearAdMode = function endLinearAdMode() {\n    var StitchedContentPlayback = States.getState('StitchedContentPlayback');\n    obj$1.end(this.player);\n    this.transitionTo(StitchedContentPlayback);\n  };\n\n  return StitchedAdRoll;\n}(AdState$4);\n\nStates.registerState('StitchedAdRoll', StitchedAdRoll);\n\n/*\nThis main plugin file is responsible for the public API and enabling the features\nthat live in in separate files.\n*/\nvar isMiddlewareMediatorSupported$1 = obj.isMiddlewareMediatorSupported;\nvar VIDEO_EVENTS = videojs.getTech('Html5').Events; // Default settings\n\nvar defaults = {\n  // Maximum amount of time in ms to wait to receive `adsready` from the ad\n  // implementation after play has been requested. Ad implementations are\n  // expected to load any dynamic libraries and make any requests to determine\n  // ad policies for a video during this time.\n  timeout: 5000,\n  // Maximum amount of time in ms to wait for the ad implementation to start\n  // linear ad mode after `readyforpreroll` has fired. This is in addition to\n  // the standard timeout.\n  prerollTimeout: undefined,\n  // Maximum amount of time in ms to wait for the ad implementation to start\n  // linear ad mode after `readyforpostroll` has fired.\n  postrollTimeout: undefined,\n  // When truthy, instructs the plugin to output additional information about\n  // plugin state to the video.js log. On most devices, the video.js log is\n  // the same as the developer console.\n  debug: false,\n  // Set this to true when using ads that are part of the content video\n  stitchedAds: false,\n  // Force content to be treated as live or not live\n  // if not defined, the code will try to infer if content is live,\n  // which can have limitations.\n  contentIsLive: undefined,\n  // If set to true, content will play muted behind ads on supported platforms. This is\n  // to support ads on video metadata cuepoints during a live stream. It also results in\n  // more precise resumes after ads during a live stream.\n  liveCuePoints: true,\n  // If set to true, callPlay middleware will not terminate the first play request in\n  // BeforePreroll if the player intends to autoplay. This allows the manual autoplay\n  // attempt made by video.js to resolve/reject naturally and trigger an 'autoplay-success'\n  // or 'autoplay-failure' event with which other plugins can interface.\n  allowVjsAutoplay: videojs.options.normalizeAutoplay || false\n};\n\nvar contribAdsPlugin = function contribAdsPlugin(options) {\n  var player = this; // eslint-disable-line consistent-this\n\n  var settings = videojs.mergeOptions(defaults, options); // Prefix all video element events during ad playback\n  // if the video element emits ad-related events directly,\n  // plugins that aren't ad-aware will break. prefixing allows\n  // plugins that wish to handle ad events to do so while\n  // avoiding the complexity for common usage\n\n  var videoEvents = []; // dedupe event names\n\n  VIDEO_EVENTS.concat(['firstplay', 'loadedalldata']).forEach(function (eventName) {\n    if (videoEvents.indexOf(eventName) === -1) {\n      videoEvents.push(eventName);\n    }\n  }); // Set up redispatching of player events\n\n  player.on(videoEvents, redispatch); // Set up features to block content playback while waiting for ads.\n  // Play middleware is only supported on later versions of video.js\n  // and on desktop currently(as the user-gesture requirement on mobile\n  // will disallow calling play once play blocking is lifted)\n  // The middleware must also be registered outside of the plugin,\n  // to avoid a middleware factory being created for each player\n\n  if (!isMiddlewareMediatorSupported$1()) {\n    initCancelContentPlay(player, settings.debug);\n  } // If we haven't seen a loadstart after 5 seconds, the plugin was not initialized\n  // correctly.\n\n\n  player.setTimeout(function () {\n    if (!player.ads._hasThereBeenALoadStartDuringPlayerLife && player.src() !== '') {\n      videojs.log.error('videojs-contrib-ads has not seen a loadstart event 5 seconds ' + 'after being initialized, but a source is present. This indicates that ' + 'videojs-contrib-ads was initialized too late. It must be initialized ' + 'immediately after video.js in the same tick. As a result, some ads will not ' + 'play and some media events will be incorrect. For more information, see ' + 'http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html');\n    }\n  }, 5000); // \"vjs-has-started\" should be present at the end of a video. This makes sure it's\n  // always there.\n\n  player.on('ended', function () {\n    if (!player.hasClass('vjs-has-started')) {\n      player.addClass('vjs-has-started');\n    }\n  }); // video.js removes the vjs-waiting class on timeupdate. We want\n  // to make sure this still happens during content restoration.\n\n  player.on('contenttimeupdate', function () {\n    player.removeClass('vjs-waiting');\n  }); // We now auto-play when an ad gets loaded if we're playing ads in the same video\n  // element as the content.\n  // The problem is that in IE11, we cannot play in addurationchange but in iOS8, we\n  // cannot play from adcanplay.\n  // This will prevent ad plugins from needing to do this themselves.\n\n  player.on(['addurationchange', 'adcanplay'], function () {\n    // We don't need to handle this for stitched ads because\n    // linear ads in such cases are stitched into the content.\n    if (player.ads.settings.stitchedAds) {\n      return;\n    } // Some techs may retrigger canplay after playback has begun.\n    // So we want to procceed only if playback hasn't started.\n\n\n    if (player.hasStarted()) {\n      return;\n    }\n\n    if (player.ads.snapshot && player.currentSrc() === player.ads.snapshot.currentSrc) {\n      return;\n    } // If an ad isn't playing, don't try to play an ad. This could result from prefixed\n    // events when the player is blocked by a preroll check, but there is no preroll.\n\n\n    if (!player.ads.inAdBreak()) {\n      return;\n    }\n\n    var playPromise = player.play();\n\n    if (playPromise && playPromise.catch) {\n      playPromise.catch(function (error) {\n        videojs.log.warn('Play promise rejected when playing ad', error);\n      });\n    }\n  });\n  player.on('nopreroll', function () {\n    player.ads.debug('Received nopreroll event');\n    player.ads.nopreroll_ = true;\n  });\n  player.on('nopostroll', function () {\n    player.ads.debug('Received nopostroll event');\n    player.ads.nopostroll_ = true;\n  }); // Restart the cancelContentPlay process.\n\n  player.on('playing', function () {\n    player.ads._cancelledPlay = false;\n    player.ads._pausedOnContentupdate = false;\n  }); // Keep track of whether a play event has happened\n\n  player.on('play', function () {\n    player.ads._playRequested = true;\n  });\n  player.one('loadstart', function () {\n    player.ads._hasThereBeenALoadStartDuringPlayerLife = true;\n  });\n  player.on('loadeddata', function () {\n    player.ads._hasThereBeenALoadedData = true;\n  });\n  player.on('loadedmetadata', function () {\n    player.ads._hasThereBeenALoadedMetaData = true;\n  }); // Replace the plugin constructor with the ad namespace\n\n  player.ads = getAds(player);\n  player.ads.settings = settings; // Set the stitched ads state. This needs to happen before the `_state` is\n  // initialized below - BeforePreroll needs to know whether contrib-ads is\n  // playing stitched ads or not.\n  // The setter is deprecated, so this does not use it.\n  // But first, cast to boolean.\n\n  settings.stitchedAds = !!settings.stitchedAds;\n\n  if (settings.stitchedAds) {\n    player.ads._state = new (States.getState('StitchedContentPlayback'))(player);\n  } else {\n    player.ads._state = new (States.getState('BeforePreroll'))(player);\n  }\n\n  player.ads._state.init(player);\n\n  player.ads.cueTextTracks = cueTextTracks;\n  player.ads.adMacroReplacement = adMacroReplacement.bind(player); // Start sending contentupdate and contentchanged events for this player\n\n  initializeContentupdate(player); // Global contentchanged handler for resetting plugin state\n\n  player.on('contentchanged', player.ads.reset); // A utility method for textTrackChangeHandler to define the conditions\n  // when text tracks should be disabled.\n  // Currently this includes:\n  //  - on iOS with native text tracks, during an ad playing\n\n  var shouldDisableTracks = function shouldDisableTracks() {\n    // If the platform matches iOS with native text tracks\n    // and this occurs during ad playback, we should disable tracks again.\n    // If shouldPlayContentBehindAd, no special handling is needed.\n    return !player.ads.shouldPlayContentBehindAd(player) && player.ads.inAdBreak() && player.tech_.featuresNativeTextTracks && videojs.browser.IS_IOS && // older versions of video.js did not use an emulated textTrackList\n    !Array.isArray(player.textTracks());\n  };\n  /*\n   * iOS Safari will change caption mode to 'showing' if a user previously\n   * turned captions on manually for that video source, so this TextTrackList\n   * 'change' event handler will re-disable them in case that occurs during ad playback\n   */\n\n\n  var textTrackChangeHandler = function textTrackChangeHandler() {\n    var textTrackList = player.textTracks();\n\n    if (shouldDisableTracks()) {\n      // We must double check all tracks\n      for (var i = 0; i < textTrackList.length; i++) {\n        var track = textTrackList[i];\n\n        if (track.mode === 'showing') {\n          track.mode = 'disabled';\n        }\n      }\n    }\n  }; // Add the listener to the text track list\n\n\n  player.ready(function () {\n    player.textTracks().addEventListener('change', textTrackChangeHandler);\n  }); // Event handling for the current state.\n\n  player.on(['play', 'playing', 'ended', 'adsready', 'adscanceled', 'adskip', 'adserror', 'adtimeout', 'adended', 'ads-ad-started', 'contentchanged', 'dispose', 'contentresumed', 'readyforpostroll', 'nopreroll', 'nopostroll'], function (e) {\n    player.ads._state.handleEvent(e.type);\n  }); // Clear timeouts and handlers when player is disposed\n\n  player.on('dispose', function () {\n    player.ads.reset();\n    player.textTracks().removeEventListener('change', textTrackChangeHandler);\n  }); // Listen to TCF changes\n\n  listenToTcf(); // Can be called for testing, or if the TCF CMP has loaded late\n\n  player.ads.listenToTcf = listenToTcf;\n}; // Expose the contrib-ads version before it is initialized. Will be replaced\n// after initialization in ads.js\n\n\ncontribAdsPlugin.VERSION = version; // Attempt to register the plugin, if we can.\n\nregister(contribAdsPlugin);\n\nexport default contribAdsPlugin;\n","import videojs from 'video.js';\n\n/**\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Wraps the video.js player for the plugin.\n *\n * @param {Object} player Video.js player instance.\n * @param {Object} adsPluginSettings Settings for the contrib-ads plugin.\n * @param {Controller} controller Reference to the parent controller.\n */\nvar PlayerWrapper = function PlayerWrapper(player, adsPluginSettings, controller) {\n  /**\n   * Instance of the video.js player.\n   */\n  this.vjsPlayer = player;\n\n  /**\n   * Plugin controller.\n   */\n  this.controller = controller;\n\n  /**\n   * Timer used to track content progress.\n   */\n  this.contentTrackingTimer = null;\n\n  /**\n   * True if our content video has completed, false otherwise.\n   */\n  this.contentComplete = false;\n\n  /**\n   * Handle to interval that repeatedly updates current time.\n   */\n  this.updateTimeIntervalHandle = null;\n\n  /**\n   * Interval (ms) to check for player resize for fluid support.\n   */\n  this.updateTimeInterval = 1000;\n\n  /**\n   * Handle to interval that repeatedly checks for seeking.\n   */\n  this.seekCheckIntervalHandle = null;\n\n  /**\n   * Interval (ms) on which to check if the user is seeking through the\n   * content.\n   */\n  this.seekCheckInterval = 1000;\n\n  /**\n   * Handle to interval that repeatedly checks for player resize.\n   */\n  this.resizeCheckIntervalHandle = null;\n\n  /**\n   * Interval (ms) to check for player resize for fluid support.\n   */\n  this.resizeCheckInterval = 250;\n\n  /**\n   * Threshold by which to judge user seeking. We check every 1000 ms to see\n   * if the user is seeking. In order for us to decide that they are *not*\n   * seeking, the content video playhead must only change by 900-1100 ms\n   * between checks. Any greater change and we assume the user is seeking\n   * through the video.\n   */\n  this.seekThreshold = 100;\n\n  /**\n   * Content ended listeners passed by the publisher to the plugin. Publishers\n   * should allow the plugin to handle content ended to ensure proper support\n   * of custom ad playback.\n   */\n  this.contentEndedListeners = [];\n\n  /**\n   * Stores the content source so we can re-populate it manually after a\n   * post-roll on iOS.\n   */\n  this.contentSource = '';\n\n  /**\n   * Stores the content source type so we can re-populate it manually after a\n   * post-roll.\n   */\n  this.contentSourceType = '';\n\n  /**\n   * Stores data for the content playhead tracker.\n   */\n  this.contentPlayheadTracker = {\n    currentTime: 0,\n    previousTime: 0,\n    seeking: false,\n    duration: 0\n  };\n\n  /**\n   * Player dimensions. Used in our resize check.\n   */\n  this.vjsPlayerDimensions = {\n    width: this.getPlayerWidth(),\n    height: this.getPlayerHeight()\n  };\n\n  /**\n   * Video.js control bar.\n   */\n  this.vjsControls = this.vjsPlayer.getChild('controlBar');\n\n  /**\n   * Vanilla HTML5 video player underneath the video.js player.\n   */\n  this.h5Player = null;\n\n  this.vjsPlayer.one('play', this.setUpPlayerIntervals.bind(this));\n  this.boundContentEndedListener = this.localContentEndedListener.bind(this);\n  this.vjsPlayer.on('contentended', this.boundContentEndedListener);\n  this.vjsPlayer.on('dispose', this.playerDisposedListener.bind(this));\n  this.vjsPlayer.on('readyforpreroll', this.onReadyForPreroll.bind(this));\n  this.vjsPlayer.on('adtimeout', this.onAdTimeout.bind(this));\n  this.vjsPlayer.ready(this.onPlayerReady.bind(this));\n\n  if (this.controller.getSettings().requestMode === 'onPlay') {\n    this.vjsPlayer.one('play', this.controller.requestAds.bind(this.controller));\n  }\n\n  this.vjsPlayer.ads(adsPluginSettings);\n};\n\n/**\n * Set up the intervals we use on the player.\n */\nPlayerWrapper.prototype.setUpPlayerIntervals = function () {\n  this.updateTimeIntervalHandle = setInterval(this.updateCurrentTime.bind(this), this.updateTimeInterval);\n  this.seekCheckIntervalHandle = setInterval(this.checkForSeeking.bind(this), this.seekCheckInterval);\n  this.resizeCheckIntervalHandle = setInterval(this.checkForResize.bind(this), this.resizeCheckInterval);\n};\n\n/**\n * Updates the current time of the video\n */\nPlayerWrapper.prototype.updateCurrentTime = function () {\n  if (!this.contentPlayheadTracker.seeking) {\n    this.contentPlayheadTracker.currentTime = this.vjsPlayer.currentTime();\n  }\n};\n\n/**\n * Detects when the user is seeking through a video.\n * This is used to prevent mid-rolls from playing while a user is seeking.\n *\n * There *is* a seeking property of the HTML5 video element, but it's not\n * properly implemented on all platforms (e.g. mobile safari), so we have to\n * check ourselves to be sure.\n */\nPlayerWrapper.prototype.checkForSeeking = function () {\n  var tempCurrentTime = this.vjsPlayer.currentTime();\n  var diff = (tempCurrentTime - this.contentPlayheadTracker.previousTime) * 1000;\n  if (Math.abs(diff) > this.seekCheckInterval + this.seekThreshold) {\n    this.contentPlayheadTracker.seeking = true;\n  } else {\n    this.contentPlayheadTracker.seeking = false;\n  }\n  this.contentPlayheadTracker.previousTime = this.vjsPlayer.currentTime();\n};\n\n/**\n * Detects when the player is resized (for fluid support) and resizes the\n * ads manager to match.\n */\nPlayerWrapper.prototype.checkForResize = function () {\n  var currentWidth = this.getPlayerWidth();\n  var currentHeight = this.getPlayerHeight();\n\n  if (currentWidth != this.vjsPlayerDimensions.width || currentHeight != this.vjsPlayerDimensions.height) {\n    this.vjsPlayerDimensions.width = currentWidth;\n    this.vjsPlayerDimensions.height = currentHeight;\n    this.controller.onPlayerResize(currentWidth, currentHeight);\n  }\n};\n\n/**\n * Local content ended listener for contentComplete.\n */\nPlayerWrapper.prototype.localContentEndedListener = function () {\n  if (!this.contentComplete) {\n    this.contentComplete = true;\n    this.controller.onContentComplete();\n  }\n\n  for (var index in this.contentEndedListeners) {\n    if (typeof this.contentEndedListeners[index] === 'function') {\n      this.contentEndedListeners[index]();\n    }\n  }\n\n  clearInterval(this.updateTimeIntervalHandle);\n  clearInterval(this.seekCheckIntervalHandle);\n  clearInterval(this.resizeCheckIntervalHandle);\n  if (this.vjsPlayer.el()) {\n    this.vjsPlayer.one('play', this.setUpPlayerIntervals.bind(this));\n  }\n};\n\n/**\n * Called when it's time to play a post-roll but we don't have one to play.\n */\nPlayerWrapper.prototype.onNoPostroll = function () {\n  this.vjsPlayer.trigger('nopostroll');\n};\n\n/**\n * Detects when the video.js player has been disposed.\n */\nPlayerWrapper.prototype.playerDisposedListener = function () {\n  this.contentEndedListeners = [];\n  this.controller.onPlayerDisposed();\n\n  this.contentComplete = true;\n  this.vjsPlayer.off('contentended', this.boundContentEndedListener);\n\n  // Bug fix: https://github.com/googleads/videojs-ima/issues/306\n  if (this.vjsPlayer.ads.adTimeoutTimeout) {\n    clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);\n  }\n\n  var intervalsToClear = [this.updateTimeIntervalHandle, this.seekCheckIntervalHandle, this.resizeCheckIntervalHandle];\n  for (var index in intervalsToClear) {\n    if (intervalsToClear[index]) {\n      clearInterval(intervalsToClear[index]);\n    }\n  }\n};\n\n/**\n * Start ad playback, or content video playback in the absence of a\n * pre-roll.\n */\nPlayerWrapper.prototype.onReadyForPreroll = function () {\n  this.controller.onPlayerReadyForPreroll();\n};\n\n/**\n * Detects if the ad has timed out.\n */\nPlayerWrapper.prototype.onAdTimeout = function () {\n  this.controller.onAdTimeout();\n};\n\n/**\n * Called when the player fires its 'ready' event.\n */\nPlayerWrapper.prototype.onPlayerReady = function () {\n  this.h5Player = document.getElementById(this.getPlayerId()).getElementsByClassName('vjs-tech')[0];\n\n  // Detect inline options\n  if (this.h5Player.hasAttribute('autoplay')) {\n    this.controller.setSetting('adWillAutoPlay', true);\n  }\n\n  // Sync ad volume with player volume.\n  this.onVolumeChange();\n  this.vjsPlayer.on('fullscreenchange', this.onFullscreenChange.bind(this));\n  this.vjsPlayer.on('volumechange', this.onVolumeChange.bind(this));\n\n  this.controller.onPlayerReady();\n};\n\n/**\n * Listens for the video.js player to change its fullscreen status. This\n * keeps the fullscreen-ness of the AdContainer in sync with the player.\n */\nPlayerWrapper.prototype.onFullscreenChange = function () {\n  if (this.vjsPlayer.isFullscreen()) {\n    this.controller.onPlayerEnterFullscreen();\n  } else {\n    this.controller.onPlayerExitFullscreen();\n  }\n};\n\n/**\n * Listens for the video.js player to change its volume. This keeps the ad\n * volume in sync with the content volume if the volume of the player is\n * changed while content is playing.\n */\nPlayerWrapper.prototype.onVolumeChange = function () {\n  var newVolume = this.vjsPlayer.muted() ? 0 : this.vjsPlayer.volume();\n  this.controller.onPlayerVolumeChanged(newVolume);\n};\n\n/**\n * Inject the ad container div into the DOM.\n *\n * @param{HTMLElement} adContainerDiv The ad container div.\n */\nPlayerWrapper.prototype.injectAdContainerDiv = function (adContainerDiv) {\n  this.vjsControls.el().parentNode.appendChild(adContainerDiv);\n};\n\n/**\n * @return {Object} The content player.\n */\nPlayerWrapper.prototype.getContentPlayer = function () {\n  return this.h5Player;\n};\n\n/**\n * @return {number} The volume, 0-1.\n */\nPlayerWrapper.prototype.getVolume = function () {\n  return this.vjsPlayer.muted() ? 0 : this.vjsPlayer.volume();\n};\n\n/**\n * Set the volume of the player. 0-1.\n *\n * @param {number} volume The new volume.\n */\nPlayerWrapper.prototype.setVolume = function (volume) {\n  this.vjsPlayer.volume(volume);\n  if (volume == 0) {\n    this.vjsPlayer.muted(true);\n  } else {\n    this.vjsPlayer.muted(false);\n  }\n};\n\n/**\n * Ummute the player.\n */\nPlayerWrapper.prototype.unmute = function () {\n  this.vjsPlayer.muted(false);\n};\n\n/**\n * Mute the player.\n */\nPlayerWrapper.prototype.mute = function () {\n  this.vjsPlayer.muted(true);\n};\n\n/**\n * Play the video.\n */\nPlayerWrapper.prototype.play = function () {\n  this.vjsPlayer.play();\n};\n\n/**\n * Toggles playback of the video.\n */\nPlayerWrapper.prototype.togglePlayback = function () {\n  if (this.vjsPlayer.paused()) {\n    this.vjsPlayer.play();\n  } else {\n    this.vjsPlayer.pause();\n  }\n};\n\n/**\n * Get the player width.\n *\n * @return {number} The player's width.\n */\nPlayerWrapper.prototype.getPlayerWidth = function () {\n  var width = (getComputedStyle(this.vjsPlayer.el()) || {}).width;\n\n  if (!width || parseFloat(width) === 0) {\n    width = (this.vjsPlayer.el().getBoundingClientRect() || {}).width;\n  }\n\n  return parseFloat(width) || this.vjsPlayer.width();\n};\n\n/**\n * Get the player height.\n *\n * @return {number} The player's height.\n */\nPlayerWrapper.prototype.getPlayerHeight = function () {\n  var height = (getComputedStyle(this.vjsPlayer.el()) || {}).height;\n\n  if (!height || parseFloat(height) === 0) {\n    height = (this.vjsPlayer.el().getBoundingClientRect() || {}).height;\n  }\n\n  return parseFloat(height) || this.vjsPlayer.height();\n};\n\n/**\n * @return {Object} The vjs player's options object.\n */\nPlayerWrapper.prototype.getPlayerOptions = function () {\n  return this.vjsPlayer.options_;\n};\n\n/**\n * Returns the instance of the player id.\n * @return {string} The player id.\n */\nPlayerWrapper.prototype.getPlayerId = function () {\n  return this.vjsPlayer.id();\n};\n\n/**\n * Toggle fullscreen state.\n */\nPlayerWrapper.prototype.toggleFullscreen = function () {\n  if (this.vjsPlayer.isFullscreen()) {\n    this.vjsPlayer.exitFullscreen();\n  } else {\n    this.vjsPlayer.requestFullscreen();\n  }\n};\n\n/**\n * Returns the content playhead tracker.\n *\n * @return {Object} The content playhead tracker.\n */\nPlayerWrapper.prototype.getContentPlayheadTracker = function () {\n  return this.contentPlayheadTracker;\n};\n\n/**\n * Handles ad errors.\n *\n * @param {Object} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nPlayerWrapper.prototype.onAdError = function (adErrorEvent) {\n  this.vjsControls.show();\n  var errorMessage = adErrorEvent.getError !== undefined ? adErrorEvent.getError() : adErrorEvent.stack;\n  this.vjsPlayer.trigger({ type: 'adserror', data: {\n      AdError: errorMessage,\n      AdErrorEvent: adErrorEvent\n    } });\n};\n\n/**\n * Handles ad log messages.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the IMA SDK.\n */\nPlayerWrapper.prototype.onAdLog = function (adEvent) {\n  var adData = adEvent.getAdData();\n  var errorMessage = adData['adError'] !== undefined ? adData['adError'].getMessage() : undefined;\n  this.vjsPlayer.trigger({ type: 'adslog', data: {\n      AdError: errorMessage,\n      AdEvent: adEvent\n    } });\n};\n\n/**\n * Handles ad break starting.\n */\nPlayerWrapper.prototype.onAdBreakStart = function () {\n  this.contentSource = this.vjsPlayer.currentSrc();\n  this.contentSourceType = this.vjsPlayer.currentType();\n  this.vjsPlayer.off('contentended', this.boundContentEndedListener);\n  this.vjsPlayer.ads.startLinearAdMode();\n  this.vjsControls.hide();\n  this.vjsPlayer.pause();\n};\n\n/**\n * Handles ad break ending.\n */\nPlayerWrapper.prototype.onAdBreakEnd = function () {\n  this.vjsPlayer.on('contentended', this.boundContentEndedListener);\n  if (this.vjsPlayer.ads.inAdBreak()) {\n    this.vjsPlayer.ads.endLinearAdMode();\n  }\n  this.vjsControls.show();\n};\n\n/**\n * Handles an individual ad start.\n */\nPlayerWrapper.prototype.onAdStart = function () {\n  this.vjsPlayer.trigger('ads-ad-started');\n};\n\n/**\n * Handles when all ads have finished playing.\n */\nPlayerWrapper.prototype.onAllAdsCompleted = function () {\n  if (this.contentComplete == true) {\n    // The null check on this.contentSource was added to fix\n    // an error when the post-roll was an empty VAST tag.\n    if (this.contentSource && this.vjsPlayer.currentSrc() != this.contentSource) {\n      this.vjsPlayer.src({\n        src: this.contentSource,\n        type: this.contentSourceType\n      });\n    }\n    this.controller.onContentAndAdsCompleted();\n  }\n};\n\n/**\n * Triggers adsready for contrib-ads.\n */\nPlayerWrapper.prototype.onAdsReady = function () {\n  this.vjsPlayer.trigger('adsready');\n};\n\n/**\n * Changes the player source.\n * @param {?string} contentSrc The URI for the content to be played. Leave\n *     blank to use the existing content.\n */\nPlayerWrapper.prototype.changeSource = function (contentSrc) {\n  // Only try to pause the player when initialised with a source already\n  if (this.vjsPlayer.currentSrc()) {\n    this.vjsPlayer.currentTime(0);\n    this.vjsPlayer.pause();\n  }\n  if (contentSrc) {\n    this.vjsPlayer.src(contentSrc);\n  }\n  this.vjsPlayer.one('loadedmetadata', this.seekContentToZero.bind(this));\n};\n\n/**\n * Seeks content to 00:00:00. This is used as an event handler for the\n * loadedmetadata event, since seeking is not possible until that event has\n * fired.\n */\nPlayerWrapper.prototype.seekContentToZero = function () {\n  this.vjsPlayer.currentTime(0);\n};\n\n/**\n * Triggers an event on the VJS player\n * @param  {string} name The event name.\n * @param  {Object} data The event data.\n */\nPlayerWrapper.prototype.triggerPlayerEvent = function (name, data) {\n  this.vjsPlayer.trigger(name, data);\n};\n\n/**\n * Listener JSDoc for ESLint. This listener can be passed to\n * addContentEndedListener.\n * @callback listener\n */\n\n/**\n * Adds a listener for the 'contentended' event of the video player. This should\n * be used instead of setting an 'contentended' listener directly to ensure that\n * the ima can do proper cleanup of the SDK before other event listeners are\n * called.\n * @param {listener} listener The listener to be called when content\n *     completes.\n */\nPlayerWrapper.prototype.addContentEndedListener = function (listener) {\n  this.contentEndedListeners.push(listener);\n};\n\n/**\n * Reset the player.\n */\nPlayerWrapper.prototype.reset = function () {\n  // Attempts to remove the contentEndedListener before adding it.\n  // This is to prevent an error where an erroring video caused multiple\n  // contentEndedListeners to be added.\n  this.vjsPlayer.off('contentended', this.boundContentEndedListener);\n\n  this.vjsPlayer.on('contentended', this.boundContentEndedListener);\n  this.vjsControls.show();\n  if (this.vjsPlayer.ads.inAdBreak()) {\n    this.vjsPlayer.ads.endLinearAdMode();\n  }\n  // Reset the content time we give the SDK. Fixes an issue where requesting\n  // VMAP followed by VMAP would play the second mid-rolls as pre-rolls if\n  // the first playthrough of the video passed the second response's\n  // mid-roll time.\n  this.contentPlayheadTracker.currentTime = 0;\n  this.contentComplete = false;\n};\n\n/**\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Ad UI implementation.\n *\n * @param {Controller} controller Plugin controller.\n * @constructor\n * @struct\n * @final\n */\nvar AdUi = function AdUi(controller) {\n  /**\n   * Plugin controller.\n   */\n  this.controller = controller;\n\n  /**\n   * Div used as an ad container.\n   */\n  this.adContainerDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad controls.\n   */\n  this.controlsDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad countdown timer.\n   */\n  this.countdownDiv = document.createElement('div');\n\n  /**\n   * Div used to display add seek bar.\n   */\n  this.seekBarDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad progress (in seek bar).\n   */\n  this.progressDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad play/pause button.\n   */\n  this.playPauseDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad mute button.\n   */\n  this.muteDiv = document.createElement('div');\n\n  /**\n   * Div used by the volume slider.\n   */\n  this.sliderDiv = document.createElement('div');\n\n  /**\n   * Volume slider level visuals\n   */\n  this.sliderLevelDiv = document.createElement('div');\n\n  /**\n   * Div used to display ad fullscreen button.\n   */\n  this.fullscreenDiv = document.createElement('div');\n\n  /**\n   * Bound event handler for onMouseUp.\n   */\n  this.boundOnMouseUp = this.onMouseUp.bind(this);\n\n  /**\n   * Bound event handler for onMouseMove.\n   */\n  this.boundOnMouseMove = this.onMouseMove.bind(this);\n\n  /**\n   * Stores data for the ad playhead tracker.\n   */\n  this.adPlayheadTracker = {\n    'currentTime': 0,\n    'duration': 0,\n    'isPod': false,\n    'adPosition': 0,\n    'totalAds': 0\n  };\n\n  /**\n   * Used to prefix videojs ima controls.\n   */\n  this.controlPrefix = this.controller.getPlayerId() + '_';\n\n  /**\n   * Boolean flag to show or hide the ad countdown timer.\n   */\n  this.showCountdown = true;\n  if (this.controller.getSettings().showCountdown === false) {\n    this.showCountdown = false;\n  }\n\n  /**\n   * Boolean flag if the current ad is nonlinear.\n   */\n  this.isAdNonlinear = false;\n\n  this.createAdContainer();\n};\n\n/**\n * Creates the ad container.\n */\nAdUi.prototype.createAdContainer = function () {\n  this.assignControlAttributes(this.adContainerDiv, 'ima-ad-container');\n  this.adContainerDiv.style.position = 'absolute';\n  this.adContainerDiv.style.zIndex = 1111;\n  this.adContainerDiv.addEventListener('mouseenter', this.showAdControls.bind(this), false);\n  this.adContainerDiv.addEventListener('mouseleave', this.hideAdControls.bind(this), false);\n  this.adContainerDiv.addEventListener('click', this.onAdContainerClick.bind(this), false);\n  this.createControls();\n  this.controller.injectAdContainerDiv(this.adContainerDiv);\n};\n\n/**\n * Create the controls.\n */\nAdUi.prototype.createControls = function () {\n  this.assignControlAttributes(this.controlsDiv, 'ima-controls-div');\n  this.controlsDiv.style.width = '100%';\n\n  if (!this.controller.getIsMobile()) {\n    this.assignControlAttributes(this.countdownDiv, 'ima-countdown-div');\n    this.countdownDiv.innerHTML = this.controller.getSettings().adLabel;\n    this.countdownDiv.style.display = this.showCountdown ? 'block' : 'none';\n  } else {\n    this.countdownDiv.style.display = 'none';\n  }\n\n  this.assignControlAttributes(this.seekBarDiv, 'ima-seek-bar-div');\n  this.seekBarDiv.style.width = '100%';\n\n  this.assignControlAttributes(this.progressDiv, 'ima-progress-div');\n\n  this.assignControlAttributes(this.playPauseDiv, 'ima-play-pause-div');\n  this.addClass(this.playPauseDiv, 'ima-playing');\n  this.playPauseDiv.addEventListener('click', this.onAdPlayPauseClick.bind(this), false);\n\n  this.assignControlAttributes(this.muteDiv, 'ima-mute-div');\n  this.addClass(this.muteDiv, 'ima-non-muted');\n  this.muteDiv.addEventListener('click', this.onAdMuteClick.bind(this), false);\n\n  this.assignControlAttributes(this.sliderDiv, 'ima-slider-div');\n  this.sliderDiv.addEventListener('mousedown', this.onAdVolumeSliderMouseDown.bind(this), false);\n\n  // Hide volume slider controls on iOS as they aren't supported.\n  if (this.controller.getIsIos()) {\n    this.sliderDiv.style.display = 'none';\n  }\n\n  this.assignControlAttributes(this.sliderLevelDiv, 'ima-slider-level-div');\n\n  this.assignControlAttributes(this.fullscreenDiv, 'ima-fullscreen-div');\n  this.addClass(this.fullscreenDiv, 'ima-non-fullscreen');\n  this.fullscreenDiv.addEventListener('click', this.onAdFullscreenClick.bind(this), false);\n\n  this.adContainerDiv.appendChild(this.controlsDiv);\n  this.controlsDiv.appendChild(this.countdownDiv);\n  this.controlsDiv.appendChild(this.seekBarDiv);\n  this.controlsDiv.appendChild(this.playPauseDiv);\n  this.controlsDiv.appendChild(this.muteDiv);\n  this.controlsDiv.appendChild(this.sliderDiv);\n  this.controlsDiv.appendChild(this.fullscreenDiv);\n  this.seekBarDiv.appendChild(this.progressDiv);\n  this.sliderDiv.appendChild(this.sliderLevelDiv);\n};\n\n/**\n * Listener for clicks on the play/pause button during ad playback.\n */\nAdUi.prototype.onAdPlayPauseClick = function () {\n  this.controller.onAdPlayPauseClick();\n};\n\n/**\n * Listener for clicks on the play/pause button during ad playback.\n */\nAdUi.prototype.onAdMuteClick = function () {\n  this.controller.onAdMuteClick();\n};\n\n/**\n * Listener for clicks on the fullscreen button during ad playback.\n */\nAdUi.prototype.onAdFullscreenClick = function () {\n  this.controller.toggleFullscreen();\n};\n\n/**\n * Show pause and hide play button\n */\nAdUi.prototype.onAdsPaused = function () {\n  this.controller.sdkImpl.adPlaying = false;\n  this.addClass(this.playPauseDiv, 'ima-paused');\n  this.removeClass(this.playPauseDiv, 'ima-playing');\n  this.showAdControls();\n};\n\n/**\n * Show pause and hide play button\n */\nAdUi.prototype.onAdsResumed = function () {\n  this.onAdsPlaying();\n  this.showAdControls();\n};\n\n/**\n * Show play and hide pause button\n */\nAdUi.prototype.onAdsPlaying = function () {\n  this.controller.sdkImpl.adPlaying = true;\n  this.addClass(this.playPauseDiv, 'ima-playing');\n  this.removeClass(this.playPauseDiv, 'ima-paused');\n};\n\n/**\n * Takes data from the controller to update the UI.\n *\n * @param {number} currentTime Current time of the ad.\n * @param {number} remainingTime Remaining time of the ad.\n * @param {number} duration Duration of the ad.\n * @param {number} adPosition Index of the ad in the pod.\n * @param {number} totalAds Total number of ads in the pod.\n */\nAdUi.prototype.updateAdUi = function (currentTime, remainingTime, duration, adPosition, totalAds) {\n  // Update countdown timer data\n  var remainingMinutes = Math.floor(remainingTime / 60);\n  var remainingSeconds = Math.floor(remainingTime % 60);\n  if (remainingSeconds.toString().length < 2) {\n    remainingSeconds = '0' + remainingSeconds;\n  }\n  var podCount = ': ';\n  if (totalAds > 1) {\n    podCount = ' (' + adPosition + ' ' + this.controller.getSettings().adLabelNofN + ' ' + totalAds + '): ';\n  }\n  this.countdownDiv.innerHTML = this.controller.getSettings().adLabel + podCount + remainingMinutes + ':' + remainingSeconds;\n\n  // Update UI\n  var playProgressRatio = currentTime / duration;\n  var playProgressPercent = playProgressRatio * 100;\n  this.progressDiv.style.width = playProgressPercent + '%';\n};\n\n/**\n * Handles UI changes when the ad is unmuted.\n */\nAdUi.prototype.unmute = function () {\n  this.addClass(this.muteDiv, 'ima-non-muted');\n  this.removeClass(this.muteDiv, 'ima-muted');\n  this.sliderLevelDiv.style.width = this.controller.getPlayerVolume() * 100 + '%';\n};\n\n/**\n * Handles UI changes when the ad is muted.\n */\nAdUi.prototype.mute = function () {\n  this.addClass(this.muteDiv, 'ima-muted');\n  this.removeClass(this.muteDiv, 'ima-non-muted');\n  this.sliderLevelDiv.style.width = '0%';\n};\n\n/*\n * Listener for mouse down events during ad playback. Used for volume.\n */\nAdUi.prototype.onAdVolumeSliderMouseDown = function () {\n  document.addEventListener('mouseup', this.boundOnMouseUp, false);\n  document.addEventListener('mousemove', this.boundOnMouseMove, false);\n};\n\n/*\n * Mouse movement listener used for volume slider.\n */\nAdUi.prototype.onMouseMove = function (event) {\n  this.changeVolume(event);\n};\n\n/*\n * Mouse release listener used for volume slider.\n */\nAdUi.prototype.onMouseUp = function (event) {\n  this.changeVolume(event);\n  document.removeEventListener('mouseup', this.boundOnMouseUp);\n  document.removeEventListener('mousemove', this.boundOnMouseMove);\n};\n\n/*\n * Utility function to set volume and associated UI\n */\nAdUi.prototype.changeVolume = function (event) {\n  var percent = (event.clientX - this.sliderDiv.getBoundingClientRect().left) / this.sliderDiv.offsetWidth;\n  percent *= 100;\n  // Bounds value 0-100 if mouse is outside slider region.\n  percent = Math.min(Math.max(percent, 0), 100);\n  this.sliderLevelDiv.style.width = percent + '%';\n  if (this.percent == 0) {\n    this.addClass(this.muteDiv, 'ima-muted');\n    this.removeClass(this.muteDiv, 'ima-non-muted');\n  } else {\n    this.addClass(this.muteDiv, 'ima-non-muted');\n    this.removeClass(this.muteDiv, 'ima-muted');\n  }\n  this.controller.setVolume(percent / 100); // 0-1\n};\n\n/**\n * Show the ad container.\n */\nAdUi.prototype.showAdContainer = function () {\n  this.adContainerDiv.style.display = 'block';\n};\n\n/**\n * Hide the ad container\n */\nAdUi.prototype.hideAdContainer = function () {\n  this.adContainerDiv.style.display = 'none';\n};\n\n/**\n * Handles clicks on the ad container\n */\nAdUi.prototype.onAdContainerClick = function () {\n  if (this.isAdNonlinear) {\n    this.controller.togglePlayback();\n  }\n};\n\n/**\n * Resets the state of the ad ui.\n */\nAdUi.prototype.reset = function () {\n  this.hideAdContainer();\n};\n\n/**\n * Handles ad errors.\n */\nAdUi.prototype.onAdError = function () {\n  this.hideAdContainer();\n};\n\n/**\n * Handles ad break starting.\n *\n * @param {Object} adEvent The event fired by the IMA SDK.\n */\nAdUi.prototype.onAdBreakStart = function (adEvent) {\n  this.showAdContainer();\n\n  var contentType = adEvent.getAd().getContentType();\n  if (contentType === 'application/javascript' && !this.controller.getSettings().showControlsForJSAds) {\n    this.controlsDiv.style.display = 'none';\n  } else {\n    this.controlsDiv.style.display = 'block';\n  }\n  this.onAdsPlaying();\n  // Start with the ad controls minimized.\n  this.hideAdControls();\n};\n\n/**\n * Handles ad break ending.\n */\nAdUi.prototype.onAdBreakEnd = function () {\n  var currentAd = this.controller.getCurrentAd();\n  if (currentAd == null || // hide for post-roll only playlist\n  currentAd.isLinear()) {\n    // don't hide for non-linear ads\n    this.hideAdContainer();\n  }\n  this.controlsDiv.style.display = 'none';\n  this.countdownDiv.innerHTML = '';\n};\n\n/**\n * Handles when all ads have finished playing.\n */\nAdUi.prototype.onAllAdsCompleted = function () {\n  this.hideAdContainer();\n};\n\n/**\n * Handles when a linear ad starts.\n */\nAdUi.prototype.onLinearAdStart = function () {\n  // Don't bump container when controls are shown\n  this.removeClass(this.adContainerDiv, 'bumpable-ima-ad-container');\n  this.isAdNonlinear = false;\n};\n\n/**\n * Handles when a non-linear ad starts.\n */\nAdUi.prototype.onNonLinearAdLoad = function () {\n  // For non-linear ads that show after a linear ad. For linear ads, we show the\n  // ad container in onAdBreakStart to prevent blinking in pods.\n  this.adContainerDiv.style.display = 'block';\n  // Bump container when controls are shown\n  this.addClass(this.adContainerDiv, 'bumpable-ima-ad-container');\n  this.isAdNonlinear = true;\n};\n\nAdUi.prototype.onPlayerEnterFullscreen = function () {\n  this.addClass(this.fullscreenDiv, 'ima-fullscreen');\n  this.removeClass(this.fullscreenDiv, 'ima-non-fullscreen');\n};\n\nAdUi.prototype.onPlayerExitFullscreen = function () {\n  this.addClass(this.fullscreenDiv, 'ima-non-fullscreen');\n  this.removeClass(this.fullscreenDiv, 'ima-fullscreen');\n};\n\n/**\n * Called when the player volume changes.\n *\n * @param {number} volume The new player volume.\n */\nAdUi.prototype.onPlayerVolumeChanged = function (volume) {\n  if (volume == 0) {\n    this.addClass(this.muteDiv, 'ima-muted');\n    this.removeClass(this.muteDiv, 'ima-non-muted');\n    this.sliderLevelDiv.style.width = '0%';\n  } else {\n    this.addClass(this.muteDiv, 'ima-non-muted');\n    this.removeClass(this.muteDiv, 'ima-muted');\n    this.sliderLevelDiv.style.width = volume * 100 + '%';\n  }\n};\n\n/**\n * Shows ad controls on mouseover.\n */\nAdUi.prototype.showAdControls = function () {\n  var _controller$getSettin = this.controller.getSettings(),\n      disableAdControls = _controller$getSettin.disableAdControls;\n\n  if (!disableAdControls) {\n    this.addClass(this.controlsDiv, 'ima-controls-div-showing');\n  }\n};\n\n/**\n * Hide the ad controls.\n */\nAdUi.prototype.hideAdControls = function () {\n  this.removeClass(this.controlsDiv, 'ima-controls-div-showing');\n};\n\n/**\n * Assigns the unique id and class names to the given element as well as the\n * style class.\n * @param {HTMLElement} element Element that needs the controlName assigned.\n * @param {string} controlName Control name to assign.\n */\nAdUi.prototype.assignControlAttributes = function (element, controlName) {\n  element.id = this.controlPrefix + controlName;\n  element.className = this.controlPrefix + controlName + ' ' + controlName;\n};\n\n/**\n * Returns a regular expression to test a string for the given className.\n *\n * @param {string} className The name of the class.\n * @return {RegExp} The regular expression used to test for that class.\n */\nAdUi.prototype.getClassRegexp = function (className) {\n  // Matches on\n  // (beginning of string OR NOT word char)\n  // classname\n  // (negative lookahead word char OR end of string)\n  return new RegExp('(^|[^A-Za-z-])' + className + '((?![A-Za-z-])|$)', 'gi');\n};\n\n/**\n * Returns whether or not the provided element has the provied class in its\n * className.\n * @param {HTMLElement} element Element to tes.t\n * @param {string} className Class to look for.\n * @return {boolean} True if element has className in class list. False\n *     otherwise.\n */\nAdUi.prototype.elementHasClass = function (element, className) {\n  var classRegexp = this.getClassRegexp(className);\n  return classRegexp.test(element.className);\n};\n\n/**\n * Adds a class to the given element if it doesn't already have the class\n * @param {HTMLElement} element Element to which the class will be added.\n * @param {string} classToAdd Class to add.\n */\nAdUi.prototype.addClass = function (element, classToAdd) {\n  element.className = element.className.trim() + ' ' + classToAdd;\n};\n\n/**\n * Removes a class from the given element if it has the given class\n *\n * @param {HTMLElement} element Element from which the class will be removed.\n * @param {string} classToRemove Class to remove.\n */\nAdUi.prototype.removeClass = function (element, classToRemove) {\n  var classRegexp = this.getClassRegexp(classToRemove);\n  element.className = element.className.trim().replace(classRegexp, '');\n};\n\n/**\n * @return {HTMLElement} The div for the ad container.\n */\nAdUi.prototype.getAdContainerDiv = function () {\n  return this.adContainerDiv;\n};\n\n/**\n * Changes the flag to show or hide the ad countdown timer.\n *\n * @param {boolean} showCountdownIn Show or hide the countdown timer.\n */\nAdUi.prototype.setShowCountdown = function (showCountdownIn) {\n  this.showCountdown = showCountdownIn;\n  this.countdownDiv.style.display = this.showCountdown ? 'block' : 'none';\n};\n\nvar name = \"videojs-ima\";\nvar version = \"2.1.0\";\nvar license = \"Apache-2.0\";\nvar main = \"./dist/videojs.ima.js\";\nvar module$1 = \"./dist/videojs.ima.es.js\";\nvar author = { \"name\": \"Google Inc.\" };\nvar engines = { \"node\": \">=0.8.0\" };\nvar scripts = { \"contBuild\": \"watch 'npm run rollup:max' src\", \"predevServer\": \"echo \\\"Starting up server on localhost:8000.\\\"\", \"devServer\": \"npm-run-all -p testServer contBuild\", \"lint\": \"eslint \\\"src/**/*.js\\\"\", \"rollup\": \"npm-run-all rollup:*\", \"rollup:max\": \"rollup -c configs/rollup.config.js\", \"rollup:es\": \"rollup -c configs/rollup.config.es.js\", \"rollup:min\": \"rollup -c configs/rollup.config.min.js\", \"pretest\": \"npm run rollup\", \"start\": \"npm run devServer\", \"test\": \"npm-run-all test:*\", \"test:vjs6\": \"npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver\", \"test:vjs7\": \"npm install video.js@7 --no-save && npm-run-all -p -r testServer webdriver\", \"testServer\": \"http-server --cors -p 8000 --silent\", \"preversion\": \"node scripts/preversion.js && npm run lint && npm test\", \"version\": \"node scripts/version.js\", \"postversion\": \"node scripts/postversion.js\", \"webdriver\": \"mocha test/webdriver/*.js --no-timeouts\" };\nvar repository = { \"type\": \"git\", \"url\": \"https://github.com/googleads/videojs-ima\" };\nvar files = [\"CHANGELOG.md\", \"LICENSE\", \"README.md\", \"dist/\", \"src/\"];\nvar peerDependencies = { \"video.js\": \"^5.19.2 || ^6 || ^7\" };\nvar dependencies = { \"@hapi/cryptiles\": \"^5.1.0\", \"can-autoplay\": \"^3.0.2\", \"extend\": \">=3.0.2\", \"videojs-contrib-ads\": \"^6.9.0\" };\nvar devDependencies = { \"axios\": \"^0.25.0\", \"babel-core\": \"^6.26.3\", \"babel-preset-env\": \"^1.7.0\", \"child_process\": \"^1.0.2\", \"chromedriver\": \"^102.0.0\", \"conventional-changelog-cli\": \"^2.2.2\", \"conventional-changelog-videojs\": \"^3.0.2\", \"ecstatic\": \"^4.1.4\", \"eslint\": \"^8.8.0\", \"eslint-config-google\": \"^0.9.1\", \"eslint-plugin-jsdoc\": \"^3.15.1\", \"geckodriver\": \"^2.0.4\", \"http-server\": \"^14.1.0\", \"ini\": \">=1.3.7\", \"mocha\": \"^9.2.0\", \"npm-run-all\": \"^4.1.5\", \"path\": \"^0.12.7\", \"protractor\": \"^7.0.0\", \"rimraf\": \"^2.7.1\", \"rollup\": \"^0.51.8\", \"rollup-plugin-babel\": \"^3.0.7\", \"rollup-plugin-copy\": \"^0.2.3\", \"rollup-plugin-json\": \"^2.3.1\", \"rollup-plugin-uglify\": \"^2.0.1\", \"selenium-webdriver\": \"^3.6.0\", \"uglify-es\": \"^3.3.9\", \"video.js\": \"^7.17.0\", \"watch\": \"^0.13.0\", \"webdriver-manager\": \"^12.1.7\", \"xmldom\": \"^0.6.0\" };\nvar keywords = [\"videojs\", \"videojs-plugin\"];\nvar pkg = {\n\tname: name,\n\tversion: version,\n\tlicense: license,\n\tmain: main,\n\tmodule: module$1,\n\tauthor: author,\n\tengines: engines,\n\tscripts: scripts,\n\trepository: repository,\n\tfiles: files,\n\tpeerDependencies: peerDependencies,\n\tdependencies: dependencies,\n\tdevDependencies: devDependencies,\n\tkeywords: keywords\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Implementation of the IMA SDK for the plugin.\n *\n * @param {Object} controller Reference to the parent controller.\n *\n * @constructor\n * @struct\n * @final\n */\nvar SdkImpl = function SdkImpl(controller) {\n  /**\n   * Plugin controller.\n   */\n  this.controller = controller;\n\n  /**\n   * IMA SDK AdDisplayContainer.\n   */\n  this.adDisplayContainer = null;\n\n  /**\n   * True if the AdDisplayContainer has been initialized. False otherwise.\n   */\n  this.adDisplayContainerInitialized = false;\n\n  /**\n   * IMA SDK AdsLoader\n   */\n  this.adsLoader = null;\n\n  /**\n   * IMA SDK AdsManager\n   */\n  this.adsManager = null;\n\n  /**\n   * IMA SDK AdsRenderingSettings.\n   */\n  this.adsRenderingSettings = null;\n\n  /**\n   * VAST, VMAP, or ad rules response. Used in lieu of fetching a response\n   * from an ad tag URL.\n   */\n  this.adsResponse = null;\n\n  /**\n   * Current IMA SDK Ad.\n   */\n  this.currentAd = null;\n\n  /**\n   * Timer used to track ad progress.\n   */\n  this.adTrackingTimer = null;\n\n  /**\n   * True if ALL_ADS_COMPLETED has fired, false until then.\n   */\n  this.allAdsCompleted = false;\n\n  /**\n   * True if ads are currently displayed, false otherwise.\n   * True regardless of ad pause state if an ad is currently being displayed.\n   */\n  this.adsActive = false;\n\n  /**\n   * True if ad is currently playing, false if ad is paused or ads are not\n   * currently displayed.\n   */\n  this.adPlaying = false;\n\n  /**\n   * True if the ad is muted, false otherwise.\n   */\n  this.adMuted = false;\n\n  /**\n   * Listener to be called to trigger manual ad break playback.\n   */\n  this.adBreakReadyListener = undefined;\n\n  /**\n   * Tracks whether or not we have already called adsLoader.contentComplete().\n   */\n  this.contentCompleteCalled = false;\n\n  /**\n   * True if the ad has timed out.\n   */\n  this.isAdTimedOut = false;\n\n  /**\n   * Stores the dimensions for the ads manager.\n   */\n  this.adsManagerDimensions = {\n    width: 0,\n    height: 0\n  };\n\n  /**\n   * Boolean flag to enable manual ad break playback.\n   */\n  this.autoPlayAdBreaks = true;\n  if (this.controller.getSettings().autoPlayAdBreaks === false) {\n    this.autoPlayAdBreaks = false;\n  }\n\n  // Set SDK settings from plugin settings.\n  if (this.controller.getSettings().locale) {\n    /* eslint no-undef: 'error' */\n    /* global google */\n    google.ima.settings.setLocale(this.controller.getSettings().locale);\n  }\n  if (this.controller.getSettings().disableFlashAds) {\n    google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds);\n  }\n  if (this.controller.getSettings().disableCustomPlaybackForIOS10Plus) {\n    google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus);\n  }\n\n  if (this.controller.getSettings().ppid) {\n    google.ima.settings.setPpid(this.controller.getSettings().ppid);\n  }\n\n  if (this.controller.getSettings().featureFlags) {\n    google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags);\n  }\n};\n\n/**\n * Creates and initializes the IMA SDK objects.\n */\nSdkImpl.prototype.initAdObjects = function () {\n  this.adDisplayContainer = new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(), this.controller.getContentPlayer());\n\n  this.adsLoader = new google.ima.AdsLoader(this.adDisplayContainer);\n\n  this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED);\n  if (this.controller.getSettings().vpaidAllowed == false) {\n    this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED);\n  }\n  if (this.controller.getSettings().vpaidMode !== undefined) {\n    this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode);\n  }\n\n  if (this.controller.getSettings().locale) {\n    this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale);\n  }\n\n  if (this.controller.getSettings().numRedirects) {\n    this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects);\n  }\n\n  if (this.controller.getSettings().sessionId) {\n    this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId);\n  }\n\n  this.adsLoader.getSettings().setPlayerType('videojs-ima');\n  this.adsLoader.getSettings().setPlayerVersion(pkg.version);\n  this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks);\n\n  this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded.bind(this), false);\n  this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdsLoaderError.bind(this), false);\n\n  this.controller.playerWrapper.vjsPlayer.trigger({\n    type: 'ads-loader',\n    adsLoader: this.adsLoader\n  });\n};\n\n/**\n * Creates the AdsRequest and request ads through the AdsLoader.\n */\nSdkImpl.prototype.requestAds = function () {\n  var adsRequest = new google.ima.AdsRequest();\n  if (this.controller.getSettings().adTagUrl) {\n    adsRequest.adTagUrl = this.controller.getSettings().adTagUrl;\n  } else {\n    adsRequest.adsResponse = this.controller.getSettings().adsResponse;\n  }\n  if (this.controller.getSettings().forceNonLinearFullSlot) {\n    adsRequest.forceNonLinearFullSlot = true;\n  }\n\n  if (this.controller.getSettings().vastLoadTimeout) {\n    adsRequest.vastLoadTimeout = this.controller.getSettings().vastLoadTimeout;\n  }\n\n  if (this.controller.getSettings().omidMode) {\n    window.console.warn('The additional setting `omidMode` has been removed. ' + 'Use `omidVendorAccess` instead.');\n  }\n\n  if (this.controller.getSettings().omidVendorAccess) {\n    adsRequest.omidAccessModeRules = {};\n    var omidVendorValues = this.controller.getSettings().omidVendorAccess;\n\n    Object.keys(omidVendorValues).forEach(function (vendorKey) {\n      adsRequest.omidAccessModeRules[vendorKey] = omidVendorValues[vendorKey];\n    });\n  }\n\n  adsRequest.linearAdSlotWidth = this.controller.getPlayerWidth();\n  adsRequest.linearAdSlotHeight = this.controller.getPlayerHeight();\n  adsRequest.nonLinearAdSlotWidth = this.controller.getSettings().nonLinearWidth || this.controller.getPlayerWidth();\n  adsRequest.nonLinearAdSlotHeight = this.controller.getSettings().nonLinearHeight || this.controller.getPlayerHeight();\n  adsRequest.setAdWillAutoPlay(this.controller.adsWillAutoplay());\n  adsRequest.setAdWillPlayMuted(this.controller.adsWillPlayMuted());\n\n  // Populate the adsRequestproperties with those provided in the AdsRequest\n  // object in the settings.\n  var providedAdsRequest = this.controller.getSettings().adsRequest;\n  if (providedAdsRequest && (typeof providedAdsRequest === 'undefined' ? 'undefined' : _typeof(providedAdsRequest)) === 'object') {\n    Object.keys(providedAdsRequest).forEach(function (key) {\n      adsRequest[key] = providedAdsRequest[key];\n    });\n  }\n\n  this.adsLoader.requestAds(adsRequest);\n  this.controller.playerWrapper.vjsPlayer.trigger({\n    type: 'ads-request',\n    AdsRequest: adsRequest\n  });\n};\n\n/**\n * Listener for the ADS_MANAGER_LOADED event. Creates the AdsManager,\n * sets up event listeners, and triggers the 'adsready' event for\n * videojs-ads-contrib.\n *\n * @param {google.ima.AdsManagerLoadedEvent} adsManagerLoadedEvent Fired when\n *     the AdsManager loads.\n */\nSdkImpl.prototype.onAdsManagerLoaded = function (adsManagerLoadedEvent) {\n  this.createAdsRenderingSettings();\n\n  this.adsManager = adsManagerLoadedEvent.getAdsManager(this.controller.getContentPlayheadTracker(), this.adsRenderingSettings);\n\n  this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdError.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY, this.onAdBreakReady.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, this.onContentPauseRequested.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, this.onContentResumeRequested.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED, this.onAllAdsCompleted.bind(this));\n\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, this.onAdLoaded.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, this.onAdStarted.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, this.onAdComplete.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED, this.onAdComplete.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG, this.onAdLog.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED, this.onAdPaused.bind(this));\n  this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED, this.onAdResumed.bind(this));\n\n  this.controller.playerWrapper.vjsPlayer.trigger({\n    type: 'ads-manager',\n    adsManager: this.adsManager\n  });\n\n  if (!this.autoPlayAdBreaks) {\n    this.initAdsManager();\n  }\n\n  var _controller$getSettin = this.controller.getSettings(),\n      preventLateAdStart = _controller$getSettin.preventLateAdStart;\n\n  if (!preventLateAdStart) {\n    this.controller.onAdsReady();\n  } else if (preventLateAdStart && !this.isAdTimedOut) {\n    this.controller.onAdsReady();\n  }\n\n  if (this.controller.getSettings().adsManagerLoadedCallback) {\n    this.controller.getSettings().adsManagerLoadedCallback();\n  }\n};\n\n/**\n * Listener for errors fired by the AdsLoader.\n * @param {google.ima.AdErrorEvent} event The error event thrown by the\n *     AdsLoader. See\n *     https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError#.Type\n */\nSdkImpl.prototype.onAdsLoaderError = function (event) {\n  window.console.warn('AdsLoader error: ' + event.getError());\n  this.controller.onErrorLoadingAds(event);\n  if (this.adsManager) {\n    this.adsManager.destroy();\n  }\n};\n\n/**\n * Initialize the ads manager.\n */\nSdkImpl.prototype.initAdsManager = function () {\n  try {\n    var initWidth = this.controller.getPlayerWidth();\n    var initHeight = this.controller.getPlayerHeight();\n    this.adsManagerDimensions.width = initWidth;\n    this.adsManagerDimensions.height = initHeight;\n    this.adsManager.init(initWidth, initHeight, google.ima.ViewMode.NORMAL);\n    this.adsManager.setVolume(this.controller.getPlayerVolume());\n    this.initializeAdDisplayContainer();\n  } catch (adError) {\n    this.onAdError(adError);\n  }\n};\n\n/**\n * Create AdsRenderingSettings for the IMA SDK.\n */\nSdkImpl.prototype.createAdsRenderingSettings = function () {\n  this.adsRenderingSettings = new google.ima.AdsRenderingSettings();\n  this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete = true;\n  if (this.controller.getSettings().adsRenderingSettings) {\n    for (var setting in this.controller.getSettings().adsRenderingSettings) {\n      if (setting !== '') {\n        this.adsRenderingSettings[setting] = this.controller.getSettings().adsRenderingSettings[setting];\n      }\n    }\n  }\n};\n\n/**\n * Listener for errors thrown by the AdsManager.\n * @param {google.ima.AdErrorEvent} adErrorEvent The error event thrown by\n *     the AdsManager.\n */\nSdkImpl.prototype.onAdError = function (adErrorEvent) {\n  var errorMessage = adErrorEvent.getError !== undefined ? adErrorEvent.getError() : adErrorEvent.stack;\n  window.console.warn('Ad error: ' + errorMessage);\n\n  this.adsManager.destroy();\n  this.controller.onAdError(adErrorEvent);\n\n  // reset these so consumers don't think we are still in an ad break,\n  // but reset them after any prior cleanup happens\n  this.adsActive = false;\n  this.adPlaying = false;\n};\n\n/**\n * Listener for AD_BREAK_READY. Passes event on to publisher's listener.\n * @param {google.ima.AdEvent} adEvent AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAdBreakReady = function (adEvent) {\n  this.adBreakReadyListener(adEvent);\n};\n\n/**\n * Pauses the content video and displays the ad container so ads can play.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onContentPauseRequested = function (adEvent) {\n  this.adsActive = true;\n  this.adPlaying = true;\n  this.controller.onAdBreakStart(adEvent);\n};\n\n/**\n * Resumes content video and hides the ad container.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onContentResumeRequested = function (adEvent) {\n  this.adsActive = false;\n  this.adPlaying = false;\n  this.controller.onAdBreakEnd();\n  // Hide controls in case of future non-linear ads. They'll be unhidden in\n  // content_pause_requested.\n};\n\n/**\n * Records that ads have completed and calls contentAndAdsEndedListeners\n * if content is also complete.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAllAdsCompleted = function (adEvent) {\n  this.allAdsCompleted = true;\n  this.controller.onAllAdsCompleted();\n};\n\n/**\n * Starts the content video when a non-linear ad is loaded.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAdLoaded = function (adEvent) {\n  if (!adEvent.getAd().isLinear()) {\n    this.controller.onNonLinearAdLoad();\n    this.controller.playContent();\n  }\n};\n\n/**\n * Starts the interval timer to check the current ad time when an ad starts\n * playing.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAdStarted = function (adEvent) {\n  this.currentAd = adEvent.getAd();\n  if (this.currentAd.isLinear()) {\n    this.adTrackingTimer = setInterval(this.onAdPlayheadTrackerInterval.bind(this), 250);\n    this.controller.onLinearAdStart();\n  } else {\n    this.controller.onNonLinearAdStart();\n  }\n};\n\n/**\n * Handles an ad click. Puts the player UI in a paused state.\n */\nSdkImpl.prototype.onAdPaused = function () {\n  this.controller.onAdsPaused();\n};\n\n/**\n * Syncs controls when an ad resumes.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAdResumed = function (adEvent) {\n  this.controller.onAdsResumed();\n};\n\n/**\n * Clears the interval timer for current ad time when an ad completes.\n */\nSdkImpl.prototype.onAdComplete = function () {\n  if (this.currentAd.isLinear()) {\n    clearInterval(this.adTrackingTimer);\n  }\n};\n\n/**\n * Handles ad log messages.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the AdsManager.\n */\nSdkImpl.prototype.onAdLog = function (adEvent) {\n  this.controller.onAdLog(adEvent);\n};\n\n/**\n * Gets the current time and duration of the ad and calls the method to\n * update the ad UI.\n */\nSdkImpl.prototype.onAdPlayheadTrackerInterval = function () {\n  if (this.adsManager === null) return;\n  var remainingTime = this.adsManager.getRemainingTime();\n  var duration = this.currentAd.getDuration();\n  var currentTime = duration - remainingTime;\n  currentTime = currentTime > 0 ? currentTime : 0;\n  var totalAds = 0;\n  var adPosition = void 0;\n  if (this.currentAd.getAdPodInfo()) {\n    adPosition = this.currentAd.getAdPodInfo().getAdPosition();\n    totalAds = this.currentAd.getAdPodInfo().getTotalAds();\n  }\n\n  this.controller.onAdPlayheadUpdated(currentTime, remainingTime, duration, adPosition, totalAds);\n};\n\n/**\n * Called by the player wrapper when content completes.\n */\nSdkImpl.prototype.onContentComplete = function () {\n  if (this.adsLoader) {\n    this.adsLoader.contentComplete();\n    this.contentCompleteCalled = true;\n  }\n\n  if (this.adsManager && this.adsManager.getCuePoints() && !this.adsManager.getCuePoints().includes(-1) || !this.adsManager) {\n    this.controller.onNoPostroll();\n  }\n\n  if (this.allAdsCompleted) {\n    this.controller.onContentAndAdsCompleted();\n  }\n};\n\n/**\n * Called when the player is disposed.\n */\nSdkImpl.prototype.onPlayerDisposed = function () {\n  if (this.adTrackingTimer) {\n    clearInterval(this.adTrackingTimer);\n  }\n  if (this.adsManager) {\n    this.adsManager.destroy();\n    this.adsManager = null;\n  }\n};\n\nSdkImpl.prototype.onPlayerReadyForPreroll = function () {\n  if (this.autoPlayAdBreaks) {\n    this.initAdsManager();\n    try {\n      this.controller.showAdContainer();\n      // Sync ad volume with content volume.\n      this.adsManager.setVolume(this.controller.getPlayerVolume());\n      this.adsManager.start();\n    } catch (adError) {\n      this.onAdError(adError);\n    }\n  }\n};\n\nSdkImpl.prototype.onAdTimeout = function () {\n  this.isAdTimedOut = true;\n};\n\nSdkImpl.prototype.onPlayerReady = function () {\n  this.initAdObjects();\n\n  if ((this.controller.getSettings().adTagUrl || this.controller.getSettings().adsResponse) && this.controller.getSettings().requestMode === 'onLoad') {\n    this.requestAds();\n  }\n};\n\nSdkImpl.prototype.onPlayerEnterFullscreen = function () {\n  if (this.adsManager) {\n    this.adsManager.resize(window.screen.width, window.screen.height, google.ima.ViewMode.FULLSCREEN);\n  }\n};\n\nSdkImpl.prototype.onPlayerExitFullscreen = function () {\n  if (this.adsManager) {\n    this.adsManager.resize(this.controller.getPlayerWidth(), this.controller.getPlayerHeight(), google.ima.ViewMode.NORMAL);\n  }\n};\n\n/**\n * Called when the player volume changes.\n *\n * @param {number} volume The new player volume.\n */\nSdkImpl.prototype.onPlayerVolumeChanged = function (volume) {\n  if (this.adsManager) {\n    this.adsManager.setVolume(volume);\n  }\n\n  if (volume == 0) {\n    this.adMuted = true;\n  } else {\n    this.adMuted = false;\n  }\n};\n\n/**\n * Called when the player wrapper detects that the player has been resized.\n *\n * @param {number} width The post-resize width of the player.\n * @param {number} height The post-resize height of the player.\n */\nSdkImpl.prototype.onPlayerResize = function (width, height) {\n  if (this.adsManager) {\n    this.adsManagerDimensions.width = width;\n    this.adsManagerDimensions.height = height;\n    /* eslint no-undef: 'error' */\n    this.adsManager.resize(width, height, google.ima.ViewMode.NORMAL);\n  }\n};\n\n/**\n * @return {Object} The current ad.\n */\nSdkImpl.prototype.getCurrentAd = function () {\n  return this.currentAd;\n};\n\n/**\n * Listener JSDoc for ESLint. This listener can be passed to\n * setAdBreakReadyListener.\n * @callback listener\n */\n\n/**\n * Sets the listener to be called to trigger manual ad break playback.\n * @param {listener} listener The listener to be called to trigger manual ad\n *     break playback.\n */\nSdkImpl.prototype.setAdBreakReadyListener = function (listener) {\n  this.adBreakReadyListener = listener;\n};\n\n/**\n * @return {boolean} True if an ad is currently playing. False otherwise.\n */\nSdkImpl.prototype.isAdPlaying = function () {\n  return this.adPlaying;\n};\n\n/**\n * @return {boolean} True if an ad is currently playing. False otherwise.\n */\nSdkImpl.prototype.isAdMuted = function () {\n  return this.adMuted;\n};\n\n/**\n * Pause ads.\n */\nSdkImpl.prototype.pauseAds = function () {\n  this.adsManager.pause();\n  this.adPlaying = false;\n};\n\n/**\n * Resume ads.\n */\nSdkImpl.prototype.resumeAds = function () {\n  this.adsManager.resume();\n  this.adPlaying = true;\n};\n\n/**\n * Unmute ads.\n */\nSdkImpl.prototype.unmute = function () {\n  this.adsManager.setVolume(1);\n  this.adMuted = false;\n};\n\n/**\n * Mute ads.\n */\nSdkImpl.prototype.mute = function () {\n  this.adsManager.setVolume(0);\n  this.adMuted = true;\n};\n\n/**\n * Set the volume of the ads. 0-1.\n *\n * @param {number} volume The new volume.\n */\nSdkImpl.prototype.setVolume = function (volume) {\n  this.adsManager.setVolume(volume);\n  if (volume == 0) {\n    this.adMuted = true;\n  } else {\n    this.adMuted = false;\n  }\n};\n\n/**\n * Initializes the AdDisplayContainer. On mobile, this must be done as a\n * result of user action.\n */\nSdkImpl.prototype.initializeAdDisplayContainer = function () {\n  if (this.adDisplayContainer) {\n    if (!this.adDisplayContainerInitialized) {\n      this.adDisplayContainer.initialize();\n      this.adDisplayContainerInitialized = true;\n    }\n  }\n};\n\n/**\n * Called by publishers in manual ad break playback mode to start an ad\n * break.\n */\nSdkImpl.prototype.playAdBreak = function () {\n  if (!this.autoPlayAdBreaks) {\n    this.controller.showAdContainer();\n    // Sync ad volume with content volume.\n    this.adsManager.setVolume(this.controller.getPlayerVolume());\n    this.adsManager.start();\n  }\n};\n\n/**\n * Callback JSDoc for ESLint. This callback can be passed to addEventListener.\n * @callback callback\n */\n\n/**\n * Ads an EventListener to the AdsManager. For a list of available events,\n * see\n * https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent#.Type\n * @param {google.ima.AdEvent.Type} event The AdEvent.Type for which to\n *     listen.\n * @param {callback} callback The method to call when the event is fired.\n */\nSdkImpl.prototype.addEventListener = function (event, callback) {\n  if (this.adsManager) {\n    this.adsManager.addEventListener(event, callback);\n  }\n};\n\n/**\n * Returns the instance of the AdsManager.\n * @return {google.ima.AdsManager} The AdsManager being used by the plugin.\n */\nSdkImpl.prototype.getAdsManager = function () {\n  return this.adsManager;\n};\n\n/**\n * Reset the SDK implementation.\n */\nSdkImpl.prototype.reset = function () {\n  this.adsActive = false;\n  this.adPlaying = false;\n  if (this.adTrackingTimer) {\n    // If this is called while an ad is playing, stop trying to get that\n    // ad's current time.\n    clearInterval(this.adTrackingTimer);\n  }\n  if (this.adsManager) {\n    this.adsManager.destroy();\n    this.adsManager = null;\n  }\n  if (this.adsLoader && !this.contentCompleteCalled) {\n    this.adsLoader.contentComplete();\n  }\n  this.contentCompleteCalled = false;\n  this.allAdsCompleted = false;\n};\n\n/**\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n/**\n * The grand coordinator of the plugin. Facilitates communication between all\n * other plugin classes.\n *\n * @param {Object} player Instance of the video.js player.\n * @param {Object} options Options provided by the implementation.\n * @constructor\n * @struct\n * @final\n */\nvar Controller = function Controller(player, options) {\n  /**\n   * Stores user-provided settings.\n   * @type {Object}\n   */\n  this.settings = {};\n\n  /**\n   * Content and ads ended listeners passed by the publisher to the plugin.\n   * These will be called when the plugin detects that content *and all\n   * ads* have completed. This differs from the contentEndedListeners in that\n   * contentEndedListeners will fire between content ending and a post-roll\n   * playing, whereas the contentAndAdsEndedListeners will fire after the\n   * post-roll completes.\n   */\n  this.contentAndAdsEndedListeners = [];\n\n  /**\n   * Whether or not we are running on a mobile platform.\n   */\n  this.isMobile = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i);\n\n  /**\n   * Whether or not we are running on an iOS platform.\n   */\n  this.isIos = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i);\n\n  this.initWithSettings(options);\n\n  /**\n   * Stores contrib-ads default settings.\n   */\n  var contribAdsDefaults = {\n    debug: this.settings.debug,\n    timeout: this.settings.timeout,\n    prerollTimeout: this.settings.prerollTimeout\n  };\n  var adsPluginSettings = Object.assign({}, contribAdsDefaults, options.contribAdsSettings || {});\n\n  this.playerWrapper = new PlayerWrapper(player, adsPluginSettings, this);\n  this.adUi = new AdUi(this);\n  this.sdkImpl = new SdkImpl(this);\n};\n\nController.IMA_DEFAULTS = {\n  adLabel: 'Advertisement',\n  adLabelNofN: 'of',\n  debug: false,\n  disableAdControls: false,\n  prerollTimeout: 1000,\n  preventLateAdStart: false,\n  requestMode: 'onLoad',\n  showControlsForJSAds: true,\n  timeout: 5000\n};\n\n/**\n * Extends the settings to include user-provided settings.\n *\n * @param {Object} options Options to be used in initialization.\n */\nController.prototype.initWithSettings = function (options) {\n  this.settings = Object.assign({}, Controller.IMA_DEFAULTS, options || {});\n\n  this.warnAboutDeprecatedSettings();\n\n  // Default showing countdown timer to true.\n  this.showCountdown = true;\n  if (this.settings.showCountdown === false) {\n    this.showCountdown = false;\n  }\n};\n\n/**\n * Logs console warnings when deprecated settings are used.\n */\nController.prototype.warnAboutDeprecatedSettings = function () {\n  var _this = this;\n\n  var deprecatedSettings = ['adWillAutoplay', 'adsWillAutoplay', 'adWillPlayMuted', 'adsWillPlayMuted'];\n  deprecatedSettings.forEach(function (setting) {\n    if (_this.settings[setting] !== undefined) {\n      console.warn('WARNING: videojs.ima setting ' + setting + ' is deprecated');\n    }\n  });\n};\n\n/**\n * Return the settings object.\n *\n * @return {Object} The settings object.\n */\nController.prototype.getSettings = function () {\n  return this.settings;\n};\n\n/**\n * Return whether or not we're in a mobile environment.\n *\n * @return {boolean} True if running on mobile, false otherwise.\n */\nController.prototype.getIsMobile = function () {\n  return this.isMobile;\n};\n\n/**\n * Return whether or not we're in an iOS environment.\n *\n * @return {boolean} True if running on iOS, false otherwise.\n */\nController.prototype.getIsIos = function () {\n  return this.isIos;\n};\n\n/**\n * Inject the ad container div into the DOM.\n *\n * @param{HTMLElement} adContainerDiv The ad container div.\n */\nController.prototype.injectAdContainerDiv = function (adContainerDiv) {\n  this.playerWrapper.injectAdContainerDiv(adContainerDiv);\n};\n\n/**\n * @return {HTMLElement} The div for the ad container.\n */\nController.prototype.getAdContainerDiv = function () {\n  return this.adUi.getAdContainerDiv();\n};\n\n/**\n * @return {Object} The content player.\n */\nController.prototype.getContentPlayer = function () {\n  return this.playerWrapper.getContentPlayer();\n};\n\n/**\n * Returns the content playhead tracker.\n *\n * @return {Object} The content playhead tracker.\n */\nController.prototype.getContentPlayheadTracker = function () {\n  return this.playerWrapper.getContentPlayheadTracker();\n};\n\n/**\n * Requests ads.\n */\nController.prototype.requestAds = function () {\n  this.sdkImpl.requestAds();\n};\n\n/**\n * Add or modify a setting.\n *\n * @param {string} key Key to modify\n * @param {Object} value Value to set at key.\n */\nController.prototype.setSetting = function (key, value) {\n  this.settings[key] = value;\n};\n\n/**\n * Called when there is an error loading ads.\n *\n * @param {Object} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nController.prototype.onErrorLoadingAds = function (adErrorEvent) {\n  this.adUi.onAdError();\n  this.playerWrapper.onAdError(adErrorEvent);\n};\n\n/**\n * Called by the ad UI when the play/pause button is clicked.\n */\nController.prototype.onAdPlayPauseClick = function () {\n  if (this.sdkImpl.isAdPlaying()) {\n    this.adUi.onAdsPaused();\n    this.sdkImpl.pauseAds();\n  } else {\n    this.adUi.onAdsPlaying();\n    this.sdkImpl.resumeAds();\n  }\n};\n\n/**\n * Called by the ad UI when the mute button is clicked.\n *\n */\nController.prototype.onAdMuteClick = function () {\n  if (this.sdkImpl.isAdMuted()) {\n    this.playerWrapper.unmute();\n    this.adUi.unmute();\n    this.sdkImpl.unmute();\n  } else {\n    this.playerWrapper.mute();\n    this.adUi.mute();\n    this.sdkImpl.mute();\n  }\n};\n\n/**\n * Set the volume of the player and ads. 0-1.\n *\n * @param {number} volume The new volume.\n */\nController.prototype.setVolume = function (volume) {\n  this.playerWrapper.setVolume(volume);\n  this.sdkImpl.setVolume(volume);\n};\n\n/**\n * @return {number} The volume of the content player.\n */\nController.prototype.getPlayerVolume = function () {\n  return this.playerWrapper.getVolume();\n};\n\n/**\n * Toggle fullscreen state.\n */\nController.prototype.toggleFullscreen = function () {\n  this.playerWrapper.toggleFullscreen();\n};\n\n/**\n * Relays ad errors to the player wrapper.\n *\n * @param {Object} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nController.prototype.onAdError = function (adErrorEvent) {\n  this.adUi.onAdError();\n  this.playerWrapper.onAdError(adErrorEvent);\n};\n\n/**\n * Handles ad break starting.\n *\n * @param {Object} adEvent The event fired by the IMA SDK.\n */\nController.prototype.onAdBreakStart = function (adEvent) {\n  this.playerWrapper.onAdBreakStart();\n  this.adUi.onAdBreakStart(adEvent);\n};\n\n/**\n * Show the ad container.\n */\nController.prototype.showAdContainer = function () {\n  this.adUi.showAdContainer();\n};\n\n/**\n * Handles ad break ending.\n */\nController.prototype.onAdBreakEnd = function () {\n  this.playerWrapper.onAdBreakEnd();\n  this.adUi.onAdBreakEnd();\n};\n\n/**\n * Handles when all ads have finished playing.\n */\nController.prototype.onAllAdsCompleted = function () {\n  this.adUi.onAllAdsCompleted();\n  this.playerWrapper.onAllAdsCompleted();\n};\n\n/**\n * Handles the SDK firing an ad paused event.\n */\nController.prototype.onAdsPaused = function () {\n  this.adUi.onAdsPaused();\n};\n\n/**\n * Handles the SDK firing an ad resumed event.\n */\nController.prototype.onAdsResumed = function () {\n  this.adUi.onAdsResumed();\n};\n\n/**\n * Takes data from the sdk impl and passes it to the ad UI to update the UI.\n *\n * @param {number} currentTime Current time of the ad.\n * @param {number} remainingTime Remaining time of the ad.\n * @param {number} duration Duration of the ad.\n * @param {number} adPosition Index of the ad in the pod.\n * @param {number} totalAds Total number of ads in the pod.\n */\nController.prototype.onAdPlayheadUpdated = function (currentTime, remainingTime, duration, adPosition, totalAds) {\n  this.adUi.updateAdUi(currentTime, remainingTime, duration, adPosition, totalAds);\n};\n\n/**\n * Handles ad log messages.\n * @param {google.ima.AdEvent} adEvent The AdEvent thrown by the IMA SDK.\n */\nController.prototype.onAdLog = function (adEvent) {\n  this.playerWrapper.onAdLog(adEvent);\n};\n\n/**\n * @return {Object} The current ad.\n */\nController.prototype.getCurrentAd = function () {\n  return this.sdkImpl.getCurrentAd();\n};\n\n/**\n * Play content.\n */\nController.prototype.playContent = function () {\n  this.playerWrapper.play();\n};\n\n/**\n * Handles when a linear ad starts.\n */\nController.prototype.onLinearAdStart = function () {\n  this.adUi.onLinearAdStart();\n  this.playerWrapper.onAdStart();\n};\n\n/**\n * Handles when a non-linear ad loads.\n */\nController.prototype.onNonLinearAdLoad = function () {\n  this.adUi.onNonLinearAdLoad();\n};\n\n/**\n * Handles when a non-linear ad starts.\n */\nController.prototype.onNonLinearAdStart = function () {\n  this.adUi.onNonLinearAdLoad();\n  this.playerWrapper.onAdStart();\n};\n\n/**\n * Get the player width.\n *\n * @return {number} The width of the player.\n */\nController.prototype.getPlayerWidth = function () {\n  return this.playerWrapper.getPlayerWidth();\n};\n\n/**\n * Get the player height.\n *\n * @return {number} The height of the player.\n */\nController.prototype.getPlayerHeight = function () {\n  return this.playerWrapper.getPlayerHeight();\n};\n\n/**\n * Tells the player wrapper that ads are ready.\n */\nController.prototype.onAdsReady = function () {\n  this.playerWrapper.onAdsReady();\n};\n\n/**\n * Called when the player wrapper detects that the player has been resized.\n *\n * @param {number} width The post-resize width of the player.\n * @param {number} height The post-resize height of the player.\n */\nController.prototype.onPlayerResize = function (width, height) {\n  this.sdkImpl.onPlayerResize(width, height);\n};\n\n/**\n * Called by the player wrapper when content completes.\n */\nController.prototype.onContentComplete = function () {\n  this.sdkImpl.onContentComplete();\n};\n\n/**\n * Called by the player wrapper when it's time to play a post-roll but we don't\n * have one to play.\n */\nController.prototype.onNoPostroll = function () {\n  this.playerWrapper.onNoPostroll();\n};\n\n/**\n * Called when content and all ads have completed.\n */\nController.prototype.onContentAndAdsCompleted = function () {\n  for (var index in this.contentAndAdsEndedListeners) {\n    if (typeof this.contentAndAdsEndedListeners[index] === 'function') {\n      this.contentAndAdsEndedListeners[index]();\n    }\n  }\n};\n\n/**\n * Called when the player is disposed.\n */\nController.prototype.onPlayerDisposed = function () {\n  this.contentAndAdsEndedListeners = [];\n  this.sdkImpl.onPlayerDisposed();\n};\n\n/**\n * Called when the player is ready to play a pre-roll.\n */\nController.prototype.onPlayerReadyForPreroll = function () {\n  this.sdkImpl.onPlayerReadyForPreroll();\n};\n\n/**\n * Called if the ad times out.\n */\nController.prototype.onAdTimeout = function () {\n  this.sdkImpl.onAdTimeout();\n};\n\n/**\n * Called when the player is ready.\n */\nController.prototype.onPlayerReady = function () {\n  this.sdkImpl.onPlayerReady();\n};\n\n/**\n * Called when the player enters fullscreen.\n */\nController.prototype.onPlayerEnterFullscreen = function () {\n  this.adUi.onPlayerEnterFullscreen();\n  this.sdkImpl.onPlayerEnterFullscreen();\n};\n\n/**\n * Called when the player exits fullscreen.\n */\nController.prototype.onPlayerExitFullscreen = function () {\n  this.adUi.onPlayerExitFullscreen();\n  this.sdkImpl.onPlayerExitFullscreen();\n};\n\n/**\n * Called when the player volume changes.\n *\n * @param {number} volume The new player volume.\n */\nController.prototype.onPlayerVolumeChanged = function (volume) {\n  this.adUi.onPlayerVolumeChanged(volume);\n  this.sdkImpl.onPlayerVolumeChanged(volume);\n};\n\n/**\n * Sets the content of the video player. You should use this method instead\n * of setting the content src directly to ensure the proper ad tag is\n * requested when the video content is loaded.\n * @param {?string} contentSrc The URI for the content to be played. Leave\n *     blank to use the existing content.\n * @param {?string} adTag The ad tag to be requested when the content loads.\n *     Leave blank to use the existing ad tag.\n */\nController.prototype.setContentWithAdTag = function (contentSrc, adTag) {\n  this.reset();\n  this.settings.adTagUrl = adTag ? adTag : this.settings.adTagUrl;\n  this.playerWrapper.changeSource(contentSrc);\n};\n\n/**\n * Sets the content of the video player. You should use this method instead\n * of setting the content src directly to ensure the proper ads response is\n * used when the video content is loaded.\n * @param {?string} contentSrc The URI for the content to be played. Leave\n *     blank to use the existing content.\n * @param {?string} adsResponse The ads response to be requested when the\n *     content loads. Leave blank to use the existing ads response.\n */\nController.prototype.setContentWithAdsResponse = function (contentSrc, adsResponse) {\n  this.reset();\n  this.settings.adsResponse = adsResponse ? adsResponse : this.settings.adsResponse;\n  this.playerWrapper.changeSource(contentSrc);\n};\n\n/**\n * Sets the content of the video player. You should use this method instead\n * of setting the content src directly to ensure the proper ads request is\n * used when the video content is loaded.\n * @param {?string} contentSrc The URI for the content to be played. Leave\n *     blank to use the existing content.\n * @param {?Object} adsRequest The ads request to be requested when the\n *     content loads. Leave blank to use the existing ads request.\n */\nController.prototype.setContentWithAdsRequest = function (contentSrc, adsRequest) {\n  this.reset();\n  this.settings.adsRequest = adsRequest ? adsRequest : this.settings.adsRequest;\n  this.playerWrapper.changeSource(contentSrc);\n};\n\n/**\n * Resets the state of the plugin.\n */\nController.prototype.reset = function () {\n  this.sdkImpl.reset();\n  this.playerWrapper.reset();\n  this.adUi.reset();\n};\n\n/**\n * Listener JSDoc for ESLint. This listener can be passed to\n * (add|remove)ContentEndedListener.\n * @callback listener\n */\n\n/**\n * Adds a listener for the 'contentended' event of the video player. This should\n * be used instead of setting an 'contentended' listener directly to ensure that\n * the ima can do proper cleanup of the SDK before other event listeners are\n * called.\n * @param {listener} listener The listener to be called when content\n *     completes.\n */\nController.prototype.addContentEndedListener = function (listener) {\n  this.playerWrapper.addContentEndedListener(listener);\n};\n\n/**\n * Adds a listener that will be called when content and all ads have\n * finished playing.\n * @param {listener} listener The listener to be called when content and ads\n *     complete.\n */\nController.prototype.addContentAndAdsEndedListener = function (listener) {\n  this.contentAndAdsEndedListeners.push(listener);\n};\n\n/**\n * Sets the listener to be called to trigger manual ad break playback.\n * @param {listener} listener The listener to be called to trigger manual ad\n *     break playback.\n */\nController.prototype.setAdBreakReadyListener = function (listener) {\n  this.sdkImpl.setAdBreakReadyListener(listener);\n};\n\n/**\n * Changes the flag to show or hide the ad countdown timer.\n *\n * @param {boolean} showCountdownIn Show or hide the countdown timer.\n */\nController.prototype.setShowCountdown = function (showCountdownIn) {\n  this.adUi.setShowCountdown(showCountdownIn);\n  this.showCountdown = showCountdownIn;\n  this.adUi.countdownDiv.style.display = this.showCountdown ? 'block' : 'none';\n};\n\n/**\n * Initializes the AdDisplayContainer. On mobile, this must be done as a\n * result of user action.\n */\nController.prototype.initializeAdDisplayContainer = function () {\n  this.sdkImpl.initializeAdDisplayContainer();\n};\n\n/**\n * Called by publishers in manual ad break playback mode to start an ad\n * break.\n */\nController.prototype.playAdBreak = function () {\n  this.sdkImpl.playAdBreak();\n};\n\n/**\n * Callback JSDoc for ESLint. This callback can be passed to addEventListener.\n * @callback callback\n */\n\n/**\n * Ads an EventListener to the AdsManager. For a list of available events,\n * see\n * https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent#.Type\n * @param {google.ima.AdEvent.Type} event The AdEvent.Type for which to\n *     listen.\n * @param {callback} callback The method to call when the event is fired.\n */\nController.prototype.addEventListener = function (event, callback) {\n  this.sdkImpl.addEventListener(event, callback);\n};\n\n/**\n * Returns the instance of the AdsManager.\n * @return {google.ima.AdsManager} The AdsManager being used by the plugin.\n */\nController.prototype.getAdsManager = function () {\n  return this.sdkImpl.getAdsManager();\n};\n\n/**\n * Returns the instance of the player id.\n * @return {string} The player id.\n */\nController.prototype.getPlayerId = function () {\n  return this.playerWrapper.getPlayerId();\n};\n\n/**\n * Changes the ad tag. You will need to call requestAds after this method\n * for the new ads to be requested.\n * @param {?string} adTag The ad tag to be requested the next time\n *     requestAds is called.\n */\nController.prototype.changeAdTag = function (adTag) {\n  this.reset();\n  this.settings.adTagUrl = adTag;\n};\n\n/**\n * Pauses the ad.\n */\nController.prototype.pauseAd = function () {\n  this.adUi.onAdsPaused();\n  this.sdkImpl.pauseAds();\n};\n\n/**\n * Resumes the ad.\n */\nController.prototype.resumeAd = function () {\n  this.adUi.onAdsPlaying();\n  this.sdkImpl.resumeAds();\n};\n\n/**\n * Toggles video/ad playback.\n */\nController.prototype.togglePlayback = function () {\n  this.playerWrapper.togglePlayback();\n};\n\n/**\n * @return {boolean} true if we expect that ads will autoplay. false otherwise.\n */\nController.prototype.adsWillAutoplay = function () {\n  if (this.settings.adsWillAutoplay !== undefined) {\n    return this.settings.adsWillAutoplay;\n  } else if (this.settings.adWillAutoplay !== undefined) {\n    return this.settings.adWillAutoplay;\n  } else {\n    return !!this.playerWrapper.getPlayerOptions().autoplay;\n  }\n};\n\n/**\n * @return {boolean} true if we expect that ads will autoplay. false otherwise.\n */\nController.prototype.adsWillPlayMuted = function () {\n  if (this.settings.adsWillPlayMuted !== undefined) {\n    return this.settings.adsWillPlayMuted;\n  } else if (this.settings.adWillPlayMuted !== undefined) {\n    return this.settings.adWillPlayMuted;\n  } else if (this.playerWrapper.getPlayerOptions().muted !== undefined) {\n    return this.playerWrapper.getPlayerOptions().muted;\n  } else {\n    return this.playerWrapper.getVolume() == 0;\n  }\n};\n\n/**\n * Triggers an event on the VJS player\n * @param  {string} name The event name.\n * @param  {Object} data The event data.\n */\nController.prototype.triggerPlayerEvent = function (name, data) {\n  this.playerWrapper.triggerPlayerEvent(name, data);\n};\n\n/**\n * Copyright 2021 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Wraps the video.js stream player for the plugin.\n *\n * @param {!Object} player Video.js player instance.\n * @param {!Object} adsPluginSettings Settings for the contrib-ads plugin.\n * @param {!DaiController} daiController Reference to the parent controller.\n */\nvar PlayerWrapper$2 = function PlayerWrapper(player, adsPluginSettings, daiController) {\n  /**\n   * Instance of the video.js player.\n   */\n  this.vjsPlayer = player;\n\n  /**\n   * Plugin DAI controller.\n   */\n  this.daiController = daiController;\n\n  /**\n   * Video.js control bar.\n   */\n  this.vjsControls = this.vjsPlayer.getChild('controlBar');\n\n  /**\n   * Vanilla HTML5 video player underneath the video.js player.\n   */\n  this.h5Player = null;\n\n  this.vjsPlayer.on('dispose', this.playerDisposedListener.bind(this));\n  this.vjsPlayer.on('pause', this.onPause.bind(this));\n  this.vjsPlayer.on('play', this.onPlay.bind(this));\n  this.vjsPlayer.on('seeked', this.onSeekEnd.bind(this));\n  this.vjsPlayer.ready(this.onPlayerReady.bind(this));\n  this.vjsPlayer.ads(adsPluginSettings);\n};\n\n/**\n * Called in response to the video.js player's 'disposed' event.\n */\nPlayerWrapper$2.prototype.playerDisposedListener = function () {\n  this.contentEndedListeners = [];\n  this.daiController.onPlayerDisposed();\n};\n\n/**\n * Called on the player 'pause' event. Handles displaying controls during\n * paused ad breaks.\n */\nPlayerWrapper$2.prototype.onPause = function () {\n  // This code will run if the stream is paused during an ad break. Since\n  // controls are usually hidden during ads, they will now show to allow\n  // users to resume ad playback.\n  if (this.daiController.isInAdBreak()) {\n    this.vjsControls.show();\n  }\n};\n\n/**\n * Called on the player 'play' event. Handles hiding controls during\n * ad breaks while playing.\n */\nPlayerWrapper$2.prototype.onPlay = function () {\n  if (this.daiController.isInAdBreak()) {\n    this.vjsControls.hide();\n  }\n};\n\n/**\n * Called on the player's 'seeked' event. Sets up handling for ad break\n * snapback for VOD streams.\n */\nPlayerWrapper$2.prototype.onSeekEnd = function () {\n  this.daiController.onSeekEnd(this.vjsPlayer.currentTime());\n};\n\n/**\n * Called on the player's 'ready' event to begin initiating IMA.\n */\nPlayerWrapper$2.prototype.onPlayerReady = function () {\n  this.h5Player = document.getElementById(this.getPlayerId()).getElementsByClassName('vjs-tech')[0];\n  this.daiController.onPlayerReady();\n};\n\n/**\n * @return {!Object} The stream player.\n */\nPlayerWrapper$2.prototype.getStreamPlayer = function () {\n  return this.h5Player;\n};\n\n/**\n * @return {!Object} The video.js player.\n */\nPlayerWrapper$2.prototype.getVjsPlayer = function () {\n  return this.vjsPlayer;\n};\n\n/**\n * @return {!Object} The vjs player's options object.\n */\nPlayerWrapper$2.prototype.getPlayerOptions = function () {\n  return this.vjsPlayer.options_;\n};\n\n/**\n * Returns the instance of the player id.\n * @return {string} The player id.\n */\nPlayerWrapper$2.prototype.getPlayerId = function () {\n  return this.vjsPlayer.id();\n};\n\n/**\n * Handles ad errors.\n *\n * @param {!Object} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nPlayerWrapper$2.prototype.onAdError = function (adErrorEvent) {\n  this.vjsControls.show();\n  var errorMessage = adErrorEvent.getError !== undefined ? adErrorEvent.getError() : adErrorEvent.stack;\n  this.vjsPlayer.trigger({ type: 'adserror', data: {\n      AdError: errorMessage,\n      AdErrorEvent: adErrorEvent\n    } });\n};\n\n/**\n * Handles ad break starting.\n */\nPlayerWrapper$2.prototype.onAdBreakStart = function () {\n  this.vjsControls.hide();\n};\n\n/**\n * Handles ad break ending.\n */\nPlayerWrapper$2.prototype.onAdBreakEnd = function () {\n  this.vjsControls.show();\n};\n\n/**\n * Reset the player.\n */\nPlayerWrapper$2.prototype.reset = function () {\n  this.vjsControls.show();\n};\n\n/**\n * Copyright 2021 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Implementation of the IMA DAI SDK for the plugin.\n *\n * @param {DaiController!} daiController Reference to the parent DAI\n * controller.\n *\n * @constructor\n * @struct\n * @final\n */\nvar SdkImpl$2 = function SdkImpl(daiController) {\n  /**\n   * Plugin DAI controller.\n   */\n  this.daiController = daiController;\n\n  /**\n   * The html5 stream player.\n   */\n  this.streamPlayer = null;\n\n  /**\n   * The videoJS stream player.\n   */\n  this.vjsPlayer = null;\n\n  /**\n   * IMA SDK StreamManager\n   */\n  this.streamManager = null;\n\n  /**\n   * IMA stream UI settings.\n   */\n  /* eslint no-undef: 'error' */\n  /* global google */\n  this.uiSettings = new google.ima.dai.api.UiSettings();\n\n  /**\n   * If the stream is currently in an ad break.\n   */\n  this.isAdBreak = false;\n\n  /**\n   * If the stream is currently seeking from a snapback.\n   */\n  this.isSnapback = false;\n\n  /**\n   * Originally seeked to time, to return stream to after ads.\n   */\n  this.snapForwardTime = 0;\n\n  /**\n   * Timed metadata for the stream.\n   */\n  this.timedMetadata;\n\n  /**\n   * Timed metadata record.\n   */\n  this.metadataLoaded = {};\n\n  this.SOURCE_TYPES = {\n    hls: 'application/x-mpegURL',\n    dash: 'application/dash+xml'\n  };\n};\n\n/**\n * Creates and initializes the IMA DAI SDK objects.\n */\nSdkImpl$2.prototype.initImaDai = function () {\n  this.streamPlayer = this.daiController.getStreamPlayer();\n  this.vjsPlayer = this.daiController.getVjsPlayer();\n\n  this.createAdUiDiv();\n  if (this.daiController.getSettings().locale) {\n    this.uiSettings.setLocale(this.daiController.getSettings().locale);\n  }\n\n  this.streamManager = new google.ima.dai.api.StreamManager(this.streamPlayer, this.adUiDiv, this.uiSettings);\n\n  this.streamPlayer.addEventListener('pause', this.onStreamPause);\n  this.streamPlayer.addEventListener('play', this.onStreamPlay);\n\n  this.streamManager.addEventListener([google.ima.dai.api.StreamEvent.Type.LOADED, google.ima.dai.api.StreamEvent.Type.ERROR, google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED, google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED], this.onStreamEvent.bind(this), false);\n\n  this.vjsPlayer.textTracks().onaddtrack = this.onAddTrack.bind(this);\n\n  this.vjsPlayer.trigger({\n    type: 'stream-manager',\n    StreamManager: this.streamManager\n  });\n\n  this.requestStream();\n};\n\n/**\n * Called when the video player has metadata to process.\n * @param {Event!} event The event that triggered this call.\n */\nSdkImpl$2.prototype.onAddTrack = function (event) {\n  var _this = this;\n\n  var track = event.track;\n  if (track.kind === 'metadata') {\n    track.mode = 'hidden';\n    track.oncuechange = function (e) {\n      var _iteratorNormalCompletion = true;\n      var _didIteratorError = false;\n      var _iteratorError = undefined;\n\n      try {\n        for (var _iterator = track.activeCues_[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n          var cue = _step.value;\n\n          var metadata = {};\n          metadata[cue.value.key] = cue.value.data;\n          _this.streamManager.onTimedMetadata(metadata);\n        }\n      } catch (err) {\n        _didIteratorError = true;\n        _iteratorError = err;\n      } finally {\n        try {\n          if (!_iteratorNormalCompletion && _iterator.return) {\n            _iterator.return();\n          }\n        } finally {\n          if (_didIteratorError) {\n            throw _iteratorError;\n          }\n        }\n      }\n    };\n  }\n};\n\n/**\n * Creates the ad UI container.\n */\nSdkImpl$2.prototype.createAdUiDiv = function () {\n  var uiDiv = document.createElement('div');\n  uiDiv.id = 'ad-ui';\n  // 3em is the height of the control bar.\n  uiDiv.style.height = 'calc(100% - 3em)';\n  this.streamPlayer.parentNode.appendChild(uiDiv);\n  this.adUiDiv = uiDiv;\n};\n\n/**\n * Called on pause to update the ad UI.\n */\nSdkImpl$2.prototype.onStreamPause = function () {\n  if (this.isAdBreak) {\n    this.adUiDiv.style.display = 'none';\n  }\n};\n\n/**\n * Called on play to update the ad UI.\n */\nSdkImpl$2.prototype.onStreamPlay = function () {\n  if (this.isAdBreak) {\n    this.adUiDiv.style.display = 'block';\n  }\n};\n\n/**\n * Called on play to update the ad UI.\n * @param {number} currentTime the current time of the stream.\n */\nSdkImpl$2.prototype.onSeekEnd = function (currentTime) {\n  var streamType = this.daiController.getSettings().streamType;\n  if (streamType === 'live') {\n    return;\n  }\n  if (this.isSnapback) {\n    this.isSnapback = false;\n    return;\n  }\n  var previousCuePoint = this.streamManager.previousCuePointForStreamTime(currentTime);\n  if (previousCuePoint && !previousCuePoint.played) {\n    this.isSnapback = true;\n    this.snapForwardTime = currentTime;\n    this.vjsPlayer.currentTime(previousCuePoint.start);\n  }\n};\n\n/**\n * Handles IMA events.\n * @param {google.ima.StreamEvent!} event the IMA event\n */\nSdkImpl$2.prototype.onStreamEvent = function (event) {\n  switch (event.type) {\n    case google.ima.dai.api.StreamEvent.Type.LOADED:\n      this.loadUrl(event.getStreamData().url);\n      break;\n    case google.ima.dai.api.StreamEvent.Type.ERROR:\n      window.console.warn('Error loading stream, attempting to play backup ' + 'stream. ' + event.getStreamData().errorMessage);\n      this.daiController.onErrorLoadingAds(event);\n      if (this.daiController.getSettings().fallbackStreamUrl) {\n        this.loadurl(this.daiController.getSettings().fallbackStreamUrl);\n      }\n      break;\n    case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:\n      this.isAdBreak = true;\n      this.adUiDiv.style.display = 'block';\n      this.daiController.onAdBreakStart();\n      break;\n    case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:\n      this.isAdBreak = false;\n      this.adUiDiv.style.display = 'none';\n      this.daiController.onAdBreakEnd();\n      if (this.snapForwardTime && this.snapForwardTime > this.vjsPlayer.currentTime()) {\n        this.vjsPlayer.currentTime(this.snapForwardTime);\n        this.snapForwardTime = 0;\n      }\n      break;\n    default:\n      break;\n  }\n};\n\n/**\n * Loads the stream URL .\n * @param {string} streamUrl the URL for the stream being loaded.\n */\nSdkImpl$2.prototype.loadUrl = function (streamUrl) {\n  this.vjsPlayer.ready(function () {\n    var streamFormat = this.daiController.getSettings().streamFormat;\n    this.vjsPlayer.src({\n      src: streamUrl,\n      type: this.SOURCE_TYPES[streamFormat]\n    });\n\n    var bookmarkTime = this.daiController.getSettings().bookmarkTime;\n    if (bookmarkTime) {\n      var startTime = this.streamManager.streamTimeForContentTime(bookmarkTime);\n      // Seeking on load triggers the onSeekEnd event, so treat this seek as\n      // if it's snapback. Without this, resuming at a bookmark kicks you\n      // back to the ad before the bookmark.\n      this.isSnapback = true;\n      this.vjsPlayer.currentTime(startTime);\n    }\n  }.bind(this));\n};\n\n/**\n * Creates the AdsRequest and request ads through the AdsLoader.\n */\nSdkImpl$2.prototype.requestStream = function () {\n  var streamRequest = void 0;\n  var streamType = this.daiController.getSettings().streamType;\n  if (streamType === 'vod') {\n    streamRequest = new google.ima.dai.api.VODStreamRequest();\n    streamRequest.contentSourceId = this.daiController.getSettings().cmsId;\n    streamRequest.videoId = this.daiController.getSettings().videoId;\n  } else if (streamType === 'live') {\n    streamRequest = new google.ima.dai.api.LiveStreamRequest();\n    streamRequest.assetKey = this.daiController.getSettings().assetKey;\n  } else {\n    window.console.warn('No valid stream type selected');\n  }\n  streamRequest.format = this.daiController.getSettings().streamFormat;\n\n  if (this.daiController.getSettings().apiKey) {\n    streamRequest.apiKey = this.daiController.getSettings().apiKey;\n  }\n  if (this.daiController.getSettings().authToken) {\n    streamRequest.authToken = this.daiController.getSettings().authToken;\n  }\n  if (this.daiController.getSettings().adTagParameters) {\n    streamRequest.adTagParameters = this.daiController.getSettings().adTagParameters;\n  }\n  if (this.daiController.getSettings().streamActivityMonitorId) {\n    streamRequest.streamActivityMonitorId = this.daiController.getSettings().streamActivityMonitorId;\n  }\n\n  if (this.daiController.getSettings().omidMode) {\n    streamRequest.omidAccessModeRules = {};\n    var omidValues = this.daiController.getSettings().omidMode;\n\n    if (omidValues.FULL) {\n      streamRequest.omidAccessModeRules[google.ima.OmidAccessMode.FULL] = omidValues.FULL;\n    }\n    if (omidValues.DOMAIN) {\n      streamRequest.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN] = omidValues.DOMAIN;\n    }\n    if (omidValues.LIMITED) {\n      streamRequest.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED] = omidValues.LIMITED;\n    }\n  }\n\n  this.streamManager.requestStream(streamRequest);\n  this.vjsPlayer.trigger({\n    type: 'stream-request',\n    StreamRequest: streamRequest\n  });\n};\n\n/**\n * Initiates IMA when the player is ready.\n */\nSdkImpl$2.prototype.onPlayerReady = function () {\n  this.initImaDai();\n};\n\n/**\n * Reset the StreamManager when the player is disposed.\n */\nSdkImpl$2.prototype.onPlayerDisposed = function () {\n  if (this.streamManager) {\n    this.streamManager.reset();\n  }\n};\n\n/**\n * Returns the instance of the StreamManager.\n * @return {google.ima.StreamManager!} The StreamManager being used by the\n * plugin.\n */\nSdkImpl$2.prototype.getStreamManager = function () {\n  return this.StreamManager;\n};\n\n/**\n * Reset the SDK implementation.\n */\nSdkImpl$2.prototype.reset = function () {\n  if (this.StreamManager) {\n    this.StreamManager.reset();\n  }\n};\n\n/**\n * Copyright 2021 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n/**\n * The coordinator for the DAI portion of the plugin. Facilitates\n * communication between all other plugin classes.\n *\n * @param {Object!} player Instance of the video.js player.\n * @param {Object!} options Options provided by the implementation.\n * @constructor\n * @struct\n * @final\n */\nvar DaiController = function DaiController(player, options) {\n  /**\n  * If the stream is currently in an ad break.\n  * @type {boolean}\n  */\n  this.inAdBreak = false;\n\n  /**\n  * Stores user-provided settings.\n  * @type {Object!}\n  */\n  this.settings = {};\n\n  /**\n  * Whether or not we are running on a mobile platform.\n  */\n  this.isMobile = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i);\n\n  /**\n  * Whether or not we are running on an iOS platform.\n  */\n  this.isIos = navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i);\n\n  this.initWithSettings(options);\n\n  /**\n  * Stores contrib-ads default settings.\n  */\n  var contribAdsDefaults = {\n    debug: this.settings.debug,\n    timeout: this.settings.timeout,\n    prerollTimeout: this.settings.prerollTimeout\n  };\n  var adsPluginSettings = Object.assign({}, contribAdsDefaults, options.contribAdsSettings || {});\n\n  this.playerWrapper = new PlayerWrapper$2(player, adsPluginSettings, this);\n  this.sdkImpl = new SdkImpl$2(this);\n};\n\nDaiController.IMA_DEFAULTS = {\n  adLabel: 'Advertisement',\n  adLabelNofN: 'of',\n  debug: false,\n  disableAdControls: false,\n  showControlsForJSAds: true\n};\n\n/**\n * Extends the settings to include user-provided settings.\n *\n * @param {Object!} options Options to be used in initialization.\n */\nDaiController.prototype.initWithSettings = function (options) {\n  this.settings = Object.assign({}, DaiController.IMA_DEFAULTS, options || {});\n\n  this.warnAboutDeprecatedSettings();\n\n  // Default showing countdown timer to true.\n  this.showCountdown = true;\n  if (this.settings.showCountdown === false) {\n    this.showCountdown = false;\n  }\n};\n\n/**\n * Logs console warnings when deprecated settings are used.\n */\nDaiController.prototype.warnAboutDeprecatedSettings = function () {\n  var _this = this;\n\n  var deprecatedSettings = [\n    // Currently no DAI plugin settings are deprecated.\n  ];\n  deprecatedSettings.forEach(function (setting) {\n    if (_this.settings[setting] !== undefined) {\n      console.warn('WARNING: videojs.imaDai setting ' + setting + ' is deprecated');\n    }\n  });\n};\n\n/**\n * Return the settings object.\n *\n * @return {Object!} The settings object.\n */\nDaiController.prototype.getSettings = function () {\n  return this.settings;\n};\n\n/**\n * Return whether or not we're in a mobile environment.\n *\n * @return {boolean} True if running on mobile, false otherwise.\n */\nDaiController.prototype.getIsMobile = function () {\n  return this.isMobile;\n};\n\n/**\n * Return whether or not we're in an iOS environment.\n *\n * @return {boolean} True if running on iOS, false otherwise.\n */\nDaiController.prototype.getIsIos = function () {\n  return this.isIos;\n};\n\n/**\n * @return {Object!} The html5 player.\n */\nDaiController.prototype.getStreamPlayer = function () {\n  return this.playerWrapper.getStreamPlayer();\n};\n\n/**\n * @return {Object!} The video.js player.\n */\nDaiController.prototype.getVjsPlayer = function () {\n  return this.playerWrapper.getVjsPlayer();\n};\n\n/**\n * Requests the stream.\n */\nDaiController.prototype.requestStream = function () {\n  this.sdkImpl.requestStream();\n};\n\n/**\n * Add or modify a setting.\n *\n * @param {string} key Key to modify\n * @param {Object!} value Value to set at key.\n*/\nDaiController.prototype.setSetting = function (key, value) {\n  this.settings[key] = value;\n};\n\n/**\n * Called when there is an error loading ads.\n *\n * @param {Object!} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nDaiController.prototype.onErrorLoadingAds = function (adErrorEvent) {\n  this.playerWrapper.onAdError(adErrorEvent);\n};\n\n/**\n * Relays ad errors to the player wrapper.\n *\n * @param {Object!} adErrorEvent The ad error event thrown by the IMA SDK.\n */\nDaiController.prototype.onAdError = function (adErrorEvent) {\n  this.playerWrapper.onAdError(adErrorEvent);\n};\n\n/**\n * Signals player that an ad break has started.\n */\nDaiController.prototype.onAdBreakStart = function () {\n  this.inAdBreak = true;\n  this.playerWrapper.onAdBreakStart();\n};\n\n/**\n * Signals player that an ad break has ended.\n */\nDaiController.prototype.onAdBreakEnd = function () {\n  this.inAdBreak = false;\n  this.playerWrapper.onAdBreakEnd();\n};\n\n/**\n * Called when the player is disposed.\n */\nDaiController.prototype.onPlayerDisposed = function () {\n  this.contentAndAdsEndedListeners = [];\n  this.sdkImpl.onPlayerDisposed();\n};\n\n/**\n * Returns if the stream is currently in an ad break.\n * @return {boolean} If the stream is currently in an ad break.\n */\nDaiController.prototype.isInAdBreak = function () {\n  return this.inAdBreak;\n};\n\n/**\n * Called on seek end to check for ad snapback.\n * @param {number} currentTime the current time of the stream.\n */\nDaiController.prototype.onSeekEnd = function (currentTime) {\n  this.sdkImpl.onSeekEnd(currentTime);\n};\n\n/**\n * Called when the player is ready.\n */\nDaiController.prototype.onPlayerReady = function () {\n  this.sdkImpl.onPlayerReady();\n};\n\n/**\n * Resets the state of the plugin.\n */\nDaiController.prototype.reset = function () {\n  this.sdkImpl.reset();\n  this.playerWrapper.reset();\n};\n\n/**\n * Adds an EventListener to the StreamManager. For a list of available events,\n * see\n * https://developers.google.com/interactive-media-ads/docs/sdks/html5/dai/reference/js/StreamEvent\n * @param {google.ima.StreamEvent.Type!} event The AdEvent.Type for which to\n *     listen.\n * @param {callback!} callback The method to call when the event is fired.\n */\nDaiController.prototype.addEventListener = function (event, callback) {\n  this.sdkImpl.addEventListener(event, callback);\n};\n\n/**\n * Returns the instance of the StreamManager.\n * @return {google.ima.StreamManager!} The StreamManager being used by the\n * plugin.\n */\nDaiController.prototype.getStreamManager = function () {\n  return this.sdkImpl.getStreamManager();\n};\n\n/**\n * Returns the instance of the player id.\n * @return {string} The player id.\n */\nDaiController.prototype.getPlayerId = function () {\n  return this.playerWrapper.getPlayerId();\n};\n\n/**\n * @return {boolean} true if we expect that the stream will autoplay. false\n * otherwise.\n */\nDaiController.prototype.streamWillAutoplay = function () {\n  if (this.settings.streamWillAutoplay !== undefined) {\n    return this.settings.streamWillAutoplay;\n  } else {\n    return !!this.playerWrapper.getPlayerOptions().autoplay;\n  }\n};\n\n/**\n * Triggers an event on the VJS player\n * @param  {string} name The event name.\n * @param  {Object!} data The event data.\n */\nDaiController.prototype.triggerPlayerEvent = function (name, data) {\n  this.playerWrapper.triggerPlayerEvent(name, data);\n};\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Copyright 2017 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * IMA SDK integration plugin for Video.js. For more information see\n * https://www.github.com/googleads/videojs-ima\n */\n\n/**\n * Exposes the ImaPlugin to a publisher implementation.\n *\n * @param {Object} player Instance of the video.js player to which this plugin\n *     will be added.\n * @param {Object} options Options provided by the implementation.\n * @constructor\n * @struct\n * @final\n */\nvar ImaPlugin = function ImaPlugin(player, options) {\n  this.controller = new Controller(player, options);\n\n  /**\n   * Listener JSDoc for ESLint. This listener can be passed to\n   * addContent(AndAds)EndedListener.\n   * @callback listener\n   */\n\n  /**\n   * Adds a listener that will be called when content and all ads have\n   * finished playing.\n   * @param {listener} listener The listener to be called when content and ads\n   *     complete.\n   */\n  this.addContentAndAdsEndedListener = function (listener) {\n    this.controller.addContentAndAdsEndedListener(listener);\n  }.bind(this);\n\n  /**\n   * Adds a listener for the 'contentended' event of the video player. This\n   * should be used instead of setting an 'contentended' listener directly to\n   * ensure that the ima can do proper cleanup of the SDK before other event\n   * listeners are called.\n   * @param {listener} listener The listener to be called when content\n   *     completes.\n   */\n  this.addContentEndedListener = function (listener) {\n    this.controller.addContentEndedListener(listener);\n  }.bind(this);\n\n  /**\n   * Callback JSDoc for ESLint. This callback can be passed to addEventListener.\n   * @callback callback\n   */\n\n  /**\n   * Ads an EventListener to the AdsManager. For a list of available events,\n   * see\n   * https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent#.Type\n   * @param {google.ima.AdEvent.Type} event The AdEvent.Type for which to\n   *     listen.\n   * @param {callback} callback The method to call when the event is fired.\n   */\n  this.addEventListener = function (event, callback) {\n    this.controller.addEventListener(event, callback);\n  }.bind(this);\n\n  /**\n   * Changes the ad tag. You will need to call requestAds after this method\n   * for the new ads to be requested.\n   * @param {?string} adTag The ad tag to be requested the next time requestAds\n   *     is called.\n   */\n  this.changeAdTag = function (adTag) {\n    this.controller.changeAdTag(adTag);\n  }.bind(this);\n\n  /**\n   * Returns the instance of the AdsManager.\n   * @return {google.ima.AdsManager} The AdsManager being used by the plugin.\n   */\n  this.getAdsManager = function () {\n    return this.controller.getAdsManager();\n  }.bind(this);\n\n  /**\n   * Initializes the AdDisplayContainer. On mobile, this must be done as a\n   * result of user action.\n   */\n  this.initializeAdDisplayContainer = function () {\n    this.controller.initializeAdDisplayContainer();\n  }.bind(this);\n\n  /**\n   * Pauses the ad.\n   */\n  this.pauseAd = function () {\n    this.controller.pauseAd();\n  }.bind(this);\n\n  /**\n   * Called by publishers in manual ad break playback mode to start an ad\n   * break.\n   */\n  this.playAdBreak = function () {\n    this.controller.playAdBreak();\n  }.bind(this);\n\n  /**\n   * Creates the AdsRequest and request ads through the AdsLoader.\n   */\n  this.requestAds = function () {\n    this.controller.requestAds();\n  }.bind(this);\n\n  /**\n   * Resumes the ad.\n   */\n  this.resumeAd = function () {\n    this.controller.resumeAd();\n  }.bind(this);\n\n  /**\n   * Sets the listener to be called to trigger manual ad break playback.\n   * @param {listener} listener The listener to be called to trigger manual ad\n   *     break playback.\n   */\n  this.setAdBreakReadyListener = function (listener) {\n    this.controller.setAdBreakReadyListener(listener);\n  }.bind(this);\n\n  /**\n   * Sets the content of the video player. You should use this method instead\n   * of setting the content src directly to ensure the proper ad tag is\n   * requested when the video content is loaded.\n   * @param {?string} contentSrc The URI for the content to be played. Leave\n   *     blank to use the existing content.\n   * @param {?string} adTag The ad tag to be requested when the content loads.\n   *     Leave blank to use the existing ad tag.\n   */\n  this.setContentWithAdTag = function (contentSrc, adTag) {\n    this.controller.setContentWithAdTag(contentSrc, adTag);\n  }.bind(this);\n\n  /**\n   * Sets the content of the video player. You should use this method instead\n   * of setting the content src directly to ensure the proper ads response is\n   * used when the video content is loaded.\n   * @param {?string} contentSrc The URI for the content to be played. Leave\n   *     blank to use the existing content.\n   * @param {?string} adsResponse The ads response to be requested when the\n   *     content loads. Leave blank to use the existing ads response.\n   */\n  this.setContentWithAdsResponse = function (contentSrc, adsResponse) {\n    this.controller.setContentWithAdsResponse(contentSrc, adsResponse);\n  }.bind(this);\n\n  /**\n   * Sets the content of the video player. You should use this method instead\n   * of setting the content src directly to ensure the proper ads request is\n   * used when the video content is loaded.\n   * @param {?string} contentSrc The URI for the content to be played. Leave\n   *     blank to use the existing content.\n   * @param {?Object} adsRequest The ads request to be requested when the\n   *     content loads. Leave blank to use the existing ads request.\n   */\n  this.setContentWithAdsRequest = function (contentSrc, adsRequest) {\n    this.controller.setContentWithAdsRequest(contentSrc, adsRequest);\n  }.bind(this);\n\n  /**\n   * Changes the flag to show or hide the ad countdown timer.\n   *\n   * @param {boolean} showCountdownIn Show or hide the countdown timer.\n   */\n  this.setShowCountdown = function (showCountdownIn) {\n    this.controller.setShowCountdown(showCountdownIn);\n  }.bind(this);\n};\n\n/**\n * Exposes the ImaDaiPlugin to a publisher implementation.\n *\n * @param {Object} player Instance of the video.js player to which this plugin\n *     will be added.\n * @param {Object} options Options provided by the implementation.\n * @constructor\n * @struct\n * @final\n */\nvar ImaDaiPlugin = function ImaDaiPlugin(player, options) {\n  this.controller = new DaiController(player, options);\n\n  /**\n   * Adds a listener that will be called when content and all ads in the\n   * stream have finished playing. VOD stream only.\n   * @param {listener} listener The listener to be called when content and ads\n   *     complete.\n   */\n  this.streamEndedListener = function (listener) {\n    this.controller.addStreamEndedListener(listener);\n  }.bind(this);\n\n  /**\n   * Adds an EventListener to the StreamManager.\n   * @param {google.ima.StreamEvent.Type} event The StreamEvent.Type for which\n   * to listen.\n   * @param {callback} callback The method to call when the event is fired.\n   */\n  this.addEventListener = function (event, callback) {\n    this.controller.addEventListener(event, callback);\n  }.bind(this);\n\n  /**\n   * Returns the instance of the StreamManager.\n   * @return {google.ima.StreamManager} The StreamManager being used by the\n   * plugin.\n   */\n  this.getStreamManager = function () {\n    return this.controller.getStreamManager();\n  }.bind(this);\n};\n\n/**\n * Initializes the plugin for client-side ads.\n * @param {Object} options Plugin option set on initiation.\n */\nvar init = function init(options) {\n  /* eslint no-invalid-this: 'off' */\n  this.ima = new ImaPlugin(this, options);\n};\n\n/**\n * LiveStream class used for DAI live streams.\n */\n\nvar LiveStream =\n/**\n * LiveStream class constructor used for DAI live streams.\n * @param {string} streamFormat stream format, plugin currently supports only\n * 'hls' streams.\n * @param {string} assetKey live stream's asset key.\n */\nfunction LiveStream(streamFormat, assetKey) {\n  _classCallCheck(this, LiveStream);\n\n  streamFormat = streamFormat.toLowerCase();\n  if (streamFormat !== 'hls' && streamFormat !== 'dash') {\n    window.console.error('VodStream error: incorrect streamFormat.');\n    return;\n  } else if (streamFormat === 'dash') {\n    window.console.error('streamFormat error: DASH streams are not' + 'currently supported by this plugin.');\n    return;\n  } else if (typeof assetKey !== 'string') {\n    window.console.error('assetKey error: value must be string.');\n    return;\n  }\n  this.streamFormat = streamFormat;\n  this.assetKey = assetKey;\n};\n\n/**\n * VodStream class used for DAI VOD streams.\n */\n\n\nvar VodStream =\n/**\n * VodStream class constructor used for DAI VOD streams.\n * @param {string} streamFormat stream format, plugin currently supports only\n * 'hls' streams.\n * @param {string} cmsId VOD stream's CMS ID.\n * @param {string} videoId VOD stream's video ID.\n */\nfunction VodStream(streamFormat, cmsId, videoId) {\n  _classCallCheck(this, VodStream);\n\n  streamFormat = streamFormat.toLowerCase();\n  if (streamFormat !== 'hls' && streamFormat !== 'dash') {\n    window.console.error('VodStream error: incorrect streamFormat.');\n    return;\n  } else if (streamFormat === 'dash') {\n    window.console.error('streamFormat error: DASH streams are not' + 'currently supported by this plugin.');\n    return;\n  } else if (typeof cmsId !== 'string') {\n    window.console.error('cmsId error: value must be string.');\n    return;\n  } else if (typeof videoId !== 'string') {\n    window.console.error('videoId error: value must be string.');\n    return;\n  }\n\n  this.streamFormat = streamFormat;\n  this.cmsId = cmsId;\n  this.videoId = videoId;\n};\n\n/**\n * Initializes the plugin for DAI ads.\n * @param {Object} stream Accepts either an instance of the LiveStream or\n * VodStream classes.\n * @param {Object} options Plugin option set on initiation.\n */\n\n\nvar initDai = function initDai(stream, options) {\n  if (stream instanceof LiveStream) {\n    options.streamType = 'live';\n    options.assetKey = stream.assetKey;\n  } else if (stream instanceof VodStream) {\n    options.streamType = 'vod';\n    options.cmsId = stream.cmsId;\n    options.videoId = stream.videoId;\n  } else {\n    window.console.error('initDai() first parameter must be an instance of LiveStream or ' + 'VodStream.');\n    return;\n  }\n\n  options.streamFormat = stream.streamFormat;\n  /* eslint no-invalid-this: 'off' */\n  this.imaDai = new ImaDaiPlugin(this, options);\n};\n\nvar registerPlugin = videojs.registerPlugin || videojs.plugin;\nregisterPlugin('ima', init);\nregisterPlugin('imaDai', initDai);\n\nexport { VodStream, LiveStream };\nexport default ImaPlugin;\n","const setTargeting = () => {\n  const profileKey = '_ttprofiles';\n  if (!window[profileKey]) {\n    return encodeURIComponent('&');\n  }\n\n  let custom = '';\n  const ttprofiles = window[profileKey];\n  const tags = {\n    age: ttprofiles.getAge,\n    gender: ttprofiles.getGender,\n    cluster: ttprofiles.getProfiles,\n    subjects: ttprofiles.getSubjects,\n    team: ttprofiles.getTeam,\n    sclass: ttprofiles.getSocialClass,\n    msegments: ttprofiles.getMicrosegments,\n    customaud: ttprofiles.getCustomAudience,\n  };\n\n  Object.keys(tags).forEach((key) => {\n    custom += `${key}=${tags[key]}&`;\n  });\n\n  return encodeURIComponent(custom);\n};\n\nexport default setTargeting;\n","// Esses são alguns exemplos de tag oferecidos pelo Google\n// Mais exemplos aqui:\n// https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags\n\nexport default {\n  singleInlineLinear:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=',\n  singleSkippableLinear:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=',\n  vmapPreroll:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpreonly&cmsid=496&vid=short_onecue&correlator=',\n  vmapPrerollBumper:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpreonlybumper&cmsid=496&vid=short_onecue&correlator=',\n  vmapPostroll:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpostonly&cmsid=496&vid=short_onecue&correlator=',\n  vmapPostrollBumper:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpostonlybumper&cmsid=496&vid=short_onecue&correlator=',\n  vmapPrePostSingle:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=',\n  vmapPreMidPost:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&correlator=',\n  vmapPreMidPostBumper:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpodbumper&cmsid=496&vid=short_onecue&correlator=',\n  vmapPreMidPostBumper5:\n    'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostlongpod&cmsid=496&vid=short_tencue&correlator=',\n};\n","import 'videojs-contrib-ads';\nimport 'videojs-ima';\nimport { hasAdBlock, showAdBlockBreaker } from './adblock';\nimport setTargeting from './tailTarget';\nimport imaSampleTags from './imaSampleTags';\nimport { isInIframe, isLocalhost } from '../helpers/helpers';\nimport getMetadatas from '../utils/get-metadatas';\nimport getParams from '../utils/get-params';\n\nconst isIpad = navigator.userAgent.match(/iPad/i);\nconst isAndroid = navigator.userAgent.match(/Android/i);\nconst isIPhone = navigator.userAgent.match(/iPhone/i);\n\n// tag de teste para local e qa\nconst getTestAdTagUrl = () => {\n  const keys = Object.keys(imaSampleTags);\n  const random = Math.floor(Math.random() * keys.length);\n  const proper = keys[random];\n  return imaSampleTags[proper] ? imaSampleTags[proper] : imaSampleTags[keys[0]];\n};\n\nconst getAdHash = (player) => {\n  const { customAdHash } = getParams(player);\n  if (customAdHash && customAdHash !== 'undefined') {\n    return customAdHash;\n  }\n  const defaultHash = '/7542/r7home/home';\n  const hash = window.r7ad ? window.r7ad.hash : defaultHash;\n\n  return hash;\n};\n\n// url de prod\nconst getProdAdTagUrl = (player) => {\n  const hash = getAdHash(player);\n  const custParams = setTargeting();\n  const sz = '480x360|480x361|768x432';\n  const timestamp = Math.floor(Date.now() / 1000);\n\n  const { duration } = getMetadatas(player);\n  let { mainSectionUrl, sectionPath } = getMetadatas(player);\n  mainSectionUrl = mainSectionUrl.indexOf('//') === 0 ? `https:${mainSectionUrl}` : mainSectionUrl;\n  sectionPath = sectionPath.indexOf('//') === 0 ? `https:${sectionPath}` : sectionPath;\n  const { autoPlay } = getParams(player);\n\n  const referrer = isInIframe() || !document.referrer ? sectionPath : document.referrer;\n  const referrerUrl = encodeURIComponent(referrer);\n  const descriptionUrl = encodeURIComponent(mainSectionUrl);\n\n  // return `https://pubads.g.doubleclick.net/gampad/ads?sz=${sz}&iu=${hash}&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cmsid=496&vid=short_onecue&correlator=&cust_params=${custParams}`;\n\n  return [\n    'https://pubads.g.doubleclick.net/gampad/ads',\n    `?sz=${sz}`,\n    `&iu=${hash}`,\n    '&gdfp_req=1',\n    '&env=vp',\n    '&output=xml_vast4',\n    '&unviewed_position_start=1',\n    '&ad_rule=1',\n    `&vid_d=${duration}`,\n    `&vpa=${autoPlay ? 'auto' : 'click'}`,\n    `&vpmute=${autoPlay ? '1' : '0'}`,\n    '&plcmt=1',\n    `&correlator=${timestamp}`,\n    `&description_url=${descriptionUrl}`,\n    `&url=${referrerUrl}`,\n    `&cust_params=${custParams}`,\n  ].join('');\n};\n\nconst getAdTagUrl = (player) => {\n  const localHost = isLocalhost();\n  if (localHost) {\n    return getTestAdTagUrl();\n  }\n  return getProdAdTagUrl(player);\n};\n\nconst imaAd = (player, adTagUrl) => {\n  // eslint-disable-next-line no-underscore-dangle\n  const el = player.el_;\n  const playerId = player.id();\n  const options = {\n    adLabel: 'Publicidade',\n    adLabelNofN: 'de',\n    id: playerId,\n    adTagUrl,\n    disableCustomPlaybackForIOS10Plus: true,\n  };\n  player.ima(options);\n\n  if (isIpad || isAndroid) {\n    if (el.hasAttribute('controls')) {\n      el.removeAttribute('controls');\n    }\n  }\n\n  let startEvent = 'click';\n  if (isIPhone || isIpad || isAndroid) {\n    startEvent = 'touchend';\n  }\n\n  const initAdDisplayContainer = () => {\n    player.ima.initializeAdDisplayContainer();\n    el.removeEventListener(startEvent, initAdDisplayContainer);\n  };\n\n  el.addEventListener(startEvent, initAdDisplayContainer);\n};\n\nconst imaAdEvents = (player) => {\n  player.on('ads-manager', (response) => {\n    try {\n      const { adsManager } = response;\n      const { Type: AdEventType } = window.google.ima.AdEvent;\n\n      const trigger = (event) => player[event]();\n\n      adsManager.addEventListener(AdEventType.ALL_ADS_COMPLETED, trigger('pause'));\n      adsManager.addEventListener(AdEventType.STARTED, trigger('pause'));\n      adsManager.addEventListener(AdEventType.PAUSED, trigger('pause'));\n      adsManager.addEventListener(AdEventType.RESUMED, trigger('pause'));\n      adsManager.addEventListener(AdEventType.LOADED, trigger('pause'));\n\n      adsManager.addEventListener(AdEventType.AD_BREAK_READY, trigger('play'));\n      adsManager.addEventListener(AdEventType.CONTENT_RESUME_REQUESTED, trigger('play'));\n      adsManager.addEventListener(AdEventType.COMPLETE, trigger('play'));\n      adsManager.addEventListener(AdEventType.USER_CLOSE, trigger('play'));\n      adsManager.addEventListener(AdEventType.SKIPPED, trigger('play'));\n    } catch (unused) {\n      // unused catch error\n    }\n  });\n};\n\nconst initAds = (videojs, player, params, metadatas) => {\n  const { ads } = params;\n  const { disableAdv } = metadatas;\n  const hasNoIma = !(window.google !== undefined);\n\n  if (!ads || disableAdv) {\n    return false;\n  }\n\n  if (hasAdBlock() || hasNoIma) {\n    showAdBlockBreaker(player);\n  } else if (player.ima && window.google) {\n    const adTagUrl = getAdTagUrl(player);\n    imaAd(player, adTagUrl);\n    imaAdEvents(player);\n  }\n\n  return true;\n};\n\nexport default initAds;\n","/**\n * Configures the Youbora plugin for sending player events.\n *\n * Example Usage:\n * vjsYoubora(player, metadatas)\n *\n * @function vjsYoubora\n * @param    {Object} [player={}]\n *           An object of player instance.\n * @param    {Object} [metadatas={}]\n *           An object of video metadatas.\n */\n\nimport youbora from 'youboralib';\nimport 'youbora-adapter-videojs';\nimport { isLiveVideo, isDevelopEnv } from '../helpers/helpers';\n\nconst vjsYoubora = (player, metadatas) => {\n  const r7player = player;\n  const { title } = metadatas;\n\n  const getYouboraLogs = () => {\n    if (isDevelopEnv()) {\n      youbora.Log.logLevel = youbora.Log.Level.DEBUG;\n    }\n  };\n\n  const setAdapter = () => {\n    r7player.youbora.setAdapter(new youbora.adapters.Videojs(player));\n  };\n\n  r7player.on('loadedmetadata', () => {\n    r7player.youbora = new youbora.Plugin({ accountCode: 'tvrecorddev' });\n    getYouboraLogs();\n    setAdapter();\n\n    r7player.youbora.setOptions({\n      'content.title': title,\n      'content.isLive': isLiveVideo(r7player.duration()),\n      'content.duration': r7player.youbora.getDuration(),\n      'content.resource': r7player.youbora.getResource(),\n    });\n  });\n};\n\nexport default vjsYoubora;\n","/* eslint-disable */\nimport { getAdPlacement, getVideoId, isDevelopEnv, isLiveVideo } from '../helpers/helpers';\nimport getMetadatas from '../utils/get-metadatas';\nimport { loadScript } from '../helpers/script-loader';\n\nconst publisherId = '14194541';\nconst applicationName = 'R7 Player';\n\nconst configureGlobalComscore = () => {\n  const analytics = ns_;\n\n  analytics.PlatformApi.setPlatformAPI(analytics.PlatformApi.PlatformApis.WebBrowser);\n\n  const myPublisherConfig = new analytics.configuration.PublisherConfiguration({\n    publisherId,\n    persistentLabels: {\n      cs_ucfr: '', // aceite o usuário - 0: não aceito; 1: aceito; vazio é sem resposta\n    },\n  });\n  analytics.configuration.addClient(myPublisherConfig);\n  analytics.configuration.setApplicationName(applicationName);\n\n  if (isDevelopEnv()) {\n    analytics.configuration.enableImplementationValidationMode();\n  }\n  analytics.start();\n\n  return analytics;\n};\n\nconst configureStreamingAnalytics = (analytics) => {\n  const sa = new analytics.StreamingAnalytics();\n  sa.setMediaPlayerName(applicationName);\n  // sa.setMediaPlayerVersion('1.2.3');\n\n  return sa;\n};\n\nconst getMediaType = (player) => {\n  const classificationTypes = {\n    video: {\n        shortform: 'vc11',\n        longform: 'vc12',\n        live: 'vc13',\n        audio: 'ac00',\n        other: 'vc00'\n    },\n    ad: {\n        preroll: 'va11',\n        midroll: 'va12',\n        postroll: 'va13',\n        live: 'va21',\n        audio: 'aa00',\n        other: 'va00'\n    }\n  };\n\n  const duration = player.duration();\n  if (Number.isNaN(duration)) {\n    return classificationTypes.video.other;\n  }\n\n  if (isLiveVideo(duration)) {\n    return classificationTypes.video.live;\n  }\n\n  const tenMinutes = 10 * 60; // em segundos\n  if (duration > tenMinutes) {\n    return classificationTypes.video.longform;\n  }\n  return classificationTypes.video.shortform;\n};\n\nconst getUniqueId = (player) => {\n  const id = getVideoId(player);\n  return id || '0';\n};\n\nconst getLength = (player) => {\n  const duration = player.duration();\n  return isLiveVideo(duration) ? 0 : parseInt(duration, 10) * 1000;\n};\n\nconst getProgramTitle = (sectionPath) => {\n  if (sectionPath.trim() === '') {\n    return '*null';\n  }\n  return sectionPath.split('/').reverse()[0];\n};\n\nconst getContentMetadata = (player) => {\n  const metadata = getMetadatas(player);\n  const { mainSection, subSection, sectionPath, title } = metadata;\n\n  const mediaType = getMediaType(player);\n  const uniqueId = getUniqueId(player);\n  const length = getLength(player);\n  const programTitle = getProgramTitle(sectionPath);\n  const publisherName = 'RecordTV';\n  const defaultDictionaryClassification = 'R7';\n  const defaultEmptyValue = '*null';\n  const genreName = `${mainSection},${subSection}`;\n  const completeEpisode = '1';\n  const contentType = 'video'; \n\n  const cm = {\n    ns_st_ct: mediaType,\n    ns_st_ci: uniqueId,\n    ns_st_cl: length,\n    ns_st_st: mainSection,\n    ns_st_pu: publisherName,\n    ns_st_pr: programTitle,\n    ns_st_ep: title,\n    ns_st_ge: genreName,\n    ns_st_ce: completeEpisode,\n    ns_st_ty: contentType, \n    c3: defaultDictionaryClassification,\n    c4: defaultEmptyValue,\n    c6: defaultEmptyValue,\n  }\n\n  return cm;\n};\n\nconst getAdvertisementMetadata = (analytics, cm, player) => {\n  const adPlacementType = getAdPlacement(player);\n  const adTypes = {\n    'pre-roll': analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_PRE_ROLL,\n    'mid-roll': analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_MID_ROLL,\n    'post-roll': analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.ON_DEMAND_POST_ROLL,\n  };\n  const defaultAdType = analytics.StreamingAnalytics.AdvertisementMetadata.AdvertisementType.OTHER;\n\n  // tipo da publicidade\n  const type = adTypes[adPlacementType] || defaultAdType;\n\n  const am = new analytics.StreamingAnalytics.AdvertisementMetadata();\n  am.setMediaType(type);\n  am.setRelatedContentMetadata(cm);\n\n  return am;\n};\n\nconst setComScoreEvents = (player, streaming, cm, am) => {\n  // Definição da mídia utilizada (principal ou publicidade)\n  player.on('ready', () => streaming.setMetadata(cm));\n  player.on('tracking:adStart', () => streaming.setMetadata(am));\n  player.on('tracking:adEnd', () => streaming.setMetadata(cm));\n  player.on('tracking:adSkip', () => streaming.setMetadata(cm));\n\n  player.on('waiting', () => streaming.notifyBufferStart());\n  player.on('playing', () => streaming.notifyBufferStop());\n  player.on('play', () => streaming.notifyPlay());\n  player.on('pause', () => streaming.notifyPause());\n  player.on('ended', () => streaming.notifyEnd());\n  player.on('error', () => streaming.notifyEnd());\n  player.on('seeking', () => streaming.notifySeekStart());\n\n  player.on('seeked', () => {\n    const time = player.currentTime().toFixed(0);\n    streaming.startFromPosition(time * 1000);\n  });\n\n  player.on('ratechange', () => {\n    const rate = player.playbackRate();\n    streaming.notifyChangePlaybackRate(rate);\n  });\n};\n\nconst loadComscore = () => {\n  const src = 'https://sb.scorecardresearch.com/plugins/streaming-videojs/v1/current.js?v=1';\n\n  loadScript(src);\n};\n\nconst initComscore = (player) => {\n  let comscorePlugin\n  loadComscore();\n\n  player.on('ready', () => {\n    player.on('loadedmetadata', () => {\n\n      comscorePlugin = player.ComScore({publisherId});\n\n      const contentMetadata = getContentMetadata(player);\n\n      for (let labelName in contentMetadata) {\n        if (contentMetadata.hasOwnProperty(labelName)) {\n          player.el_.dataset[labelName] = contentMetadata[labelName]\n        }\n      } \n\n      comscorePlugin.getPlaybackSession().getAsset().setLabels(contentMetadata)      \n    });\n  });\n};\n\nexport default initComscore;\n","/*\n * Lightweight JSONP fetcher\n * Copyright 2010-2012 Erik Karlsson. All rights reserved.\n * BSD licensed\n * @flow\n */\n\n/* jshint ignore: start */\n/*\n * Usage:\n *\n * JSONP.get( 'someUrl.php', {param1:'123', param2:'456'}, function(data){\n *   do something with data, which is the JSON object you should retrieve from someUrl.php\n * });\n */\n\nlet counter = 0;\nlet head;\nlet query;\nlet config = {};\n\nfunction load(url) {\n  const script = document.createElement('script');\n  let done = false;\n\n  script.src = url;\n  script.async = true;\n\n  script.onreadystatechange = function onreadystatechange() {\n    if (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) {\n      done = true;\n      script.onreadystatechange = null;\n      script.onload = script.onreadystatechange;\n      if (script && script.parentNode) {\n        script.parentNode.removeChild(script);\n      }\n    }\n  };\n\n  script.onload = script.onreadystatechange;\n\n  if (!head) {\n    [head] = document.getElementsByTagName('head');\n  }\n\n  try {\n    head.appendChild(script);\n  } catch (error) {\n    // console.log('JSONP - Error: ' + error);\n  }\n\n  return script;\n}\n\nfunction encode(str) {\n  return encodeURIComponent(str);\n}\n\nconst JSONP = {\n  init(obj) {\n    config = obj;\n  },\n\n  get(url, params, callback, callbackName) {\n    const parameters = params || {};\n\n    query = (url || '').indexOf('?') === -1 ? '?' : '&';\n\n    Object.entries(parameters).forEach(([key, param]) => {\n      query += `${encode(key)}=${encode(String(param))}&`;\n    });\n\n    const name = `json${(counter += 1)}`;\n\n    window[name] = function onCallback(data) {\n      callback(data);\n      try {\n        delete window[name];\n      } catch (e) {\n        // do nothing\n      }\n\n      window[name] = null;\n    };\n\n    this.load = load(`${url}${query}${callbackName || config[callbackName] || 'callback'}=${name}`);\n\n    return name;\n  },\n};\n\nexport default JSONP;\n","import { getVideoId } from '../helpers/helpers';\nimport JSONP from '../helpers/jsonp';\n\nconst randomizeNumber = () => {\n  const n = 999999999;\n  const date = new Date().getTime();\n  const randomNumber = Math.random() * n;\n  const roundNumber = Math.floor(date + randomNumber);\n\n  return roundNumber;\n};\n\nconst isPlaylist = () =>\n  document.referrer.search('tv.r7.com') !== -1 || window.location.pathname.includes('/playlist/');\n\nconst formatCategories = (player, message) => {\n  const mensagem = message;\n  const path = window.location.href.split('/');\n\n  path\n    .filter((e, i) => !e.includes('http') && !e.includes('https') && i !== path.length - 1 && e.trim() !== '')\n    .forEach((e, i) => {\n      const category = i === 0 ? 'category' : `subCategory${i}`;\n      const [categoryName] = e.split(':');\n\n      mensagem[category] = categoryName;\n    });\n};\n\nconst sendLog = (message) => {\n  const url = '//log-ads.r7.com';\n  JSONP.get(url, message);\n};\n\nconst log = (player) => {\n  const rawParams = player.tagAttributes['data-player-params'] || player.tagAttributes.player_params;\n\n  const playerParams = JSON.parse(rawParams);\n  let { referrerUrl } = playerParams;\n  [referrerUrl] = (referrerUrl || '').split('?');\n\n  const message = {\n    playerName: 'videojs',\n    playerVersion: '1.0.0',\n    id: getVideoId(player),\n    event: 'main_media_started',\n    mediaType: 'mainMedia',\n    playerType: 'html5',\n    rdm: randomizeNumber(10000000),\n    referrerPlayer: referrerUrl,\n    R7Tv: isPlaylist(),\n  };\n  formatCategories(player, message);\n\n  sendLog(message);\n};\n\nconst kibana = (player) => {\n  player.on('tracking:main_media_started', () => {\n    log(player);\n  });\n};\n\nexport default kibana;\n","/**\n * Returns an object with the player's metadatas\n * sent by the <video> tag.\n *\n * Example Usage:\n * const metadatas = getMetadatas(player)\n *\n * @function getMetadatas\n * @param    {Object} [player={}]\n *           An object of player instance.\n */\n\nimport { toBoolean, formatDate, verifyUrl } from '../helpers/helpers';\n\nconst getMetadatas = (player) => {\n  const r7player = player;\n  const rawMetadata = r7player.tagAttributes['data-metadata'] || r7player.tagAttributes.metadata;\n  const playerMetadata = JSON.parse(rawMetadata);\n  const {\n    title,\n    mainSection,\n    subSection,\n    thirdSection,\n    sectionName,\n    views,\n    disableAdv,\n    createdDate,\n    mainSectionUrl,\n    sectionPath,\n    ageRating,\n    ageRatingDescription,\n    duration,\n    playerUrl,\n  } = playerMetadata;\n\n  const formatedCreatedDate = formatDate(createdDate);\n\n  const datas = {\n    title,\n    mainSection,\n    subSection,\n    thirdSection,\n    sectionName,\n    views,\n    disableAdv: toBoolean(disableAdv),\n    createdDate: formatedCreatedDate.getFullDate,\n    createdHour: formatedCreatedDate.getFullTime,\n    mainSectionUrl: verifyUrl(mainSectionUrl),\n    sectionPath: verifyUrl(sectionPath),\n    ageRating,\n    ageRatingDescription,\n    duration: parseInt(duration, 10),\n    playerUrl,\n  };\n\n  return datas;\n};\n\nexport default getMetadatas;\n","const url = new URL(document.currentScript.src);\n// eslint-disable-next-line camelcase\n__webpack_public_path__ = url.origin + __webpack_public_path__;\n","/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT © Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n  \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n  try {\n    return document.execCommand(type);\n  } catch (err) {\n    return false;\n  }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n  var selectedText = select_default()(target);\n  command('cut');\n  return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n  var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n  var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n  fakeElement.style.fontSize = '12pt'; // Reset box model\n\n  fakeElement.style.border = '0';\n  fakeElement.style.padding = '0';\n  fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n  fakeElement.style.position = 'absolute';\n  fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n  var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n  fakeElement.style.top = \"\".concat(yPosition, \"px\");\n  fakeElement.setAttribute('readonly', '');\n  fakeElement.value = value;\n  return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n  var fakeElement = createFakeElement(value);\n  options.container.appendChild(fakeElement);\n  var selectedText = select_default()(fakeElement);\n  command('copy');\n  fakeElement.remove();\n  return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n    container: document.body\n  };\n  var selectedText = '';\n\n  if (typeof target === 'string') {\n    selectedText = fakeCopyAction(target, options);\n  } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n    // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n    selectedText = fakeCopyAction(target.value, options);\n  } else {\n    selectedText = select_default()(target);\n    command('copy');\n  }\n\n  return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  // Defines base properties passed from constructor.\n  var _options$action = options.action,\n      action = _options$action === void 0 ? 'copy' : _options$action,\n      container = options.container,\n      target = options.target,\n      text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n  if (action !== 'copy' && action !== 'cut') {\n    throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n  } // Sets the `target` property using an element that will be have its content copied.\n\n\n  if (target !== undefined) {\n    if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n      if (action === 'copy' && target.hasAttribute('disabled')) {\n        throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n      }\n\n      if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n        throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n      }\n    } else {\n      throw new Error('Invalid \"target\" value, use a valid Element');\n    }\n  } // Define selection strategy based on `text` property.\n\n\n  if (text) {\n    return actions_copy(text, {\n      container: container\n    });\n  } // Defines which selection strategy based on `target` property.\n\n\n  if (target) {\n    return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n      container: container\n    });\n  }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n  var attribute = \"data-clipboard-\".concat(suffix);\n\n  if (!element.hasAttribute(attribute)) {\n    return;\n  }\n\n  return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n  _inherits(Clipboard, _Emitter);\n\n  var _super = _createSuper(Clipboard);\n\n  /**\n   * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n   * @param {Object} options\n   */\n  function Clipboard(trigger, options) {\n    var _this;\n\n    _classCallCheck(this, Clipboard);\n\n    _this = _super.call(this);\n\n    _this.resolveOptions(options);\n\n    _this.listenClick(trigger);\n\n    return _this;\n  }\n  /**\n   * Defines if attributes would be resolved using internal setter functions\n   * or custom functions that were passed in the constructor.\n   * @param {Object} options\n   */\n\n\n  _createClass(Clipboard, [{\n    key: \"resolveOptions\",\n    value: function resolveOptions() {\n      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n      this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n      this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n      this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n    }\n    /**\n     * Adds a click event listener to the passed trigger.\n     * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n     */\n\n  }, {\n    key: \"listenClick\",\n    value: function listenClick(trigger) {\n      var _this2 = this;\n\n      this.listener = listen_default()(trigger, 'click', function (e) {\n        return _this2.onClick(e);\n      });\n    }\n    /**\n     * Defines a new `ClipboardAction` on each click event.\n     * @param {Event} e\n     */\n\n  }, {\n    key: \"onClick\",\n    value: function onClick(e) {\n      var trigger = e.delegateTarget || e.currentTarget;\n      var action = this.action(trigger) || 'copy';\n      var text = actions_default({\n        action: action,\n        container: this.container,\n        target: this.target(trigger),\n        text: this.text(trigger)\n      }); // Fires an event based on the copy operation result.\n\n      this.emit(text ? 'success' : 'error', {\n        action: action,\n        text: text,\n        trigger: trigger,\n        clearSelection: function clearSelection() {\n          if (trigger) {\n            trigger.focus();\n          }\n\n          window.getSelection().removeAllRanges();\n        }\n      });\n    }\n    /**\n     * Default `action` lookup function.\n     * @param {Element} trigger\n     */\n\n  }, {\n    key: \"defaultAction\",\n    value: function defaultAction(trigger) {\n      return getAttributeValue('action', trigger);\n    }\n    /**\n     * Default `target` lookup function.\n     * @param {Element} trigger\n     */\n\n  }, {\n    key: \"defaultTarget\",\n    value: function defaultTarget(trigger) {\n      var selector = getAttributeValue('target', trigger);\n\n      if (selector) {\n        return document.querySelector(selector);\n      }\n    }\n    /**\n     * Allow fire programmatically a copy action\n     * @param {String|HTMLElement} target\n     * @param {Object} options\n     * @returns Text copied.\n     */\n\n  }, {\n    key: \"defaultText\",\n\n    /**\n     * Default `text` lookup function.\n     * @param {Element} trigger\n     */\n    value: function defaultText(trigger) {\n      return getAttributeValue('text', trigger);\n    }\n    /**\n     * Destroy lifecycle.\n     */\n\n  }, {\n    key: \"destroy\",\n    value: function destroy() {\n      this.listener.destroy();\n    }\n  }], [{\n    key: \"copy\",\n    value: function copy(target) {\n      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n        container: document.body\n      };\n      return actions_copy(target, options);\n    }\n    /**\n     * Allow fire programmatically a cut action\n     * @param {String|HTMLElement} target\n     * @returns Text cutted.\n     */\n\n  }, {\n    key: \"cut\",\n    value: function cut(target) {\n      return actions_cut(target);\n    }\n    /**\n     * Returns the support of the given action, or all actions if no action is\n     * given.\n     * @param {String} [action]\n     */\n\n  }, {\n    key: \"isSupported\",\n    value: function isSupported() {\n      var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n      var actions = typeof action === 'string' ? [action] : action;\n      var support = !!document.queryCommandSupported;\n      actions.forEach(function (action) {\n        support = support && !!document.queryCommandSupported(action);\n      });\n      return support;\n    }\n  }]);\n\n  return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n    var proto = Element.prototype;\n\n    proto.matches = proto.matchesSelector ||\n                    proto.mozMatchesSelector ||\n                    proto.msMatchesSelector ||\n                    proto.oMatchesSelector ||\n                    proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n    while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n        if (typeof element.matches === 'function' &&\n            element.matches(selector)) {\n          return element;\n        }\n        element = element.parentNode;\n    }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n    var listenerFn = listener.apply(this, arguments);\n\n    element.addEventListener(type, listenerFn, useCapture);\n\n    return {\n        destroy: function() {\n            element.removeEventListener(type, listenerFn, useCapture);\n        }\n    }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n    // Handle the regular Element usage\n    if (typeof elements.addEventListener === 'function') {\n        return _delegate.apply(null, arguments);\n    }\n\n    // Handle Element-less usage, it defaults to global delegation\n    if (typeof type === 'function') {\n        // Use `document` as the first parameter, then apply arguments\n        // This is a short way to .unshift `arguments` without running into deoptimizations\n        return _delegate.bind(null, document).apply(null, arguments);\n    }\n\n    // Handle Selector-based usage\n    if (typeof elements === 'string') {\n        elements = document.querySelectorAll(elements);\n    }\n\n    // Handle Array-like based usage\n    return Array.prototype.map.call(elements, function (element) {\n        return _delegate(element, selector, type, callback, useCapture);\n    });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n    return function(e) {\n        e.delegateTarget = closest(e.target, selector);\n\n        if (e.delegateTarget) {\n            callback.call(element, e);\n        }\n    }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n    return value !== undefined\n        && value instanceof HTMLElement\n        && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n    var type = Object.prototype.toString.call(value);\n\n    return value !== undefined\n        && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n        && ('length' in value)\n        && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n    return typeof value === 'string'\n        || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n    var type = Object.prototype.toString.call(value);\n\n    return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n    if (!target && !type && !callback) {\n        throw new Error('Missing required arguments');\n    }\n\n    if (!is.string(type)) {\n        throw new TypeError('Second argument must be a String');\n    }\n\n    if (!is.fn(callback)) {\n        throw new TypeError('Third argument must be a Function');\n    }\n\n    if (is.node(target)) {\n        return listenNode(target, type, callback);\n    }\n    else if (is.nodeList(target)) {\n        return listenNodeList(target, type, callback);\n    }\n    else if (is.string(target)) {\n        return listenSelector(target, type, callback);\n    }\n    else {\n        throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n    }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n    node.addEventListener(type, callback);\n\n    return {\n        destroy: function() {\n            node.removeEventListener(type, callback);\n        }\n    }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n    Array.prototype.forEach.call(nodeList, function(node) {\n        node.addEventListener(type, callback);\n    });\n\n    return {\n        destroy: function() {\n            Array.prototype.forEach.call(nodeList, function(node) {\n                node.removeEventListener(type, callback);\n            });\n        }\n    }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n    return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n    var selectedText;\n\n    if (element.nodeName === 'SELECT') {\n        element.focus();\n\n        selectedText = element.value;\n    }\n    else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n        var isReadOnly = element.hasAttribute('readonly');\n\n        if (!isReadOnly) {\n            element.setAttribute('readonly', '');\n        }\n\n        element.select();\n        element.setSelectionRange(0, element.value.length);\n\n        if (!isReadOnly) {\n            element.removeAttribute('readonly');\n        }\n\n        selectedText = element.value;\n    }\n    else {\n        if (element.hasAttribute('contenteditable')) {\n            element.focus();\n        }\n\n        var selection = window.getSelection();\n        var range = document.createRange();\n\n        range.selectNodeContents(element);\n        selection.removeAllRanges();\n        selection.addRange(range);\n\n        selectedText = selection.toString();\n    }\n\n    return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n  // Keep this empty so it's easier to inherit from\n  // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n  on: function (name, callback, ctx) {\n    var e = this.e || (this.e = {});\n\n    (e[name] || (e[name] = [])).push({\n      fn: callback,\n      ctx: ctx\n    });\n\n    return this;\n  },\n\n  once: function (name, callback, ctx) {\n    var self = this;\n    function listener () {\n      self.off(name, listener);\n      callback.apply(ctx, arguments);\n    };\n\n    listener._ = callback\n    return this.on(name, listener, ctx);\n  },\n\n  emit: function (name) {\n    var data = [].slice.call(arguments, 1);\n    var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n    var i = 0;\n    var len = evtArr.length;\n\n    for (i; i < len; i++) {\n      evtArr[i].fn.apply(evtArr[i].ctx, data);\n    }\n\n    return this;\n  },\n\n  off: function (name, callback) {\n    var e = this.e || (this.e = {});\n    var evts = e[name];\n    var liveEvents = [];\n\n    if (evts && callback) {\n      for (var i = 0, len = evts.length; i < len; i++) {\n        if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n          liveEvents.push(evts[i]);\n      }\n    }\n\n    // Remove event from queue to prevent memory leak\n    // Suggested by https://github.com/lazd\n    // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n    (liveEvents.length)\n      ? e[name] = liveEvents\n      : delete e[name];\n\n    return this;\n  }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"images/ic_cast_white_24dp.png\", import.meta.url);\nvar ___CSS_LOADER_URL_IMPORT_1___ = new URL(\"images/ic_cast_connected_white_24dp.png\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\nvar ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.vjs-chromecast-button .vjs-icon-placeholder{background:url(${___CSS_LOADER_URL_REPLACEMENT_0___}) center center no-repeat;background-size:contain;display:inline-block;width:12px;height:12px}.vjs-chromecast-button:hover{cursor:pointer}.vjs-chromecast-button:hover .vjs-icon-placeholder{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden){display:flex;align-items:center;width:auto;padding:0 4px}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden) .vjs-chromecast-button-label{flex-grow:1;margin-left:4px}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden) .vjs-icon-placeholder{flex-grow:1}.vjs-tech-chromecast{display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden}.vjs-tech-chromecast .vjs-tech-chromecast-poster::after{content:\" \";display:block;height:2px;width:100px;background-color:#ccc;position:absolute;left:calc(50% - 50px)}.vjs-tech-chromecast .vjs-tech-chromecast-poster-img{max-height:180px;width:auto;border:2px solid #ccc}.vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty{width:160px;height:90px}.vjs-tech-chromecast .vjs-tech-chromecast-title-container{position:absolute;bottom:50%;margin-bottom:100px;color:#ccc;text-align:center}.vjs-tech-chromecast .vjs-tech-chromecast-title{font-size:22px}.vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty{display:none}.vjs-tech-chromecast .vjs-tech-chromecast-subtitle{font-size:18px;padding-top:.5em}.vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty{display:none}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@silvermine/videojs-chromecast/dist/silvermine-videojs-chromecast.css\"],\"names\":[],\"mappings\":\"AAAA,6CAA6C,0EAAuE,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,UAAU,CAAC,WAAW,CAAC,6BAA6B,cAAc,CAAC,mDAAmD,wDAAqD,CAAC,0EAA0E,wDAA+D,CAAC,gFAAgF,wDAA+D,CAAC,iEAAiE,YAAY,CAAC,kBAAkB,CAAC,UAAU,CAAC,aAAa,CAAC,8FAA8F,WAAW,CAAC,eAAe,CAAC,uFAAuF,WAAW,CAAC,qBAAqB,YAAY,CAAC,qBAAqB,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,eAAe,CAAC,wDAAwD,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,qDAAqD,gBAAgB,CAAC,UAAU,CAAC,qBAAqB,CAAC,0FAA0F,WAAW,CAAC,WAAW,CAAC,0DAA0D,iBAAiB,CAAC,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC,iBAAiB,CAAC,gDAAgD,cAAc,CAAC,gFAAgF,YAAY,CAAC,mDAAmD,cAAc,CAAC,gBAAgB,CAAC,sFAAsF,YAAY\",\"sourcesContent\":[\".vjs-chromecast-button .vjs-icon-placeholder{background:url(\\\"images/ic_cast_white_24dp.png\\\") center center no-repeat;background-size:contain;display:inline-block;width:12px;height:12px}.vjs-chromecast-button:hover{cursor:pointer}.vjs-chromecast-button:hover .vjs-icon-placeholder{background-image:url(\\\"images/ic_cast_white_24dp.png\\\")}.vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder{background-image:url(\\\"images/ic_cast_connected_white_24dp.png\\\")}.vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder{background-image:url(\\\"images/ic_cast_connected_white_24dp.png\\\")}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden){display:flex;align-items:center;width:auto;padding:0 4px}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden) .vjs-chromecast-button-label{flex-grow:1;margin-left:4px}.vjs-chromecast-button.vjs-chromecast-button-lg:not(.vjs-hidden) .vjs-icon-placeholder{flex-grow:1}.vjs-tech-chromecast{display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden}.vjs-tech-chromecast .vjs-tech-chromecast-poster::after{content:\\\" \\\";display:block;height:2px;width:100px;background-color:#ccc;position:absolute;left:calc(50% - 50px)}.vjs-tech-chromecast .vjs-tech-chromecast-poster-img{max-height:180px;width:auto;border:2px solid #ccc}.vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty{width:160px;height:90px}.vjs-tech-chromecast .vjs-tech-chromecast-title-container{position:absolute;bottom:50%;margin-bottom:100px;color:#ccc;text-align:center}.vjs-tech-chromecast .vjs-tech-chromecast-title{font-size:22px}.vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty{display:none}.vjs-tech-chromecast .vjs-tech-chromecast-subtitle{font-size:18px;padding-top:.5em}.vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty{display:none}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/video.js/dist/video-js.min.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_2___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-share/dist/videojs-share.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_3___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-errors/dist/videojs-errors.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_4___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-logo/dist/videojs-logo.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_5___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-contrib-ads/dist/videojs.ads.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_6___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-ima/dist/videojs.ima.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_7___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/videojs-overlay/dist/videojs-overlay.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_8___ from \"-!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/@silvermine/videojs-chromecast/dist/silvermine-videojs-chromecast.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_4___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_5___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_6___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_7___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_8___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.video-js{width:100%;min-width:320px;max-width:100%;height:auto}video::-internal-media-controls-overlay-cast-button{display:none}@font-face{font-family:\"Material Icons\";font-style:normal;font-weight:400;font-display:block;src:url(https://fonts.gstatic.com/s/materialicons/v55/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format(\"woff2\")}@font-face{font-family:\"Material Icons Outlined\";font-style:normal;font-weight:400;font-display:block;src:url(https://fonts.gstatic.com/s/materialiconsoutlined/v27/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2) format(\"woff2\")}@font-face{font-family:\"Material Icons Round\";font-style:normal;font-weight:400;font-display:block;src:url(https://fonts.gstatic.com/s/materialiconsround/v26/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmP.woff2) format(\"woff2\")}@font-face{font-family:\"Material Icons Sharp\";font-style:normal;font-weight:400;font-display:block;src:url(https://fonts.gstatic.com/s/materialiconssharp/v27/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvR.woff2) format(\"woff2\")}@font-face{font-family:\"Material Icons Two Tone\";font-style:normal;font-weight:400;font-display:block;src:url(https://fonts.gstatic.com/s/materialiconstwotone/v25/hESh6WRmNCxEqUmNyh3JDeGxjVVyMg4tHGctNCu0.woff2) format(\"woff2\")}.material-icons{font-family:\"Material Icons\";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}.material-icons-outlined{font-family:\"Material Icons Outlined\";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}.material-icons-round{font-family:\"Material Icons Round\";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}.material-icons-sharp{font-family:\"Material Icons Sharp\";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}.material-icons-two-tone{font-family:\"Material Icons Two Tone\";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased}.video-js.vjs-r7-skin .vjs-adblock-breaker-modal::before{content:\"⚠\";position:absolute;font-size:2000%;padding-left:10%;top:0;left:0;height:100%;width:100%;z-index:3;background-color:#333;display:flex;align-items:center}.video-js.vjs-r7-skin .vjs-adblock-breaker-modal::after{content:\"Desabilite o AdBlock para que o vídeo seja tocado.\";color:#fff;font-size:350%;line-height:150%;position:absolute;left:40%;height:100%;width:50%;display:flex;align-items:center;z-index:4}.video-js.vjs-r7-skin .ima-ad-container{z-index:9 !important}.video-js.vjs-r7-skin{font-family:\"Open Sans\",Arial,Helvetica,sans-serif;height:100%;max-height:100%;width:100%;max-width:100%;color:#fff}.video-js.vjs-r7-skin,.video-js.vjs-r7-skin *{outline:none}.video-js.vjs-r7-skin .vjs-quality-selector .vjs-menu-item-text{text-transform:capitalize}.video-js.vjs-r7-skin .vjs-no-js{position:absolute;top:0;width:100%}.video-js.vjs-r7-skin .vjs-menu-button .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js.vjs-r7-skin .vjs-slider,.video-js.vjs-r7-skin .video-js{background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js.vjs-r7-skin .vjs-volume-level{background-color:#3086eb;color:#3086eb}.video-js.vjs-r7-skin .vjs-play-progress{background:#3086eb;color:#3086eb}.video-js.vjs-r7-skin .vjs-load-progress{background:#bfc7d3;background:rgba(115,133,159,.5)}.video-js.vjs-r7-skin .vjs-load-progress div{background:#fff;background:rgba(115,133,159,.75)}.video-js.vjs-r7-skin .vjs-big-play-button:focus,.video-js.vjs-r7-skin:hover .vjs-big-play-button{border:none;background:none}.video-js.vjs-r7-skin.vjs-paused.vjs-has-started .vjs-big-play-button{display:block}.video-js.vjs-r7-skin .vjs-big-play-button{margin-left:-0.8em;border-radius:1.6em;height:1em;width:1em;color:#fff;border:none;background:none;font-size:5em;line-height:1em;transition:none;z-index:2;font-size:80px;left:50%;top:50%;margin-left:-0.5em;margin-top:-0.5em}@media screen and (max-width: 768px){.video-js.vjs-r7-skin .vjs-big-play-button{font-size:60px}}.video-js.vjs-r7-skin .vjs-big-play-button .vjs-icon-placeholder:before{font-family:\"Material Icons\";content:\"play_circle_filled\"}.video-js.vjs-r7-skin .vjs-control-bar{background-color:rgba(0,0,0,0);margin-left:16px;margin-right:16px;width:auto;height:42px;display:flex;justify-content:flex-end}.video-js.vjs-r7-skin .vjs-control-bar::before{content:\"\";background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.37) 48%, rgba(0, 0, 0, 0.9));position:absolute;bottom:0;left:-16px;right:-16px;height:60px;z-index:0}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-control-bar{margin-left:24px;margin-right:24px;height:45px}.video-js.vjs-r7-skin .vjs-control-bar::before{left:-24px;right:-24px}}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar{margin-left:6px;margin-right:6px}.video-js.vjs-r7-skin .vjs-control-bar::before{left:-6px;right:-6px}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-menu-button-popup .vjs-menu{border-radius:3px;margin-bottom:25px}.video-js.vjs-r7-skin .vjs-control-bar .vjs-menu-button-popup .vjs-menu-content{border-radius:3px;background-color:#1a1a1a;opacity:.9;padding:16px;font-size:11px;line-height:15px;max-height:none;width:auto;bottom:1.2em;left:-25%}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-control{outline:none;z-index:2}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-progress-control{z-index:1}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-remaining-time{position:absolute;top:-19px;right:0;z-index:1;font-size:.9rem;line-height:1.6rem}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-control-bar>.vjs-remaining-time{top:-16px}}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-icon-share:before{font-size:19px}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-quality-selector{font-size:12px}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-quality-selector .vjs-menu .vjs-menu-content .vjs-menu-item{display:none}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-quality-selector .vjs-valid-quality{display:block !important}.video-js.vjs-r7-skin .vjs-control-bar>.vjs-quality-selector .vjs-menu-content{left:10%}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar>.vjs-quality-selector .vjs-menu-button{display:flex;align-items:center;justify-content:center}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-button{outline:none;width:40px}.video-js.vjs-r7-skin .vjs-control-bar .vjs-button>.vjs-icon-placeholder:before{font-size:24px;line-height:normal;position:static;top:auto;left:auto;width:auto;height:auto}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-button>.vjs-icon-placeholder:before{font-size:20px}}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-button{width:36px}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate .vjs-playback-rate-value,.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate>.vjs-menu-button{top:2px}.video-js.vjs-r7-skin .vjs-control-bar .vjs-progress-control{position:absolute;top:-24px;left:0;width:calc(100% - 50px)}@media(max-width: 425px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-progress-control{width:100%}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-play-control,.video-js.vjs-r7-skin .vjs-control-bar .vjs-volume-panel,.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button{position:absolute;bottom:0;left:0}.video-js.vjs-r7-skin .vjs-control-bar .vjs-volume-panel{left:40px}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-volume-panel{left:32px}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button>.vjs-icon-placeholder:before{font-family:\"VideoJS\"}.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button.skip-back{left:80px}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button.skip-back{left:64px}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button.skip-forward{left:120px;transform:scale(-1, 1)}@media(max-width: 400px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-seek-button.skip-forward{left:96px}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate .vjs-icon-placeholder{display:flex;align-items:center;justify-content:center}.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate .vjs-icon-placeholder::before{font-family:\"Material Icons\";content:\"speed\"}.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate .vjs-menu{width:5em}.video-js.vjs-r7-skin .vjs-control-bar .vjs-playback-rate .vjs-playback-rate-value{line-height:2.5em;display:none}.video-js.vjs-r7-skin .vjs-control-bar .vjs-progress-holder{height:.4em}.video-js.vjs-r7-skin .vjs-control-bar .vjs-chromecast-button .vjs-icon-placeholder{width:25px;height:25px}.video-js.vjs-r7-skin .vjs-control-bar .vjs-progress-holder{height:.4em}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-picture-in-picture-control{display:none}}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-control-bar .vjs-subs-caps-button{display:flex;align-items:center;justify-content:center}}.video-js.vjs-r7-skin .vjs-control-bar .vjs-icon-cog{display:flex;align-items:center;justify-content:center}.video-js.vjs-r7-skin.vjs-live .vjs-seek-button{display:none}.video-js.vjs-r7-skin.vjs-live .vjs-progress-control{display:block;top:-6px;width:100%}.video-js.vjs-r7-skin.vjs-live .vjs-progress-control .vjs-play-progress::before{display:none}.video-js.vjs-r7-skin.vjs-live .vjs-progress-control .vjs-progress-holder{background:#3086eb}@media(min-width: 576px){.video-js.vjs-r7-skin.vjs-live .vjs-progress-control{width:100%}}.video-js.vjs-r7-skin.vjs-live .vjs-live-control{display:none}.video-js.vjs-r7-skin.vjs-live .vjs-seek-to-live-control{display:block;position:absolute;bottom:0;left:80px}.video-js.vjs-r7-skin.vjs-live .vjs-seek-to-live-control .vjs-icon-placeholder{color:red}.video-js.vjs-r7-skin.vjs-videojs-share_open .vjs-control.vjs-close-button::before{font-size:30px}.video-js.vjs-r7-skin.vjs-videojs-share_open .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:\"\"}.video-js.vjs-r7-skin .vjs-time-tooltip,.video-js.vjs-r7-skin .vjs-volume-tooltip{width:max-content}.video-js.vjs-r7-skin .vjs-r7-block-msg__container{font-family:\"Open Sans\";display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.video-js.vjs-r7-skin .vjs-r7-block-msg__icon{font-family:\"Material Icons\";font-size:92px;font-weight:normal;margin-bottom:62px}.video-js.vjs-r7-skin .vjs-r7-block-msg__icon--outline{font-family:\"Material Icons Outlined\"}.video-js.vjs-r7-skin .vjs-r7-block-msg__icon--contained{border:8px solid #fff;border-radius:75px;width:92px;height:92px;text-align:center;font-size:53px}.video-js.vjs-r7-skin .vjs-r7-block-msg__title{font-size:19px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.38;letter-spacing:normal;margin-bottom:13px}.video-js.vjs-r7-skin .vjs-r7-block-msg__desc{font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:1.36;letter-spacing:normal;text-align:center;margin-bottom:28px}.video-js.vjs-r7-skin .vjs-r7-block-msg__button{border:1px solid #fff;border-radius:25px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.29;letter-spacing:normal;text-align:center;padding:10px 17px;color:#fff;text-decoration:none}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-r7-block-msg .vjs-r7-block-msg__icon{font-size:52px;margin-bottom:16px}.video-js.vjs-r7-skin .vjs-r7-block-msg .vjs-r7-block-msg__icon--contained{font-size:30px;border:5px solid #fff;width:52px;height:52px}.video-js.vjs-r7-skin .vjs-r7-block-msg .vjs-r7-block-msg__title{font-size:16px;margin-bottom:8px}.video-js.vjs-r7-skin .vjs-r7-block-msg .vjs-r7-block-msg__desc{font-size:11px;margin-bottom:13px}}.video-js.vjs-r7-skin .vjs-modal-dialog{background-color:#2b333f;font-family:\"Open Sans\",Arial,Helvetica,sans-serif;font-weight:600;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:-0.2px;color:#fff;z-index:3}.video-js.vjs-r7-skin .vjs-r7-suggestednext .vjs-modal-dialog-content>div{display:flex;flex-direction:column;flex-wrap:wrap;justify-content:center;align-items:center;height:100%}.video-js.vjs-r7-skin .vjs-r7-suggestednext__play{background-color:rgba(0,0,0,.1647058824);color:rgba(0,0,0,0);border-radius:50%;height:81px;width:81px;margin-bottom:12px;position:relative}.video-js.vjs-r7-skin .vjs-r7-suggestednext__play::before{content:\"play_arrow\";font-family:\"Material Icons\";font-size:36px;display:flex;align-items:center;justify-content:space-around;background-color:#fff;color:#000;position:absolute;top:10px;right:10px;bottom:11px;left:11px;border-radius:50%;padding-top:2px;padding-left:1px}.video-js.vjs-r7-skin .vjs-r7-suggestednext__play::after{content:\"\";border:4px solid rgba(0,0,0,0);border-radius:50%;border-top:4px solid #2d77d6;animation:vjs-r7-suggestednext__play-spin 2s linear infinite;position:absolute;top:6px;right:6px;bottom:7px;left:7px}.video-js.vjs-r7-skin .vjs-r7-suggestednext__title{font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;line-height:1.29;letter-spacing:normal;text-align:center;max-width:53%}@media(min-width: 768px){.video-js.vjs-r7-skin .vjs-r7-suggestednext__title{font-size:19px}}@keyframes vjs-r7-suggestednext__play-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay{max-width:45%;right:0}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay>div{display:flex}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__item-container{background-color:#000;border:1px solid rgba(255,255,255,.2);border-right:none;display:flex;align-items:center;border-top-left-radius:3px;border-bottom-left-radius:3px}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__item-link{display:flex;align-items:center;color:#fff;font-size:14px;text-decoration:none}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__item-img{width:116px;height:65px;min-width:116px;min-height:65px;border-top-left-radius:3px;border-bottom-left-radius:3px;pointer-events:none}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__item-desc{font-size:12px;line-height:normal;padding:10px;text-align:left;pointer-events:none}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__close-button{width:40px;height:40px;cursor:pointer;align-self:baseline}.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__close-button::before{content:\"×\";font-size:20px;line-height:15px}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-r7-suggestedoverlay__item-img{display:none}}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-modal-dialog-content>div{display:flex;flex-wrap:wrap;justify-content:center;align-items:center}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container{color:#fff;font-size:14px;line-height:1.36;height:auto;max-height:56%;width:47%;position:relative;text-decoration:none;margin-left:16px;margin-bottom:20px}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container:nth-child(1){margin-left:0}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container:nth-child(3){display:none}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container::before{content:\"\";background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));position:absolute;top:0;left:0;right:0;bottom:5px;z-index:1}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-img{width:100%}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-desc{font-size:11px;font-weight:normal;line-height:1.36;position:absolute;bottom:8px;right:8px;left:8px;z-index:2}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__review{display:flex;align-items:center;justify-content:center;width:100%;font-size:14px;font-weight:600;line-height:1.29;cursor:pointer}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__review::before{font-family:\"Material Icons\";content:\"autorenew\";font-size:32px;font-weight:normal}@media(min-width: 768px){.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-modal-dialog-content>div{position:absolute;top:32.65%;left:22px;right:22px}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container{margin-left:8px;margin-bottom:42px;width:32%}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__item-container:nth-child(3){display:inline}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__review{justify-content:flex-end}.video-js.vjs-r7-skin .vjs-modal-dialog.vjs-r7-suggestedvideos .vjs-r7-suggestedvideos__review::before{font-size:24px}}.video-js.vjs-r7-skin .vjs-mute-control .vjs-icon-placeholder:before,.video-js.vjs-r7-skin .vjs-icon-volume-high:before{font-family:\"Material Icons Outlined\";content:\"volume_up\"}.video-js.vjs-r7-skin .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.video-js.vjs-r7-skin .vjs-icon-volume-mute:before{font-family:\"Material Icons Outlined\";content:\"volume_off\"}.video-js.vjs-r7-skin .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.video-js.vjs-r7-skin .vjs-icon-volume-low:before{font-family:\"Material Icons Outlined\";content:\"volume_mute\"}.video-js.vjs-r7-skin .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.video-js.vjs-r7-skin .vjs-icon-volume-mid:before{font-family:\"Material Icons Outlined\";content:\"volume_down\"}.video-js.vjs-r7-skin .vjs-share{justify-content:center}.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__bottom:before{width:auto;min-width:324px}.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__bottom:after{border-bottom:0px}.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__bottom>.vjs-share__socials{align-content:center;justify-content:center}.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__middle{display:none}.video-js.vjs-r7-skin .vjs-modal-dialog-content{overflow:hidden}.video-js.vjs-r7-skin .vjs-share__title{display:none}.video-js.vjs-r7-skin .vjs-share__subtitle{opacity:1}.video-js.vjs-r7-skin .vjs-share__short-link{opacity:0}.video-js.vjs-r7-skin .vjs-share__short-link--small{padding:10px 40px 10px 10px;overflow:hidden;font-size:11px;line-height:14px;background:#363636;outline:none;border:none;width:100%;height:100%;color:#fff;font-family:\"Open Sans\",Arial,Helvetica,sans-serif;resize:none;top:0px;left:0px;position:absolute}.video-js.vjs-r7-skin .vjs-share__middle{width:50%;order:1;min-width:260px}.video-js.vjs-r7-skin .vjs-share__middle>.vjs-share__short-link-wrapper{display:none}.video-js.vjs-r7-skin .vjs-share__middle>.vjs-share__short-link-wrapper~.vjs-share__short-link-wrapper{display:block}.video-js.vjs-r7-skin .vjs-share__middle>.vjs-share__subtitle{display:block}.video-js.vjs-r7-skin .vjs-share__middle>.vjs-share__subtitle~.vjs-share__subtitle{display:none}.video-js.vjs-r7-skin .vjs-share__bottom{width:50%;min-width:260px;padding:0 25px;order:0;margin-bottom:25px;margin-top:50px}.video-js.vjs-r7-skin .vjs-share__bottom:before{content:\"Redes Sociais:\";width:50%;min-width:260px;position:absolute;padding:0px 25px;margin-top:-36px;font-size:16px}.video-js.vjs-r7-skin .vjs-share__bottom:after{content:\"\";border-bottom:1px solid #fff;width:50%;min-width:240px;position:absolute;margin-top:68px;opacity:.5}.video-js.vjs-r7-skin .vjs-share__socials{width:100%;align-content:flex-start;justify-content:flex-start}.video-js.vjs-r7-skin .vjs-share__social{width:50px;height:50px;margin-right:18px}.video-js.vjs-r7-skin .vjs-share__social svg{pointer-events:none}.video-js.vjs-r7-skin .vjs-share__social_fbFeed,.video-js.vjs-r7-skin .vjs-share__social_tw,.video-js.vjs-r7-skin .vjs-share__social_whatsapp,.video-js.vjs-r7-skin .vjs-share__social_url{background-color:#060708;border:1px solid #fff;border-radius:3em}.video-js.vjs-r7-skin .vjs-share__social_fbFeed:hover,.video-js.vjs-r7-skin .vjs-share__social_tw:hover,.video-js.vjs-r7-skin .vjs-share__social_whatsapp:hover,.video-js.vjs-r7-skin .vjs-share__social_url:hover{background-color:#fff}.video-js.vjs-r7-skin .vjs-share__social_fbFeed:hover svg path,.video-js.vjs-r7-skin .vjs-share__social_tw:hover svg path,.video-js.vjs-r7-skin .vjs-share__social_whatsapp:hover svg path,.video-js.vjs-r7-skin .vjs-share__social_url:hover svg path{fill:#060708}.video-js.vjs-r7-skin .vjs-share__social_tw svg{max-height:18px}.video-js.vjs-r7-skin .vjs-share__social_url{flex-direction:column}.video-js.vjs-r7-skin .vjs-share__social_url:hover:before,.video-js.vjs-r7-skin .vjs-share__social_url:hover:after{color:#060708}.video-js.vjs-r7-skin .vjs-share__social_url:after{width:36px;height:0px;opacity:0;content:\"Copiado!\";color:#fff;transition:.15s linear height}.video-js.vjs-r7-skin .vjs-share__social_url--copied:after{height:20px;opacity:1;transition:none}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-share__social_url--copied{line-height:4px}}.video-js.vjs-r7-skin .vjs-share__short-link-wrapper{height:100px}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-share__short-link-wrapper{height:40px}}.video-js.vjs-r7-skin .vjs-share__short-link{padding:10px 40px 10px 10px;overflow:hidden;font-size:11px;line-height:14px}.video-js.vjs-r7-skin .vjs-share__btn{height:100%}.video-js.vjs-r7-skin .vjs-share__btn svg,.video-js.vjs-r7-skin .vjs-share__btn-text{pointer-events:none}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-share__btn{width:100%;justify-content:center;background-image:none}.video-js.vjs-r7-skin .vjs-share__btn span{opacity:1}}@media(max-width: 576px){.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__bottom:before{min-width:240px}.video-js.vjs-r7-skin .vjs-share--arc>.vjs-share__middle{display:none}.video-js.vjs-r7-skin .vjs-share__social{width:40px;height:40px;margin-right:6px}.video-js.vjs-r7-skin .vjs-share__bottom:after{margin-top:58px}}.video-js.vjs-r7-skin .vjs-overlay-background{background-color:rgba(0,0,0,0);width:100%}.video-js.vjs-r7-skin .vjs-title-text{font-size:16px;margin-bottom:2px;z-index:1;text-align:left;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;line-height:normal;padding-right:40px}.video-js.vjs-r7-skin .vjs-title-text__link{color:#fff;text-decoration:none}.video-js.vjs-r7-skin .vjs-title-text__link:hover{text-decoration:underline}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-title-text{font-size:19px;padding-right:70px}}.video-js.vjs-r7-skin .vjs-title-description{font-size:11px;z-index:1;text-align:left}.video-js.vjs-r7-skin .vjs-title-description__link{color:#fff;text-decoration:none}.video-js.vjs-r7-skin .vjs-title-description__link:hover{text-decoration:underline}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-title-description{font-size:14px}}.video-js.vjs-r7-skin .vjs-overlay-top-left{top:0px;left:0px}.video-js.vjs-r7-skin.vjs-ad-playing .vjs-overlay-top-left{display:none}.video-js.vjs-r7-skin .vjs-title-overlay-wrap{display:flex;flex-flow:column;align-items:flex-start;padding:14px 20px;margin-left:50px;z-index:1;padding:3px 20px;margin-left:38px}.video-js.vjs-r7-skin .vjs-title-overlay-wrap--no-logo{margin-left:0px}.video-js.vjs-r7-skin .vjs-title-overlay-wrap::before{content:\"\";background-image:linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.37) 48%, rgba(0, 0, 0, 0.5));position:absolute;top:0;left:0;height:120px;width:100%;z-index:0}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-title-overlay-wrap{padding:6px 20px;margin-left:50px}.video-js.vjs-r7-skin .vjs-title-overlay-wrap--no-logo{margin-left:0px}}.video-js.vjs-r7-skin.vjs-ad-playing .vjs-logo-content{display:none}.video-js.vjs-r7-skin .vjs-logo-content{transition:unset;z-index:1}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-logo-content img{width:40px;height:44px}}.video-js.vjs-r7-skin .vjs-age-overlay-wrap{position:absolute;top:-5px;right:-5px;height:auto;display:flex;align-items:center;justify-content:center;padding:8px;border-bottom-left-radius:4px}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-overlay-wrap{padding:16px}}.video-js.vjs-r7-skin .vjs-age-icon{width:35px;height:35px;min-width:35px;min-height:35px;margin:5px;border-radius:6px;display:flex;justify-content:center;flex-direction:column;margin-right:8px}.video-js.vjs-r7-skin .vjs-age-icon--age-free{background:#2d973d}.video-js.vjs-r7-skin .vjs-age-icon--age-10{background:#0083ca}.video-js.vjs-r7-skin .vjs-age-icon--age-12{background:#fecb17}.video-js.vjs-r7-skin .vjs-age-icon--age-14{background:#ed6a14}.video-js.vjs-r7-skin .vjs-age-icon--age-16{background:#dc061d}.video-js.vjs-r7-skin .vjs-age-icon--age-18{background:#1b2638}.video-js.vjs-r7-skin .vjs-age-icon__text{font-size:16px;font-weight:bold;color:#fff}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-icon__text{font-size:20px}}.video-js.vjs-r7-skin .vjs-age-icon--hidden{opacity:0}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-icon{width:45px;height:45px;min-width:45px;min-height:45px}}.video-js.vjs-r7-skin .vjs-age-description{display:flex;align-items:center;justify-content:center;max-width:0px;max-height:45px;opacity:0}.video-js.vjs-r7-skin .vjs-age-description--age-free{border-left:1px solid #2d973d}.video-js.vjs-r7-skin .vjs-age-description--age-10{border-left:1px solid #0083ca}.video-js.vjs-r7-skin .vjs-age-description--age-12{border-left:1px solid #fecb17}.video-js.vjs-r7-skin .vjs-age-description--age-14{border-left:1px solid #ed6a14}.video-js.vjs-r7-skin .vjs-age-description--age-16{border-left:1px solid #dc061d}.video-js.vjs-r7-skin .vjs-age-description--age-18{border-left:1px solid #1b2638}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-description{max-height:55px}}.video-js.vjs-r7-skin .vjs-age-description__text{font-size:12px;font-weight:400;margin-left:8px;line-height:25px;text-align:start}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-description__text{font-size:16px}}.video-js.vjs-r7-skin .vjs-age-overlay-wrap--open{animation:show-background 7s ease-in-out}.video-js.vjs-r7-skin .vjs-age-overlay-wrap--open>.vjs-age-description{animation:show-description-small 7s ease-in-out}@media(min-width: 576px){.video-js.vjs-r7-skin .vjs-age-overlay-wrap--open>.vjs-age-description{animation:show-description 7s ease-in-out}}@keyframes show-background{0%{background:rgba(0,0,0,0)}10%{background:rgba(0,0,0,.4)}90%{background:rgba(0,0,0,.4)}100%{background:rgba(0,0,0,0)}}@keyframes show-description{0%{max-width:0}10%{opacity:0;max-width:435px}11%{opacity:1}89%{opacity:1}90%{opacity:0;max-width:435px}100%{max-width:0}}@keyframes show-description-small{0%{max-width:0}10%{opacity:0;max-width:290px}11%{opacity:1}89%{opacity:1}90%{opacity:0;max-width:290px}100%{max-width:0}}.video-js.vjs-r7-skin .vjs-text-track-display{bottom:4em !important}.video-js.vjs-r7-skin .vjs-subs-caps-button .vjs-menu-item{text-transform:capitalize}.video-js.vjs-r7-skin .vjs-subs-caps-button .vjs-icon-placeholder{display:flex;justify-content:center}.video-js.vjs-r7-skin .vjs-text-track-settings{height:310px;font-size:12px;color:#000}.video-js.vjs-r7-skin .vjs-text-track-settings .vjs-close-button{color:#fff}.video-js.vjs-r7-skin .vjs-track-settings-font{display:none !important}.video-js.vjs-r7-skin .vjs-track-settings-colors select{height:30px;width:100px;max-width:200px}.video-js.vjs-r7-skin .vjs-text-opacity select,.video-js.vjs-r7-skin .vjs-bg-opacity select,.video-js.vjs-r7-skin .vjs-window-opacity select{width:140px}.video-js.vjs-r7-skin .vjs-track-settings-controls .vjs-default-button,.video-js.vjs-r7-skin .vjs-track-settings-controls .vjs-done-button{width:80px;height:30px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/assets/stylesheets/libs/_video-js.scss\",\"webpack://./src/assets/stylesheets/_fonts.scss\",\"webpack://./src/assets/stylesheets/_ads.scss\",\"webpack://./src/assets/stylesheets/_default.scss\",\"webpack://./src/assets/stylesheets/_variables.scss\",\"webpack://./src/assets/stylesheets/components/_big-play-button.scss\",\"webpack://./src/assets/stylesheets/components/_control-bar.scss\",\"webpack://./src/assets/stylesheets/components/_messages.scss\",\"webpack://./src/assets/stylesheets/components/_modal.scss\",\"webpack://./src/assets/stylesheets/components/_modal-suggested-next.scss\",\"webpack://./src/assets/stylesheets/components/_modal-suggested-overlay.scss\",\"webpack://./src/assets/stylesheets/components/_modal-suggested-videos.scss\",\"webpack://./src/assets/stylesheets/components/_volume-button.scss\",\"webpack://./src/assets/stylesheets/components/_modal-share-overlay.scss\",\"webpack://./src/assets/stylesheets/components/_video-title.scss\",\"webpack://./src/assets/stylesheets/components/_logo.scss\",\"webpack://./src/assets/stylesheets/components/_age-rating-overlay.scss\",\"webpack://./src/assets/stylesheets/components/_captions.scss\"],\"names\":[],\"mappings\":\"AAQQ,UAER,UACE,CAAA,eACA,CAAA,cACA,CAAA,WACA,CAAA,oDAGF,YACE,CAAA,WCjBF,4BACE,CAAA,iBACA,CAAA,eACA,CAAA,kBACA,CAAA,yGACA,CAAA,WAGF,qCACE,CAAA,iBACA,CAAA,eACA,CAAA,kBACA,CAAA,6HACA,CAAA,WAGF,kCACE,CAAA,iBACA,CAAA,eACA,CAAA,kBACA,CAAA,sHACA,CAAA,WAGF,kCACE,CAAA,iBACA,CAAA,eACA,CAAA,kBACA,CAAA,sHACA,CAAA,WAGF,qCACE,CAAA,iBACA,CAAA,eACA,CAAA,kBAC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,yBAAA,CAAA,IACA,yBAAA,CAAA,KACA,wBAAA,CAAA,CAAA,4BAGF,GACE,WAAA,CAAA,IACA,SAAA,CAAA,eAAA,CAAA,IACA,SAAA,CAAA,IACA,SAAA,CAAA,IACA,SAAA,CAAA,eAAA,CAAA,KACA,WAAA,CAAA,CAAA,kCAGF,GACE,WAAA,CAAA,IACA,SAAA,CAAA,eAAA,CAAA,IACA,SAAA,CAAA,IACA,SAAA,CAAA,IACA,SAAA,CAAA,eAAA,CAAA,KACA,WAAA,CAAA,CAAA,8CC7JF,qBACE,CAAA,2DAIA,yBACE,CAAA,kEAGF,YACE,CAAA,sBACA,CAAA,+CAIJ,YACE,CAAA,cACA,CAAA,UACA,CAAA,iEAEA,UACE,CAAA,+CAIJ,uBACE,CAAA,wDAIA,WACE,CAAA,WACA,CAAA,eACA,CAAA,6IAKF,WACE,CAAA,2IAKF,UACE,CAAA,WACA\",\"sourcesContent\":[\"@import 'videojs-seek-buttons/dist/videojs-seek-buttons.css';\\n@import 'video.js/dist/video-js.min.css';\\n@import 'videojs-share/dist/videojs-share.css';\\n@import 'videojs-errors/dist/videojs-errors.css';\\n@import 'videojs-logo/dist/videojs-logo.css';\\n@import 'videojs-contrib-ads/dist/videojs.ads.css';\\n@import 'videojs-ima/dist/videojs.ima.css';\\n@import 'videojs-overlay/dist/videojs-overlay.css';\\n@import '@silvermine/videojs-chromecast/dist/silvermine-videojs-chromecast.css';\\n\\n.video-js {\\n  width: 100%;\\n  min-width: 320px;\\n  max-width: 100%;\\n  height: auto;\\n}\\n\\nvideo::-internal-media-controls-overlay-cast-button {\\n  display: none;\\n}\\n\",\"/* fallback */\\n@font-face {\\n  font-family: 'Material Icons';\\n  font-style: normal;\\n  font-weight: 400;\\n  font-display: block;\\n  src: url(https://fonts.gstatic.com/s/materialicons/v55/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');\\n}\\n\\n@font-face {\\n  font-family: 'Material Icons Outlined';\\n  font-style: normal;\\n  font-weight: 400;\\n  font-display: block;\\n  src: url(https://fonts.gstatic.com/s/materialiconsoutlined/v27/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUce.woff2) format('woff2');\\n}\\n/* fallback */\\n@font-face {\\n  font-family: 'Material Icons Round';\\n  font-style: normal;\\n  font-weight: 400;\\n  font-display: block;\\n  src: url(https://fonts.gstatic.com/s/materialiconsround/v26/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmP.woff2) format('woff2');\\n}\\n/* fallback */\\n@font-face {\\n  font-family: 'Material Icons Sharp';\\n  font-style: normal;\\n  font-weight: 400;\\n  font-display: block;\\n  src: url(https://fonts.gstatic.com/s/materialiconssharp/v27/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvR.woff2) format('woff2');\\n}\\n/* fallback */\\n@font-face {\\n  font-family: 'Material Icons Two Tone';\\n  font-style: normal;\\n  font-weight: 400;\\n  font-display: block;\\n  src: url(https://fonts.gstatic.com/s/materialiconstwotone/v25/hESh6WRmNCxEqUmNyh3JDeGxjVVyMg4tHGctNCu0.woff2) format('woff2');\\n}\\n\\n.material-icons {\\n  font-family: 'Material Icons';\\n  font-weight: normal;\\n  font-style: normal;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: normal;\\n  text-transform: none;\\n  display: inline-block;\\n  white-space: nowrap;\\n  word-wrap: normal;\\n  direction: ltr;\\n  -webkit-font-feature-settings: 'liga';\\n  -webkit-font-smoothing: antialiased;\\n}\\n\\n.material-icons-outlined {\\n  font-family: 'Material Icons Outlined';\\n  font-weight: normal;\\n  font-style: normal;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: normal;\\n  text-transform: none;\\n  display: inline-block;\\n  white-space: nowrap;\\n  word-wrap: normal;\\n  direction: ltr;\\n  -webkit-font-feature-settings: 'liga';\\n  -webkit-font-smoothing: antialiased;\\n}\\n\\n.material-icons-round {\\n  font-family: 'Material Icons Round';\\n  font-weight: normal;\\n  font-style: normal;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: normal;\\n  text-transform: none;\\n  display: inline-block;\\n  white-space: nowrap;\\n  word-wrap: normal;\\n  direction: ltr;\\n  -webkit-font-feature-settings: 'liga';\\n  -webkit-font-smoothing: antialiased;\\n}\\n\\n.material-icons-sharp {\\n  font-family: 'Material Icons Sharp';\\n  font-weight: normal;\\n  font-style: normal;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: normal;\\n  text-transform: none;\\n  display: inline-block;\\n  white-space: nowrap;\\n  word-wrap: normal;\\n  direction: ltr;\\n  -webkit-font-feature-settings: 'liga';\\n  -webkit-font-smoothing: antialiased;\\n}\\n\\n.material-icons-two-tone {\\n  font-family: 'Material Icons Two Tone';\\n  font-weight: normal;\\n  font-style: normal;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: normal;\\n  text-transform: none;\\n  display: inline-block;\\n  white-space: nowrap;\\n  word-wrap: normal;\\n  direction: ltr;\\n  -webkit-font-feature-settings: 'liga';\\n  -webkit-font-smoothing: antialiased;\\n}\",\".video-js.vjs-r7-skin {\\n  // formatação da tela de bloqueio com adblock\\n  .vjs-adblock-breaker-modal::before {\\n    content: '⚠';\\n    position: absolute;\\n    font-size: 2000%;\\n    padding-left: 10%;\\n    top: 0;\\n    left: 0;\\n    height: 100%;\\n    width: 100%;\\n    z-index: 3;\\n    background-color: #333;\\n    display: flex;\\n    align-items: center;\\n  }\\n\\n  .vjs-adblock-breaker-modal::after {\\n    content: 'Desabilite o AdBlock para que o vídeo seja tocado.';\\n    color: white;\\n    font-size: 350%;\\n    line-height: 150%;\\n    position: absolute;\\n    left: 40%;\\n    height: 100%;\\n    width: 50%;\\n    display: flex;\\n    align-items: center;\\n    z-index: 4;\\n  }\\n\\n  .ima-ad-container {\\n    z-index: 9 !important;\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  font-family: \\\"Open Sans\\\",Arial,Helvetica,sans-serif;\\n  height: 100%;\\n  max-height: 100%;\\n  width: 100%;\\n  max-width: 100%;\\n  color: $primary-foreground-color;\\n\\n  &, * {\\n    outline: none;\\n  }\\n  \\n  .vjs-quality-selector {\\n    .vjs-menu-item-text {\\n      text-transform: capitalize;\\n    }\\n  }\\n  \\n  .vjs-no-js {\\n    position: absolute;\\n    top: 0;\\n    width: 100%;\\n  }\\n\\n  .vjs-menu-button .vjs-menu-content {\\n    background-color: $primary-background-color;\\n    background-color: rgba($primary-background-color, 0.7);\\n  }\\n\\n  .vjs-slider, .video-js {\\n    background-color: $slider-bg-color;\\n    background-color: rgba($slider-bg-color, 0.5);\\n  }\\n\\n  .vjs-volume-level {\\n    background-color: $r7-default-background-color;\\n    color: $r7-default-background-color;\\n  }\\n\\n  .vjs-play-progress {\\n    background: $r7-default-background-color;\\n    color: $r7-default-background-color;\\n  }\\n\\n  .vjs-load-progress {\\n    background: lighten($slider-bg-color, 25%);\\n    background: rgba($slider-bg-color, 0.5);\\n  }\\n\\n  .vjs-load-progress div {\\n    background: lighten($slider-bg-color, 50%);\\n    background: rgba($slider-bg-color, 0.75);\\n  }\\n}\\n\",\"$primary-foreground-color: #fff;\\n$primary-background-color: #2B333F;\\n$r7-default-background-color: #3086EB;\\n$r7-default-modal-bg-color: #060708;\\n$slider-bg-color: lighten($primary-background-color, 33%);\\n$live-indicator-color: #ff0000;\\n$share-copy-area-background-color: #363636;\\n\\n$center-big-play-button: true;\\n\\n$breakpoint-widget-mobile: 'max-width: 400px';\\n$breakpoint-extra-small: 'max-width: 576px';\\n$breakpoint-small: 'min-width: 576px';\\n$breakpoint-medium: 'min-width: 768px';\\n$breakpoint-large: 'min-width: 992px';\\n$breakpoint-extra-large: 'min-width: 1200px';\\n\\n$age-free: #2D973D;\\n$age-10: #0083CA;\\n$age-12: #FECB17;\\n$age-14: #ED6A14;\\n$age-16: #DC061D;\\n$age-18: #1B2638;\",\"@use 'sass:math';\\n\\n.video-js.vjs-r7-skin {\\n  \\n  .vjs-big-play-button:focus, &:hover .vjs-big-play-button {\\n    border: none;\\n    background: none;\\n  }\\n\\n  &.vjs-paused.vjs-has-started .vjs-big-play-button {\\n    display: block;\\n  }\\n  \\n  .vjs-big-play-button {\\n    $big-play-width: 1em; \\n    $big-play-height: 1em;\\n    margin-left: -0.8em;\\n    border-radius: 1.6em;\\n    height: $big-play-height;\\n    width: $big-play-width;\\n    color: $primary-foreground-color;\\n    border: none;\\n    background: none;\\n    font-size: 5em;\\n    line-height: 1em;\\n    transition: none;\\n    z-index: 2;\\n    font-size: 80px;\\n    \\n    @if $center-big-play-button {\\n      /* Align center */\\n      left: 50%;\\n      top: 50%;\\n      margin-left: math.div($big-play-width, 2) * -1;\\n      margin-top: math.div($big-play-height, 2) * -1;   \\n    } @else {\\n      /* Align top left. 0.5em = 15px default */\\n      left: 0.5em;\\n      top: 0.5em;\\n    }\\n\\n    @media screen and (max-width:768px) {\\n      font-size: 60px;\\n    }\\n\\n    .vjs-icon-placeholder:before {\\n      font-family: 'Material Icons';\\n      content: \\\"play_circle_filled\\\";\\n    }\\n  }\\n  \\n}\\n\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-control-bar {\\n    background-color: transparent;\\n    margin-left: 16px;\\n    margin-right: 16px;\\n    width: auto;\\n    height: 42px;\\n    display: flex;\\n    justify-content: flex-end;\\n\\n    &::before {\\n      content: '';\\n      background-image: linear-gradient(\\n        to bottom,\\n        rgba(0, 0, 0, 0),\\n        rgba(0, 0, 0, 0.37) 48%,\\n        rgba(0, 0, 0, 0.9)\\n      );\\n      position: absolute;\\n      bottom: 0;\\n      left: -16px;\\n      right: -16px;\\n      height: 60px;\\n      z-index: 0;\\n    }\\n\\n    @media ($breakpoint-small) {\\n      margin-left: 24px;\\n      margin-right: 24px;\\n      height: 45px;\\n\\n      &::before {\\n        left: -24px;\\n        right: -24px;\\n      }\\n    }\\n\\n    @media ($breakpoint-widget-mobile) {\\n      margin-left: 6px;\\n      margin-right: 6px;\\n\\n      &::before {\\n        left: -6px;\\n        right: -6px;\\n      }\\n    }  \\n\\n    .vjs-menu-button-popup {\\n      .vjs-menu {\\n        border-radius: 3px;\\n        margin-bottom: 25px;\\n      }\\n\\n      .vjs-menu-content {\\n        border-radius: 3px;\\n        background-color: #1a1a1a;\\n        opacity: 0.9;\\n        padding: 16px;\\n        font-size: 11px;\\n        line-height: 15px;\\n        max-height: none;\\n        width: auto;\\n        bottom: 1.2em;\\n        left: -25%;\\n      }\\n    }\\n\\n    > .vjs-control {\\n      outline: none;\\n      z-index: 2;\\n    }\\n\\n    > .vjs-progress-control {\\n      z-index: 1;\\n    }\\n\\n    > .vjs-remaining-time {\\n      position: absolute;\\n      top: -19px;\\n      right: 0;\\n      z-index: 1;\\n      font-size: 0.9rem;\\n      line-height: 1.6rem;\\n\\n      @media ($breakpoint-small) {\\n        top: -16px;\\n      }\\n    }\\n\\n    > .vjs-icon-share:before {\\n      font-size: 19px;\\n    }\\n\\n    > .vjs-quality-selector {\\n      font-size: 12px;\\n\\n      .vjs-menu .vjs-menu-content .vjs-menu-item {\\n        display: none;\\n      }\\n\\n      .vjs-valid-quality {\\n        display: block !important;\\n      }\\n\\n      .vjs-menu-content {\\n        left: 10%;\\n      }\\n\\n      .vjs-menu-button {\\n        @media ($breakpoint-widget-mobile) {\\n          display: flex;\\n          align-items: center;\\n          justify-content: center;\\n        }\\n      }\\n    }\\n\\n    .vjs-button {\\n      outline: none;\\n      width: 40px;\\n\\n      > .vjs-icon-placeholder:before {\\n        font-size: 24px;\\n        line-height: normal;\\n        position: static;\\n        top: auto;\\n        left: auto;\\n        width: auto;\\n        height: auto;\\n\\n        @media ($breakpoint-widget-mobile) {\\n          font-size: 20px;\\n        }\\n      }\\n\\n      @media ($breakpoint-widget-mobile) {\\n        width: 36px;\\n      }\\n    }\\n\\n    .vjs-playback-rate .vjs-playback-rate-value,\\n    .vjs-playback-rate > .vjs-menu-button {\\n      top: 2px;\\n    }\\n\\n    .vjs-progress-control {\\n      position: absolute;\\n      top: -24px;\\n      left: 0;\\n      width: calc(100% - 50px);\\n\\n      @media (max-width: 425px) {\\n        width: 100%;\\n      }\\n    }\\n\\n    .vjs-play-control,\\n    .vjs-volume-panel,\\n    .vjs-seek-button {\\n      position: absolute;\\n      bottom: 0;\\n      left: 0;\\n    }\\n\\n    .vjs-volume-panel {\\n      left: 40px;\\n\\n      @media ($breakpoint-widget-mobile) {\\n        left: 32px;\\n      }\\n    }\\n\\n    .vjs-seek-button {\\n      > .vjs-icon-placeholder:before {\\n        font-family: 'VideoJS'\\n      }\\n    }\\n\\n    .vjs-seek-button.skip-back {\\n      left: 80px;\\n\\n      @media ($breakpoint-widget-mobile) {\\n        left: 64px;\\n      }\\n    }\\n\\n    .vjs-seek-button.skip-forward {\\n      left: 120px;\\n      transform: scale(-1, 1);\\n\\n      @media ($breakpoint-widget-mobile) {\\n        left: 96px;\\n      }\\n    }\\n\\n    .vjs-playback-rate .vjs-icon-placeholder {\\n      display: flex;\\n      align-items: center;\\n      justify-content: center;\\n\\n      &::before {\\n        font-family: 'Material Icons';\\n        content: 'speed';\\n      }\\n    }\\n\\n    .vjs-playback-rate .vjs-menu {\\n      width: 5em;\\n    }\\n\\n    .vjs-playback-rate .vjs-playback-rate-value {\\n      line-height: 2.5em;\\n      display: none;\\n    }\\n\\n    .vjs-progress-holder {\\n      height: 0.4em;\\n    }\\n\\n    .vjs-chromecast-button .vjs-icon-placeholder {\\n      width: 25px;\\n      height: 25px;\\n    }\\n    \\n    .vjs-progress-holder {\\n      height: 0.4em;\\n    }\\n\\n    .vjs-picture-in-picture-control {\\n      @media ($breakpoint-extra-small) {\\n        display: none;\\n      }\\n    }\\n\\n    .vjs-subs-caps-button {\\n      @media ($breakpoint-extra-small) {\\n        display: flex;\\n        align-items: center;\\n        justify-content: center;\\n      }\\n    }\\n\\n    .vjs-icon-cog {\\n      display: flex;\\n      align-items: center;\\n      justify-content: center;\\n    }\\n  }\\n\\n  &.vjs-live {\\n    .vjs-seek-button {\\n      display: none;\\n    }\\n\\n    .vjs-progress-control {\\n      display: block;\\n      top: -6px;\\n      width: 100%;\\n\\n      .vjs-play-progress::before {\\n        display: none;\\n      }\\n\\n      .vjs-progress-holder {\\n        background: $r7-default-background-color;\\n      }\\n\\n      @media ($breakpoint-small) {\\n        width: 100%;\\n      }\\n    }\\n\\n    .vjs-live-control {\\n      display: none;\\n    }\\n\\n    .vjs-seek-to-live-control {\\n      display: block;\\n      position: absolute;\\n      bottom: 0;\\n      left: 80px;\\n\\n      .vjs-icon-placeholder {\\n        color: $live-indicator-color;\\n      }\\n    }\\n  }\\n\\n  &.vjs-videojs-share_open {\\n    .vjs-control.vjs-close-button {\\n      &::before {\\n        font-size: 30px;\\n      }\\n\\n      .vjs-icon-placeholder:before {\\n        content: '';\\n      }\\n    }\\n  }\\n\\n  .vjs-time-tooltip, .vjs-volume-tooltip {\\n    width: max-content;\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-r7-block-msg {\\n    &__container {\\n      font-family: \\\"Open Sans\\\";\\n      display: flex;\\n      flex-direction: column;\\n      align-items: center;\\n      justify-content: center;\\n      height: 100%;\\n    }\\n\\n    &__icon {\\n      font-family: \\\"Material Icons\\\";\\n      font-size: 92px;\\n      font-weight: normal;\\n      margin-bottom: 62px;\\n\\n      &--outline {\\n        font-family: \\\"Material Icons Outlined\\\";\\n      }\\n\\n      &--contained {\\n        border: 8px solid $primary-foreground-color;\\n      \\tborder-radius: 75px;\\n      \\twidth: 92px;\\n      \\theight: 92px;\\n      \\ttext-align: center;\\n        font-size: 53px;\\n      }\\n    }\\n\\n    &__title {\\n      font-size: 19px;\\n      font-weight: 600;\\n      font-stretch: normal;\\n      font-style: normal;\\n      line-height: 1.38;\\n      letter-spacing: normal;\\n      margin-bottom: 13px;\\n    }\\n\\n    &__desc {\\n      font-size: 14px;\\n      font-weight: normal;\\n      font-stretch: normal;\\n      font-style: normal;\\n      line-height: 1.36;\\n      letter-spacing: normal;\\n      text-align: center;\\n      margin-bottom: 28px;\\n    }\\n\\n    &__button {\\n      border: 1px solid $primary-foreground-color;\\n      border-radius: 25px;\\n      font-size: 14px;\\n      font-weight: 600;\\n      font-stretch: normal;\\n      font-style: normal;\\n      line-height: 1.29;\\n      letter-spacing: normal;\\n      text-align: center;\\n      padding: 10px 17px;\\n\\n      color: $primary-foreground-color;\\n      text-decoration: none;\\n    }\\n\\n    @media ($breakpoint-extra-small) {\\n      .vjs-r7-block-msg {\\n        &__icon {\\n          font-size: 52px;\\n          margin-bottom: 16px;\\n\\n          &--contained {\\n            font-size: 30px;\\n            border: 5px solid $primary-foreground-color;\\n            width: 52px;\\n            height: 52px;\\n          }\\n        }\\n    \\n        &__title {\\n          font-size: 16px;\\n          margin-bottom: 8px;\\n        }\\n    \\n        &__desc {\\n          font-size: 11px;\\n          margin-bottom: 13px;\\n        }\\n      }\\n    }\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n\\n  .vjs-modal-dialog {\\n    background-color: $primary-background-color;\\n\\n    font-family: \\\"Open Sans\\\",Arial,Helvetica,sans-serif;\\n    font-weight: 600;\\n    font-stretch: normal;\\n    font-style: normal;\\n    line-height: normal;\\n    letter-spacing: -.2px;\\n    color: $primary-foreground-color;\\n    z-index: 3;\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-r7-suggestednext {\\n    .vjs-modal-dialog-content > div {\\n      display: flex;\\n      flex-direction: column;\\n      flex-wrap: wrap;\\n      justify-content: center;\\n      align-items: center;\\n      height: 100%;\\n    }\\n\\n    &__play {\\n      background-color: #0000002a;\\n      color: transparent;\\n\\n      border-radius: 50%;\\n      height: 81px;\\n      width: 81px;\\n      margin-bottom: 12px;\\n      position: relative;\\n\\n      &::before {\\n        content: \\\"play_arrow\\\";\\n        font-family: \\\"Material Icons\\\";\\n        font-size: 36px;\\n        display: flex;\\n        align-items: center;\\n        justify-content: space-around;\\n        background-color: #fff;\\n        color: #000000;\\n        position: absolute;\\n        top: 10px;\\n        right: 10px;\\n        bottom: 11px;\\n        left: 11px;\\n        border-radius: 50%;\\n        padding-top: 2px;\\n        padding-left: 1px;\\n      }\\n\\n      &::after {\\n        content: \\\"\\\";\\n        border: 4px solid transparent;\\n        border-radius: 50%;\\n        border-top: 4px solid #2d77d6;\\n        animation: vjs-r7-suggestednext__play-spin 2s linear infinite;\\n\\n        position: absolute;\\n        top: 6px;\\n        right: 6px;\\n        bottom: 7px;\\n        left: 7px;\\n      }\\n    }\\n\\n    &__title {\\n      font-size: 14px;\\n      font-weight: 600;\\n      font-stretch: normal;\\n      font-style: normal;\\n      line-height: 1.29;\\n      letter-spacing: normal;\\n      text-align: center;\\n      max-width: 53%;\\n    }\\n\\n    @media ($breakpoint-medium) {\\n      &__title {\\n        font-size: 19px;\\n      }\\n    }\\n  }\\n}\\n\\n@keyframes vjs-r7-suggestednext__play-spin {\\n  0% { transform: rotate(0deg); }\\n  100% { transform: rotate(360deg); }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-r7-suggestedoverlay {\\n    max-width: 45%;\\n    right: 0;\\n\\n    > div {\\n      display: flex;\\n    }\\n\\n    &__item-container {\\n      background-color: #000000;\\n      border: 1px solid rgba(255,255,255,.2);\\n      border-right: none;\\n      display: flex;\\n      align-items: center;\\n\\n      border-top-left-radius: 3px;\\n      border-bottom-left-radius: 3px;\\n    }\\n\\n    &__item-link {\\n      display: flex;\\n      align-items: center;\\n\\n      color: $primary-foreground-color;\\n      font-size: 14px;\\n      text-decoration: none;\\n    }\\n\\n    \\n    &__item-img {\\n      width: 116px;\\n      height: 65px;\\n      min-width: 116px;\\n      min-height: 65px;\\n      border-top-left-radius: 3px;\\n      border-bottom-left-radius: 3px;\\n      pointer-events: none;\\n    }\\n\\n    &__item-desc {\\n      font-size: 12px;\\n      line-height: normal;\\n      padding: 10px;\\n      text-align: left;\\n      pointer-events: none;\\n    }\\n\\n    &__close-button {\\n      width: 40px;\\n      height: 40px;\\n      cursor: pointer;\\n      align-self: baseline;\\n\\n      &::before {\\n        content: '×';\\n        font-size: 20px;\\n        line-height: 15px;\\n      }\\n    }\\n\\n    @media ($breakpoint-extra-small) {\\n      &__item-img {\\n        display: none;\\n      }\\n    }\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-modal-dialog.vjs-r7-suggestedvideos {\\n    .vjs-modal-dialog-content > div {\\n      display: flex;\\n      flex-wrap: wrap;\\n      justify-content: center;\\n      align-items: center;\\n    }\\n\\n    .vjs-r7-suggestedvideos__item-container {\\n      color: $primary-foreground-color;\\n      font-size: 14px;\\n      line-height: 1.36;\\n      height: auto;\\n      max-height: 56%;\\n      width: 47%;\\n      position: relative;\\n      text-decoration: none;\\n      margin-left: 16px;\\n      margin-bottom: 20px;\\n\\n      &:nth-child(1) {\\n        margin-left: 0;\\n      }\\n\\n      &:nth-child(3) {\\n        display: none;\\n      }\\n\\n      &::before {\\n        content: \\\"\\\";\\n        background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));\\n        position: absolute;\\n        top: 0;\\n        left: 0;\\n        right: 0;\\n        bottom: 5px;\\n        z-index: 1;\\n      }\\n    }\\n\\n    .vjs-r7-suggestedvideos__item-img {\\n      width: 100%;\\n    }\\n\\n    .vjs-r7-suggestedvideos__item-desc {\\n      font-size: 11px;\\n      font-weight: normal;\\n      line-height: 1.36;\\n      position: absolute;\\n      bottom: 8px;\\n      right: 8px;\\n      left: 8px;\\n      z-index: 2;\\n    }\\n\\n    .vjs-r7-suggestedvideos__review {\\n      display: flex;\\n      align-items: center;\\n      justify-content: center;\\n      width: 100%;\\n      font-size: 14px;\\n      font-weight: 600;\\n      line-height: 1.29;\\n      cursor: pointer;\\n\\n      &::before {\\n        font-family: \\\"Material Icons\\\";\\n        content: \\\"autorenew\\\";\\n        font-size: 32px;\\n        font-weight: normal;\\n      }\\n    }\\n\\n    @media ($breakpoint-medium) {\\n      .vjs-modal-dialog-content > div {\\n        position: absolute;\\n        top: 32.65%;\\n        left: 22px;\\n        right: 22px;\\n      }\\n\\n      .vjs-r7-suggestedvideos__item-container {\\n        margin-left: 8px;\\n        margin-bottom: 42px;\\n        width: 32%;\\n\\n        &:nth-child(3) {\\n          display: inline;\\n        }\\n      }\\n\\n      .vjs-r7-suggestedvideos__review {\\n        justify-content: flex-end;\\n\\n        &::before {\\n          font-size: 24px;\\n        }\\n      }\\n    }\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n\\n  .vjs-mute-control .vjs-icon-placeholder:before, .vjs-icon-volume-high:before {\\n    font-family: 'Material Icons Outlined';\\n    content: \\\"volume_up\\\";\\n  }\\n  \\n  .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before, .vjs-icon-volume-mute:before {\\n    font-family: 'Material Icons Outlined';\\n    content: \\\"volume_off\\\";\\n  } \\n  \\n  .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before, .vjs-icon-volume-low:before {\\n    font-family: 'Material Icons Outlined';\\n    content: \\\"volume_mute\\\";\\n  }\\n\\n  .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before, .vjs-icon-volume-mid:before {\\n    font-family: 'Material Icons Outlined';\\n    content: \\\"volume_down\\\";\\n  }\\n\\n}\",\".video-js.vjs-r7-skin {\\n  .vjs-share {\\n    justify-content: center;\\n  }\\n\\n  .vjs-share--arc {\\n    > .vjs-share__bottom {\\n      &:before {\\n        width: auto;\\n        min-width: 324px;\\n      }\\n  \\n      &:after {\\n        border-bottom: 0px;\\n      }\\n  \\n      > .vjs-share__socials {\\n        align-content: center;\\n        justify-content: center;\\n      }\\n    }\\n\\n    > .vjs-share__middle {\\n      display: none;\\n    }\\n  }\\n\\n  .vjs-modal-dialog-content {\\n    overflow: hidden;\\n  }\\n\\n  .vjs-share__title {\\n    display: none;\\n  }\\n\\n  .vjs-share__subtitle {\\n    opacity: 1;\\n  }\\n\\n  .vjs-share__short-link {\\n    opacity: 0;\\n  }\\n\\n  .vjs-share__short-link--small {\\n    padding: 10px 40px 10px 10px;\\n    overflow: hidden;\\n    font-size: 11px;\\n    line-height: 14px;\\n    background: $share-copy-area-background-color;\\n    outline: none;\\n    border: none;\\n    width: 100%;\\n    height: 100%;\\n    color: $primary-foreground-color;\\n    font-family: \\\"Open Sans\\\",Arial,Helvetica,sans-serif;\\n    resize: none;\\n    top: 0px;\\n    left: 0px;\\n    position: absolute;\\n  }\\n\\n  .vjs-share__middle {\\n    width: 50%;\\n    order: 1;\\n    min-width: 260px;\\n\\n    > .vjs-share__short-link-wrapper {\\n      display: none;\\n    }\\n\\n    > .vjs-share__short-link-wrapper ~ .vjs-share__short-link-wrapper {\\n      display: block;\\n    }\\n\\n    > .vjs-share__subtitle {\\n      display: block;\\n    }\\n\\n    > .vjs-share__subtitle ~ .vjs-share__subtitle {\\n      display: none;\\n    }\\n  }\\n\\n  .vjs-share__bottom {\\n    width: 50%;\\n    min-width: 260px;\\n    padding: 0 25px;\\n    order: 0;\\n    margin-bottom: 25px;\\n    margin-top: 50px;\\n\\n    &:before {\\n      content: \\\"Redes Sociais:\\\";\\n      width: 50%;\\n      min-width: 260px;\\n      position: absolute;\\n      padding: 0px 25px;\\n      margin-top: -36px;\\n      font-size: 16px;\\n    }\\n\\n    &:after {\\n      content: \\\"\\\";\\n      border-bottom: 1px solid $primary-foreground-color;\\n      width: 50%;\\n      min-width: 240px;\\n      position: absolute;\\n      margin-top: 68px;\\n      opacity: 0.5;\\n    }\\n  }\\n\\n  .vjs-share__socials {\\n    width: 100%;\\n    align-content: flex-start;\\n    justify-content: flex-start;\\n  }\\n\\n  .vjs-share__social {\\n    width: 50px;\\n    height: 50px;\\n    margin-right: 18px;\\n\\n    svg {\\n      pointer-events: none;\\n    }\\n  }\\n\\n  .vjs-share__social_fbFeed,\\n  .vjs-share__social_tw,\\n  .vjs-share__social_whatsapp,\\n  .vjs-share__social_url {\\n    background-color: $r7-default-modal-bg-color;\\n    border: 1px solid $primary-foreground-color;\\n    border-radius: 3em;\\n\\n    &:hover {\\n      background-color: $primary-foreground-color;\\n\\n      svg {\\n        path {\\n          fill: $r7-default-modal-bg-color;\\n        }\\n      }\\n    }\\n  }\\n\\n  .vjs-share__social_tw {\\n    svg {\\n      max-height: 18px;\\n    }\\n  }\\n\\n  .vjs-share__social_url {\\n    flex-direction: column;\\n\\n    &:hover:before,\\n    &:hover:after  {\\n      color: $r7-default-modal-bg-color;\\n    }\\n\\n    &:after {\\n      width: 36px;\\n      height: 0px;\\n      opacity: 0;\\n      content: 'Copiado!';\\n      color: $primary-foreground-color;\\n      transition: 0.15s linear height;\\n    }\\n\\n    &--copied { \\n      &:after {\\n        height: 20px;\\n        opacity: 1;\\n        transition: none;\\n      }\\n  \\n      @media ($breakpoint-extra-small) {\\n        line-height: 4px;\\n      }\\n    }\\n  }\\n\\n  .vjs-share__short-link-wrapper {\\n    height: 100px;\\n\\n    @media ($breakpoint-extra-small) {\\n      height: 40px;\\n    }\\n  }\\n\\n  .vjs-share__short-link {\\n    padding: 10px 40px 10px 10px;\\n    overflow: hidden;\\n    font-size: 11px;\\n    line-height: 14px;\\n  }\\n\\n  .vjs-share__btn {\\n    height: 100%;\\n\\n    svg, &-text {\\n      pointer-events: none;\\n    }\\n\\n    @media ($breakpoint-extra-small) {\\n      width: 100%;\\n      justify-content: center;\\n      background-image: none;\\n\\n      span {\\n        opacity: 1;\\n      }\\n    }\\n  }\\n\\n  @media ($breakpoint-extra-small) {\\n    .vjs-share--arc {\\n      > .vjs-share__bottom {\\n        &:before {\\n          min-width: 240px;\\n        }\\n      }\\n  \\n      > .vjs-share__middle {\\n        display: none;\\n      }\\n    }\\n\\n    .vjs-share__social {\\n      width: 40px;\\n      height: 40px;\\n      margin-right: 6px;\\n    }\\n\\n    .vjs-share__bottom:after {\\n      margin-top: 58px;\\n    }\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-overlay-background {\\n    background-color: transparent;\\n    width: 100%;\\n  }\\n\\n  .vjs-title-text {\\n    font-size: 16px;\\n    margin-bottom: 2px;\\n    z-index: 1;\\n    text-align: left;\\n    text-overflow: ellipsis;\\n    overflow: hidden;\\n    white-space: nowrap;\\n    width: 100%;\\n    line-height: normal;\\n    padding-right: 40px;\\n\\n    &__link {\\n      color: $primary-foreground-color;\\n      text-decoration: none;\\n\\n      &:hover {\\n        text-decoration: underline;\\n      }\\n    }\\n\\n    @media ($breakpoint-small) {\\n      font-size: 19px;\\n      padding-right: 70px;\\n    }\\n  }\\n\\n  .vjs-title-description {\\n    font-size: 11px;\\n    z-index: 1;\\n    text-align: left;\\n\\n    &__link {\\n      color: $primary-foreground-color;\\n      text-decoration: none;\\n\\n      &:hover {\\n        text-decoration: underline;\\n      }\\n    }\\n\\n    @media ($breakpoint-small) {\\n      font-size: 14px;\\n    }\\n  }\\n\\n  .vjs-overlay-top-left {\\n    top: 0px;\\n    left: 0px;\\n  }\\n\\n  &.vjs-ad-playing {\\n    .vjs-overlay-top-left {\\n      display: none;\\n    }\\n  }\\n\\n  .vjs-title-overlay-wrap {\\n    display: flex;\\n    flex-flow: column;\\n    align-items: flex-start;\\n    padding: 14px 20px;\\n    margin-left: 50px;\\n    z-index: 1;\\n    padding: 3px 20px;\\n    margin-left: 38px;\\n\\n    &--no-logo {\\n      margin-left: 0px;\\n    }\\n\\n    &::before {\\n      content: '';\\n      background-image: linear-gradient(\\n        to top,\\n        rgba(0, 0, 0, 0),\\n        rgba(0, 0, 0, 0.37) 48%,\\n        rgba(0, 0, 0, 0.5)\\n      );\\n      position: absolute;\\n      top: 0;\\n      left: 0;\\n      height: 120px;\\n      width: 100%;\\n      z-index: 0;\\n    }\\n\\n    @media ($breakpoint-small) {\\n      padding: 6px 20px;\\n      margin-left: 50px;\\n\\n      &--no-logo {\\n        margin-left: 0px;\\n      }\\n    }\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n\\n  &.vjs-ad-playing {\\n    .vjs-logo-content {\\n      display: none;\\n    }\\n  }\\n\\n  .vjs-logo-content {\\n    transition: unset;\\n    z-index: 1;\\n\\n    @media ($breakpoint-small) {\\n      img {\\n        width: 40px;\\n        height: 44px;\\n      }\\n    }\\n  }\\n}\",\".video-js.vjs-r7-skin {\\n  .vjs-age-overlay-wrap {\\n    position: absolute;\\n    top: -5px;\\n    right: -5px;\\n    height: auto;\\n    display: flex;\\n    align-items: center;\\n    justify-content: center;\\n    padding: 8px;\\n    border-bottom-left-radius: 4px;\\n\\n    @media ($breakpoint-small) {\\n      padding: 16px;\\n    }\\n  }\\n\\n  .vjs-age-icon {\\n    width: 35px;\\n    height: 35px;\\n    min-width: 35px;\\n    min-height: 35px;\\n    margin: 5px;\\n    border-radius: 6px;\\n    display: flex;\\n    justify-content: center;\\n    flex-direction: column;\\n    margin-right: 8px;\\n\\n    &--age-free {\\n      background: $age-free;\\n    }\\n\\n    &--age-10 {\\n      background: $age-10;\\n    }\\n\\n    &--age-12 {\\n      background: $age-12;\\n    }\\n\\n    &--age-14 {\\n      background: $age-14;\\n    }\\n\\n    &--age-16 {\\n      background: $age-16;\\n    }\\n\\n    &--age-18 {\\n      background: $age-18;\\n    }\\n\\n    &__text {\\n      font-size: 16px;\\n      font-weight: bold;\\n      color: #fff;\\n\\n      @media ($breakpoint-small) {\\n        font-size: 20px;\\n      }\\n    }\\n\\n    &--hidden {\\n      opacity: 0;\\n    }\\n\\n    @media ($breakpoint-small) {\\n      width: 45px;\\n      height: 45px;\\n      min-width: 45px;\\n      min-height: 45px;\\n    }\\n  }\\n\\n  .vjs-age-description {\\n    display: flex;\\n    align-items: center;\\n    justify-content: center;\\n    max-width: 0px;\\n    max-height: 45px;\\n    opacity: 0;\\n\\n    &--age-free {\\n      border-left: 1px solid $age-free;\\n    }\\n\\n    &--age-10 {\\n      border-left: 1px solid $age-10;\\n    }\\n\\n    &--age-12 {\\n      border-left: 1px solid $age-12;\\n    }\\n\\n    &--age-14 {\\n      border-left: 1px solid $age-14;\\n    }\\n\\n    &--age-16 {\\n      border-left: 1px solid $age-16;\\n    }\\n\\n    &--age-18 {\\n      border-left: 1px solid $age-18;\\n    }\\n\\n    @media ($breakpoint-small) {\\n      max-height: 55px;\\n    }\\n\\n    &__text {\\n      font-size: 12px;\\n      font-weight: 400;\\n      margin-left: 8px;\\n      line-height: 25px;\\n      text-align: start;\\n\\n      @media ($breakpoint-small) {\\n        font-size: 16px;\\n      }\\n    }\\n  }\\n\\n  .vjs-age-overlay-wrap--open {\\n    animation: show-background 7s ease-in-out;\\n\\n    > .vjs-age-description {\\n      animation: show-description-small 7s ease-in-out;\\n\\n      @media ($breakpoint-small) {\\n        animation: show-description 7s ease-in-out;\\n      }\\n    }\\n  }\\n\\n  @keyframes show-background {\\n    0% { background: rgba(0, 0, 0, 0); }\\n    10% { background: rgba(0, 0, 0, 0.4); }\\n    90% { background: rgba(0, 0, 0, 0.4); }\\n    100% { background: rgba(0, 0, 0, 0); }\\n  }\\n\\n  @keyframes show-description {\\n    0% { max-width: 0; }\\n    10% { opacity: 0; max-width: 435px;}\\n    11% { opacity: 1; }\\n    89% { opacity: 1; }\\n    90% { opacity: 0; max-width: 435px;}\\n    100% { max-width: 0;}\\n  }\\n\\n  @keyframes show-description-small {\\n    0% { max-width: 0; }\\n    10% { opacity: 0; max-width: 290px;}\\n    11% { opacity: 1; }\\n    89% { opacity: 1; }\\n    90% { opacity: 0; max-width: 290px;}\\n    100% { max-width: 0;}\\n  }\\n}\\n\",\".video-js.vjs-r7-skin {\\n  .vjs-text-track-display {\\n    bottom: 4em !important;\\n  }\\n\\n  .vjs-subs-caps-button {\\n    .vjs-menu-item {\\n      text-transform: capitalize;\\n    }\\n\\n    .vjs-icon-placeholder {\\n      display: flex;\\n      justify-content: center;\\n    }\\n  }\\n\\n  .vjs-text-track-settings {\\n    height: 310px;\\n    font-size: 12px;\\n    color: #000;\\n\\n    .vjs-close-button {\\n      color: #fff;\\n    }\\n  }\\n\\n  .vjs-track-settings-font {\\n    display: none !important;\\n  }\\n\\n  .vjs-track-settings-colors {\\n    select {\\n      height: 30px;\\n      width: 100px;\\n      max-width: 200px;\\n    }\\n  }\\n\\n  .vjs-text-opacity, .vjs-bg-opacity, .vjs-window-opacity {\\n    select {\\n      width: 140px;\\n    }\\n  }\\n  \\n  .vjs-track-settings-controls {\\n    .vjs-default-button, .vjs-done-button {\\n      width: 80px;\\n      height: 30px;\\n    }\\n  }\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52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nAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `@charset \"UTF-8\";.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(${___CSS_LOADER_URL_REPLACEMENT_0___}) format(\"woff\");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:\"\\\\f101\"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:\"\\\\f102\"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:\"\\\\f103\"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:\"\\\\f104\"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:\"\\\\f105\"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:\"\\\\f106\"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:\"\\\\f107\"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:\"\\\\f108\"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:\"\\\\f109\"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:\"\\\\f10a\"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:\"\\\\f10b\"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:\"\\\\f10c\"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:\"\\\\f10d\"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:\"\\\\f10e\"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:\"\\\\f10f\"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:\"\\\\f110\"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:\"\\\\f111\"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:\"\\\\f112\"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:\"\\\\f113\"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:\"\\\\f114\"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:\"\\\\f115\"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:\"\\\\f116\"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:\"\\\\f117\"}.vjs-icon-gplus{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-gplus:before{content:\"\\\\f118\"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:\"\\\\f119\"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:\"\\\\f11a\"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:\"\\\\f11b\"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:\"\\\\f11c\"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:\"\\\\f11d\"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:\"\\\\f11e\"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:\"\\\\f11f\"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:\"\\\\f120\"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:\"\\\\f121\"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:\"\\\\f122\"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex=\"-1\"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.81666em;margin-left:-1.5em}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.vjs-no-flex .vjs-volume-control .vjs-mouse-display{z-index:0}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster{display:block}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control{display:none}.video-js .vjs-current-time,.vjs-no-flex .vjs-current-time{display:none}.video-js .vjs-duration,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:\"X\";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:\"\";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@-webkit-keyframes vjs-spinner-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:\"\";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:\" \";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.video-js.vjs-layout-x-small.vjs-no-flex .vjs-custom-control-spacer{width:auto}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px 0}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px 0;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/video.js/dist/video-js.min.css\"],\"names\":[],\"mappings\":\"AAAA,gBAAgB,CAAC,6KAA6K,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,qGAAqG,iBAAiB,CAAC,WAAW,mBAAmB,CAAC,0DAAgtL,CAAC,eAAe,CAAC,iBAAiB,CAAC,6HAA6H,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,2IAA2I,eAAe,CAAC,sBAAsB,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,6BAA6B,eAAe,CAAC,8EAA8E,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,4FAA4F,eAAe,CAAC,kFAAkF,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,gGAAgG,eAAe,CAAC,iFAAiF,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,+FAA+F,eAAe,CAAC,iFAAiF,mBAAmB,CAAC,eAAe,CAAC,iBAAiB,CAAC,+FAA+F,eAAe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,CAAC,SAAS,CAAC,eAAe,CAAC,qFAAqF,mBAAmB,CAAC,oBAAoB,CAAC,4DAA4D,CAAC,0CAA0C,wBAAwB,CAAC,oCAAoC,qBAAqB,CAAC,+DAA+D,CAAC,aAAa,CAAC,cAAc,CAAC,iBAAiB,CAAC,iDAAiD,gBAAgB,CAAC,aAAa,2CAA2C,iBAAiB,CAAC,CAAC,oBAAoB,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,uDAAuD,SAAS,CAAC,qCAAqC,SAAS\",\"sourcesContent\":[\"@charset \\\"UTF-8\\\";.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRAD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AGOPgaG//85+hkYGVCBMgBGGwNYAAAAeJxjYGBgYB8EmKOPgQEAQ04BfgAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhAi2COh4nGNgZGBgUGYoZWBnAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format(\\\"woff\\\");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:\\\"\\\\f101\\\"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:\\\"\\\\f102\\\"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:\\\"\\\\f103\\\"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:\\\"\\\\f104\\\"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:\\\"\\\\f105\\\"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:\\\"\\\\f106\\\"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:\\\"\\\\f107\\\"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:\\\"\\\\f108\\\"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:\\\"\\\\f109\\\"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:\\\"\\\\f10a\\\"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:\\\"\\\\f10b\\\"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:\\\"\\\\f10c\\\"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:\\\"\\\\f10d\\\"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:\\\"\\\\f10e\\\"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:\\\"\\\\f10f\\\"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:\\\"\\\\f110\\\"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:\\\"\\\\f111\\\"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:\\\"\\\\f112\\\"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:\\\"\\\\f113\\\"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:\\\"\\\\f114\\\"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:\\\"\\\\f115\\\"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:\\\"\\\\f116\\\"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:\\\"\\\\f117\\\"}.vjs-icon-gplus{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-gplus:before{content:\\\"\\\\f118\\\"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:\\\"\\\\f119\\\"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:\\\"\\\\f11a\\\"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:\\\"\\\\f11b\\\"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:\\\"\\\\f11c\\\"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:\\\"\\\\f11d\\\"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:\\\"\\\\f11e\\\"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:\\\"\\\\f11f\\\"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:\\\"\\\\f120\\\"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:\\\"\\\\f121\\\"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:\\\"\\\\f122\\\"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex=\\\"-1\\\"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.81666em;margin-left:-1.5em}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.vjs-no-flex .vjs-volume-control .vjs-mouse-display{z-index:0}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster{display:block}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control{display:none}.video-js .vjs-current-time,.vjs-no-flex .vjs-current-time{display:none}.video-js .vjs-duration,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:\\\"X\\\";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:\\\"\\\";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@-webkit-keyframes vjs-spinner-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:\\\"\\\";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:\\\" \\\";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.video-js.vjs-layout-x-small.vjs-no-flex .vjs-custom-control-spacer{width:auto}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px 0}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px 0;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.vjs-ad-playing.vjs-ad-playing .vjs-progress-control{pointer-events:none}.vjs-ad-playing.vjs-ad-playing .vjs-play-progress{background-color:#ffe400}.vjs-ad-loading .vjs-loading-spinner{display:block;visibility:visible}.vjs-ad-playing .vjs-captions-button{display:none}.vjs-ad-playing .vjs-audio-button{display:none}.vjs-ad-loading .vjs-loading-spinner:before,.vjs-ad-loading .vjs-loading-spinner:after{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-ad-loading .vjs-loading-spinner:before{border-top-color:#fff}.vjs-ad-loading .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:0.44s;animation-delay:0.44s}.vjs-ad-loading .vjs-big-play-button,.vjs-ad-loading .vjs-poster,.vjs-ad-content-resuming .vjs-big-play-button,.vjs-ad-content-resuming .vjs-poster{display:none}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-contrib-ads/dist/videojs.ads.css\"],\"names\":[],\"mappings\":\"AAAA,qDAAqD,mBAAmB,CAAC,kDAAkD,wBAAwB,CAAC,qCAAqC,aAAa,CAAC,kBAAkB,CAAC,qCAAqC,YAAY,CAAC,kCAAkC,YAAY,CAAC,uFAAuF,qHAAqH,CAAC,6GAA6G,CAAC,4CAA4C,qBAAqB,CAAC,2CAA2C,qBAAqB,CAAC,6BAA6B,CAAC,qBAAqB,CAAC,oJAAoJ,YAAY\",\"sourcesContent\":[\".vjs-ad-playing.vjs-ad-playing .vjs-progress-control{pointer-events:none}.vjs-ad-playing.vjs-ad-playing .vjs-play-progress{background-color:#ffe400}.vjs-ad-loading .vjs-loading-spinner{display:block;visibility:visible}.vjs-ad-playing .vjs-captions-button{display:none}.vjs-ad-playing .vjs-audio-button{display:none}.vjs-ad-loading .vjs-loading-spinner:before,.vjs-ad-loading .vjs-loading-spinner:after{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-ad-loading .vjs-loading-spinner:before{border-top-color:#fff}.vjs-ad-loading .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:0.44s;animation-delay:0.44s}.vjs-ad-loading .vjs-big-play-button,.vjs-ad-loading .vjs-poster,.vjs-ad-content-resuming .vjs-big-play-button,.vjs-ad-content-resuming .vjs-poster{display:none}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */\n.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-errors-flashmessage{float:right;font-size:9px;font-style:italic}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}.vjs-xs.vjs-errors-flashmessage{display:none}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message,.vjs-errors-flashmessage{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-errors/dist/videojs-errors.css\"],\"names\":[],\"mappings\":\"AAAA,6DAA6D;AAC7D,mBAAmB,UAAU,CAAC,YAAY,CAAC,sCAAsC,CAAC,cAAc,CAAC,iBAAiB,CAAC,8BAA8B,aAAa,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC,wDAAwD,cAAc,CAAC,mBAAmB,eAAe,CAAC,qBAAqB,CAAC,eAAe,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,oBAAoB,eAAe,CAAC,oBAAoB,qBAAqB,CAAC,wBAAwB,CAAC,aAAa,CAAC,eAAe,CAAC,YAAY,CAAC,gCAAgC,aAAa,CAAC,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,iBAAiB,CAAC,kEAAkE,aAAa,CAAC,WAAW,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,sBAAsB,aAAa,CAAC,UAAU,CAAC,8EAA8E,qBAAqB,CAAC,UAAU,CAAC,qCAAqC,YAAY,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,iBAAiB,CAAC,4CAA4C,WAAW,CAAC,8BAA8B,aAAa,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,qBAAqB,cAAc,CAAC,eAAe,CAAC,iBAAiB,CAAC,iDAAiD,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,yBAAyB,WAAW,CAAC,aAAa,CAAC,iBAAiB,CAAC,0BAA0B,cAAc,CAAC,qBAAqB,CAAC,4FAA4F,YAAY,CAAC,sCAAsC,KAAK,CAAC,6BAA6B,cAAc,CAAC,eAAe,CAAC,2BAA2B,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,gCAAgC,YAAY,CAAC,4CAA4C,mBAAmB,cAAc,CAAC,qBAAqB,CAAC,uGAAuG,YAAY,CAAC,iDAAiD,QAAQ,CAAC,wCAAwC,cAAc,CAAC,eAAe,CAAC,sCAAsC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC\",\"sourcesContent\":[\"/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */\\n.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-errors-flashmessage{float:right;font-size:9px;font-style:italic}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}.vjs-xs.vjs-errors-flashmessage{display:none}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message,.vjs-errors-flashmessage{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/**\n * Copyright 2014 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.ima-ad-container {\n  top: 0em;\n  position: absolute;\n  display: none;\n  width: 100%;\n  height: 100%;\n}\n\n/* Move overlay if user fast-clicks play button. */\n.video-js.vjs-playing .bumpable-ima-ad-container {\n  margin-top: -4em;\n}\n\n/* Move overlay when controls are active. */\n.video-js.vjs-user-inactive.vjs-playing .bumpable-ima-ad-container {\n  margin-top: 0em;\n}\n\n.video-js.vjs-paused .bumpable-ima-ad-container,\n.video-js.vjs-playing:hover .bumpable-ima-ad-container,\n.video-js.vjs-user-active.vjs-playing .bumpable-ima-ad-container {\n  margin-top: -4em;\n}\n\n.ima-controls-div {\n  bottom: 0em;\n  height: 1.4em;\n  position: absolute;\n  overflow: hidden;\n  display: none;\n  opacity: 1;\n  background-color: rgba(7, 20, 30, .7);\n  background: -moz-linear-gradient(\n      bottom,\n      rgba(7, 20, 30, .7) 0%,\n      rgba(7, 20, 30, 0) 100%); /* FF3.6+ */\n  background: -webkit-gradient(\n      linear,\n      left bottom,\n      left top,\n      color-stop(0%,rgba(7, 20, 30, .7)),\n      color-stop(100%,rgba(7, 20, 30, 0))); /* Chrome,Safari4+ */\n  background: -webkit-linear-gradient(\n      bottom,\n      rgba(7, 20, 30, .7) 0%,\n      rgba(7, 20, 30, 0) 100%); /* Chrome10+,Safari5.1+ */\n  background: -o-linear-gradient(bottom,\n    rgba(7, 20, 30, .7) 0%,\n    rgba(7, 20, 30, 0) 100%); /* Opera 11.10+ */\n  background: -ms-linear-gradient(bottom,\n    rgba(7, 20, 30, .7) 0%,\n    rgba(7, 20, 30, 0) 100%); /* IE10+ */\n  background: linear-gradient(to top,\n    rgba(7, 20, 30, .7) 0%,\n    rgba(7, 20, 30, 0) 100%); /* W3C */\n  filter: progid:DXImageTransform.Microsoft.gradient(\n    startColorstr='#0007141E',\n    endColorstr='#07141E',GradientType=0 ); /* IE6-9 */\n}\n\n.ima-controls-div.ima-controls-div-showing {\n  height: 3.7em;\n}\n\n.ima-countdown-div {\n  height: 1em;\n  color: #FFFFFF;\n  text-shadow: 0 0 0.2em #000;\n  cursor: default;\n}\n\n.ima-seek-bar-div {\n  top: 1.2em;\n  height: 0.3em;\n  position: absolute;\n  background: rgba(255, 255, 255, .4);\n}\n\n.ima-progress-div {\n  width: 0em;\n  height: 0.3em;\n  background-color: #ECC546;\n}\n\n.ima-play-pause-div, .ima-mute-div, .ima-slider-div, .ima-fullscreen-div {\n  width: 2.33em;\n  height: 1.33em;\n  top: 0.733em;\n  left: 0em;\n  position: absolute;\n  color: #CCCCCC;\n  font-size: 1.5em;\n  line-height: 2;\n  text-align: center;\n  font-family: VideoJS;\n  cursor: pointer;\n}\n\n.ima-mute-div {\n  left: auto;\n  right: 5.667em;\n}\n\n.ima-slider-div {\n  left: auto;\n  right: 2.33em;\n  width: 3.33em;\n  height: 0.667em;\n  top: 1.33em;\n  background-color: #555555;\n}\n\n.ima-slider-level-div {\n  width: 100%;\n  height: 0.667em;\n  background-color: #ECC546;\n}\n\n.ima-fullscreen-div {\n  left: auto;\n  right: 0em;\n}\n\n.ima-playing:before {\n  content: \"\\\\00f103\";\n}\n\n.ima-paused:before {\n  content: \"\\\\00f101\";\n}\n\n.ima-playing:hover:before, .ima-paused:hover:before {\n  text-shadow: 0 0 1em #fff;\n}\n\n.ima-non-muted:before {\n  content: \"\\\\00f107\";\n}\n\n.ima-muted:before {\n  content: \"\\\\00f104\";\n}\n\n.ima-non-muted:hover:before, .ima-muted:hover:before {\n  text-shadow: 0 0 1em #fff;\n}\n\n.ima-non-fullscreen:before {\n  content: \"\\\\00f108\";\n}\n\n.ima-fullscreen:before {\n  content: \"\\\\00f109\";\n}\n\n.ima-non-fullscreen:hover:before, .ima-fullscreen:hover:before {\n  text-shadow: 0 0 1em #fff;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-ima/dist/videojs.ima.css\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;EAcE;;AAEF;EACE,QAAQ;EACR,kBAAkB;EAClB,aAAa;EACb,WAAW;EACX,YAAY;AACd;;AAEA,kDAAkD;AAClD;EACE,gBAAgB;AAClB;;AAEA,2CAA2C;AAC3C;EACE,eAAe;AACjB;;AAEA;;;EAGE,gBAAgB;AAClB;;AAEA;EACE,WAAW;EACX,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,aAAa;EACb,UAAU;EACV,qCAAqC;EACrC;;;8BAG4B,EAAE,WAAW;EACzC;;;;;0CAKwC,EAAE,oBAAoB;EAC9D;;;8BAG4B,EAAE,yBAAyB;EACvD;;4BAE0B,EAAE,iBAAiB;EAC7C;;4BAE0B,EAAE,UAAU;EACtC;;4BAE0B,EAAE,QAAQ;EACpC;;0CAEwC,EAAE,UAAU;AACtD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,WAAW;EACX,cAAc;EACd,2BAA2B;EAC3B,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,aAAa;EACb,kBAAkB;EAClB,mCAAmC;AACrC;;AAEA;EACE,UAAU;EACV,aAAa;EACb,yBAAyB;AAC3B;;AAEA;EACE,aAAa;EACb,cAAc;EACd,YAAY;EACZ,SAAS;EACT,kBAAkB;EAClB,cAAc;EACd,gBAAgB;EAChB,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,eAAe;AACjB;;AAEA;EACE,UAAU;EACV,cAAc;AAChB;;AAEA;EACE,UAAU;EACV,aAAa;EACb,aAAa;EACb,eAAe;EACf,WAAW;EACX,yBAAyB;AAC3B;;AAEA;EACE,WAAW;EACX,eAAe;EACf,yBAAyB;AAC3B;;AAEA;EACE,UAAU;EACV,UAAU;AACZ;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,yBAAyB;AAC3B\",\"sourcesContent\":[\"/**\\n * Copyright 2014 Google Inc.\\n *\\n * Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n * you may not use this file except in compliance with the License.\\n * You may obtain a copy of the License at\\n *\\n *     http://www.apache.org/licenses/LICENSE-2.0\\n *\\n * Unless required by applicable law or agreed to in writing, software\\n * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n * See the License for the specific language governing permissions and\\n * limitations under the License.\\n */\\n\\n.ima-ad-container {\\n  top: 0em;\\n  position: absolute;\\n  display: none;\\n  width: 100%;\\n  height: 100%;\\n}\\n\\n/* Move overlay if user fast-clicks play button. */\\n.video-js.vjs-playing .bumpable-ima-ad-container {\\n  margin-top: -4em;\\n}\\n\\n/* Move overlay when controls are active. */\\n.video-js.vjs-user-inactive.vjs-playing .bumpable-ima-ad-container {\\n  margin-top: 0em;\\n}\\n\\n.video-js.vjs-paused .bumpable-ima-ad-container,\\n.video-js.vjs-playing:hover .bumpable-ima-ad-container,\\n.video-js.vjs-user-active.vjs-playing .bumpable-ima-ad-container {\\n  margin-top: -4em;\\n}\\n\\n.ima-controls-div {\\n  bottom: 0em;\\n  height: 1.4em;\\n  position: absolute;\\n  overflow: hidden;\\n  display: none;\\n  opacity: 1;\\n  background-color: rgba(7, 20, 30, .7);\\n  background: -moz-linear-gradient(\\n      bottom,\\n      rgba(7, 20, 30, .7) 0%,\\n      rgba(7, 20, 30, 0) 100%); /* FF3.6+ */\\n  background: -webkit-gradient(\\n      linear,\\n      left bottom,\\n      left top,\\n      color-stop(0%,rgba(7, 20, 30, .7)),\\n      color-stop(100%,rgba(7, 20, 30, 0))); /* Chrome,Safari4+ */\\n  background: -webkit-linear-gradient(\\n      bottom,\\n      rgba(7, 20, 30, .7) 0%,\\n      rgba(7, 20, 30, 0) 100%); /* Chrome10+,Safari5.1+ */\\n  background: -o-linear-gradient(bottom,\\n    rgba(7, 20, 30, .7) 0%,\\n    rgba(7, 20, 30, 0) 100%); /* Opera 11.10+ */\\n  background: -ms-linear-gradient(bottom,\\n    rgba(7, 20, 30, .7) 0%,\\n    rgba(7, 20, 30, 0) 100%); /* IE10+ */\\n  background: linear-gradient(to top,\\n    rgba(7, 20, 30, .7) 0%,\\n    rgba(7, 20, 30, 0) 100%); /* W3C */\\n  filter: progid:DXImageTransform.Microsoft.gradient(\\n    startColorstr='#0007141E',\\n    endColorstr='#07141E',GradientType=0 ); /* IE6-9 */\\n}\\n\\n.ima-controls-div.ima-controls-div-showing {\\n  height: 3.7em;\\n}\\n\\n.ima-countdown-div {\\n  height: 1em;\\n  color: #FFFFFF;\\n  text-shadow: 0 0 0.2em #000;\\n  cursor: default;\\n}\\n\\n.ima-seek-bar-div {\\n  top: 1.2em;\\n  height: 0.3em;\\n  position: absolute;\\n  background: rgba(255, 255, 255, .4);\\n}\\n\\n.ima-progress-div {\\n  width: 0em;\\n  height: 0.3em;\\n  background-color: #ECC546;\\n}\\n\\n.ima-play-pause-div, .ima-mute-div, .ima-slider-div, .ima-fullscreen-div {\\n  width: 2.33em;\\n  height: 1.33em;\\n  top: 0.733em;\\n  left: 0em;\\n  position: absolute;\\n  color: #CCCCCC;\\n  font-size: 1.5em;\\n  line-height: 2;\\n  text-align: center;\\n  font-family: VideoJS;\\n  cursor: pointer;\\n}\\n\\n.ima-mute-div {\\n  left: auto;\\n  right: 5.667em;\\n}\\n\\n.ima-slider-div {\\n  left: auto;\\n  right: 2.33em;\\n  width: 3.33em;\\n  height: 0.667em;\\n  top: 1.33em;\\n  background-color: #555555;\\n}\\n\\n.ima-slider-level-div {\\n  width: 100%;\\n  height: 0.667em;\\n  background-color: #ECC546;\\n}\\n\\n.ima-fullscreen-div {\\n  left: auto;\\n  right: 0em;\\n}\\n\\n.ima-playing:before {\\n  content: \\\"\\\\00f103\\\";\\n}\\n\\n.ima-paused:before {\\n  content: \\\"\\\\00f101\\\";\\n}\\n\\n.ima-playing:hover:before, .ima-paused:hover:before {\\n  text-shadow: 0 0 1em #fff;\\n}\\n\\n.ima-non-muted:before {\\n  content: \\\"\\\\00f107\\\";\\n}\\n\\n.ima-muted:before {\\n  content: \\\"\\\\00f104\\\";\\n}\\n\\n.ima-non-muted:hover:before, .ima-muted:hover:before {\\n  text-shadow: 0 0 1em #fff;\\n}\\n\\n.ima-non-fullscreen:before {\\n  content: \\\"\\\\00f108\\\";\\n}\\n\\n.ima-fullscreen:before {\\n  content: \\\"\\\\00f109\\\";\\n}\\n\\n.ima-non-fullscreen:hover:before, .ima-fullscreen:hover:before {\\n  text-shadow: 0 0 1em #fff;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/*! @name videojs-logo @version 2.1.6 @license MIT */\n.video-js.vjs-logo{display:block}.video-js.vjs-logo .vjs-logo-content{position:absolute;opacity:1;transition:visibility 2s,opacity 2s}.video-js.vjs-logo .vjs-logo-content.vjs-logo-hide{visibility:hidden;opacity:0}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-logo/dist/videojs-logo.css\"],\"names\":[],\"mappings\":\"AAAA,oDAAoD;AACpD,mBAAmB,aAAa,CAAC,qCAAqC,iBAAiB,CAAC,SAAS,CAAC,mCAAmC,CAAC,mDAAmD,iBAAiB,CAAC,SAAS\",\"sourcesContent\":[\"/*! @name videojs-logo @version 2.1.6 @license MIT */\\n.video-js.vjs-logo{display:block}.video-js.vjs-logo .vjs-logo-content{position:absolute;opacity:1;transition:visibility 2s,opacity 2s}.video-js.vjs-logo .vjs-logo-content.vjs-logo-hide{visibility:hidden;opacity:0}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.video-js .vjs-overlay{color:#fff;position:absolute;text-align:center}.video-js .vjs-overlay-no-background{max-width:33%}.video-js .vjs-overlay-background{background-color:#646464;background-color:rgba(255,255,255,0.4);border-radius:3px;padding:10px;width:33%}.video-js .vjs-overlay-top-left{top:5px;left:5px}.video-js .vjs-overlay-top{left:50%;margin-left:-16.5%;top:5px}.video-js .vjs-overlay-top-right{right:5px;top:5px}.video-js .vjs-overlay-right{right:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-bottom-right{bottom:3.5em;right:5px}.video-js .vjs-overlay-bottom{bottom:3.5em;left:50%;margin-left:-16.5%}.video-js .vjs-overlay-bottom-left{bottom:3.5em;left:5px}.video-js .vjs-overlay-left{left:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-center{left:50%;margin-left:-16.5%;top:50%;transform:translateY(-50%)}.video-js .vjs-no-flex .vjs-overlay-left,.video-js .vjs-no-flex .vjs-overlay-center,.video-js .vjs-no-flex .vjs-overlay-right{margin-top:-15px}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-overlay/dist/videojs-overlay.css\"],\"names\":[],\"mappings\":\"AAAA,uBAAuB,UAAU,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,qCAAqC,aAAa,CAAC,kCAAkC,wBAAwB,CAAC,sCAAsC,CAAC,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC,gCAAgC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,iCAAiC,SAAS,CAAC,OAAO,CAAC,6BAA6B,SAAS,CAAC,OAAO,CAAC,0BAA0B,CAAC,oCAAoC,YAAY,CAAC,SAAS,CAAC,8BAA8B,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC,mCAAmC,YAAY,CAAC,QAAQ,CAAC,4BAA4B,QAAQ,CAAC,OAAO,CAAC,0BAA0B,CAAC,8BAA8B,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,0BAA0B,CAAC,8HAA8H,gBAAgB\",\"sourcesContent\":[\".video-js .vjs-overlay{color:#fff;position:absolute;text-align:center}.video-js .vjs-overlay-no-background{max-width:33%}.video-js .vjs-overlay-background{background-color:#646464;background-color:rgba(255,255,255,0.4);border-radius:3px;padding:10px;width:33%}.video-js .vjs-overlay-top-left{top:5px;left:5px}.video-js .vjs-overlay-top{left:50%;margin-left:-16.5%;top:5px}.video-js .vjs-overlay-top-right{right:5px;top:5px}.video-js .vjs-overlay-right{right:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-bottom-right{bottom:3.5em;right:5px}.video-js .vjs-overlay-bottom{bottom:3.5em;left:50%;margin-left:-16.5%}.video-js .vjs-overlay-bottom-left{bottom:3.5em;left:5px}.video-js .vjs-overlay-left{left:5px;top:50%;transform:translateY(-50%)}.video-js .vjs-overlay-center{left:50%;margin-left:-16.5%;top:50%;transform:translateY(-50%)}.video-js .vjs-no-flex .vjs-overlay-left,.video-js .vjs-no-flex .vjs-overlay-center,.video-js .vjs-no-flex .vjs-overlay-right{margin-top:-15px}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/*! @name videojs-seek-buttons @version 3.0.1 @license Apache-2.0 */\n.video-js .vjs-seek-button{font-family:'VideoJS';cursor:pointer;font-weight:400;font-style:normal}.video-js .vjs-seek-button.skip-back::before,.video-js.vjs-v6 .vjs-seek-button.skip-back .vjs-icon-placeholder::before,.video-js.vjs-v7 .vjs-seek-button.skip-back .vjs-icon-placeholder::before{transform:rotate(-45deg);-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);content:'\\\\f116'}.video-js .vjs-seek-button.skip-forward::before{transform:rotateY(180deg) rotate(-45deg);-ms-transform:rotateY(180deg) rotate(-45deg);-webkit-transform:rotateY(180deg) rotate(-45deg);content:'\\\\f116'}.video-js.vjs-v6 .vjs-seek-button.skip-back::before,.video-js.vjs-v6 .vjs-seek-button.skip-forward::before,.video-js.vjs-v7 .vjs-seek-button.skip-back::before,.video-js.vjs-v7 .vjs-seek-button.skip-forward::before{content:none}.video-js.vjs-v6 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before,.video-js.vjs-v7 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before{transform:scale(-1,1) rotate(-45deg);-ms-transform:scale(-1,1) rotate(-45deg);-webkit-transform:scale(-1,1) rotate(-45deg);content:'\\\\f116'}`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.css\"],\"names\":[],\"mappings\":\"AAAA,mEAAmE;AACnE,2BAA2B,qBAAqB,CAAC,cAAc,CAAC,eAAe,CAAC,iBAAiB,CAAC,iMAAiM,wBAAwB,CAAC,4BAA4B,CAAC,gCAAgC,CAAC,eAAe,CAAC,gDAAgD,wCAAwC,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,eAAe,CAAC,sNAAsN,YAAY,CAAC,0JAA0J,oCAAoC,CAAC,wCAAwC,CAAC,4CAA4C,CAAC,eAAe\",\"sourcesContent\":[\"/*! @name videojs-seek-buttons @version 3.0.1 @license Apache-2.0 */\\n.video-js .vjs-seek-button{font-family:'VideoJS';cursor:pointer;font-weight:400;font-style:normal}.video-js .vjs-seek-button.skip-back::before,.video-js.vjs-v6 .vjs-seek-button.skip-back .vjs-icon-placeholder::before,.video-js.vjs-v7 .vjs-seek-button.skip-back .vjs-icon-placeholder::before{transform:rotate(-45deg);-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);content:'\\\\f116'}.video-js .vjs-seek-button.skip-forward::before{transform:rotateY(180deg) rotate(-45deg);-ms-transform:rotateY(180deg) rotate(-45deg);-webkit-transform:rotateY(180deg) rotate(-45deg);content:'\\\\f116'}.video-js.vjs-v6 .vjs-seek-button.skip-back::before,.video-js.vjs-v6 .vjs-seek-button.skip-forward::before,.video-js.vjs-v7 .vjs-seek-button.skip-back::before,.video-js.vjs-v7 .vjs-seek-button.skip-forward::before{content:none}.video-js.vjs-v6 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before,.video-js.vjs-v7 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before{transform:scale(-1,1) rotate(-45deg);-ms-transform:scale(-1,1) rotate(-45deg);-webkit-transform:scale(-1,1) rotate(-45deg);content:'\\\\f116'}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/**\n * videojs-share\n * @version 3.2.1\n * @copyright 2019 Mikhail Khazov <mkhazov.work@gmail.com>\n * @license MIT\n */\n.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-modal-dialog-content{display:flex;align-items:center;padding:0;background-image:linear-gradient(to bottom, rgba(0,0,0,0.77), rgba(0,0,0,0.75))}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{position:absolute;right:0;top:5px;width:30px;height:30px;color:#fff;cursor:pointer;opacity:0.9;transition:opacity 0.25s ease-out}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:before{content:'×';font-size:20px;line-height:15px}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:hover{opacity:1}.video-js .vjs-share{display:flex;flex-direction:column;justify-content:space-around;align-items:center;width:100%;height:100%;max-height:400px}.video-js .vjs-share__top,.video-js .vjs-share__middle,.video-js .vjs-share__bottom{display:flex}.video-js .vjs-share__top,.video-js .vjs-share__middle{flex-direction:column;justify-content:space-between}.video-js .vjs-share__middle{padding:0 25px}.video-js .vjs-share__title{align-self:center;font-size:22px;color:#fff}.video-js .vjs-share__subtitle{width:100%;margin:0 auto 12px;font-size:16px;color:#fff;opacity:0.7}.video-js .vjs-share__short-link-wrapper{position:relative;display:block;width:100%;height:40px;margin:0 auto;margin-bottom:15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none;overflow:hidden;flex-shrink:0}.video-js .vjs-share__short-link{display:block;width:100%;height:100%;padding:0 40px 0 15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none}.video-js .vjs-share__btn{position:absolute;right:0;bottom:0;height:40px;width:40px;display:flex;align-items:center;padding:0 11px;border:0;color:#fff;background-color:#2e2e2e;background-size:18px 19px;background-position:center;background-repeat:no-repeat;cursor:pointer;outline:none;transition:width 0.3s ease-out, padding 0.3s ease-out}.video-js .vjs-share__btn svg{flex-shrink:0}.video-js .vjs-share__btn span{position:relative;padding-left:10px;opacity:0;transition:opacity 0.3s ease-out}.video-js .vjs-share__btn:hover{justify-content:center;width:100%;padding:0 40px;background-image:none}.video-js .vjs-share__btn:hover span{opacity:1}.video-js .vjs-share__socials{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;transition:width 0.3s ease-out, height 0.3s ease-out}.video-js .vjs-share__social{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:32px;height:32px;margin-right:6px;margin-bottom:6px;cursor:pointer;font-size:8px;transition:transform 0.3s ease-out, filter 0.2s ease-out;border:none;outline:none}.video-js .vjs-share__social:hover{filter:brightness(115%)}.video-js .vjs-share__social svg{overflow:visible;max-height:24px}.video-js .vjs-share__social_vk{background-color:#5d7294}.video-js .vjs-share__social_ok{background-color:#ed7c20}.video-js .vjs-share__social_mail,.video-js .vjs-share__social_email{background-color:#134785}.video-js .vjs-share__social_tw{background-color:#76aaeb}.video-js .vjs-share__social_reddit{background-color:#ff4500}.video-js .vjs-share__social_fbFeed{background-color:#475995}.video-js .vjs-share__social_messenger{background-color:#0084ff}.video-js .vjs-share__social_gp{background-color:#d53f35}.video-js .vjs-share__social_linkedin{background-color:#0077b5}.video-js .vjs-share__social_viber{background-color:#766db5}.video-js .vjs-share__social_telegram{background-color:#4bb0e2}.video-js .vjs-share__social_whatsapp{background-color:#78c870}.video-js .vjs-share__bottom{justify-content:center}@media (max-height: 220px){.video-js .vjs-share .hidden-xs{display:none}}@media (max-height: 350px){.video-js .vjs-share .hidden-sm{display:none}}@media (min-height: 400px){.video-js .vjs-share__title{margin-bottom:15px}.video-js .vjs-share__short-link-wrapper{margin-bottom:30px}}@media (min-width: 320px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:5px;top:10px}}@media (min-width: 660px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:20px;top:20px}.video-js .vjs-share__social{width:40px;height:40px}}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/videojs-share/dist/videojs-share.css\"],\"names\":[],\"mappings\":\"AAAA;;;;;EAKE;AACF,6EAA6E,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,+EAA+E,CAAC,qEAAqE,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,iCAAiC,CAAC,4EAA4E,WAAW,CAAC,cAAc,CAAC,gBAAgB,CAAC,2EAA2E,SAAS,CAAC,qBAAqB,YAAY,CAAC,qBAAqB,CAAC,4BAA4B,CAAC,kBAAkB,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,oFAAoF,YAAY,CAAC,uDAAuD,qBAAqB,CAAC,6BAA6B,CAAC,6BAA6B,cAAc,CAAC,4BAA4B,iBAAiB,CAAC,cAAc,CAAC,UAAU,CAAC,+BAA+B,UAAU,CAAC,kBAAkB,CAAC,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,yCAAyC,iBAAiB,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,QAAQ,CAAC,4BAA4B,CAAC,wBAAwB,CAAC,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,iCAAiC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,qBAAqB,CAAC,QAAQ,CAAC,4BAA4B,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,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* @version 3.2.1\\n * @copyright 2019 Mikhail Khazov <mkhazov.work@gmail.com>\\n * @license MIT\\n */\\n.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-modal-dialog-content{display:flex;align-items:center;padding:0;background-image:linear-gradient(to bottom, rgba(0,0,0,0.77), rgba(0,0,0,0.75))}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{position:absolute;right:0;top:5px;width:30px;height:30px;color:#fff;cursor:pointer;opacity:0.9;transition:opacity 0.25s ease-out}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:before{content:'×';font-size:20px;line-height:15px}.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button:hover{opacity:1}.video-js .vjs-share{display:flex;flex-direction:column;justify-content:space-around;align-items:center;width:100%;height:100%;max-height:400px}.video-js .vjs-share__top,.video-js .vjs-share__middle,.video-js .vjs-share__bottom{display:flex}.video-js .vjs-share__top,.video-js .vjs-share__middle{flex-direction:column;justify-content:space-between}.video-js .vjs-share__middle{padding:0 25px}.video-js .vjs-share__title{align-self:center;font-size:22px;color:#fff}.video-js .vjs-share__subtitle{width:100%;margin:0 auto 12px;font-size:16px;color:#fff;opacity:0.7}.video-js .vjs-share__short-link-wrapper{position:relative;display:block;width:100%;height:40px;margin:0 auto;margin-bottom:15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none;overflow:hidden;flex-shrink:0}.video-js .vjs-share__short-link{display:block;width:100%;height:100%;padding:0 40px 0 15px;border:0;color:rgba(255,255,255,0.65);background-color:#363636;outline:none}.video-js .vjs-share__btn{position:absolute;right:0;bottom:0;height:40px;width:40px;display:flex;align-items:center;padding:0 11px;border:0;color:#fff;background-color:#2e2e2e;background-size:18px 19px;background-position:center;background-repeat:no-repeat;cursor:pointer;outline:none;transition:width 0.3s ease-out, padding 0.3s ease-out}.video-js .vjs-share__btn svg{flex-shrink:0}.video-js .vjs-share__btn span{position:relative;padding-left:10px;opacity:0;transition:opacity 0.3s ease-out}.video-js .vjs-share__btn:hover{justify-content:center;width:100%;padding:0 40px;background-image:none}.video-js .vjs-share__btn:hover span{opacity:1}.video-js .vjs-share__socials{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;transition:width 0.3s ease-out, height 0.3s ease-out}.video-js .vjs-share__social{display:flex;justify-content:center;align-items:center;flex-shrink:0;width:32px;height:32px;margin-right:6px;margin-bottom:6px;cursor:pointer;font-size:8px;transition:transform 0.3s ease-out, filter 0.2s ease-out;border:none;outline:none}.video-js .vjs-share__social:hover{filter:brightness(115%)}.video-js .vjs-share__social svg{overflow:visible;max-height:24px}.video-js .vjs-share__social_vk{background-color:#5d7294}.video-js .vjs-share__social_ok{background-color:#ed7c20}.video-js .vjs-share__social_mail,.video-js .vjs-share__social_email{background-color:#134785}.video-js .vjs-share__social_tw{background-color:#76aaeb}.video-js .vjs-share__social_reddit{background-color:#ff4500}.video-js .vjs-share__social_fbFeed{background-color:#475995}.video-js .vjs-share__social_messenger{background-color:#0084ff}.video-js .vjs-share__social_gp{background-color:#d53f35}.video-js .vjs-share__social_linkedin{background-color:#0077b5}.video-js .vjs-share__social_viber{background-color:#766db5}.video-js .vjs-share__social_telegram{background-color:#4bb0e2}.video-js .vjs-share__social_whatsapp{background-color:#78c870}.video-js .vjs-share__bottom{justify-content:center}@media (max-height: 220px){.video-js .vjs-share .hidden-xs{display:none}}@media (max-height: 350px){.video-js .vjs-share .hidden-sm{display:none}}@media (min-height: 400px){.video-js .vjs-share__title{margin-bottom:15px}.video-js .vjs-share__short-link-wrapper{margin-bottom:30px}}@media (min-width: 320px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:5px;top:10px}}@media (min-width: 660px){.video-js.vjs-videojs-share_open .vjs-modal-dialog .vjs-close-button{right:20px;top:20px}.video-js .vjs-share__social{width:40px;height:40px}}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n  MIT License http://www.opensource.org/licenses/mit-license.php\n  Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n  var list = [];\n\n  // return the list of modules as css string\n  list.toString = function toString() {\n    return this.map(function (item) {\n      var content = \"\";\n      var needLayer = typeof item[5] !== \"undefined\";\n      if (item[4]) {\n        content += \"@supports (\".concat(item[4], \") {\");\n      }\n      if (item[2]) {\n        content += \"@media \".concat(item[2], \" {\");\n      }\n      if (needLayer) {\n        content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n      }\n      content += cssWithMappingToString(item);\n      if (needLayer) {\n        content += \"}\";\n      }\n      if (item[2]) {\n        content += \"}\";\n      }\n      if (item[4]) {\n        content += \"}\";\n      }\n      return content;\n    }).join(\"\");\n  };\n\n  // import a list of modules into the list\n  list.i = function i(modules, media, dedupe, supports, layer) {\n    if (typeof modules === \"string\") {\n      modules = [[null, modules, undefined]];\n    }\n    var alreadyImportedModules = {};\n    if (dedupe) {\n      for (var k = 0; k < this.length; k++) {\n        var id = this[k][0];\n        if (id != null) {\n          alreadyImportedModules[id] = true;\n        }\n      }\n    }\n    for (var _k = 0; _k < modules.length; _k++) {\n      var item = [].concat(modules[_k]);\n      if (dedupe && alreadyImportedModules[item[0]]) {\n        continue;\n      }\n      if (typeof layer !== \"undefined\") {\n        if (typeof item[5] === \"undefined\") {\n          item[5] = layer;\n        } else {\n          item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n          item[5] = layer;\n        }\n      }\n      if (media) {\n        if (!item[2]) {\n          item[2] = media;\n        } else {\n          item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n          item[2] = media;\n        }\n      }\n      if (supports) {\n        if (!item[4]) {\n          item[4] = \"\".concat(supports);\n        } else {\n          item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n          item[4] = supports;\n        }\n      }\n      list.push(item);\n    }\n  };\n  return list;\n};","\"use strict\";\n\nmodule.exports = function (url, options) {\n  if (!options) {\n    options = {};\n  }\n  if (!url) {\n    return url;\n  }\n  url = String(url.__esModule ? url.default : url);\n\n  // If url is already wrapped in quotes, remove them\n  if (/^['\"].*['\"]$/.test(url)) {\n    url = url.slice(1, -1);\n  }\n  if (options.hash) {\n    url += options.hash;\n  }\n\n  // Should url be wrapped?\n  // See https://drafts.csswg.org/css-values-3/#urls\n  if (/[\"'() \\t\\n]|(%20)/.test(url) || options.needQuotes) {\n    return \"\\\"\".concat(url.replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\"), \"\\\"\");\n  }\n  return url;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n  var content = item[1];\n  var cssMapping = item[3];\n  if (!cssMapping) {\n    return content;\n  }\n  if (typeof btoa === \"function\") {\n    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n    var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n    var sourceMapping = \"/*# \".concat(data, \" */\");\n    return [content].concat([sourceMapping]).join(\"\\n\");\n  }\n  return [content].join(\"\\n\");\n};","var DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n    var proto = Element.prototype;\n\n    proto.matches = proto.matchesSelector ||\n                    proto.mozMatchesSelector ||\n                    proto.msMatchesSelector ||\n                    proto.oMatchesSelector ||\n                    proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n    while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n        if (typeof element.matches === 'function' &&\n            element.matches(selector)) {\n          return element;\n        }\n        element = element.parentNode;\n    }\n}\n\nmodule.exports = closest;\n","var closest = require('./closest');\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n    var listenerFn = listener.apply(this, arguments);\n\n    element.addEventListener(type, listenerFn, useCapture);\n\n    return {\n        destroy: function() {\n            element.removeEventListener(type, listenerFn, useCapture);\n        }\n    }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n    // Handle the regular Element usage\n    if (typeof elements.addEventListener === 'function') {\n        return _delegate.apply(null, arguments);\n    }\n\n    // Handle Element-less usage, it defaults to global delegation\n    if (typeof type === 'function') {\n        // Use `document` as the first parameter, then apply arguments\n        // This is a short way to .unshift `arguments` without running into deoptimizations\n        return _delegate.bind(null, document).apply(null, arguments);\n    }\n\n    // Handle Selector-based usage\n    if (typeof elements === 'string') {\n        elements = document.querySelectorAll(elements);\n    }\n\n    // Handle Array-like based usage\n    return Array.prototype.map.call(elements, function (element) {\n        return _delegate(element, selector, type, callback, useCapture);\n    });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n    return function(e) {\n        e.delegateTarget = closest(e.target, selector);\n\n        if (e.delegateTarget) {\n            callback.call(element, e);\n        }\n    }\n}\n\nmodule.exports = delegate;\n","var topLevel = typeof global !== 'undefined' ? global :\n    typeof window !== 'undefined' ? window : {}\nvar minDoc = require('min-document');\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n    doccy = document;\n} else {\n    doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n    if (!doccy) {\n        doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n    }\n}\n\nmodule.exports = doccy;\n","var win;\n\nif (typeof window !== \"undefined\") {\n    win = window;\n} else if (typeof global !== \"undefined\") {\n    win = global;\n} else if (typeof self !== \"undefined\"){\n    win = self;\n} else {\n    win = {};\n}\n\nmodule.exports = win;\n","/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n    return value !== undefined\n        && value instanceof HTMLElement\n        && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n    var type = Object.prototype.toString.call(value);\n\n    return value !== undefined\n        && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n        && ('length' in value)\n        && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n    return typeof value === 'string'\n        || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n    var type = Object.prototype.toString.call(value);\n\n    return type === '[object Function]';\n};\n","var is = require('./is');\nvar delegate = require('delegate');\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n    if (!target && !type && !callback) {\n        throw new Error('Missing required arguments');\n    }\n\n    if (!is.string(type)) {\n        throw new TypeError('Second argument must be a String');\n    }\n\n    if (!is.fn(callback)) {\n        throw new TypeError('Third argument must be a Function');\n    }\n\n    if (is.node(target)) {\n        return listenNode(target, type, callback);\n    }\n    else if (is.nodeList(target)) {\n        return listenNodeList(target, type, callback);\n    }\n    else if (is.string(target)) {\n        return listenSelector(target, type, callback);\n    }\n    else {\n        throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n    }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n    node.addEventListener(type, callback);\n\n    return {\n        destroy: function() {\n            node.removeEventListener(type, callback);\n        }\n    }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n    Array.prototype.forEach.call(nodeList, function(node) {\n        node.addEventListener(type, callback);\n    });\n\n    return {\n        destroy: function() {\n            Array.prototype.forEach.call(nodeList, function(node) {\n                node.removeEventListener(type, callback);\n            });\n        }\n    }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n    return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n  if (!fn) {\n    return false\n  }\n  var string = toString.call(fn)\n  return string === '[object Function]' ||\n    (typeof fn === 'function' && string !== '[object RegExp]') ||\n    (typeof window !== 'undefined' &&\n     // IE8 and below\n     (fn === window.setTimeout ||\n      fn === window.alert ||\n      fn === window.confirm ||\n      fn === window.prompt))\n};\n","// Source: http://jsfiddle.net/vWx8V/\n// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes\n\n/**\n * Conenience method returns corresponding value for given keyName or keyCode.\n *\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Mixed}\n * @api public\n */\n\nfunction keyCode(searchInput) {\n  // Keyboard Events\n  if (searchInput && 'object' === typeof searchInput) {\n    var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode\n    if (hasKeyCode) searchInput = hasKeyCode\n  }\n\n  // Numbers\n  if ('number' === typeof searchInput) return names[searchInput]\n\n  // Everything else (cast to string)\n  var search = String(searchInput)\n\n  // check codes\n  var foundNamedKey = codes[search.toLowerCase()]\n  if (foundNamedKey) return foundNamedKey\n\n  // check aliases\n  var foundNamedKey = aliases[search.toLowerCase()]\n  if (foundNamedKey) return foundNamedKey\n\n  // weird character?\n  if (search.length === 1) return search.charCodeAt(0)\n\n  return undefined\n}\n\n/**\n * Compares a keyboard event with a given keyCode or keyName.\n *\n * @param {Event} event Keyboard event that should be tested\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Boolean}\n * @api public\n */\nkeyCode.isEventKey = function isEventKey(event, nameOrCode) {\n  if (event && 'object' === typeof event) {\n    var keyCode = event.which || event.keyCode || event.charCode\n    if (keyCode === null || keyCode === undefined) { return false; }\n    if (typeof nameOrCode === 'string') {\n      // check codes\n      var foundNamedKey = codes[nameOrCode.toLowerCase()]\n      if (foundNamedKey) { return foundNamedKey === keyCode; }\n    \n      // check aliases\n      var foundNamedKey = aliases[nameOrCode.toLowerCase()]\n      if (foundNamedKey) { return foundNamedKey === keyCode; }\n    } else if (typeof nameOrCode === 'number') {\n      return nameOrCode === keyCode;\n    }\n    return false;\n  }\n}\n\nexports = module.exports = keyCode;\n\n/**\n * Get by name\n *\n *   exports.code['enter'] // => 13\n */\n\nvar codes = exports.code = exports.codes = {\n  'backspace': 8,\n  'tab': 9,\n  'enter': 13,\n  'shift': 16,\n  'ctrl': 17,\n  'alt': 18,\n  'pause/break': 19,\n  'caps lock': 20,\n  'esc': 27,\n  'space': 32,\n  'page up': 33,\n  'page down': 34,\n  'end': 35,\n  'home': 36,\n  'left': 37,\n  'up': 38,\n  'right': 39,\n  'down': 40,\n  'insert': 45,\n  'delete': 46,\n  'command': 91,\n  'left command': 91,\n  'right command': 93,\n  'numpad *': 106,\n  'numpad +': 107,\n  'numpad -': 109,\n  'numpad .': 110,\n  'numpad /': 111,\n  'num lock': 144,\n  'scroll lock': 145,\n  'my computer': 182,\n  'my calculator': 183,\n  ';': 186,\n  '=': 187,\n  ',': 188,\n  '-': 189,\n  '.': 190,\n  '/': 191,\n  '`': 192,\n  '[': 219,\n  '\\\\': 220,\n  ']': 221,\n  \"'\": 222\n}\n\n// Helper aliases\n\nvar aliases = exports.aliases = {\n  'windows': 91,\n  '⇧': 16,\n  '⌥': 18,\n  '⌃': 17,\n  '⌘': 91,\n  'ctl': 17,\n  'control': 17,\n  'option': 18,\n  'pause': 19,\n  'break': 19,\n  'caps': 20,\n  'return': 13,\n  'escape': 27,\n  'spc': 32,\n  'spacebar': 32,\n  'pgup': 33,\n  'pgdn': 34,\n  'ins': 45,\n  'del': 46,\n  'cmd': 91\n}\n\n/*!\n * Programatically add the following\n */\n\n// lower case chars\nfor (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32\n\n// numbers\nfor (var i = 48; i < 58; i++) codes[i - 48] = i\n\n// function keys\nfor (i = 1; i < 13; i++) codes['f'+i] = i + 111\n\n// numpad keys\nfor (i = 0; i < 10; i++) codes['numpad '+i] = i + 96\n\n/**\n * Get by code\n *\n *   exports.name[13] // => 'Enter'\n */\n\nvar names = exports.names = exports.title = {} // title for backward compat\n\n// Create reverse mapping\nfor (i in codes) names[codes[i]] = i\n\n// Add aliases\nfor (var alias in aliases) {\n  codes[alias] = aliases[alias]\n}\n","var getUint64 = require('../utils/numbers.js').getUint64;\n\nvar parseSidx = function(data) {\n  var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n      result = {\n        version: data[0],\n        flags: new Uint8Array(data.subarray(1, 4)),\n        references: [],\n        referenceId: view.getUint32(4),\n        timescale: view.getUint32(8)\n      },\n    i = 12;\n\n  if (result.version === 0) {\n    result.earliestPresentationTime = view.getUint32(i);\n    result.firstOffset = view.getUint32(i + 4);\n    i += 8;\n  } else {\n    // read 64 bits\n    result.earliestPresentationTime = getUint64(data.subarray(i));\n    result.firstOffset = getUint64(data.subarray(i + 8));\n    i += 16;\n  }\n\n  i += 2; // reserved\n\n  var referenceCount = view.getUint16(i);\n\n  i += 2; // start of references\n\n  for (; referenceCount > 0; i += 12, referenceCount--) {\n    result.references.push({\n      referenceType: (data[i] & 0x80) >>> 7,\n      referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n      subsegmentDuration: view.getUint32(i + 4),\n      startsWithSap: !!(data[i + 8] & 0x80),\n      sapType: (data[i + 8] & 0x70) >>> 4,\n      sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n    });\n  }\n\n  return result;\n};\n\n\nmodule.exports = parseSidx;\n","/**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\nvar\n  ONE_SECOND_IN_TS = 90000, // 90kHz clock\n  secondsToVideoTs,\n  secondsToAudioTs,\n  videoTsToSeconds,\n  audioTsToSeconds,\n  audioTsToVideoTs,\n  videoTsToAudioTs,\n  metadataTsToSeconds;\n\nsecondsToVideoTs = function(seconds) {\n  return seconds * ONE_SECOND_IN_TS;\n};\n\nsecondsToAudioTs = function(seconds, sampleRate) {\n  return seconds * sampleRate;\n};\n\nvideoTsToSeconds = function(timestamp) {\n  return timestamp / ONE_SECOND_IN_TS;\n};\n\naudioTsToSeconds = function(timestamp, sampleRate) {\n  return timestamp / sampleRate;\n};\n\naudioTsToVideoTs = function(timestamp, sampleRate) {\n  return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n};\n\nvideoTsToAudioTs = function(timestamp, sampleRate) {\n  return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n};\n\n/**\n * Adjust ID3 tag or caption timing information by the timeline pts values\n * (if keepOriginalTimestamps is false) and convert to seconds\n */\nmetadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {\n  return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n};\n\nmodule.exports = {\n  ONE_SECOND_IN_TS: ONE_SECOND_IN_TS,\n  secondsToVideoTs: secondsToVideoTs,\n  secondsToAudioTs: secondsToAudioTs,\n  videoTsToSeconds: videoTsToSeconds,\n  audioTsToSeconds: audioTsToSeconds,\n  audioTsToVideoTs: audioTsToVideoTs,\n  videoTsToAudioTs: videoTsToAudioTs,\n  metadataTsToSeconds: metadataTsToSeconds\n};\n","var MAX_UINT32 = Math.pow(2, 32);\n\nvar getUint64 = function(uint8) {\n  var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);\n  var value;\n\n  if (dv.getBigUint64) {\n    value = dv.getBigUint64(0);\n\n    if (value < Number.MAX_SAFE_INTEGER) {\n      return Number(value);\n    }\n\n    return value;\n  }\n\n  return (dv.getUint32(0) * MAX_UINT32) + dv.getUint32(4);\n};\n\nmodule.exports = {\n  getUint64: getUint64,\n  MAX_UINT32: MAX_UINT32\n};\n","module.exports = SafeParseTuple\n\nfunction SafeParseTuple(obj, reviver) {\n    var json\n    var error = null\n\n    try {\n        json = JSON.parse(obj, reviver)\n    } catch (err) {\n        error = err\n    }\n\n    return [error, json]\n}\n","function select(element) {\n    var selectedText;\n\n    if (element.nodeName === 'SELECT') {\n        element.focus();\n\n        selectedText = element.value;\n    }\n    else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n        var isReadOnly = element.hasAttribute('readonly');\n\n        if (!isReadOnly) {\n            element.setAttribute('readonly', '');\n        }\n\n        element.select();\n        element.setSelectionRange(0, element.value.length);\n\n        if (!isReadOnly) {\n            element.removeAttribute('readonly');\n        }\n\n        selectedText = element.value;\n    }\n    else {\n        if (element.hasAttribute('contenteditable')) {\n            element.focus();\n        }\n\n        var selection = window.getSelection();\n        var range = document.createRange();\n\n        range.selectNodeContents(element);\n        selection.removeAllRanges();\n        selection.addRange(range);\n\n        selectedText = selection.toString();\n    }\n\n    return selectedText;\n}\n\nmodule.exports = select;\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n  var result = -1;\n  for (var i = 0; i < stylesInDOM.length; i++) {\n    if (stylesInDOM[i].identifier === identifier) {\n      result = i;\n      break;\n    }\n  }\n  return result;\n}\nfunction modulesToDom(list, options) {\n  var idCountMap = {};\n  var identifiers = [];\n  for (var i = 0; i < list.length; i++) {\n    var item = list[i];\n    var id = options.base ? item[0] + options.base : item[0];\n    var count = idCountMap[id] || 0;\n    var identifier = \"\".concat(id, \" \").concat(count);\n    idCountMap[id] = count + 1;\n    var indexByIdentifier = getIndexByIdentifier(identifier);\n    var obj = {\n      css: item[1],\n      media: item[2],\n      sourceMap: item[3],\n      supports: item[4],\n      layer: item[5]\n    };\n    if (indexByIdentifier !== -1) {\n      stylesInDOM[indexByIdentifier].references++;\n      stylesInDOM[indexByIdentifier].updater(obj);\n    } else {\n      var updater = addElementStyle(obj, options);\n      options.byIndex = i;\n      stylesInDOM.splice(i, 0, {\n        identifier: identifier,\n        updater: updater,\n        references: 1\n      });\n    }\n    identifiers.push(identifier);\n  }\n  return identifiers;\n}\nfunction addElementStyle(obj, options) {\n  var api = options.domAPI(options);\n  api.update(obj);\n  var updater = function updater(newObj) {\n    if (newObj) {\n      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n        return;\n      }\n      api.update(obj = newObj);\n    } else {\n      api.remove();\n    }\n  };\n  return updater;\n}\nmodule.exports = function (list, options) {\n  options = options || {};\n  list = list || [];\n  var lastIdentifiers = modulesToDom(list, options);\n  return function update(newList) {\n    newList = newList || [];\n    for (var i = 0; i < lastIdentifiers.length; i++) {\n      var identifier = lastIdentifiers[i];\n      var index = getIndexByIdentifier(identifier);\n      stylesInDOM[index].references--;\n    }\n    var newLastIdentifiers = modulesToDom(newList, options);\n    for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n      var _identifier = lastIdentifiers[_i];\n      var _index = getIndexByIdentifier(_identifier);\n      if (stylesInDOM[_index].references === 0) {\n        stylesInDOM[_index].updater();\n        stylesInDOM.splice(_index, 1);\n      }\n    }\n    lastIdentifiers = newLastIdentifiers;\n  };\n};","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next  */\nfunction getTarget(target) {\n  if (typeof memo[target] === \"undefined\") {\n    var styleTarget = document.querySelector(target);\n\n    // Special case to return head of iframe instead of iframe itself\n    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n      try {\n        // This will throw an exception if access to iframe is blocked\n        // due to cross-origin restrictions\n        styleTarget = styleTarget.contentDocument.head;\n      } catch (e) {\n        // istanbul ignore next\n        styleTarget = null;\n      }\n    }\n    memo[target] = styleTarget;\n  }\n  return memo[target];\n}\n\n/* istanbul ignore next  */\nfunction insertBySelector(insert, style) {\n  var target = getTarget(insert);\n  if (!target) {\n    throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n  }\n  target.appendChild(style);\n}\nmodule.exports = insertBySelector;","\"use strict\";\n\n/* istanbul ignore next  */\nfunction insertStyleElement(options) {\n  var element = document.createElement(\"style\");\n  options.setAttributes(element, options.attributes);\n  options.insert(element, options.options);\n  return element;\n}\nmodule.exports = insertStyleElement;","\"use strict\";\n\n/* istanbul ignore next  */\nfunction setAttributesWithoutAttributes(styleElement) {\n  var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n  if (nonce) {\n    styleElement.setAttribute(\"nonce\", nonce);\n  }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/* istanbul ignore next  */\nfunction apply(styleElement, options, obj) {\n  var css = \"\";\n  if (obj.supports) {\n    css += \"@supports (\".concat(obj.supports, \") {\");\n  }\n  if (obj.media) {\n    css += \"@media \".concat(obj.media, \" {\");\n  }\n  var needLayer = typeof obj.layer !== \"undefined\";\n  if (needLayer) {\n    css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n  }\n  css += obj.css;\n  if (needLayer) {\n    css += \"}\";\n  }\n  if (obj.media) {\n    css += \"}\";\n  }\n  if (obj.supports) {\n    css += \"}\";\n  }\n  var sourceMap = obj.sourceMap;\n  if (sourceMap && typeof btoa !== \"undefined\") {\n    css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n  }\n\n  // For old IE\n  /* istanbul ignore if  */\n  options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n  // istanbul ignore if\n  if (styleElement.parentNode === null) {\n    return false;\n  }\n  styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next  */\nfunction domAPI(options) {\n  if (typeof document === \"undefined\") {\n    return {\n      update: function update() {},\n      remove: function remove() {}\n    };\n  }\n  var styleElement = options.insertStyleElement(options);\n  return {\n    update: function update(obj) {\n      apply(styleElement, options, obj);\n    },\n    remove: function remove() {\n      removeStyleElement(styleElement);\n    }\n  };\n}\nmodule.exports = domAPI;","\"use strict\";\n\n/* istanbul ignore next  */\nfunction styleTagTransform(css, styleElement) {\n  if (styleElement.styleSheet) {\n    styleElement.styleSheet.cssText = css;\n  } else {\n    while (styleElement.firstChild) {\n      styleElement.removeChild(styleElement.firstChild);\n    }\n    styleElement.appendChild(document.createTextNode(css));\n  }\n}\nmodule.exports = styleTagTransform;","function E () {\n  // Keep this empty so it's easier to inherit from\n  // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n  on: function (name, callback, ctx) {\n    var e = this.e || (this.e = {});\n\n    (e[name] || (e[name] = [])).push({\n      fn: callback,\n      ctx: ctx\n    });\n\n    return this;\n  },\n\n  once: function (name, callback, ctx) {\n    var self = this;\n    function listener () {\n      self.off(name, listener);\n      callback.apply(ctx, arguments);\n    };\n\n    listener._ = callback\n    return this.on(name, listener, ctx);\n  },\n\n  emit: function (name) {\n    var data = [].slice.call(arguments, 1);\n    var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n    var i = 0;\n    var len = evtArr.length;\n\n    for (i; i < len; i++) {\n      evtArr[i].fn.apply(evtArr[i].ctx, data);\n    }\n\n    return this;\n  },\n\n  off: function (name, callback) {\n    var e = this.e || (this.e = {});\n    var evts = e[name];\n    var liveEvents = [];\n\n    if (evts && callback) {\n      for (var i = 0, len = evts.length; i < len; i++) {\n        if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n          liveEvents.push(evts[i]);\n      }\n    }\n\n    // Remove event from queue to prevent memory leak\n    // Suggested by https://github.com/lazd\n    // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n    (liveEvents.length)\n      ? e[name] = liveEvents\n      : delete e[name];\n\n    return this;\n  }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n","// see https://tools.ietf.org/html/rfc1808\n\n(function (root) {\n  var URL_REGEX =\n    /^(?=((?:[a-zA-Z0-9+\\-.]+:)?))\\1(?=((?:\\/\\/[^\\/?#]*)?))\\2(?=((?:(?:[^?#\\/]*\\/)*[^;?#\\/]*)?))\\3((?:;[^?#]*)?)(\\?[^#]*)?(#[^]*)?$/;\n  var FIRST_SEGMENT_REGEX = /^(?=([^\\/?#]*))\\1([^]*)$/;\n  var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n  var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/)[^\\/]*(?=\\/)/g;\n\n  var URLToolkit = {\n    // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n    // E.g\n    // With opts.alwaysNormalize = false (default, spec compliant)\n    // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n    // With opts.alwaysNormalize = true (not spec compliant)\n    // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n    buildAbsoluteURL: function (baseURL, relativeURL, opts) {\n      opts = opts || {};\n      // remove any remaining space and CRLF\n      baseURL = baseURL.trim();\n      relativeURL = relativeURL.trim();\n      if (!relativeURL) {\n        // 2a) If the embedded URL is entirely empty, it inherits the\n        // entire base URL (i.e., is set equal to the base URL)\n        // and we are done.\n        if (!opts.alwaysNormalize) {\n          return baseURL;\n        }\n        var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n        if (!basePartsForNormalise) {\n          throw new Error('Error trying to parse base URL.');\n        }\n        basePartsForNormalise.path = URLToolkit.normalizePath(\n          basePartsForNormalise.path\n        );\n        return URLToolkit.buildURLFromParts(basePartsForNormalise);\n      }\n      var relativeParts = URLToolkit.parseURL(relativeURL);\n      if (!relativeParts) {\n        throw new Error('Error trying to parse relative URL.');\n      }\n      if (relativeParts.scheme) {\n        // 2b) If the embedded URL starts with a scheme name, it is\n        // interpreted as an absolute URL and we are done.\n        if (!opts.alwaysNormalize) {\n          return relativeURL;\n        }\n        relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n        return URLToolkit.buildURLFromParts(relativeParts);\n      }\n      var baseParts = URLToolkit.parseURL(baseURL);\n      if (!baseParts) {\n        throw new Error('Error trying to parse base URL.');\n      }\n      if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n        // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n        // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n        var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n        baseParts.netLoc = pathParts[1];\n        baseParts.path = pathParts[2];\n      }\n      if (baseParts.netLoc && !baseParts.path) {\n        baseParts.path = '/';\n      }\n      var builtParts = {\n        // 2c) Otherwise, the embedded URL inherits the scheme of\n        // the base URL.\n        scheme: baseParts.scheme,\n        netLoc: relativeParts.netLoc,\n        path: null,\n        params: relativeParts.params,\n        query: relativeParts.query,\n        fragment: relativeParts.fragment,\n      };\n      if (!relativeParts.netLoc) {\n        // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n        // Step 7.  Otherwise, the embedded URL inherits the <net_loc>\n        // (if any) of the base URL.\n        builtParts.netLoc = baseParts.netLoc;\n        // 4) If the embedded URL path is preceded by a slash \"/\", the\n        // path is not relative and we skip to Step 7.\n        if (relativeParts.path[0] !== '/') {\n          if (!relativeParts.path) {\n            // 5) If the embedded URL path is empty (and not preceded by a\n            // slash), then the embedded URL inherits the base URL path\n            builtParts.path = baseParts.path;\n            // 5a) if the embedded URL's <params> is non-empty, we skip to\n            // step 7; otherwise, it inherits the <params> of the base\n            // URL (if any) and\n            if (!relativeParts.params) {\n              builtParts.params = baseParts.params;\n              // 5b) if the embedded URL's <query> is non-empty, we skip to\n              // step 7; otherwise, it inherits the <query> of the base\n              // URL (if any) and we skip to step 7.\n              if (!relativeParts.query) {\n                builtParts.query = baseParts.query;\n              }\n            }\n          } else {\n            // 6) The last segment of the base URL's path (anything\n            // following the rightmost slash \"/\", or the entire path if no\n            // slash is present) is removed and the embedded URL's path is\n            // appended in its place.\n            var baseURLPath = baseParts.path;\n            var newPath =\n              baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) +\n              relativeParts.path;\n            builtParts.path = URLToolkit.normalizePath(newPath);\n          }\n        }\n      }\n      if (builtParts.path === null) {\n        builtParts.path = opts.alwaysNormalize\n          ? URLToolkit.normalizePath(relativeParts.path)\n          : relativeParts.path;\n      }\n      return URLToolkit.buildURLFromParts(builtParts);\n    },\n    parseURL: function (url) {\n      var parts = URL_REGEX.exec(url);\n      if (!parts) {\n        return null;\n      }\n      return {\n        scheme: parts[1] || '',\n        netLoc: parts[2] || '',\n        path: parts[3] || '',\n        params: parts[4] || '',\n        query: parts[5] || '',\n        fragment: parts[6] || '',\n      };\n    },\n    normalizePath: function (path) {\n      // The following operations are\n      // then applied, in order, to the new path:\n      // 6a) All occurrences of \"./\", where \".\" is a complete path\n      // segment, are removed.\n      // 6b) If the path ends with \".\" as a complete path segment,\n      // that \".\" is removed.\n      path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n      // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n      // complete path segment not equal to \"..\", are removed.\n      // Removal of these path segments is performed iteratively,\n      // removing the leftmost matching pattern on each iteration,\n      // until no matching pattern remains.\n      // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n      // complete path segment not equal to \"..\", that\n      // \"<segment>/..\" is removed.\n      while (\n        path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length\n      ) {}\n      return path.split('').reverse().join('');\n    },\n    buildURLFromParts: function (parts) {\n      return (\n        parts.scheme +\n        parts.netLoc +\n        parts.path +\n        parts.params +\n        parts.query +\n        parts.fragment\n      );\n    },\n  };\n\n  if (typeof exports === 'object' && typeof module === 'object')\n    module.exports = URLToolkit;\n  else if (typeof define === 'function' && define.amd)\n    define([], function () {\n      return URLToolkit;\n    });\n  else if (typeof exports === 'object') exports['URLToolkit'] = URLToolkit;\n  else root['URLToolkit'] = URLToolkit;\n})(this);\n","export default function _assertThisInitialized(self) {\n  if (self === void 0) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n  return self;\n}","export default function _setPrototypeOf(o, p) {\n  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n  return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n  setPrototypeOf(subClass, superClass);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n  if (isNativeReflectConstruct()) {\n    _construct = Reflect.construct.bind();\n  } else {\n    _construct = function _construct(Parent, args, Class) {\n      var a = [null];\n      a.push.apply(a, args);\n      var Constructor = Function.bind.apply(Parent, a);\n      var instance = new Constructor();\n      if (Class) setPrototypeOf(instance, Class.prototype);\n      return instance;\n    };\n  }\n  return _construct.apply(null, arguments);\n}","export default function _isNativeReflectConstruct() {\n  if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n  if (Reflect.construct.sham) return false;\n  if (typeof Proxy === \"function\") return true;\n  try {\n    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n    return true;\n  } catch (e) {\n    return false;\n  }\n}","import URLToolkit from 'url-toolkit';\nimport window from 'global/window';\nvar DEFAULT_LOCATION = 'http://example.com';\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n  // return early if we don't need to resolve\n  if (/^[a-z]+:/i.test(relativeUrl)) {\n    return relativeUrl;\n  } // if baseUrl is a data URI, ignore it and resolve everything relative to window.location\n\n\n  if (/^data:/.test(baseUrl)) {\n    baseUrl = window.location && window.location.href || '';\n  } // IE11 supports URL but not the URL constructor\n  // feature detect the behavior we want\n\n\n  var nativeURL = typeof window.URL === 'function';\n  var protocolLess = /^\\/\\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)\n  // and if baseUrl isn't an absolute url\n\n  var removeLocation = !window.location && !/\\/\\//i.test(baseUrl); // if the base URL is relative then combine with the current location\n\n  if (nativeURL) {\n    baseUrl = new window.URL(baseUrl, window.location || DEFAULT_LOCATION);\n  } else if (!/\\/\\//i.test(baseUrl)) {\n    baseUrl = URLToolkit.buildAbsoluteURL(window.location && window.location.href || '', baseUrl);\n  }\n\n  if (nativeURL) {\n    var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol\n    // and if we're location-less, remove the location\n    // otherwise, return the url unmodified\n\n    if (removeLocation) {\n      return newUrl.href.slice(DEFAULT_LOCATION.length);\n    } else if (protocolLess) {\n      return newUrl.href.slice(newUrl.protocol.length);\n    }\n\n    return newUrl.href;\n  }\n\n  return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\nexport default resolveUrl;","/**\n * @file stream.js\n */\n\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = /*#__PURE__*/function () {\n  function Stream() {\n    this.listeners = {};\n  }\n  /**\n   * Add a listener for a specified event type.\n   *\n   * @param {string} type the event name\n   * @param {Function} listener the callback to be invoked when an event of\n   * the specified type occurs\n   */\n\n\n  var _proto = Stream.prototype;\n\n  _proto.on = function on(type, listener) {\n    if (!this.listeners[type]) {\n      this.listeners[type] = [];\n    }\n\n    this.listeners[type].push(listener);\n  }\n  /**\n   * Remove a listener for a specified event type.\n   *\n   * @param {string} type the event name\n   * @param {Function} listener  a function previously registered for this\n   * type of event through `on`\n   * @return {boolean} if we could turn it off or not\n   */\n  ;\n\n  _proto.off = function off(type, listener) {\n    if (!this.listeners[type]) {\n      return false;\n    }\n\n    var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n    // In Video.js we slice listener functions\n    // on trigger so that it does not mess up the order\n    // while we loop through.\n    //\n    // Here we slice on off so that the loop in trigger\n    // can continue using it's old reference to loop without\n    // messing up the order.\n\n    this.listeners[type] = this.listeners[type].slice(0);\n    this.listeners[type].splice(index, 1);\n    return index > -1;\n  }\n  /**\n   * Trigger an event of the specified type on this stream. Any additional\n   * arguments to this function are passed as parameters to event listeners.\n   *\n   * @param {string} type the event name\n   */\n  ;\n\n  _proto.trigger = function trigger(type) {\n    var callbacks = this.listeners[type];\n\n    if (!callbacks) {\n      return;\n    } // Slicing the arguments on every invocation of this method\n    // can add a significant amount of overhead. Avoid the\n    // intermediate object creation for the common case of a\n    // single callback argument\n\n\n    if (arguments.length === 2) {\n      var length = callbacks.length;\n\n      for (var i = 0; i < length; ++i) {\n        callbacks[i].call(this, arguments[1]);\n      }\n    } else {\n      var args = Array.prototype.slice.call(arguments, 1);\n      var _length = callbacks.length;\n\n      for (var _i = 0; _i < _length; ++_i) {\n        callbacks[_i].apply(this, args);\n      }\n    }\n  }\n  /**\n   * Destroys the stream and cleans up.\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.listeners = {};\n  }\n  /**\n   * Forwards all `data` events on this stream to the destination stream. The\n   * destination stream should provide a method `push` to receive the data\n   * events as they arrive.\n   *\n   * @param {Stream} destination the stream that will receive all `data` events\n   * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n   */\n  ;\n\n  _proto.pipe = function pipe(destination) {\n    this.on('data', function (data) {\n      destination.push(data);\n    });\n  };\n\n  return Stream;\n}();\n\nexport { Stream as default };","import window from 'global/window';\n\nvar atob = function atob(s) {\n  return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nexport default function decodeB64ToUint8Array(b64Text) {\n  var decodedString = atob(b64Text);\n  var array = new Uint8Array(decodedString.length);\n\n  for (var i = 0; i < decodedString.length; i++) {\n    array[i] = decodedString.charCodeAt(i);\n  }\n\n  return array;\n}","/*! @name m3u8-parser @version 4.7.1 @license Apache-2.0 */\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport Stream from '@videojs/vhs-utils/es/stream.js';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array.js';\n\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nvar LineStream = /*#__PURE__*/function (_Stream) {\n  _inheritsLoose(LineStream, _Stream);\n\n  function LineStream() {\n    var _this;\n\n    _this = _Stream.call(this) || this;\n    _this.buffer = '';\n    return _this;\n  }\n  /**\n   * Add new data to be parsed.\n   *\n   * @param {string} data the text to process\n   */\n\n\n  var _proto = LineStream.prototype;\n\n  _proto.push = function push(data) {\n    var nextNewline;\n    this.buffer += data;\n    nextNewline = this.buffer.indexOf('\\n');\n\n    for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n      this.trigger('data', this.buffer.substring(0, nextNewline));\n      this.buffer = this.buffer.substring(nextNewline + 1);\n    }\n  };\n\n  return LineStream;\n}(Stream);\n\nvar TAB = String.fromCharCode(0x09);\n\nvar parseByterange = function parseByterange(byterangeString) {\n  // optionally match and capture 0+ digits before `@`\n  // optionally match and capture 0+ digits after `@`\n  var match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || '');\n  var result = {};\n\n  if (match[1]) {\n    result.length = parseInt(match[1], 10);\n  }\n\n  if (match[2]) {\n    result.offset = parseInt(match[2], 10);\n  }\n\n  return result;\n};\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue   -> key '=' value\n * key        -> [^=]*\n * value      -> '\"' [^\"]* '\"' | [^,]*\n */\n\n\nvar attributeSeparator = function attributeSeparator() {\n  var key = '[^=]*';\n  var value = '\"[^\"]*\"|[^,]*';\n  var keyvalue = '(?:' + key + ')=(?:' + value + ')';\n  return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n/**\n * Parse attributes from a line given the separator\n *\n * @param {string} attributes the attribute line to parse\n */\n\n\nvar parseAttributes = function parseAttributes(attributes) {\n  // split the string using attributes as the separator\n  var attrs = attributes.split(attributeSeparator());\n  var result = {};\n  var i = attrs.length;\n  var attr;\n\n  while (i--) {\n    // filter out unmatched portions of the string\n    if (attrs[i] === '') {\n      continue;\n    } // split the key and value\n\n\n    attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1); // trim whitespace and remove optional quotes around the value\n\n    attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n    attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n    attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n    result[attr[0]] = attr[1];\n  }\n\n  return result;\n};\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\n\nvar ParseStream = /*#__PURE__*/function (_Stream) {\n  _inheritsLoose(ParseStream, _Stream);\n\n  function ParseStream() {\n    var _this;\n\n    _this = _Stream.call(this) || this;\n    _this.customParsers = [];\n    _this.tagMappers = [];\n    return _this;\n  }\n  /**\n   * Parses an additional line of input.\n   *\n   * @param {string} line a single line of an M3U8 file to parse\n   */\n\n\n  var _proto = ParseStream.prototype;\n\n  _proto.push = function push(line) {\n    var _this2 = this;\n\n    var match;\n    var event; // strip whitespace\n\n    line = line.trim();\n\n    if (line.length === 0) {\n      // ignore empty lines\n      return;\n    } // URIs\n\n\n    if (line[0] !== '#') {\n      this.trigger('data', {\n        type: 'uri',\n        uri: line\n      });\n      return;\n    } // map tags\n\n\n    var newLines = this.tagMappers.reduce(function (acc, mapper) {\n      var mappedLine = mapper(line); // skip if unchanged\n\n      if (mappedLine === line) {\n        return acc;\n      }\n\n      return acc.concat([mappedLine]);\n    }, [line]);\n    newLines.forEach(function (newLine) {\n      for (var i = 0; i < _this2.customParsers.length; i++) {\n        if (_this2.customParsers[i].call(_this2, newLine)) {\n          return;\n        }\n      } // Comments\n\n\n      if (newLine.indexOf('#EXT') !== 0) {\n        _this2.trigger('data', {\n          type: 'comment',\n          text: newLine.slice(1)\n        });\n\n        return;\n      } // strip off any carriage returns here so the regex matching\n      // doesn't have to account for them.\n\n\n      newLine = newLine.replace('\\r', ''); // Tags\n\n      match = /^#EXTM3U/.exec(newLine);\n\n      if (match) {\n        _this2.trigger('data', {\n          type: 'tag',\n          tagType: 'm3u'\n        });\n\n        return;\n      }\n\n      match = /^#EXTINF:?([0-9\\.]*)?,?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'inf'\n        };\n\n        if (match[1]) {\n          event.duration = parseFloat(match[1]);\n        }\n\n        if (match[2]) {\n          event.title = match[2];\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'targetduration'\n        };\n\n        if (match[1]) {\n          event.duration = parseInt(match[1], 10);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'version'\n        };\n\n        if (match[1]) {\n          event.version = parseInt(match[1], 10);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-MEDIA-SEQUENCE:?(\\-?[0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'media-sequence'\n        };\n\n        if (match[1]) {\n          event.number = parseInt(match[1], 10);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\\-?[0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'discontinuity-sequence'\n        };\n\n        if (match[1]) {\n          event.number = parseInt(match[1], 10);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'playlist-type'\n        };\n\n        if (match[1]) {\n          event.playlistType = match[1];\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = _extends(parseByterange(match[1]), {\n          type: 'tag',\n          tagType: 'byterange'\n        });\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'allow-cache'\n        };\n\n        if (match[1]) {\n          event.allowed = !/NO/.test(match[1]);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-MAP:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'map'\n        };\n\n        if (match[1]) {\n          var attributes = parseAttributes(match[1]);\n\n          if (attributes.URI) {\n            event.uri = attributes.URI;\n          }\n\n          if (attributes.BYTERANGE) {\n            event.byterange = parseByterange(attributes.BYTERANGE);\n          }\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'stream-inf'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n\n          if (event.attributes.RESOLUTION) {\n            var split = event.attributes.RESOLUTION.split('x');\n            var resolution = {};\n\n            if (split[0]) {\n              resolution.width = parseInt(split[0], 10);\n            }\n\n            if (split[1]) {\n              resolution.height = parseInt(split[1], 10);\n            }\n\n            event.attributes.RESOLUTION = resolution;\n          }\n\n          if (event.attributes.BANDWIDTH) {\n            event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n          }\n\n          if (event.attributes['PROGRAM-ID']) {\n            event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n          }\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-MEDIA:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'media'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-ENDLIST/.exec(newLine);\n\n      if (match) {\n        _this2.trigger('data', {\n          type: 'tag',\n          tagType: 'endlist'\n        });\n\n        return;\n      }\n\n      match = /^#EXT-X-DISCONTINUITY/.exec(newLine);\n\n      if (match) {\n        _this2.trigger('data', {\n          type: 'tag',\n          tagType: 'discontinuity'\n        });\n\n        return;\n      }\n\n      match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'program-date-time'\n        };\n\n        if (match[1]) {\n          event.dateTimeString = match[1];\n          event.dateTimeObject = new Date(match[1]);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-KEY:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'key'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]); // parse the IV string into a Uint32Array\n\n          if (event.attributes.IV) {\n            if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n              event.attributes.IV = event.attributes.IV.substring(2);\n            }\n\n            event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n            event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n            event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n            event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n            event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n            event.attributes.IV = new Uint32Array(event.attributes.IV);\n          }\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-START:?(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'start'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n          event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n          event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-out-cont'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-out'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-in'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'skip'\n        };\n        event.attributes = parseAttributes(match[1]);\n\n        if (event.attributes.hasOwnProperty('SKIPPED-SEGMENTS')) {\n          event.attributes['SKIPPED-SEGMENTS'] = parseInt(event.attributes['SKIPPED-SEGMENTS'], 10);\n        }\n\n        if (event.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES')) {\n          event.attributes['RECENTLY-REMOVED-DATERANGES'] = event.attributes['RECENTLY-REMOVED-DATERANGES'].split(TAB);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-PART:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'part'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['DURATION'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        ['INDEPENDENT', 'GAP'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = /YES/.test(event.attributes[key]);\n          }\n        });\n\n        if (event.attributes.hasOwnProperty('BYTERANGE')) {\n          event.attributes.byterange = parseByterange(event.attributes.BYTERANGE);\n        }\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'server-control'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = /YES/.test(event.attributes[key]);\n          }\n        });\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'part-inf'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['PART-TARGET'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'preload-hint'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseInt(event.attributes[key], 10);\n            var subkey = key === 'BYTERANGE-LENGTH' ? 'length' : 'offset';\n            event.attributes.byterange = event.attributes.byterange || {};\n            event.attributes.byterange[subkey] = event.attributes[key]; // only keep the parsed byterange object.\n\n            delete event.attributes[key];\n          }\n        });\n\n        _this2.trigger('data', event);\n\n        return;\n      }\n\n      match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'rendition-report'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['LAST-MSN', 'LAST-PART'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseInt(event.attributes[key], 10);\n          }\n        });\n\n        _this2.trigger('data', event);\n\n        return;\n      } // unknown tag type\n\n\n      _this2.trigger('data', {\n        type: 'tag',\n        data: newLine.slice(4)\n      });\n    });\n  }\n  /**\n   * Add a parser for custom headers\n   *\n   * @param {Object}   options              a map of options for the added parser\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {string}   options.customType   the custom type to register to the output\n   * @param {Function} [options.dataParser] function to parse the line into an object\n   * @param {boolean}  [options.segment]    should tag data be attached to the segment object\n   */\n  ;\n\n  _proto.addParser = function addParser(_ref) {\n    var _this3 = this;\n\n    var expression = _ref.expression,\n        customType = _ref.customType,\n        dataParser = _ref.dataParser,\n        segment = _ref.segment;\n\n    if (typeof dataParser !== 'function') {\n      dataParser = function dataParser(line) {\n        return line;\n      };\n    }\n\n    this.customParsers.push(function (line) {\n      var match = expression.exec(line);\n\n      if (match) {\n        _this3.trigger('data', {\n          type: 'custom',\n          data: dataParser(line),\n          customType: customType,\n          segment: segment\n        });\n\n        return true;\n      }\n    });\n  }\n  /**\n   * Add a custom header mapper\n   *\n   * @param {Object}   options\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {Function} options.map          function to translate tag into a different tag\n   */\n  ;\n\n  _proto.addTagMapper = function addTagMapper(_ref2) {\n    var expression = _ref2.expression,\n        map = _ref2.map;\n\n    var mapFn = function mapFn(line) {\n      if (expression.test(line)) {\n        return map(line);\n      }\n\n      return line;\n    };\n\n    this.tagMappers.push(mapFn);\n  };\n\n  return ParseStream;\n}(Stream);\n\nvar camelCase = function camelCase(str) {\n  return str.toLowerCase().replace(/-(\\w)/g, function (a) {\n    return a[1].toUpperCase();\n  });\n};\n\nvar camelCaseKeys = function camelCaseKeys(attributes) {\n  var result = {};\n  Object.keys(attributes).forEach(function (key) {\n    result[camelCase(key)] = attributes[key];\n  });\n  return result;\n}; // set SERVER-CONTROL hold back based upon targetDuration and partTargetDuration\n// we need this helper because defaults are based upon targetDuration and\n// partTargetDuration being set, but they may not be if SERVER-CONTROL appears before\n// target durations are set.\n\n\nvar setHoldBack = function setHoldBack(manifest) {\n  var serverControl = manifest.serverControl,\n      targetDuration = manifest.targetDuration,\n      partTargetDuration = manifest.partTargetDuration;\n\n  if (!serverControl) {\n    return;\n  }\n\n  var tag = '#EXT-X-SERVER-CONTROL';\n  var hb = 'holdBack';\n  var phb = 'partHoldBack';\n  var minTargetDuration = targetDuration && targetDuration * 3;\n  var minPartDuration = partTargetDuration && partTargetDuration * 2;\n\n  if (targetDuration && !serverControl.hasOwnProperty(hb)) {\n    serverControl[hb] = minTargetDuration;\n    this.trigger('info', {\n      message: tag + \" defaulting HOLD-BACK to targetDuration * 3 (\" + minTargetDuration + \").\"\n    });\n  }\n\n  if (minTargetDuration && serverControl[hb] < minTargetDuration) {\n    this.trigger('warn', {\n      message: tag + \" clamping HOLD-BACK (\" + serverControl[hb] + \") to targetDuration * 3 (\" + minTargetDuration + \")\"\n    });\n    serverControl[hb] = minTargetDuration;\n  } // default no part hold back to part target duration * 3\n\n\n  if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {\n    serverControl[phb] = partTargetDuration * 3;\n    this.trigger('info', {\n      message: tag + \" defaulting PART-HOLD-BACK to partTargetDuration * 3 (\" + serverControl[phb] + \").\"\n    });\n  } // if part hold back is too small default it to part target duration * 2\n\n\n  if (partTargetDuration && serverControl[phb] < minPartDuration) {\n    this.trigger('warn', {\n      message: tag + \" clamping PART-HOLD-BACK (\" + serverControl[phb] + \") to partTargetDuration * 2 (\" + minPartDuration + \").\"\n    });\n    serverControl[phb] = minPartDuration;\n  }\n};\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\n\nvar Parser = /*#__PURE__*/function (_Stream) {\n  _inheritsLoose(Parser, _Stream);\n\n  function Parser() {\n    var _this;\n\n    _this = _Stream.call(this) || this;\n    _this.lineStream = new LineStream();\n    _this.parseStream = new ParseStream();\n\n    _this.lineStream.pipe(_this.parseStream);\n    /* eslint-disable consistent-this */\n\n\n    var self = _assertThisInitialized(_this);\n    /* eslint-enable consistent-this */\n\n\n    var uris = [];\n    var currentUri = {}; // if specified, the active EXT-X-MAP definition\n\n    var currentMap; // if specified, the active decryption key\n\n    var _key;\n\n    var hasParts = false;\n\n    var noop = function noop() {};\n\n    var defaultMediaGroups = {\n      'AUDIO': {},\n      'VIDEO': {},\n      'CLOSED-CAPTIONS': {},\n      'SUBTITLES': {}\n    }; // This is the Widevine UUID from DASH IF IOP. The same exact string is\n    // used in MPDs with Widevine encrypted streams.\n\n    var widevineUuid = 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'; // group segments into numbered timelines delineated by discontinuities\n\n    var currentTimeline = 0; // the manifest is empty until the parse stream begins delivering data\n\n    _this.manifest = {\n      allowCache: true,\n      discontinuityStarts: [],\n      segments: []\n    }; // keep track of the last seen segment's byte range end, as segments are not required\n    // to provide the offset, in which case it defaults to the next byte after the\n    // previous segment\n\n    var lastByterangeEnd = 0; // keep track of the last seen part's byte range end.\n\n    var lastPartByterangeEnd = 0;\n\n    _this.on('end', function () {\n      // only add preloadSegment if we don't yet have a uri for it.\n      // and we actually have parts/preloadHints\n      if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {\n        return;\n      }\n\n      if (!currentUri.map && currentMap) {\n        currentUri.map = currentMap;\n      }\n\n      if (!currentUri.key && _key) {\n        currentUri.key = _key;\n      }\n\n      if (!currentUri.timeline && typeof currentTimeline === 'number') {\n        currentUri.timeline = currentTimeline;\n      }\n\n      _this.manifest.preloadSegment = currentUri;\n    }); // update the manifest with the m3u8 entry from the parse stream\n\n\n    _this.parseStream.on('data', function (entry) {\n      var mediaGroup;\n      var rendition;\n      ({\n        tag: function tag() {\n          // switch based on the tag type\n          (({\n            version: function version() {\n              if (entry.version) {\n                this.manifest.version = entry.version;\n              }\n            },\n            'allow-cache': function allowCache() {\n              this.manifest.allowCache = entry.allowed;\n\n              if (!('allowed' in entry)) {\n                this.trigger('info', {\n                  message: 'defaulting allowCache to YES'\n                });\n                this.manifest.allowCache = true;\n              }\n            },\n            byterange: function byterange() {\n              var byterange = {};\n\n              if ('length' in entry) {\n                currentUri.byterange = byterange;\n                byterange.length = entry.length;\n\n                if (!('offset' in entry)) {\n                  /*\n                   * From the latest spec (as of this writing):\n                   * https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.2\n                   *\n                   * Same text since EXT-X-BYTERANGE's introduction in draft 7:\n                   * https://tools.ietf.org/html/draft-pantos-http-live-streaming-07#section-3.3.1)\n                   *\n                   * \"If o [offset] is not present, the sub-range begins at the next byte\n                   * following the sub-range of the previous media segment.\"\n                   */\n                  entry.offset = lastByterangeEnd;\n                }\n              }\n\n              if ('offset' in entry) {\n                currentUri.byterange = byterange;\n                byterange.offset = entry.offset;\n              }\n\n              lastByterangeEnd = byterange.offset + byterange.length;\n            },\n            endlist: function endlist() {\n              this.manifest.endList = true;\n            },\n            inf: function inf() {\n              if (!('mediaSequence' in this.manifest)) {\n                this.manifest.mediaSequence = 0;\n                this.trigger('info', {\n                  message: 'defaulting media sequence to zero'\n                });\n              }\n\n              if (!('discontinuitySequence' in this.manifest)) {\n                this.manifest.discontinuitySequence = 0;\n                this.trigger('info', {\n                  message: 'defaulting discontinuity sequence to zero'\n                });\n              }\n\n              if (entry.duration > 0) {\n                currentUri.duration = entry.duration;\n              }\n\n              if (entry.duration === 0) {\n                currentUri.duration = 0.01;\n                this.trigger('info', {\n                  message: 'updating zero segment duration to a small value'\n                });\n              }\n\n              this.manifest.segments = uris;\n            },\n            key: function key() {\n              if (!entry.attributes) {\n                this.trigger('warn', {\n                  message: 'ignoring key declaration without attribute list'\n                });\n                return;\n              } // clear the active encryption key\n\n\n              if (entry.attributes.METHOD === 'NONE') {\n                _key = null;\n                return;\n              }\n\n              if (!entry.attributes.URI) {\n                this.trigger('warn', {\n                  message: 'ignoring key declaration without URI'\n                });\n                return;\n              }\n\n              if (entry.attributes.KEYFORMAT === 'com.apple.streamingkeydelivery') {\n                this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n                this.manifest.contentProtection['com.apple.fps.1_0'] = {\n                  attributes: entry.attributes\n                };\n                return;\n              }\n\n              if (entry.attributes.KEYFORMAT === 'com.microsoft.playready') {\n                this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n                this.manifest.contentProtection['com.microsoft.playready'] = {\n                  uri: entry.attributes.URI\n                };\n                return;\n              } // check if the content is encrypted for Widevine\n              // Widevine/HLS spec: https://storage.googleapis.com/wvdocs/Widevine_DRM_HLS.pdf\n\n\n              if (entry.attributes.KEYFORMAT === widevineUuid) {\n                var VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];\n\n                if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {\n                  this.trigger('warn', {\n                    message: 'invalid key method provided for Widevine'\n                  });\n                  return;\n                }\n\n                if (entry.attributes.METHOD === 'SAMPLE-AES-CENC') {\n                  this.trigger('warn', {\n                    message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'\n                  });\n                }\n\n                if (entry.attributes.URI.substring(0, 23) !== 'data:text/plain;base64,') {\n                  this.trigger('warn', {\n                    message: 'invalid key URI provided for Widevine'\n                  });\n                  return;\n                }\n\n                if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === '0x')) {\n                  this.trigger('warn', {\n                    message: 'invalid key ID provided for Widevine'\n                  });\n                  return;\n                } // if Widevine key attributes are valid, store them as `contentProtection`\n                // on the manifest to emulate Widevine tag structure in a DASH mpd\n\n\n                this.manifest.contentProtection = this.manifest.contentProtection || {};\n                this.manifest.contentProtection['com.widevine.alpha'] = {\n                  attributes: {\n                    schemeIdUri: entry.attributes.KEYFORMAT,\n                    // remove '0x' from the key id string\n                    keyId: entry.attributes.KEYID.substring(2)\n                  },\n                  // decode the base64-encoded PSSH box\n                  pssh: decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])\n                };\n                return;\n              }\n\n              if (!entry.attributes.METHOD) {\n                this.trigger('warn', {\n                  message: 'defaulting key method to AES-128'\n                });\n              } // setup an encryption key for upcoming segments\n\n\n              _key = {\n                method: entry.attributes.METHOD || 'AES-128',\n                uri: entry.attributes.URI\n              };\n\n              if (typeof entry.attributes.IV !== 'undefined') {\n                _key.iv = entry.attributes.IV;\n              }\n            },\n            'media-sequence': function mediaSequence() {\n              if (!isFinite(entry.number)) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid media sequence: ' + entry.number\n                });\n                return;\n              }\n\n              this.manifest.mediaSequence = entry.number;\n            },\n            'discontinuity-sequence': function discontinuitySequence() {\n              if (!isFinite(entry.number)) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid discontinuity sequence: ' + entry.number\n                });\n                return;\n              }\n\n              this.manifest.discontinuitySequence = entry.number;\n              currentTimeline = entry.number;\n            },\n            'playlist-type': function playlistType() {\n              if (!/VOD|EVENT/.test(entry.playlistType)) {\n                this.trigger('warn', {\n                  message: 'ignoring unknown playlist type: ' + entry.playlist\n                });\n                return;\n              }\n\n              this.manifest.playlistType = entry.playlistType;\n            },\n            map: function map() {\n              currentMap = {};\n\n              if (entry.uri) {\n                currentMap.uri = entry.uri;\n              }\n\n              if (entry.byterange) {\n                currentMap.byterange = entry.byterange;\n              }\n\n              if (_key) {\n                currentMap.key = _key;\n              }\n            },\n            'stream-inf': function streamInf() {\n              this.manifest.playlists = uris;\n              this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n              if (!entry.attributes) {\n                this.trigger('warn', {\n                  message: 'ignoring empty stream-inf attributes'\n                });\n                return;\n              }\n\n              if (!currentUri.attributes) {\n                currentUri.attributes = {};\n              }\n\n              _extends(currentUri.attributes, entry.attributes);\n            },\n            media: function media() {\n              this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n              if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n                this.trigger('warn', {\n                  message: 'ignoring incomplete or missing media group'\n                });\n                return;\n              } // find the media group, creating defaults as necessary\n\n\n              var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n              mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n              mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']]; // collect the rendition metadata\n\n              rendition = {\n                default: /yes/i.test(entry.attributes.DEFAULT)\n              };\n\n              if (rendition.default) {\n                rendition.autoselect = true;\n              } else {\n                rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n              }\n\n              if (entry.attributes.LANGUAGE) {\n                rendition.language = entry.attributes.LANGUAGE;\n              }\n\n              if (entry.attributes.URI) {\n                rendition.uri = entry.attributes.URI;\n              }\n\n              if (entry.attributes['INSTREAM-ID']) {\n                rendition.instreamId = entry.attributes['INSTREAM-ID'];\n              }\n\n              if (entry.attributes.CHARACTERISTICS) {\n                rendition.characteristics = entry.attributes.CHARACTERISTICS;\n              }\n\n              if (entry.attributes.FORCED) {\n                rendition.forced = /yes/i.test(entry.attributes.FORCED);\n              } // insert the new rendition\n\n\n              mediaGroup[entry.attributes.NAME] = rendition;\n            },\n            discontinuity: function discontinuity() {\n              currentTimeline += 1;\n              currentUri.discontinuity = true;\n              this.manifest.discontinuityStarts.push(uris.length);\n            },\n            'program-date-time': function programDateTime() {\n              if (typeof this.manifest.dateTimeString === 'undefined') {\n                // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n                // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n                // to the manifest object\n                // TODO: Consider removing this in future major version\n                this.manifest.dateTimeString = entry.dateTimeString;\n                this.manifest.dateTimeObject = entry.dateTimeObject;\n              }\n\n              currentUri.dateTimeString = entry.dateTimeString;\n              currentUri.dateTimeObject = entry.dateTimeObject;\n            },\n            targetduration: function targetduration() {\n              if (!isFinite(entry.duration) || entry.duration < 0) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid target duration: ' + entry.duration\n                });\n                return;\n              }\n\n              this.manifest.targetDuration = entry.duration;\n              setHoldBack.call(this, this.manifest);\n            },\n            start: function start() {\n              if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n                this.trigger('warn', {\n                  message: 'ignoring start declaration without appropriate attribute list'\n                });\n                return;\n              }\n\n              this.manifest.start = {\n                timeOffset: entry.attributes['TIME-OFFSET'],\n                precise: entry.attributes.PRECISE\n              };\n            },\n            'cue-out': function cueOut() {\n              currentUri.cueOut = entry.data;\n            },\n            'cue-out-cont': function cueOutCont() {\n              currentUri.cueOutCont = entry.data;\n            },\n            'cue-in': function cueIn() {\n              currentUri.cueIn = entry.data;\n            },\n            'skip': function skip() {\n              this.manifest.skip = camelCaseKeys(entry.attributes);\n              this.warnOnMissingAttributes_('#EXT-X-SKIP', entry.attributes, ['SKIPPED-SEGMENTS']);\n            },\n            'part': function part() {\n              var _this2 = this;\n\n              hasParts = true; // parts are always specifed before a segment\n\n              var segmentIndex = this.manifest.segments.length;\n              var part = camelCaseKeys(entry.attributes);\n              currentUri.parts = currentUri.parts || [];\n              currentUri.parts.push(part);\n\n              if (part.byterange) {\n                if (!part.byterange.hasOwnProperty('offset')) {\n                  part.byterange.offset = lastPartByterangeEnd;\n                }\n\n                lastPartByterangeEnd = part.byterange.offset + part.byterange.length;\n              }\n\n              var partIndex = currentUri.parts.length - 1;\n              this.warnOnMissingAttributes_(\"#EXT-X-PART #\" + partIndex + \" for segment #\" + segmentIndex, entry.attributes, ['URI', 'DURATION']);\n\n              if (this.manifest.renditionReports) {\n                this.manifest.renditionReports.forEach(function (r, i) {\n                  if (!r.hasOwnProperty('lastPart')) {\n                    _this2.trigger('warn', {\n                      message: \"#EXT-X-RENDITION-REPORT #\" + i + \" lacks required attribute(s): LAST-PART\"\n                    });\n                  }\n                });\n              }\n            },\n            'server-control': function serverControl() {\n              var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);\n\n              if (!attrs.hasOwnProperty('canBlockReload')) {\n                attrs.canBlockReload = false;\n                this.trigger('info', {\n                  message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false'\n                });\n              }\n\n              setHoldBack.call(this, this.manifest);\n\n              if (attrs.canSkipDateranges && !attrs.hasOwnProperty('canSkipUntil')) {\n                this.trigger('warn', {\n                  message: '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set'\n                });\n              }\n            },\n            'preload-hint': function preloadHint() {\n              // parts are always specifed before a segment\n              var segmentIndex = this.manifest.segments.length;\n              var hint = camelCaseKeys(entry.attributes);\n              var isPart = hint.type && hint.type === 'PART';\n              currentUri.preloadHints = currentUri.preloadHints || [];\n              currentUri.preloadHints.push(hint);\n\n              if (hint.byterange) {\n                if (!hint.byterange.hasOwnProperty('offset')) {\n                  // use last part byterange end or zero if not a part.\n                  hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;\n\n                  if (isPart) {\n                    lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;\n                  }\n                }\n              }\n\n              var index = currentUri.preloadHints.length - 1;\n              this.warnOnMissingAttributes_(\"#EXT-X-PRELOAD-HINT #\" + index + \" for segment #\" + segmentIndex, entry.attributes, ['TYPE', 'URI']);\n\n              if (!hint.type) {\n                return;\n              } // search through all preload hints except for the current one for\n              // a duplicate type.\n\n\n              for (var i = 0; i < currentUri.preloadHints.length - 1; i++) {\n                var otherHint = currentUri.preloadHints[i];\n\n                if (!otherHint.type) {\n                  continue;\n                }\n\n                if (otherHint.type === hint.type) {\n                  this.trigger('warn', {\n                    message: \"#EXT-X-PRELOAD-HINT #\" + index + \" for segment #\" + segmentIndex + \" has the same TYPE \" + hint.type + \" as preload hint #\" + i\n                  });\n                }\n              }\n            },\n            'rendition-report': function renditionReport() {\n              var report = camelCaseKeys(entry.attributes);\n              this.manifest.renditionReports = this.manifest.renditionReports || [];\n              this.manifest.renditionReports.push(report);\n              var index = this.manifest.renditionReports.length - 1;\n              var required = ['LAST-MSN', 'URI'];\n\n              if (hasParts) {\n                required.push('LAST-PART');\n              }\n\n              this.warnOnMissingAttributes_(\"#EXT-X-RENDITION-REPORT #\" + index, entry.attributes, required);\n            },\n            'part-inf': function partInf() {\n              this.manifest.partInf = camelCaseKeys(entry.attributes);\n              this.warnOnMissingAttributes_('#EXT-X-PART-INF', entry.attributes, ['PART-TARGET']);\n\n              if (this.manifest.partInf.partTarget) {\n                this.manifest.partTargetDuration = this.manifest.partInf.partTarget;\n              }\n\n              setHoldBack.call(this, this.manifest);\n            }\n          })[entry.tagType] || noop).call(self);\n        },\n        uri: function uri() {\n          currentUri.uri = entry.uri;\n          uris.push(currentUri); // if no explicit duration was declared, use the target duration\n\n          if (this.manifest.targetDuration && !('duration' in currentUri)) {\n            this.trigger('warn', {\n              message: 'defaulting segment duration to the target duration'\n            });\n            currentUri.duration = this.manifest.targetDuration;\n          } // annotate with encryption information, if necessary\n\n\n          if (_key) {\n            currentUri.key = _key;\n          }\n\n          currentUri.timeline = currentTimeline; // annotate with initialization segment information, if necessary\n\n          if (currentMap) {\n            currentUri.map = currentMap;\n          } // reset the last byterange end as it needs to be 0 between parts\n\n\n          lastPartByterangeEnd = 0; // prepare for the next URI\n\n          currentUri = {};\n        },\n        comment: function comment() {// comments are not important for playback\n        },\n        custom: function custom() {\n          // if this is segment-level data attach the output to the segment\n          if (entry.segment) {\n            currentUri.custom = currentUri.custom || {};\n            currentUri.custom[entry.customType] = entry.data; // if this is manifest-level data attach to the top level manifest object\n          } else {\n            this.manifest.custom = this.manifest.custom || {};\n            this.manifest.custom[entry.customType] = entry.data;\n          }\n        }\n      })[entry.type].call(self);\n    });\n\n    return _this;\n  }\n\n  var _proto = Parser.prototype;\n\n  _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) {\n    var missing = [];\n    required.forEach(function (key) {\n      if (!attributes.hasOwnProperty(key)) {\n        missing.push(key);\n      }\n    });\n\n    if (missing.length) {\n      this.trigger('warn', {\n        message: identifier + \" lacks required attribute(s): \" + missing.join(', ')\n      });\n    }\n  }\n  /**\n   * Parse the input string and update the manifest object.\n   *\n   * @param {string} chunk a potentially incomplete portion of the manifest\n   */\n  ;\n\n  _proto.push = function push(chunk) {\n    this.lineStream.push(chunk);\n  }\n  /**\n   * Flush any remaining input. This can be handy if the last line of an M3U8\n   * manifest did not contain a trailing newline but the file has been\n   * completely received.\n   */\n  ;\n\n  _proto.end = function end() {\n    // flush any buffered input\n    this.lineStream.push('\\n');\n    this.trigger('end');\n  }\n  /**\n   * Add an additional parser for non-standard tags\n   *\n   * @param {Object}   options              a map of options for the added parser\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {string}   options.type         the type to register to the output\n   * @param {Function} [options.dataParser] function to parse the line into an object\n   * @param {boolean}  [options.segment]    should tag data be attached to the segment object\n   */\n  ;\n\n  _proto.addParser = function addParser(options) {\n    this.parseStream.addParser(options);\n  }\n  /**\n   * Add a custom header mapper\n   *\n   * @param {Object}   options\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {Function} options.map          function to translate tag into a different tag\n   */\n  ;\n\n  _proto.addTagMapper = function addTagMapper(options) {\n    this.parseStream.addTagMapper(options);\n  };\n\n  return Parser;\n}(Stream);\n\nexport { LineStream, ParseStream, Parser };\n","import window from 'global/window'; // const log2 = Math.log2 ? Math.log2 : (x) => (Math.log(x) / Math.log(2));\n\nvar repeat = function repeat(str, len) {\n  var acc = '';\n\n  while (len--) {\n    acc += str;\n  }\n\n  return acc;\n}; // count the number of bits it would take to represent a number\n// we used to do this with log2 but BigInt does not support builtin math\n// Math.ceil(log2(x));\n\n\nexport var countBits = function countBits(x) {\n  return x.toString(2).length;\n}; // count the number of whole bytes it would take to represent a number\n\nexport var countBytes = function countBytes(x) {\n  return Math.ceil(countBits(x) / 8);\n};\nexport var padStart = function padStart(b, len, str) {\n  if (str === void 0) {\n    str = ' ';\n  }\n\n  return (repeat(str, len) + b.toString()).slice(-len);\n};\nexport var isArrayBufferView = function isArrayBufferView(obj) {\n  if (ArrayBuffer.isView === 'function') {\n    return ArrayBuffer.isView(obj);\n  }\n\n  return obj && obj.buffer instanceof ArrayBuffer;\n};\nexport var isTypedArray = function isTypedArray(obj) {\n  return isArrayBufferView(obj);\n};\nexport var toUint8 = function toUint8(bytes) {\n  if (bytes instanceof Uint8Array) {\n    return bytes;\n  }\n\n  if (!Array.isArray(bytes) && !isTypedArray(bytes) && !(bytes instanceof ArrayBuffer)) {\n    // any non-number or NaN leads to empty uint8array\n    // eslint-disable-next-line\n    if (typeof bytes !== 'number' || typeof bytes === 'number' && bytes !== bytes) {\n      bytes = 0;\n    } else {\n      bytes = [bytes];\n    }\n  }\n\n  return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);\n};\nexport var toHexString = function toHexString(bytes) {\n  bytes = toUint8(bytes);\n  var str = '';\n\n  for (var i = 0; i < bytes.length; i++) {\n    str += padStart(bytes[i].toString(16), 2, '0');\n  }\n\n  return str;\n};\nexport var toBinaryString = function toBinaryString(bytes) {\n  bytes = toUint8(bytes);\n  var str = '';\n\n  for (var i = 0; i < bytes.length; i++) {\n    str += padStart(bytes[i].toString(2), 8, '0');\n  }\n\n  return str;\n};\nvar BigInt = window.BigInt || Number;\nvar BYTE_TABLE = [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\nexport var ENDIANNESS = function () {\n  var a = new Uint16Array([0xFFCC]);\n  var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n\n  if (b[0] === 0xFF) {\n    return 'big';\n  }\n\n  if (b[0] === 0xCC) {\n    return 'little';\n  }\n\n  return 'unknown';\n}();\nexport var IS_BIG_ENDIAN = ENDIANNESS === 'big';\nexport var IS_LITTLE_ENDIAN = ENDIANNESS === 'little';\nexport var bytesToNumber = function bytesToNumber(bytes, _temp) {\n  var _ref = _temp === void 0 ? {} : _temp,\n      _ref$signed = _ref.signed,\n      signed = _ref$signed === void 0 ? false : _ref$signed,\n      _ref$le = _ref.le,\n      le = _ref$le === void 0 ? false : _ref$le;\n\n  bytes = toUint8(bytes);\n  var fn = le ? 'reduce' : 'reduceRight';\n  var obj = bytes[fn] ? bytes[fn] : Array.prototype[fn];\n  var number = obj.call(bytes, function (total, byte, i) {\n    var exponent = le ? i : Math.abs(i + 1 - bytes.length);\n    return total + BigInt(byte) * BYTE_TABLE[exponent];\n  }, BigInt(0));\n\n  if (signed) {\n    var max = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);\n    number = BigInt(number);\n\n    if (number > max) {\n      number -= max;\n      number -= max;\n      number -= BigInt(2);\n    }\n  }\n\n  return Number(number);\n};\nexport var numberToBytes = function numberToBytes(number, _temp2) {\n  var _ref2 = _temp2 === void 0 ? {} : _temp2,\n      _ref2$le = _ref2.le,\n      le = _ref2$le === void 0 ? false : _ref2$le;\n\n  // eslint-disable-next-line\n  if (typeof number !== 'bigint' && typeof number !== 'number' || typeof number === 'number' && number !== number) {\n    number = 0;\n  }\n\n  number = BigInt(number);\n  var byteCount = countBytes(number);\n  var bytes = new Uint8Array(new ArrayBuffer(byteCount));\n\n  for (var i = 0; i < byteCount; i++) {\n    var byteIndex = le ? i : Math.abs(i + 1 - bytes.length);\n    bytes[byteIndex] = Number(number / BYTE_TABLE[i] & BigInt(0xFF));\n\n    if (number < 0) {\n      bytes[byteIndex] = Math.abs(~bytes[byteIndex]);\n      bytes[byteIndex] -= i === 0 ? 1 : 2;\n    }\n  }\n\n  return bytes;\n};\nexport var bytesToString = function bytesToString(bytes) {\n  if (!bytes) {\n    return '';\n  } // TODO: should toUint8 handle cases where we only have 8 bytes\n  // but report more since this is a Uint16+ Array?\n\n\n  bytes = Array.prototype.slice.call(bytes);\n  var string = String.fromCharCode.apply(null, toUint8(bytes));\n\n  try {\n    return decodeURIComponent(escape(string));\n  } catch (e) {// if decodeURIComponent/escape fails, we are dealing with partial\n    // or full non string data. Just return the potentially garbled string.\n  }\n\n  return string;\n};\nexport var stringToBytes = function stringToBytes(string, stringIsBytes) {\n  if (typeof string !== 'string' && string && typeof string.toString === 'function') {\n    string = string.toString();\n  }\n\n  if (typeof string !== 'string') {\n    return new Uint8Array();\n  } // If the string already is bytes, we don't have to do this\n  // otherwise we do this so that we split multi length characters\n  // into individual bytes\n\n\n  if (!stringIsBytes) {\n    string = unescape(encodeURIComponent(string));\n  }\n\n  var view = new Uint8Array(string.length);\n\n  for (var i = 0; i < string.length; i++) {\n    view[i] = string.charCodeAt(i);\n  }\n\n  return view;\n};\nexport var concatTypedArrays = function concatTypedArrays() {\n  for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {\n    buffers[_key] = arguments[_key];\n  }\n\n  buffers = buffers.filter(function (b) {\n    return b && (b.byteLength || b.length) && typeof b !== 'string';\n  });\n\n  if (buffers.length <= 1) {\n    // for 0 length we will return empty uint8\n    // for 1 length we return the first uint8\n    return toUint8(buffers[0]);\n  }\n\n  var totalLen = buffers.reduce(function (total, buf, i) {\n    return total + (buf.byteLength || buf.length);\n  }, 0);\n  var tempBuffer = new Uint8Array(totalLen);\n  var offset = 0;\n  buffers.forEach(function (buf) {\n    buf = toUint8(buf);\n    tempBuffer.set(buf, offset);\n    offset += buf.byteLength;\n  });\n  return tempBuffer;\n};\n/**\n * Check if the bytes \"b\" are contained within bytes \"a\".\n *\n * @param {Uint8Array|Array} a\n *        Bytes to check in\n *\n * @param {Uint8Array|Array} b\n *        Bytes to check for\n *\n * @param {Object} options\n *        options\n *\n * @param {Array|Uint8Array} [offset=0]\n *        offset to use when looking at bytes in a\n *\n * @param {Array|Uint8Array} [mask=[]]\n *        mask to use on bytes before comparison.\n *\n * @return {boolean}\n *         If all bytes in b are inside of a, taking into account\n *         bit masks.\n */\n\nexport var bytesMatch = function bytesMatch(a, b, _temp3) {\n  var _ref3 = _temp3 === void 0 ? {} : _temp3,\n      _ref3$offset = _ref3.offset,\n      offset = _ref3$offset === void 0 ? 0 : _ref3$offset,\n      _ref3$mask = _ref3.mask,\n      mask = _ref3$mask === void 0 ? [] : _ref3$mask;\n\n  a = toUint8(a);\n  b = toUint8(b); // ie 11 does not support uint8 every\n\n  var fn = b.every ? b.every : Array.prototype.every;\n  return b.length && a.length - offset >= b.length && // ie 11 doesn't support every on uin8\n  fn.call(b, function (bByte, i) {\n    var aByte = mask[i] ? mask[i] & a[offset + i] : a[offset + i];\n    return bByte === aByte;\n  });\n};\nexport var sliceBytes = function sliceBytes(src, start, end) {\n  if (Uint8Array.prototype.slice) {\n    return Uint8Array.prototype.slice.call(src, start, end);\n  }\n\n  return new Uint8Array(Array.prototype.slice.call(src, start, end));\n};\nexport var reverseBytes = function reverseBytes(src) {\n  if (src.reverse) {\n    return src.reverse();\n  }\n\n  return Array.prototype.reverse.call(src);\n};","import { stringToBytes, toUint8, bytesMatch, bytesToString, toHexString, padStart, bytesToNumber } from './byte-helpers.js';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js';\nimport { parseOpusHead } from './opus-helpers.js';\n\nvar normalizePath = function normalizePath(path) {\n  if (typeof path === 'string') {\n    return stringToBytes(path);\n  }\n\n  if (typeof path === 'number') {\n    return path;\n  }\n\n  return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n  if (!Array.isArray(paths)) {\n    return [normalizePath(paths)];\n  }\n\n  return paths.map(function (p) {\n    return normalizePath(p);\n  });\n};\n\nvar DESCRIPTORS;\nexport var parseDescriptors = function parseDescriptors(bytes) {\n  bytes = toUint8(bytes);\n  var results = [];\n  var i = 0;\n\n  while (bytes.length > i) {\n    var tag = bytes[i];\n    var size = 0;\n    var headerSize = 0; // tag\n\n    headerSize++;\n    var byte = bytes[headerSize]; // first byte\n\n    headerSize++;\n\n    while (byte & 0x80) {\n      size = (byte & 0x7F) << 7;\n      byte = bytes[headerSize];\n      headerSize++;\n    }\n\n    size += byte & 0x7F;\n\n    for (var z = 0; z < DESCRIPTORS.length; z++) {\n      var _DESCRIPTORS$z = DESCRIPTORS[z],\n          id = _DESCRIPTORS$z.id,\n          parser = _DESCRIPTORS$z.parser;\n\n      if (tag === id) {\n        results.push(parser(bytes.subarray(headerSize, headerSize + size)));\n        break;\n      }\n    }\n\n    i += size + headerSize;\n  }\n\n  return results;\n};\nDESCRIPTORS = [{\n  id: 0x03,\n  parser: function parser(bytes) {\n    var desc = {\n      tag: 0x03,\n      id: bytes[0] << 8 | bytes[1],\n      flags: bytes[2],\n      size: 3,\n      dependsOnEsId: 0,\n      ocrEsId: 0,\n      descriptors: [],\n      url: ''\n    }; // depends on es id\n\n    if (desc.flags & 0x80) {\n      desc.dependsOnEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n      desc.size += 2;\n    } // url\n\n\n    if (desc.flags & 0x40) {\n      var len = bytes[desc.size];\n      desc.url = bytesToString(bytes.subarray(desc.size + 1, desc.size + 1 + len));\n      desc.size += len;\n    } // ocr es id\n\n\n    if (desc.flags & 0x20) {\n      desc.ocrEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n      desc.size += 2;\n    }\n\n    desc.descriptors = parseDescriptors(bytes.subarray(desc.size)) || [];\n    return desc;\n  }\n}, {\n  id: 0x04,\n  parser: function parser(bytes) {\n    // DecoderConfigDescriptor\n    var desc = {\n      tag: 0x04,\n      oti: bytes[0],\n      streamType: bytes[1],\n      bufferSize: bytes[2] << 16 | bytes[3] << 8 | bytes[4],\n      maxBitrate: bytes[5] << 24 | bytes[6] << 16 | bytes[7] << 8 | bytes[8],\n      avgBitrate: bytes[9] << 24 | bytes[10] << 16 | bytes[11] << 8 | bytes[12],\n      descriptors: parseDescriptors(bytes.subarray(13))\n    };\n    return desc;\n  }\n}, {\n  id: 0x05,\n  parser: function parser(bytes) {\n    // DecoderSpecificInfo\n    return {\n      tag: 0x05,\n      bytes: bytes\n    };\n  }\n}, {\n  id: 0x06,\n  parser: function parser(bytes) {\n    // SLConfigDescriptor\n    return {\n      tag: 0x06,\n      bytes: bytes\n    };\n  }\n}];\n/**\n * find any number of boxes by name given a path to it in an iso bmff\n * such as mp4.\n *\n * @param {TypedArray} bytes\n *        bytes for the iso bmff to search for boxes in\n *\n * @param {Uint8Array[]|string[]|string|Uint8Array} name\n *        An array of paths or a single path representing the name\n *        of boxes to search through in bytes. Paths may be\n *        uint8 (character codes) or strings.\n *\n * @param {boolean} [complete=false]\n *        Should we search only for complete boxes on the final path.\n *        This is very useful when you do not want to get back partial boxes\n *        in the case of streaming files.\n *\n * @return {Uint8Array[]}\n *         An array of the end paths that we found.\n */\n\nexport var findBox = function findBox(bytes, paths, complete) {\n  if (complete === void 0) {\n    complete = false;\n  }\n\n  paths = normalizePaths(paths);\n  bytes = toUint8(bytes);\n  var results = [];\n\n  if (!paths.length) {\n    // short-circuit the search for empty paths\n    return results;\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    var size = (bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]) >>> 0;\n    var type = bytes.subarray(i + 4, i + 8); // invalid box format.\n\n    if (size === 0) {\n      break;\n    }\n\n    var end = i + size;\n\n    if (end > bytes.length) {\n      // this box is bigger than the number of bytes we have\n      // and complete is set, we cannot find any more boxes.\n      if (complete) {\n        break;\n      }\n\n      end = bytes.length;\n    }\n\n    var data = bytes.subarray(i + 8, end);\n\n    if (bytesMatch(type, paths[0])) {\n      if (paths.length === 1) {\n        // this is the end of the path and we've found the box we were\n        // looking for\n        results.push(data);\n      } else {\n        // recursively search for the next box along the path\n        results.push.apply(results, findBox(data, paths.slice(1), complete));\n      }\n    }\n\n    i = end;\n  } // we've finished searching all of bytes\n\n\n  return results;\n};\n/**\n * Search for a single matching box by name in an iso bmff format like\n * mp4. This function is useful for finding codec boxes which\n * can be placed arbitrarily in sample descriptions depending\n * on the version of the file or file type.\n *\n * @param {TypedArray} bytes\n *        bytes for the iso bmff to search for boxes in\n *\n * @param {string|Uint8Array} name\n *        The name of the box to find.\n *\n * @return {Uint8Array[]}\n *         a subarray of bytes representing the name boxed we found.\n */\n\nexport var findNamedBox = function findNamedBox(bytes, name) {\n  name = normalizePath(name);\n\n  if (!name.length) {\n    // short-circuit the search for empty paths\n    return bytes.subarray(bytes.length);\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    if (bytesMatch(bytes.subarray(i, i + name.length), name)) {\n      var size = (bytes[i - 4] << 24 | bytes[i - 3] << 16 | bytes[i - 2] << 8 | bytes[i - 1]) >>> 0;\n      var end = size > 1 ? i + size : bytes.byteLength;\n      return bytes.subarray(i + 4, end);\n    }\n\n    i++;\n  } // we've finished searching all of bytes\n\n\n  return bytes.subarray(bytes.length);\n};\n\nvar parseSamples = function parseSamples(data, entrySize, parseEntry) {\n  if (entrySize === void 0) {\n    entrySize = 4;\n  }\n\n  if (parseEntry === void 0) {\n    parseEntry = function parseEntry(d) {\n      return bytesToNumber(d);\n    };\n  }\n\n  var entries = [];\n\n  if (!data || !data.length) {\n    return entries;\n  }\n\n  var entryCount = bytesToNumber(data.subarray(4, 8));\n\n  for (var i = 8; entryCount; i += entrySize, entryCount--) {\n    entries.push(parseEntry(data.subarray(i, i + entrySize)));\n  }\n\n  return entries;\n};\n\nexport var buildFrameTable = function buildFrameTable(stbl, timescale) {\n  var keySamples = parseSamples(findBox(stbl, ['stss'])[0]);\n  var chunkOffsets = parseSamples(findBox(stbl, ['stco'])[0]);\n  var timeToSamples = parseSamples(findBox(stbl, ['stts'])[0], 8, function (entry) {\n    return {\n      sampleCount: bytesToNumber(entry.subarray(0, 4)),\n      sampleDelta: bytesToNumber(entry.subarray(4, 8))\n    };\n  });\n  var samplesToChunks = parseSamples(findBox(stbl, ['stsc'])[0], 12, function (entry) {\n    return {\n      firstChunk: bytesToNumber(entry.subarray(0, 4)),\n      samplesPerChunk: bytesToNumber(entry.subarray(4, 8)),\n      sampleDescriptionIndex: bytesToNumber(entry.subarray(8, 12))\n    };\n  });\n  var stsz = findBox(stbl, ['stsz'])[0]; // stsz starts with a 4 byte sampleSize which we don't need\n\n  var sampleSizes = parseSamples(stsz && stsz.length && stsz.subarray(4) || null);\n  var frames = [];\n\n  for (var chunkIndex = 0; chunkIndex < chunkOffsets.length; chunkIndex++) {\n    var samplesInChunk = void 0;\n\n    for (var i = 0; i < samplesToChunks.length; i++) {\n      var sampleToChunk = samplesToChunks[i];\n      var isThisOne = chunkIndex + 1 >= sampleToChunk.firstChunk && (i + 1 >= samplesToChunks.length || chunkIndex + 1 < samplesToChunks[i + 1].firstChunk);\n\n      if (isThisOne) {\n        samplesInChunk = sampleToChunk.samplesPerChunk;\n        break;\n      }\n    }\n\n    var chunkOffset = chunkOffsets[chunkIndex];\n\n    for (var _i = 0; _i < samplesInChunk; _i++) {\n      var frameEnd = sampleSizes[frames.length]; // if we don't have key samples every frame is a keyframe\n\n      var keyframe = !keySamples.length;\n\n      if (keySamples.length && keySamples.indexOf(frames.length + 1) !== -1) {\n        keyframe = true;\n      }\n\n      var frame = {\n        keyframe: keyframe,\n        start: chunkOffset,\n        end: chunkOffset + frameEnd\n      };\n\n      for (var k = 0; k < timeToSamples.length; k++) {\n        var _timeToSamples$k = timeToSamples[k],\n            sampleCount = _timeToSamples$k.sampleCount,\n            sampleDelta = _timeToSamples$k.sampleDelta;\n\n        if (frames.length <= sampleCount) {\n          // ms to ns\n          var lastTimestamp = frames.length ? frames[frames.length - 1].timestamp : 0;\n          frame.timestamp = lastTimestamp + sampleDelta / timescale * 1000;\n          frame.duration = sampleDelta;\n          break;\n        }\n      }\n\n      frames.push(frame);\n      chunkOffset += frameEnd;\n    }\n  }\n\n  return frames;\n};\nexport var addSampleDescription = function addSampleDescription(track, bytes) {\n  var codec = bytesToString(bytes.subarray(0, 4));\n\n  if (track.type === 'video') {\n    track.info = track.info || {};\n    track.info.width = bytes[28] << 8 | bytes[29];\n    track.info.height = bytes[30] << 8 | bytes[31];\n  } else if (track.type === 'audio') {\n    track.info = track.info || {};\n    track.info.channels = bytes[20] << 8 | bytes[21];\n    track.info.bitDepth = bytes[22] << 8 | bytes[23];\n    track.info.sampleRate = bytes[28] << 8 | bytes[29];\n  }\n\n  if (codec === 'avc1') {\n    var avcC = findNamedBox(bytes, 'avcC'); // AVCDecoderConfigurationRecord\n\n    codec += \".\" + getAvcCodec(avcC);\n    track.info.avcC = avcC; // TODO: do we need to parse all this?\n\n    /* {\n      configurationVersion: avcC[0],\n      profile: avcC[1],\n      profileCompatibility: avcC[2],\n      level: avcC[3],\n      lengthSizeMinusOne: avcC[4] & 0x3\n    };\n     let spsNalUnitCount = avcC[5] & 0x1F;\n    const spsNalUnits = track.info.avc.spsNalUnits = [];\n     // past spsNalUnitCount\n    let offset = 6;\n     while (spsNalUnitCount--) {\n      const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n       spsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n       offset += nalLen + 2;\n    }\n    let ppsNalUnitCount = avcC[offset];\n    const ppsNalUnits = track.info.avc.ppsNalUnits = [];\n     // past ppsNalUnitCount\n    offset += 1;\n     while (ppsNalUnitCount--) {\n      const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n       ppsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n       offset += nalLen + 2;\n    }*/\n    // HEVCDecoderConfigurationRecord\n  } else if (codec === 'hvc1' || codec === 'hev1') {\n    codec += \".\" + getHvcCodec(findNamedBox(bytes, 'hvcC'));\n  } else if (codec === 'mp4a' || codec === 'mp4v') {\n    var esds = findNamedBox(bytes, 'esds');\n    var esDescriptor = parseDescriptors(esds.subarray(4))[0];\n    var decoderConfig = esDescriptor && esDescriptor.descriptors.filter(function (_ref) {\n      var tag = _ref.tag;\n      return tag === 0x04;\n    })[0];\n\n    if (decoderConfig) {\n      // most codecs do not have a further '.'\n      // such as 0xa5 for ac-3 and 0xa6 for e-ac-3\n      codec += '.' + toHexString(decoderConfig.oti);\n\n      if (decoderConfig.oti === 0x40) {\n        codec += '.' + (decoderConfig.descriptors[0].bytes[0] >> 3).toString();\n      } else if (decoderConfig.oti === 0x20) {\n        codec += '.' + decoderConfig.descriptors[0].bytes[4].toString();\n      } else if (decoderConfig.oti === 0xdd) {\n        codec = 'vorbis';\n      }\n    } else if (track.type === 'audio') {\n      codec += '.40.2';\n    } else {\n      codec += '.20.9';\n    }\n  } else if (codec === 'av01') {\n    // AV1DecoderConfigurationRecord\n    codec += \".\" + getAv1Codec(findNamedBox(bytes, 'av1C'));\n  } else if (codec === 'vp09') {\n    // VPCodecConfigurationRecord\n    var vpcC = findNamedBox(bytes, 'vpcC'); // https://www.webmproject.org/vp9/mp4/\n\n    var profile = vpcC[0];\n    var level = vpcC[1];\n    var bitDepth = vpcC[2] >> 4;\n    var chromaSubsampling = (vpcC[2] & 0x0F) >> 1;\n    var videoFullRangeFlag = (vpcC[2] & 0x0F) >> 3;\n    var colourPrimaries = vpcC[3];\n    var transferCharacteristics = vpcC[4];\n    var matrixCoefficients = vpcC[5];\n    codec += \".\" + padStart(profile, 2, '0');\n    codec += \".\" + padStart(level, 2, '0');\n    codec += \".\" + padStart(bitDepth, 2, '0');\n    codec += \".\" + padStart(chromaSubsampling, 2, '0');\n    codec += \".\" + padStart(colourPrimaries, 2, '0');\n    codec += \".\" + padStart(transferCharacteristics, 2, '0');\n    codec += \".\" + padStart(matrixCoefficients, 2, '0');\n    codec += \".\" + padStart(videoFullRangeFlag, 2, '0');\n  } else if (codec === 'theo') {\n    codec = 'theora';\n  } else if (codec === 'spex') {\n    codec = 'speex';\n  } else if (codec === '.mp3') {\n    codec = 'mp4a.40.34';\n  } else if (codec === 'msVo') {\n    codec = 'vorbis';\n  } else if (codec === 'Opus') {\n    codec = 'opus';\n    var dOps = findNamedBox(bytes, 'dOps');\n    track.info.opus = parseOpusHead(dOps); // TODO: should this go into the webm code??\n    // Firefox requires a codecDelay for opus playback\n    // see https://bugzilla.mozilla.org/show_bug.cgi?id=1276238\n\n    track.info.codecDelay = 6500000;\n  } else {\n    codec = codec.toLowerCase();\n  }\n  /* eslint-enable */\n  // flac, ac-3, ec-3, opus\n\n\n  track.codec = codec;\n};\nexport var parseTracks = function parseTracks(bytes, frameTable) {\n  if (frameTable === void 0) {\n    frameTable = true;\n  }\n\n  bytes = toUint8(bytes);\n  var traks = findBox(bytes, ['moov', 'trak'], true);\n  var tracks = [];\n  traks.forEach(function (trak) {\n    var track = {\n      bytes: trak\n    };\n    var mdia = findBox(trak, ['mdia'])[0];\n    var hdlr = findBox(mdia, ['hdlr'])[0];\n    var trakType = bytesToString(hdlr.subarray(8, 12));\n\n    if (trakType === 'soun') {\n      track.type = 'audio';\n    } else if (trakType === 'vide') {\n      track.type = 'video';\n    } else {\n      track.type = trakType;\n    }\n\n    var tkhd = findBox(trak, ['tkhd'])[0];\n\n    if (tkhd) {\n      var view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n      var tkhdVersion = view.getUint8(0);\n      track.number = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n    }\n\n    var mdhd = findBox(mdia, ['mdhd'])[0];\n\n    if (mdhd) {\n      // mdhd is a FullBox, meaning it will have its own version as the first byte\n      var version = mdhd[0];\n      var index = version === 0 ? 12 : 20;\n      track.timescale = (mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]) >>> 0;\n    }\n\n    var stbl = findBox(mdia, ['minf', 'stbl'])[0];\n    var stsd = findBox(stbl, ['stsd'])[0];\n    var descriptionCount = bytesToNumber(stsd.subarray(4, 8));\n    var offset = 8; // add codec and codec info\n\n    while (descriptionCount--) {\n      var len = bytesToNumber(stsd.subarray(offset, offset + 4));\n      var sampleDescriptor = stsd.subarray(offset + 4, offset + 4 + len);\n      addSampleDescription(track, sampleDescriptor);\n      offset += 4 + len;\n    }\n\n    if (frameTable) {\n      track.frameTable = buildFrameTable(stbl, track.timescale);\n    } // codec has no sub parameters\n\n\n    tracks.push(track);\n  });\n  return tracks;\n};\nexport var parseMediaInfo = function parseMediaInfo(bytes) {\n  var mvhd = findBox(bytes, ['moov', 'mvhd'], true)[0];\n\n  if (!mvhd || !mvhd.length) {\n    return;\n  }\n\n  var info = {}; // ms to ns\n  // mvhd v1 has 8 byte duration and other fields too\n\n  if (mvhd[0] === 1) {\n    info.timestampScale = bytesToNumber(mvhd.subarray(20, 24));\n    info.duration = bytesToNumber(mvhd.subarray(24, 32));\n  } else {\n    info.timestampScale = bytesToNumber(mvhd.subarray(12, 16));\n    info.duration = bytesToNumber(mvhd.subarray(16, 20));\n  }\n\n  info.bytes = mvhd;\n  return info;\n};","import window from 'global/window';\nvar regexs = {\n  // to determine mime types\n  mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,\n  webm: /^(vp0?[89]|av0?1|opus|vorbis)/,\n  ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,\n  // to determine if a codec is audio or video\n  video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,\n  audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,\n  text: /^(stpp.ttml.im1t)/,\n  // mux.js support regex\n  muxerVideo: /^(avc0?1)/,\n  muxerAudio: /^(mp4a)/,\n  // match nothing as muxer does not support text right now.\n  // there cannot never be a character before the start of a string\n  // so this matches nothing.\n  muxerText: /a^/\n};\nvar mediaTypes = ['video', 'audio', 'text'];\nvar upperMediaTypes = ['Video', 'Audio', 'Text'];\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string} codec\n *        Codec string to translate\n * @return {string}\n *         The translated codec string\n */\n\nexport var translateLegacyCodec = function translateLegacyCodec(codec) {\n  if (!codec) {\n    return codec;\n  }\n\n  return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n    var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n    var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n    return 'avc1.' + profileHex + '00' + avcLevelHex;\n  });\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec strings with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string[]} codecs\n *        An array of codec strings to translate\n * @return {string[]}\n *         The translated array of codec strings\n */\n\nexport var translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n  return codecs.map(translateLegacyCodec);\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param {string} codecString\n *        The codec string\n * @return {string}\n *         The codec string with old apple-style codecs replaced\n *\n * @private\n */\n\nexport var mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n  return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n    return translateLegacyCodecs([match])[0];\n  });\n};\n/**\n * @typedef {Object} ParsedCodecInfo\n * @property {number} codecCount\n *           Number of codecs parsed\n * @property {string} [videoCodec]\n *           Parsed video codec (if found)\n * @property {string} [videoObjectTypeIndicator]\n *           Video object type indicator (if found)\n * @property {string|null} audioProfile\n *           Audio profile\n */\n\n/**\n * Parses a codec string to retrieve the number of codecs specified, the video codec and\n * object type indicator, and the audio profile.\n *\n * @param {string} [codecString]\n *        The codec string to parse\n * @return {ParsedCodecInfo}\n *         Parsed codec info\n */\n\nexport var parseCodecs = function parseCodecs(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  var codecs = codecString.split(',');\n  var result = [];\n  codecs.forEach(function (codec) {\n    codec = codec.trim();\n    var codecType;\n    mediaTypes.forEach(function (name) {\n      var match = regexs[name].exec(codec.toLowerCase());\n\n      if (!match || match.length <= 1) {\n        return;\n      }\n\n      codecType = name; // maintain codec case\n\n      var type = codec.substring(0, match[1].length);\n      var details = codec.replace(type, '');\n      result.push({\n        type: type,\n        details: details,\n        mediaType: name\n      });\n    });\n\n    if (!codecType) {\n      result.push({\n        type: codec,\n        details: '',\n        mediaType: 'unknown'\n      });\n    }\n  });\n  return result;\n};\n/**\n * Returns a ParsedCodecInfo object for the default alternate audio playlist if there is\n * a default alternate audio playlist for the provided audio group.\n *\n * @param {Object} master\n *        The master playlist\n * @param {string} audioGroupId\n *        ID of the audio group for which to find the default codec info\n * @return {ParsedCodecInfo}\n *         Parsed codec info\n */\n\nexport var codecsFromDefault = function codecsFromDefault(master, audioGroupId) {\n  if (!master.mediaGroups.AUDIO || !audioGroupId) {\n    return null;\n  }\n\n  var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n  if (!audioGroup) {\n    return null;\n  }\n\n  for (var name in audioGroup) {\n    var audioType = audioGroup[name];\n\n    if (audioType.default && audioType.playlists) {\n      // codec should be the same for all playlists within the audio type\n      return parseCodecs(audioType.playlists[0].attributes.CODECS);\n    }\n  }\n\n  return null;\n};\nexport var isVideoCodec = function isVideoCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.video.test(codec.trim().toLowerCase());\n};\nexport var isAudioCodec = function isAudioCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.audio.test(codec.trim().toLowerCase());\n};\nexport var isTextCodec = function isTextCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.text.test(codec.trim().toLowerCase());\n};\nexport var getMimeForCodec = function getMimeForCodec(codecString) {\n  if (!codecString || typeof codecString !== 'string') {\n    return;\n  }\n\n  var codecs = codecString.toLowerCase().split(',').map(function (c) {\n    return translateLegacyCodec(c.trim());\n  }); // default to video type\n\n  var type = 'video'; // only change to audio type if the only codec we have is\n  // audio\n\n  if (codecs.length === 1 && isAudioCodec(codecs[0])) {\n    type = 'audio';\n  } else if (codecs.length === 1 && isTextCodec(codecs[0])) {\n    // text uses application/<container> for now\n    type = 'application';\n  } // default the container to mp4\n\n\n  var container = 'mp4'; // every codec must be able to go into the container\n  // for that container to be the correct one\n\n  if (codecs.every(function (c) {\n    return regexs.mp4.test(c);\n  })) {\n    container = 'mp4';\n  } else if (codecs.every(function (c) {\n    return regexs.webm.test(c);\n  })) {\n    container = 'webm';\n  } else if (codecs.every(function (c) {\n    return regexs.ogg.test(c);\n  })) {\n    container = 'ogg';\n  }\n\n  return type + \"/\" + container + \";codecs=\\\"\" + codecString + \"\\\"\";\n};\nexport var browserSupportsCodec = function browserSupportsCodec(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  return window.MediaSource && window.MediaSource.isTypeSupported && window.MediaSource.isTypeSupported(getMimeForCodec(codecString)) || false;\n};\nexport var muxerSupportsCodec = function muxerSupportsCodec(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  return codecString.toLowerCase().split(',').every(function (codec) {\n    codec = codec.trim(); // any match is supported.\n\n    for (var i = 0; i < upperMediaTypes.length; i++) {\n      var type = upperMediaTypes[i];\n\n      if (regexs[\"muxer\" + type].test(codec)) {\n        return true;\n      }\n    }\n\n    return false;\n  });\n};\nexport var DEFAULT_AUDIO_CODEC = 'mp4a.40.2';\nexport var DEFAULT_VIDEO_CODEC = 'avc1.4d400d';","var MPEGURL_REGEX = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\nvar DASH_REGEX = /^application\\/dash\\+xml/i;\n/**\n * Returns a string that describes the type of source based on a video source object's\n * media type.\n *\n * @see {@link https://dev.w3.org/html5/pf-summary/video.html#dom-source-type|Source Type}\n *\n * @param {string} type\n *        Video source object media type\n * @return {('hls'|'dash'|'vhs-json'|null)}\n *         VHS source type string\n */\n\nexport var simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n  if (MPEGURL_REGEX.test(type)) {\n    return 'hls';\n  }\n\n  if (DASH_REGEX.test(type)) {\n    return 'dash';\n  } // Denotes the special case of a manifest object passed to http-streaming instead of a\n  // source URL.\n  //\n  // See https://en.wikipedia.org/wiki/Media_type for details on specifying media types.\n  //\n  // In this case, vnd stands for vendor, video.js for the organization, VHS for this\n  // project, and the +json suffix identifies the structure of the media type.\n\n\n  if (type === 'application/vnd.videojs.vhs+json') {\n    return 'vhs-json';\n  }\n\n  return null;\n};","/*! @name mpd-parser @version 0.21.1 @license Apache-2.0 */\nimport resolveUrl from '@videojs/vhs-utils/es/resolve-url';\nimport window from 'global/window';\nimport { forEachMediaGroup } from '@videojs/vhs-utils/es/media-groups';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array';\nimport { DOMParser } from '@xmldom/xmldom';\n\nvar version = \"0.21.1\";\n\nvar isObject = function isObject(obj) {\n  return !!obj && typeof obj === 'object';\n};\n\nvar merge = function merge() {\n  for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n    objects[_key] = arguments[_key];\n  }\n\n  return objects.reduce(function (result, source) {\n    if (typeof source !== 'object') {\n      return result;\n    }\n\n    Object.keys(source).forEach(function (key) {\n      if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n        result[key] = result[key].concat(source[key]);\n      } else if (isObject(result[key]) && isObject(source[key])) {\n        result[key] = merge(result[key], source[key]);\n      } else {\n        result[key] = source[key];\n      }\n    });\n    return result;\n  }, {});\n};\nvar values = function values(o) {\n  return Object.keys(o).map(function (k) {\n    return o[k];\n  });\n};\n\nvar range = function range(start, end) {\n  var result = [];\n\n  for (var i = start; i < end; i++) {\n    result.push(i);\n  }\n\n  return result;\n};\nvar flatten = function flatten(lists) {\n  return lists.reduce(function (x, y) {\n    return x.concat(y);\n  }, []);\n};\nvar from = function from(list) {\n  if (!list.length) {\n    return [];\n  }\n\n  var result = [];\n\n  for (var i = 0; i < list.length; i++) {\n    result.push(list[i]);\n  }\n\n  return result;\n};\nvar findIndexes = function findIndexes(l, key) {\n  return l.reduce(function (a, e, i) {\n    if (e[key]) {\n      a.push(i);\n    }\n\n    return a;\n  }, []);\n};\n/**\n * Returns the first index that satisfies the matching function, or -1 if not found.\n *\n * Only necessary because of IE11 support.\n *\n * @param {Array} list - the list to search through\n * @param {Function} matchingFunction - the matching function\n *\n * @return {number} the matching index or -1 if not found\n */\n\nvar findIndex = function findIndex(list, matchingFunction) {\n  for (var i = 0; i < list.length; i++) {\n    if (matchingFunction(list[i])) {\n      return i;\n    }\n  }\n\n  return -1;\n};\n/**\n * Returns a union of the included lists provided each element can be identified by a key.\n *\n * @param {Array} list - list of lists to get the union of\n * @param {Function} keyFunction - the function to use as a key for each element\n *\n * @return {Array} the union of the arrays\n */\n\nvar union = function union(lists, keyFunction) {\n  return values(lists.reduce(function (acc, list) {\n    list.forEach(function (el) {\n      acc[keyFunction(el)] = el;\n    });\n    return acc;\n  }, {}));\n};\n\nvar errors = {\n  INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n  DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n  DASH_INVALID_XML: 'DASH_INVALID_XML',\n  NO_BASE_URL: 'NO_BASE_URL',\n  MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n  SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n  UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n *   requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls,\n *   follows  RFC 2616, Clause 14.35.1\n * @return {SingleUri} full segment information transformed into a format similar\n *   to m3u8-parser\n */\n\nvar urlTypeToSegment = function urlTypeToSegment(_ref) {\n  var _ref$baseUrl = _ref.baseUrl,\n      baseUrl = _ref$baseUrl === void 0 ? '' : _ref$baseUrl,\n      _ref$source = _ref.source,\n      source = _ref$source === void 0 ? '' : _ref$source,\n      _ref$range = _ref.range,\n      range = _ref$range === void 0 ? '' : _ref$range,\n      _ref$indexRange = _ref.indexRange,\n      indexRange = _ref$indexRange === void 0 ? '' : _ref$indexRange;\n  var segment = {\n    uri: source,\n    resolvedUri: resolveUrl(baseUrl || '', source)\n  };\n\n  if (range || indexRange) {\n    var rangeStr = range ? range : indexRange;\n    var ranges = rangeStr.split('-'); // default to parsing this as a BigInt if possible\n\n    var startRange = window.BigInt ? window.BigInt(ranges[0]) : parseInt(ranges[0], 10);\n    var endRange = window.BigInt ? window.BigInt(ranges[1]) : parseInt(ranges[1], 10); // convert back to a number if less than MAX_SAFE_INTEGER\n\n    if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === 'bigint') {\n      startRange = Number(startRange);\n    }\n\n    if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === 'bigint') {\n      endRange = Number(endRange);\n    }\n\n    var length;\n\n    if (typeof endRange === 'bigint' || typeof startRange === 'bigint') {\n      length = window.BigInt(endRange) - window.BigInt(startRange) + window.BigInt(1);\n    } else {\n      length = endRange - startRange + 1;\n    }\n\n    if (typeof length === 'bigint' && length < Number.MAX_SAFE_INTEGER) {\n      length = Number(length);\n    } // byterange should be inclusive according to\n    // RFC 2616, Clause 14.35.1\n\n\n    segment.byterange = {\n      length: length,\n      offset: startRange\n    };\n  }\n\n  return segment;\n};\nvar byteRangeToString = function byteRangeToString(byterange) {\n  // `endRange` is one less than `offset + length` because the HTTP range\n  // header uses inclusive ranges\n  var endRange;\n\n  if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n    endRange = window.BigInt(byterange.offset) + window.BigInt(byterange.length) - window.BigInt(1);\n  } else {\n    endRange = byterange.offset + byterange.length - 1;\n  }\n\n  return byterange.offset + \"-\" + endRange;\n};\n\n/**\n * parse the end number attribue that can be a string\n * number, or undefined.\n *\n * @param {string|number|undefined} endNumber\n *        The end number attribute.\n *\n * @return {number|null}\n *          The result of parsing the end number.\n */\n\nvar parseEndNumber = function parseEndNumber(endNumber) {\n  if (endNumber && typeof endNumber !== 'number') {\n    endNumber = parseInt(endNumber, 10);\n  }\n\n  if (isNaN(endNumber)) {\n    return null;\n  }\n\n  return endNumber;\n};\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\n\nvar segmentRange = {\n  /**\n   * Returns the entire range of available segments for a static MPD\n   *\n   * @param {Object} attributes\n   *        Inheritied MPD attributes\n   * @return {{ start: number, end: number }}\n   *         The start and end numbers for available segments\n   */\n  static: function _static(attributes) {\n    var duration = attributes.duration,\n        _attributes$timescale = attributes.timescale,\n        timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n        sourceDuration = attributes.sourceDuration,\n        periodDuration = attributes.periodDuration;\n    var endNumber = parseEndNumber(attributes.endNumber);\n    var segmentDuration = duration / timescale;\n\n    if (typeof endNumber === 'number') {\n      return {\n        start: 0,\n        end: endNumber\n      };\n    }\n\n    if (typeof periodDuration === 'number') {\n      return {\n        start: 0,\n        end: periodDuration / segmentDuration\n      };\n    }\n\n    return {\n      start: 0,\n      end: sourceDuration / segmentDuration\n    };\n  },\n\n  /**\n   * Returns the current live window range of available segments for a dynamic MPD\n   *\n   * @param {Object} attributes\n   *        Inheritied MPD attributes\n   * @return {{ start: number, end: number }}\n   *         The start and end numbers for available segments\n   */\n  dynamic: function dynamic(attributes) {\n    var NOW = attributes.NOW,\n        clientOffset = attributes.clientOffset,\n        availabilityStartTime = attributes.availabilityStartTime,\n        _attributes$timescale2 = attributes.timescale,\n        timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n        duration = attributes.duration,\n        _attributes$periodSta = attributes.periodStart,\n        periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta,\n        _attributes$minimumUp = attributes.minimumUpdatePeriod,\n        minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp,\n        _attributes$timeShift = attributes.timeShiftBufferDepth,\n        timeShiftBufferDepth = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;\n    var endNumber = parseEndNumber(attributes.endNumber); // clientOffset is passed in at the top level of mpd-parser and is an offset calculated\n    // after retrieving UTC server time.\n\n    var now = (NOW + clientOffset) / 1000; // WC stands for Wall Clock.\n    // Convert the period start time to EPOCH.\n\n    var periodStartWC = availabilityStartTime + periodStart; // Period end in EPOCH is manifest's retrieval time + time until next update.\n\n    var periodEndWC = now + minimumUpdatePeriod;\n    var periodDuration = periodEndWC - periodStartWC;\n    var segmentCount = Math.ceil(periodDuration * timescale / duration);\n    var availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n    var availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n    return {\n      start: Math.max(0, availableStart),\n      end: typeof endNumber === 'number' ? endNumber : Math.min(segmentCount, availableEnd)\n    };\n  }\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n *        Number of the segment\n * @param {number} index\n *        Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n *         Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n *        Inherited MPD attributes\n * @return {toSegmentsCallback}\n *         Callback map function\n */\n\nvar toSegments = function toSegments(attributes) {\n  return function (number) {\n    var duration = attributes.duration,\n        _attributes$timescale3 = attributes.timescale,\n        timescale = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3,\n        periodStart = attributes.periodStart,\n        _attributes$startNumb = attributes.startNumber,\n        startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;\n    return {\n      number: startNumber + number,\n      duration: duration / timescale,\n      timeline: periodStart,\n      time: number * duration\n    };\n  };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n *        Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\nvar parseByDuration = function parseByDuration(attributes) {\n  var type = attributes.type,\n      duration = attributes.duration,\n      _attributes$timescale4 = attributes.timescale,\n      timescale = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4,\n      periodDuration = attributes.periodDuration,\n      sourceDuration = attributes.sourceDuration;\n\n  var _segmentRange$type = segmentRange[type](attributes),\n      start = _segmentRange$type.start,\n      end = _segmentRange$type.end;\n\n  var segments = range(start, end).map(toSegments(attributes));\n\n  if (type === 'static') {\n    var index = segments.length - 1; // section is either a period or the full source\n\n    var sectionDuration = typeof periodDuration === 'number' ? periodDuration : sourceDuration; // final segment may be less than full segment duration\n\n    segments[index].duration = sectionDuration - duration / timescale * index;\n  }\n\n  return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes.  Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @return {Object.<Array>} list of segments\n */\n\nvar segmentsFromBase = function segmentsFromBase(attributes) {\n  var baseUrl = attributes.baseUrl,\n      _attributes$initializ = attributes.initialization,\n      initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ,\n      sourceDuration = attributes.sourceDuration,\n      _attributes$indexRang = attributes.indexRange,\n      indexRange = _attributes$indexRang === void 0 ? '' : _attributes$indexRang,\n      periodStart = attributes.periodStart,\n      presentationTime = attributes.presentationTime,\n      _attributes$number = attributes.number,\n      number = _attributes$number === void 0 ? 0 : _attributes$number,\n      duration = attributes.duration; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n  if (!baseUrl) {\n    throw new Error(errors.NO_BASE_URL);\n  }\n\n  var initSegment = urlTypeToSegment({\n    baseUrl: baseUrl,\n    source: initialization.sourceURL,\n    range: initialization.range\n  });\n  var segment = urlTypeToSegment({\n    baseUrl: baseUrl,\n    source: baseUrl,\n    indexRange: indexRange\n  });\n  segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n  // (since SegmentBase is only for one total segment)\n\n  if (duration) {\n    var segmentTimeInfo = parseByDuration(attributes);\n\n    if (segmentTimeInfo.length) {\n      segment.duration = segmentTimeInfo[0].duration;\n      segment.timeline = segmentTimeInfo[0].timeline;\n    }\n  } else if (sourceDuration) {\n    segment.duration = sourceDuration;\n    segment.timeline = periodStart;\n  } // If presentation time is provided, these segments are being generated by SIDX\n  // references, and should use the time provided. For the general case of SegmentBase,\n  // there should only be one segment in the period, so its presentation time is the same\n  // as its period start.\n\n\n  segment.presentationTime = presentationTime || periodStart;\n  segment.number = number;\n  return [segment];\n};\n/**\n * Given a playlist, a sidx box, and a baseUrl, update the segment list of the playlist\n * according to the sidx information given.\n *\n * playlist.sidx has metadadata about the sidx where-as the sidx param\n * is the parsed sidx box itself.\n *\n * @param {Object} playlist the playlist to update the sidx information for\n * @param {Object} sidx the parsed sidx box\n * @return {Object} the playlist object with the updated sidx information\n */\n\nvar addSidxSegmentsToPlaylist$1 = function addSidxSegmentsToPlaylist(playlist, sidx, baseUrl) {\n  // Retain init segment information\n  var initSegment = playlist.sidx.map ? playlist.sidx.map : null; // Retain source duration from initial main manifest parsing\n\n  var sourceDuration = playlist.sidx.duration; // Retain source timeline\n\n  var timeline = playlist.timeline || 0;\n  var sidxByteRange = playlist.sidx.byterange;\n  var sidxEnd = sidxByteRange.offset + sidxByteRange.length; // Retain timescale of the parsed sidx\n\n  var timescale = sidx.timescale; // referenceType 1 refers to other sidx boxes\n\n  var mediaReferences = sidx.references.filter(function (r) {\n    return r.referenceType !== 1;\n  });\n  var segments = [];\n  var type = playlist.endList ? 'static' : 'dynamic';\n  var periodStart = playlist.sidx.timeline;\n  var presentationTime = periodStart;\n  var number = playlist.mediaSequence || 0; // firstOffset is the offset from the end of the sidx box\n\n  var startIndex; // eslint-disable-next-line\n\n  if (typeof sidx.firstOffset === 'bigint') {\n    startIndex = window.BigInt(sidxEnd) + sidx.firstOffset;\n  } else {\n    startIndex = sidxEnd + sidx.firstOffset;\n  }\n\n  for (var i = 0; i < mediaReferences.length; i++) {\n    var reference = sidx.references[i]; // size of the referenced (sub)segment\n\n    var size = reference.referencedSize; // duration of the referenced (sub)segment, in  the  timescale\n    // this will be converted to seconds when generating segments\n\n    var duration = reference.subsegmentDuration; // should be an inclusive range\n\n    var endIndex = void 0; // eslint-disable-next-line\n\n    if (typeof startIndex === 'bigint') {\n      endIndex = startIndex + window.BigInt(size) - window.BigInt(1);\n    } else {\n      endIndex = startIndex + size - 1;\n    }\n\n    var indexRange = startIndex + \"-\" + endIndex;\n    var attributes = {\n      baseUrl: baseUrl,\n      timescale: timescale,\n      timeline: timeline,\n      periodStart: periodStart,\n      presentationTime: presentationTime,\n      number: number,\n      duration: duration,\n      sourceDuration: sourceDuration,\n      indexRange: indexRange,\n      type: type\n    };\n    var segment = segmentsFromBase(attributes)[0];\n\n    if (initSegment) {\n      segment.map = initSegment;\n    }\n\n    segments.push(segment);\n\n    if (typeof startIndex === 'bigint') {\n      startIndex += window.BigInt(size);\n    } else {\n      startIndex += size;\n    }\n\n    presentationTime += duration / timescale;\n    number++;\n  }\n\n  playlist.segments = segments;\n  return playlist;\n};\n\nvar SUPPORTED_MEDIA_TYPES = ['AUDIO', 'SUBTITLES']; // allow one 60fps frame as leniency (arbitrarily chosen)\n\nvar TIME_FUDGE = 1 / 60;\n/**\n * Given a list of timelineStarts, combines, dedupes, and sorts them.\n *\n * @param {TimelineStart[]} timelineStarts - list of timeline starts\n *\n * @return {TimelineStart[]} the combined and deduped timeline starts\n */\n\nvar getUniqueTimelineStarts = function getUniqueTimelineStarts(timelineStarts) {\n  return union(timelineStarts, function (_ref) {\n    var timeline = _ref.timeline;\n    return timeline;\n  }).sort(function (a, b) {\n    return a.timeline > b.timeline ? 1 : -1;\n  });\n};\n/**\n * Finds the playlist with the matching NAME attribute.\n *\n * @param {Array} playlists - playlists to search through\n * @param {string} name - the NAME attribute to search for\n *\n * @return {Object|null} the matching playlist object, or null\n */\n\nvar findPlaylistWithName = function findPlaylistWithName(playlists, name) {\n  for (var i = 0; i < playlists.length; i++) {\n    if (playlists[i].attributes.NAME === name) {\n      return playlists[i];\n    }\n  }\n\n  return null;\n};\n/**\n * Gets a flattened array of media group playlists.\n *\n * @param {Object} manifest - the main manifest object\n *\n * @return {Array} the media group playlists\n */\n\nvar getMediaGroupPlaylists = function getMediaGroupPlaylists(manifest) {\n  var mediaGroupPlaylists = [];\n  forEachMediaGroup(manifest, SUPPORTED_MEDIA_TYPES, function (properties, type, group, label) {\n    mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);\n  });\n  return mediaGroupPlaylists;\n};\n/**\n * Updates the playlist's media sequence numbers.\n *\n * @param {Object} config - options object\n * @param {Object} config.playlist - the playlist to update\n * @param {number} config.mediaSequence - the mediaSequence number to start with\n */\n\nvar updateMediaSequenceForPlaylist = function updateMediaSequenceForPlaylist(_ref2) {\n  var playlist = _ref2.playlist,\n      mediaSequence = _ref2.mediaSequence;\n  playlist.mediaSequence = mediaSequence;\n  playlist.segments.forEach(function (segment, index) {\n    segment.number = playlist.mediaSequence + index;\n  });\n};\n/**\n * Updates the media and discontinuity sequence numbers of newPlaylists given oldPlaylists\n * and a complete list of timeline starts.\n *\n * If no matching playlist is found, only the discontinuity sequence number of the playlist\n * will be updated.\n *\n * Since early available timelines are not supported, at least one segment must be present.\n *\n * @param {Object} config - options object\n * @param {Object[]} oldPlaylists - the old playlists to use as a reference\n * @param {Object[]} newPlaylists - the new playlists to update\n * @param {Object} timelineStarts - all timelineStarts seen in the stream to this point\n */\n\nvar updateSequenceNumbers = function updateSequenceNumbers(_ref3) {\n  var oldPlaylists = _ref3.oldPlaylists,\n      newPlaylists = _ref3.newPlaylists,\n      timelineStarts = _ref3.timelineStarts;\n  newPlaylists.forEach(function (playlist) {\n    playlist.discontinuitySequence = findIndex(timelineStarts, function (_ref4) {\n      var timeline = _ref4.timeline;\n      return timeline === playlist.timeline;\n    }); // Playlists NAMEs come from DASH Representation IDs, which are mandatory\n    // (see ISO_23009-1-2012 5.3.5.2).\n    //\n    // If the same Representation existed in a prior Period, it will retain the same NAME.\n\n    var oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);\n\n    if (!oldPlaylist) {\n      // Since this is a new playlist, the media sequence values can start from 0 without\n      // consequence.\n      return;\n    } // TODO better support for live SIDX\n    //\n    // As of this writing, mpd-parser does not support multiperiod SIDX (in live or VOD).\n    // This is evident by a playlist only having a single SIDX reference. In a multiperiod\n    // playlist there would need to be multiple SIDX references. In addition, live SIDX is\n    // not supported when the SIDX properties change on refreshes.\n    //\n    // In the future, if support needs to be added, the merging logic here can be called\n    // after SIDX references are resolved. For now, exit early to prevent exceptions being\n    // thrown due to undefined references.\n\n\n    if (playlist.sidx) {\n      return;\n    } // Since we don't yet support early available timelines, we don't need to support\n    // playlists with no segments.\n\n\n    var firstNewSegment = playlist.segments[0];\n    var oldMatchingSegmentIndex = findIndex(oldPlaylist.segments, function (oldSegment) {\n      return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;\n    }); // No matching segment from the old playlist means the entire playlist was refreshed.\n    // In this case the media sequence should account for this update, and the new segments\n    // should be marked as discontinuous from the prior content, since the last prior\n    // timeline was removed.\n\n    if (oldMatchingSegmentIndex === -1) {\n      updateMediaSequenceForPlaylist({\n        playlist: playlist,\n        mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length\n      });\n      playlist.segments[0].discontinuity = true;\n      playlist.discontinuityStarts.unshift(0); // No matching segment does not necessarily mean there's missing content.\n      //\n      // If the new playlist's timeline is the same as the last seen segment's timeline,\n      // then a discontinuity can be added to identify that there's potentially missing\n      // content. If there's no missing content, the discontinuity should still be rather\n      // harmless. It's possible that if segment durations are accurate enough, that the\n      // existence of a gap can be determined using the presentation times and durations,\n      // but if the segment timing info is off, it may introduce more problems than simply\n      // adding the discontinuity.\n      //\n      // If the new playlist's timeline is different from the last seen segment's timeline,\n      // then a discontinuity can be added to identify that this is the first seen segment\n      // of a new timeline. However, the logic at the start of this function that\n      // determined the disconinuity sequence by timeline index is now off by one (the\n      // discontinuity of the newest timeline hasn't yet fallen off the manifest...since\n      // we added it), so the disconinuity sequence must be decremented.\n      //\n      // A period may also have a duration of zero, so the case of no segments is handled\n      // here even though we don't yet support early available periods.\n\n      if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {\n        playlist.discontinuitySequence--;\n      }\n\n      return;\n    } // If the first segment matched with a prior segment on a discontinuity (it's matching\n    // on the first segment of a period), then the discontinuitySequence shouldn't be the\n    // timeline's matching one, but instead should be the one prior, and the first segment\n    // of the new manifest should be marked with a discontinuity.\n    //\n    // The reason for this special case is that discontinuity sequence shows how many\n    // discontinuities have fallen off of the playlist, and discontinuities are marked on\n    // the first segment of a new \"timeline.\" Because of this, while DASH will retain that\n    // Period while the \"timeline\" exists, HLS keeps track of it via the discontinuity\n    // sequence, and that first segment is an indicator, but can be removed before that\n    // timeline is gone.\n\n\n    var oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];\n\n    if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {\n      firstNewSegment.discontinuity = true;\n      playlist.discontinuityStarts.unshift(0);\n      playlist.discontinuitySequence--;\n    }\n\n    updateMediaSequenceForPlaylist({\n      playlist: playlist,\n      mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number\n    });\n  });\n};\n/**\n * Given an old parsed manifest object and a new parsed manifest object, updates the\n * sequence and timing values within the new manifest to ensure that it lines up with the\n * old.\n *\n * @param {Array} oldManifest - the old main manifest object\n * @param {Array} newManifest - the new main manifest object\n *\n * @return {Object} the updated new manifest object\n */\n\nvar positionManifestOnTimeline = function positionManifestOnTimeline(_ref5) {\n  var oldManifest = _ref5.oldManifest,\n      newManifest = _ref5.newManifest;\n  // Starting from v4.1.2 of the IOP, section 4.4.3.3 states:\n  //\n  // \"MPD@availabilityStartTime and Period@start shall not be changed over MPD updates.\"\n  //\n  // This was added from https://github.com/Dash-Industry-Forum/DASH-IF-IOP/issues/160\n  //\n  // Because of this change, and the difficulty of supporting periods with changing start\n  // times, periods with changing start times are not supported. This makes the logic much\n  // simpler, since periods with the same start time can be considerred the same period\n  // across refreshes.\n  //\n  // To give an example as to the difficulty of handling periods where the start time may\n  // change, if a single period manifest is refreshed with another manifest with a single\n  // period, and both the start and end times are increased, then the only way to determine\n  // if it's a new period or an old one that has changed is to look through the segments of\n  // each playlist and determine the presentation time bounds to find a match. In addition,\n  // if the period start changed to exceed the old period end, then there would be no\n  // match, and it would not be possible to determine whether the refreshed period is a new\n  // one or the old one.\n  var oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));\n  var newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest)); // Save all seen timelineStarts to the new manifest. Although this potentially means that\n  // there's a \"memory leak\" in that it will never stop growing, in reality, only a couple\n  // of properties are saved for each seen Period. Even long running live streams won't\n  // generate too many Periods, unless the stream is watched for decades. In the future,\n  // this can be optimized by mapping to discontinuity sequence numbers for each timeline,\n  // but it may not become an issue, and the additional info can be useful for debugging.\n\n  newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);\n  updateSequenceNumbers({\n    oldPlaylists: oldPlaylists,\n    newPlaylists: newPlaylists,\n    timelineStarts: newManifest.timelineStarts\n  });\n  return newManifest;\n};\n\nvar generateSidxKey = function generateSidxKey(sidx) {\n  return sidx && sidx.uri + '-' + byteRangeToString(sidx.byterange);\n};\n\nvar mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists(playlists) {\n  var mergedPlaylists = values(playlists.reduce(function (acc, playlist) {\n    // assuming playlist IDs are the same across periods\n    // TODO: handle multiperiod where representation sets are not the same\n    // across periods\n    var name = playlist.attributes.id + (playlist.attributes.lang || '');\n\n    if (!acc[name]) {\n      // First Period\n      acc[name] = playlist;\n      acc[name].attributes.timelineStarts = [];\n    } else {\n      // Subsequent Periods\n      if (playlist.segments) {\n        var _acc$name$segments;\n\n        // first segment of subsequent periods signal a discontinuity\n        if (playlist.segments[0]) {\n          playlist.segments[0].discontinuity = true;\n        }\n\n        (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments);\n      } // bubble up contentProtection, this assumes all DRM content\n      // has the same contentProtection\n\n\n      if (playlist.attributes.contentProtection) {\n        acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n      }\n    }\n\n    acc[name].attributes.timelineStarts.push({\n      // Although they represent the same number, it's important to have both to make it\n      // compatible with HLS potentially having a similar attribute.\n      start: playlist.attributes.periodStart,\n      timeline: playlist.attributes.periodStart\n    });\n    return acc;\n  }, {}));\n  return mergedPlaylists.map(function (playlist) {\n    playlist.discontinuityStarts = findIndexes(playlist.segments || [], 'discontinuity');\n    return playlist;\n  });\n};\n\nvar addSidxSegmentsToPlaylist = function addSidxSegmentsToPlaylist(playlist, sidxMapping) {\n  var sidxKey = generateSidxKey(playlist.sidx);\n  var sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;\n\n  if (sidxMatch) {\n    addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);\n  }\n\n  return playlist;\n};\nvar addSidxSegmentsToPlaylists = function addSidxSegmentsToPlaylists(playlists, sidxMapping) {\n  if (sidxMapping === void 0) {\n    sidxMapping = {};\n  }\n\n  if (!Object.keys(sidxMapping).length) {\n    return playlists;\n  }\n\n  for (var i in playlists) {\n    playlists[i] = addSidxSegmentsToPlaylist(playlists[i], sidxMapping);\n  }\n\n  return playlists;\n};\nvar formatAudioPlaylist = function formatAudioPlaylist(_ref, isAudioOnly) {\n  var _attributes;\n\n  var attributes = _ref.attributes,\n      segments = _ref.segments,\n      sidx = _ref.sidx,\n      mediaSequence = _ref.mediaSequence,\n      discontinuitySequence = _ref.discontinuitySequence,\n      discontinuityStarts = _ref.discontinuityStarts;\n  var playlist = {\n    attributes: (_attributes = {\n      NAME: attributes.id,\n      BANDWIDTH: attributes.bandwidth,\n      CODECS: attributes.codecs\n    }, _attributes['PROGRAM-ID'] = 1, _attributes),\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: '',\n    targetDuration: attributes.duration,\n    discontinuitySequence: discontinuitySequence,\n    discontinuityStarts: discontinuityStarts,\n    timelineStarts: attributes.timelineStarts,\n    mediaSequence: mediaSequence,\n    segments: segments\n  };\n\n  if (attributes.contentProtection) {\n    playlist.contentProtection = attributes.contentProtection;\n  }\n\n  if (sidx) {\n    playlist.sidx = sidx;\n  }\n\n  if (isAudioOnly) {\n    playlist.attributes.AUDIO = 'audio';\n    playlist.attributes.SUBTITLES = 'subs';\n  }\n\n  return playlist;\n};\nvar formatVttPlaylist = function formatVttPlaylist(_ref2) {\n  var _m3u8Attributes;\n\n  var attributes = _ref2.attributes,\n      segments = _ref2.segments,\n      mediaSequence = _ref2.mediaSequence,\n      discontinuityStarts = _ref2.discontinuityStarts,\n      discontinuitySequence = _ref2.discontinuitySequence;\n\n  if (typeof segments === 'undefined') {\n    // vtt tracks may use single file in BaseURL\n    segments = [{\n      uri: attributes.baseUrl,\n      timeline: attributes.periodStart,\n      resolvedUri: attributes.baseUrl || '',\n      duration: attributes.sourceDuration,\n      number: 0\n    }]; // targetDuration should be the same duration as the only segment\n\n    attributes.duration = attributes.sourceDuration;\n  }\n\n  var m3u8Attributes = (_m3u8Attributes = {\n    NAME: attributes.id,\n    BANDWIDTH: attributes.bandwidth\n  }, _m3u8Attributes['PROGRAM-ID'] = 1, _m3u8Attributes);\n\n  if (attributes.codecs) {\n    m3u8Attributes.CODECS = attributes.codecs;\n  }\n\n  return {\n    attributes: m3u8Attributes,\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: attributes.baseUrl || '',\n    targetDuration: attributes.duration,\n    timelineStarts: attributes.timelineStarts,\n    discontinuityStarts: discontinuityStarts,\n    discontinuitySequence: discontinuitySequence,\n    mediaSequence: mediaSequence,\n    segments: segments\n  };\n};\nvar organizeAudioPlaylists = function organizeAudioPlaylists(playlists, sidxMapping, isAudioOnly) {\n  if (sidxMapping === void 0) {\n    sidxMapping = {};\n  }\n\n  if (isAudioOnly === void 0) {\n    isAudioOnly = false;\n  }\n\n  var mainPlaylist;\n  var formattedPlaylists = playlists.reduce(function (a, playlist) {\n    var role = playlist.attributes.role && playlist.attributes.role.value || '';\n    var language = playlist.attributes.lang || '';\n    var label = playlist.attributes.label || 'main';\n\n    if (language && !playlist.attributes.label) {\n      var roleLabel = role ? \" (\" + role + \")\" : '';\n      label = \"\" + playlist.attributes.lang + roleLabel;\n    }\n\n    if (!a[label]) {\n      a[label] = {\n        language: language,\n        autoselect: true,\n        default: role === 'main',\n        playlists: [],\n        uri: ''\n      };\n    }\n\n    var formatted = addSidxSegmentsToPlaylist(formatAudioPlaylist(playlist, isAudioOnly), sidxMapping);\n    a[label].playlists.push(formatted);\n\n    if (typeof mainPlaylist === 'undefined' && role === 'main') {\n      mainPlaylist = playlist;\n      mainPlaylist.default = true;\n    }\n\n    return a;\n  }, {}); // if no playlists have role \"main\", mark the first as main\n\n  if (!mainPlaylist) {\n    var firstLabel = Object.keys(formattedPlaylists)[0];\n    formattedPlaylists[firstLabel].default = true;\n  }\n\n  return formattedPlaylists;\n};\nvar organizeVttPlaylists = function organizeVttPlaylists(playlists, sidxMapping) {\n  if (sidxMapping === void 0) {\n    sidxMapping = {};\n  }\n\n  return playlists.reduce(function (a, playlist) {\n    var label = playlist.attributes.lang || 'text';\n\n    if (!a[label]) {\n      a[label] = {\n        language: label,\n        default: false,\n        autoselect: false,\n        playlists: [],\n        uri: ''\n      };\n    }\n\n    a[label].playlists.push(addSidxSegmentsToPlaylist(formatVttPlaylist(playlist), sidxMapping));\n    return a;\n  }, {});\n};\n\nvar organizeCaptionServices = function organizeCaptionServices(captionServices) {\n  return captionServices.reduce(function (svcObj, svc) {\n    if (!svc) {\n      return svcObj;\n    }\n\n    svc.forEach(function (service) {\n      var channel = service.channel,\n          language = service.language;\n      svcObj[language] = {\n        autoselect: false,\n        default: false,\n        instreamId: channel,\n        language: language\n      };\n\n      if (service.hasOwnProperty('aspectRatio')) {\n        svcObj[language].aspectRatio = service.aspectRatio;\n      }\n\n      if (service.hasOwnProperty('easyReader')) {\n        svcObj[language].easyReader = service.easyReader;\n      }\n\n      if (service.hasOwnProperty('3D')) {\n        svcObj[language]['3D'] = service['3D'];\n      }\n    });\n    return svcObj;\n  }, {});\n};\n\nvar formatVideoPlaylist = function formatVideoPlaylist(_ref3) {\n  var _attributes2;\n\n  var attributes = _ref3.attributes,\n      segments = _ref3.segments,\n      sidx = _ref3.sidx,\n      discontinuityStarts = _ref3.discontinuityStarts;\n  var playlist = {\n    attributes: (_attributes2 = {\n      NAME: attributes.id,\n      AUDIO: 'audio',\n      SUBTITLES: 'subs',\n      RESOLUTION: {\n        width: attributes.width,\n        height: attributes.height\n      },\n      CODECS: attributes.codecs,\n      BANDWIDTH: attributes.bandwidth\n    }, _attributes2['PROGRAM-ID'] = 1, _attributes2),\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: '',\n    targetDuration: attributes.duration,\n    discontinuityStarts: discontinuityStarts,\n    timelineStarts: attributes.timelineStarts,\n    segments: segments\n  };\n\n  if (attributes.contentProtection) {\n    playlist.contentProtection = attributes.contentProtection;\n  }\n\n  if (sidx) {\n    playlist.sidx = sidx;\n  }\n\n  return playlist;\n};\n\nvar videoOnly = function videoOnly(_ref4) {\n  var attributes = _ref4.attributes;\n  return attributes.mimeType === 'video/mp4' || attributes.mimeType === 'video/webm' || attributes.contentType === 'video';\n};\n\nvar audioOnly = function audioOnly(_ref5) {\n  var attributes = _ref5.attributes;\n  return attributes.mimeType === 'audio/mp4' || attributes.mimeType === 'audio/webm' || attributes.contentType === 'audio';\n};\n\nvar vttOnly = function vttOnly(_ref6) {\n  var attributes = _ref6.attributes;\n  return attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n};\n/**\n * Contains start and timeline properties denoting a timeline start. For DASH, these will\n * be the same number.\n *\n * @typedef {Object} TimelineStart\n * @property {number} start - the start time of the timeline\n * @property {number} timeline - the timeline number\n */\n\n/**\n * Adds appropriate media and discontinuity sequence values to the segments and playlists.\n *\n * Throughout mpd-parser, the `number` attribute is used in relation to `startNumber`, a\n * DASH specific attribute used in constructing segment URI's from templates. However, from\n * an HLS perspective, the `number` attribute on a segment would be its `mediaSequence`\n * value, which should start at the original media sequence value (or 0) and increment by 1\n * for each segment thereafter. Since DASH's `startNumber` values are independent per\n * period, it doesn't make sense to use it for `number`. Instead, assume everything starts\n * from a 0 mediaSequence value and increment from there.\n *\n * Note that VHS currently doesn't use the `number` property, but it can be helpful for\n * debugging and making sense of the manifest.\n *\n * For live playlists, to account for values increasing in manifests when periods are\n * removed on refreshes, merging logic should be used to update the numbers to their\n * appropriate values (to ensure they're sequential and increasing).\n *\n * @param {Object[]} playlists - the playlists to update\n * @param {TimelineStart[]} timelineStarts - the timeline starts for the manifest\n */\n\n\nvar addMediaSequenceValues = function addMediaSequenceValues(playlists, timelineStarts) {\n  // increment all segments sequentially\n  playlists.forEach(function (playlist) {\n    playlist.mediaSequence = 0;\n    playlist.discontinuitySequence = findIndex(timelineStarts, function (_ref7) {\n      var timeline = _ref7.timeline;\n      return timeline === playlist.timeline;\n    });\n\n    if (!playlist.segments) {\n      return;\n    }\n\n    playlist.segments.forEach(function (segment, index) {\n      segment.number = index;\n    });\n  });\n};\n/**\n * Given a media group object, flattens all playlists within the media group into a single\n * array.\n *\n * @param {Object} mediaGroupObject - the media group object\n *\n * @return {Object[]}\n *         The media group playlists\n */\n\nvar flattenMediaGroupPlaylists = function flattenMediaGroupPlaylists(mediaGroupObject) {\n  if (!mediaGroupObject) {\n    return [];\n  }\n\n  return Object.keys(mediaGroupObject).reduce(function (acc, label) {\n    var labelContents = mediaGroupObject[label];\n    return acc.concat(labelContents.playlists);\n  }, []);\n};\nvar toM3u8 = function toM3u8(_ref8) {\n  var _mediaGroups;\n\n  var dashPlaylists = _ref8.dashPlaylists,\n      locations = _ref8.locations,\n      _ref8$sidxMapping = _ref8.sidxMapping,\n      sidxMapping = _ref8$sidxMapping === void 0 ? {} : _ref8$sidxMapping,\n      previousManifest = _ref8.previousManifest;\n\n  if (!dashPlaylists.length) {\n    return {};\n  } // grab all main manifest attributes\n\n\n  var _dashPlaylists$0$attr = dashPlaylists[0].attributes,\n      duration = _dashPlaylists$0$attr.sourceDuration,\n      type = _dashPlaylists$0$attr.type,\n      suggestedPresentationDelay = _dashPlaylists$0$attr.suggestedPresentationDelay,\n      minimumUpdatePeriod = _dashPlaylists$0$attr.minimumUpdatePeriod;\n  var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n  var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n  var vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));\n  var captions = dashPlaylists.map(function (playlist) {\n    return playlist.attributes.captionServices;\n  }).filter(Boolean);\n  var manifest = {\n    allowCache: true,\n    discontinuityStarts: [],\n    segments: [],\n    endList: true,\n    mediaGroups: (_mediaGroups = {\n      AUDIO: {},\n      VIDEO: {}\n    }, _mediaGroups['CLOSED-CAPTIONS'] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),\n    uri: '',\n    duration: duration,\n    playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)\n  };\n\n  if (minimumUpdatePeriod >= 0) {\n    manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000;\n  }\n\n  if (locations) {\n    manifest.locations = locations;\n  }\n\n  if (type === 'dynamic') {\n    manifest.suggestedPresentationDelay = suggestedPresentationDelay;\n  }\n\n  var isAudioOnly = manifest.playlists.length === 0;\n  var organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly) : null;\n  var organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;\n  var formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));\n  var playlistTimelineStarts = formattedPlaylists.map(function (_ref9) {\n    var timelineStarts = _ref9.timelineStarts;\n    return timelineStarts;\n  });\n  manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);\n  addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);\n\n  if (organizedAudioGroup) {\n    manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;\n  }\n\n  if (organizedVttGroup) {\n    manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;\n  }\n\n  if (captions.length) {\n    manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);\n  }\n\n  if (previousManifest) {\n    return positionManifestOnTimeline({\n      oldManifest: previousManifest,\n      newManifest: manifest\n    });\n  }\n\n  return manifest;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {number} time\n *        current time (typically the total time up until the final segment)\n * @param {number} duration\n *        duration property for the given <S />\n *\n * @return {number}\n *        R value to reach the end of the given period\n */\nvar getLiveRValue = function getLiveRValue(attributes, time, duration) {\n  var NOW = attributes.NOW,\n      clientOffset = attributes.clientOffset,\n      availabilityStartTime = attributes.availabilityStartTime,\n      _attributes$timescale = attributes.timescale,\n      timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n      _attributes$periodSta = attributes.periodStart,\n      periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta,\n      _attributes$minimumUp = attributes.minimumUpdatePeriod,\n      minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;\n  var now = (NOW + clientOffset) / 1000;\n  var periodStartWC = availabilityStartTime + periodStart;\n  var periodEndWC = now + minimumUpdatePeriod;\n  var periodDuration = periodEndWC - periodStartWC;\n  return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\n\nvar parseByTimeline = function parseByTimeline(attributes, segmentTimeline) {\n  var type = attributes.type,\n      _attributes$minimumUp2 = attributes.minimumUpdatePeriod,\n      minimumUpdatePeriod = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2,\n      _attributes$media = attributes.media,\n      media = _attributes$media === void 0 ? '' : _attributes$media,\n      sourceDuration = attributes.sourceDuration,\n      _attributes$timescale2 = attributes.timescale,\n      timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n      _attributes$startNumb = attributes.startNumber,\n      startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb,\n      timeline = attributes.periodStart;\n  var segments = [];\n  var time = -1;\n\n  for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n    var S = segmentTimeline[sIndex];\n    var duration = S.d;\n    var repeat = S.r || 0;\n    var segmentTime = S.t || 0;\n\n    if (time < 0) {\n      // first segment\n      time = segmentTime;\n    }\n\n    if (segmentTime && segmentTime > time) {\n      // discontinuity\n      // TODO: How to handle this type of discontinuity\n      // timeline++ here would treat it like HLS discontuity and content would\n      // get appended without gap\n      // E.G.\n      //  <S t=\"0\" d=\"1\" />\n      //  <S d=\"1\" />\n      //  <S d=\"1\" />\n      //  <S t=\"5\" d=\"1\" />\n      // would have $Time$ values of [0, 1, 2, 5]\n      // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n      // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n      // does the value of sourceDuration consider this when calculating arbitrary\n      // negative @r repeat value?\n      // E.G. Same elements as above with this added at the end\n      //  <S d=\"1\" r=\"-1\" />\n      //  with a sourceDuration of 10\n      // Would the 2 gaps be included in the time duration calculations resulting in\n      // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n      // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n      time = segmentTime;\n    }\n\n    var count = void 0;\n\n    if (repeat < 0) {\n      var nextS = sIndex + 1;\n\n      if (nextS === segmentTimeline.length) {\n        // last segment\n        if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n          count = getLiveRValue(attributes, time, duration);\n        } else {\n          // TODO: This may be incorrect depending on conclusion of TODO above\n          count = (sourceDuration * timescale - time) / duration;\n        }\n      } else {\n        count = (segmentTimeline[nextS].t - time) / duration;\n      }\n    } else {\n      count = repeat + 1;\n    }\n\n    var end = startNumber + segments.length + count;\n    var number = startNumber + segments.length;\n\n    while (number < end) {\n      segments.push({\n        number: number,\n        duration: duration / timescale,\n        time: time,\n        timeline: timeline\n      });\n      time += duration;\n      number++;\n    }\n  }\n\n  return segments;\n};\n\nvar identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n *        Entire match of identifier\n * @param {string} identifier\n *        Name of matched identifier\n * @param {string} format\n *        Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n *        Desired length of the replaced value. Values less than this width shall be left\n *        zero padded\n * @return {string}\n *         Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n *        Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n *        Value of the Representation@id attribute\n * @param {number} values.Number\n *        Number of the corresponding segment\n * @param {number} values.Bandwidth\n *        Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n *        Timestamp value of the corresponding segment\n * @return {replaceCallback}\n *         Callback to be used with String.prototype.replace to replace identifiers\n */\n\nvar identifierReplacement = function identifierReplacement(values) {\n  return function (match, identifier, format, width) {\n    if (match === '$$') {\n      // escape sequence\n      return '$';\n    }\n\n    if (typeof values[identifier] === 'undefined') {\n      return match;\n    }\n\n    var value = '' + values[identifier];\n\n    if (identifier === 'RepresentationID') {\n      // Format tag shall not be present with RepresentationID\n      return value;\n    }\n\n    if (!format) {\n      width = 1;\n    } else {\n      width = parseInt(width, 10);\n    }\n\n    if (value.length >= width) {\n      return value;\n    }\n\n    return \"\" + new Array(width - value.length + 1).join('0') + value;\n  };\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n *        Template string to construct url from\n * @param {Obect} values\n *        Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n *        Value of the Representation@id attribute\n * @param {number} values.Number\n *        Number of the corresponding segment\n * @param {number} values.Bandwidth\n *        Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n *        Timestamp value of the corresponding segment\n * @return {string}\n *         Segment url with identifiers replaced\n */\n\nvar constructTemplateUrl = function constructTemplateUrl(url, values) {\n  return url.replace(identifierPattern, identifierReplacement(values));\n};\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\nvar parseTemplateInfo = function parseTemplateInfo(attributes, segmentTimeline) {\n  if (!attributes.duration && !segmentTimeline) {\n    // if neither @duration or SegmentTimeline are present, then there shall be exactly\n    // one media segment\n    return [{\n      number: attributes.startNumber || 1,\n      duration: attributes.sourceDuration,\n      time: 0,\n      timeline: attributes.periodStart\n    }];\n  }\n\n  if (attributes.duration) {\n    return parseByDuration(attributes);\n  }\n\n  return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {Object[]}\n *         List of segment objects\n */\n\nvar segmentsFromTemplate = function segmentsFromTemplate(attributes, segmentTimeline) {\n  var templateValues = {\n    RepresentationID: attributes.id,\n    Bandwidth: attributes.bandwidth || 0\n  };\n  var _attributes$initializ = attributes.initialization,\n      initialization = _attributes$initializ === void 0 ? {\n    sourceURL: '',\n    range: ''\n  } : _attributes$initializ;\n  var mapSegment = urlTypeToSegment({\n    baseUrl: attributes.baseUrl,\n    source: constructTemplateUrl(initialization.sourceURL, templateValues),\n    range: initialization.range\n  });\n  var segments = parseTemplateInfo(attributes, segmentTimeline);\n  return segments.map(function (segment) {\n    templateValues.Number = segment.number;\n    templateValues.Time = segment.time;\n    var uri = constructTemplateUrl(attributes.media || '', templateValues); // See DASH spec section 5.3.9.2.2\n    // - if timescale isn't present on any level, default to 1.\n\n    var timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n    var presentationTimeOffset = attributes.presentationTimeOffset || 0;\n    var presentationTime = // Even if the @t attribute is not specified for the segment, segment.time is\n    // calculated in mpd-parser prior to this, so it's assumed to be available.\n    attributes.periodStart + (segment.time - presentationTimeOffset) / timescale;\n    var map = {\n      uri: uri,\n      timeline: segment.timeline,\n      duration: segment.duration,\n      resolvedUri: resolveUrl(attributes.baseUrl || '', uri),\n      map: mapSegment,\n      number: segment.number,\n      presentationTime: presentationTime\n    };\n    return map;\n  });\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @param {Object} segmentUrl\n *   <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nvar SegmentURLToSegmentObject = function SegmentURLToSegmentObject(attributes, segmentUrl) {\n  var baseUrl = attributes.baseUrl,\n      _attributes$initializ = attributes.initialization,\n      initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;\n  var initSegment = urlTypeToSegment({\n    baseUrl: baseUrl,\n    source: initialization.sourceURL,\n    range: initialization.range\n  });\n  var segment = urlTypeToSegment({\n    baseUrl: baseUrl,\n    source: segmentUrl.media,\n    range: segmentUrl.mediaRange\n  });\n  segment.map = initSegment;\n  return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes.  Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nvar segmentsFromList = function segmentsFromList(attributes, segmentTimeline) {\n  var duration = attributes.duration,\n      _attributes$segmentUr = attributes.segmentUrls,\n      segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr,\n      periodStart = attributes.periodStart; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n  // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n  if (!duration && !segmentTimeline || duration && segmentTimeline) {\n    throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);\n  }\n\n  var segmentUrlMap = segmentUrls.map(function (segmentUrlObject) {\n    return SegmentURLToSegmentObject(attributes, segmentUrlObject);\n  });\n  var segmentTimeInfo;\n\n  if (duration) {\n    segmentTimeInfo = parseByDuration(attributes);\n  }\n\n  if (segmentTimeline) {\n    segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n  }\n\n  var segments = segmentTimeInfo.map(function (segmentTime, index) {\n    if (segmentUrlMap[index]) {\n      var segment = segmentUrlMap[index]; // See DASH spec section 5.3.9.2.2\n      // - if timescale isn't present on any level, default to 1.\n\n      var timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n      var presentationTimeOffset = attributes.presentationTimeOffset || 0;\n      segment.timeline = segmentTime.timeline;\n      segment.duration = segmentTime.duration;\n      segment.number = segmentTime.number;\n      segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset) / timescale;\n      return segment;\n    } // Since we're mapping we should get rid of any blank segments (in case\n    // the given SegmentTimeline is handling for more elements than we have\n    // SegmentURLs for).\n\n  }).filter(function (segment) {\n    return segment;\n  });\n  return segments;\n};\n\nvar generateSegments = function generateSegments(_ref) {\n  var attributes = _ref.attributes,\n      segmentInfo = _ref.segmentInfo;\n  var segmentAttributes;\n  var segmentsFn;\n\n  if (segmentInfo.template) {\n    segmentsFn = segmentsFromTemplate;\n    segmentAttributes = merge(attributes, segmentInfo.template);\n  } else if (segmentInfo.base) {\n    segmentsFn = segmentsFromBase;\n    segmentAttributes = merge(attributes, segmentInfo.base);\n  } else if (segmentInfo.list) {\n    segmentsFn = segmentsFromList;\n    segmentAttributes = merge(attributes, segmentInfo.list);\n  }\n\n  var segmentsInfo = {\n    attributes: attributes\n  };\n\n  if (!segmentsFn) {\n    return segmentsInfo;\n  }\n\n  var segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n  // must be in seconds. Since we've generated the segment list, we no longer need\n  // @duration to be in @timescale units, so we can convert it here.\n\n  if (segmentAttributes.duration) {\n    var _segmentAttributes = segmentAttributes,\n        duration = _segmentAttributes.duration,\n        _segmentAttributes$ti = _segmentAttributes.timescale,\n        timescale = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;\n    segmentAttributes.duration = duration / timescale;\n  } else if (segments.length) {\n    // if there is no @duration attribute, use the largest segment duration as\n    // as target duration\n    segmentAttributes.duration = segments.reduce(function (max, segment) {\n      return Math.max(max, Math.ceil(segment.duration));\n    }, 0);\n  } else {\n    segmentAttributes.duration = 0;\n  }\n\n  segmentsInfo.attributes = segmentAttributes;\n  segmentsInfo.segments = segments; // This is a sidx box without actual segment information\n\n  if (segmentInfo.base && segmentAttributes.indexRange) {\n    segmentsInfo.sidx = segments[0];\n    segmentsInfo.segments = [];\n  }\n\n  return segmentsInfo;\n};\nvar toPlaylists = function toPlaylists(representations) {\n  return representations.map(generateSegments);\n};\n\nvar findChildren = function findChildren(element, name) {\n  return from(element.childNodes).filter(function (_ref) {\n    var tagName = _ref.tagName;\n    return tagName === name;\n  });\n};\nvar getContent = function getContent(element) {\n  return element.textContent.trim();\n};\n\nvar parseDuration = function parseDuration(str) {\n  var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n  var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n  var SECONDS_IN_DAY = 24 * 60 * 60;\n  var SECONDS_IN_HOUR = 60 * 60;\n  var SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n  var durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n  var match = durationRegex.exec(str);\n\n  if (!match) {\n    return 0;\n  }\n\n  var _match$slice = match.slice(1),\n      year = _match$slice[0],\n      month = _match$slice[1],\n      day = _match$slice[2],\n      hour = _match$slice[3],\n      minute = _match$slice[4],\n      second = _match$slice[5];\n\n  return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nvar parseDate = function parseDate(str) {\n  // Date format without timezone according to ISO 8601\n  // YYY-MM-DDThh:mm:ss.ssssss\n  var dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n  // expressed by ending with 'Z'\n\n  if (dateRegex.test(str)) {\n    str += 'Z';\n  }\n\n  return Date.parse(str);\n};\n\nvar parsers = {\n  /**\n   * Specifies the duration of the entire Media Presentation. Format is a duration string\n   * as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  mediaPresentationDuration: function mediaPresentationDuration(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the Segment availability start time for all Segments referred to in this\n   * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n   * time. Format is a date string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The date as seconds from unix epoch\n   */\n  availabilityStartTime: function availabilityStartTime(value) {\n    return parseDate(value) / 1000;\n  },\n\n  /**\n   * Specifies the smallest period between potential changes to the MPD. Format is a\n   * duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  minimumUpdatePeriod: function minimumUpdatePeriod(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the suggested presentation delay. Format is a\n   * duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  suggestedPresentationDelay: function suggestedPresentationDelay(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * specifices the type of mpd. Can be either \"static\" or \"dynamic\"\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   *\n   * @return {string}\n   *         The type as a string\n   */\n  type: function type(value) {\n    return value;\n  },\n\n  /**\n   * Specifies the duration of the smallest time shifting buffer for any Representation\n   * in the MPD. Format is a duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  timeShiftBufferDepth: function timeShiftBufferDepth(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n   * Format is a duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  start: function start(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the width of the visual presentation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed width\n   */\n  width: function width(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the height of the visual presentation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed height\n   */\n  height: function height(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the bitrate of the representation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed bandwidth\n   */\n  bandwidth: function bandwidth(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the number of the first Media Segment in this Representation in the Period\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed number\n   */\n  startNumber: function startNumber(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the timescale in units per seconds\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed timescale\n   */\n  timescale: function timescale(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the presentationTimeOffset.\n   *\n   * @param {string} value\n   *        value of the attribute as a string\n   *\n   * @return {number}\n   *         The parsed presentationTimeOffset\n   */\n  presentationTimeOffset: function presentationTimeOffset(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the constant approximate Segment duration\n   * NOTE: The <Period> element also contains an @duration attribute. This duration\n   *       specifies the duration of the Period. This attribute is currently not\n   *       supported by the rest of the parser, however we still check for it to prevent\n   *       errors.\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed duration\n   */\n  duration: function duration(value) {\n    var parsedValue = parseInt(value, 10);\n\n    if (isNaN(parsedValue)) {\n      return parseDuration(value);\n    }\n\n    return parsedValue;\n  },\n\n  /**\n   * Specifies the Segment duration, in units of the value of the @timescale.\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed duration\n   */\n  d: function d(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the MPD start time, in @timescale units, the first Segment in the series\n   * starts relative to the beginning of the Period\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed time\n   */\n  t: function t(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the repeat count of the number of following contiguous Segments with the\n   * same duration expressed by the value of @d\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed number\n   */\n  r: function r(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Default parser for all other attributes. Acts as a no-op and just returns the value\n   * as a string\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {string}\n   *         Unparsed value\n   */\n  DEFAULT: function DEFAULT(value) {\n    return value;\n  }\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n *        The node to parse attributes from\n * @return {Object}\n *         Object with all attributes of el parsed\n */\n\nvar parseAttributes = function parseAttributes(el) {\n  if (!(el && el.attributes)) {\n    return {};\n  }\n\n  return from(el.attributes).reduce(function (a, e) {\n    var parseFn = parsers[e.name] || parsers.DEFAULT;\n    a[e.name] = parseFn(e.value);\n    return a;\n  }, {});\n};\n\nvar keySystemsMap = {\n  'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n  'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n  'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n  'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {string[]} referenceUrls\n *        List of reference urls to resolve to\n * @param {Node[]} baseUrlElements\n *        List of BaseURL nodes from the mpd\n * @return {string[]}\n *         List of resolved urls\n */\n\nvar buildBaseUrls = function buildBaseUrls(referenceUrls, baseUrlElements) {\n  if (!baseUrlElements.length) {\n    return referenceUrls;\n  }\n\n  return flatten(referenceUrls.map(function (reference) {\n    return baseUrlElements.map(function (baseUrlElement) {\n      return resolveUrl(reference, getContent(baseUrlElement));\n    });\n  }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n *           Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} segmentTimeline\n *           Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n *           Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n *           Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n *        The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n *         The Segment information contained within the provided AdaptationSet\n */\n\nvar getSegmentInformation = function getSegmentInformation(adaptationSet) {\n  var segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n  var segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n  var segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(function (s) {\n    return merge({\n      tag: 'SegmentURL'\n    }, parseAttributes(s));\n  });\n  var segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n  var segmentTimelineParentNode = segmentList || segmentTemplate;\n  var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n  var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n  var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n  // @initialization and an <Initialization> node.  @initialization can be templated,\n  // while the node can have a url and range specified.  If the <SegmentTemplate> has\n  // both @initialization and an <Initialization> subelement we opt to override with\n  // the node, as this interaction is not defined in the spec.\n\n  var template = segmentTemplate && parseAttributes(segmentTemplate);\n\n  if (template && segmentInitialization) {\n    template.initialization = segmentInitialization && parseAttributes(segmentInitialization);\n  } else if (template && template.initialization) {\n    // If it is @initialization we convert it to an object since this is the format that\n    // later functions will rely on for the initialization segment.  This is only valid\n    // for <SegmentTemplate>\n    template.initialization = {\n      sourceURL: template.initialization\n    };\n  }\n\n  var segmentInfo = {\n    template: template,\n    segmentTimeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(function (s) {\n      return parseAttributes(s);\n    }),\n    list: segmentList && merge(parseAttributes(segmentList), {\n      segmentUrls: segmentUrls,\n      initialization: parseAttributes(segmentInitialization)\n    }),\n    base: segmentBase && merge(parseAttributes(segmentBase), {\n      initialization: parseAttributes(segmentInitialization)\n    })\n  };\n  Object.keys(segmentInfo).forEach(function (key) {\n    if (!segmentInfo[key]) {\n      delete segmentInfo[key];\n    }\n  });\n  return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n *           Segment information for this Representation\n * @property {Object} attributes\n *           Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n *        Representation node from the mpd\n * @return {RepresentationInformation}\n *         Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n *        Contains attributes inherited by the AdaptationSet\n * @param {string[]} adaptationSetBaseUrls\n *        Contains list of resolved base urls inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n *        Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n *         Callback map function\n */\n\nvar inheritBaseUrls = function inheritBaseUrls(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {\n  return function (representation) {\n    var repBaseUrlElements = findChildren(representation, 'BaseURL');\n    var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n    var attributes = merge(adaptationSetAttributes, parseAttributes(representation));\n    var representationSegmentInfo = getSegmentInformation(representation);\n    return repBaseUrls.map(function (baseUrl) {\n      return {\n        segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n        attributes: merge(attributes, {\n          baseUrl: baseUrl\n        })\n      };\n    });\n  };\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n *        Content protection nodes\n * @return {Object}\n *        Object containing pssh data by key system\n */\n\nvar generateKeySystemInformation = function generateKeySystemInformation(contentProtectionNodes) {\n  return contentProtectionNodes.reduce(function (acc, node) {\n    var attributes = parseAttributes(node); // Although it could be argued that according to the UUID RFC spec the UUID string (a-f chars) should be generated\n    // as a lowercase string it also mentions it should be treated as case-insensitive on input. Since the key system\n    // UUIDs in the keySystemsMap are hardcoded as lowercase in the codebase there isn't any reason not to do\n    // .toLowerCase() on the input UUID string from the manifest (at least I could not think of one).\n\n    if (attributes.schemeIdUri) {\n      attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();\n    }\n\n    var keySystem = keySystemsMap[attributes.schemeIdUri];\n\n    if (keySystem) {\n      acc[keySystem] = {\n        attributes: attributes\n      };\n      var psshNode = findChildren(node, 'cenc:pssh')[0];\n\n      if (psshNode) {\n        var pssh = getContent(psshNode);\n        acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);\n      }\n    }\n\n    return acc;\n  }, {});\n}; // defined in ANSI_SCTE 214-1 2016\n\n\nvar parseCaptionServiceMetadata = function parseCaptionServiceMetadata(service) {\n  // 608 captions\n  if (service.schemeIdUri === 'urn:scte:dash:cc:cea-608:2015') {\n    var values = typeof service.value !== 'string' ? [] : service.value.split(';');\n    return values.map(function (value) {\n      var channel;\n      var language; // default language to value\n\n      language = value;\n\n      if (/^CC\\d=/.test(value)) {\n        var _value$split = value.split('=');\n\n        channel = _value$split[0];\n        language = _value$split[1];\n      } else if (/^CC\\d$/.test(value)) {\n        channel = value;\n      }\n\n      return {\n        channel: channel,\n        language: language\n      };\n    });\n  } else if (service.schemeIdUri === 'urn:scte:dash:cc:cea-708:2015') {\n    var _values = typeof service.value !== 'string' ? [] : service.value.split(';');\n\n    return _values.map(function (value) {\n      var flags = {\n        // service or channel number 1-63\n        'channel': undefined,\n        // language is a 3ALPHA per ISO 639.2/B\n        // field is required\n        'language': undefined,\n        // BIT 1/0 or ?\n        // default value is 1, meaning 16:9 aspect ratio, 0 is 4:3, ? is unknown\n        'aspectRatio': 1,\n        // BIT 1/0\n        // easy reader flag indicated the text is tailed to the needs of beginning readers\n        // default 0, or off\n        'easyReader': 0,\n        // BIT 1/0\n        // If 3d metadata is present (CEA-708.1) then 1\n        // default 0\n        '3D': 0\n      };\n\n      if (/=/.test(value)) {\n        var _value$split2 = value.split('='),\n            channel = _value$split2[0],\n            _value$split2$ = _value$split2[1],\n            opts = _value$split2$ === void 0 ? '' : _value$split2$;\n\n        flags.channel = channel;\n        flags.language = value;\n        opts.split(',').forEach(function (opt) {\n          var _opt$split = opt.split(':'),\n              name = _opt$split[0],\n              val = _opt$split[1];\n\n          if (name === 'lang') {\n            flags.language = val; // er for easyReadery\n          } else if (name === 'er') {\n            flags.easyReader = Number(val); // war for wide aspect ratio\n          } else if (name === 'war') {\n            flags.aspectRatio = Number(val);\n          } else if (name === '3D') {\n            flags['3D'] = Number(val);\n          }\n        });\n      } else {\n        flags.language = value;\n      }\n\n      if (flags.channel) {\n        flags.channel = 'SERVICE' + flags.channel;\n      }\n\n      return flags;\n    });\n  }\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n *        AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n *         List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n *        Contains attributes inherited by the Period\n * @param {string[]} periodBaseUrls\n *        Contains list of resolved base urls inherited by the Period\n * @param {string[]} periodSegmentInfo\n *        Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n *         Callback map function\n */\n\nvar toRepresentations = function toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo) {\n  return function (adaptationSet) {\n    var adaptationSetAttributes = parseAttributes(adaptationSet);\n    var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n    var role = findChildren(adaptationSet, 'Role')[0];\n    var roleAttributes = {\n      role: parseAttributes(role)\n    };\n    var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n    var accessibility = findChildren(adaptationSet, 'Accessibility')[0];\n    var captionServices = parseCaptionServiceMetadata(parseAttributes(accessibility));\n\n    if (captionServices) {\n      attrs = merge(attrs, {\n        captionServices: captionServices\n      });\n    }\n\n    var label = findChildren(adaptationSet, 'Label')[0];\n\n    if (label && label.childNodes.length) {\n      var labelVal = label.childNodes[0].nodeValue.trim();\n      attrs = merge(attrs, {\n        label: labelVal\n      });\n    }\n\n    var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n    if (Object.keys(contentProtection).length) {\n      attrs = merge(attrs, {\n        contentProtection: contentProtection\n      });\n    }\n\n    var segmentInfo = getSegmentInformation(adaptationSet);\n    var representations = findChildren(adaptationSet, 'Representation');\n    var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n    return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n  };\n};\n/**\n * Contains all period information for mapping nodes onto adaptation sets.\n *\n * @typedef {Object} PeriodInformation\n * @property {Node} period.node\n *           Period node from the mpd\n * @property {Object} period.attributes\n *           Parsed period attributes from node plus any added\n */\n\n/**\n * Maps a PeriodInformation object to a list of Representation information objects for all\n * AdaptationSet nodes contained within the Period.\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {PeriodInformation} period\n *        Period object containing necessary period information\n * @param {number} periodStart\n *        Start time of the Period within the mpd\n * @return {RepresentationInformation[]}\n *         List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n *        Contains attributes inherited by the mpd\n * @param {string[]} mpdBaseUrls\n *        Contains list of resolved base urls inherited by the mpd\n * @return {toAdaptationSetsCallback}\n *         Callback map function\n */\n\nvar toAdaptationSets = function toAdaptationSets(mpdAttributes, mpdBaseUrls) {\n  return function (period, index) {\n    var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, 'BaseURL'));\n    var periodAttributes = merge(mpdAttributes, {\n      periodStart: period.attributes.start\n    });\n\n    if (typeof period.attributes.duration === 'number') {\n      periodAttributes.periodDuration = period.attributes.duration;\n    }\n\n    var adaptationSets = findChildren(period.node, 'AdaptationSet');\n    var periodSegmentInfo = getSegmentInformation(period.node);\n    return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n  };\n};\n/**\n * Gets Period@start property for a given period.\n *\n * @param {Object} options\n *        Options object\n * @param {Object} options.attributes\n *        Period attributes\n * @param {Object} [options.priorPeriodAttributes]\n *        Prior period attributes (if prior period is available)\n * @param {string} options.mpdType\n *        The MPD@type these periods came from\n * @return {number|null}\n *         The period start, or null if it's an early available period or error\n */\n\nvar getPeriodStart = function getPeriodStart(_ref) {\n  var attributes = _ref.attributes,\n      priorPeriodAttributes = _ref.priorPeriodAttributes,\n      mpdType = _ref.mpdType;\n\n  // Summary of period start time calculation from DASH spec section 5.3.2.1\n  //\n  // A period's start is the first period's start + time elapsed after playing all\n  // prior periods to this one. Periods continue one after the other in time (without\n  // gaps) until the end of the presentation.\n  //\n  // The value of Period@start should be:\n  // 1. if Period@start is present: value of Period@start\n  // 2. if previous period exists and it has @duration: previous Period@start +\n  //    previous Period@duration\n  // 3. if this is first period and MPD@type is 'static': 0\n  // 4. in all other cases, consider the period an \"early available period\" (note: not\n  //    currently supported)\n  // (1)\n  if (typeof attributes.start === 'number') {\n    return attributes.start;\n  } // (2)\n\n\n  if (priorPeriodAttributes && typeof priorPeriodAttributes.start === 'number' && typeof priorPeriodAttributes.duration === 'number') {\n    return priorPeriodAttributes.start + priorPeriodAttributes.duration;\n  } // (3)\n\n\n  if (!priorPeriodAttributes && mpdType === 'static') {\n    return 0;\n  } // (4)\n  // There is currently no logic for calculating the Period@start value if there is\n  // no Period@start or prior Period@start and Period@duration available. This is not made\n  // explicit by the DASH interop guidelines or the DASH spec, however, since there's\n  // nothing about any other resolution strategies, it's implied. Thus, this case should\n  // be considered an early available period, or error, and null should suffice for both\n  // of those cases.\n\n\n  return null;\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n *        The root node of the mpd\n * @param {Object} options\n *        Available options for inheritAttributes\n * @param {string} options.manifestUri\n *        The uri source of the mpd\n * @param {number} options.NOW\n *        Current time per DASH IOP.  Default is current time in ms since epoch\n * @param {number} options.clientOffset\n *        Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n *         List of objects containing Representation information\n */\n\nvar inheritAttributes = function inheritAttributes(mpd, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      _options$manifestUri = _options.manifestUri,\n      manifestUri = _options$manifestUri === void 0 ? '' : _options$manifestUri,\n      _options$NOW = _options.NOW,\n      NOW = _options$NOW === void 0 ? Date.now() : _options$NOW,\n      _options$clientOffset = _options.clientOffset,\n      clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;\n  var periodNodes = findChildren(mpd, 'Period');\n\n  if (!periodNodes.length) {\n    throw new Error(errors.INVALID_NUMBER_OF_PERIOD);\n  }\n\n  var locations = findChildren(mpd, 'Location');\n  var mpdAttributes = parseAttributes(mpd);\n  var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, 'BaseURL')); // See DASH spec section 5.3.1.2, Semantics of MPD element. Default type to 'static'.\n\n  mpdAttributes.type = mpdAttributes.type || 'static';\n  mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n  mpdAttributes.NOW = NOW;\n  mpdAttributes.clientOffset = clientOffset;\n\n  if (locations.length) {\n    mpdAttributes.locations = locations.map(getContent);\n  }\n\n  var periods = []; // Since toAdaptationSets acts on individual periods right now, the simplest approach to\n  // adding properties that require looking at prior periods is to parse attributes and add\n  // missing ones before toAdaptationSets is called. If more such properties are added, it\n  // may be better to refactor toAdaptationSets.\n\n  periodNodes.forEach(function (node, index) {\n    var attributes = parseAttributes(node); // Use the last modified prior period, as it may contain added information necessary\n    // for this period.\n\n    var priorPeriod = periods[index - 1];\n    attributes.start = getPeriodStart({\n      attributes: attributes,\n      priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,\n      mpdType: mpdAttributes.type\n    });\n    periods.push({\n      node: node,\n      attributes: attributes\n    });\n  });\n  return {\n    locations: mpdAttributes.locations,\n    representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)))\n  };\n};\n\nvar stringToMpdXml = function stringToMpdXml(manifestString) {\n  if (manifestString === '') {\n    throw new Error(errors.DASH_EMPTY_MANIFEST);\n  }\n\n  var parser = new DOMParser();\n  var xml;\n  var mpd;\n\n  try {\n    xml = parser.parseFromString(manifestString, 'application/xml');\n    mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n  } catch (e) {// ie 11 throwsw on invalid xml\n  }\n\n  if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n    throw new Error(errors.DASH_INVALID_XML);\n  }\n\n  return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n *        XML string of the MPD manifest\n * @return {Object|null}\n *         Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTimingScheme = function parseUTCTimingScheme(mpd) {\n  var UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n  if (!UTCTimingNode) {\n    return null;\n  }\n\n  var attributes = parseAttributes(UTCTimingNode);\n\n  switch (attributes.schemeIdUri) {\n    case 'urn:mpeg:dash:utc:http-head:2014':\n    case 'urn:mpeg:dash:utc:http-head:2012':\n      attributes.method = 'HEAD';\n      break;\n\n    case 'urn:mpeg:dash:utc:http-xsdate:2014':\n    case 'urn:mpeg:dash:utc:http-iso:2014':\n    case 'urn:mpeg:dash:utc:http-xsdate:2012':\n    case 'urn:mpeg:dash:utc:http-iso:2012':\n      attributes.method = 'GET';\n      break;\n\n    case 'urn:mpeg:dash:utc:direct:2014':\n    case 'urn:mpeg:dash:utc:direct:2012':\n      attributes.method = 'DIRECT';\n      attributes.value = Date.parse(attributes.value);\n      break;\n\n    case 'urn:mpeg:dash:utc:http-ntp:2014':\n    case 'urn:mpeg:dash:utc:ntp:2014':\n    case 'urn:mpeg:dash:utc:sntp:2014':\n    default:\n      throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n  }\n\n  return attributes;\n};\n\nvar VERSION = version;\n/*\n * Given a DASH manifest string and options, parses the DASH manifest into an object in the\n * form outputed by m3u8-parser and accepted by videojs/http-streaming.\n *\n * For live DASH manifests, if `previousManifest` is provided in options, then the newly\n * parsed DASH manifest will have its media sequence and discontinuity sequence values\n * updated to reflect its position relative to the prior manifest.\n *\n * @param {string} manifestString - the DASH manifest as a string\n * @param {options} [options] - any options\n *\n * @return {Object} the manifest object\n */\n\nvar parse = function parse(manifestString, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options);\n  var playlists = toPlaylists(parsedManifestInfo.representationInfo);\n  return toM3u8({\n    dashPlaylists: playlists,\n    locations: parsedManifestInfo.locations,\n    sidxMapping: options.sidxMapping,\n    previousManifest: options.previousManifest\n  });\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n *        XML string of the MPD manifest\n * @return {Object|null}\n *         Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\n\nvar parseUTCTiming = function parseUTCTiming(manifestString) {\n  return parseUTCTimingScheme(stringToMpdXml(manifestString));\n};\n\nexport { VERSION, addSidxSegmentsToPlaylist$1 as addSidxSegmentsToPlaylist, generateSidxKey, inheritAttributes, parse, parseUTCTiming, stringToMpdXml, toM3u8, toPlaylists };\n","/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n *        The parsed master manifest object\n * @param {string[]} groups\n *        The media groups to call the callback for\n * @param {Function} callback\n *        Callback to call for each media group\n */\nexport var forEachMediaGroup = function forEachMediaGroup(master, groups, callback) {\n  groups.forEach(function (mediaType) {\n    for (var groupKey in master.mediaGroups[mediaType]) {\n      for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n        var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n        callback(mediaProperties, mediaType, groupKey, labelKey);\n      }\n    }\n  });\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nvar ID3 = toUint8([0x49, 0x44, 0x33]);\nexport var getId3Size = function getId3Size(bytes, offset) {\n  if (offset === void 0) {\n    offset = 0;\n  }\n\n  bytes = toUint8(bytes);\n  var flags = bytes[offset + 5];\n  var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];\n  var footerPresent = (flags & 16) >> 4;\n\n  if (footerPresent) {\n    return returnSize + 20;\n  }\n\n  return returnSize + 10;\n};\nexport var getId3Offset = function getId3Offset(bytes, offset) {\n  if (offset === void 0) {\n    offset = 0;\n  }\n\n  bytes = toUint8(bytes);\n\n  if (bytes.length - offset < 10 || !bytesMatch(bytes, ID3, {\n    offset: offset\n  })) {\n    return offset;\n  }\n\n  offset += getId3Size(bytes, offset); // recursive check for id3 tags as some files\n  // have multiple ID3 tag sections even though\n  // they should not.\n\n  return getId3Offset(bytes, offset);\n};","export var OPUS_HEAD = new Uint8Array([// O, p, u, s\n0x4f, 0x70, 0x75, 0x73, // H, e, a, d\n0x48, 0x65, 0x61, 0x64]); // https://wiki.xiph.org/OggOpus\n// https://vfrmaniac.fushizen.eu/contents/opus_in_isobmff.html\n// https://opus-codec.org/docs/opusfile_api-0.7/structOpusHead.html\n\nexport var parseOpusHead = function parseOpusHead(bytes) {\n  var view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n  var version = view.getUint8(0); // version 0, from mp4, does not use littleEndian.\n\n  var littleEndian = version !== 0;\n  var config = {\n    version: version,\n    channels: view.getUint8(1),\n    preSkip: view.getUint16(2, littleEndian),\n    sampleRate: view.getUint32(4, littleEndian),\n    outputGain: view.getUint16(8, littleEndian),\n    channelMappingFamily: view.getUint8(10)\n  };\n\n  if (config.channelMappingFamily > 0 && bytes.length > 10) {\n    config.streamCount = view.getUint8(11);\n    config.twoChannelStreamCount = view.getUint8(12);\n    config.channelMapping = [];\n\n    for (var c = 0; c < config.channels; c++) {\n      config.channelMapping.push(view.getUint8(13 + c));\n    }\n  }\n\n  return config;\n};\nexport var setOpusHead = function setOpusHead(config) {\n  var size = config.channelMappingFamily <= 0 ? 11 : 12 + config.channels;\n  var view = new DataView(new ArrayBuffer(size));\n  var littleEndian = config.version !== 0;\n  view.setUint8(0, config.version);\n  view.setUint8(1, config.channels);\n  view.setUint16(2, config.preSkip, littleEndian);\n  view.setUint32(4, config.sampleRate, littleEndian);\n  view.setUint16(8, config.outputGain, littleEndian);\n  view.setUint8(10, config.channelMappingFamily);\n\n  if (config.channelMappingFamily > 0) {\n    view.setUint8(11, config.streamCount);\n    config.channelMapping.foreach(function (cm, i) {\n      view.setUint8(12 + i, cm);\n    });\n  }\n\n  return new Uint8Array(view.buffer);\n};","import { toUint8, bytesToNumber, bytesMatch, bytesToString, numberToBytes, padStart } from './byte-helpers';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js'; // relevant specs for this parser:\n// https://matroska-org.github.io/libebml/specs.html\n// https://www.matroska.org/technical/elements.html\n// https://www.webmproject.org/docs/container/\n\nexport var EBML_TAGS = {\n  EBML: toUint8([0x1A, 0x45, 0xDF, 0xA3]),\n  DocType: toUint8([0x42, 0x82]),\n  Segment: toUint8([0x18, 0x53, 0x80, 0x67]),\n  SegmentInfo: toUint8([0x15, 0x49, 0xA9, 0x66]),\n  Tracks: toUint8([0x16, 0x54, 0xAE, 0x6B]),\n  Track: toUint8([0xAE]),\n  TrackNumber: toUint8([0xd7]),\n  DefaultDuration: toUint8([0x23, 0xe3, 0x83]),\n  TrackEntry: toUint8([0xAE]),\n  TrackType: toUint8([0x83]),\n  FlagDefault: toUint8([0x88]),\n  CodecID: toUint8([0x86]),\n  CodecPrivate: toUint8([0x63, 0xA2]),\n  VideoTrack: toUint8([0xe0]),\n  AudioTrack: toUint8([0xe1]),\n  // Not used yet, but will be used for live webm/mkv\n  // see https://www.matroska.org/technical/basics.html#block-structure\n  // see https://www.matroska.org/technical/basics.html#simpleblock-structure\n  Cluster: toUint8([0x1F, 0x43, 0xB6, 0x75]),\n  Timestamp: toUint8([0xE7]),\n  TimestampScale: toUint8([0x2A, 0xD7, 0xB1]),\n  BlockGroup: toUint8([0xA0]),\n  BlockDuration: toUint8([0x9B]),\n  Block: toUint8([0xA1]),\n  SimpleBlock: toUint8([0xA3])\n};\n/**\n * This is a simple table to determine the length\n * of things in ebml. The length is one based (starts at 1,\n * rather than zero) and for every zero bit before a one bit\n * we add one to length. We also need this table because in some\n * case we have to xor all the length bits from another value.\n */\n\nvar LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];\n\nvar getLength = function getLength(byte) {\n  var len = 1;\n\n  for (var i = 0; i < LENGTH_TABLE.length; i++) {\n    if (byte & LENGTH_TABLE[i]) {\n      break;\n    }\n\n    len++;\n  }\n\n  return len;\n}; // length in ebml is stored in the first 4 to 8 bits\n// of the first byte. 4 for the id length and 8 for the\n// data size length. Length is measured by converting the number to binary\n// then 1 + the number of zeros before a 1 is encountered starting\n// from the left.\n\n\nvar getvint = function getvint(bytes, offset, removeLength, signed) {\n  if (removeLength === void 0) {\n    removeLength = true;\n  }\n\n  if (signed === void 0) {\n    signed = false;\n  }\n\n  var length = getLength(bytes[offset]);\n  var valueBytes = bytes.subarray(offset, offset + length); // NOTE that we do **not** subarray here because we need to copy these bytes\n  // as they will be modified below to remove the dataSizeLen bits and we do not\n  // want to modify the original data. normally we could just call slice on\n  // uint8array but ie 11 does not support that...\n\n  if (removeLength) {\n    valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);\n    valueBytes[0] ^= LENGTH_TABLE[length - 1];\n  }\n\n  return {\n    length: length,\n    value: bytesToNumber(valueBytes, {\n      signed: signed\n    }),\n    bytes: valueBytes\n  };\n};\n\nvar normalizePath = function normalizePath(path) {\n  if (typeof path === 'string') {\n    return path.match(/.{1,2}/g).map(function (p) {\n      return normalizePath(p);\n    });\n  }\n\n  if (typeof path === 'number') {\n    return numberToBytes(path);\n  }\n\n  return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n  if (!Array.isArray(paths)) {\n    return [normalizePath(paths)];\n  }\n\n  return paths.map(function (p) {\n    return normalizePath(p);\n  });\n};\n\nvar getInfinityDataSize = function getInfinityDataSize(id, bytes, offset) {\n  if (offset >= bytes.length) {\n    return bytes.length;\n  }\n\n  var innerid = getvint(bytes, offset, false);\n\n  if (bytesMatch(id.bytes, innerid.bytes)) {\n    return offset;\n  }\n\n  var dataHeader = getvint(bytes, offset + innerid.length);\n  return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);\n};\n/**\n * Notes on the EBLM format.\n *\n * EBLM uses \"vints\" tags. Every vint tag contains\n * two parts\n *\n * 1. The length from the first byte. You get this by\n *    converting the byte to binary and counting the zeros\n *    before a 1. Then you add 1 to that. Examples\n *    00011111 = length 4 because there are 3 zeros before a 1.\n *    00100000 = length 3 because there are 2 zeros before a 1.\n *    00000011 = length 7 because there are 6 zeros before a 1.\n *\n * 2. The bits used for length are removed from the first byte\n *    Then all the bytes are merged into a value. NOTE: this\n *    is not the case for id ebml tags as there id includes\n *    length bits.\n *\n */\n\n\nexport var findEbml = function findEbml(bytes, paths) {\n  paths = normalizePaths(paths);\n  bytes = toUint8(bytes);\n  var results = [];\n\n  if (!paths.length) {\n    return results;\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    var id = getvint(bytes, i, false);\n    var dataHeader = getvint(bytes, i + id.length);\n    var dataStart = i + id.length + dataHeader.length; // dataSize is unknown or this is a live stream\n\n    if (dataHeader.value === 0x7f) {\n      dataHeader.value = getInfinityDataSize(id, bytes, dataStart);\n\n      if (dataHeader.value !== bytes.length) {\n        dataHeader.value -= dataStart;\n      }\n    }\n\n    var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;\n    var data = bytes.subarray(dataStart, dataEnd);\n\n    if (bytesMatch(paths[0], id.bytes)) {\n      if (paths.length === 1) {\n        // this is the end of the paths and we've found the tag we were\n        // looking for\n        results.push(data);\n      } else {\n        // recursively search for the next tag inside of the data\n        // of this one\n        results = results.concat(findEbml(data, paths.slice(1)));\n      }\n    }\n\n    var totalLength = id.length + dataHeader.length + data.length; // move past this tag entirely, we are not looking for it\n\n    i += totalLength;\n  }\n\n  return results;\n}; // see https://www.matroska.org/technical/basics.html#block-structure\n\nexport var decodeBlock = function decodeBlock(block, type, timestampScale, clusterTimestamp) {\n  var duration;\n\n  if (type === 'group') {\n    duration = findEbml(block, [EBML_TAGS.BlockDuration])[0];\n\n    if (duration) {\n      duration = bytesToNumber(duration);\n      duration = 1 / timestampScale * duration * timestampScale / 1000;\n    }\n\n    block = findEbml(block, [EBML_TAGS.Block])[0];\n    type = 'block'; // treat data as a block after this point\n  }\n\n  var dv = new DataView(block.buffer, block.byteOffset, block.byteLength);\n  var trackNumber = getvint(block, 0);\n  var timestamp = dv.getInt16(trackNumber.length, false);\n  var flags = block[trackNumber.length + 2];\n  var data = block.subarray(trackNumber.length + 3); // pts/dts in seconds\n\n  var ptsdts = 1 / timestampScale * (clusterTimestamp + timestamp) * timestampScale / 1000; // return the frame\n\n  var parsed = {\n    duration: duration,\n    trackNumber: trackNumber.value,\n    keyframe: type === 'simple' && flags >> 7 === 1,\n    invisible: (flags & 0x08) >> 3 === 1,\n    lacing: (flags & 0x06) >> 1,\n    discardable: type === 'simple' && (flags & 0x01) === 1,\n    frames: [],\n    pts: ptsdts,\n    dts: ptsdts,\n    timestamp: timestamp\n  };\n\n  if (!parsed.lacing) {\n    parsed.frames.push(data);\n    return parsed;\n  }\n\n  var numberOfFrames = data[0] + 1;\n  var frameSizes = [];\n  var offset = 1; // Fixed\n\n  if (parsed.lacing === 2) {\n    var sizeOfFrame = (data.length - offset) / numberOfFrames;\n\n    for (var i = 0; i < numberOfFrames; i++) {\n      frameSizes.push(sizeOfFrame);\n    }\n  } // xiph\n\n\n  if (parsed.lacing === 1) {\n    for (var _i = 0; _i < numberOfFrames - 1; _i++) {\n      var size = 0;\n\n      do {\n        size += data[offset];\n        offset++;\n      } while (data[offset - 1] === 0xFF);\n\n      frameSizes.push(size);\n    }\n  } // ebml\n\n\n  if (parsed.lacing === 3) {\n    // first vint is unsinged\n    // after that vints are singed and\n    // based on a compounding size\n    var _size = 0;\n\n    for (var _i2 = 0; _i2 < numberOfFrames - 1; _i2++) {\n      var vint = _i2 === 0 ? getvint(data, offset) : getvint(data, offset, true, true);\n      _size += vint.value;\n      frameSizes.push(_size);\n      offset += vint.length;\n    }\n  }\n\n  frameSizes.forEach(function (size) {\n    parsed.frames.push(data.subarray(offset, offset + size));\n    offset += size;\n  });\n  return parsed;\n}; // VP9 Codec Feature Metadata (CodecPrivate)\n// https://www.webmproject.org/docs/container/\n\nvar parseVp9Private = function parseVp9Private(bytes) {\n  var i = 0;\n  var params = {};\n\n  while (i < bytes.length) {\n    var id = bytes[i] & 0x7f;\n    var len = bytes[i + 1];\n    var val = void 0;\n\n    if (len === 1) {\n      val = bytes[i + 2];\n    } else {\n      val = bytes.subarray(i + 2, i + 2 + len);\n    }\n\n    if (id === 1) {\n      params.profile = val;\n    } else if (id === 2) {\n      params.level = val;\n    } else if (id === 3) {\n      params.bitDepth = val;\n    } else if (id === 4) {\n      params.chromaSubsampling = val;\n    } else {\n      params[id] = val;\n    }\n\n    i += 2 + len;\n  }\n\n  return params;\n};\n\nexport var parseTracks = function parseTracks(bytes) {\n  bytes = toUint8(bytes);\n  var decodedTracks = [];\n  var tracks = findEbml(bytes, [EBML_TAGS.Segment, EBML_TAGS.Tracks, EBML_TAGS.Track]);\n\n  if (!tracks.length) {\n    tracks = findEbml(bytes, [EBML_TAGS.Tracks, EBML_TAGS.Track]);\n  }\n\n  if (!tracks.length) {\n    tracks = findEbml(bytes, [EBML_TAGS.Track]);\n  }\n\n  if (!tracks.length) {\n    return decodedTracks;\n  }\n\n  tracks.forEach(function (track) {\n    var trackType = findEbml(track, EBML_TAGS.TrackType)[0];\n\n    if (!trackType || !trackType.length) {\n      return;\n    } // 1 is video, 2 is audio, 17 is subtitle\n    // other values are unimportant in this context\n\n\n    if (trackType[0] === 1) {\n      trackType = 'video';\n    } else if (trackType[0] === 2) {\n      trackType = 'audio';\n    } else if (trackType[0] === 17) {\n      trackType = 'subtitle';\n    } else {\n      return;\n    } // todo parse language\n\n\n    var decodedTrack = {\n      rawCodec: bytesToString(findEbml(track, [EBML_TAGS.CodecID])[0]),\n      type: trackType,\n      codecPrivate: findEbml(track, [EBML_TAGS.CodecPrivate])[0],\n      number: bytesToNumber(findEbml(track, [EBML_TAGS.TrackNumber])[0]),\n      defaultDuration: bytesToNumber(findEbml(track, [EBML_TAGS.DefaultDuration])[0]),\n      default: findEbml(track, [EBML_TAGS.FlagDefault])[0],\n      rawData: track\n    };\n    var codec = '';\n\n    if (/V_MPEG4\\/ISO\\/AVC/.test(decodedTrack.rawCodec)) {\n      codec = \"avc1.\" + getAvcCodec(decodedTrack.codecPrivate);\n    } else if (/V_MPEGH\\/ISO\\/HEVC/.test(decodedTrack.rawCodec)) {\n      codec = \"hev1.\" + getHvcCodec(decodedTrack.codecPrivate);\n    } else if (/V_MPEG4\\/ISO\\/ASP/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        codec = 'mp4v.20.' + decodedTrack.codecPrivate[4].toString();\n      } else {\n        codec = 'mp4v.20.9';\n      }\n    } else if (/^V_THEORA/.test(decodedTrack.rawCodec)) {\n      codec = 'theora';\n    } else if (/^V_VP8/.test(decodedTrack.rawCodec)) {\n      codec = 'vp8';\n    } else if (/^V_VP9/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        var _parseVp9Private = parseVp9Private(decodedTrack.codecPrivate),\n            profile = _parseVp9Private.profile,\n            level = _parseVp9Private.level,\n            bitDepth = _parseVp9Private.bitDepth,\n            chromaSubsampling = _parseVp9Private.chromaSubsampling;\n\n        codec = 'vp09.';\n        codec += padStart(profile, 2, '0') + \".\";\n        codec += padStart(level, 2, '0') + \".\";\n        codec += padStart(bitDepth, 2, '0') + \".\";\n        codec += \"\" + padStart(chromaSubsampling, 2, '0'); // Video -> Colour -> Ebml name\n\n        var matrixCoefficients = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB1]])[0] || [];\n        var videoFullRangeFlag = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB9]])[0] || [];\n        var transferCharacteristics = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBA]])[0] || [];\n        var colourPrimaries = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBB]])[0] || []; // if we find any optional codec parameter specify them all.\n\n        if (matrixCoefficients.length || videoFullRangeFlag.length || transferCharacteristics.length || colourPrimaries.length) {\n          codec += \".\" + padStart(colourPrimaries[0], 2, '0');\n          codec += \".\" + padStart(transferCharacteristics[0], 2, '0');\n          codec += \".\" + padStart(matrixCoefficients[0], 2, '0');\n          codec += \".\" + padStart(videoFullRangeFlag[0], 2, '0');\n        }\n      } else {\n        codec = 'vp9';\n      }\n    } else if (/^V_AV1/.test(decodedTrack.rawCodec)) {\n      codec = \"av01.\" + getAv1Codec(decodedTrack.codecPrivate);\n    } else if (/A_ALAC/.test(decodedTrack.rawCodec)) {\n      codec = 'alac';\n    } else if (/A_MPEG\\/L2/.test(decodedTrack.rawCodec)) {\n      codec = 'mp2';\n    } else if (/A_MPEG\\/L3/.test(decodedTrack.rawCodec)) {\n      codec = 'mp3';\n    } else if (/^A_AAC/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        codec = 'mp4a.40.' + (decodedTrack.codecPrivate[0] >>> 3).toString();\n      } else {\n        codec = 'mp4a.40.2';\n      }\n    } else if (/^A_AC3/.test(decodedTrack.rawCodec)) {\n      codec = 'ac-3';\n    } else if (/^A_PCM/.test(decodedTrack.rawCodec)) {\n      codec = 'pcm';\n    } else if (/^A_MS\\/ACM/.test(decodedTrack.rawCodec)) {\n      codec = 'speex';\n    } else if (/^A_EAC3/.test(decodedTrack.rawCodec)) {\n      codec = 'ec-3';\n    } else if (/^A_VORBIS/.test(decodedTrack.rawCodec)) {\n      codec = 'vorbis';\n    } else if (/^A_FLAC/.test(decodedTrack.rawCodec)) {\n      codec = 'flac';\n    } else if (/^A_OPUS/.test(decodedTrack.rawCodec)) {\n      codec = 'opus';\n    }\n\n    decodedTrack.codec = codec;\n    decodedTracks.push(decodedTrack);\n  });\n  return decodedTracks.sort(function (a, b) {\n    return a.number - b.number;\n  });\n};\nexport var parseData = function parseData(data, tracks) {\n  var allBlocks = [];\n  var segment = findEbml(data, [EBML_TAGS.Segment])[0];\n  var timestampScale = findEbml(segment, [EBML_TAGS.SegmentInfo, EBML_TAGS.TimestampScale])[0]; // in nanoseconds, defaults to 1ms\n\n  if (timestampScale && timestampScale.length) {\n    timestampScale = bytesToNumber(timestampScale);\n  } else {\n    timestampScale = 1000000;\n  }\n\n  var clusters = findEbml(segment, [EBML_TAGS.Cluster]);\n\n  if (!tracks) {\n    tracks = parseTracks(segment);\n  }\n\n  clusters.forEach(function (cluster, ci) {\n    var simpleBlocks = findEbml(cluster, [EBML_TAGS.SimpleBlock]).map(function (b) {\n      return {\n        type: 'simple',\n        data: b\n      };\n    });\n    var blockGroups = findEbml(cluster, [EBML_TAGS.BlockGroup]).map(function (b) {\n      return {\n        type: 'group',\n        data: b\n      };\n    });\n    var timestamp = findEbml(cluster, [EBML_TAGS.Timestamp])[0] || 0;\n\n    if (timestamp && timestamp.length) {\n      timestamp = bytesToNumber(timestamp);\n    } // get all blocks then sort them into the correct order\n\n\n    var blocks = simpleBlocks.concat(blockGroups).sort(function (a, b) {\n      return a.data.byteOffset - b.data.byteOffset;\n    });\n    blocks.forEach(function (block, bi) {\n      var decoded = decodeBlock(block.data, block.type, timestampScale, timestamp);\n      allBlocks.push(decoded);\n    });\n  });\n  return {\n    tracks: tracks,\n    blocks: allBlocks\n  };\n};","import { bytesMatch, toUint8 } from './byte-helpers.js';\nexport var NAL_TYPE_ONE = toUint8([0x00, 0x00, 0x00, 0x01]);\nexport var NAL_TYPE_TWO = toUint8([0x00, 0x00, 0x01]);\nexport var EMULATION_PREVENTION = toUint8([0x00, 0x00, 0x03]);\n/**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n *\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\nexport var discardEmulationPreventionBytes = function discardEmulationPreventionBytes(bytes) {\n  var positions = [];\n  var i = 1; // Find all `Emulation Prevention Bytes`\n\n  while (i < bytes.length - 2) {\n    if (bytesMatch(bytes.subarray(i, i + 3), EMULATION_PREVENTION)) {\n      positions.push(i + 2);\n      i++;\n    }\n\n    i++;\n  } // If no Emulation Prevention Bytes were found just return the original\n  // array\n\n\n  if (positions.length === 0) {\n    return bytes;\n  } // Create a new array to hold the NAL unit data\n\n\n  var newLength = bytes.length - positions.length;\n  var newData = new Uint8Array(newLength);\n  var sourceIndex = 0;\n\n  for (i = 0; i < newLength; sourceIndex++, i++) {\n    if (sourceIndex === positions[0]) {\n      // Skip this byte\n      sourceIndex++; // Remove this position index\n\n      positions.shift();\n    }\n\n    newData[i] = bytes[sourceIndex];\n  }\n\n  return newData;\n};\nexport var findNal = function findNal(bytes, dataType, types, nalLimit) {\n  if (nalLimit === void 0) {\n    nalLimit = Infinity;\n  }\n\n  bytes = toUint8(bytes);\n  types = [].concat(types);\n  var i = 0;\n  var nalStart;\n  var nalsFound = 0; // keep searching until:\n  // we reach the end of bytes\n  // we reach the maximum number of nals they want to seach\n  // NOTE: that we disregard nalLimit when we have found the start\n  // of the nal we want so that we can find the end of the nal we want.\n\n  while (i < bytes.length && (nalsFound < nalLimit || nalStart)) {\n    var nalOffset = void 0;\n\n    if (bytesMatch(bytes.subarray(i), NAL_TYPE_ONE)) {\n      nalOffset = 4;\n    } else if (bytesMatch(bytes.subarray(i), NAL_TYPE_TWO)) {\n      nalOffset = 3;\n    } // we are unsynced,\n    // find the next nal unit\n\n\n    if (!nalOffset) {\n      i++;\n      continue;\n    }\n\n    nalsFound++;\n\n    if (nalStart) {\n      return discardEmulationPreventionBytes(bytes.subarray(nalStart, i));\n    }\n\n    var nalType = void 0;\n\n    if (dataType === 'h264') {\n      nalType = bytes[i + nalOffset] & 0x1f;\n    } else if (dataType === 'h265') {\n      nalType = bytes[i + nalOffset] >> 1 & 0x3f;\n    }\n\n    if (types.indexOf(nalType) !== -1) {\n      nalStart = i + nalOffset;\n    } // nal header is 1 length for h264, and 2 for h265\n\n\n    i += nalOffset + (dataType === 'h264' ? 1 : 2);\n  }\n\n  return bytes.subarray(0, 0);\n};\nexport var findH264Nal = function findH264Nal(bytes, type, nalLimit) {\n  return findNal(bytes, 'h264', type, nalLimit);\n};\nexport var findH265Nal = function findH265Nal(bytes, type, nalLimit) {\n  return findNal(bytes, 'h265', type, nalLimit);\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nimport { findBox } from './mp4-helpers.js';\nimport { findEbml, EBML_TAGS } from './ebml-helpers.js';\nimport { getId3Offset } from './id3-helpers.js';\nimport { findH264Nal, findH265Nal } from './nal-helpers.js';\nvar CONSTANTS = {\n  // \"webm\" string literal in hex\n  'webm': toUint8([0x77, 0x65, 0x62, 0x6d]),\n  // \"matroska\" string literal in hex\n  'matroska': toUint8([0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61]),\n  // \"fLaC\" string literal in hex\n  'flac': toUint8([0x66, 0x4c, 0x61, 0x43]),\n  // \"OggS\" string literal in hex\n  'ogg': toUint8([0x4f, 0x67, 0x67, 0x53]),\n  // ac-3 sync byte, also works for ec-3 as that is simply a codec\n  // of ac-3\n  'ac3': toUint8([0x0b, 0x77]),\n  // \"RIFF\" string literal in hex used for wav and avi\n  'riff': toUint8([0x52, 0x49, 0x46, 0x46]),\n  // \"AVI\" string literal in hex\n  'avi': toUint8([0x41, 0x56, 0x49]),\n  // \"WAVE\" string literal in hex\n  'wav': toUint8([0x57, 0x41, 0x56, 0x45]),\n  // \"ftyp3g\" string literal in hex\n  '3gp': toUint8([0x66, 0x74, 0x79, 0x70, 0x33, 0x67]),\n  // \"ftyp\" string literal in hex\n  'mp4': toUint8([0x66, 0x74, 0x79, 0x70]),\n  // \"styp\" string literal in hex\n  'fmp4': toUint8([0x73, 0x74, 0x79, 0x70]),\n  // \"ftypqt\" string literal in hex\n  'mov': toUint8([0x66, 0x74, 0x79, 0x70, 0x71, 0x74]),\n  // moov string literal in hex\n  'moov': toUint8([0x6D, 0x6F, 0x6F, 0x76]),\n  // moof string literal in hex\n  'moof': toUint8([0x6D, 0x6F, 0x6F, 0x66])\n};\nvar _isLikely = {\n  aac: function aac(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, [0xFF, 0x10], {\n      offset: offset,\n      mask: [0xFF, 0x16]\n    });\n  },\n  mp3: function mp3(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, [0xFF, 0x02], {\n      offset: offset,\n      mask: [0xFF, 0x06]\n    });\n  },\n  webm: function webm(bytes) {\n    var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is webm\n\n    return bytesMatch(docType, CONSTANTS.webm);\n  },\n  mkv: function mkv(bytes) {\n    var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is matroska\n\n    return bytesMatch(docType, CONSTANTS.matroska);\n  },\n  mp4: function mp4(bytes) {\n    // if this file is another base media file format, it is not mp4\n    if (_isLikely['3gp'](bytes) || _isLikely.mov(bytes)) {\n      return false;\n    } // if this file starts with a ftyp or styp box its mp4\n\n\n    if (bytesMatch(bytes, CONSTANTS.mp4, {\n      offset: 4\n    }) || bytesMatch(bytes, CONSTANTS.fmp4, {\n      offset: 4\n    })) {\n      return true;\n    } // if this file starts with a moof/moov box its mp4\n\n\n    if (bytesMatch(bytes, CONSTANTS.moof, {\n      offset: 4\n    }) || bytesMatch(bytes, CONSTANTS.moov, {\n      offset: 4\n    })) {\n      return true;\n    }\n  },\n  mov: function mov(bytes) {\n    return bytesMatch(bytes, CONSTANTS.mov, {\n      offset: 4\n    });\n  },\n  '3gp': function gp(bytes) {\n    return bytesMatch(bytes, CONSTANTS['3gp'], {\n      offset: 4\n    });\n  },\n  ac3: function ac3(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, CONSTANTS.ac3, {\n      offset: offset\n    });\n  },\n  ts: function ts(bytes) {\n    if (bytes.length < 189 && bytes.length >= 1) {\n      return bytes[0] === 0x47;\n    }\n\n    var i = 0; // check the first 376 bytes for two matching sync bytes\n\n    while (i + 188 < bytes.length && i < 188) {\n      if (bytes[i] === 0x47 && bytes[i + 188] === 0x47) {\n        return true;\n      }\n\n      i += 1;\n    }\n\n    return false;\n  },\n  flac: function flac(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, CONSTANTS.flac, {\n      offset: offset\n    });\n  },\n  ogg: function ogg(bytes) {\n    return bytesMatch(bytes, CONSTANTS.ogg);\n  },\n  avi: function avi(bytes) {\n    return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.avi, {\n      offset: 8\n    });\n  },\n  wav: function wav(bytes) {\n    return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.wav, {\n      offset: 8\n    });\n  },\n  'h264': function h264(bytes) {\n    // find seq_parameter_set_rbsp\n    return findH264Nal(bytes, 7, 3).length;\n  },\n  'h265': function h265(bytes) {\n    // find video_parameter_set_rbsp or seq_parameter_set_rbsp\n    return findH265Nal(bytes, [32, 33], 3).length;\n  }\n}; // get all the isLikely functions\n// but make sure 'ts' is above h264 and h265\n// but below everything else as it is the least specific\n\nvar isLikelyTypes = Object.keys(_isLikely) // remove ts, h264, h265\n.filter(function (t) {\n  return t !== 'ts' && t !== 'h264' && t !== 'h265';\n}) // add it back to the bottom\n.concat(['ts', 'h264', 'h265']); // make sure we are dealing with uint8 data.\n\nisLikelyTypes.forEach(function (type) {\n  var isLikelyFn = _isLikely[type];\n\n  _isLikely[type] = function (bytes) {\n    return isLikelyFn(toUint8(bytes));\n  };\n}); // export after wrapping\n\nexport var isLikely = _isLikely; // A useful list of file signatures can be found here\n// https://en.wikipedia.org/wiki/List_of_file_signatures\n\nexport var detectContainerForBytes = function detectContainerForBytes(bytes) {\n  bytes = toUint8(bytes);\n\n  for (var i = 0; i < isLikelyTypes.length; i++) {\n    var type = isLikelyTypes[i];\n\n    if (isLikely[type](bytes)) {\n      return type;\n    }\n  }\n\n  return '';\n}; // fmp4 is not a container\n\nexport var isLikelyFmp4MediaSegment = function isLikelyFmp4MediaSegment(bytes) {\n  return findBox(bytes, ['moof']).length > 0;\n};","/**\n * @license\n * Video.js 7.20.3 <http://videojs.com/>\n * Copyright Brightcove, Inc. <https://www.brightcove.com/>\n * Available under Apache License Version 2.0\n * <https://github.com/videojs/video.js/blob/main/LICENSE>\n *\n * Includes vtt.js <https://github.com/mozilla/vtt.js>\n * Available under Apache License Version 2.0\n * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>\n */\n\nimport window$1 from 'global/window';\nimport document from 'global/document';\nimport _extends from '@babel/runtime/helpers/extends';\nimport keycode from 'keycode';\nimport _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport XHR from '@videojs/xhr';\nimport vtt from 'videojs-vtt.js';\nimport _construct from '@babel/runtime/helpers/construct';\nimport _inherits from '@babel/runtime/helpers/inherits';\nimport _resolveUrl from '@videojs/vhs-utils/es/resolve-url.js';\nimport { Parser } from 'm3u8-parser';\nimport { browserSupportsCodec, DEFAULT_VIDEO_CODEC, DEFAULT_AUDIO_CODEC, muxerSupportsCodec, parseCodecs, translateLegacyCodec, codecsFromDefault, getMimeForCodec, isAudioCodec } from '@videojs/vhs-utils/es/codecs.js';\nimport { simpleTypeFromSourceType } from '@videojs/vhs-utils/es/media-types.js';\nimport { isArrayBufferView, concatTypedArrays, stringToBytes, toUint8 } from '@videojs/vhs-utils/es/byte-helpers';\nimport { generateSidxKey, parseUTCTiming, parse, addSidxSegmentsToPlaylist } from 'mpd-parser';\nimport parseSidx from 'mux.js/lib/tools/parse-sidx';\nimport { getId3Offset } from '@videojs/vhs-utils/es/id3-helpers';\nimport { detectContainerForBytes, isLikelyFmp4MediaSegment } from '@videojs/vhs-utils/es/containers';\nimport { ONE_SECOND_IN_TS } from 'mux.js/lib/utils/clock';\n\nvar version$5 = \"7.20.3\";\n\n/**\n * An Object that contains lifecycle hooks as keys which point to an array\n * of functions that are run when a lifecycle is triggered\n *\n * @private\n */\nvar hooks_ = {};\n/**\n * Get a list of hooks for a specific lifecycle\n *\n * @param  {string} type\n *         the lifecyle to get hooks from\n *\n * @param  {Function|Function[]} [fn]\n *         Optionally add a hook (or hooks) to the lifecycle that your are getting.\n *\n * @return {Array}\n *         an array of hooks, or an empty array if there are none.\n */\n\nvar hooks = function hooks(type, fn) {\n  hooks_[type] = hooks_[type] || [];\n\n  if (fn) {\n    hooks_[type] = hooks_[type].concat(fn);\n  }\n\n  return hooks_[type];\n};\n/**\n * Add a function hook to a specific videojs lifecycle.\n *\n * @param {string} type\n *        the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n *        The function or array of functions to attach.\n */\n\n\nvar hook = function hook(type, fn) {\n  hooks(type, fn);\n};\n/**\n * Remove a hook from a specific videojs lifecycle.\n *\n * @param  {string} type\n *         the lifecycle that the function hooked to\n *\n * @param  {Function} fn\n *         The hooked function to remove\n *\n * @return {boolean}\n *         The function that was removed or undef\n */\n\n\nvar removeHook = function removeHook(type, fn) {\n  var index = hooks(type).indexOf(fn);\n\n  if (index <= -1) {\n    return false;\n  }\n\n  hooks_[type] = hooks_[type].slice();\n  hooks_[type].splice(index, 1);\n  return true;\n};\n/**\n * Add a function hook that will only run once to a specific videojs lifecycle.\n *\n * @param {string} type\n *        the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n *        The function or array of functions to attach.\n */\n\n\nvar hookOnce = function hookOnce(type, fn) {\n  hooks(type, [].concat(fn).map(function (original) {\n    var wrapper = function wrapper() {\n      removeHook(type, wrapper);\n      return original.apply(void 0, arguments);\n    };\n\n    return wrapper;\n  }));\n};\n\n/**\n * @file fullscreen-api.js\n * @module fullscreen-api\n * @private\n */\n/**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\n\nvar FullscreenApi = {\n  prefixed: true\n}; // browser API methods\n\nvar apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'], // WebKit\n['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'], // Mozilla\n['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'], // Microsoft\n['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen']];\nvar specApi = apiMap[0];\nvar browserApi; // determine the supported set of functions\n\nfor (var i = 0; i < apiMap.length; i++) {\n  // check for exitFullscreen function\n  if (apiMap[i][1] in document) {\n    browserApi = apiMap[i];\n    break;\n  }\n} // map the browser API names to the spec API names\n\n\nif (browserApi) {\n  for (var _i = 0; _i < browserApi.length; _i++) {\n    FullscreenApi[specApi[_i]] = browserApi[_i];\n  }\n\n  FullscreenApi.prefixed = browserApi[0] !== specApi[0];\n}\n\n/**\n * @file create-logger.js\n * @module create-logger\n */\n\nvar history = [];\n/**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param  {string} type\n *         The name of the console method to use.\n *\n * @param  {Array} args\n *         The arguments to be passed to the matching console method.\n */\n\nvar LogByTypeFactory = function LogByTypeFactory(name, log) {\n  return function (type, level, args) {\n    var lvl = log.levels[level];\n    var lvlRegExp = new RegExp(\"^(\" + lvl + \")$\");\n\n    if (type !== 'log') {\n      // Add the type to the front of the message when it's not \"log\".\n      args.unshift(type.toUpperCase() + ':');\n    } // Add console prefix after adding to history.\n\n\n    args.unshift(name + ':'); // Add a clone of the args at this point to history.\n\n    if (history) {\n      history.push([].concat(args)); // only store 1000 history entries\n\n      var splice = history.length - 1000;\n      history.splice(0, splice > 0 ? splice : 0);\n    } // If there's no console then don't try to output messages, but they will\n    // still be stored in history.\n\n\n    if (!window$1.console) {\n      return;\n    } // Was setting these once outside of this function, but containing them\n    // in the function makes it easier to test cases where console doesn't exist\n    // when the module is executed.\n\n\n    var fn = window$1.console[type];\n\n    if (!fn && type === 'debug') {\n      // Certain browsers don't have support for console.debug. For those, we\n      // should default to the closest comparable log.\n      fn = window$1.console.info || window$1.console.log;\n    } // Bail out if there's no console or if this type is not allowed by the\n    // current logging level.\n\n\n    if (!fn || !lvl || !lvlRegExp.test(type)) {\n      return;\n    }\n\n    fn[Array.isArray(args) ? 'apply' : 'call'](window$1.console, args);\n  };\n};\n\nfunction createLogger$1(name) {\n  // This is the private tracking variable for logging level.\n  var level = 'info'; // the curried logByType bound to the specific log and history\n\n  var logByType;\n  /**\n   * Logs plain debug messages. Similar to `console.log`.\n   *\n   * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n   * of our JSDoc template, we cannot properly document this as both a function\n   * and a namespace, so its function signature is documented here.\n   *\n   * #### Arguments\n   * ##### *args\n   * Mixed[]\n   *\n   * Any combination of values that could be passed to `console.log()`.\n   *\n   * #### Return Value\n   *\n   * `undefined`\n   *\n   * @namespace\n   * @param    {Mixed[]} args\n   *           One or more messages or objects that should be logged.\n   */\n\n  var log = function log() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    logByType('log', level, args);\n  }; // This is the logByType helper that the logging methods below use\n\n\n  logByType = LogByTypeFactory(name, log);\n  /**\n   * Create a new sublogger which chains the old name to the new name.\n   *\n   * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n   * ```js\n   *  mylogger('foo');\n   *  // > VIDEOJS: player: foo\n   * ```\n   *\n   * @param {string} name\n   *        The name to add call the new logger\n   * @return {Object}\n   */\n\n  log.createLogger = function (subname) {\n    return createLogger$1(name + ': ' + subname);\n  };\n  /**\n   * Enumeration of available logging levels, where the keys are the level names\n   * and the values are `|`-separated strings containing logging methods allowed\n   * in that logging level. These strings are used to create a regular expression\n   * matching the function name being called.\n   *\n   * Levels provided by Video.js are:\n   *\n   * - `off`: Matches no calls. Any value that can be cast to `false` will have\n   *   this effect. The most restrictive.\n   * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n   *   `log.warn`, and `log.error`).\n   * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n   * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n   * - `warn`: Matches `log.warn` and `log.error` calls.\n   * - `error`: Matches only `log.error` calls.\n   *\n   * @type {Object}\n   */\n\n\n  log.levels = {\n    all: 'debug|log|warn|error',\n    off: '',\n    debug: 'debug|log|warn|error',\n    info: 'log|warn|error',\n    warn: 'warn|error',\n    error: 'error',\n    DEFAULT: level\n  };\n  /**\n   * Get or set the current logging level.\n   *\n   * If a string matching a key from {@link module:log.levels} is provided, acts\n   * as a setter.\n   *\n   * @param  {string} [lvl]\n   *         Pass a valid level to set a new logging level.\n   *\n   * @return {string}\n   *         The current logging level.\n   */\n\n  log.level = function (lvl) {\n    if (typeof lvl === 'string') {\n      if (!log.levels.hasOwnProperty(lvl)) {\n        throw new Error(\"\\\"\" + lvl + \"\\\" in not a valid log level\");\n      }\n\n      level = lvl;\n    }\n\n    return level;\n  };\n  /**\n   * Returns an array containing everything that has been logged to the history.\n   *\n   * This array is a shallow clone of the internal history record. However, its\n   * contents are _not_ cloned; so, mutating objects inside this array will\n   * mutate them in history.\n   *\n   * @return {Array}\n   */\n\n\n  log.history = function () {\n    return history ? [].concat(history) : [];\n  };\n  /**\n   * Allows you to filter the history by the given logger name\n   *\n   * @param {string} fname\n   *        The name to filter by\n   *\n   * @return {Array}\n   *         The filtered list to return\n   */\n\n\n  log.history.filter = function (fname) {\n    return (history || []).filter(function (historyItem) {\n      // if the first item in each historyItem includes `fname`, then it's a match\n      return new RegExp(\".*\" + fname + \".*\").test(historyItem[0]);\n    });\n  };\n  /**\n   * Clears the internal history tracking, but does not prevent further history\n   * tracking.\n   */\n\n\n  log.history.clear = function () {\n    if (history) {\n      history.length = 0;\n    }\n  };\n  /**\n   * Disable history tracking if it is currently enabled.\n   */\n\n\n  log.history.disable = function () {\n    if (history !== null) {\n      history.length = 0;\n      history = null;\n    }\n  };\n  /**\n   * Enable history tracking if it is currently disabled.\n   */\n\n\n  log.history.enable = function () {\n    if (history === null) {\n      history = [];\n    }\n  };\n  /**\n   * Logs error messages. Similar to `console.error`.\n   *\n   * @param {Mixed[]} args\n   *        One or more messages or objects that should be logged as an error\n   */\n\n\n  log.error = function () {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    return logByType('error', level, args);\n  };\n  /**\n   * Logs warning messages. Similar to `console.warn`.\n   *\n   * @param {Mixed[]} args\n   *        One or more messages or objects that should be logged as a warning.\n   */\n\n\n  log.warn = function () {\n    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      args[_key3] = arguments[_key3];\n    }\n\n    return logByType('warn', level, args);\n  };\n  /**\n   * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n   * log if `console.debug` is not available\n   *\n   * @param {Mixed[]} args\n   *        One or more messages or objects that should be logged as debug.\n   */\n\n\n  log.debug = function () {\n    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n      args[_key4] = arguments[_key4];\n    }\n\n    return logByType('debug', level, args);\n  };\n\n  return log;\n}\n\n/**\n * @file log.js\n * @module log\n */\nvar log$1 = createLogger$1('VIDEOJS');\nvar createLogger = log$1.createLogger;\n\n/**\n * @file obj.js\n * @module obj\n */\n\n/**\n * @callback obj:EachCallback\n *\n * @param {Mixed} value\n *        The current key for the object that is being iterated over.\n *\n * @param {string} key\n *        The current key-value for object that is being iterated over\n */\n\n/**\n * @callback obj:ReduceCallback\n *\n * @param {Mixed} accum\n *        The value that is accumulating over the reduce loop.\n *\n * @param {Mixed} value\n *        The current key for the object that is being iterated over.\n *\n * @param {string} key\n *        The current key-value for object that is being iterated over\n *\n * @return {Mixed}\n *         The new accumulated value.\n */\nvar toString = Object.prototype.toString;\n/**\n * Get the keys of an Object\n *\n * @param {Object}\n *        The Object to get the keys from\n *\n * @return {string[]}\n *         An array of the keys from the object. Returns an empty array if the\n *         object passed in was invalid or had no keys.\n *\n * @private\n */\n\nvar keys = function keys(object) {\n  return isObject(object) ? Object.keys(object) : [];\n};\n/**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n *        The object to iterate over\n *\n * @param {obj:EachCallback} fn\n *        The callback function which is called for each key in the object.\n */\n\n\nfunction each(object, fn) {\n  keys(object).forEach(function (key) {\n    return fn(object[key], key);\n  });\n}\n/**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n *        The Object that you want to reduce.\n *\n * @param {Function} fn\n *         A callback function which is called for each key in the object. It\n *         receives the accumulated value and the per-iteration value and key\n *         as arguments.\n *\n * @param {Mixed} [initial = 0]\n *        Starting value\n *\n * @return {Mixed}\n *         The final accumulated value.\n */\n\nfunction reduce(object, fn, initial) {\n  if (initial === void 0) {\n    initial = 0;\n  }\n\n  return keys(object).reduce(function (accum, key) {\n    return fn(accum, object[key], key);\n  }, initial);\n}\n/**\n * Object.assign-style object shallow merge/extend.\n *\n * @param  {Object} target\n * @param  {Object} ...sources\n * @return {Object}\n */\n\nfunction assign(target) {\n  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n    sources[_key - 1] = arguments[_key];\n  }\n\n  if (Object.assign) {\n    return _extends.apply(void 0, [target].concat(sources));\n  }\n\n  sources.forEach(function (source) {\n    if (!source) {\n      return;\n    }\n\n    each(source, function (value, key) {\n      target[key] = value;\n    });\n  });\n  return target;\n}\n/**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param  {Object} value\n * @return {boolean}\n */\n\nfunction isObject(value) {\n  return !!value && typeof value === 'object';\n}\n/**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param  {Object} value\n * @return {boolean}\n */\n\nfunction isPlain(value) {\n  return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object;\n}\n\n/**\n * @file computed-style.js\n * @module computed-style\n */\n/**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @function\n * @param    {Element} el\n *           The element you want the computed style of\n *\n * @param    {string} prop\n *           The property name you want\n *\n * @see      https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\n\nfunction computedStyle(el, prop) {\n  if (!el || !prop) {\n    return '';\n  }\n\n  if (typeof window$1.getComputedStyle === 'function') {\n    var computedStyleValue;\n\n    try {\n      computedStyleValue = window$1.getComputedStyle(el);\n    } catch (e) {\n      return '';\n    }\n\n    return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : '';\n  }\n\n  return '';\n}\n\n/**\n * @file browser.js\n * @module browser\n */\nvar USER_AGENT = window$1.navigator && window$1.navigator.userAgent || '';\nvar webkitVersionMap = /AppleWebKit\\/([\\d.]+)/i.exec(USER_AGENT);\nvar appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n/**\n * Whether or not this device is an iPod.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPOD = /iPod/i.test(USER_AGENT);\n/**\n * The detected iOS version - or `null`.\n *\n * @static\n * @const\n * @type {string|null}\n */\n\nvar IOS_VERSION = function () {\n  var match = USER_AGENT.match(/OS (\\d+)_/i);\n\n  if (match && match[1]) {\n    return match[1];\n  }\n\n  return null;\n}();\n/**\n * Whether or not this is an Android device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANDROID = /Android/i.test(USER_AGENT);\n/**\n * The detected Android version - or `null`.\n *\n * @static\n * @const\n * @type {number|string|null}\n */\n\nvar ANDROID_VERSION = function () {\n  // This matches Android Major.Minor.Patch versions\n  // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n  var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n\n  if (!match) {\n    return null;\n  }\n\n  var major = match[1] && parseFloat(match[1]);\n  var minor = match[2] && parseFloat(match[2]);\n\n  if (major && minor) {\n    return parseFloat(match[1] + '.' + match[2]);\n  } else if (major) {\n    return major;\n  }\n\n  return null;\n}();\n/**\n * Whether or not this is a native Android browser.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n/**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n/**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_EDGE = /Edg/i.test(USER_AGENT);\n/**\n * Whether or not this is Google Chrome.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));\n/**\n * The detected Google Chrome version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar CHROME_VERSION = function () {\n  var match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n\n  if (match && match[2]) {\n    return parseFloat(match[2]);\n  }\n\n  return null;\n}();\n/**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar IE_VERSION = function () {\n  var result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n  var version = result && parseFloat(result[1]);\n\n  if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n    // IE 11 has a different user agent string than other IE versions\n    version = 11.0;\n  }\n\n  return version;\n}();\n/**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n/**\n * Whether or not this is a Windows machine.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_WINDOWS = /Windows/i.test(USER_AGENT);\n/**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar TOUCH_ENABLED = Boolean(isReal() && ('ontouchstart' in window$1 || window$1.navigator.maxTouchPoints || window$1.DocumentTouch && window$1.document instanceof window$1.DocumentTouch));\n/**\n * Whether or not this device is an iPad.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);\n/**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\n\nvar IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n/**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n/**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n\nvar browser = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  IS_IPOD: IS_IPOD,\n  IOS_VERSION: IOS_VERSION,\n  IS_ANDROID: IS_ANDROID,\n  ANDROID_VERSION: ANDROID_VERSION,\n  IS_NATIVE_ANDROID: IS_NATIVE_ANDROID,\n  IS_FIREFOX: IS_FIREFOX,\n  IS_EDGE: IS_EDGE,\n  IS_CHROME: IS_CHROME,\n  CHROME_VERSION: CHROME_VERSION,\n  IE_VERSION: IE_VERSION,\n  IS_SAFARI: IS_SAFARI,\n  IS_WINDOWS: IS_WINDOWS,\n  TOUCH_ENABLED: TOUCH_ENABLED,\n  IS_IPAD: IS_IPAD,\n  IS_IPHONE: IS_IPHONE,\n  IS_IOS: IS_IOS,\n  IS_ANY_SAFARI: IS_ANY_SAFARI\n});\n\n/**\n * @file dom.js\n * @module dom\n */\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param  {string} str\n *         The string to check\n *\n * @return {boolean}\n *         Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\n\nfunction isNonBlankString(str) {\n  // we use str.trim as it will trim any whitespace characters\n  // from the front or back of non-whitespace characters. aka\n  // Any string that contains non-whitespace characters will\n  // still contain them after `trim` but whitespace only strings\n  // will have a length of 0, failing this check.\n  return typeof str === 'string' && Boolean(str.trim());\n}\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param  {string} str\n *         The string to check for whitespace.\n *\n * @throws {Error}\n *         Throws an error if there is whitespace in the string.\n */\n\n\nfunction throwIfWhitespace(str) {\n  // str.indexOf instead of regex because str.indexOf is faster performance wise.\n  if (str.indexOf(' ') >= 0) {\n    throw new Error('class has illegal whitespace characters');\n  }\n}\n/**\n * Produce a regular expression for matching a className within an elements className.\n *\n * @private\n * @param  {string} className\n *         The className to generate the RegExp for.\n *\n * @return {RegExp}\n *         The RegExp that will check for a specific `className` in an elements\n *         className.\n */\n\n\nfunction classRegExp(className) {\n  return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n}\n/**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n *         Will be `true` if the DOM appears to be real, `false` otherwise.\n */\n\n\nfunction isReal() {\n  // Both document and window will never be undefined thanks to `global`.\n  return document === window$1.document;\n}\n/**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param  {Mixed} value\n *         The value to check.\n *\n * @return {boolean}\n *         Will be `true` if the value is a DOM element, `false` otherwise.\n */\n\nfunction isEl(value) {\n  return isObject(value) && value.nodeType === 1;\n}\n/**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n *         Will be `true` if the DOM is embedded in an iframe, `false`\n *         otherwise.\n */\n\nfunction isInFrame() {\n  // We need a try/catch here because Safari will throw errors when attempting\n  // to get either `parent` or `self`\n  try {\n    return window$1.parent !== window$1.self;\n  } catch (x) {\n    return true;\n  }\n}\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param   {string} method\n *          The method to create the query with.\n *\n * @return  {Function}\n *          The query method\n */\n\nfunction createQuerier(method) {\n  return function (selector, context) {\n    if (!isNonBlankString(selector)) {\n      return document[method](null);\n    }\n\n    if (isNonBlankString(context)) {\n      context = document.querySelector(context);\n    }\n\n    var ctx = isEl(context) ? context : document;\n    return ctx[method] && ctx[method](selector);\n  };\n}\n/**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param  {string} [tagName='div']\n *         Name of tag to be created.\n *\n * @param  {Object} [properties={}]\n *         Element properties to be applied.\n *\n * @param  {Object} [attributes={}]\n *         Element attributes to be applied.\n *\n * @param {module:dom~ContentDescriptor} content\n *        A content descriptor object.\n *\n * @return {Element}\n *         The element that was created.\n */\n\n\nfunction createEl(tagName, properties, attributes, content) {\n  if (tagName === void 0) {\n    tagName = 'div';\n  }\n\n  if (properties === void 0) {\n    properties = {};\n  }\n\n  if (attributes === void 0) {\n    attributes = {};\n  }\n\n  var el = document.createElement(tagName);\n  Object.getOwnPropertyNames(properties).forEach(function (propName) {\n    var val = properties[propName]; // See #2176\n    // We originally were accepting both properties and attributes in the\n    // same object, but that doesn't work so well.\n\n    if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n      log$1.warn('Setting attributes in the second argument of createEl()\\n' + 'has been deprecated. Use the third argument instead.\\n' + (\"createEl(type, properties, attributes). Attempting to set \" + propName + \" to \" + val + \".\"));\n      el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a\n      // method for it.\n    } else if (propName === 'textContent') {\n      textContent(el, val);\n    } else if (el[propName] !== val || propName === 'tabIndex') {\n      el[propName] = val;\n    }\n  });\n  Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n    el.setAttribute(attrName, attributes[attrName]);\n  });\n\n  if (content) {\n    appendContent(el, content);\n  }\n\n  return el;\n}\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param  {Element} el\n *         The element to add text content into\n *\n * @param  {string} text\n *         The text content to add.\n *\n * @return {Element}\n *         The element with added text content.\n */\n\nfunction textContent(el, text) {\n  if (typeof el.textContent === 'undefined') {\n    el.innerText = text;\n  } else {\n    el.textContent = text;\n  }\n\n  return el;\n}\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n *        Element to insert\n *\n * @param {Element} parent\n *        Element to insert child into\n */\n\nfunction prependTo(child, parent) {\n  if (parent.firstChild) {\n    parent.insertBefore(child, parent.firstChild);\n  } else {\n    parent.appendChild(child);\n  }\n}\n/**\n * Check if an element has a class name.\n *\n * @param  {Element} element\n *         Element to check\n *\n * @param  {string} classToCheck\n *         Class name to check for\n *\n * @return {boolean}\n *         Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n *         Throws an error if `classToCheck` has white space.\n */\n\nfunction hasClass(element, classToCheck) {\n  throwIfWhitespace(classToCheck);\n\n  if (element.classList) {\n    return element.classList.contains(classToCheck);\n  }\n\n  return classRegExp(classToCheck).test(element.className);\n}\n/**\n * Add a class name to an element.\n *\n * @param  {Element} element\n *         Element to add class name to.\n *\n * @param  {string} classToAdd\n *         Class name to add.\n *\n * @return {Element}\n *         The DOM element with the added class name.\n */\n\nfunction addClass(element, classToAdd) {\n  if (element.classList) {\n    element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it\n    // in the case of classList not being supported.\n  } else if (!hasClass(element, classToAdd)) {\n    element.className = (element.className + ' ' + classToAdd).trim();\n  }\n\n  return element;\n}\n/**\n * Remove a class name from an element.\n *\n * @param  {Element} element\n *         Element to remove a class name from.\n *\n * @param  {string} classToRemove\n *         Class name to remove\n *\n * @return {Element}\n *         The DOM element with class name removed.\n */\n\nfunction removeClass(element, classToRemove) {\n  // Protect in case the player gets disposed\n  if (!element) {\n    log$1.warn(\"removeClass was called with an element that doesn't exist\");\n    return null;\n  }\n\n  if (element.classList) {\n    element.classList.remove(classToRemove);\n  } else {\n    throwIfWhitespace(classToRemove);\n    element.className = element.className.split(/\\s+/).filter(function (c) {\n      return c !== classToRemove;\n    }).join(' ');\n  }\n\n  return element;\n}\n/**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param    {Element} element\n *           The DOM element of the Component.\n *\n * @param    {string} classToToggle\n *           The `className` that wants to be toggled\n *\n * @return   {boolean|undefined}\n *           If `true` is returned, the `classToToggle` will be added to the\n *           `element`. If `false`, the `classToToggle` will be removed from\n *           the `element`. If `undefined`, the callback will be ignored.\n */\n\n/**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param  {Element} element\n *         The element to toggle a class name on.\n *\n * @param  {string} classToToggle\n *         The class that should be toggled.\n *\n * @param  {boolean|module:dom~PredicateCallback} [predicate]\n *         See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n *         The element with a class that has been toggled.\n */\n\nfunction toggleClass(element, classToToggle, predicate) {\n  // This CANNOT use `classList` internally because IE11 does not support the\n  // second parameter to the `classList.toggle()` method! Which is fine because\n  // `classList` will be used by the add/remove functions.\n  var has = hasClass(element, classToToggle);\n\n  if (typeof predicate === 'function') {\n    predicate = predicate(element, classToToggle);\n  }\n\n  if (typeof predicate !== 'boolean') {\n    predicate = !has;\n  } // If the necessary class operation matches the current state of the\n  // element, no action is required.\n\n\n  if (predicate === has) {\n    return;\n  }\n\n  if (predicate) {\n    addClass(element, classToToggle);\n  } else {\n    removeClass(element, classToToggle);\n  }\n\n  return element;\n}\n/**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n *        Element to add attributes to.\n *\n * @param {Object} [attributes]\n *        Attributes to be applied.\n */\n\nfunction setAttributes(el, attributes) {\n  Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n    var attrValue = attributes[attrName];\n\n    if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n      el.removeAttribute(attrName);\n    } else {\n      el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n    }\n  });\n}\n/**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param  {Element} tag\n *         Element from which to get tag attributes.\n *\n * @return {Object}\n *         All attributes of the element. Boolean attributes will be `true` or\n *         `false`, others will be strings.\n */\n\nfunction getAttributes(tag) {\n  var obj = {}; // known boolean attributes\n  // we can check for matching boolean properties, but not all browsers\n  // and not all tags know about these attributes, so, we still want to check them manually\n\n  var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ',';\n\n  if (tag && tag.attributes && tag.attributes.length > 0) {\n    var attrs = tag.attributes;\n\n    for (var i = attrs.length - 1; i >= 0; i--) {\n      var attrName = attrs[i].name;\n      var attrVal = attrs[i].value; // check for known booleans\n      // the matching element property will return a value for typeof\n\n      if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {\n        // the value of an included boolean attribute is typically an empty\n        // string ('') which would equal false if we just check for a false value.\n        // we also don't want support bad code like autoplay='false'\n        attrVal = attrVal !== null ? true : false;\n      }\n\n      obj[attrName] = attrVal;\n    }\n  }\n\n  return obj;\n}\n/**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n *        A DOM element.\n *\n * @param {string} attribute\n *        Attribute to get the value of.\n *\n * @return {string}\n *         The value of the attribute.\n */\n\nfunction getAttribute(el, attribute) {\n  return el.getAttribute(attribute);\n}\n/**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n *        A DOM element.\n *\n * @param {string} attribute\n *        Attribute to set.\n *\n * @param {string} value\n *        Value to set the attribute to.\n */\n\nfunction setAttribute(el, attribute, value) {\n  el.setAttribute(attribute, value);\n}\n/**\n * Remove an element's attribute.\n *\n * @param {Element} el\n *        A DOM element.\n *\n * @param {string} attribute\n *        Attribute to remove.\n */\n\nfunction removeAttribute(el, attribute) {\n  el.removeAttribute(attribute);\n}\n/**\n * Attempt to block the ability to select text.\n */\n\nfunction blockTextSelection() {\n  document.body.focus();\n\n  document.onselectstart = function () {\n    return false;\n  };\n}\n/**\n * Turn off text selection blocking.\n */\n\nfunction unblockTextSelection() {\n  document.onselectstart = function () {\n    return true;\n  };\n}\n/**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param  {Element} el\n *         Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n *         Always returns a plain object - or `undefined` if it cannot.\n */\n\nfunction getBoundingClientRect(el) {\n  if (el && el.getBoundingClientRect && el.parentNode) {\n    var rect = el.getBoundingClientRect();\n    var result = {};\n    ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) {\n      if (rect[k] !== undefined) {\n        result[k] = rect[k];\n      }\n    });\n\n    if (!result.height) {\n      result.height = parseFloat(computedStyle(el, 'height'));\n    }\n\n    if (!result.width) {\n      result.width = parseFloat(computedStyle(el, 'width'));\n    }\n\n    return result;\n  }\n}\n/**\n * Represents the position of a DOM element on the page.\n *\n * @typedef  {Object} module:dom~Position\n *\n * @property {number} left\n *           Pixels to the left.\n *\n * @property {number} top\n *           Pixels from the top.\n */\n\n/**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param  {Element} el\n *         Element from which to get offset.\n *\n * @return {module:dom~Position}\n *         The position of the element that was passed in.\n */\n\nfunction findPosition(el) {\n  if (!el || el && !el.offsetParent) {\n    return {\n      left: 0,\n      top: 0,\n      width: 0,\n      height: 0\n    };\n  }\n\n  var width = el.offsetWidth;\n  var height = el.offsetHeight;\n  var left = 0;\n  var top = 0;\n\n  while (el.offsetParent && el !== document[FullscreenApi.fullscreenElement]) {\n    left += el.offsetLeft;\n    top += el.offsetTop;\n    el = el.offsetParent;\n  }\n\n  return {\n    left: left,\n    top: top,\n    width: width,\n    height: height\n  };\n}\n/**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef  {Object} module:dom~Coordinates\n *\n * @property {number} x\n *           x coordinate in pixels\n *\n * @property {number} y\n *           y coordinate in pixels\n */\n\n/**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param  {Element} el\n *         Element on which to get the pointer position on.\n *\n * @param  {EventTarget~Event} event\n *         Event object.\n *\n * @return {module:dom~Coordinates}\n *         A coordinates object corresponding to the mouse position.\n *\n */\n\nfunction getPointerPosition(el, event) {\n  var translated = {\n    x: 0,\n    y: 0\n  };\n\n  if (IS_IOS) {\n    var item = el;\n\n    while (item && item.nodeName.toLowerCase() !== 'html') {\n      var transform = computedStyle(item, 'transform');\n\n      if (/^matrix/.test(transform)) {\n        var values = transform.slice(7, -1).split(/,\\s/).map(Number);\n        translated.x += values[4];\n        translated.y += values[5];\n      } else if (/^matrix3d/.test(transform)) {\n        var _values = transform.slice(9, -1).split(/,\\s/).map(Number);\n\n        translated.x += _values[12];\n        translated.y += _values[13];\n      }\n\n      item = item.parentNode;\n    }\n  }\n\n  var position = {};\n  var boxTarget = findPosition(event.target);\n  var box = findPosition(el);\n  var boxW = box.width;\n  var boxH = box.height;\n  var offsetY = event.offsetY - (box.top - boxTarget.top);\n  var offsetX = event.offsetX - (box.left - boxTarget.left);\n\n  if (event.changedTouches) {\n    offsetX = event.changedTouches[0].pageX - box.left;\n    offsetY = event.changedTouches[0].pageY + box.top;\n\n    if (IS_IOS) {\n      offsetX -= translated.x;\n      offsetY -= translated.y;\n    }\n  }\n\n  position.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));\n  position.x = Math.max(0, Math.min(1, offsetX / boxW));\n  return position;\n}\n/**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param  {Mixed} value\n *         Check if this value is a text node.\n *\n * @return {boolean}\n *         Will be `true` if the value is a text node, `false` otherwise.\n */\n\nfunction isTextNode(value) {\n  return isObject(value) && value.nodeType === 3;\n}\n/**\n * Empties the contents of an element.\n *\n * @param  {Element} el\n *         The element to empty children from\n *\n * @return {Element}\n *         The element with no children\n */\n\nfunction emptyEl(el) {\n  while (el.firstChild) {\n    el.removeChild(el.firstChild);\n  }\n\n  return el;\n}\n/**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type       | Description\n * -----------|-------------\n * `string`   | The value will be normalized into a text node.\n * `Element`  | The value will be accepted as-is.\n * `TextNode` | The value will be accepted as-is.\n * `Array`    | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor\n */\n\n/**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {module:dom~ContentDescriptor} content\n *        A content descriptor value.\n *\n * @return {Array}\n *         All of the content that was passed in, normalized to an array of\n *         elements or text nodes.\n */\n\nfunction normalizeContent(content) {\n  // First, invoke content if it is a function. If it produces an array,\n  // that needs to happen before normalization.\n  if (typeof content === 'function') {\n    content = content();\n  } // Next up, normalize to an array, so one or many items can be normalized,\n  // filtered, and returned.\n\n\n  return (Array.isArray(content) ? content : [content]).map(function (value) {\n    // First, invoke value if it is a function to produce a new value,\n    // which will be subsequently normalized to a Node of some kind.\n    if (typeof value === 'function') {\n      value = value();\n    }\n\n    if (isEl(value) || isTextNode(value)) {\n      return value;\n    }\n\n    if (typeof value === 'string' && /\\S/.test(value)) {\n      return document.createTextNode(value);\n    }\n  }).filter(function (value) {\n    return value;\n  });\n}\n/**\n * Normalizes and appends content to an element.\n *\n * @param  {Element} el\n *         Element to append normalized content to.\n *\n * @param {module:dom~ContentDescriptor} content\n *        A content descriptor value.\n *\n * @return {Element}\n *         The element with appended normalized content.\n */\n\nfunction appendContent(el, content) {\n  normalizeContent(content).forEach(function (node) {\n    return el.appendChild(node);\n  });\n  return el;\n}\n/**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n *        Element to insert normalized content into.\n *\n * @param {module:dom~ContentDescriptor} content\n *        A content descriptor value.\n *\n * @return {Element}\n *         The element with inserted normalized content.\n */\n\nfunction insertContent(el, content) {\n  return appendContent(emptyEl(el), content);\n}\n/**\n * Check if an event was a single left click.\n *\n * @param  {EventTarget~Event} event\n *         Event object.\n *\n * @return {boolean}\n *         Will be `true` if a single left click, `false` otherwise.\n */\n\nfunction isSingleLeftClick(event) {\n  // Note: if you create something draggable, be sure to\n  // call it on both `mousedown` and `mousemove` event,\n  // otherwise `mousedown` should be enough for a button\n  if (event.button === undefined && event.buttons === undefined) {\n    // Why do we need `buttons` ?\n    // Because, middle mouse sometimes have this:\n    // e.button === 0 and e.buttons === 4\n    // Furthermore, we want to prevent combination click, something like\n    // HOLD middlemouse then left click, that would be\n    // e.button === 0, e.buttons === 5\n    // just `button` is not gonna work\n    // Alright, then what this block does ?\n    // this is for chrome `simulate mobile devices`\n    // I want to support this as well\n    return true;\n  }\n\n  if (event.button === 0 && event.buttons === undefined) {\n    // Touch screen, sometimes on some specific device, `buttons`\n    // doesn't have anything (safari on ios, blackberry...)\n    return true;\n  } // `mouseup` event on a single left click has\n  // `button` and `buttons` equal to 0\n\n\n  if (event.type === 'mouseup' && event.button === 0 && event.buttons === 0) {\n    return true;\n  }\n\n  if (event.button !== 0 || event.buttons !== 1) {\n    // This is the reason we have those if else block above\n    // if any special case we can catch and let it slide\n    // we do it above, when get to here, this definitely\n    // is-not-left-click\n    return false;\n  }\n\n  return true;\n}\n/**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param  {string} selector\n *         A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param  {Element|String} [context=document]\n *         A DOM element within which to query. Can also be a selector\n *         string in which case the first matching element will be used\n *         as context. If missing (or no element matches selector), falls\n *         back to `document`.\n *\n * @return {Element|null}\n *         The element that was found or null.\n */\n\nvar $ = createQuerier('querySelector');\n/**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param  {string} selector\n *         A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param  {Element|String} [context=document]\n *         A DOM element within which to query. Can also be a selector\n *         string in which case the first matching element will be used\n *         as context. If missing (or no element matches selector), falls\n *         back to `document`.\n *\n * @return {NodeList}\n *         A element list of elements that were found. Will be empty if none\n *         were found.\n *\n */\n\nvar $$ = createQuerier('querySelectorAll');\n\nvar Dom = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  isReal: isReal,\n  isEl: isEl,\n  isInFrame: isInFrame,\n  createEl: createEl,\n  textContent: textContent,\n  prependTo: prependTo,\n  hasClass: hasClass,\n  addClass: addClass,\n  removeClass: removeClass,\n  toggleClass: toggleClass,\n  setAttributes: setAttributes,\n  getAttributes: getAttributes,\n  getAttribute: getAttribute,\n  setAttribute: setAttribute,\n  removeAttribute: removeAttribute,\n  blockTextSelection: blockTextSelection,\n  unblockTextSelection: unblockTextSelection,\n  getBoundingClientRect: getBoundingClientRect,\n  findPosition: findPosition,\n  getPointerPosition: getPointerPosition,\n  isTextNode: isTextNode,\n  emptyEl: emptyEl,\n  normalizeContent: normalizeContent,\n  appendContent: appendContent,\n  insertContent: insertContent,\n  isSingleLeftClick: isSingleLeftClick,\n  $: $,\n  $$: $$\n});\n\n/**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\nvar _windowLoaded = false;\nvar videojs$1;\n/**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\n\nvar autoSetup = function autoSetup() {\n  if (videojs$1.options.autoSetup === false) {\n    return;\n  }\n\n  var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n  var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n  var divs = Array.prototype.slice.call(document.getElementsByTagName('video-js'));\n  var mediaEls = vids.concat(audios, divs); // Check if any media elements exist\n\n  if (mediaEls && mediaEls.length > 0) {\n    for (var i = 0, e = mediaEls.length; i < e; i++) {\n      var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func.\n\n      if (mediaEl && mediaEl.getAttribute) {\n        // Make sure this player hasn't already been set up.\n        if (mediaEl.player === undefined) {\n          var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists.\n          // We only auto-setup if they've added the data-setup attr.\n\n          if (options !== null) {\n            // Create new video.js instance.\n            videojs$1(mediaEl);\n          }\n        } // If getAttribute isn't defined, we need to wait for the DOM.\n\n      } else {\n        autoSetupTimeout(1);\n        break;\n      }\n    } // No videos were found, so keep looping unless page is finished loading.\n\n  } else if (!_windowLoaded) {\n    autoSetupTimeout(1);\n  }\n};\n/**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n *        How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n *        The videojs library function\n */\n\n\nfunction autoSetupTimeout(wait, vjs) {\n  // Protect against breakage in non-browser environments\n  if (!isReal()) {\n    return;\n  }\n\n  if (vjs) {\n    videojs$1 = vjs;\n  }\n\n  window$1.setTimeout(autoSetup, wait);\n}\n/**\n * Used to set the internal tracking of window loaded state to true.\n *\n * @private\n */\n\n\nfunction setWindowLoaded() {\n  _windowLoaded = true;\n  window$1.removeEventListener('load', setWindowLoaded);\n}\n\nif (isReal()) {\n  if (document.readyState === 'complete') {\n    setWindowLoaded();\n  } else {\n    /**\n     * Listen for the load event on window, and set _windowLoaded to true.\n     *\n     * We use a standard event listener here to avoid incrementing the GUID\n     * before any players are created.\n     *\n     * @listens load\n     */\n    window$1.addEventListener('load', setWindowLoaded);\n  }\n}\n\n/**\n * @file stylesheet.js\n * @module stylesheet\n */\n/**\n * Create a DOM syle element given a className for it.\n *\n * @param {string} className\n *        The className to add to the created style element.\n *\n * @return {Element}\n *         The element that was created.\n */\n\nvar createStyleElement = function createStyleElement(className) {\n  var style = document.createElement('style');\n  style.className = className;\n  return style;\n};\n/**\n * Add text to a DOM element.\n *\n * @param {Element} el\n *        The Element to add text content to.\n *\n * @param {string} content\n *        The text to add to the element.\n */\n\nvar setTextContent = function setTextContent(el, content) {\n  if (el.styleSheet) {\n    el.styleSheet.cssText = content;\n  } else {\n    el.textContent = content;\n  }\n};\n\n/**\n * @file guid.js\n * @module guid\n */\n// Default value for GUIDs. This allows us to reset the GUID counter in tests.\n//\n// The initial GUID is 3 because some users have come to rely on the first\n// default player ID ending up as `vjs_video_3`.\n//\n// See: https://github.com/videojs/video.js/pull/6216\nvar _initialGuid = 3;\n/**\n * Unique ID for an element or function\n *\n * @type {Number}\n */\n\nvar _guid = _initialGuid;\n/**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n *         A new unique ID.\n */\n\nfunction newGUID() {\n  return _guid++;\n}\n\n/**\n * @file dom-data.js\n * @module dom-data\n */\nvar FakeWeakMap;\n\nif (!window$1.WeakMap) {\n  FakeWeakMap = /*#__PURE__*/function () {\n    function FakeWeakMap() {\n      this.vdata = 'vdata' + Math.floor(window$1.performance && window$1.performance.now() || Date.now());\n      this.data = {};\n    }\n\n    var _proto = FakeWeakMap.prototype;\n\n    _proto.set = function set(key, value) {\n      var access = key[this.vdata] || newGUID();\n\n      if (!key[this.vdata]) {\n        key[this.vdata] = access;\n      }\n\n      this.data[access] = value;\n      return this;\n    };\n\n    _proto.get = function get(key) {\n      var access = key[this.vdata]; // we have data, return it\n\n      if (access) {\n        return this.data[access];\n      } // we don't have data, return nothing.\n      // return undefined explicitly as that's the contract for this method\n\n\n      log$1('We have no data for this element', key);\n      return undefined;\n    };\n\n    _proto.has = function has(key) {\n      var access = key[this.vdata];\n      return access in this.data;\n    };\n\n    _proto[\"delete\"] = function _delete(key) {\n      var access = key[this.vdata];\n\n      if (access) {\n        delete this.data[access];\n        delete key[this.vdata];\n      }\n    };\n\n    return FakeWeakMap;\n  }();\n}\n/**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\n\n\nvar DomData = window$1.WeakMap ? new WeakMap() : new FakeWeakMap();\n\n/**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n/**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n *        Element to clean up\n *\n * @param {string} type\n *        Type of event to clean up\n */\n\nfunction _cleanUpEvents(elem, type) {\n  if (!DomData.has(elem)) {\n    return;\n  }\n\n  var data = DomData.get(elem); // Remove the events of a particular type if there are none left\n\n  if (data.handlers[type].length === 0) {\n    delete data.handlers[type]; // data.handlers[type] = null;\n    // Setting to null was causing an error with data.handlers\n    // Remove the meta-handler from the element\n\n    if (elem.removeEventListener) {\n      elem.removeEventListener(type, data.dispatcher, false);\n    } else if (elem.detachEvent) {\n      elem.detachEvent('on' + type, data.dispatcher);\n    }\n  } // Remove the events object if there are no types left\n\n\n  if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n    delete data.handlers;\n    delete data.dispatcher;\n    delete data.disabled;\n  } // Finally remove the element data if there is no data left\n\n\n  if (Object.getOwnPropertyNames(data).length === 0) {\n    DomData[\"delete\"](elem);\n  }\n}\n/**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n *        The event method we want to use.\n *\n * @param {Element|Object} elem\n *        Element or object to bind listeners to\n *\n * @param {string} type\n *        Type of event to bind to.\n *\n * @param {EventTarget~EventListener} callback\n *        Event listener.\n */\n\n\nfunction _handleMultipleEvents(fn, elem, types, callback) {\n  types.forEach(function (type) {\n    // Call the event method for each one of the types\n    fn(elem, type, callback);\n  });\n}\n/**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n *        Event object to fix.\n *\n * @return {Object}\n *         Fixed event object.\n */\n\n\nfunction fixEvent(event) {\n  if (event.fixed_) {\n    return event;\n  }\n\n  function returnTrue() {\n    return true;\n  }\n\n  function returnFalse() {\n    return false;\n  } // Test if fixing up is needed\n  // Used to check if !event.stopPropagation instead of isPropagationStopped\n  // But native events return true for stopPropagation, but don't have\n  // other expected methods like isPropagationStopped. Seems to be a problem\n  // with the Javascript Ninja code. So we're just overriding all events now.\n\n\n  if (!event || !event.isPropagationStopped || !event.isImmediatePropagationStopped) {\n    var old = event || window$1.event;\n    event = {}; // Clone the old object so that we can modify the values event = {};\n    // IE8 Doesn't like when you mess with native event properties\n    // Firefox returns false for event.hasOwnProperty('type') and other props\n    //  which makes copying more difficult.\n    // TODO: Probably best to create a whitelist of event props\n\n    for (var key in old) {\n      // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n      // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n      // and webkitMovementX/Y\n      // Lighthouse complains if Event.path is copied\n      if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY' && key !== 'path') {\n        // Chrome 32+ warns if you try to copy deprecated returnValue, but\n        // we still want to if preventDefault isn't supported (IE8).\n        if (!(key === 'returnValue' && old.preventDefault)) {\n          event[key] = old[key];\n        }\n      }\n    } // The event occurred on this element\n\n\n    if (!event.target) {\n      event.target = event.srcElement || document;\n    } // Handle which other element the event is related to\n\n\n    if (!event.relatedTarget) {\n      event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n    } // Stop the default browser action\n\n\n    event.preventDefault = function () {\n      if (old.preventDefault) {\n        old.preventDefault();\n      }\n\n      event.returnValue = false;\n      old.returnValue = false;\n      event.defaultPrevented = true;\n    };\n\n    event.defaultPrevented = false; // Stop the event from bubbling\n\n    event.stopPropagation = function () {\n      if (old.stopPropagation) {\n        old.stopPropagation();\n      }\n\n      event.cancelBubble = true;\n      old.cancelBubble = true;\n      event.isPropagationStopped = returnTrue;\n    };\n\n    event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers\n\n    event.stopImmediatePropagation = function () {\n      if (old.stopImmediatePropagation) {\n        old.stopImmediatePropagation();\n      }\n\n      event.isImmediatePropagationStopped = returnTrue;\n      event.stopPropagation();\n    };\n\n    event.isImmediatePropagationStopped = returnFalse; // Handle mouse position\n\n    if (event.clientX !== null && event.clientX !== undefined) {\n      var doc = document.documentElement;\n      var body = document.body;\n      event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n      event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n    } // Handle key presses\n\n\n    event.which = event.charCode || event.keyCode; // Fix button for mouse clicks:\n    // 0 == left; 1 == middle; 2 == right\n\n    if (event.button !== null && event.button !== undefined) {\n      // The following is disabled because it does not pass videojs-standard\n      // and... yikes.\n\n      /* eslint-disable */\n      event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n      /* eslint-enable */\n    }\n  }\n\n  event.fixed_ = true; // Returns fixed-up instance\n\n  return event;\n}\n/**\n * Whether passive event listeners are supported\n */\n\nvar _supportsPassive;\n\nvar supportsPassive = function supportsPassive() {\n  if (typeof _supportsPassive !== 'boolean') {\n    _supportsPassive = false;\n\n    try {\n      var opts = Object.defineProperty({}, 'passive', {\n        get: function get() {\n          _supportsPassive = true;\n        }\n      });\n      window$1.addEventListener('test', null, opts);\n      window$1.removeEventListener('test', null, opts);\n    } catch (e) {// disregard\n    }\n  }\n\n  return _supportsPassive;\n};\n/**\n * Touch events Chrome expects to be passive\n */\n\n\nvar passiveEvents = ['touchstart', 'touchmove'];\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n *        Element or object to bind listeners to\n *\n * @param {string|string[]} type\n *        Type of event to bind to.\n *\n * @param {EventTarget~EventListener} fn\n *        Event listener.\n */\n\nfunction on(elem, type, fn) {\n  if (Array.isArray(type)) {\n    return _handleMultipleEvents(on, elem, type, fn);\n  }\n\n  if (!DomData.has(elem)) {\n    DomData.set(elem, {});\n  }\n\n  var data = DomData.get(elem); // We need a place to store all our handler data\n\n  if (!data.handlers) {\n    data.handlers = {};\n  }\n\n  if (!data.handlers[type]) {\n    data.handlers[type] = [];\n  }\n\n  if (!fn.guid) {\n    fn.guid = newGUID();\n  }\n\n  data.handlers[type].push(fn);\n\n  if (!data.dispatcher) {\n    data.disabled = false;\n\n    data.dispatcher = function (event, hash) {\n      if (data.disabled) {\n        return;\n      }\n\n      event = fixEvent(event);\n      var handlers = data.handlers[event.type];\n\n      if (handlers) {\n        // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n        var handlersCopy = handlers.slice(0);\n\n        for (var m = 0, n = handlersCopy.length; m < n; m++) {\n          if (event.isImmediatePropagationStopped()) {\n            break;\n          } else {\n            try {\n              handlersCopy[m].call(elem, event, hash);\n            } catch (e) {\n              log$1.error(e);\n            }\n          }\n        }\n      }\n    };\n  }\n\n  if (data.handlers[type].length === 1) {\n    if (elem.addEventListener) {\n      var options = false;\n\n      if (supportsPassive() && passiveEvents.indexOf(type) > -1) {\n        options = {\n          passive: true\n        };\n      }\n\n      elem.addEventListener(type, data.dispatcher, options);\n    } else if (elem.attachEvent) {\n      elem.attachEvent('on' + type, data.dispatcher);\n    }\n  }\n}\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n *        Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n *        Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {EventTarget~EventListener} [fn]\n *        Specific listener to remove. Don't include to remove listeners for an event\n *        type.\n */\n\nfunction off(elem, type, fn) {\n  // Don't want to add a cache object through getElData if not needed\n  if (!DomData.has(elem)) {\n    return;\n  }\n\n  var data = DomData.get(elem); // If no events exist, nothing to unbind\n\n  if (!data.handlers) {\n    return;\n  }\n\n  if (Array.isArray(type)) {\n    return _handleMultipleEvents(off, elem, type, fn);\n  } // Utility function\n\n\n  var removeType = function removeType(el, t) {\n    data.handlers[t] = [];\n\n    _cleanUpEvents(el, t);\n  }; // Are we removing all bound events?\n\n\n  if (type === undefined) {\n    for (var t in data.handlers) {\n      if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n        removeType(elem, t);\n      }\n    }\n\n    return;\n  }\n\n  var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind\n\n  if (!handlers) {\n    return;\n  } // If no listener was provided, remove all listeners for type\n\n\n  if (!fn) {\n    removeType(elem, type);\n    return;\n  } // We're only removing a single handler\n\n\n  if (fn.guid) {\n    for (var n = 0; n < handlers.length; n++) {\n      if (handlers[n].guid === fn.guid) {\n        handlers.splice(n--, 1);\n      }\n    }\n  }\n\n  _cleanUpEvents(elem, type);\n}\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n *        Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n *        A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n *        data hash to pass along with the event\n *\n * @return {boolean|undefined}\n *         Returns the opposite of `defaultPrevented` if default was\n *         prevented. Otherwise, returns `undefined`\n */\n\nfunction trigger(elem, event, hash) {\n  // Fetches element data and a reference to the parent (for bubbling).\n  // Don't want to add a data object to cache for every parent,\n  // so checking hasElData first.\n  var elemData = DomData.has(elem) ? DomData.get(elem) : {};\n  var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event,\n  // handler;\n  // If an event name was passed as a string, creates an event out of it\n\n  if (typeof event === 'string') {\n    event = {\n      type: event,\n      target: elem\n    };\n  } else if (!event.target) {\n    event.target = elem;\n  } // Normalizes the event properties.\n\n\n  event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers.\n\n  if (elemData.dispatcher) {\n    elemData.dispatcher.call(elem, event, hash);\n  } // Unless explicitly stopped or the event does not bubble (e.g. media events)\n  // recursively calls this function to bubble the event up the DOM.\n\n\n  if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n    trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled.\n  } else if (!parent && !event.defaultPrevented && event.target && event.target[event.type]) {\n    if (!DomData.has(event.target)) {\n      DomData.set(event.target, {});\n    }\n\n    var targetData = DomData.get(event.target); // Checks if the target has a default action for this event.\n\n    if (event.target[event.type]) {\n      // Temporarily disables event dispatching on the target as we have already executed the handler.\n      targetData.disabled = true; // Executes the default action.\n\n      if (typeof event.target[event.type] === 'function') {\n        event.target[event.type]();\n      } // Re-enables event dispatching.\n\n\n      targetData.disabled = false;\n    }\n  } // Inform the triggerer if the default was prevented by returning false\n\n\n  return !event.defaultPrevented;\n}\n/**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n *        Element or object to bind to.\n *\n * @param {string|string[]} type\n *        Name/type of event\n *\n * @param {Event~EventListener} fn\n *        Event listener function\n */\n\nfunction one(elem, type, fn) {\n  if (Array.isArray(type)) {\n    return _handleMultipleEvents(one, elem, type, fn);\n  }\n\n  var func = function func() {\n    off(elem, type, func);\n    fn.apply(this, arguments);\n  }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n  func.guid = fn.guid = fn.guid || newGUID();\n  on(elem, type, func);\n}\n/**\n * Trigger a listener only once and then turn if off for all\n * configured events\n *\n * @param {Element|Object} elem\n *        Element or object to bind to.\n *\n * @param {string|string[]} type\n *        Name/type of event\n *\n * @param {Event~EventListener} fn\n *        Event listener function\n */\n\nfunction any(elem, type, fn) {\n  var func = function func() {\n    off(elem, type, func);\n    fn.apply(this, arguments);\n  }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n  func.guid = fn.guid = fn.guid || newGUID(); // multiple ons, but one off for everything\n\n  on(elem, type, func);\n}\n\nvar Events = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  fixEvent: fixEvent,\n  on: on,\n  off: off,\n  trigger: trigger,\n  one: one,\n  any: any\n});\n\n/**\n * @file fn.js\n * @module fn\n */\nvar UPDATE_REFRESH_INTERVAL = 30;\n/**\n * Bind (a.k.a proxy or context). A simple method for changing the context of\n * a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @function\n * @param    {Mixed} context\n *           The object to bind as scope.\n *\n * @param    {Function} fn\n *           The function to be bound to a scope.\n *\n * @param    {number} [uid]\n *           An optional unique ID for the function to be set\n *\n * @return   {Function}\n *           The new function that will be bound into the context given\n */\n\nvar bind = function bind(context, fn, uid) {\n  // Make sure the function has a unique ID\n  if (!fn.guid) {\n    fn.guid = newGUID();\n  } // Create the new function that changes the context\n\n\n  var bound = fn.bind(context); // Allow for the ability to individualize this function\n  // Needed in the case where multiple objects might share the same prototype\n  // IF both items add an event listener with the same function, then you try to remove just one\n  // it will remove both because they both have the same guid.\n  // when using this, you need to use the bind method when you remove the listener as well.\n  // currently used in text tracks\n\n  bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n  return bound;\n};\n/**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param    {Function} fn\n *           The function to be throttled.\n *\n * @param    {number}   wait\n *           The number of milliseconds by which to throttle.\n *\n * @return   {Function}\n */\n\nvar throttle = function throttle(fn, wait) {\n  var last = window$1.performance.now();\n\n  var throttled = function throttled() {\n    var now = window$1.performance.now();\n\n    if (now - last >= wait) {\n      fn.apply(void 0, arguments);\n      last = now;\n    }\n  };\n\n  return throttled;\n};\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param    {Function} func\n *           The function to wrap with debounce behavior.\n *\n * @param    {number} wait\n *           The number of milliseconds to wait after the last invocation.\n *\n * @param    {boolean} [immediate]\n *           Whether or not to invoke the function immediately upon creation.\n *\n * @param    {Object} [context=window]\n *           The \"context\" in which the debounced function should debounce. For\n *           example, if this function should be tied to a Video.js player,\n *           the player can be passed here. Alternatively, defaults to the\n *           global `window` object.\n *\n * @return   {Function}\n *           A debounced function.\n */\n\nvar debounce = function debounce(func, wait, immediate, context) {\n  if (context === void 0) {\n    context = window$1;\n  }\n\n  var timeout;\n\n  var cancel = function cancel() {\n    context.clearTimeout(timeout);\n    timeout = null;\n  };\n  /* eslint-disable consistent-this */\n\n\n  var debounced = function debounced() {\n    var self = this;\n    var args = arguments;\n\n    var _later = function later() {\n      timeout = null;\n      _later = null;\n\n      if (!immediate) {\n        func.apply(self, args);\n      }\n    };\n\n    if (!timeout && immediate) {\n      func.apply(self, args);\n    }\n\n    context.clearTimeout(timeout);\n    timeout = context.setTimeout(_later, wait);\n  };\n  /* eslint-enable consistent-this */\n\n\n  debounced.cancel = cancel;\n  return debounced;\n};\n\n/**\n * @file src/js/event-target.js\n */\n/**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\n\nvar EventTarget$2 = function EventTarget() {};\n/**\n * A Custom DOM event.\n *\n * @typedef {Object} EventTarget~Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n/**\n * All event listeners should follow the following format.\n *\n * @callback EventTarget~EventListener\n * @this {EventTarget}\n *\n * @param {EventTarget~Event} event\n *        the event that triggered this function\n *\n * @param {Object} [hash]\n *        hash of data sent during the event\n */\n\n/**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n *         will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @private\n */\n\n\nEventTarget$2.prototype.allowedEvents_ = {};\n/**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n *        An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n *        The function to call with `EventTarget`s\n */\n\nEventTarget$2.prototype.on = function (type, fn) {\n  // Remove the addEventListener alias before calling Events.on\n  // so we don't get into an infinite type loop\n  var ael = this.addEventListener;\n\n  this.addEventListener = function () {};\n\n  on(this, type, fn);\n  this.addEventListener = ael;\n};\n/**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\n\n\nEventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;\n/**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n *        An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n *        The function to remove.\n */\n\nEventTarget$2.prototype.off = function (type, fn) {\n  off(this, type, fn);\n};\n/**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\n\n\nEventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;\n/**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n *        An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n *        The function to be called once for each event name.\n */\n\nEventTarget$2.prototype.one = function (type, fn) {\n  // Remove the addEventListener aliasing Events.on\n  // so we don't get into an infinite type loop\n  var ael = this.addEventListener;\n\n  this.addEventListener = function () {};\n\n  one(this, type, fn);\n  this.addEventListener = ael;\n};\n\nEventTarget$2.prototype.any = function (type, fn) {\n  // Remove the addEventListener aliasing Events.on\n  // so we don't get into an infinite type loop\n  var ael = this.addEventListener;\n\n  this.addEventListener = function () {};\n\n  any(this, type, fn);\n  this.addEventListener = ael;\n};\n/**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n *        The name of the event, an `Event`, or an object with a key of type set to\n *        an event name.\n */\n\n\nEventTarget$2.prototype.trigger = function (event) {\n  var type = event.type || event; // deprecation\n  // In a future version we should default target to `this`\n  // similar to how we default the target to `elem` in\n  // `Events.trigger`. Right now the default `target` will be\n  // `document` due to the `Event.fixEvent` call.\n\n  if (typeof event === 'string') {\n    event = {\n      type: type\n    };\n  }\n\n  event = fixEvent(event);\n\n  if (this.allowedEvents_[type] && this['on' + type]) {\n    this['on' + type](event);\n  }\n\n  trigger(this, event);\n};\n/**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\n\n\nEventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;\nvar EVENT_MAP;\n\nEventTarget$2.prototype.queueTrigger = function (event) {\n  var _this = this;\n\n  // only set up EVENT_MAP if it'll be used\n  if (!EVENT_MAP) {\n    EVENT_MAP = new Map();\n  }\n\n  var type = event.type || event;\n  var map = EVENT_MAP.get(this);\n\n  if (!map) {\n    map = new Map();\n    EVENT_MAP.set(this, map);\n  }\n\n  var oldTimeout = map.get(type);\n  map[\"delete\"](type);\n  window$1.clearTimeout(oldTimeout);\n  var timeout = window$1.setTimeout(function () {\n    // if we cleared out all timeouts for the current target, delete its map\n    if (map.size === 0) {\n      map = null;\n      EVENT_MAP[\"delete\"](_this);\n    }\n\n    _this.trigger(event);\n  }, 0);\n  map.set(type, timeout);\n};\n\n/**\n * @file mixins/evented.js\n * @module evented\n */\n\nvar objName = function objName(obj) {\n  if (typeof obj.name === 'function') {\n    return obj.name();\n  }\n\n  if (typeof obj.name === 'string') {\n    return obj.name;\n  }\n\n  if (obj.name_) {\n    return obj.name_;\n  }\n\n  if (obj.constructor && obj.constructor.name) {\n    return obj.constructor.name;\n  }\n\n  return typeof obj;\n};\n/**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param  {Object} object\n *         An object to test.\n *\n * @return {boolean}\n *         Whether or not the object appears to be evented.\n */\n\n\nvar isEvented = function isEvented(object) {\n  return object instanceof EventTarget$2 || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) {\n    return typeof object[k] === 'function';\n  });\n};\n/**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param  {Object} object\n *         An object to Add\n * @param  {Function} callback\n *         The callback to run.\n */\n\n\nvar addEventedCallback = function addEventedCallback(target, callback) {\n  if (isEvented(target)) {\n    callback();\n  } else {\n    if (!target.eventedCallbacks) {\n      target.eventedCallbacks = [];\n    }\n\n    target.eventedCallbacks.push(callback);\n  }\n};\n/**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param  {string|Array} type\n *         The type value to test.\n *\n * @return {boolean}\n *         Whether or not the type is a valid event type.\n */\n\n\nvar isValidEventType = function isValidEventType(type) {\n  return (// The regex here verifies that the `type` contains at least one non-\n    // whitespace character.\n    typeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length\n  );\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n *         If the target does not appear to be a valid event target.\n *\n * @param  {Object} target\n *         The object to test.\n *\n * @param  {Object} obj\n *         The evented object we are validating for\n *\n * @param  {string} fnName\n *         The name of the evented mixin function that called this.\n */\n\n\nvar validateTarget = function validateTarget(target, obj, fnName) {\n  if (!target || !target.nodeName && !isEvented(target)) {\n    throw new Error(\"Invalid target for \" + objName(obj) + \"#\" + fnName + \"; must be a DOM node or evented object.\");\n  }\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n *         If the type does not appear to be a valid event type.\n *\n * @param  {string|Array} type\n *         The type to test.\n *\n * @param  {Object} obj\n*         The evented object we are validating for\n *\n * @param  {string} fnName\n *         The name of the evented mixin function that called this.\n */\n\n\nvar validateEventType = function validateEventType(type, obj, fnName) {\n  if (!isValidEventType(type)) {\n    throw new Error(\"Invalid event type for \" + objName(obj) + \"#\" + fnName + \"; must be a non-empty string or array.\");\n  }\n};\n/**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n *         If the listener is not a function.\n *\n * @param  {Function} listener\n *         The listener to test.\n *\n * @param  {Object} obj\n *         The evented object we are validating for\n *\n * @param  {string} fnName\n *         The name of the evented mixin function that called this.\n */\n\n\nvar validateListener = function validateListener(listener, obj, fnName) {\n  if (typeof listener !== 'function') {\n    throw new Error(\"Invalid listener for \" + objName(obj) + \"#\" + fnName + \"; must be a function.\");\n  }\n};\n/**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param  {Object} self\n *         The evented object on which `on()` or `one()` was called. This\n *         object will be bound as the `this` value for the listener.\n *\n * @param  {Array} args\n *         An array of arguments passed to `on()` or `one()`.\n *\n * @param  {string} fnName\n *         The name of the evented mixin function that called this.\n *\n * @return {Object}\n *         An object containing useful values for `on()` or `one()` calls.\n */\n\n\nvar normalizeListenArgs = function normalizeListenArgs(self, args, fnName) {\n  // If the number of arguments is less than 3, the target is always the\n  // evented object itself.\n  var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n  var target;\n  var type;\n  var listener;\n\n  if (isTargetingSelf) {\n    target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to\n    // the evented object itself.\n\n    if (args.length >= 3) {\n      args.shift();\n    }\n\n    type = args[0];\n    listener = args[1];\n  } else {\n    target = args[0];\n    type = args[1];\n    listener = args[2];\n  }\n\n  validateTarget(target, self, fnName);\n  validateEventType(type, self, fnName);\n  validateListener(listener, self, fnName);\n  listener = bind(self, listener);\n  return {\n    isTargetingSelf: isTargetingSelf,\n    target: target,\n    type: type,\n    listener: listener\n  };\n};\n/**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param  {Element|Object} target\n *         A DOM node or evented object.\n *\n * @param  {string} method\n *         The event binding method to use (\"on\" or \"one\").\n *\n * @param  {string|Array} type\n *         One or more event type(s).\n *\n * @param  {Function} listener\n *         A listener function.\n */\n\n\nvar listen = function listen(target, method, type, listener) {\n  validateTarget(target, target, method);\n\n  if (target.nodeName) {\n    Events[method](target, type, listener);\n  } else {\n    target[method](type, listener);\n  }\n};\n/**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\n\n\nvar EventedMixin = {\n  /**\n   * Add a listener to an event (or events) on this object or another evented\n   * object.\n   *\n   * @param  {string|Array|Element|Object} targetOrType\n   *         If this is a string or array, it represents the event type(s)\n   *         that will trigger the listener.\n   *\n   *         Another evented object can be passed here instead, which will\n   *         cause the listener to listen for events on _that_ object.\n   *\n   *         In either case, the listener's `this` value will be bound to\n   *         this object.\n   *\n   * @param  {string|Array|Function} typeOrListener\n   *         If the first argument was a string or array, this should be the\n   *         listener function. Otherwise, this is a string or array of event\n   *         type(s).\n   *\n   * @param  {Function} [listener]\n   *         If the first argument was another evented object, this will be\n   *         the listener function.\n   */\n  on: function on() {\n    var _this = this;\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    var _normalizeListenArgs = normalizeListenArgs(this, args, 'on'),\n        isTargetingSelf = _normalizeListenArgs.isTargetingSelf,\n        target = _normalizeListenArgs.target,\n        type = _normalizeListenArgs.type,\n        listener = _normalizeListenArgs.listener;\n\n    listen(target, 'on', type, listener); // If this object is listening to another evented object.\n\n    if (!isTargetingSelf) {\n      // If this object is disposed, remove the listener.\n      var removeListenerOnDispose = function removeListenerOnDispose() {\n        return _this.off(target, type, listener);\n      }; // Use the same function ID as the listener so we can remove it later it\n      // using the ID of the original listener.\n\n\n      removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures\n      // that if the target is disposed BEFORE this object, we remove the\n      // removal listener that was just added. Otherwise, we create a memory leak.\n\n      var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() {\n        return _this.off('dispose', removeListenerOnDispose);\n      }; // Use the same function ID as the listener so we can remove it later\n      // it using the ID of the original listener.\n\n\n      removeRemoverOnTargetDispose.guid = listener.guid;\n      listen(this, 'on', 'dispose', removeListenerOnDispose);\n      listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n    }\n  },\n\n  /**\n   * Add a listener to an event (or events) on this object or another evented\n   * object. The listener will be called once per event and then removed.\n   *\n   * @param  {string|Array|Element|Object} targetOrType\n   *         If this is a string or array, it represents the event type(s)\n   *         that will trigger the listener.\n   *\n   *         Another evented object can be passed here instead, which will\n   *         cause the listener to listen for events on _that_ object.\n   *\n   *         In either case, the listener's `this` value will be bound to\n   *         this object.\n   *\n   * @param  {string|Array|Function} typeOrListener\n   *         If the first argument was a string or array, this should be the\n   *         listener function. Otherwise, this is a string or array of event\n   *         type(s).\n   *\n   * @param  {Function} [listener]\n   *         If the first argument was another evented object, this will be\n   *         the listener function.\n   */\n  one: function one() {\n    var _this2 = this;\n\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    var _normalizeListenArgs2 = normalizeListenArgs(this, args, 'one'),\n        isTargetingSelf = _normalizeListenArgs2.isTargetingSelf,\n        target = _normalizeListenArgs2.target,\n        type = _normalizeListenArgs2.type,\n        listener = _normalizeListenArgs2.listener; // Targeting this evented object.\n\n\n    if (isTargetingSelf) {\n      listen(target, 'one', type, listener); // Targeting another evented object.\n    } else {\n      // TODO: This wrapper is incorrect! It should only\n      //       remove the wrapper for the event type that called it.\n      //       Instead all listners are removed on the first trigger!\n      //       see https://github.com/videojs/video.js/issues/5962\n      var wrapper = function wrapper() {\n        _this2.off(target, type, wrapper);\n\n        for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n          largs[_key3] = arguments[_key3];\n        }\n\n        listener.apply(null, largs);\n      }; // Use the same function ID as the listener so we can remove it later\n      // it using the ID of the original listener.\n\n\n      wrapper.guid = listener.guid;\n      listen(target, 'one', type, wrapper);\n    }\n  },\n\n  /**\n   * Add a listener to an event (or events) on this object or another evented\n   * object. The listener will only be called once for the first event that is triggered\n   * then removed.\n   *\n   * @param  {string|Array|Element|Object} targetOrType\n   *         If this is a string or array, it represents the event type(s)\n   *         that will trigger the listener.\n   *\n   *         Another evented object can be passed here instead, which will\n   *         cause the listener to listen for events on _that_ object.\n   *\n   *         In either case, the listener's `this` value will be bound to\n   *         this object.\n   *\n   * @param  {string|Array|Function} typeOrListener\n   *         If the first argument was a string or array, this should be the\n   *         listener function. Otherwise, this is a string or array of event\n   *         type(s).\n   *\n   * @param  {Function} [listener]\n   *         If the first argument was another evented object, this will be\n   *         the listener function.\n   */\n  any: function any() {\n    var _this3 = this;\n\n    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n      args[_key4] = arguments[_key4];\n    }\n\n    var _normalizeListenArgs3 = normalizeListenArgs(this, args, 'any'),\n        isTargetingSelf = _normalizeListenArgs3.isTargetingSelf,\n        target = _normalizeListenArgs3.target,\n        type = _normalizeListenArgs3.type,\n        listener = _normalizeListenArgs3.listener; // Targeting this evented object.\n\n\n    if (isTargetingSelf) {\n      listen(target, 'any', type, listener); // Targeting another evented object.\n    } else {\n      var wrapper = function wrapper() {\n        _this3.off(target, type, wrapper);\n\n        for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n          largs[_key5] = arguments[_key5];\n        }\n\n        listener.apply(null, largs);\n      }; // Use the same function ID as the listener so we can remove it later\n      // it using the ID of the original listener.\n\n\n      wrapper.guid = listener.guid;\n      listen(target, 'any', type, wrapper);\n    }\n  },\n\n  /**\n   * Removes listener(s) from event(s) on an evented object.\n   *\n   * @param  {string|Array|Element|Object} [targetOrType]\n   *         If this is a string or array, it represents the event type(s).\n   *\n   *         Another evented object can be passed here instead, in which case\n   *         ALL 3 arguments are _required_.\n   *\n   * @param  {string|Array|Function} [typeOrListener]\n   *         If the first argument was a string or array, this may be the\n   *         listener function. Otherwise, this is a string or array of event\n   *         type(s).\n   *\n   * @param  {Function} [listener]\n   *         If the first argument was another evented object, this will be\n   *         the listener function; otherwise, _all_ listeners bound to the\n   *         event type(s) will be removed.\n   */\n  off: function off$1(targetOrType, typeOrListener, listener) {\n    // Targeting this evented object.\n    if (!targetOrType || isValidEventType(targetOrType)) {\n      off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object.\n    } else {\n      var target = targetOrType;\n      var type = typeOrListener; // Fail fast and in a meaningful way!\n\n      validateTarget(target, this, 'off');\n      validateEventType(type, this, 'off');\n      validateListener(listener, this, 'off'); // Ensure there's at least a guid, even if the function hasn't been used\n\n      listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given\n      // the same guid as the event listener in on().\n\n      this.off('dispose', listener);\n\n      if (target.nodeName) {\n        off(target, type, listener);\n        off(target, 'dispose', listener);\n      } else if (isEvented(target)) {\n        target.off(type, listener);\n        target.off('dispose', listener);\n      }\n    }\n  },\n\n  /**\n   * Fire an event on this evented object, causing its listeners to be called.\n   *\n   * @param   {string|Object} event\n   *          An event type or an object with a type property.\n   *\n   * @param   {Object} [hash]\n   *          An additional object to pass along to listeners.\n   *\n   * @return {boolean}\n   *          Whether or not the default behavior was prevented.\n   */\n  trigger: function trigger$1(event, hash) {\n    validateTarget(this.eventBusEl_, this, 'trigger');\n    var type = event && typeof event !== 'string' ? event.type : event;\n\n    if (!isValidEventType(type)) {\n      var error = \"Invalid event type for \" + objName(this) + \"#trigger; \" + 'must be a non-empty string or object with a type key that has a non-empty value.';\n\n      if (event) {\n        (this.log || log$1).error(error);\n      } else {\n        throw new Error(error);\n      }\n    }\n\n    return trigger(this.eventBusEl_, event, hash);\n  }\n};\n/**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param  {Object} target\n *         The object to which to add event methods.\n *\n * @param  {Object} [options={}]\n *         Options for customizing the mixin behavior.\n *\n * @param  {string} [options.eventBusKey]\n *         By default, adds a `eventBusEl_` DOM element to the target object,\n *         which is used as an event bus. If the target object already has a\n *         DOM element that should be used, pass its key here.\n *\n * @return {Object}\n *         The target object.\n */\n\nfunction evented(target, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var _options = options,\n      eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_.\n\n  if (eventBusKey) {\n    if (!target[eventBusKey].nodeName) {\n      throw new Error(\"The eventBusKey \\\"\" + eventBusKey + \"\\\" does not refer to an element.\");\n    }\n\n    target.eventBusEl_ = target[eventBusKey];\n  } else {\n    target.eventBusEl_ = createEl('span', {\n      className: 'vjs-event-bus'\n    });\n  }\n\n  assign(target, EventedMixin);\n\n  if (target.eventedCallbacks) {\n    target.eventedCallbacks.forEach(function (callback) {\n      callback();\n    });\n  } // When any evented object is disposed, it removes all its listeners.\n\n\n  target.on('dispose', function () {\n    target.off();\n    [target, target.el_, target.eventBusEl_].forEach(function (val) {\n      if (val && DomData.has(val)) {\n        DomData[\"delete\"](val);\n      }\n    });\n    window$1.setTimeout(function () {\n      target.eventBusEl_ = null;\n    }, 0);\n  });\n  return target;\n}\n\n/**\n * @file mixins/stateful.js\n * @module stateful\n */\n/**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\n\nvar StatefulMixin = {\n  /**\n   * A hash containing arbitrary keys and values representing the state of\n   * the object.\n   *\n   * @type {Object}\n   */\n  state: {},\n\n  /**\n   * Set the state of an object by mutating its\n   * {@link module:stateful~StatefulMixin.state|state} object in place.\n   *\n   * @fires   module:stateful~StatefulMixin#statechanged\n   * @param   {Object|Function} stateUpdates\n   *          A new set of properties to shallow-merge into the plugin state.\n   *          Can be a plain object or a function returning a plain object.\n   *\n   * @return {Object|undefined}\n   *          An object containing changes that occurred. If no changes\n   *          occurred, returns `undefined`.\n   */\n  setState: function setState(stateUpdates) {\n    var _this = this;\n\n    // Support providing the `stateUpdates` state as a function.\n    if (typeof stateUpdates === 'function') {\n      stateUpdates = stateUpdates();\n    }\n\n    var changes;\n    each(stateUpdates, function (value, key) {\n      // Record the change if the value is different from what's in the\n      // current state.\n      if (_this.state[key] !== value) {\n        changes = changes || {};\n        changes[key] = {\n          from: _this.state[key],\n          to: value\n        };\n      }\n\n      _this.state[key] = value;\n    }); // Only trigger \"statechange\" if there were changes AND we have a trigger\n    // function. This allows us to not require that the target object be an\n    // evented object.\n\n    if (changes && isEvented(this)) {\n      /**\n       * An event triggered on an object that is both\n       * {@link module:stateful|stateful} and {@link module:evented|evented}\n       * indicating that its state has changed.\n       *\n       * @event    module:stateful~StatefulMixin#statechanged\n       * @type     {Object}\n       * @property {Object} changes\n       *           A hash containing the properties that were changed and\n       *           the values they were changed `from` and `to`.\n       */\n      this.trigger({\n        changes: changes,\n        type: 'statechanged'\n      });\n    }\n\n    return changes;\n  }\n};\n/**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param   {Object} target\n *          The object to be made stateful.\n *\n * @param   {Object} [defaultState]\n *          A default set of properties to populate the newly-stateful object's\n *          `state` property.\n *\n * @return {Object}\n *          Returns the `target`.\n */\n\nfunction stateful(target, defaultState) {\n  assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state`\n  // added in that step.\n\n  target.state = assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists.\n\n  if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n    target.on('statechanged', target.handleStateChanged);\n  }\n\n  return target;\n}\n\n/**\n * @file string-cases.js\n * @module to-lower-case\n */\n\n/**\n * Lowercase the first letter of a string.\n *\n * @param {string} string\n *        String to be lowercased\n *\n * @return {string}\n *         The string with a lowercased first letter\n */\nvar toLowerCase = function toLowerCase(string) {\n  if (typeof string !== 'string') {\n    return string;\n  }\n\n  return string.replace(/./, function (w) {\n    return w.toLowerCase();\n  });\n};\n/**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n *        String to be uppercased\n *\n * @return {string}\n *         The string with an uppercased first letter\n */\n\nvar toTitleCase$1 = function toTitleCase(string) {\n  if (typeof string !== 'string') {\n    return string;\n  }\n\n  return string.replace(/./, function (w) {\n    return w.toUpperCase();\n  });\n};\n/**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n *        The first string to compare\n *\n * @param {string} str2\n *        The second string to compare\n *\n * @return {boolean}\n *         Whether the TitleCase versions of the strings are equal\n */\n\nvar titleCaseEquals = function titleCaseEquals(str1, str2) {\n  return toTitleCase$1(str1) === toTitleCase$1(str2);\n};\n\n/**\n * @file merge-options.js\n * @module merge-options\n */\n/**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @static\n * @param   {Object[]} sources\n *          One or more objects to merge into a new object.\n *\n * @return {Object}\n *          A new object that is the merged result of all sources.\n */\n\nfunction mergeOptions$3() {\n  var result = {};\n\n  for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n    sources[_key] = arguments[_key];\n  }\n\n  sources.forEach(function (source) {\n    if (!source) {\n      return;\n    }\n\n    each(source, function (value, key) {\n      if (!isPlain(value)) {\n        result[key] = value;\n        return;\n      }\n\n      if (!isPlain(result[key])) {\n        result[key] = {};\n      }\n\n      result[key] = mergeOptions$3(result[key], value);\n    });\n  });\n  return result;\n}\n\nvar MapSham = /*#__PURE__*/function () {\n  function MapSham() {\n    this.map_ = {};\n  }\n\n  var _proto = MapSham.prototype;\n\n  _proto.has = function has(key) {\n    return key in this.map_;\n  };\n\n  _proto[\"delete\"] = function _delete(key) {\n    var has = this.has(key);\n    delete this.map_[key];\n    return has;\n  };\n\n  _proto.set = function set(key, value) {\n    this.map_[key] = value;\n    return this;\n  };\n\n  _proto.forEach = function forEach(callback, thisArg) {\n    for (var key in this.map_) {\n      callback.call(thisArg, this.map_[key], key, this);\n    }\n  };\n\n  return MapSham;\n}();\n\nvar Map$1 = window$1.Map ? window$1.Map : MapSham;\n\nvar SetSham = /*#__PURE__*/function () {\n  function SetSham() {\n    this.set_ = {};\n  }\n\n  var _proto = SetSham.prototype;\n\n  _proto.has = function has(key) {\n    return key in this.set_;\n  };\n\n  _proto[\"delete\"] = function _delete(key) {\n    var has = this.has(key);\n    delete this.set_[key];\n    return has;\n  };\n\n  _proto.add = function add(key) {\n    this.set_[key] = 1;\n    return this;\n  };\n\n  _proto.forEach = function forEach(callback, thisArg) {\n    for (var key in this.set_) {\n      callback.call(thisArg, key, key, this);\n    }\n  };\n\n  return SetSham;\n}();\n\nvar Set$1 = window$1.Set ? window$1.Set : SetSham;\n\n/**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n/**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\n\nvar Component$1 = /*#__PURE__*/function () {\n  /**\n   * A callback that is called when a component is ready. Does not have any\n   * paramters and any callback value will be ignored.\n   *\n   * @callback Component~ReadyCallback\n   * @this Component\n   */\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of component options.\n   *\n   * @param {Object[]} [options.children]\n   *        An array of children objects to intialize this component with. Children objects have\n   *        a name property that will be used if more than one component of the same type needs to be\n   *        added.\n   *\n   * @param  {string} [options.className]\n   *         A class or space separated list of classes to add the component\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        Function that gets called when the `Component` is ready.\n   */\n  function Component(player, options, ready) {\n    var _this = this;\n\n    // The component might be the player itself and we can't pass `this` to super\n    if (!player && this.play) {\n      this.player_ = player = this; // eslint-disable-line\n    } else {\n      this.player_ = player;\n    }\n\n    this.isDisposed_ = false; // Hold the reference to the parent component via `addChild` method\n\n    this.parentComponent_ = null; // Make a copy of prototype.options_ to protect against overriding defaults\n\n    this.options_ = mergeOptions$3({}, this.options_); // Updated options with supplied options\n\n    options = this.options_ = mergeOptions$3(this.options_, options); // Get ID from options or options element if one is supplied\n\n    this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one\n\n    if (!this.id_) {\n      // Don't require the player ID function in the case of mock players\n      var id = player && player.id && player.id() || 'no_player';\n      this.id_ = id + \"_component_\" + newGUID();\n    }\n\n    this.name_ = options.name || null; // Create element if one wasn't provided in options\n\n    if (options.el) {\n      this.el_ = options.el;\n    } else if (options.createEl !== false) {\n      this.el_ = this.createEl();\n    }\n\n    if (options.className && this.el_) {\n      options.className.split(' ').forEach(function (c) {\n        return _this.addClass(c);\n      });\n    } // if evented is anything except false, we want to mixin in evented\n\n\n    if (options.evented !== false) {\n      // Make this an evented object and use `el_`, if available, as its event bus\n      evented(this, {\n        eventBusKey: this.el_ ? 'el_' : null\n      });\n      this.handleLanguagechange = this.handleLanguagechange.bind(this);\n      this.on(this.player_, 'languagechange', this.handleLanguagechange);\n    }\n\n    stateful(this, this.constructor.defaultState);\n    this.children_ = [];\n    this.childIndex_ = {};\n    this.childNameIndex_ = {};\n    this.setTimeoutIds_ = new Set$1();\n    this.setIntervalIds_ = new Set$1();\n    this.rafIds_ = new Set$1();\n    this.namedRafs_ = new Map$1();\n    this.clearingTimersOnDispose_ = false; // Add any child components in options\n\n    if (options.initChildren !== false) {\n      this.initChildren();\n    } // Don't want to trigger ready here or it will go before init is actually\n    // finished for all children that run this constructor\n\n\n    this.ready(ready);\n\n    if (options.reportTouchActivity !== false) {\n      this.enableTouchActivity();\n    }\n  }\n  /**\n   * Dispose of the `Component` and all child components.\n   *\n   * @fires Component#dispose\n   *\n   * @param {Object} options\n   * @param {Element} options.originalEl element with which to replace player element\n   */\n\n\n  var _proto = Component.prototype;\n\n  _proto.dispose = function dispose(options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    // Bail out if the component has already been disposed.\n    if (this.isDisposed_) {\n      return;\n    }\n\n    if (this.readyQueue_) {\n      this.readyQueue_.length = 0;\n    }\n    /**\n     * Triggered when a `Component` is disposed.\n     *\n     * @event Component#dispose\n     * @type {EventTarget~Event}\n     *\n     * @property {boolean} [bubbles=false]\n     *           set to false so that the dispose event does not\n     *           bubble up\n     */\n\n\n    this.trigger({\n      type: 'dispose',\n      bubbles: false\n    });\n    this.isDisposed_ = true; // Dispose all children.\n\n    if (this.children_) {\n      for (var i = this.children_.length - 1; i >= 0; i--) {\n        if (this.children_[i].dispose) {\n          this.children_[i].dispose();\n        }\n      }\n    } // Delete child references\n\n\n    this.children_ = null;\n    this.childIndex_ = null;\n    this.childNameIndex_ = null;\n    this.parentComponent_ = null;\n\n    if (this.el_) {\n      // Remove element from DOM\n      if (this.el_.parentNode) {\n        if (options.restoreEl) {\n          this.el_.parentNode.replaceChild(options.restoreEl, this.el_);\n        } else {\n          this.el_.parentNode.removeChild(this.el_);\n        }\n      }\n\n      this.el_ = null;\n    } // remove reference to the player after disposing of the element\n\n\n    this.player_ = null;\n  }\n  /**\n   * Determine whether or not this component has been disposed.\n   *\n   * @return {boolean}\n   *         If the component has been disposed, will be `true`. Otherwise, `false`.\n   */\n  ;\n\n  _proto.isDisposed = function isDisposed() {\n    return Boolean(this.isDisposed_);\n  }\n  /**\n   * Return the {@link Player} that the `Component` has attached to.\n   *\n   * @return {Player}\n   *         The player that this `Component` has attached to.\n   */\n  ;\n\n  _proto.player = function player() {\n    return this.player_;\n  }\n  /**\n   * Deep merge of options objects with new options.\n   * > Note: When both `obj` and `options` contain properties whose values are objects.\n   *         The two properties get merged using {@link module:mergeOptions}\n   *\n   * @param {Object} obj\n   *        The object that contains new options.\n   *\n   * @return {Object}\n   *         A new object of `this.options_` and `obj` merged together.\n   */\n  ;\n\n  _proto.options = function options(obj) {\n    if (!obj) {\n      return this.options_;\n    }\n\n    this.options_ = mergeOptions$3(this.options_, obj);\n    return this.options_;\n  }\n  /**\n   * Get the `Component`s DOM element\n   *\n   * @return {Element}\n   *         The DOM element for this `Component`.\n   */\n  ;\n\n  _proto.el = function el() {\n    return this.el_;\n  }\n  /**\n   * Create the `Component`s DOM element.\n   *\n   * @param {string} [tagName]\n   *        Element's DOM node type. e.g. 'div'\n   *\n   * @param {Object} [properties]\n   *        An object of properties that should be set.\n   *\n   * @param {Object} [attributes]\n   *        An object of attributes that should be set.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl$1(tagName, properties, attributes) {\n    return createEl(tagName, properties, attributes);\n  }\n  /**\n   * Localize a string given the string in english.\n   *\n   * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n   * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n   *\n   * If a `defaultValue` is provided, it'll use that over `string`,\n   * if a value isn't found in provided language files.\n   * This is useful if you want to have a descriptive key for token replacement\n   * but have a succinct localized string and not require `en.json` to be included.\n   *\n   * Currently, it is used for the progress bar timing.\n   * ```js\n   * {\n   *   \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n   * }\n   * ```\n   * It is then used like so:\n   * ```js\n   * this.localize('progress bar timing: currentTime={1} duration{2}',\n   *               [this.player_.currentTime(), this.player_.duration()],\n   *               '{1} of {2}');\n   * ```\n   *\n   * Which outputs something like: `01:23 of 24:56`.\n   *\n   *\n   * @param {string} string\n   *        The string to localize and the key to lookup in the language files.\n   * @param {string[]} [tokens]\n   *        If the current item has token replacements, provide the tokens here.\n   * @param {string} [defaultValue]\n   *        Defaults to `string`. Can be a default value to use for token replacement\n   *        if the lookup key is needed to be separate.\n   *\n   * @return {string}\n   *         The localized string or if no localization exists the english string.\n   */\n  ;\n\n  _proto.localize = function localize(string, tokens, defaultValue) {\n    if (defaultValue === void 0) {\n      defaultValue = string;\n    }\n\n    var code = this.player_.language && this.player_.language();\n    var languages = this.player_.languages && this.player_.languages();\n    var language = languages && languages[code];\n    var primaryCode = code && code.split('-')[0];\n    var primaryLang = languages && languages[primaryCode];\n    var localizedString = defaultValue;\n\n    if (language && language[string]) {\n      localizedString = language[string];\n    } else if (primaryLang && primaryLang[string]) {\n      localizedString = primaryLang[string];\n    }\n\n    if (tokens) {\n      localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n        var value = tokens[index - 1];\n        var ret = value;\n\n        if (typeof value === 'undefined') {\n          ret = match;\n        }\n\n        return ret;\n      });\n    }\n\n    return localizedString;\n  }\n  /**\n   * Handles language change for the player in components. Should be overriden by sub-components.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.handleLanguagechange = function handleLanguagechange() {}\n  /**\n   * Return the `Component`s DOM element. This is where children get inserted.\n   * This will usually be the the same as the element returned in {@link Component#el}.\n   *\n   * @return {Element}\n   *         The content element for this `Component`.\n   */\n  ;\n\n  _proto.contentEl = function contentEl() {\n    return this.contentEl_ || this.el_;\n  }\n  /**\n   * Get this `Component`s ID\n   *\n   * @return {string}\n   *         The id of this `Component`\n   */\n  ;\n\n  _proto.id = function id() {\n    return this.id_;\n  }\n  /**\n   * Get the `Component`s name. The name gets used to reference the `Component`\n   * and is set during registration.\n   *\n   * @return {string}\n   *         The name of this `Component`.\n   */\n  ;\n\n  _proto.name = function name() {\n    return this.name_;\n  }\n  /**\n   * Get an array of all child components\n   *\n   * @return {Array}\n   *         The children\n   */\n  ;\n\n  _proto.children = function children() {\n    return this.children_;\n  }\n  /**\n   * Returns the child `Component` with the given `id`.\n   *\n   * @param {string} id\n   *        The id of the child `Component` to get.\n   *\n   * @return {Component|undefined}\n   *         The child `Component` with the given `id` or undefined.\n   */\n  ;\n\n  _proto.getChildById = function getChildById(id) {\n    return this.childIndex_[id];\n  }\n  /**\n   * Returns the child `Component` with the given `name`.\n   *\n   * @param {string} name\n   *        The name of the child `Component` to get.\n   *\n   * @return {Component|undefined}\n   *         The child `Component` with the given `name` or undefined.\n   */\n  ;\n\n  _proto.getChild = function getChild(name) {\n    if (!name) {\n      return;\n    }\n\n    return this.childNameIndex_[name];\n  }\n  /**\n   * Returns the descendant `Component` following the givent\n   * descendant `names`. For instance ['foo', 'bar', 'baz'] would\n   * try to get 'foo' on the current component, 'bar' on the 'foo'\n   * component and 'baz' on the 'bar' component and return undefined\n   * if any of those don't exist.\n   *\n   * @param {...string[]|...string} names\n   *        The name of the child `Component` to get.\n   *\n   * @return {Component|undefined}\n   *         The descendant `Component` following the given descendant\n   *         `names` or undefined.\n   */\n  ;\n\n  _proto.getDescendant = function getDescendant() {\n    for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {\n      names[_key] = arguments[_key];\n    }\n\n    // flatten array argument into the main array\n    names = names.reduce(function (acc, n) {\n      return acc.concat(n);\n    }, []);\n    var currentChild = this;\n\n    for (var i = 0; i < names.length; i++) {\n      currentChild = currentChild.getChild(names[i]);\n\n      if (!currentChild || !currentChild.getChild) {\n        return;\n      }\n    }\n\n    return currentChild;\n  }\n  /**\n   * Add a child `Component` inside the current `Component`.\n   *\n   *\n   * @param {string|Component} child\n   *        The name or instance of a child to add.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of options that will get passed to children of\n   *        the child.\n   *\n   * @param {number} [index=this.children_.length]\n   *        The index to attempt to add a child into.\n   *\n   * @return {Component}\n   *         The `Component` that gets added as a child. When using a string the\n   *         `Component` will get created by this process.\n   */\n  ;\n\n  _proto.addChild = function addChild(child, options, index) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    if (index === void 0) {\n      index = this.children_.length;\n    }\n\n    var component;\n    var componentName; // If child is a string, create component with options\n\n    if (typeof child === 'string') {\n      componentName = toTitleCase$1(child);\n      var componentClassName = options.componentClass || componentName; // Set name through options\n\n      options.name = componentName; // Create a new object & element for this controls set\n      // If there's no .player_, this is a player\n\n      var ComponentClass = Component.getComponent(componentClassName);\n\n      if (!ComponentClass) {\n        throw new Error(\"Component \" + componentClassName + \" does not exist\");\n      } // data stored directly on the videojs object may be\n      // misidentified as a component to retain\n      // backwards-compatibility with 4.x. check to make sure the\n      // component class can be instantiated.\n\n\n      if (typeof ComponentClass !== 'function') {\n        return null;\n      }\n\n      component = new ComponentClass(this.player_ || this, options); // child is a component instance\n    } else {\n      component = child;\n    }\n\n    if (component.parentComponent_) {\n      component.parentComponent_.removeChild(component);\n    }\n\n    this.children_.splice(index, 0, component);\n    component.parentComponent_ = this;\n\n    if (typeof component.id === 'function') {\n      this.childIndex_[component.id()] = component;\n    } // If a name wasn't used to create the component, check if we can use the\n    // name function of the component\n\n\n    componentName = componentName || component.name && toTitleCase$1(component.name());\n\n    if (componentName) {\n      this.childNameIndex_[componentName] = component;\n      this.childNameIndex_[toLowerCase(componentName)] = component;\n    } // Add the UI object's element to the container div (box)\n    // Having an element is not required\n\n\n    if (typeof component.el === 'function' && component.el()) {\n      // If inserting before a component, insert before that component's element\n      var refNode = null;\n\n      if (this.children_[index + 1]) {\n        // Most children are components, but the video tech is an HTML element\n        if (this.children_[index + 1].el_) {\n          refNode = this.children_[index + 1].el_;\n        } else if (isEl(this.children_[index + 1])) {\n          refNode = this.children_[index + 1];\n        }\n      }\n\n      this.contentEl().insertBefore(component.el(), refNode);\n    } // Return so it can stored on parent object if desired.\n\n\n    return component;\n  }\n  /**\n   * Remove a child `Component` from this `Component`s list of children. Also removes\n   * the child `Component`s element from this `Component`s element.\n   *\n   * @param {Component} component\n   *        The child `Component` to remove.\n   */\n  ;\n\n  _proto.removeChild = function removeChild(component) {\n    if (typeof component === 'string') {\n      component = this.getChild(component);\n    }\n\n    if (!component || !this.children_) {\n      return;\n    }\n\n    var childFound = false;\n\n    for (var i = this.children_.length - 1; i >= 0; i--) {\n      if (this.children_[i] === component) {\n        childFound = true;\n        this.children_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (!childFound) {\n      return;\n    }\n\n    component.parentComponent_ = null;\n    this.childIndex_[component.id()] = null;\n    this.childNameIndex_[toTitleCase$1(component.name())] = null;\n    this.childNameIndex_[toLowerCase(component.name())] = null;\n    var compEl = component.el();\n\n    if (compEl && compEl.parentNode === this.contentEl()) {\n      this.contentEl().removeChild(component.el());\n    }\n  }\n  /**\n   * Add and initialize default child `Component`s based upon options.\n   */\n  ;\n\n  _proto.initChildren = function initChildren() {\n    var _this2 = this;\n\n    var children = this.options_.children;\n\n    if (children) {\n      // `this` is `parent`\n      var parentOptions = this.options_;\n\n      var handleAdd = function handleAdd(child) {\n        var name = child.name;\n        var opts = child.opts; // Allow options for children to be set at the parent options\n        // e.g. videojs(id, { controlBar: false });\n        // instead of videojs(id, { children: { controlBar: false });\n\n        if (parentOptions[name] !== undefined) {\n          opts = parentOptions[name];\n        } // Allow for disabling default components\n        // e.g. options['children']['posterImage'] = false\n\n\n        if (opts === false) {\n          return;\n        } // Allow options to be passed as a simple boolean if no configuration\n        // is necessary.\n\n\n        if (opts === true) {\n          opts = {};\n        } // We also want to pass the original player options\n        // to each component as well so they don't need to\n        // reach back into the player for options later.\n\n\n        opts.playerOptions = _this2.options_.playerOptions; // Create and add the child component.\n        // Add a direct reference to the child by name on the parent instance.\n        // If two of the same component are used, different names should be supplied\n        // for each\n\n        var newChild = _this2.addChild(name, opts);\n\n        if (newChild) {\n          _this2[name] = newChild;\n        }\n      }; // Allow for an array of children details to passed in the options\n\n\n      var workingChildren;\n      var Tech = Component.getComponent('Tech');\n\n      if (Array.isArray(children)) {\n        workingChildren = children;\n      } else {\n        workingChildren = Object.keys(children);\n      }\n\n      workingChildren // children that are in this.options_ but also in workingChildren  would\n      // give us extra children we do not want. So, we want to filter them out.\n      .concat(Object.keys(this.options_).filter(function (child) {\n        return !workingChildren.some(function (wchild) {\n          if (typeof wchild === 'string') {\n            return child === wchild;\n          }\n\n          return child === wchild.name;\n        });\n      })).map(function (child) {\n        var name;\n        var opts;\n\n        if (typeof child === 'string') {\n          name = child;\n          opts = children[name] || _this2.options_[name] || {};\n        } else {\n          name = child.name;\n          opts = child;\n        }\n\n        return {\n          name: name,\n          opts: opts\n        };\n      }).filter(function (child) {\n        // we have to make sure that child.name isn't in the techOrder since\n        // techs are registerd as Components but can't aren't compatible\n        // See https://github.com/videojs/video.js/issues/2772\n        var c = Component.getComponent(child.opts.componentClass || toTitleCase$1(child.name));\n        return c && !Tech.isTech(c);\n      }).forEach(handleAdd);\n    }\n  }\n  /**\n   * Builds the default DOM class name. Should be overriden by sub-components.\n   *\n   * @return {string}\n   *         The DOM class name for this object.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    // Child classes can include a function that does:\n    // return 'CLASS NAME' + this._super();\n    return '';\n  }\n  /**\n   * Bind a listener to the component's ready state.\n   * Different from event listeners in that if the ready event has already happened\n   * it will trigger the function immediately.\n   *\n   * @return {Component}\n   *         Returns itself; method can be chained.\n   */\n  ;\n\n  _proto.ready = function ready(fn, sync) {\n    if (sync === void 0) {\n      sync = false;\n    }\n\n    if (!fn) {\n      return;\n    }\n\n    if (!this.isReady_) {\n      this.readyQueue_ = this.readyQueue_ || [];\n      this.readyQueue_.push(fn);\n      return;\n    }\n\n    if (sync) {\n      fn.call(this);\n    } else {\n      // Call the function asynchronously by default for consistency\n      this.setTimeout(fn, 1);\n    }\n  }\n  /**\n   * Trigger all the ready listeners for this `Component`.\n   *\n   * @fires Component#ready\n   */\n  ;\n\n  _proto.triggerReady = function triggerReady() {\n    this.isReady_ = true; // Ensure ready is triggered asynchronously\n\n    this.setTimeout(function () {\n      var readyQueue = this.readyQueue_; // Reset Ready Queue\n\n      this.readyQueue_ = [];\n\n      if (readyQueue && readyQueue.length > 0) {\n        readyQueue.forEach(function (fn) {\n          fn.call(this);\n        }, this);\n      } // Allow for using event listeners also\n\n      /**\n       * Triggered when a `Component` is ready.\n       *\n       * @event Component#ready\n       * @type {EventTarget~Event}\n       */\n\n\n      this.trigger('ready');\n    }, 1);\n  }\n  /**\n   * Find a single DOM element matching a `selector`. This can be within the `Component`s\n   * `contentEl()` or another custom context.\n   *\n   * @param {string} selector\n   *        A valid CSS selector, which will be passed to `querySelector`.\n   *\n   * @param {Element|string} [context=this.contentEl()]\n   *        A DOM element within which to query. Can also be a selector string in\n   *        which case the first matching element will get used as context. If\n   *        missing `this.contentEl()` gets used. If  `this.contentEl()` returns\n   *        nothing it falls back to `document`.\n   *\n   * @return {Element|null}\n   *         the dom element that was found, or null\n   *\n   * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n   */\n  ;\n\n  _proto.$ = function $$1(selector, context) {\n    return $(selector, context || this.contentEl());\n  }\n  /**\n   * Finds all DOM element matching a `selector`. This can be within the `Component`s\n   * `contentEl()` or another custom context.\n   *\n   * @param {string} selector\n   *        A valid CSS selector, which will be passed to `querySelectorAll`.\n   *\n   * @param {Element|string} [context=this.contentEl()]\n   *        A DOM element within which to query. Can also be a selector string in\n   *        which case the first matching element will get used as context. If\n   *        missing `this.contentEl()` gets used. If  `this.contentEl()` returns\n   *        nothing it falls back to `document`.\n   *\n   * @return {NodeList}\n   *         a list of dom elements that were found\n   *\n   * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n   */\n  ;\n\n  _proto.$$ = function $$$1(selector, context) {\n    return $$(selector, context || this.contentEl());\n  }\n  /**\n   * Check if a component's element has a CSS class name.\n   *\n   * @param {string} classToCheck\n   *        CSS class name to check.\n   *\n   * @return {boolean}\n   *         - True if the `Component` has the class.\n   *         - False if the `Component` does not have the class`\n   */\n  ;\n\n  _proto.hasClass = function hasClass$1(classToCheck) {\n    return hasClass(this.el_, classToCheck);\n  }\n  /**\n   * Add a CSS class name to the `Component`s element.\n   *\n   * @param {string} classToAdd\n   *        CSS class name to add\n   */\n  ;\n\n  _proto.addClass = function addClass$1(classToAdd) {\n    addClass(this.el_, classToAdd);\n  }\n  /**\n   * Remove a CSS class name from the `Component`s element.\n   *\n   * @param {string} classToRemove\n   *        CSS class name to remove\n   */\n  ;\n\n  _proto.removeClass = function removeClass$1(classToRemove) {\n    removeClass(this.el_, classToRemove);\n  }\n  /**\n   * Add or remove a CSS class name from the component's element.\n   * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n   * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n   *\n   * @param  {string} classToToggle\n   *         The class to add or remove based on (@link Component#hasClass}\n   *\n   * @param  {boolean|Dom~predicate} [predicate]\n   *         An {@link Dom~predicate} function or a boolean\n   */\n  ;\n\n  _proto.toggleClass = function toggleClass$1(classToToggle, predicate) {\n    toggleClass(this.el_, classToToggle, predicate);\n  }\n  /**\n   * Show the `Component`s element if it is hidden by removing the\n   * 'vjs-hidden' class name from it.\n   */\n  ;\n\n  _proto.show = function show() {\n    this.removeClass('vjs-hidden');\n  }\n  /**\n   * Hide the `Component`s element if it is currently showing by adding the\n   * 'vjs-hidden` class name to it.\n   */\n  ;\n\n  _proto.hide = function hide() {\n    this.addClass('vjs-hidden');\n  }\n  /**\n   * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n   * class name to it. Used during fadeIn/fadeOut.\n   *\n   * @private\n   */\n  ;\n\n  _proto.lockShowing = function lockShowing() {\n    this.addClass('vjs-lock-showing');\n  }\n  /**\n   * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n   * class name from it. Used during fadeIn/fadeOut.\n   *\n   * @private\n   */\n  ;\n\n  _proto.unlockShowing = function unlockShowing() {\n    this.removeClass('vjs-lock-showing');\n  }\n  /**\n   * Get the value of an attribute on the `Component`s element.\n   *\n   * @param {string} attribute\n   *        Name of the attribute to get the value from.\n   *\n   * @return {string|null}\n   *         - The value of the attribute that was asked for.\n   *         - Can be an empty string on some browsers if the attribute does not exist\n   *           or has no value\n   *         - Most browsers will return null if the attibute does not exist or has\n   *           no value.\n   *\n   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n   */\n  ;\n\n  _proto.getAttribute = function getAttribute$1(attribute) {\n    return getAttribute(this.el_, attribute);\n  }\n  /**\n   * Set the value of an attribute on the `Component`'s element\n   *\n   * @param {string} attribute\n   *        Name of the attribute to set.\n   *\n   * @param {string} value\n   *        Value to set the attribute to.\n   *\n   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n   */\n  ;\n\n  _proto.setAttribute = function setAttribute$1(attribute, value) {\n    setAttribute(this.el_, attribute, value);\n  }\n  /**\n   * Remove an attribute from the `Component`s element.\n   *\n   * @param {string} attribute\n   *        Name of the attribute to remove.\n   *\n   * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n   */\n  ;\n\n  _proto.removeAttribute = function removeAttribute$1(attribute) {\n    removeAttribute(this.el_, attribute);\n  }\n  /**\n   * Get or set the width of the component based upon the CSS styles.\n   * See {@link Component#dimension} for more detailed information.\n   *\n   * @param {number|string} [num]\n   *        The width that you want to set postfixed with '%', 'px' or nothing.\n   *\n   * @param {boolean} [skipListeners]\n   *        Skip the componentresize event trigger\n   *\n   * @return {number|string}\n   *         The width when getting, zero if there is no width. Can be a string\n   *           postpixed with '%' or 'px'.\n   */\n  ;\n\n  _proto.width = function width(num, skipListeners) {\n    return this.dimension('width', num, skipListeners);\n  }\n  /**\n   * Get or set the height of the component based upon the CSS styles.\n   * See {@link Component#dimension} for more detailed information.\n   *\n   * @param {number|string} [num]\n   *        The height that you want to set postfixed with '%', 'px' or nothing.\n   *\n   * @param {boolean} [skipListeners]\n   *        Skip the componentresize event trigger\n   *\n   * @return {number|string}\n   *         The width when getting, zero if there is no width. Can be a string\n   *         postpixed with '%' or 'px'.\n   */\n  ;\n\n  _proto.height = function height(num, skipListeners) {\n    return this.dimension('height', num, skipListeners);\n  }\n  /**\n   * Set both the width and height of the `Component` element at the same time.\n   *\n   * @param  {number|string} width\n   *         Width to set the `Component`s element to.\n   *\n   * @param  {number|string} height\n   *         Height to set the `Component`s element to.\n   */\n  ;\n\n  _proto.dimensions = function dimensions(width, height) {\n    // Skip componentresize listeners on width for optimization\n    this.width(width, true);\n    this.height(height);\n  }\n  /**\n   * Get or set width or height of the `Component` element. This is the shared code\n   * for the {@link Component#width} and {@link Component#height}.\n   *\n   * Things to know:\n   * - If the width or height in an number this will return the number postfixed with 'px'.\n   * - If the width/height is a percent this will return the percent postfixed with '%'\n   * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n   *   defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n   *   See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n   *   for more information\n   * - If you want the computed style of the component, use {@link Component#currentWidth}\n   *   and {@link {Component#currentHeight}\n   *\n   * @fires Component#componentresize\n   *\n   * @param {string} widthOrHeight\n   8        'width' or 'height'\n   *\n   * @param  {number|string} [num]\n   8         New dimension\n   *\n   * @param  {boolean} [skipListeners]\n   *         Skip componentresize event trigger\n   *\n   * @return {number}\n   *         The dimension when getting or 0 if unset\n   */\n  ;\n\n  _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {\n    if (num !== undefined) {\n      // Set to zero if null or literally NaN (NaN !== NaN)\n      if (num === null || num !== num) {\n        num = 0;\n      } // Check if using css width/height (% or px) and adjust\n\n\n      if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n        this.el_.style[widthOrHeight] = num;\n      } else if (num === 'auto') {\n        this.el_.style[widthOrHeight] = '';\n      } else {\n        this.el_.style[widthOrHeight] = num + 'px';\n      } // skipListeners allows us to avoid triggering the resize event when setting both width and height\n\n\n      if (!skipListeners) {\n        /**\n         * Triggered when a component is resized.\n         *\n         * @event Component#componentresize\n         * @type {EventTarget~Event}\n         */\n        this.trigger('componentresize');\n      }\n\n      return;\n    } // Not setting a value, so getting it\n    // Make sure element exists\n\n\n    if (!this.el_) {\n      return 0;\n    } // Get dimension value from style\n\n\n    var val = this.el_.style[widthOrHeight];\n    var pxIndex = val.indexOf('px');\n\n    if (pxIndex !== -1) {\n      // Return the pixel value with no 'px'\n      return parseInt(val.slice(0, pxIndex), 10);\n    } // No px so using % or no style was set, so falling back to offsetWidth/height\n    // If component has display:none, offset will return 0\n    // TODO: handle display:none and no dimension style using px\n\n\n    return parseInt(this.el_['offset' + toTitleCase$1(widthOrHeight)], 10);\n  }\n  /**\n   * Get the computed width or the height of the component's element.\n   *\n   * Uses `window.getComputedStyle`.\n   *\n   * @param {string} widthOrHeight\n   *        A string containing 'width' or 'height'. Whichever one you want to get.\n   *\n   * @return {number}\n   *         The dimension that gets asked for or 0 if nothing was set\n   *         for that dimension.\n   */\n  ;\n\n  _proto.currentDimension = function currentDimension(widthOrHeight) {\n    var computedWidthOrHeight = 0;\n\n    if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n      throw new Error('currentDimension only accepts width or height value');\n    }\n\n    computedWidthOrHeight = computedStyle(this.el_, widthOrHeight); // remove 'px' from variable and parse as integer\n\n    computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying\n    // and we want to check the offset values.\n    // This code also runs wherever getComputedStyle doesn't exist.\n\n    if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {\n      var rule = \"offset\" + toTitleCase$1(widthOrHeight);\n      computedWidthOrHeight = this.el_[rule];\n    }\n\n    return computedWidthOrHeight;\n  }\n  /**\n   * An object that contains width and height values of the `Component`s\n   * computed style. Uses `window.getComputedStyle`.\n   *\n   * @typedef {Object} Component~DimensionObject\n   *\n   * @property {number} width\n   *           The width of the `Component`s computed style.\n   *\n   * @property {number} height\n   *           The height of the `Component`s computed style.\n   */\n\n  /**\n   * Get an object that contains computed width and height values of the\n   * component's element.\n   *\n   * Uses `window.getComputedStyle`.\n   *\n   * @return {Component~DimensionObject}\n   *         The computed dimensions of the component's element.\n   */\n  ;\n\n  _proto.currentDimensions = function currentDimensions() {\n    return {\n      width: this.currentDimension('width'),\n      height: this.currentDimension('height')\n    };\n  }\n  /**\n   * Get the computed width of the component's element.\n   *\n   * Uses `window.getComputedStyle`.\n   *\n   * @return {number}\n   *         The computed width of the component's element.\n   */\n  ;\n\n  _proto.currentWidth = function currentWidth() {\n    return this.currentDimension('width');\n  }\n  /**\n   * Get the computed height of the component's element.\n   *\n   * Uses `window.getComputedStyle`.\n   *\n   * @return {number}\n   *         The computed height of the component's element.\n   */\n  ;\n\n  _proto.currentHeight = function currentHeight() {\n    return this.currentDimension('height');\n  }\n  /**\n   * Set the focus to this component\n   */\n  ;\n\n  _proto.focus = function focus() {\n    this.el_.focus();\n  }\n  /**\n   * Remove the focus from this component\n   */\n  ;\n\n  _proto.blur = function blur() {\n    this.el_.blur();\n  }\n  /**\n   * When this Component receives a `keydown` event which it does not process,\n   *  it passes the event to the Player for handling.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    if (this.player_) {\n      // We only stop propagation here because we want unhandled events to fall\n      // back to the browser. Exclude Tab for focus trapping.\n      if (!keycode.isEventKey(event, 'Tab')) {\n        event.stopPropagation();\n      }\n\n      this.player_.handleKeyDown(event);\n    }\n  }\n  /**\n   * Many components used to have a `handleKeyPress` method, which was poorly\n   * named because it listened to a `keydown` event. This method name now\n   * delegates to `handleKeyDown`. This means anyone calling `handleKeyPress`\n   * will not see their method calls stop working.\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to be called.\n   */\n  ;\n\n  _proto.handleKeyPress = function handleKeyPress(event) {\n    this.handleKeyDown(event);\n  }\n  /**\n   * Emit a 'tap' events when touch event support gets detected. This gets used to\n   * support toggling the controls through a tap on the video. They get enabled\n   * because every sub-component would have extra overhead otherwise.\n   *\n   * @private\n   * @fires Component#tap\n   * @listens Component#touchstart\n   * @listens Component#touchmove\n   * @listens Component#touchleave\n   * @listens Component#touchcancel\n   * @listens Component#touchend\n    */\n  ;\n\n  _proto.emitTapEvents = function emitTapEvents() {\n    // Track the start time so we can determine how long the touch lasted\n    var touchStart = 0;\n    var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap\n    // Other popular libs use anywhere from 2 (hammer.js) to 15,\n    // so 10 seems like a nice, round number.\n\n    var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap\n\n    var touchTimeThreshold = 200;\n    var couldBeTap;\n    this.on('touchstart', function (event) {\n      // If more than one finger, don't consider treating this as a click\n      if (event.touches.length === 1) {\n        // Copy pageX/pageY from the object\n        firstTouch = {\n          pageX: event.touches[0].pageX,\n          pageY: event.touches[0].pageY\n        }; // Record start time so we can detect a tap vs. \"touch and hold\"\n\n        touchStart = window$1.performance.now(); // Reset couldBeTap tracking\n\n        couldBeTap = true;\n      }\n    });\n    this.on('touchmove', function (event) {\n      // If more than one finger, don't consider treating this as a click\n      if (event.touches.length > 1) {\n        couldBeTap = false;\n      } else if (firstTouch) {\n        // Some devices will throw touchmoves for all but the slightest of taps.\n        // So, if we moved only a small distance, this could still be a tap\n        var xdiff = event.touches[0].pageX - firstTouch.pageX;\n        var ydiff = event.touches[0].pageY - firstTouch.pageY;\n        var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n\n        if (touchDistance > tapMovementThreshold) {\n          couldBeTap = false;\n        }\n      }\n    });\n\n    var noTap = function noTap() {\n      couldBeTap = false;\n    }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n\n\n    this.on('touchleave', noTap);\n    this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate\n    // event\n\n    this.on('touchend', function (event) {\n      firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen\n\n      if (couldBeTap === true) {\n        // Measure how long the touch lasted\n        var touchTime = window$1.performance.now() - touchStart; // Make sure the touch was less than the threshold to be considered a tap\n\n        if (touchTime < touchTimeThreshold) {\n          // Don't let browser turn this into a click\n          event.preventDefault();\n          /**\n           * Triggered when a `Component` is tapped.\n           *\n           * @event Component#tap\n           * @type {EventTarget~Event}\n           */\n\n          this.trigger('tap'); // It may be good to copy the touchend event object and change the\n          // type to tap, if the other event properties aren't exact after\n          // Events.fixEvent runs (e.g. event.target)\n        }\n      }\n    });\n  }\n  /**\n   * This function reports user activity whenever touch events happen. This can get\n   * turned off by any sub-components that wants touch events to act another way.\n   *\n   * Report user touch activity when touch events occur. User activity gets used to\n   * determine when controls should show/hide. It is simple when it comes to mouse\n   * events, because any mouse event should show the controls. So we capture mouse\n   * events that bubble up to the player and report activity when that happens.\n   * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n   * controls. So touch events can't help us at the player level either.\n   *\n   * User activity gets checked asynchronously. So what could happen is a tap event\n   * on the video turns the controls off. Then the `touchend` event bubbles up to\n   * the player. Which, if it reported user activity, would turn the controls right\n   * back on. We also don't want to completely block touch events from bubbling up.\n   * Furthermore a `touchmove` event and anything other than a tap, should not turn\n   * controls back on.\n   *\n   * @listens Component#touchstart\n   * @listens Component#touchmove\n   * @listens Component#touchend\n   * @listens Component#touchcancel\n   */\n  ;\n\n  _proto.enableTouchActivity = function enableTouchActivity() {\n    // Don't continue if the root player doesn't support reporting user activity\n    if (!this.player() || !this.player().reportUserActivity) {\n      return;\n    } // listener for reporting that the user is active\n\n\n    var report = bind(this.player(), this.player().reportUserActivity);\n    var touchHolding;\n    this.on('touchstart', function () {\n      report(); // For as long as the they are touching the device or have their mouse down,\n      // we consider them active even if they're not moving their finger or mouse.\n      // So we want to continue to update that they are active\n\n      this.clearInterval(touchHolding); // report at the same interval as activityCheck\n\n      touchHolding = this.setInterval(report, 250);\n    });\n\n    var touchEnd = function touchEnd(event) {\n      report(); // stop the interval that maintains activity if the touch is holding\n\n      this.clearInterval(touchHolding);\n    };\n\n    this.on('touchmove', report);\n    this.on('touchend', touchEnd);\n    this.on('touchcancel', touchEnd);\n  }\n  /**\n   * A callback that has no parameters and is bound into `Component`s context.\n   *\n   * @callback Component~GenericCallback\n   * @this Component\n   */\n\n  /**\n   * Creates a function that runs after an `x` millisecond timeout. This function is a\n   * wrapper around `window.setTimeout`. There are a few reasons to use this one\n   * instead though:\n   * 1. It gets cleared via  {@link Component#clearTimeout} when\n   *    {@link Component#dispose} gets called.\n   * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n   *\n   * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n   *         will cause its dispose listener not to get cleaned up! Please use\n   *         {@link Component#clearTimeout} or {@link Component#dispose} instead.\n   *\n   * @param {Component~GenericCallback} fn\n   *        The function that will be run after `timeout`.\n   *\n   * @param {number} timeout\n   *        Timeout in milliseconds to delay before executing the specified function.\n   *\n   * @return {number}\n   *         Returns a timeout ID that gets used to identify the timeout. It can also\n   *         get used in {@link Component#clearTimeout} to clear the timeout that\n   *         was set.\n   *\n   * @listens Component#dispose\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n   */\n  ;\n\n  _proto.setTimeout = function setTimeout(fn, timeout) {\n    var _this3 = this;\n\n    // declare as variables so they are properly available in timeout function\n    // eslint-disable-next-line\n    var timeoutId;\n    fn = bind(this, fn);\n    this.clearTimersOnDispose_();\n    timeoutId = window$1.setTimeout(function () {\n      if (_this3.setTimeoutIds_.has(timeoutId)) {\n        _this3.setTimeoutIds_[\"delete\"](timeoutId);\n      }\n\n      fn();\n    }, timeout);\n    this.setTimeoutIds_.add(timeoutId);\n    return timeoutId;\n  }\n  /**\n   * Clears a timeout that gets created via `window.setTimeout` or\n   * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n   * use this function instead of `window.clearTimout`. If you don't your dispose\n   * listener will not get cleaned up until {@link Component#dispose}!\n   *\n   * @param {number} timeoutId\n   *        The id of the timeout to clear. The return value of\n   *        {@link Component#setTimeout} or `window.setTimeout`.\n   *\n   * @return {number}\n   *         Returns the timeout id that was cleared.\n   *\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n   */\n  ;\n\n  _proto.clearTimeout = function clearTimeout(timeoutId) {\n    if (this.setTimeoutIds_.has(timeoutId)) {\n      this.setTimeoutIds_[\"delete\"](timeoutId);\n      window$1.clearTimeout(timeoutId);\n    }\n\n    return timeoutId;\n  }\n  /**\n   * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n   * around `window.setInterval`. There are a few reasons to use this one instead though.\n   * 1. It gets cleared via  {@link Component#clearInterval} when\n   *    {@link Component#dispose} gets called.\n   * 2. The function callback will be a {@link Component~GenericCallback}\n   *\n   * @param {Component~GenericCallback} fn\n   *        The function to run every `x` seconds.\n   *\n   * @param {number} interval\n   *        Execute the specified function every `x` milliseconds.\n   *\n   * @return {number}\n   *         Returns an id that can be used to identify the interval. It can also be be used in\n   *         {@link Component#clearInterval} to clear the interval.\n   *\n   * @listens Component#dispose\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n   */\n  ;\n\n  _proto.setInterval = function setInterval(fn, interval) {\n    fn = bind(this, fn);\n    this.clearTimersOnDispose_();\n    var intervalId = window$1.setInterval(fn, interval);\n    this.setIntervalIds_.add(intervalId);\n    return intervalId;\n  }\n  /**\n   * Clears an interval that gets created via `window.setInterval` or\n   * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}\n   * use this function instead of `window.clearInterval`. If you don't your dispose\n   * listener will not get cleaned up until {@link Component#dispose}!\n   *\n   * @param {number} intervalId\n   *        The id of the interval to clear. The return value of\n   *        {@link Component#setInterval} or `window.setInterval`.\n   *\n   * @return {number}\n   *         Returns the interval id that was cleared.\n   *\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n   */\n  ;\n\n  _proto.clearInterval = function clearInterval(intervalId) {\n    if (this.setIntervalIds_.has(intervalId)) {\n      this.setIntervalIds_[\"delete\"](intervalId);\n      window$1.clearInterval(intervalId);\n    }\n\n    return intervalId;\n  }\n  /**\n   * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n   * with a few extra bonuses:\n   *\n   * - Supports browsers that do not support rAF by falling back to\n   *   {@link Component#setTimeout}.\n   *\n   * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n   *   bound to the component).\n   *\n   * - Automatic cancellation of the rAF callback is handled if the component\n   *   is disposed before it is called.\n   *\n   * @param  {Component~GenericCallback} fn\n   *         A function that will be bound to this component and executed just\n   *         before the browser's next repaint.\n   *\n   * @return {number}\n   *         Returns an rAF ID that gets used to identify the timeout. It can\n   *         also be used in {@link Component#cancelAnimationFrame} to cancel\n   *         the animation frame callback.\n   *\n   * @listens Component#dispose\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n   */\n  ;\n\n  _proto.requestAnimationFrame = function requestAnimationFrame(fn) {\n    var _this4 = this;\n\n    // Fall back to using a timer.\n    if (!this.supportsRaf_) {\n      return this.setTimeout(fn, 1000 / 60);\n    }\n\n    this.clearTimersOnDispose_(); // declare as variables so they are properly available in rAF function\n    // eslint-disable-next-line\n\n    var id;\n    fn = bind(this, fn);\n    id = window$1.requestAnimationFrame(function () {\n      if (_this4.rafIds_.has(id)) {\n        _this4.rafIds_[\"delete\"](id);\n      }\n\n      fn();\n    });\n    this.rafIds_.add(id);\n    return id;\n  }\n  /**\n   * Request an animation frame, but only one named animation\n   * frame will be queued. Another will never be added until\n   * the previous one finishes.\n   *\n   * @param {string} name\n   *        The name to give this requestAnimationFrame\n   *\n   * @param  {Component~GenericCallback} fn\n   *         A function that will be bound to this component and executed just\n   *         before the browser's next repaint.\n   */\n  ;\n\n  _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn) {\n    var _this5 = this;\n\n    if (this.namedRafs_.has(name)) {\n      return;\n    }\n\n    this.clearTimersOnDispose_();\n    fn = bind(this, fn);\n    var id = this.requestAnimationFrame(function () {\n      fn();\n\n      if (_this5.namedRafs_.has(name)) {\n        _this5.namedRafs_[\"delete\"](name);\n      }\n    });\n    this.namedRafs_.set(name, id);\n    return name;\n  }\n  /**\n   * Cancels a current named animation frame if it exists.\n   *\n   * @param {string} name\n   *        The name of the requestAnimationFrame to cancel.\n   */\n  ;\n\n  _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) {\n    if (!this.namedRafs_.has(name)) {\n      return;\n    }\n\n    this.cancelAnimationFrame(this.namedRafs_.get(name));\n    this.namedRafs_[\"delete\"](name);\n  }\n  /**\n   * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n   * (rAF).\n   *\n   * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n   * use this function instead of `window.cancelAnimationFrame`. If you don't,\n   * your dispose listener will not get cleaned up until {@link Component#dispose}!\n   *\n   * @param {number} id\n   *        The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n   *\n   * @return {number}\n   *         Returns the rAF ID that was cleared.\n   *\n   * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n   */\n  ;\n\n  _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {\n    // Fall back to using a timer.\n    if (!this.supportsRaf_) {\n      return this.clearTimeout(id);\n    }\n\n    if (this.rafIds_.has(id)) {\n      this.rafIds_[\"delete\"](id);\n      window$1.cancelAnimationFrame(id);\n    }\n\n    return id;\n  }\n  /**\n   * A function to setup `requestAnimationFrame`, `setTimeout`,\n   * and `setInterval`, clearing on dispose.\n   *\n   * > Previously each timer added and removed dispose listeners on it's own.\n   * For better performance it was decided to batch them all, and use `Set`s\n   * to track outstanding timer ids.\n   *\n   * @private\n   */\n  ;\n\n  _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {\n    var _this6 = this;\n\n    if (this.clearingTimersOnDispose_) {\n      return;\n    }\n\n    this.clearingTimersOnDispose_ = true;\n    this.one('dispose', function () {\n      [['namedRafs_', 'cancelNamedAnimationFrame'], ['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(function (_ref) {\n        var idName = _ref[0],\n            cancelName = _ref[1];\n\n        // for a `Set` key will actually be the value again\n        // so forEach((val, val) =>` but for maps we want to use\n        // the key.\n        _this6[idName].forEach(function (val, key) {\n          return _this6[cancelName](key);\n        });\n      });\n      _this6.clearingTimersOnDispose_ = false;\n    });\n  }\n  /**\n   * Register a `Component` with `videojs` given the name and the component.\n   *\n   * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n   *         should be registered using {@link Tech.registerTech} or\n   *         {@link videojs:videojs.registerTech}.\n   *\n   * > NOTE: This function can also be seen on videojs as\n   *         {@link videojs:videojs.registerComponent}.\n   *\n   * @param {string} name\n   *        The name of the `Component` to register.\n   *\n   * @param {Component} ComponentToRegister\n   *        The `Component` class to register.\n   *\n   * @return {Component}\n   *         The `Component` that was registered.\n   */\n  ;\n\n  Component.registerComponent = function registerComponent(name, ComponentToRegister) {\n    if (typeof name !== 'string' || !name) {\n      throw new Error(\"Illegal component name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n    }\n\n    var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered.\n\n    var isTech = Tech && Tech.isTech(ComponentToRegister);\n    var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype);\n\n    if (isTech || !isComp) {\n      var reason;\n\n      if (isTech) {\n        reason = 'techs must be registered using Tech.registerTech()';\n      } else {\n        reason = 'must be a Component subclass';\n      }\n\n      throw new Error(\"Illegal component, \\\"\" + name + \"\\\"; \" + reason + \".\");\n    }\n\n    name = toTitleCase$1(name);\n\n    if (!Component.components_) {\n      Component.components_ = {};\n    }\n\n    var Player = Component.getComponent('Player');\n\n    if (name === 'Player' && Player && Player.players) {\n      var players = Player.players;\n      var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be\n      // in Players.players. So, we must loop through and verify that the value\n      // for each item is not null. This allows registration of the Player component\n      // after all players have been disposed or before any were created.\n\n      if (players && playerNames.length > 0 && playerNames.map(function (pname) {\n        return players[pname];\n      }).every(Boolean)) {\n        throw new Error('Can not register Player component after player has been created.');\n      }\n    }\n\n    Component.components_[name] = ComponentToRegister;\n    Component.components_[toLowerCase(name)] = ComponentToRegister;\n    return ComponentToRegister;\n  }\n  /**\n   * Get a `Component` based on the name it was registered with.\n   *\n   * @param {string} name\n   *        The Name of the component to get.\n   *\n   * @return {Component}\n   *         The `Component` that got registered under the given name.\n   */\n  ;\n\n  Component.getComponent = function getComponent(name) {\n    if (!name || !Component.components_) {\n      return;\n    }\n\n    return Component.components_[name];\n  };\n\n  return Component;\n}();\n/**\n * Whether or not this component supports `requestAnimationFrame`.\n *\n * This is exposed primarily for testing purposes.\n *\n * @private\n * @type {Boolean}\n */\n\n\nComponent$1.prototype.supportsRaf_ = typeof window$1.requestAnimationFrame === 'function' && typeof window$1.cancelAnimationFrame === 'function';\nComponent$1.registerComponent('Component', Component$1);\n\n/**\n * @file time-ranges.js\n * @module time-ranges\n */\n/**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef    {Function} TimeRangeIndex\n *\n * @param      {number} [index=0]\n *             The range number to return the time for.\n *\n * @return     {number}\n *             The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n *             In the future, leaving it out will throw an error.\n */\n\n/**\n * An object that contains ranges of time.\n *\n * @typedef  {Object} TimeRange\n *\n * @property {number} length\n *           The number of time ranges represented by this object.\n *\n * @property {module:time-ranges~TimeRangeIndex} start\n *           Returns the time offset at which a specified time range begins.\n *\n * @property {module:time-ranges~TimeRangeIndex} end\n *           Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n/**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param   {string} fnName\n *          The function name to use for logging\n *\n * @param   {number} index\n *          The index to check\n *\n * @param   {number} maxIndex\n *          The maximum possible index\n *\n * @throws  {Error} if the timeRanges provided are over the maxIndex\n */\n\nfunction rangeCheck(fnName, index, maxIndex) {\n  if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n    throw new Error(\"Failed to execute '\" + fnName + \"' on 'TimeRanges': The index provided (\" + index + \") is non-numeric or out of bounds (0-\" + maxIndex + \").\");\n  }\n}\n/**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param      {string} fnName\n *             The function name to use for logging\n *\n * @param      {string} valueIndex\n *             The property that should be used to get the time. should be\n *             'start' or 'end'\n *\n * @param      {Array} ranges\n *             An array of time ranges\n *\n * @param      {Array} [rangeIndex=0]\n *             The index to start the search at\n *\n * @return     {number}\n *             The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws     {Error} if rangeIndex is more than the length of ranges\n */\n\n\nfunction getRange(fnName, valueIndex, ranges, rangeIndex) {\n  rangeCheck(fnName, rangeIndex, ranges.length - 1);\n  return ranges[rangeIndex][valueIndex];\n}\n/**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param   {Array} [ranges]\n *          An array of time ranges.\n */\n\n\nfunction createTimeRangesObj(ranges) {\n  var timeRangesObj;\n\n  if (ranges === undefined || ranges.length === 0) {\n    timeRangesObj = {\n      length: 0,\n      start: function start() {\n        throw new Error('This TimeRanges object is empty');\n      },\n      end: function end() {\n        throw new Error('This TimeRanges object is empty');\n      }\n    };\n  } else {\n    timeRangesObj = {\n      length: ranges.length,\n      start: getRange.bind(null, 'start', 0, ranges),\n      end: getRange.bind(null, 'end', 1, ranges)\n    };\n  }\n\n  if (window$1.Symbol && window$1.Symbol.iterator) {\n    timeRangesObj[window$1.Symbol.iterator] = function () {\n      return (ranges || []).values();\n    };\n  }\n\n  return timeRangesObj;\n}\n/**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n *        The start of a single range (a number) or an array of ranges (an\n *        array of arrays of two numbers each).\n *\n * @param {number} end\n *        The end of a single range. Cannot be used with the array form of\n *        the `start` argument.\n */\n\n\nfunction createTimeRanges(start, end) {\n  if (Array.isArray(start)) {\n    return createTimeRangesObj(start);\n  } else if (start === undefined || end === undefined) {\n    return createTimeRangesObj();\n  }\n\n  return createTimeRangesObj([[start, end]]);\n}\n\n/**\n * @file buffer.js\n * @module buffer\n */\n/**\n * Compute the percentage of the media that has been buffered.\n *\n * @param {TimeRange} buffered\n *        The current `TimeRange` object representing buffered time ranges\n *\n * @param {number} duration\n *        Total duration of the media\n *\n * @return {number}\n *         Percent buffered of the total duration in decimal form.\n */\n\nfunction bufferedPercent(buffered, duration) {\n  var bufferedDuration = 0;\n  var start;\n  var end;\n\n  if (!duration) {\n    return 0;\n  }\n\n  if (!buffered || !buffered.length) {\n    buffered = createTimeRanges(0, 0);\n  }\n\n  for (var i = 0; i < buffered.length; i++) {\n    start = buffered.start(i);\n    end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction\n\n    if (end > duration) {\n      end = duration;\n    }\n\n    bufferedDuration += end - start;\n  }\n\n  return bufferedDuration / duration;\n}\n\n/**\n * @file media-error.js\n */\n/**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n *        This can be of multiple types:\n *        - number: should be a standard error code\n *        - string: an error message (the code will be 0)\n *        - Object: arbitrary properties\n *        - `MediaError` (native): used to populate a video.js `MediaError` object\n *        - `MediaError` (video.js): will return itself if it's already a\n *          video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\n\nfunction MediaError(value) {\n  // Allow redundant calls to this constructor to avoid having `instanceof`\n  // checks peppered around the code.\n  if (value instanceof MediaError) {\n    return value;\n  }\n\n  if (typeof value === 'number') {\n    this.code = value;\n  } else if (typeof value === 'string') {\n    // default code is zero, so this is a custom error\n    this.message = value;\n  } else if (isObject(value)) {\n    // We assign the `code` property manually because native `MediaError` objects\n    // do not expose it as an own/enumerable property of the object.\n    if (typeof value.code === 'number') {\n      this.code = value.code;\n    }\n\n    assign(this, value);\n  }\n\n  if (!this.message) {\n    this.message = MediaError.defaultMessages[this.code] || '';\n  }\n}\n/**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\n\n\nMediaError.prototype.code = 0;\n/**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\n\nMediaError.prototype.message = '';\n/**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\n\nMediaError.prototype.status = null;\n/**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\n\nMediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n/**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\n\nMediaError.defaultMessages = {\n  1: 'You aborted the media playback',\n  2: 'A network error caused the media download to fail part-way.',\n  3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n  4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n  5: 'The media is encrypted and we do not have the keys to decrypt it.'\n}; // Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\n\nfor (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n  MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance\n\n  MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n} // jsdocs for instance/static members added above\n\n/**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param  {Object}  value\n *         An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n *         Whether or not the object is `Promise`-like.\n */\nfunction isPromise(value) {\n  return value !== undefined && value !== null && typeof value.then === 'function';\n}\n/**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param  {Object} value\n *         An object that may or may not be `Promise`-like.\n */\n\nfunction silencePromise(value) {\n  if (isPromise(value)) {\n    value.then(null, function (e) {});\n  }\n}\n\n/**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n/**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n *        The text track to query.\n *\n * @return {Object}\n *         A serializable javascript representation of the TextTrack.\n * @private\n */\nvar trackToJson_ = function trackToJson_(track) {\n  var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) {\n    if (track[prop]) {\n      acc[prop] = track[prop];\n    }\n\n    return acc;\n  }, {\n    cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n      return {\n        startTime: cue.startTime,\n        endTime: cue.endTime,\n        text: cue.text,\n        id: cue.id\n      };\n    })\n  });\n  return ret;\n};\n/**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param {Tech} tech\n *        The tech object to query\n *\n * @return {Array}\n *         A serializable javascript representation of the {@link Tech}s\n *         {@link TextTrackList}.\n */\n\n\nvar textTracksToJson = function textTracksToJson(tech) {\n  var trackEls = tech.$$('track');\n  var trackObjs = Array.prototype.map.call(trackEls, function (t) {\n    return t.track;\n  });\n  var tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n    var json = trackToJson_(trackEl.track);\n\n    if (trackEl.src) {\n      json.src = trackEl.src;\n    }\n\n    return json;\n  });\n  return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n    return trackObjs.indexOf(track) === -1;\n  }).map(trackToJson_));\n};\n/**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n *        An array of `TextTrack` representation objects, like those that would be\n *        produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n *        The `Tech` to create the `TextTrack`s on.\n */\n\n\nvar jsonToTextTracks = function jsonToTextTracks(json, tech) {\n  json.forEach(function (track) {\n    var addedTrack = tech.addRemoteTextTrack(track).track;\n\n    if (!track.src && track.cues) {\n      track.cues.forEach(function (cue) {\n        return addedTrack.addCue(cue);\n      });\n    }\n  });\n  return tech.textTracks();\n};\n\nvar textTrackConverter = {\n  textTracksToJson: textTracksToJson,\n  jsonToTextTracks: jsonToTextTracks,\n  trackToJson_: trackToJson_\n};\n\nvar MODAL_CLASS_NAME = 'vjs-modal-dialog';\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\n\nvar ModalDialog = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(ModalDialog, _Component);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Mixed} [options.content=undefined]\n   *        Provide customized content for this modal.\n   *\n   * @param {string} [options.description]\n   *        A text description for the modal, primarily for accessibility.\n   *\n   * @param {boolean} [options.fillAlways=false]\n   *        Normally, modals are automatically filled only the first time\n   *        they open. This tells the modal to refresh its content\n   *        every time it opens.\n   *\n   * @param {string} [options.label]\n   *        A text label for the modal, primarily for accessibility.\n   *\n   * @param {boolean} [options.pauseOnOpen=true]\n   *        If `true`, playback will will be paused if playing when\n   *        the modal opens, and resumed when it closes.\n   *\n   * @param {boolean} [options.temporary=true]\n   *        If `true`, the modal can only be opened once; it will be\n   *        disposed as soon as it's closed.\n   *\n   * @param {boolean} [options.uncloseable=false]\n   *        If `true`, the user will not be able to close the modal\n   *        through the UI in the normal ways. Programmatic closing is\n   *        still possible.\n   */\n  function ModalDialog(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    _this.handleKeyDown_ = function (e) {\n      return _this.handleKeyDown(e);\n    };\n\n    _this.close_ = function (e) {\n      return _this.close(e);\n    };\n\n    _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;\n\n    _this.closeable(!_this.options_.uncloseable);\n\n    _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized\n    // because we only want the contents of the modal in the contentEl\n    // (not the UI elements like the close button).\n\n\n    _this.contentEl_ = createEl('div', {\n      className: MODAL_CLASS_NAME + \"-content\"\n    }, {\n      role: 'document'\n    });\n    _this.descEl_ = createEl('p', {\n      className: MODAL_CLASS_NAME + \"-description vjs-control-text\",\n      id: _this.el().getAttribute('aria-describedby')\n    });\n    textContent(_this.descEl_, _this.description());\n\n    _this.el_.appendChild(_this.descEl_);\n\n    _this.el_.appendChild(_this.contentEl_);\n\n    return _this;\n  }\n  /**\n   * Create the `ModalDialog`'s DOM element\n   *\n   * @return {Element}\n   *         The DOM element that gets created.\n   */\n\n\n  var _proto = ModalDialog.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: this.buildCSSClass(),\n      tabIndex: -1\n    }, {\n      'aria-describedby': this.id() + \"_description\",\n      'aria-hidden': 'true',\n      'aria-label': this.label(),\n      'role': 'dialog'\n    });\n  };\n\n  _proto.dispose = function dispose() {\n    this.contentEl_ = null;\n    this.descEl_ = null;\n    this.previouslyActiveEl_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return MODAL_CLASS_NAME + \" vjs-hidden \" + _Component.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Returns the label string for this modal. Primarily used for accessibility.\n   *\n   * @return {string}\n   *         the localized or raw label of this modal.\n   */\n  ;\n\n  _proto.label = function label() {\n    return this.localize(this.options_.label || 'Modal Window');\n  }\n  /**\n   * Returns the description string for this modal. Primarily used for\n   * accessibility.\n   *\n   * @return {string}\n   *         The localized or raw description of this modal.\n   */\n  ;\n\n  _proto.description = function description() {\n    var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable.\n\n    if (this.closeable()) {\n      desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n    }\n\n    return desc;\n  }\n  /**\n   * Opens the modal.\n   *\n   * @fires ModalDialog#beforemodalopen\n   * @fires ModalDialog#modalopen\n   */\n  ;\n\n  _proto.open = function open() {\n    if (!this.opened_) {\n      var player = this.player();\n      /**\n        * Fired just before a `ModalDialog` is opened.\n        *\n        * @event ModalDialog#beforemodalopen\n        * @type {EventTarget~Event}\n        */\n\n      this.trigger('beforemodalopen');\n      this.opened_ = true; // Fill content if the modal has never opened before and\n      // never been filled.\n\n      if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n        this.fill();\n      } // If the player was playing, pause it and take note of its previously\n      // playing state.\n\n\n      this.wasPlaying_ = !player.paused();\n\n      if (this.options_.pauseOnOpen && this.wasPlaying_) {\n        player.pause();\n      }\n\n      this.on('keydown', this.handleKeyDown_); // Hide controls and note if they were enabled.\n\n      this.hadControls_ = player.controls();\n      player.controls(false);\n      this.show();\n      this.conditionalFocus_();\n      this.el().setAttribute('aria-hidden', 'false');\n      /**\n        * Fired just after a `ModalDialog` is opened.\n        *\n        * @event ModalDialog#modalopen\n        * @type {EventTarget~Event}\n        */\n\n      this.trigger('modalopen');\n      this.hasBeenOpened_ = true;\n    }\n  }\n  /**\n   * If the `ModalDialog` is currently open or closed.\n   *\n   * @param  {boolean} [value]\n   *         If given, it will open (`true`) or close (`false`) the modal.\n   *\n   * @return {boolean}\n   *         the current open state of the modaldialog\n   */\n  ;\n\n  _proto.opened = function opened(value) {\n    if (typeof value === 'boolean') {\n      this[value ? 'open' : 'close']();\n    }\n\n    return this.opened_;\n  }\n  /**\n   * Closes the modal, does nothing if the `ModalDialog` is\n   * not open.\n   *\n   * @fires ModalDialog#beforemodalclose\n   * @fires ModalDialog#modalclose\n   */\n  ;\n\n  _proto.close = function close() {\n    if (!this.opened_) {\n      return;\n    }\n\n    var player = this.player();\n    /**\n      * Fired just before a `ModalDialog` is closed.\n      *\n      * @event ModalDialog#beforemodalclose\n      * @type {EventTarget~Event}\n      */\n\n    this.trigger('beforemodalclose');\n    this.opened_ = false;\n\n    if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n      player.play();\n    }\n\n    this.off('keydown', this.handleKeyDown_);\n\n    if (this.hadControls_) {\n      player.controls(true);\n    }\n\n    this.hide();\n    this.el().setAttribute('aria-hidden', 'true');\n    /**\n      * Fired just after a `ModalDialog` is closed.\n      *\n      * @event ModalDialog#modalclose\n      * @type {EventTarget~Event}\n      */\n\n    this.trigger('modalclose');\n    this.conditionalBlur_();\n\n    if (this.options_.temporary) {\n      this.dispose();\n    }\n  }\n  /**\n   * Check to see if the `ModalDialog` is closeable via the UI.\n   *\n   * @param  {boolean} [value]\n   *         If given as a boolean, it will set the `closeable` option.\n   *\n   * @return {boolean}\n   *         Returns the final value of the closable option.\n   */\n  ;\n\n  _proto.closeable = function closeable(value) {\n    if (typeof value === 'boolean') {\n      var closeable = this.closeable_ = !!value;\n      var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one.\n\n      if (closeable && !close) {\n        // The close button should be a child of the modal - not its\n        // content element, so temporarily change the content element.\n        var temp = this.contentEl_;\n        this.contentEl_ = this.el_;\n        close = this.addChild('closeButton', {\n          controlText: 'Close Modal Dialog'\n        });\n        this.contentEl_ = temp;\n        this.on(close, 'close', this.close_);\n      } // If this is being made uncloseable and has a close button, remove it.\n\n\n      if (!closeable && close) {\n        this.off(close, 'close', this.close_);\n        this.removeChild(close);\n        close.dispose();\n      }\n    }\n\n    return this.closeable_;\n  }\n  /**\n   * Fill the modal's content element with the modal's \"content\" option.\n   * The content element will be emptied before this change takes place.\n   */\n  ;\n\n  _proto.fill = function fill() {\n    this.fillWith(this.content());\n  }\n  /**\n   * Fill the modal's content element with arbitrary content.\n   * The content element will be emptied before this change takes place.\n   *\n   * @fires ModalDialog#beforemodalfill\n   * @fires ModalDialog#modalfill\n   *\n   * @param {Mixed} [content]\n   *        The same rules apply to this as apply to the `content` option.\n   */\n  ;\n\n  _proto.fillWith = function fillWith(content) {\n    var contentEl = this.contentEl();\n    var parentEl = contentEl.parentNode;\n    var nextSiblingEl = contentEl.nextSibling;\n    /**\n      * Fired just before a `ModalDialog` is filled with content.\n      *\n      * @event ModalDialog#beforemodalfill\n      * @type {EventTarget~Event}\n      */\n\n    this.trigger('beforemodalfill');\n    this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing\n    // manipulation to avoid modifying the live DOM multiple times.\n\n    parentEl.removeChild(contentEl);\n    this.empty();\n    insertContent(contentEl, content);\n    /**\n     * Fired just after a `ModalDialog` is filled with content.\n     *\n     * @event ModalDialog#modalfill\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('modalfill'); // Re-inject the re-filled content element.\n\n    if (nextSiblingEl) {\n      parentEl.insertBefore(contentEl, nextSiblingEl);\n    } else {\n      parentEl.appendChild(contentEl);\n    } // make sure that the close button is last in the dialog DOM\n\n\n    var closeButton = this.getChild('closeButton');\n\n    if (closeButton) {\n      parentEl.appendChild(closeButton.el_);\n    }\n  }\n  /**\n   * Empties the content element. This happens anytime the modal is filled.\n   *\n   * @fires ModalDialog#beforemodalempty\n   * @fires ModalDialog#modalempty\n   */\n  ;\n\n  _proto.empty = function empty() {\n    /**\n    * Fired just before a `ModalDialog` is emptied.\n    *\n    * @event ModalDialog#beforemodalempty\n    * @type {EventTarget~Event}\n    */\n    this.trigger('beforemodalempty');\n    emptyEl(this.contentEl());\n    /**\n    * Fired just after a `ModalDialog` is emptied.\n    *\n    * @event ModalDialog#modalempty\n    * @type {EventTarget~Event}\n    */\n\n    this.trigger('modalempty');\n  }\n  /**\n   * Gets or sets the modal content, which gets normalized before being\n   * rendered into the DOM.\n   *\n   * This does not update the DOM or fill the modal, but it is called during\n   * that process.\n   *\n   * @param  {Mixed} [value]\n   *         If defined, sets the internal content value to be used on the\n   *         next call(s) to `fill`. This value is normalized before being\n   *         inserted. To \"clear\" the internal content value, pass `null`.\n   *\n   * @return {Mixed}\n   *         The current content of the modal dialog\n   */\n  ;\n\n  _proto.content = function content(value) {\n    if (typeof value !== 'undefined') {\n      this.content_ = value;\n    }\n\n    return this.content_;\n  }\n  /**\n   * conditionally focus the modal dialog if focus was previously on the player.\n   *\n   * @private\n   */\n  ;\n\n  _proto.conditionalFocus_ = function conditionalFocus_() {\n    var activeEl = document.activeElement;\n    var playerEl = this.player_.el_;\n    this.previouslyActiveEl_ = null;\n\n    if (playerEl.contains(activeEl) || playerEl === activeEl) {\n      this.previouslyActiveEl_ = activeEl;\n      this.focus();\n    }\n  }\n  /**\n   * conditionally blur the element and refocus the last focused element\n   *\n   * @private\n   */\n  ;\n\n  _proto.conditionalBlur_ = function conditionalBlur_() {\n    if (this.previouslyActiveEl_) {\n      this.previouslyActiveEl_.focus();\n      this.previouslyActiveEl_ = null;\n    }\n  }\n  /**\n   * Keydown handler. Attached when modal is focused.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Do not allow keydowns to reach out of the modal dialog.\n    event.stopPropagation();\n\n    if (keycode.isEventKey(event, 'Escape') && this.closeable()) {\n      event.preventDefault();\n      this.close();\n      return;\n    } // exit early if it isn't a tab key\n\n\n    if (!keycode.isEventKey(event, 'Tab')) {\n      return;\n    }\n\n    var focusableEls = this.focusableEls_();\n    var activeEl = this.el_.querySelector(':focus');\n    var focusIndex;\n\n    for (var i = 0; i < focusableEls.length; i++) {\n      if (activeEl === focusableEls[i]) {\n        focusIndex = i;\n        break;\n      }\n    }\n\n    if (document.activeElement === this.el_) {\n      focusIndex = 0;\n    }\n\n    if (event.shiftKey && focusIndex === 0) {\n      focusableEls[focusableEls.length - 1].focus();\n      event.preventDefault();\n    } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n      focusableEls[0].focus();\n      event.preventDefault();\n    }\n  }\n  /**\n   * get all focusable elements\n   *\n   * @private\n   */\n  ;\n\n  _proto.focusableEls_ = function focusableEls_() {\n    var allChildren = this.el_.querySelectorAll('*');\n    return Array.prototype.filter.call(allChildren, function (child) {\n      return (child instanceof window$1.HTMLAnchorElement || child instanceof window$1.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$1.HTMLInputElement || child instanceof window$1.HTMLSelectElement || child instanceof window$1.HTMLTextAreaElement || child instanceof window$1.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$1.HTMLIFrameElement || child instanceof window$1.HTMLObjectElement || child instanceof window$1.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n    });\n  };\n\n  return ModalDialog;\n}(Component$1);\n/**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\n\n\nModalDialog.prototype.options_ = {\n  pauseOnOpen: true,\n  temporary: true\n};\nComponent$1.registerComponent('ModalDialog', ModalDialog);\n\n/**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\n\nvar TrackList = /*#__PURE__*/function (_EventTarget) {\n  _inheritsLoose(TrackList, _EventTarget);\n\n  /**\n   * Create an instance of this class\n   *\n   * @param {Track[]} tracks\n   *        A list of tracks to initialize the list with.\n   *\n   * @abstract\n   */\n  function TrackList(tracks) {\n    var _this;\n\n    if (tracks === void 0) {\n      tracks = [];\n    }\n\n    _this = _EventTarget.call(this) || this;\n    _this.tracks_ = [];\n    /**\n     * @memberof TrackList\n     * @member {number} length\n     *         The current number of `Track`s in the this Trackist.\n     * @instance\n     */\n\n    Object.defineProperty(_assertThisInitialized(_this), 'length', {\n      get: function get() {\n        return this.tracks_.length;\n      }\n    });\n\n    for (var i = 0; i < tracks.length; i++) {\n      _this.addTrack(tracks[i]);\n    }\n\n    return _this;\n  }\n  /**\n   * Add a {@link Track} to the `TrackList`\n   *\n   * @param {Track} track\n   *        The audio, video, or text track to add to the list.\n   *\n   * @fires TrackList#addtrack\n   */\n\n\n  var _proto = TrackList.prototype;\n\n  _proto.addTrack = function addTrack(track) {\n    var _this2 = this;\n\n    var index = this.tracks_.length;\n\n    if (!('' + index in this)) {\n      Object.defineProperty(this, index, {\n        get: function get() {\n          return this.tracks_[index];\n        }\n      });\n    } // Do not add duplicate tracks\n\n\n    if (this.tracks_.indexOf(track) === -1) {\n      this.tracks_.push(track);\n      /**\n       * Triggered when a track is added to a track list.\n       *\n       * @event TrackList#addtrack\n       * @type {EventTarget~Event}\n       * @property {Track} track\n       *           A reference to track that was added.\n       */\n\n      this.trigger({\n        track: track,\n        type: 'addtrack',\n        target: this\n      });\n    }\n    /**\n     * Triggered when a track label is changed.\n     *\n     * @event TrackList#addtrack\n     * @type {EventTarget~Event}\n     * @property {Track} track\n     *           A reference to track that was added.\n     */\n\n\n    track.labelchange_ = function () {\n      _this2.trigger({\n        track: track,\n        type: 'labelchange',\n        target: _this2\n      });\n    };\n\n    if (isEvented(track)) {\n      track.addEventListener('labelchange', track.labelchange_);\n    }\n  }\n  /**\n   * Remove a {@link Track} from the `TrackList`\n   *\n   * @param {Track} rtrack\n   *        The audio, video, or text track to remove from the list.\n   *\n   * @fires TrackList#removetrack\n   */\n  ;\n\n  _proto.removeTrack = function removeTrack(rtrack) {\n    var track;\n\n    for (var i = 0, l = this.length; i < l; i++) {\n      if (this[i] === rtrack) {\n        track = this[i];\n\n        if (track.off) {\n          track.off();\n        }\n\n        this.tracks_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (!track) {\n      return;\n    }\n    /**\n     * Triggered when a track is removed from track list.\n     *\n     * @event TrackList#removetrack\n     * @type {EventTarget~Event}\n     * @property {Track} track\n     *           A reference to track that was removed.\n     */\n\n\n    this.trigger({\n      track: track,\n      type: 'removetrack',\n      target: this\n    });\n  }\n  /**\n   * Get a Track from the TrackList by a tracks id\n   *\n   * @param {string} id - the id of the track to get\n   * @method getTrackById\n   * @return {Track}\n   * @private\n   */\n  ;\n\n  _proto.getTrackById = function getTrackById(id) {\n    var result = null;\n\n    for (var i = 0, l = this.length; i < l; i++) {\n      var track = this[i];\n\n      if (track.id === id) {\n        result = track;\n        break;\n      }\n    }\n\n    return result;\n  };\n\n  return TrackList;\n}(EventTarget$2);\n/**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {EventTarget~Event}\n */\n\n/**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @private\n */\n\n\nTrackList.prototype.allowedEvents_ = {\n  change: 'change',\n  addtrack: 'addtrack',\n  removetrack: 'removetrack',\n  labelchange: 'labelchange'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var event in TrackList.prototype.allowedEvents_) {\n  TrackList.prototype['on' + event] = null;\n}\n\n/**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n *        list to work on\n *\n * @param {AudioTrack} track\n *        The track to skip\n *\n * @private\n */\n\nvar disableOthers$1 = function disableOthers(list, track) {\n  for (var i = 0; i < list.length; i++) {\n    if (!Object.keys(list[i]).length || track.id === list[i].id) {\n      continue;\n    } // another audio track is enabled, disable it\n\n\n    list[i].enabled = false;\n  }\n};\n/**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\n\n\nvar AudioTrackList = /*#__PURE__*/function (_TrackList) {\n  _inheritsLoose(AudioTrackList, _TrackList);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {AudioTrack[]} [tracks=[]]\n   *        A list of `AudioTrack` to instantiate the list with.\n   */\n  function AudioTrackList(tracks) {\n    var _this;\n\n    if (tracks === void 0) {\n      tracks = [];\n    }\n\n    // make sure only 1 track is enabled\n    // sorted from last index to first index\n    for (var i = tracks.length - 1; i >= 0; i--) {\n      if (tracks[i].enabled) {\n        disableOthers$1(tracks, tracks[i]);\n        break;\n      }\n    }\n\n    _this = _TrackList.call(this, tracks) || this;\n    _this.changing_ = false;\n    return _this;\n  }\n  /**\n   * Add an {@link AudioTrack} to the `AudioTrackList`.\n   *\n   * @param {AudioTrack} track\n   *        The AudioTrack to add to the list\n   *\n   * @fires TrackList#addtrack\n   */\n\n\n  var _proto = AudioTrackList.prototype;\n\n  _proto.addTrack = function addTrack(track) {\n    var _this2 = this;\n\n    if (track.enabled) {\n      disableOthers$1(this, track);\n    }\n\n    _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n    if (!track.addEventListener) {\n      return;\n    }\n\n    track.enabledChange_ = function () {\n      // when we are disabling other tracks (since we don't support\n      // more than one track at a time) we will set changing_\n      // to true so that we don't trigger additional change events\n      if (_this2.changing_) {\n        return;\n      }\n\n      _this2.changing_ = true;\n      disableOthers$1(_this2, track);\n      _this2.changing_ = false;\n\n      _this2.trigger('change');\n    };\n    /**\n     * @listens AudioTrack#enabledchange\n     * @fires TrackList#change\n     */\n\n\n    track.addEventListener('enabledchange', track.enabledChange_);\n  };\n\n  _proto.removeTrack = function removeTrack(rtrack) {\n    _TrackList.prototype.removeTrack.call(this, rtrack);\n\n    if (rtrack.removeEventListener && rtrack.enabledChange_) {\n      rtrack.removeEventListener('enabledchange', rtrack.enabledChange_);\n      rtrack.enabledChange_ = null;\n    }\n  };\n\n  return AudioTrackList;\n}(TrackList);\n\n/**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n *        list to work on\n *\n * @param {VideoTrack} track\n *        The track to skip\n *\n * @private\n */\n\nvar disableOthers = function disableOthers(list, track) {\n  for (var i = 0; i < list.length; i++) {\n    if (!Object.keys(list[i]).length || track.id === list[i].id) {\n      continue;\n    } // another video track is enabled, disable it\n\n\n    list[i].selected = false;\n  }\n};\n/**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\n\n\nvar VideoTrackList = /*#__PURE__*/function (_TrackList) {\n  _inheritsLoose(VideoTrackList, _TrackList);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {VideoTrack[]} [tracks=[]]\n   *        A list of `VideoTrack` to instantiate the list with.\n   */\n  function VideoTrackList(tracks) {\n    var _this;\n\n    if (tracks === void 0) {\n      tracks = [];\n    }\n\n    // make sure only 1 track is enabled\n    // sorted from last index to first index\n    for (var i = tracks.length - 1; i >= 0; i--) {\n      if (tracks[i].selected) {\n        disableOthers(tracks, tracks[i]);\n        break;\n      }\n    }\n\n    _this = _TrackList.call(this, tracks) || this;\n    _this.changing_ = false;\n    /**\n     * @member {number} VideoTrackList#selectedIndex\n     *         The current index of the selected {@link VideoTrack`}.\n     */\n\n    Object.defineProperty(_assertThisInitialized(_this), 'selectedIndex', {\n      get: function get() {\n        for (var _i = 0; _i < this.length; _i++) {\n          if (this[_i].selected) {\n            return _i;\n          }\n        }\n\n        return -1;\n      },\n      set: function set() {}\n    });\n    return _this;\n  }\n  /**\n   * Add a {@link VideoTrack} to the `VideoTrackList`.\n   *\n   * @param {VideoTrack} track\n   *        The VideoTrack to add to the list\n   *\n   * @fires TrackList#addtrack\n   */\n\n\n  var _proto = VideoTrackList.prototype;\n\n  _proto.addTrack = function addTrack(track) {\n    var _this2 = this;\n\n    if (track.selected) {\n      disableOthers(this, track);\n    }\n\n    _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n    if (!track.addEventListener) {\n      return;\n    }\n\n    track.selectedChange_ = function () {\n      if (_this2.changing_) {\n        return;\n      }\n\n      _this2.changing_ = true;\n      disableOthers(_this2, track);\n      _this2.changing_ = false;\n\n      _this2.trigger('change');\n    };\n    /**\n     * @listens VideoTrack#selectedchange\n     * @fires TrackList#change\n     */\n\n\n    track.addEventListener('selectedchange', track.selectedChange_);\n  };\n\n  _proto.removeTrack = function removeTrack(rtrack) {\n    _TrackList.prototype.removeTrack.call(this, rtrack);\n\n    if (rtrack.removeEventListener && rtrack.selectedChange_) {\n      rtrack.removeEventListener('selectedchange', rtrack.selectedChange_);\n      rtrack.selectedChange_ = null;\n    }\n  };\n\n  return VideoTrackList;\n}(TrackList);\n\n/**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\n\nvar TextTrackList = /*#__PURE__*/function (_TrackList) {\n  _inheritsLoose(TextTrackList, _TrackList);\n\n  function TextTrackList() {\n    return _TrackList.apply(this, arguments) || this;\n  }\n\n  var _proto = TextTrackList.prototype;\n\n  /**\n   * Add a {@link TextTrack} to the `TextTrackList`\n   *\n   * @param {TextTrack} track\n   *        The text track to add to the list.\n   *\n   * @fires TrackList#addtrack\n   */\n  _proto.addTrack = function addTrack(track) {\n    var _this = this;\n\n    _TrackList.prototype.addTrack.call(this, track);\n\n    if (!this.queueChange_) {\n      this.queueChange_ = function () {\n        return _this.queueTrigger('change');\n      };\n    }\n\n    if (!this.triggerSelectedlanguagechange) {\n      this.triggerSelectedlanguagechange_ = function () {\n        return _this.trigger('selectedlanguagechange');\n      };\n    }\n    /**\n     * @listens TextTrack#modechange\n     * @fires TrackList#change\n     */\n\n\n    track.addEventListener('modechange', this.queueChange_);\n    var nonLanguageTextTrackKind = ['metadata', 'chapters'];\n\n    if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n      track.addEventListener('modechange', this.triggerSelectedlanguagechange_);\n    }\n  };\n\n  _proto.removeTrack = function removeTrack(rtrack) {\n    _TrackList.prototype.removeTrack.call(this, rtrack); // manually remove the event handlers we added\n\n\n    if (rtrack.removeEventListener) {\n      if (this.queueChange_) {\n        rtrack.removeEventListener('modechange', this.queueChange_);\n      }\n\n      if (this.selectedlanguagechange_) {\n        rtrack.removeEventListener('modechange', this.triggerSelectedlanguagechange_);\n      }\n    }\n  };\n\n  return TextTrackList;\n}(TrackList);\n\n/**\n * @file html-track-element-list.js\n */\n\n/**\n * The current list of {@link HtmlTrackElement}s.\n */\nvar HtmlTrackElementList = /*#__PURE__*/function () {\n  /**\n   * Create an instance of this class.\n   *\n   * @param {HtmlTrackElement[]} [tracks=[]]\n   *        A list of `HtmlTrackElement` to instantiate the list with.\n   */\n  function HtmlTrackElementList(trackElements) {\n    if (trackElements === void 0) {\n      trackElements = [];\n    }\n\n    this.trackElements_ = [];\n    /**\n     * @memberof HtmlTrackElementList\n     * @member {number} length\n     *         The current number of `Track`s in the this Trackist.\n     * @instance\n     */\n\n    Object.defineProperty(this, 'length', {\n      get: function get() {\n        return this.trackElements_.length;\n      }\n    });\n\n    for (var i = 0, length = trackElements.length; i < length; i++) {\n      this.addTrackElement_(trackElements[i]);\n    }\n  }\n  /**\n   * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n   *\n   * @param {HtmlTrackElement} trackElement\n   *        The track element to add to the list.\n   *\n   * @private\n   */\n\n\n  var _proto = HtmlTrackElementList.prototype;\n\n  _proto.addTrackElement_ = function addTrackElement_(trackElement) {\n    var index = this.trackElements_.length;\n\n    if (!('' + index in this)) {\n      Object.defineProperty(this, index, {\n        get: function get() {\n          return this.trackElements_[index];\n        }\n      });\n    } // Do not add duplicate elements\n\n\n    if (this.trackElements_.indexOf(trackElement) === -1) {\n      this.trackElements_.push(trackElement);\n    }\n  }\n  /**\n   * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n   * {@link TextTrack}.\n   *\n   * @param {TextTrack} track\n   *        The track associated with a track element.\n   *\n   * @return {HtmlTrackElement|undefined}\n   *         The track element that was found or undefined.\n   *\n   * @private\n   */\n  ;\n\n  _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {\n    var trackElement_;\n\n    for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n      if (track === this.trackElements_[i].track) {\n        trackElement_ = this.trackElements_[i];\n        break;\n      }\n    }\n\n    return trackElement_;\n  }\n  /**\n   * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n   *\n   * @param {HtmlTrackElement} trackElement\n   *        The track element to remove from the list.\n   *\n   * @private\n   */\n  ;\n\n  _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {\n    for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n      if (trackElement === this.trackElements_[i]) {\n        if (this.trackElements_[i].track && typeof this.trackElements_[i].track.off === 'function') {\n          this.trackElements_[i].track.off();\n        }\n\n        if (typeof this.trackElements_[i].off === 'function') {\n          this.trackElements_[i].off();\n        }\n\n        this.trackElements_.splice(i, 1);\n        break;\n      }\n    }\n  };\n\n  return HtmlTrackElementList;\n}();\n\n/**\n * @file text-track-cue-list.js\n */\n\n/**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n *           The unique id for this text track cue\n *\n * @property {number} startTime\n *           The start time for this text track cue\n *\n * @property {number} endTime\n *           The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n *           Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n/**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\nvar TextTrackCueList = /*#__PURE__*/function () {\n  /**\n   * Create an instance of this class..\n   *\n   * @param {Array} cues\n   *        A list of cues to be initialized with\n   */\n  function TextTrackCueList(cues) {\n    TextTrackCueList.prototype.setCues_.call(this, cues);\n    /**\n     * @memberof TextTrackCueList\n     * @member {number} length\n     *         The current number of `TextTrackCue`s in the TextTrackCueList.\n     * @instance\n     */\n\n    Object.defineProperty(this, 'length', {\n      get: function get() {\n        return this.length_;\n      }\n    });\n  }\n  /**\n   * A setter for cues in this list. Creates getters\n   * an an index for the cues.\n   *\n   * @param {Array} cues\n   *        An array of cues to set\n   *\n   * @private\n   */\n\n\n  var _proto = TextTrackCueList.prototype;\n\n  _proto.setCues_ = function setCues_(cues) {\n    var oldLength = this.length || 0;\n    var i = 0;\n    var l = cues.length;\n    this.cues_ = cues;\n    this.length_ = cues.length;\n\n    var defineProp = function defineProp(index) {\n      if (!('' + index in this)) {\n        Object.defineProperty(this, '' + index, {\n          get: function get() {\n            return this.cues_[index];\n          }\n        });\n      }\n    };\n\n    if (oldLength < l) {\n      i = oldLength;\n\n      for (; i < l; i++) {\n        defineProp.call(this, i);\n      }\n    }\n  }\n  /**\n   * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n   *\n   * @param {string} id\n   *        The id of the cue that should be searched for.\n   *\n   * @return {TextTrackCueList~TextTrackCue|null}\n   *         A single cue or null if none was found.\n   */\n  ;\n\n  _proto.getCueById = function getCueById(id) {\n    var result = null;\n\n    for (var i = 0, l = this.length; i < l; i++) {\n      var cue = this[i];\n\n      if (cue.id === id) {\n        result = cue;\n        break;\n      }\n    }\n\n    return result;\n  };\n\n  return TextTrackCueList;\n}();\n\n/**\n * @file track-kinds.js\n */\n\n/**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\nvar VideoTrackKind = {\n  alternative: 'alternative',\n  captions: 'captions',\n  main: 'main',\n  sign: 'sign',\n  subtitles: 'subtitles',\n  commentary: 'commentary'\n};\n/**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\n\nvar AudioTrackKind = {\n  'alternative': 'alternative',\n  'descriptions': 'descriptions',\n  'main': 'main',\n  'main-desc': 'main-desc',\n  'translation': 'translation',\n  'commentary': 'commentary'\n};\n/**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\n\nvar TextTrackKind = {\n  subtitles: 'subtitles',\n  captions: 'captions',\n  descriptions: 'descriptions',\n  chapters: 'chapters',\n  metadata: 'metadata'\n};\n/**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\n\nvar TextTrackMode = {\n  disabled: 'disabled',\n  hidden: 'hidden',\n  showing: 'showing'\n};\n\n/**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\n\nvar Track = /*#__PURE__*/function (_EventTarget) {\n  _inheritsLoose(Track, _EventTarget);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Object} [options={}]\n   *        Object of option names and values\n   *\n   * @param {string} [options.kind='']\n   *        A valid kind for the track type you are creating.\n   *\n   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n   *        A unique id for this AudioTrack.\n   *\n   * @param {string} [options.label='']\n   *        The menu label for this track.\n   *\n   * @param {string} [options.language='']\n   *        A valid two character language code.\n   *\n   * @abstract\n   */\n  function Track(options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _EventTarget.call(this) || this;\n    var trackProps = {\n      id: options.id || 'vjs_track_' + newGUID(),\n      kind: options.kind || '',\n      language: options.language || ''\n    };\n    var label = options.label || '';\n    /**\n     * @memberof Track\n     * @member {string} id\n     *         The id of this track. Cannot be changed after creation.\n     * @instance\n     *\n     * @readonly\n     */\n\n    /**\n     * @memberof Track\n     * @member {string} kind\n     *         The kind of track that this is. Cannot be changed after creation.\n     * @instance\n     *\n     * @readonly\n     */\n\n    /**\n     * @memberof Track\n     * @member {string} language\n     *         The two letter language code for this track. Cannot be changed after\n     *         creation.\n     * @instance\n     *\n     * @readonly\n     */\n\n    var _loop = function _loop(key) {\n      Object.defineProperty(_assertThisInitialized(_this), key, {\n        get: function get() {\n          return trackProps[key];\n        },\n        set: function set() {}\n      });\n    };\n\n    for (var key in trackProps) {\n      _loop(key);\n    }\n    /**\n     * @memberof Track\n     * @member {string} label\n     *         The label of this track. Cannot be changed after creation.\n     * @instance\n     *\n     * @fires Track#labelchange\n     */\n\n\n    Object.defineProperty(_assertThisInitialized(_this), 'label', {\n      get: function get() {\n        return label;\n      },\n      set: function set(newLabel) {\n        if (newLabel !== label) {\n          label = newLabel;\n          /**\n           * An event that fires when label changes on this track.\n           *\n           * > Note: This is not part of the spec!\n           *\n           * @event Track#labelchange\n           * @type {EventTarget~Event}\n           */\n\n          this.trigger('labelchange');\n        }\n      }\n    });\n    return _this;\n  }\n\n  return Track;\n}(EventTarget$2);\n\n/**\n * @file url.js\n * @module url\n */\n/**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n *           The protocol of the url that was parsed.\n *\n * @property {string} hostname\n *           The hostname of the url that was parsed.\n *\n * @property {string} port\n *           The port of the url that was parsed.\n *\n * @property {string} pathname\n *           The pathname of the url that was parsed.\n *\n * @property {string} search\n *           The search query of the url that was parsed.\n *\n * @property {string} hash\n *           The hash of the url that was parsed.\n *\n * @property {string} host\n *           The host of the url that was parsed.\n */\n\n/**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param    {String} url\n *           The url to parse\n *\n * @return   {url:URLObject}\n *           An object of url details\n */\n\nvar parseUrl = function parseUrl(url) {\n  // This entire method can be replace with URL once we are able to drop IE11\n  var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL\n\n  var a = document.createElement('a');\n  a.href = url; // Copy the specific URL properties to a new object\n  // This is also needed for IE because the anchor loses its\n  // properties when it's removed from the dom\n\n  var details = {};\n\n  for (var i = 0; i < props.length; i++) {\n    details[props[i]] = a[props[i]];\n  } // IE adds the port to the host property unlike everyone else. If\n  // a port identifier is added for standard ports, strip it.\n\n\n  if (details.protocol === 'http:') {\n    details.host = details.host.replace(/:80$/, '');\n  }\n\n  if (details.protocol === 'https:') {\n    details.host = details.host.replace(/:443$/, '');\n  }\n\n  if (!details.protocol) {\n    details.protocol = window$1.location.protocol;\n  }\n  /* istanbul ignore if */\n\n\n  if (!details.host) {\n    details.host = window$1.location.host;\n  }\n\n  return details;\n};\n/**\n * Get absolute version of relative URL. Used to tell Flash the correct URL.\n *\n * @function\n * @param    {string} url\n *           URL to make absolute\n *\n * @return   {string}\n *           Absolute URL\n *\n * @see      http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\n\nvar getAbsoluteURL = function getAbsoluteURL(url) {\n  // Check if absolute URL\n  if (!url.match(/^https?:\\/\\//)) {\n    // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n    // add the url to an anchor and let the browser parse the URL\n    var a = document.createElement('a');\n    a.href = url;\n    url = a.href;\n  }\n\n  return url;\n};\n/**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param    {string} path\n *           The fileName path like '/path/to/file.mp4'\n *\n * @return  {string}\n *           The extension in lower case or an empty string if no\n *           extension could be found.\n */\n\nvar getFileExtension = function getFileExtension(path) {\n  if (typeof path === 'string') {\n    var splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/;\n    var pathParts = splitPathRe.exec(path);\n\n    if (pathParts) {\n      return pathParts.pop().toLowerCase();\n    }\n  }\n\n  return '';\n};\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param    {string} url\n *           The url to check.\n *\n * @param    {Object} [winLoc]\n *           the domain to check the url against, defaults to window.location\n *\n * @param    {string} [winLoc.protocol]\n *           The window location protocol defaults to window.location.protocol\n *\n * @param    {string} [winLoc.host]\n *           The window location host defaults to window.location.host\n *\n * @return   {boolean}\n *           Whether it is a cross domain request or not.\n */\n\nvar isCrossOrigin = function isCrossOrigin(url, winLoc) {\n  if (winLoc === void 0) {\n    winLoc = window$1.location;\n  }\n\n  var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol\n\n  var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin\n  // IE8 doesn't know location.origin, so we won't rely on it here\n\n  var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n  return crossOrigin;\n};\n\nvar Url = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  parseUrl: parseUrl,\n  getAbsoluteURL: getAbsoluteURL,\n  getFileExtension: getFileExtension,\n  isCrossOrigin: isCrossOrigin\n});\n\n/**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n *        webVTT file contents\n *\n * @param {TextTrack} track\n *        TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\n\nvar parseCues = function parseCues(srcContent, track) {\n  var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, window$1.WebVTT.StringDecoder());\n  var errors = [];\n\n  parser.oncue = function (cue) {\n    track.addCue(cue);\n  };\n\n  parser.onparsingerror = function (error) {\n    errors.push(error);\n  };\n\n  parser.onflush = function () {\n    track.trigger({\n      type: 'loadeddata',\n      target: track\n    });\n  };\n\n  parser.parse(srcContent);\n\n  if (errors.length > 0) {\n    if (window$1.console && window$1.console.groupCollapsed) {\n      window$1.console.groupCollapsed(\"Text Track parsing errors for \" + track.src);\n    }\n\n    errors.forEach(function (error) {\n      return log$1.error(error);\n    });\n\n    if (window$1.console && window$1.console.groupEnd) {\n      window$1.console.groupEnd();\n    }\n  }\n\n  parser.flush();\n};\n/**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n *        Url to load track from.\n *\n * @param {TextTrack} track\n *        Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\n\n\nvar loadTrack = function loadTrack(src, track) {\n  var opts = {\n    uri: src\n  };\n  var crossOrigin = isCrossOrigin(src);\n\n  if (crossOrigin) {\n    opts.cors = crossOrigin;\n  }\n\n  var withCredentials = track.tech_.crossOrigin() === 'use-credentials';\n\n  if (withCredentials) {\n    opts.withCredentials = withCredentials;\n  }\n\n  XHR(opts, bind(this, function (err, response, responseBody) {\n    if (err) {\n      return log$1.error(err, response);\n    }\n\n    track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n    // NOTE: this is only used for the alt/video.novtt.js build\n\n    if (typeof window$1.WebVTT !== 'function') {\n      if (track.tech_) {\n        // to prevent use before define eslint error, we define loadHandler\n        // as a let here\n        track.tech_.any(['vttjsloaded', 'vttjserror'], function (event) {\n          if (event.type === 'vttjserror') {\n            log$1.error(\"vttjs failed to load, stopping trying to process \" + track.src);\n            return;\n          }\n\n          return parseCues(responseBody, track);\n        });\n      }\n    } else {\n      parseCues(responseBody, track);\n    }\n  }));\n};\n/**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\n\n\nvar TextTrack = /*#__PURE__*/function (_Track) {\n  _inheritsLoose(TextTrack, _Track);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Object} options={}\n   *        Object of option names and values\n   *\n   * @param {Tech} options.tech\n   *        A reference to the tech that owns this TextTrack.\n   *\n   * @param {TextTrack~Kind} [options.kind='subtitles']\n   *        A valid text track kind.\n   *\n   * @param {TextTrack~Mode} [options.mode='disabled']\n   *        A valid text track mode.\n   *\n   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n   *        A unique id for this TextTrack.\n   *\n   * @param {string} [options.label='']\n   *        The menu label for this track.\n   *\n   * @param {string} [options.language='']\n   *        A valid two character language code.\n   *\n   * @param {string} [options.srclang='']\n   *        A valid two character language code. An alternative, but deprioritized\n   *        version of `options.language`\n   *\n   * @param {string} [options.src]\n   *        A url to TextTrack cues.\n   *\n   * @param {boolean} [options.default]\n   *        If this track should default to on or off.\n   */\n  function TextTrack(options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    if (!options.tech) {\n      throw new Error('A tech was not provided.');\n    }\n\n    var settings = mergeOptions$3(options, {\n      kind: TextTrackKind[options.kind] || 'subtitles',\n      language: options.language || options.srclang || ''\n    });\n    var mode = TextTrackMode[settings.mode] || 'disabled';\n    var default_ = settings[\"default\"];\n\n    if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n      mode = 'hidden';\n    }\n\n    _this = _Track.call(this, settings) || this;\n    _this.tech_ = settings.tech;\n    _this.cues_ = [];\n    _this.activeCues_ = [];\n    _this.preload_ = _this.tech_.preloadTextTracks !== false;\n    var cues = new TextTrackCueList(_this.cues_);\n    var activeCues = new TextTrackCueList(_this.activeCues_);\n    var changed = false;\n    _this.timeupdateHandler = bind(_assertThisInitialized(_this), function (event) {\n      if (event === void 0) {\n        event = {};\n      }\n\n      if (this.tech_.isDisposed()) {\n        return;\n      }\n\n      if (!this.tech_.isReady_) {\n        if (event.type !== 'timeupdate') {\n          this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);\n        }\n\n        return;\n      } // Accessing this.activeCues for the side-effects of updating itself\n      // due to its nature as a getter function. Do not remove or cues will\n      // stop updating!\n      // Use the setter to prevent deletion from uglify (pure_getters rule)\n\n\n      this.activeCues = this.activeCues;\n\n      if (changed) {\n        this.trigger('cuechange');\n        changed = false;\n      }\n\n      if (event.type !== 'timeupdate') {\n        this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);\n      }\n    });\n\n    var disposeHandler = function disposeHandler() {\n      _this.stopTracking();\n    };\n\n    _this.tech_.one('dispose', disposeHandler);\n\n    if (mode !== 'disabled') {\n      _this.startTracking();\n    }\n\n    Object.defineProperties(_assertThisInitialized(_this), {\n      /**\n       * @memberof TextTrack\n       * @member {boolean} default\n       *         If this track was set to be on or off by default. Cannot be changed after\n       *         creation.\n       * @instance\n       *\n       * @readonly\n       */\n      \"default\": {\n        get: function get() {\n          return default_;\n        },\n        set: function set() {}\n      },\n\n      /**\n       * @memberof TextTrack\n       * @member {string} mode\n       *         Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n       *         not be set if setting to an invalid mode.\n       * @instance\n       *\n       * @fires TextTrack#modechange\n       */\n      mode: {\n        get: function get() {\n          return mode;\n        },\n        set: function set(newMode) {\n          if (!TextTrackMode[newMode]) {\n            return;\n          }\n\n          if (mode === newMode) {\n            return;\n          }\n\n          mode = newMode;\n\n          if (!this.preload_ && mode !== 'disabled' && this.cues.length === 0) {\n            // On-demand load.\n            loadTrack(this.src, this);\n          }\n\n          this.stopTracking();\n\n          if (mode !== 'disabled') {\n            this.startTracking();\n          }\n          /**\n           * An event that fires when mode changes on this track. This allows\n           * the TextTrackList that holds this track to act accordingly.\n           *\n           * > Note: This is not part of the spec!\n           *\n           * @event TextTrack#modechange\n           * @type {EventTarget~Event}\n           */\n\n\n          this.trigger('modechange');\n        }\n      },\n\n      /**\n       * @memberof TextTrack\n       * @member {TextTrackCueList} cues\n       *         The text track cue list for this TextTrack.\n       * @instance\n       */\n      cues: {\n        get: function get() {\n          if (!this.loaded_) {\n            return null;\n          }\n\n          return cues;\n        },\n        set: function set() {}\n      },\n\n      /**\n       * @memberof TextTrack\n       * @member {TextTrackCueList} activeCues\n       *         The list text track cues that are currently active for this TextTrack.\n       * @instance\n       */\n      activeCues: {\n        get: function get() {\n          if (!this.loaded_) {\n            return null;\n          } // nothing to do\n\n\n          if (this.cues.length === 0) {\n            return activeCues;\n          }\n\n          var ct = this.tech_.currentTime();\n          var active = [];\n\n          for (var i = 0, l = this.cues.length; i < l; i++) {\n            var cue = this.cues[i];\n\n            if (cue.startTime <= ct && cue.endTime >= ct) {\n              active.push(cue);\n            } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) {\n              active.push(cue);\n            }\n          }\n\n          changed = false;\n\n          if (active.length !== this.activeCues_.length) {\n            changed = true;\n          } else {\n            for (var _i = 0; _i < active.length; _i++) {\n              if (this.activeCues_.indexOf(active[_i]) === -1) {\n                changed = true;\n              }\n            }\n          }\n\n          this.activeCues_ = active;\n          activeCues.setCues_(this.activeCues_);\n          return activeCues;\n        },\n        // /!\\ Keep this setter empty (see the timeupdate handler above)\n        set: function set() {}\n      }\n    });\n\n    if (settings.src) {\n      _this.src = settings.src;\n\n      if (!_this.preload_) {\n        // Tracks will load on-demand.\n        // Act like we're loaded for other purposes.\n        _this.loaded_ = true;\n      }\n\n      if (_this.preload_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') {\n        loadTrack(_this.src, _assertThisInitialized(_this));\n      }\n    } else {\n      _this.loaded_ = true;\n    }\n\n    return _this;\n  }\n\n  var _proto = TextTrack.prototype;\n\n  _proto.startTracking = function startTracking() {\n    // More precise cues based on requestVideoFrameCallback with a requestAnimationFram fallback\n    this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler); // Also listen to timeupdate in case rVFC/rAF stops (window in background, audio in video el)\n\n    this.tech_.on('timeupdate', this.timeupdateHandler);\n  };\n\n  _proto.stopTracking = function stopTracking() {\n    if (this.rvf_) {\n      this.tech_.cancelVideoFrameCallback(this.rvf_);\n      this.rvf_ = undefined;\n    }\n\n    this.tech_.off('timeupdate', this.timeupdateHandler);\n  }\n  /**\n   * Add a cue to the internal list of cues.\n   *\n   * @param {TextTrack~Cue} cue\n   *        The cue to add to our internal list\n   */\n  ;\n\n  _proto.addCue = function addCue(originalCue) {\n    var cue = originalCue;\n\n    if (window$1.vttjs && !(originalCue instanceof window$1.vttjs.VTTCue)) {\n      cue = new window$1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n\n      for (var prop in originalCue) {\n        if (!(prop in cue)) {\n          cue[prop] = originalCue[prop];\n        }\n      } // make sure that `id` is copied over\n\n\n      cue.id = originalCue.id;\n      cue.originalCue_ = originalCue;\n    }\n\n    var tracks = this.tech_.textTracks();\n\n    for (var i = 0; i < tracks.length; i++) {\n      if (tracks[i] !== this) {\n        tracks[i].removeCue(cue);\n      }\n    }\n\n    this.cues_.push(cue);\n    this.cues.setCues_(this.cues_);\n  }\n  /**\n   * Remove a cue from our internal list\n   *\n   * @param {TextTrack~Cue} removeCue\n   *        The cue to remove from our internal list\n   */\n  ;\n\n  _proto.removeCue = function removeCue(_removeCue) {\n    var i = this.cues_.length;\n\n    while (i--) {\n      var cue = this.cues_[i];\n\n      if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {\n        this.cues_.splice(i, 1);\n        this.cues.setCues_(this.cues_);\n        break;\n      }\n    }\n  };\n\n  return TextTrack;\n}(Track);\n/**\n * cuechange - One or more cues in the track have become active or stopped being active.\n */\n\n\nTextTrack.prototype.allowedEvents_ = {\n  cuechange: 'cuechange'\n};\n\n/**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\n\nvar AudioTrack = /*#__PURE__*/function (_Track) {\n  _inheritsLoose(AudioTrack, _Track);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Object} [options={}]\n   *        Object of option names and values\n   *\n   * @param {AudioTrack~Kind} [options.kind='']\n   *        A valid audio track kind\n   *\n   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n   *        A unique id for this AudioTrack.\n   *\n   * @param {string} [options.label='']\n   *        The menu label for this track.\n   *\n   * @param {string} [options.language='']\n   *        A valid two character language code.\n   *\n   * @param {boolean} [options.enabled]\n   *        If this track is the one that is currently playing. If this track is part of\n   *        an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n   */\n  function AudioTrack(options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    var settings = mergeOptions$3(options, {\n      kind: AudioTrackKind[options.kind] || ''\n    });\n    _this = _Track.call(this, settings) || this;\n    var enabled = false;\n    /**\n     * @memberof AudioTrack\n     * @member {boolean} enabled\n     *         If this `AudioTrack` is enabled or not. When setting this will\n     *         fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n     * @instance\n     *\n     * @fires VideoTrack#selectedchange\n     */\n\n    Object.defineProperty(_assertThisInitialized(_this), 'enabled', {\n      get: function get() {\n        return enabled;\n      },\n      set: function set(newEnabled) {\n        // an invalid or unchanged value\n        if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n          return;\n        }\n\n        enabled = newEnabled;\n        /**\n         * An event that fires when enabled changes on this track. This allows\n         * the AudioTrackList that holds this track to act accordingly.\n         *\n         * > Note: This is not part of the spec! Native tracks will do\n         *         this internally without an event.\n         *\n         * @event AudioTrack#enabledchange\n         * @type {EventTarget~Event}\n         */\n\n        this.trigger('enabledchange');\n      }\n    }); // if the user sets this track to selected then\n    // set selected to that true value otherwise\n    // we keep it false\n\n    if (settings.enabled) {\n      _this.enabled = settings.enabled;\n    }\n\n    _this.loaded_ = true;\n    return _this;\n  }\n\n  return AudioTrack;\n}(Track);\n\n/**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\n\nvar VideoTrack = /*#__PURE__*/function (_Track) {\n  _inheritsLoose(VideoTrack, _Track);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Object} [options={}]\n   *        Object of option names and values\n   *\n   * @param {string} [options.kind='']\n   *        A valid {@link VideoTrack~Kind}\n   *\n   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n   *        A unique id for this AudioTrack.\n   *\n   * @param {string} [options.label='']\n   *        The menu label for this track.\n   *\n   * @param {string} [options.language='']\n   *        A valid two character language code.\n   *\n   * @param {boolean} [options.selected]\n   *        If this track is the one that is currently playing.\n   */\n  function VideoTrack(options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    var settings = mergeOptions$3(options, {\n      kind: VideoTrackKind[options.kind] || ''\n    });\n    _this = _Track.call(this, settings) || this;\n    var selected = false;\n    /**\n     * @memberof VideoTrack\n     * @member {boolean} selected\n     *         If this `VideoTrack` is selected or not. When setting this will\n     *         fire {@link VideoTrack#selectedchange} if the state of selected changed.\n     * @instance\n     *\n     * @fires VideoTrack#selectedchange\n     */\n\n    Object.defineProperty(_assertThisInitialized(_this), 'selected', {\n      get: function get() {\n        return selected;\n      },\n      set: function set(newSelected) {\n        // an invalid or unchanged value\n        if (typeof newSelected !== 'boolean' || newSelected === selected) {\n          return;\n        }\n\n        selected = newSelected;\n        /**\n         * An event that fires when selected changes on this track. This allows\n         * the VideoTrackList that holds this track to act accordingly.\n         *\n         * > Note: This is not part of the spec! Native tracks will do\n         *         this internally without an event.\n         *\n         * @event VideoTrack#selectedchange\n         * @type {EventTarget~Event}\n         */\n\n        this.trigger('selectedchange');\n      }\n    }); // if the user sets this track to selected then\n    // set selected to that true value otherwise\n    // we keep it false\n\n    if (settings.selected) {\n      _this.selected = settings.selected;\n    }\n\n    return _this;\n  }\n\n  return VideoTrack;\n}(Track);\n\n/**\n * @memberof HTMLTrackElement\n * @typedef {HTMLTrackElement~ReadyState}\n * @enum {number}\n */\n\nvar NONE = 0;\nvar LOADING = 1;\nvar LOADED = 2;\nvar ERROR = 3;\n/**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\n\nvar HTMLTrackElement = /*#__PURE__*/function (_EventTarget) {\n  _inheritsLoose(HTMLTrackElement, _EventTarget);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Object} options={}\n   *        Object of option names and values\n   *\n   * @param {Tech} options.tech\n   *        A reference to the tech that owns this HTMLTrackElement.\n   *\n   * @param {TextTrack~Kind} [options.kind='subtitles']\n   *        A valid text track kind.\n   *\n   * @param {TextTrack~Mode} [options.mode='disabled']\n   *        A valid text track mode.\n   *\n   * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n   *        A unique id for this TextTrack.\n   *\n   * @param {string} [options.label='']\n   *        The menu label for this track.\n   *\n   * @param {string} [options.language='']\n   *        A valid two character language code.\n   *\n   * @param {string} [options.srclang='']\n   *        A valid two character language code. An alternative, but deprioritized\n   *        version of `options.language`\n   *\n   * @param {string} [options.src]\n   *        A url to TextTrack cues.\n   *\n   * @param {boolean} [options.default]\n   *        If this track should default to on or off.\n   */\n  function HTMLTrackElement(options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _EventTarget.call(this) || this;\n    var readyState;\n    var track = new TextTrack(options);\n    _this.kind = track.kind;\n    _this.src = track.src;\n    _this.srclang = track.language;\n    _this.label = track.label;\n    _this[\"default\"] = track[\"default\"];\n    Object.defineProperties(_assertThisInitialized(_this), {\n      /**\n       * @memberof HTMLTrackElement\n       * @member {HTMLTrackElement~ReadyState} readyState\n       *         The current ready state of the track element.\n       * @instance\n       */\n      readyState: {\n        get: function get() {\n          return readyState;\n        }\n      },\n\n      /**\n       * @memberof HTMLTrackElement\n       * @member {TextTrack} track\n       *         The underlying TextTrack object.\n       * @instance\n       *\n       */\n      track: {\n        get: function get() {\n          return track;\n        }\n      }\n    });\n    readyState = NONE;\n    /**\n     * @listens TextTrack#loadeddata\n     * @fires HTMLTrackElement#load\n     */\n\n    track.addEventListener('loadeddata', function () {\n      readyState = LOADED;\n\n      _this.trigger({\n        type: 'load',\n        target: _assertThisInitialized(_this)\n      });\n    });\n    return _this;\n  }\n\n  return HTMLTrackElement;\n}(EventTarget$2);\n\nHTMLTrackElement.prototype.allowedEvents_ = {\n  load: 'load'\n};\nHTMLTrackElement.NONE = NONE;\nHTMLTrackElement.LOADING = LOADING;\nHTMLTrackElement.LOADED = LOADED;\nHTMLTrackElement.ERROR = ERROR;\n\n/*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\nvar NORMAL = {\n  audio: {\n    ListClass: AudioTrackList,\n    TrackClass: AudioTrack,\n    capitalName: 'Audio'\n  },\n  video: {\n    ListClass: VideoTrackList,\n    TrackClass: VideoTrack,\n    capitalName: 'Video'\n  },\n  text: {\n    ListClass: TextTrackList,\n    TrackClass: TextTrack,\n    capitalName: 'Text'\n  }\n};\nObject.keys(NORMAL).forEach(function (type) {\n  NORMAL[type].getterName = type + \"Tracks\";\n  NORMAL[type].privateName = type + \"Tracks_\";\n});\nvar REMOTE = {\n  remoteText: {\n    ListClass: TextTrackList,\n    TrackClass: TextTrack,\n    capitalName: 'RemoteText',\n    getterName: 'remoteTextTracks',\n    privateName: 'remoteTextTracks_'\n  },\n  remoteTextEl: {\n    ListClass: HtmlTrackElementList,\n    TrackClass: HTMLTrackElement,\n    capitalName: 'RemoteTextTrackEls',\n    getterName: 'remoteTextTrackEls',\n    privateName: 'remoteTextTrackEls_'\n  }\n};\n\nvar ALL = _extends({}, NORMAL, REMOTE);\n\nREMOTE.names = Object.keys(REMOTE);\nNORMAL.names = Object.keys(NORMAL);\nALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n/**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n   * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} Tech~SourceObject\n *\n * @property {string} src\n *           The url to the source\n *\n * @property {string} type\n *           The mime type of the source\n */\n\n/**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n *        An instance of the Tech class.\n *\n * @param {string} kind\n *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n *        Label to identify the text track\n *\n * @param {string} [language]\n *        Two letter language abbreviation\n *\n * @param {Object} [options={}]\n *        An object with additional text track options\n *\n * @return {TextTrack}\n *          The text track that was created.\n */\n\nfunction createTrackHelper(self, kind, label, language, options) {\n  if (options === void 0) {\n    options = {};\n  }\n\n  var tracks = self.textTracks();\n  options.kind = kind;\n\n  if (label) {\n    options.label = label;\n  }\n\n  if (language) {\n    options.language = language;\n  }\n\n  options.tech = self;\n  var track = new ALL.text.TrackClass(options);\n  tracks.addTrack(track);\n  return track;\n}\n/**\n * This is the base class for media playback technology controllers, such as\n * {@link HTML5}\n *\n * @extends Component\n */\n\n\nvar Tech = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(Tech, _Component);\n\n  /**\n  * Create an instance of this Tech.\n  *\n  * @param {Object} [options]\n  *        The key/value store of player options.\n  *\n  * @param {Component~ReadyCallback} ready\n  *        Callback function to call when the `HTML5` Tech is ready.\n  */\n  function Tech(options, ready) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    if (ready === void 0) {\n      ready = function ready() {};\n    }\n\n    // we don't want the tech to report user activity automatically.\n    // This is done manually in addControlsListeners\n    options.reportTouchActivity = false;\n    _this = _Component.call(this, null, options, ready) || this;\n\n    _this.onDurationChange_ = function (e) {\n      return _this.onDurationChange(e);\n    };\n\n    _this.trackProgress_ = function (e) {\n      return _this.trackProgress(e);\n    };\n\n    _this.trackCurrentTime_ = function (e) {\n      return _this.trackCurrentTime(e);\n    };\n\n    _this.stopTrackingCurrentTime_ = function (e) {\n      return _this.stopTrackingCurrentTime(e);\n    };\n\n    _this.disposeSourceHandler_ = function (e) {\n      return _this.disposeSourceHandler(e);\n    };\n\n    _this.queuedHanders_ = new Set(); // keep track of whether the current source has played at all to\n    // implement a very limited played()\n\n    _this.hasStarted_ = false;\n\n    _this.on('playing', function () {\n      this.hasStarted_ = true;\n    });\n\n    _this.on('loadstart', function () {\n      this.hasStarted_ = false;\n    });\n\n    ALL.names.forEach(function (name) {\n      var props = ALL[name];\n\n      if (options && options[props.getterName]) {\n        _this[props.privateName] = options[props.getterName];\n      }\n    }); // Manually track progress in cases where the browser/tech doesn't report it.\n\n    if (!_this.featuresProgressEvents) {\n      _this.manualProgressOn();\n    } // Manually track timeupdates in cases where the browser/tech doesn't report it.\n\n\n    if (!_this.featuresTimeupdateEvents) {\n      _this.manualTimeUpdatesOn();\n    }\n\n    ['Text', 'Audio', 'Video'].forEach(function (track) {\n      if (options[\"native\" + track + \"Tracks\"] === false) {\n        _this[\"featuresNative\" + track + \"Tracks\"] = false;\n      }\n    });\n\n    if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n      _this.featuresNativeTextTracks = false;\n    } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n      _this.featuresNativeTextTracks = true;\n    }\n\n    if (!_this.featuresNativeTextTracks) {\n      _this.emulateTextTracks();\n    }\n\n    _this.preloadTextTracks = options.preloadTextTracks !== false;\n    _this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n\n    _this.initTrackListeners(); // Turn on component tap events only if not using native controls\n\n\n    if (!options.nativeControlsForTouch) {\n      _this.emitTapEvents();\n    }\n\n    if (_this.constructor) {\n      _this.name_ = _this.constructor.name || 'Unknown Tech';\n    }\n\n    return _this;\n  }\n  /**\n   * A special function to trigger source set in a way that will allow player\n   * to re-trigger if the player or tech are not ready yet.\n   *\n   * @fires Tech#sourceset\n   * @param {string} src The source string at the time of the source changing.\n   */\n\n\n  var _proto = Tech.prototype;\n\n  _proto.triggerSourceset = function triggerSourceset(src) {\n    var _this2 = this;\n\n    if (!this.isReady_) {\n      // on initial ready we have to trigger source set\n      // 1ms after ready so that player can watch for it.\n      this.one('ready', function () {\n        return _this2.setTimeout(function () {\n          return _this2.triggerSourceset(src);\n        }, 1);\n      });\n    }\n    /**\n     * Fired when the source is set on the tech causing the media element\n     * to reload.\n     *\n     * @see {@link Player#event:sourceset}\n     * @event Tech#sourceset\n     * @type {EventTarget~Event}\n     */\n\n\n    this.trigger({\n      src: src,\n      type: 'sourceset'\n    });\n  }\n  /* Fallbacks for unsupported event types\n  ================================================================================ */\n\n  /**\n   * Polyfill the `progress` event for browsers that don't support it natively.\n   *\n   * @see {@link Tech#trackProgress}\n   */\n  ;\n\n  _proto.manualProgressOn = function manualProgressOn() {\n    this.on('durationchange', this.onDurationChange_);\n    this.manualProgress = true; // Trigger progress watching when a source begins loading\n\n    this.one('ready', this.trackProgress_);\n  }\n  /**\n   * Turn off the polyfill for `progress` events that was created in\n   * {@link Tech#manualProgressOn}\n   */\n  ;\n\n  _proto.manualProgressOff = function manualProgressOff() {\n    this.manualProgress = false;\n    this.stopTrackingProgress();\n    this.off('durationchange', this.onDurationChange_);\n  }\n  /**\n   * This is used to trigger a `progress` event when the buffered percent changes. It\n   * sets an interval function that will be called every 500 milliseconds to check if the\n   * buffer end percent has changed.\n   *\n   * > This function is called by {@link Tech#manualProgressOn}\n   *\n   * @param {EventTarget~Event} event\n   *        The `ready` event that caused this to run.\n   *\n   * @listens Tech#ready\n   * @fires Tech#progress\n   */\n  ;\n\n  _proto.trackProgress = function trackProgress(event) {\n    this.stopTrackingProgress();\n    this.progressInterval = this.setInterval(bind(this, function () {\n      // Don't trigger unless buffered amount is greater than last time\n      var numBufferedPercent = this.bufferedPercent();\n\n      if (this.bufferedPercent_ !== numBufferedPercent) {\n        /**\n         * See {@link Player#progress}\n         *\n         * @event Tech#progress\n         * @type {EventTarget~Event}\n         */\n        this.trigger('progress');\n      }\n\n      this.bufferedPercent_ = numBufferedPercent;\n\n      if (numBufferedPercent === 1) {\n        this.stopTrackingProgress();\n      }\n    }), 500);\n  }\n  /**\n   * Update our internal duration on a `durationchange` event by calling\n   * {@link Tech#duration}.\n   *\n   * @param {EventTarget~Event} event\n   *        The `durationchange` event that caused this to run.\n   *\n   * @listens Tech#durationchange\n   */\n  ;\n\n  _proto.onDurationChange = function onDurationChange(event) {\n    this.duration_ = this.duration();\n  }\n  /**\n   * Get and create a `TimeRange` object for buffering.\n   *\n   * @return {TimeRange}\n   *         The time range object that was created.\n   */\n  ;\n\n  _proto.buffered = function buffered() {\n    return createTimeRanges(0, 0);\n  }\n  /**\n   * Get the percentage of the current video that is currently buffered.\n   *\n   * @return {number}\n   *         A number from 0 to 1 that represents the decimal percentage of the\n   *         video that is buffered.\n   *\n   */\n  ;\n\n  _proto.bufferedPercent = function bufferedPercent$1() {\n    return bufferedPercent(this.buffered(), this.duration_);\n  }\n  /**\n   * Turn off the polyfill for `progress` events that was created in\n   * {@link Tech#manualProgressOn}\n   * Stop manually tracking progress events by clearing the interval that was set in\n   * {@link Tech#trackProgress}.\n   */\n  ;\n\n  _proto.stopTrackingProgress = function stopTrackingProgress() {\n    this.clearInterval(this.progressInterval);\n  }\n  /**\n   * Polyfill the `timeupdate` event for browsers that don't support it.\n   *\n   * @see {@link Tech#trackCurrentTime}\n   */\n  ;\n\n  _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {\n    this.manualTimeUpdates = true;\n    this.on('play', this.trackCurrentTime_);\n    this.on('pause', this.stopTrackingCurrentTime_);\n  }\n  /**\n   * Turn off the polyfill for `timeupdate` events that was created in\n   * {@link Tech#manualTimeUpdatesOn}\n   */\n  ;\n\n  _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {\n    this.manualTimeUpdates = false;\n    this.stopTrackingCurrentTime();\n    this.off('play', this.trackCurrentTime_);\n    this.off('pause', this.stopTrackingCurrentTime_);\n  }\n  /**\n   * Sets up an interval function to track current time and trigger `timeupdate` every\n   * 250 milliseconds.\n   *\n   * @listens Tech#play\n   * @triggers Tech#timeupdate\n   */\n  ;\n\n  _proto.trackCurrentTime = function trackCurrentTime() {\n    if (this.currentTimeInterval) {\n      this.stopTrackingCurrentTime();\n    }\n\n    this.currentTimeInterval = this.setInterval(function () {\n      /**\n       * Triggered at an interval of 250ms to indicated that time is passing in the video.\n       *\n       * @event Tech#timeupdate\n       * @type {EventTarget~Event}\n       */\n      this.trigger({\n        type: 'timeupdate',\n        target: this,\n        manuallyTriggered: true\n      }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n    }, 250);\n  }\n  /**\n   * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n   * `timeupdate` event is no longer triggered.\n   *\n   * @listens {Tech#pause}\n   */\n  ;\n\n  _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {\n    this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen,\n    // the progress bar won't make it all the way to the end\n\n    this.trigger({\n      type: 'timeupdate',\n      target: this,\n      manuallyTriggered: true\n    });\n  }\n  /**\n   * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n   * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n   *\n   * @fires Component#dispose\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    // clear out all tracks because we can't reuse them between techs\n    this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking\n\n    if (this.manualProgress) {\n      this.manualProgressOff();\n    }\n\n    if (this.manualTimeUpdates) {\n      this.manualTimeUpdatesOff();\n    }\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n   *\n   * > Note: Techs without source handlers should call this between sources for `video`\n   *         & `audio` tracks. You don't want to use them between tracks!\n   *\n   * @param {string[]|string} types\n   *        TrackList names to clear, valid names are `video`, `audio`, and\n   *        `text`.\n   */\n  ;\n\n  _proto.clearTracks = function clearTracks(types) {\n    var _this3 = this;\n\n    types = [].concat(types); // clear out all tracks because we can't reuse them between techs\n\n    types.forEach(function (type) {\n      var list = _this3[type + \"Tracks\"]() || [];\n      var i = list.length;\n\n      while (i--) {\n        var track = list[i];\n\n        if (type === 'text') {\n          _this3.removeRemoteTextTrack(track);\n        }\n\n        list.removeTrack(track);\n      }\n    });\n  }\n  /**\n   * Remove any TextTracks added via addRemoteTextTrack that are\n   * flagged for automatic garbage collection\n   */\n  ;\n\n  _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {\n    var list = this.autoRemoteTextTracks_ || [];\n    var i = list.length;\n\n    while (i--) {\n      var track = list[i];\n      this.removeRemoteTextTrack(track);\n    }\n  }\n  /**\n   * Reset the tech, which will removes all sources and reset the internal readyState.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.reset = function reset() {}\n  /**\n   * Get the value of `crossOrigin` from the tech.\n   *\n   * @abstract\n   *\n   * @see {Html5#crossOrigin}\n   */\n  ;\n\n  _proto.crossOrigin = function crossOrigin() {}\n  /**\n   * Set the value of `crossOrigin` on the tech.\n   *\n   * @abstract\n   *\n   * @param {string} crossOrigin the crossOrigin value\n   * @see {Html5#setCrossOrigin}\n   */\n  ;\n\n  _proto.setCrossOrigin = function setCrossOrigin() {}\n  /**\n   * Get or set an error on the Tech.\n   *\n   * @param {MediaError} [err]\n   *        Error to set on the Tech\n   *\n   * @return {MediaError|null}\n   *         The current error object on the tech, or null if there isn't one.\n   */\n  ;\n\n  _proto.error = function error(err) {\n    if (err !== undefined) {\n      this.error_ = new MediaError(err);\n      this.trigger('error');\n    }\n\n    return this.error_;\n  }\n  /**\n   * Returns the `TimeRange`s that have been played through for the current source.\n   *\n   * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n   *         It only checks whether the source has played at all or not.\n   *\n   * @return {TimeRange}\n   *         - A single time range if this video has played\n   *         - An empty set of ranges if not.\n   */\n  ;\n\n  _proto.played = function played() {\n    if (this.hasStarted_) {\n      return createTimeRanges(0, 0);\n    }\n\n    return createTimeRanges();\n  }\n  /**\n   * Start playback\n   *\n   * @abstract\n   *\n   * @see {Html5#play}\n   */\n  ;\n\n  _proto.play = function play() {}\n  /**\n   * Set whether we are scrubbing or not\n   *\n   * @abstract\n   *\n   * @see {Html5#setScrubbing}\n   */\n  ;\n\n  _proto.setScrubbing = function setScrubbing() {}\n  /**\n   * Get whether we are scrubbing or not\n   *\n   * @abstract\n   *\n   * @see {Html5#scrubbing}\n   */\n  ;\n\n  _proto.scrubbing = function scrubbing() {}\n  /**\n   * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n   * previously called.\n   *\n   * @fires Tech#timeupdate\n   */\n  ;\n\n  _proto.setCurrentTime = function setCurrentTime() {\n    // improve the accuracy of manual timeupdates\n    if (this.manualTimeUpdates) {\n      /**\n       * A manual `timeupdate` event.\n       *\n       * @event Tech#timeupdate\n       * @type {EventTarget~Event}\n       */\n      this.trigger({\n        type: 'timeupdate',\n        target: this,\n        manuallyTriggered: true\n      });\n    }\n  }\n  /**\n   * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n   * {@link TextTrackList} events.\n   *\n   * This adds {@link EventTarget~EventListeners} for `addtrack`, and  `removetrack`.\n   *\n   * @fires Tech#audiotrackchange\n   * @fires Tech#videotrackchange\n   * @fires Tech#texttrackchange\n   */\n  ;\n\n  _proto.initTrackListeners = function initTrackListeners() {\n    var _this4 = this;\n\n    /**\n      * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n      *\n      * @event Tech#audiotrackchange\n      * @type {EventTarget~Event}\n      */\n\n    /**\n      * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n      *\n      * @event Tech#videotrackchange\n      * @type {EventTarget~Event}\n      */\n\n    /**\n      * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n      *\n      * @event Tech#texttrackchange\n      * @type {EventTarget~Event}\n      */\n    NORMAL.names.forEach(function (name) {\n      var props = NORMAL[name];\n\n      var trackListChanges = function trackListChanges() {\n        _this4.trigger(name + \"trackchange\");\n      };\n\n      var tracks = _this4[props.getterName]();\n\n      tracks.addEventListener('removetrack', trackListChanges);\n      tracks.addEventListener('addtrack', trackListChanges);\n\n      _this4.on('dispose', function () {\n        tracks.removeEventListener('removetrack', trackListChanges);\n        tracks.removeEventListener('addtrack', trackListChanges);\n      });\n    });\n  }\n  /**\n   * Emulate TextTracks using vtt.js if necessary\n   *\n   * @fires Tech#vttjsloaded\n   * @fires Tech#vttjserror\n   */\n  ;\n\n  _proto.addWebVttScript_ = function addWebVttScript_() {\n    var _this5 = this;\n\n    if (window$1.WebVTT) {\n      return;\n    } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n    // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n    // before inserting the WebVTT script\n\n\n    if (document.body.contains(this.el())) {\n      // load via require if available and vtt.js script location was not passed in\n      // as an option. novtt builds will turn the above require call into an empty object\n      // which will cause this if check to always fail.\n      if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) {\n        this.trigger('vttjsloaded');\n        return;\n      } // load vtt.js via the script location option or the cdn of no location was\n      // passed in\n\n\n      var script = document.createElement('script');\n      script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n\n      script.onload = function () {\n        /**\n         * Fired when vtt.js is loaded.\n         *\n         * @event Tech#vttjsloaded\n         * @type {EventTarget~Event}\n         */\n        _this5.trigger('vttjsloaded');\n      };\n\n      script.onerror = function () {\n        /**\n         * Fired when vtt.js was not loaded due to an error\n         *\n         * @event Tech#vttjsloaded\n         * @type {EventTarget~Event}\n         */\n        _this5.trigger('vttjserror');\n      };\n\n      this.on('dispose', function () {\n        script.onload = null;\n        script.onerror = null;\n      }); // but have not loaded yet and we set it to true before the inject so that\n      // we don't overwrite the injected window.WebVTT if it loads right away\n\n      window$1.WebVTT = true;\n      this.el().parentNode.appendChild(script);\n    } else {\n      this.ready(this.addWebVttScript_);\n    }\n  }\n  /**\n   * Emulate texttracks\n   *\n   */\n  ;\n\n  _proto.emulateTextTracks = function emulateTextTracks() {\n    var _this6 = this;\n\n    var tracks = this.textTracks();\n    var remoteTracks = this.remoteTextTracks();\n\n    var handleAddTrack = function handleAddTrack(e) {\n      return tracks.addTrack(e.track);\n    };\n\n    var handleRemoveTrack = function handleRemoveTrack(e) {\n      return tracks.removeTrack(e.track);\n    };\n\n    remoteTracks.on('addtrack', handleAddTrack);\n    remoteTracks.on('removetrack', handleRemoveTrack);\n    this.addWebVttScript_();\n\n    var updateDisplay = function updateDisplay() {\n      return _this6.trigger('texttrackchange');\n    };\n\n    var textTracksChanges = function textTracksChanges() {\n      updateDisplay();\n\n      for (var i = 0; i < tracks.length; i++) {\n        var track = tracks[i];\n        track.removeEventListener('cuechange', updateDisplay);\n\n        if (track.mode === 'showing') {\n          track.addEventListener('cuechange', updateDisplay);\n        }\n      }\n    };\n\n    textTracksChanges();\n    tracks.addEventListener('change', textTracksChanges);\n    tracks.addEventListener('addtrack', textTracksChanges);\n    tracks.addEventListener('removetrack', textTracksChanges);\n    this.on('dispose', function () {\n      remoteTracks.off('addtrack', handleAddTrack);\n      remoteTracks.off('removetrack', handleRemoveTrack);\n      tracks.removeEventListener('change', textTracksChanges);\n      tracks.removeEventListener('addtrack', textTracksChanges);\n      tracks.removeEventListener('removetrack', textTracksChanges);\n\n      for (var i = 0; i < tracks.length; i++) {\n        var track = tracks[i];\n        track.removeEventListener('cuechange', updateDisplay);\n      }\n    });\n  }\n  /**\n   * Create and returns a remote {@link TextTrack} object.\n   *\n   * @param {string} kind\n   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n   *\n   * @param {string} [label]\n   *        Label to identify the text track\n   *\n   * @param {string} [language]\n   *        Two letter language abbreviation\n   *\n   * @return {TextTrack}\n   *         The TextTrack that gets created.\n   */\n  ;\n\n  _proto.addTextTrack = function addTextTrack(kind, label, language) {\n    if (!kind) {\n      throw new Error('TextTrack kind is required but was not provided');\n    }\n\n    return createTrackHelper(this, kind, label, language);\n  }\n  /**\n   * Create an emulated TextTrack for use by addRemoteTextTrack\n   *\n   * This is intended to be overridden by classes that inherit from\n   * Tech in order to create native or custom TextTracks.\n   *\n   * @param {Object} options\n   *        The object should contain the options to initialize the TextTrack with.\n   *\n   * @param {string} [options.kind]\n   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n   *\n   * @param {string} [options.label].\n   *        Label to identify the text track\n   *\n   * @param {string} [options.language]\n   *        Two letter language abbreviation.\n   *\n   * @return {HTMLTrackElement}\n   *         The track element that gets created.\n   */\n  ;\n\n  _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n    var track = mergeOptions$3(options, {\n      tech: this\n    });\n    return new REMOTE.remoteTextEl.TrackClass(track);\n  }\n  /**\n   * Creates a remote text track object and returns an html track element.\n   *\n   * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n   *\n   * @param {Object} options\n   *        See {@link Tech#createRemoteTextTrack} for more detailed properties.\n   *\n   * @param {boolean} [manualCleanup=true]\n   *        - When false: the TextTrack will be automatically removed from the video\n   *          element whenever the source changes\n   *        - When True: The TextTrack will have to be cleaned up manually\n   *\n   * @return {HTMLTrackElement}\n   *         An Html Track Element.\n   *\n   * @deprecated The default functionality for this function will be equivalent\n   *             to \"manualCleanup=false\" in the future. The manualCleanup parameter will\n   *             also be removed.\n   */\n  ;\n\n  _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n    var _this7 = this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    var htmlTrackElement = this.createRemoteTextTrack(options);\n\n    if (manualCleanup !== true && manualCleanup !== false) {\n      // deprecation warning\n      log$1.warn('Calling addRemoteTextTrack without explicitly setting the \"manualCleanup\" parameter to `true` is deprecated and default to `false` in future version of video.js');\n      manualCleanup = true;\n    } // store HTMLTrackElement and TextTrack to remote list\n\n\n    this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n    this.remoteTextTracks().addTrack(htmlTrackElement.track);\n\n    if (manualCleanup !== true) {\n      // create the TextTrackList if it doesn't exist\n      this.ready(function () {\n        return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);\n      });\n    }\n\n    return htmlTrackElement;\n  }\n  /**\n   * Remove a remote text track from the remote `TextTrackList`.\n   *\n   * @param {TextTrack} track\n   *        `TextTrack` to remove from the `TextTrackList`\n   */\n  ;\n\n  _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n    var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list\n\n    this.remoteTextTrackEls().removeTrackElement_(trackElement);\n    this.remoteTextTracks().removeTrack(track);\n    this.autoRemoteTextTracks_.removeTrack(track);\n  }\n  /**\n   * Gets available media playback quality metrics as specified by the W3C's Media\n   * Playback Quality API.\n   *\n   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n   *\n   * @return {Object}\n   *         An object with supported media playback quality metrics\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n    return {};\n  }\n  /**\n   * Attempt to create a floating video window always on top of other windows\n   * so that users may continue consuming media while they interact with other\n   * content sites, or applications on their device.\n   *\n   * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n   *\n   * @return {Promise|undefined}\n   *         A promise with a Picture-in-Picture window if the browser supports\n   *         Promises (or one was passed in as an option). It returns undefined\n   *         otherwise.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.requestPictureInPicture = function requestPictureInPicture() {\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      return PromiseClass.reject();\n    }\n  }\n  /**\n   * A method to check for the value of the 'disablePictureInPicture' <video> property.\n   * Defaults to true, as it should be considered disabled if the tech does not support pip\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.disablePictureInPicture = function disablePictureInPicture() {\n    return true;\n  }\n  /**\n   * A method to set or unset the 'disablePictureInPicture' <video> property.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {}\n  /**\n   * A fallback implementation of requestVideoFrameCallback using requestAnimationFrame\n   *\n   * @param {function} cb\n   * @return {number} request id\n   */\n  ;\n\n  _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {\n    var _this8 = this;\n\n    var id = newGUID();\n\n    if (!this.isReady_ || this.paused()) {\n      this.queuedHanders_.add(id);\n      this.one('playing', function () {\n        if (_this8.queuedHanders_.has(id)) {\n          _this8.queuedHanders_[\"delete\"](id);\n\n          cb();\n        }\n      });\n    } else {\n      this.requestNamedAnimationFrame(id, cb);\n    }\n\n    return id;\n  }\n  /**\n   * A fallback implementation of cancelVideoFrameCallback\n   *\n   * @param {number} id id of callback to be cancelled\n   */\n  ;\n\n  _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {\n    if (this.queuedHanders_.has(id)) {\n      this.queuedHanders_[\"delete\"](id);\n    } else {\n      this.cancelNamedAnimationFrame(id);\n    }\n  }\n  /**\n   * A method to set a poster from a `Tech`.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.setPoster = function setPoster() {}\n  /**\n   * A method to check for the presence of the 'playsinline' <video> attribute.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.playsinline = function playsinline() {}\n  /**\n   * A method to set or unset the 'playsinline' <video> attribute.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.setPlaysinline = function setPlaysinline() {}\n  /**\n   * Attempt to force override of native audio tracks.\n   *\n   * @param {boolean} override - If set to true native audio will be overridden,\n   * otherwise native audio will potentially be used.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {}\n  /**\n   * Attempt to force override of native video tracks.\n   *\n   * @param {boolean} override - If set to true native video will be overridden,\n   * otherwise native video will potentially be used.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {}\n  /*\n   * Check if the tech can support the given mime-type.\n   *\n   * The base tech does not support any type, but source handlers might\n   * overwrite this.\n   *\n   * @param  {string} type\n   *         The mimetype to check for support\n   *\n   * @return {string}\n   *         'probably', 'maybe', or empty string\n   *\n   * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.canPlayType = function canPlayType() {\n    return '';\n  }\n  /**\n   * Check if the type is supported by this tech.\n   *\n   * The base tech does not support any type, but source handlers might\n   * overwrite this.\n   *\n   * @param {string} type\n   *        The media type to check\n   * @return {string} Returns the native video element's response\n   */\n  ;\n\n  Tech.canPlayType = function canPlayType() {\n    return '';\n  }\n  /**\n   * Check if the tech can support the given source\n   *\n   * @param {Object} srcObj\n   *        The source object\n   * @param {Object} options\n   *        The options passed to the tech\n   * @return {string} 'probably', 'maybe', or '' (empty string)\n   */\n  ;\n\n  Tech.canPlaySource = function canPlaySource(srcObj, options) {\n    return Tech.canPlayType(srcObj.type);\n  }\n  /*\n   * Return whether the argument is a Tech or not.\n   * Can be passed either a Class like `Html5` or a instance like `player.tech_`\n   *\n   * @param {Object} component\n   *        The item to check\n   *\n   * @return {boolean}\n   *         Whether it is a tech or not\n   *         - True if it is a tech\n   *         - False if it is not\n   */\n  ;\n\n  Tech.isTech = function isTech(component) {\n    return component.prototype instanceof Tech || component instanceof Tech || component === Tech;\n  }\n  /**\n   * Registers a `Tech` into a shared list for videojs.\n   *\n   * @param {string} name\n   *        Name of the `Tech` to register.\n   *\n   * @param {Object} tech\n   *        The `Tech` class to register.\n   */\n  ;\n\n  Tech.registerTech = function registerTech(name, tech) {\n    if (!Tech.techs_) {\n      Tech.techs_ = {};\n    }\n\n    if (!Tech.isTech(tech)) {\n      throw new Error(\"Tech \" + name + \" must be a Tech\");\n    }\n\n    if (!Tech.canPlayType) {\n      throw new Error('Techs must have a static canPlayType method on them');\n    }\n\n    if (!Tech.canPlaySource) {\n      throw new Error('Techs must have a static canPlaySource method on them');\n    }\n\n    name = toTitleCase$1(name);\n    Tech.techs_[name] = tech;\n    Tech.techs_[toLowerCase(name)] = tech;\n\n    if (name !== 'Tech') {\n      // camel case the techName for use in techOrder\n      Tech.defaultTechOrder_.push(name);\n    }\n\n    return tech;\n  }\n  /**\n   * Get a `Tech` from the shared list by name.\n   *\n   * @param {string} name\n   *        `camelCase` or `TitleCase` name of the Tech to get\n   *\n   * @return {Tech|undefined}\n   *         The `Tech` or undefined if there was no tech with the name requested.\n   */\n  ;\n\n  Tech.getTech = function getTech(name) {\n    if (!name) {\n      return;\n    }\n\n    if (Tech.techs_ && Tech.techs_[name]) {\n      return Tech.techs_[name];\n    }\n\n    name = toTitleCase$1(name);\n\n    if (window$1 && window$1.videojs && window$1.videojs[name]) {\n      log$1.warn(\"The \" + name + \" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)\");\n      return window$1.videojs[name];\n    }\n  };\n\n  return Tech;\n}(Component$1);\n/**\n * Get the {@link VideoTrackList}\n *\n * @returns {VideoTrackList}\n * @method Tech.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @returns {AudioTrackList}\n * @method Tech.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.textTracks\n */\n\n/**\n * Get the remote element {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote element {@link HtmlTrackElementList}\n *\n * @returns {HtmlTrackElementList}\n * @method Tech.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n  var props = ALL[name];\n\n  Tech.prototype[props.getterName] = function () {\n    this[props.privateName] = this[props.privateName] || new props.ListClass();\n    return this[props.privateName];\n  };\n});\n/**\n * List of associated text tracks\n *\n * @type {TextTrackList}\n * @private\n * @property Tech#textTracks_\n */\n\n/**\n * List of associated audio tracks.\n *\n * @type {AudioTrackList}\n * @private\n * @property Tech#audioTracks_\n */\n\n/**\n * List of associated video tracks.\n *\n * @type {VideoTrackList}\n * @private\n * @property Tech#videoTracks_\n */\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresVolumeControl = true;\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default\n */\n\nTech.prototype.featuresMuteControl = true;\n/**\n * Boolean indicating whether the `Tech` supports fullscreen resize control.\n * Resizing plugins using request fullscreen reloads the plugin\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresFullscreenResize = false;\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the video\n * plays. Examples:\n *   - Set player to play 2x (twice) as fast\n *   - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresPlaybackRate = false;\n/**\n * Boolean indicating whether the `Tech` supports the `progress` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualProgressOn} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresProgressEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * A tech should set this to `true` and then use {@link Tech#triggerSourceset}\n * to trigger a {@link Tech#event:sourceset} at the earliest time after getting\n * a new source.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresSourceset = false;\n/**\n * Boolean indicating whether the `Tech` supports the `timeupdate` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualTimeUpdates} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresTimeupdateEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the native `TextTrack`s.\n * This will help us integrate with native `TextTrack`s if the browser supports them.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresNativeTextTracks = false;\n/**\n * Boolean indicating whether the `Tech` supports `requestVideoFrameCallback`.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresVideoFrameCallback = false;\n/**\n * A functional mixin for techs that want to use the Source Handler pattern.\n * Source handlers are scripts for handling specific formats.\n * The source handler pattern is used for adaptive formats (HLS, DASH) that\n * manually load video data and feed it into a Source Buffer (Media Source Extensions)\n * Example: `Tech.withSourceHandlers.call(MyTech);`\n *\n * @param {Tech} _Tech\n *        The tech to add source handler functions to.\n *\n * @mixes Tech~SourceHandlerAdditions\n */\n\nTech.withSourceHandlers = function (_Tech) {\n  /**\n   * Register a source handler\n   *\n   * @param {Function} handler\n   *        The source handler class\n   *\n   * @param {number} [index]\n   *        Register it at the following index\n   */\n  _Tech.registerSourceHandler = function (handler, index) {\n    var handlers = _Tech.sourceHandlers;\n\n    if (!handlers) {\n      handlers = _Tech.sourceHandlers = [];\n    }\n\n    if (index === undefined) {\n      // add to the end of the list\n      index = handlers.length;\n    }\n\n    handlers.splice(index, 0, handler);\n  };\n  /**\n   * Check if the tech can support the given type. Also checks the\n   * Techs sourceHandlers.\n   *\n   * @param {string} type\n   *         The mimetype to check.\n   *\n   * @return {string}\n   *         'probably', 'maybe', or '' (empty string)\n   */\n\n\n  _Tech.canPlayType = function (type) {\n    var handlers = _Tech.sourceHandlers || [];\n    var can;\n\n    for (var i = 0; i < handlers.length; i++) {\n      can = handlers[i].canPlayType(type);\n\n      if (can) {\n        return can;\n      }\n    }\n\n    return '';\n  };\n  /**\n   * Returns the first source handler that supports the source.\n   *\n   * TODO: Answer question: should 'probably' be prioritized over 'maybe'\n   *\n   * @param {Tech~SourceObject} source\n   *        The source object\n   *\n   * @param {Object} options\n   *        The options passed to the tech\n   *\n   * @return {SourceHandler|null}\n   *          The first source handler that supports the source or null if\n   *          no SourceHandler supports the source\n   */\n\n\n  _Tech.selectSourceHandler = function (source, options) {\n    var handlers = _Tech.sourceHandlers || [];\n    var can;\n\n    for (var i = 0; i < handlers.length; i++) {\n      can = handlers[i].canHandleSource(source, options);\n\n      if (can) {\n        return handlers[i];\n      }\n    }\n\n    return null;\n  };\n  /**\n   * Check if the tech can support the given source.\n   *\n   * @param {Tech~SourceObject} srcObj\n   *        The source object\n   *\n   * @param {Object} options\n   *        The options passed to the tech\n   *\n   * @return {string}\n   *         'probably', 'maybe', or '' (empty string)\n   */\n\n\n  _Tech.canPlaySource = function (srcObj, options) {\n    var sh = _Tech.selectSourceHandler(srcObj, options);\n\n    if (sh) {\n      return sh.canHandleSource(srcObj, options);\n    }\n\n    return '';\n  };\n  /**\n   * When using a source handler, prefer its implementation of\n   * any function normally provided by the tech.\n   */\n\n\n  var deferrable = ['seekable', 'seeking', 'duration'];\n  /**\n   * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable\n   * function if it exists, with a fallback to the Techs seekable function.\n   *\n   * @method _Tech.seekable\n   */\n\n  /**\n   * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration\n   * function if it exists, otherwise it will fallback to the techs duration function.\n   *\n   * @method _Tech.duration\n   */\n\n  deferrable.forEach(function (fnName) {\n    var originalFn = this[fnName];\n\n    if (typeof originalFn !== 'function') {\n      return;\n    }\n\n    this[fnName] = function () {\n      if (this.sourceHandler_ && this.sourceHandler_[fnName]) {\n        return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);\n      }\n\n      return originalFn.apply(this, arguments);\n    };\n  }, _Tech.prototype);\n  /**\n   * Create a function for setting the source using a source object\n   * and source handlers.\n   * Should never be called unless a source handler was found.\n   *\n   * @param {Tech~SourceObject} source\n   *        A source object with src and type keys\n   */\n\n  _Tech.prototype.setSource = function (source) {\n    var sh = _Tech.selectSourceHandler(source, this.options_);\n\n    if (!sh) {\n      // Fall back to a native source hander when unsupported sources are\n      // deliberately set\n      if (_Tech.nativeSourceHandler) {\n        sh = _Tech.nativeSourceHandler;\n      } else {\n        log$1.error('No source handler found for the current source.');\n      }\n    } // Dispose any existing source handler\n\n\n    this.disposeSourceHandler();\n    this.off('dispose', this.disposeSourceHandler_);\n\n    if (sh !== _Tech.nativeSourceHandler) {\n      this.currentSource_ = source;\n    }\n\n    this.sourceHandler_ = sh.handleSource(source, this, this.options_);\n    this.one('dispose', this.disposeSourceHandler_);\n  };\n  /**\n   * Clean up any existing SourceHandlers and listeners when the Tech is disposed.\n   *\n   * @listens Tech#dispose\n   */\n\n\n  _Tech.prototype.disposeSourceHandler = function () {\n    // if we have a source and get another one\n    // then we are loading something new\n    // than clear all of our current tracks\n    if (this.currentSource_) {\n      this.clearTracks(['audio', 'video']);\n      this.currentSource_ = null;\n    } // always clean up auto-text tracks\n\n\n    this.cleanupAutoTextTracks();\n\n    if (this.sourceHandler_) {\n      if (this.sourceHandler_.dispose) {\n        this.sourceHandler_.dispose();\n      }\n\n      this.sourceHandler_ = null;\n    }\n  };\n}; // The base Tech class needs to be registered as a Component. It is the only\n// Tech that can be registered as a Component.\n\n\nComponent$1.registerComponent('Tech', Tech);\nTech.registerTech('Tech', Tech);\n/**\n * A list of techs that should be added to techOrder on Players\n *\n * @private\n */\n\nTech.defaultTechOrder_ = [];\n\n/**\n * @file middleware.js\n * @module middleware\n */\nvar middlewares = {};\nvar middlewareInstances = {};\nvar TERMINATOR = {};\n/**\n * A middleware object is a plain JavaScript object that has methods that\n * match the {@link Tech} methods found in the lists of allowed\n * {@link module:middleware.allowedGetters|getters},\n * {@link module:middleware.allowedSetters|setters}, and\n * {@link module:middleware.allowedMediators|mediators}.\n *\n * @typedef {Object} MiddlewareObject\n */\n\n/**\n * A middleware factory function that should return a\n * {@link module:middleware~MiddlewareObject|MiddlewareObject}.\n *\n * This factory will be called for each player when needed, with the player\n * passed in as an argument.\n *\n * @callback MiddlewareFactory\n * @param {Player} player\n *        A Video.js player.\n */\n\n/**\n * Define a middleware that the player should use by way of a factory function\n * that returns a middleware object.\n *\n * @param  {string} type\n *         The MIME type to match or `\"*\"` for all MIME types.\n *\n * @param  {MiddlewareFactory} middleware\n *         A middleware factory function that will be executed for\n *         matching types.\n */\n\nfunction use(type, middleware) {\n  middlewares[type] = middlewares[type] || [];\n  middlewares[type].push(middleware);\n}\n/**\n * Asynchronously sets a source using middleware by recursing through any\n * matching middlewares and calling `setSource` on each, passing along the\n * previous returned value each time.\n *\n * @param  {Player} player\n *         A {@link Player} instance.\n *\n * @param  {Tech~SourceObject} src\n *         A source object.\n *\n * @param  {Function}\n *         The next middleware to run.\n */\n\nfunction setSource(player, src, next) {\n  player.setTimeout(function () {\n    return setSourceHelper(src, middlewares[src.type], next, player);\n  }, 1);\n}\n/**\n * When the tech is set, passes the tech to each middleware's `setTech` method.\n *\n * @param {Object[]} middleware\n *        An array of middleware instances.\n *\n * @param {Tech} tech\n *        A Video.js tech.\n */\n\nfunction setTech(middleware, tech) {\n  middleware.forEach(function (mw) {\n    return mw.setTech && mw.setTech(tech);\n  });\n}\n/**\n * Calls a getter on the tech first, through each middleware\n * from right to left to the player.\n *\n * @param  {Object[]} middleware\n *         An array of middleware instances.\n *\n * @param  {Tech} tech\n *         The current tech.\n *\n * @param  {string} method\n *         A method name.\n *\n * @return {Mixed}\n *         The final value from the tech after middleware has intercepted it.\n */\n\nfunction get(middleware, tech, method) {\n  return middleware.reduceRight(middlewareIterator(method), tech[method]());\n}\n/**\n * Takes the argument given to the player and calls the setter method on each\n * middleware from left to right to the tech.\n *\n * @param  {Object[]} middleware\n *         An array of middleware instances.\n *\n * @param  {Tech} tech\n *         The current tech.\n *\n * @param  {string} method\n *         A method name.\n *\n * @param  {Mixed} arg\n *         The value to set on the tech.\n *\n * @return {Mixed}\n *         The return value of the `method` of the `tech`.\n */\n\nfunction set(middleware, tech, method, arg) {\n  return tech[method](middleware.reduce(middlewareIterator(method), arg));\n}\n/**\n * Takes the argument given to the player and calls the `call` version of the\n * method on each middleware from left to right.\n *\n * Then, call the passed in method on the tech and return the result unchanged\n * back to the player, through middleware, this time from right to left.\n *\n * @param  {Object[]} middleware\n *         An array of middleware instances.\n *\n * @param  {Tech} tech\n *         The current tech.\n *\n * @param  {string} method\n *         A method name.\n *\n * @param  {Mixed} arg\n *         The value to set on the tech.\n *\n * @return {Mixed}\n *         The return value of the `method` of the `tech`, regardless of the\n *         return values of middlewares.\n */\n\nfunction mediate(middleware, tech, method, arg) {\n  if (arg === void 0) {\n    arg = null;\n  }\n\n  var callMethod = 'call' + toTitleCase$1(method);\n  var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);\n  var terminated = middlewareValue === TERMINATOR; // deprecated. The `null` return value should instead return TERMINATOR to\n  // prevent confusion if a techs method actually returns null.\n\n  var returnValue = terminated ? null : tech[method](middlewareValue);\n  executeRight(middleware, method, returnValue, terminated);\n  return returnValue;\n}\n/**\n * Enumeration of allowed getters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedGetters = {\n  buffered: 1,\n  currentTime: 1,\n  duration: 1,\n  muted: 1,\n  played: 1,\n  paused: 1,\n  seekable: 1,\n  volume: 1,\n  ended: 1\n};\n/**\n * Enumeration of allowed setters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedSetters = {\n  setCurrentTime: 1,\n  setMuted: 1,\n  setVolume: 1\n};\n/**\n * Enumeration of allowed mediators where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedMediators = {\n  play: 1,\n  pause: 1\n};\n\nfunction middlewareIterator(method) {\n  return function (value, mw) {\n    // if the previous middleware terminated, pass along the termination\n    if (value === TERMINATOR) {\n      return TERMINATOR;\n    }\n\n    if (mw[method]) {\n      return mw[method](value);\n    }\n\n    return value;\n  };\n}\n\nfunction executeRight(mws, method, value, terminated) {\n  for (var i = mws.length - 1; i >= 0; i--) {\n    var mw = mws[i];\n\n    if (mw[method]) {\n      mw[method](terminated, value);\n    }\n  }\n}\n/**\n * Clear the middleware cache for a player.\n *\n * @param  {Player} player\n *         A {@link Player} instance.\n */\n\n\nfunction clearCacheForPlayer(player) {\n  middlewareInstances[player.id()] = null;\n}\n/**\n * {\n *  [playerId]: [[mwFactory, mwInstance], ...]\n * }\n *\n * @private\n */\n\nfunction getOrCreateFactory(player, mwFactory) {\n  var mws = middlewareInstances[player.id()];\n  var mw = null;\n\n  if (mws === undefined || mws === null) {\n    mw = mwFactory(player);\n    middlewareInstances[player.id()] = [[mwFactory, mw]];\n    return mw;\n  }\n\n  for (var i = 0; i < mws.length; i++) {\n    var _mws$i = mws[i],\n        mwf = _mws$i[0],\n        mwi = _mws$i[1];\n\n    if (mwf !== mwFactory) {\n      continue;\n    }\n\n    mw = mwi;\n  }\n\n  if (mw === null) {\n    mw = mwFactory(player);\n    mws.push([mwFactory, mw]);\n  }\n\n  return mw;\n}\n\nfunction setSourceHelper(src, middleware, next, player, acc, lastRun) {\n  if (src === void 0) {\n    src = {};\n  }\n\n  if (middleware === void 0) {\n    middleware = [];\n  }\n\n  if (acc === void 0) {\n    acc = [];\n  }\n\n  if (lastRun === void 0) {\n    lastRun = false;\n  }\n\n  var _middleware = middleware,\n      mwFactory = _middleware[0],\n      mwrest = _middleware.slice(1); // if mwFactory is a string, then we're at a fork in the road\n\n\n  if (typeof mwFactory === 'string') {\n    setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun); // if we have an mwFactory, call it with the player to get the mw,\n    // then call the mw's setSource method\n  } else if (mwFactory) {\n    var mw = getOrCreateFactory(player, mwFactory); // if setSource isn't present, implicitly select this middleware\n\n    if (!mw.setSource) {\n      acc.push(mw);\n      return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n    }\n\n    mw.setSource(assign({}, src), function (err, _src) {\n      // something happened, try the next middleware on the current level\n      // make sure to use the old src\n      if (err) {\n        return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n      } // we've succeeded, now we need to go deeper\n\n\n      acc.push(mw); // if it's the same type, continue down the current chain\n      // otherwise, we want to go down the new chain\n\n      setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);\n    });\n  } else if (mwrest.length) {\n    setSourceHelper(src, mwrest, next, player, acc, lastRun);\n  } else if (lastRun) {\n    next(src, acc);\n  } else {\n    setSourceHelper(src, middlewares['*'], next, player, acc, true);\n  }\n}\n\n/**\n * Mimetypes\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml\n * @typedef Mimetypes~Kind\n * @enum\n */\n\nvar MimetypesKind = {\n  opus: 'video/ogg',\n  ogv: 'video/ogg',\n  mp4: 'video/mp4',\n  mov: 'video/mp4',\n  m4v: 'video/mp4',\n  mkv: 'video/x-matroska',\n  m4a: 'audio/mp4',\n  mp3: 'audio/mpeg',\n  aac: 'audio/aac',\n  caf: 'audio/x-caf',\n  flac: 'audio/flac',\n  oga: 'audio/ogg',\n  wav: 'audio/wav',\n  m3u8: 'application/x-mpegURL',\n  mpd: 'application/dash+xml',\n  jpg: 'image/jpeg',\n  jpeg: 'image/jpeg',\n  gif: 'image/gif',\n  png: 'image/png',\n  svg: 'image/svg+xml',\n  webp: 'image/webp'\n};\n/**\n * Get the mimetype of a given src url if possible\n *\n * @param {string} src\n *        The url to the src\n *\n * @return {string}\n *         return the mimetype if it was known or empty string otherwise\n */\n\nvar getMimetype = function getMimetype(src) {\n  if (src === void 0) {\n    src = '';\n  }\n\n  var ext = getFileExtension(src);\n  var mimetype = MimetypesKind[ext.toLowerCase()];\n  return mimetype || '';\n};\n/**\n * Find the mime type of a given source string if possible. Uses the player\n * source cache.\n *\n * @param {Player} player\n *        The player object\n *\n * @param {string} src\n *        The source string\n *\n * @return {string}\n *         The type that was found\n */\n\nvar findMimetype = function findMimetype(player, src) {\n  if (!src) {\n    return '';\n  } // 1. check for the type in the `source` cache\n\n\n  if (player.cache_.source.src === src && player.cache_.source.type) {\n    return player.cache_.source.type;\n  } // 2. see if we have this source in our `currentSources` cache\n\n\n  var matchingSources = player.cache_.sources.filter(function (s) {\n    return s.src === src;\n  });\n\n  if (matchingSources.length) {\n    return matchingSources[0].type;\n  } // 3. look for the src url in source elements and use the type there\n\n\n  var sources = player.$$('source');\n\n  for (var i = 0; i < sources.length; i++) {\n    var s = sources[i];\n\n    if (s.type && s.src && s.src === src) {\n      return s.type;\n    }\n  } // 4. finally fallback to our list of mime types based on src url extension\n\n\n  return getMimetype(src);\n};\n\n/**\n * @module filter-source\n */\n/**\n * Filter out single bad source objects or multiple source objects in an\n * array. Also flattens nested source object arrays into a 1 dimensional\n * array of source objects.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]} src\n *        The src object to filter\n *\n * @return {Tech~SourceObject[]}\n *         An array of sourceobjects containing only valid sources\n *\n * @private\n */\n\nvar filterSource = function filterSource(src) {\n  // traverse array\n  if (Array.isArray(src)) {\n    var newsrc = [];\n    src.forEach(function (srcobj) {\n      srcobj = filterSource(srcobj);\n\n      if (Array.isArray(srcobj)) {\n        newsrc = newsrc.concat(srcobj);\n      } else if (isObject(srcobj)) {\n        newsrc.push(srcobj);\n      }\n    });\n    src = newsrc;\n  } else if (typeof src === 'string' && src.trim()) {\n    // convert string into object\n    src = [fixSource({\n      src: src\n    })];\n  } else if (isObject(src) && typeof src.src === 'string' && src.src && src.src.trim()) {\n    // src is already valid\n    src = [fixSource(src)];\n  } else {\n    // invalid source, turn it into an empty array\n    src = [];\n  }\n\n  return src;\n};\n/**\n * Checks src mimetype, adding it when possible\n *\n * @param {Tech~SourceObject} src\n *        The src object to check\n * @return {Tech~SourceObject}\n *        src Object with known type\n */\n\n\nfunction fixSource(src) {\n  if (!src.type) {\n    var mimetype = getMimetype(src.src);\n\n    if (mimetype) {\n      src.type = mimetype;\n    }\n  }\n\n  return src;\n}\n\n/**\n * The `MediaLoader` is the `Component` that decides which playback technology to load\n * when a player is initialized.\n *\n * @extends Component\n */\n\nvar MediaLoader = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(MediaLoader, _Component);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should attach to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function that is run when this component is ready.\n   */\n  function MediaLoader(player, options, ready) {\n    var _this;\n\n    // MediaLoader has no element\n    var options_ = mergeOptions$3({\n      createEl: false\n    }, options);\n    _this = _Component.call(this, player, options_, ready) || this; // If there are no sources when the player is initialized,\n    // load the first supported playback technology.\n\n    if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {\n      for (var i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {\n        var techName = toTitleCase$1(j[i]);\n        var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n        // Remove once that deprecated behavior is removed.\n\n        if (!techName) {\n          tech = Component$1.getComponent(techName);\n        } // Check if the browser supports this technology\n\n\n        if (tech && tech.isSupported()) {\n          player.loadTech_(techName);\n          break;\n        }\n      }\n    } else {\n      // Loop through playback technologies (e.g. HTML5) and check for support.\n      // Then load the best source.\n      // A few assumptions here:\n      //   All playback technologies respect preload false.\n      player.src(options.playerOptions.sources);\n    }\n\n    return _this;\n  }\n\n  return MediaLoader;\n}(Component$1);\n\nComponent$1.registerComponent('MediaLoader', MediaLoader);\n\n/**\n * Component which is clickable or keyboard actionable, but is not a\n * native HTML button.\n *\n * @extends Component\n */\n\nvar ClickableComponent = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(ClickableComponent, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param  {Player} player\n   *         The `Player` that this class should be attached to.\n   *\n   * @param  {Object} [options]\n   *         The key/value store of component options.\n   *\n   * @param  {function} [options.clickHandler]\n   *         The function to call when the button is clicked / activated\n   *\n   * @param  {string} [options.controlText]\n   *         The text to set on the button\n   *\n   * @param  {string} [options.className]\n   *         A class or space separated list of classes to add the component\n   *\n   */\n  function ClickableComponent(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    if (_this.options_.controlText) {\n      _this.controlText(_this.options_.controlText);\n    }\n\n    _this.handleMouseOver_ = function (e) {\n      return _this.handleMouseOver(e);\n    };\n\n    _this.handleMouseOut_ = function (e) {\n      return _this.handleMouseOut(e);\n    };\n\n    _this.handleClick_ = function (e) {\n      return _this.handleClick(e);\n    };\n\n    _this.handleKeyDown_ = function (e) {\n      return _this.handleKeyDown(e);\n    };\n\n    _this.emitTapEvents();\n\n    _this.enable();\n\n    return _this;\n  }\n  /**\n   * Create the `ClickableComponent`s DOM element.\n   *\n   * @param {string} [tag=div]\n   *        The element's node type.\n   *\n   * @param {Object} [props={}]\n   *        An object of properties that should be set on the element.\n   *\n   * @param {Object} [attributes={}]\n   *        An object of attributes that should be set on the element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n\n\n  var _proto = ClickableComponent.prototype;\n\n  _proto.createEl = function createEl$1(tag, props, attributes) {\n    if (tag === void 0) {\n      tag = 'div';\n    }\n\n    if (props === void 0) {\n      props = {};\n    }\n\n    if (attributes === void 0) {\n      attributes = {};\n    }\n\n    props = assign({\n      className: this.buildCSSClass(),\n      tabIndex: 0\n    }, props);\n\n    if (tag === 'button') {\n      log$1.error(\"Creating a ClickableComponent with an HTML element of \" + tag + \" is not supported; use a Button instead.\");\n    } // Add ARIA attributes for clickable element which is not a native HTML button\n\n\n    attributes = assign({\n      role: 'button'\n    }, attributes);\n    this.tabIndex_ = props.tabIndex;\n    var el = createEl(tag, props, attributes);\n    el.appendChild(createEl('span', {\n      className: 'vjs-icon-placeholder'\n    }, {\n      'aria-hidden': true\n    }));\n    this.createControlTextEl(el);\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    // remove controlTextEl_ on dispose\n    this.controlTextEl_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Create a control text element on this `ClickableComponent`\n   *\n   * @param {Element} [el]\n   *        Parent element for the control text.\n   *\n   * @return {Element}\n   *         The control text element that gets created.\n   */\n  ;\n\n  _proto.createControlTextEl = function createControlTextEl(el) {\n    this.controlTextEl_ = createEl('span', {\n      className: 'vjs-control-text'\n    }, {\n      // let the screen reader user know that the text of the element may change\n      'aria-live': 'polite'\n    });\n\n    if (el) {\n      el.appendChild(this.controlTextEl_);\n    }\n\n    this.controlText(this.controlText_, el);\n    return this.controlTextEl_;\n  }\n  /**\n   * Get or set the localize text to use for the controls on the `ClickableComponent`.\n   *\n   * @param {string} [text]\n   *        Control text for element.\n   *\n   * @param {Element} [el=this.el()]\n   *        Element to set the title on.\n   *\n   * @return {string}\n   *         - The control text when getting\n   */\n  ;\n\n  _proto.controlText = function controlText(text, el) {\n    if (el === void 0) {\n      el = this.el();\n    }\n\n    if (text === undefined) {\n      return this.controlText_ || 'Need Text';\n    }\n\n    var localizedText = this.localize(text);\n    this.controlText_ = text;\n    textContent(this.controlTextEl_, localizedText);\n\n    if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {\n      // Set title attribute if only an icon is shown\n      el.setAttribute('title', localizedText);\n    }\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-control vjs-button \" + _Component.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Enable this `ClickableComponent`\n   */\n  ;\n\n  _proto.enable = function enable() {\n    if (!this.enabled_) {\n      this.enabled_ = true;\n      this.removeClass('vjs-disabled');\n      this.el_.setAttribute('aria-disabled', 'false');\n\n      if (typeof this.tabIndex_ !== 'undefined') {\n        this.el_.setAttribute('tabIndex', this.tabIndex_);\n      }\n\n      this.on(['tap', 'click'], this.handleClick_);\n      this.on('keydown', this.handleKeyDown_);\n    }\n  }\n  /**\n   * Disable this `ClickableComponent`\n   */\n  ;\n\n  _proto.disable = function disable() {\n    this.enabled_ = false;\n    this.addClass('vjs-disabled');\n    this.el_.setAttribute('aria-disabled', 'true');\n\n    if (typeof this.tabIndex_ !== 'undefined') {\n      this.el_.removeAttribute('tabIndex');\n    }\n\n    this.off('mouseover', this.handleMouseOver_);\n    this.off('mouseout', this.handleMouseOut_);\n    this.off(['tap', 'click'], this.handleClick_);\n    this.off('keydown', this.handleKeyDown_);\n  }\n  /**\n   * Handles language change in ClickableComponent for the player in components\n   *\n   *\n   */\n  ;\n\n  _proto.handleLanguagechange = function handleLanguagechange() {\n    this.controlText(this.controlText_);\n  }\n  /**\n   * Event handler that is called when a `ClickableComponent` receives a\n   * `click` or `tap` event.\n   *\n   * @param {EventTarget~Event} event\n   *        The `tap` or `click` event that caused this function to be called.\n   *\n   * @listens tap\n   * @listens click\n   * @abstract\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    if (this.options_.clickHandler) {\n      this.options_.clickHandler.call(this, arguments);\n    }\n  }\n  /**\n   * Event handler that is called when a `ClickableComponent` receives a\n   * `keydown` event.\n   *\n   * By default, if the key is Space or Enter, it will trigger a `click` event.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Support Space or Enter key operation to fire a click event. Also,\n    // prevent the event from propagating through the DOM and triggering\n    // Player hotkeys.\n    if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.trigger('click');\n    } else {\n      // Pass keypress handling up for unsupported keys\n      _Component.prototype.handleKeyDown.call(this, event);\n    }\n  };\n\n  return ClickableComponent;\n}(Component$1);\n\nComponent$1.registerComponent('ClickableComponent', ClickableComponent);\n\n/**\n * A `ClickableComponent` that handles showing the poster image for the player.\n *\n * @extends ClickableComponent\n */\n\nvar PosterImage = /*#__PURE__*/function (_ClickableComponent) {\n  _inheritsLoose(PosterImage, _ClickableComponent);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should attach to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function PosterImage(player, options) {\n    var _this;\n\n    _this = _ClickableComponent.call(this, player, options) || this;\n\n    _this.update();\n\n    _this.update_ = function (e) {\n      return _this.update(e);\n    };\n\n    player.on('posterchange', _this.update_);\n    return _this;\n  }\n  /**\n   * Clean up and dispose of the `PosterImage`.\n   */\n\n\n  var _proto = PosterImage.prototype;\n\n  _proto.dispose = function dispose() {\n    this.player().off('posterchange', this.update_);\n\n    _ClickableComponent.prototype.dispose.call(this);\n  }\n  /**\n   * Create the `PosterImage`s DOM element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl$1() {\n    var el = createEl('div', {\n      className: 'vjs-poster',\n      // Don't want poster to be tabbable.\n      tabIndex: -1\n    });\n    return el;\n  }\n  /**\n   * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.\n   *\n   * @listens Player#posterchange\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `Player#posterchange` event that triggered this function.\n   */\n  ;\n\n  _proto.update = function update(event) {\n    var url = this.player().poster();\n    this.setSrc(url); // If there's no poster source we should display:none on this component\n    // so it's not still clickable or right-clickable\n\n    if (url) {\n      this.show();\n    } else {\n      this.hide();\n    }\n  }\n  /**\n   * Set the source of the `PosterImage` depending on the display method.\n   *\n   * @param {string} url\n   *        The URL to the source for the `PosterImage`.\n   */\n  ;\n\n  _proto.setSrc = function setSrc(url) {\n    var backgroundImage = ''; // Any falsy value should stay as an empty string, otherwise\n    // this will throw an extra error\n\n    if (url) {\n      backgroundImage = \"url(\\\"\" + url + \"\\\")\";\n    }\n\n    this.el_.style.backgroundImage = backgroundImage;\n  }\n  /**\n   * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See\n   * {@link ClickableComponent#handleClick} for instances where this will be triggered.\n   *\n   * @listens tap\n   * @listens click\n   * @listens keydown\n   *\n   * @param {EventTarget~Event} event\n   +        The `click`, `tap` or `keydown` event that caused this function to be called.\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    // We don't want a click to trigger playback when controls are disabled\n    if (!this.player_.controls()) {\n      return;\n    }\n\n    var sourceIsEncrypted = this.player_.usingPlugin('eme') && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;\n\n    if (this.player_.tech(true) && // We've observed a bug in IE and Edge when playing back DRM content where\n    // calling .focus() on the video element causes the video to go black,\n    // so we avoid it in that specific case\n    !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {\n      this.player_.tech(true).focus();\n    }\n\n    if (this.player_.paused()) {\n      silencePromise(this.player_.play());\n    } else {\n      this.player_.pause();\n    }\n  };\n\n  return PosterImage;\n}(ClickableComponent);\n\nComponent$1.registerComponent('PosterImage', PosterImage);\n\nvar darkGray = '#222';\nvar lightGray = '#ccc';\nvar fontMap = {\n  monospace: 'monospace',\n  sansSerif: 'sans-serif',\n  serif: 'serif',\n  monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n  monospaceSerif: '\"Courier New\", monospace',\n  proportionalSansSerif: 'sans-serif',\n  proportionalSerif: 'serif',\n  casual: '\"Comic Sans MS\", Impact, fantasy',\n  script: '\"Monotype Corsiva\", cursive',\n  smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n/**\n * Construct an rgba color from a given hex color code.\n *\n * @param {number} color\n *        Hex number for color, like #f0e or #f604e2.\n *\n * @param {number} opacity\n *        Value for opacity, 0.0 - 1.0.\n *\n * @return {string}\n *         The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.\n */\n\nfunction constructColor(color, opacity) {\n  var hex;\n\n  if (color.length === 4) {\n    // color looks like \"#f0e\"\n    hex = color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n  } else if (color.length === 7) {\n    // color looks like \"#f604e2\"\n    hex = color.slice(1);\n  } else {\n    throw new Error('Invalid color code provided, ' + color + '; must be formatted as e.g. #f0e or #f604e2.');\n  }\n\n  return 'rgba(' + parseInt(hex.slice(0, 2), 16) + ',' + parseInt(hex.slice(2, 4), 16) + ',' + parseInt(hex.slice(4, 6), 16) + ',' + opacity + ')';\n}\n/**\n * Try to update the style of a DOM element. Some style changes will throw an error,\n * particularly in IE8. Those should be noops.\n *\n * @param {Element} el\n *        The DOM element to be styled.\n *\n * @param {string} style\n *        The CSS property on the element that should be styled.\n *\n * @param {string} rule\n *        The style rule that should be applied to the property.\n *\n * @private\n */\n\nfunction tryUpdateStyle(el, style, rule) {\n  try {\n    el.style[style] = rule;\n  } catch (e) {\n    // Satisfies linter.\n    return;\n  }\n}\n/**\n * The component for displaying text track cues.\n *\n * @extends Component\n */\n\n\nvar TextTrackDisplay = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(TextTrackDisplay, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function to call when `TextTrackDisplay` is ready.\n   */\n  function TextTrackDisplay(player, options, ready) {\n    var _this;\n\n    _this = _Component.call(this, player, options, ready) || this;\n\n    var updateDisplayHandler = function updateDisplayHandler(e) {\n      return _this.updateDisplay(e);\n    };\n\n    player.on('loadstart', function (e) {\n      return _this.toggleDisplay(e);\n    });\n    player.on('texttrackchange', updateDisplayHandler);\n    player.on('loadedmetadata', function (e) {\n      return _this.preselectTrack(e);\n    }); // This used to be called during player init, but was causing an error\n    // if a track should show by default and the display hadn't loaded yet.\n    // Should probably be moved to an external track loader when we support\n    // tracks that don't need a display.\n\n    player.ready(bind(_assertThisInitialized(_this), function () {\n      if (player.tech_ && player.tech_.featuresNativeTextTracks) {\n        this.hide();\n        return;\n      }\n\n      player.on('fullscreenchange', updateDisplayHandler);\n      player.on('playerresize', updateDisplayHandler);\n      window$1.addEventListener('orientationchange', updateDisplayHandler);\n      player.on('dispose', function () {\n        return window$1.removeEventListener('orientationchange', updateDisplayHandler);\n      });\n      var tracks = this.options_.playerOptions.tracks || [];\n\n      for (var i = 0; i < tracks.length; i++) {\n        this.player_.addRemoteTextTrack(tracks[i], true);\n      }\n\n      this.preselectTrack();\n    }));\n    return _this;\n  }\n  /**\n  * Preselect a track following this precedence:\n  * - matches the previously selected {@link TextTrack}'s language and kind\n  * - matches the previously selected {@link TextTrack}'s language only\n  * - is the first default captions track\n  * - is the first default descriptions track\n  *\n  * @listens Player#loadstart\n  */\n\n\n  var _proto = TextTrackDisplay.prototype;\n\n  _proto.preselectTrack = function preselectTrack() {\n    var modes = {\n      captions: 1,\n      subtitles: 1\n    };\n    var trackList = this.player_.textTracks();\n    var userPref = this.player_.cache_.selectedLanguage;\n    var firstDesc;\n    var firstCaptions;\n    var preferredTrack;\n\n    for (var i = 0; i < trackList.length; i++) {\n      var track = trackList[i];\n\n      if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {\n        // Always choose the track that matches both language and kind\n        if (track.kind === userPref.kind) {\n          preferredTrack = track; // or choose the first track that matches language\n        } else if (!preferredTrack) {\n          preferredTrack = track;\n        } // clear everything if offTextTrackMenuItem was clicked\n\n      } else if (userPref && !userPref.enabled) {\n        preferredTrack = null;\n        firstDesc = null;\n        firstCaptions = null;\n      } else if (track[\"default\"]) {\n        if (track.kind === 'descriptions' && !firstDesc) {\n          firstDesc = track;\n        } else if (track.kind in modes && !firstCaptions) {\n          firstCaptions = track;\n        }\n      }\n    } // The preferredTrack matches the user preference and takes\n    // precedence over all the other tracks.\n    // So, display the preferredTrack before the first default track\n    // and the subtitles/captions track before the descriptions track\n\n\n    if (preferredTrack) {\n      preferredTrack.mode = 'showing';\n    } else if (firstCaptions) {\n      firstCaptions.mode = 'showing';\n    } else if (firstDesc) {\n      firstDesc.mode = 'showing';\n    }\n  }\n  /**\n   * Turn display of {@link TextTrack}'s from the current state into the other state.\n   * There are only two states:\n   * - 'shown'\n   * - 'hidden'\n   *\n   * @listens Player#loadstart\n   */\n  ;\n\n  _proto.toggleDisplay = function toggleDisplay() {\n    if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {\n      this.hide();\n    } else {\n      this.show();\n    }\n  }\n  /**\n   * Create the {@link Component}'s DOM element.\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-text-track-display'\n    }, {\n      'translate': 'yes',\n      'aria-live': 'off',\n      'aria-atomic': 'true'\n    });\n  }\n  /**\n   * Clear all displayed {@link TextTrack}s.\n   */\n  ;\n\n  _proto.clearDisplay = function clearDisplay() {\n    if (typeof window$1.WebVTT === 'function') {\n      window$1.WebVTT.processCues(window$1, [], this.el_);\n    }\n  }\n  /**\n   * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or\n   * a {@link Player#fullscreenchange} is fired.\n   *\n   * @listens Player#texttrackchange\n   * @listens Player#fullscreenchange\n   */\n  ;\n\n  _proto.updateDisplay = function updateDisplay() {\n    var tracks = this.player_.textTracks();\n    var allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;\n    this.clearDisplay();\n\n    if (allowMultipleShowingTracks) {\n      var showingTracks = [];\n\n      for (var _i = 0; _i < tracks.length; ++_i) {\n        var track = tracks[_i];\n\n        if (track.mode !== 'showing') {\n          continue;\n        }\n\n        showingTracks.push(track);\n      }\n\n      this.updateForTrack(showingTracks);\n      return;\n    } //  Track display prioritization model: if multiple tracks are 'showing',\n    //  display the first 'subtitles' or 'captions' track which is 'showing',\n    //  otherwise display the first 'descriptions' track which is 'showing'\n\n\n    var descriptionsTrack = null;\n    var captionsSubtitlesTrack = null;\n    var i = tracks.length;\n\n    while (i--) {\n      var _track = tracks[i];\n\n      if (_track.mode === 'showing') {\n        if (_track.kind === 'descriptions') {\n          descriptionsTrack = _track;\n        } else {\n          captionsSubtitlesTrack = _track;\n        }\n      }\n    }\n\n    if (captionsSubtitlesTrack) {\n      if (this.getAttribute('aria-live') !== 'off') {\n        this.setAttribute('aria-live', 'off');\n      }\n\n      this.updateForTrack(captionsSubtitlesTrack);\n    } else if (descriptionsTrack) {\n      if (this.getAttribute('aria-live') !== 'assertive') {\n        this.setAttribute('aria-live', 'assertive');\n      }\n\n      this.updateForTrack(descriptionsTrack);\n    }\n  }\n  /**\n   * Style {@Link TextTrack} activeCues according to {@Link TextTrackSettings}.\n   *\n   * @param {TextTrack} track\n   *        Text track object containing active cues to style.\n   */\n  ;\n\n  _proto.updateDisplayState = function updateDisplayState(track) {\n    var overrides = this.player_.textTrackSettings.getValues();\n    var cues = track.activeCues;\n    var i = cues.length;\n\n    while (i--) {\n      var cue = cues[i];\n\n      if (!cue) {\n        continue;\n      }\n\n      var cueDiv = cue.displayState;\n\n      if (overrides.color) {\n        cueDiv.firstChild.style.color = overrides.color;\n      }\n\n      if (overrides.textOpacity) {\n        tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity));\n      }\n\n      if (overrides.backgroundColor) {\n        cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;\n      }\n\n      if (overrides.backgroundOpacity) {\n        tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity));\n      }\n\n      if (overrides.windowColor) {\n        if (overrides.windowOpacity) {\n          tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity));\n        } else {\n          cueDiv.style.backgroundColor = overrides.windowColor;\n        }\n      }\n\n      if (overrides.edgeStyle) {\n        if (overrides.edgeStyle === 'dropshadow') {\n          cueDiv.firstChild.style.textShadow = \"2px 2px 3px \" + darkGray + \", 2px 2px 4px \" + darkGray + \", 2px 2px 5px \" + darkGray;\n        } else if (overrides.edgeStyle === 'raised') {\n          cueDiv.firstChild.style.textShadow = \"1px 1px \" + darkGray + \", 2px 2px \" + darkGray + \", 3px 3px \" + darkGray;\n        } else if (overrides.edgeStyle === 'depressed') {\n          cueDiv.firstChild.style.textShadow = \"1px 1px \" + lightGray + \", 0 1px \" + lightGray + \", -1px -1px \" + darkGray + \", 0 -1px \" + darkGray;\n        } else if (overrides.edgeStyle === 'uniform') {\n          cueDiv.firstChild.style.textShadow = \"0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray;\n        }\n      }\n\n      if (overrides.fontPercent && overrides.fontPercent !== 1) {\n        var fontSize = window$1.parseFloat(cueDiv.style.fontSize);\n        cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px';\n        cueDiv.style.height = 'auto';\n        cueDiv.style.top = 'auto';\n      }\n\n      if (overrides.fontFamily && overrides.fontFamily !== 'default') {\n        if (overrides.fontFamily === 'small-caps') {\n          cueDiv.firstChild.style.fontVariant = 'small-caps';\n        } else {\n          cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];\n        }\n      }\n    }\n  }\n  /**\n   * Add an {@link TextTrack} to to the {@link Tech}s {@link TextTrackList}.\n   *\n   * @param {TextTrack|TextTrack[]} tracks\n   *        Text track object or text track array to be added to the list.\n   */\n  ;\n\n  _proto.updateForTrack = function updateForTrack(tracks) {\n    if (!Array.isArray(tracks)) {\n      tracks = [tracks];\n    }\n\n    if (typeof window$1.WebVTT !== 'function' || tracks.every(function (track) {\n      return !track.activeCues;\n    })) {\n      return;\n    }\n\n    var cues = []; // push all active track cues\n\n    for (var i = 0; i < tracks.length; ++i) {\n      var track = tracks[i];\n\n      for (var j = 0; j < track.activeCues.length; ++j) {\n        cues.push(track.activeCues[j]);\n      }\n    } // removes all cues before it processes new ones\n\n\n    window$1.WebVTT.processCues(window$1, cues, this.el_); // add unique class to each language text track & add settings styling if necessary\n\n    for (var _i2 = 0; _i2 < tracks.length; ++_i2) {\n      var _track2 = tracks[_i2];\n\n      for (var _j = 0; _j < _track2.activeCues.length; ++_j) {\n        var cueEl = _track2.activeCues[_j].displayState;\n        addClass(cueEl, 'vjs-text-track-cue');\n        addClass(cueEl, 'vjs-text-track-cue-' + (_track2.language ? _track2.language : _i2));\n\n        if (_track2.language) {\n          setAttribute(cueEl, 'lang', _track2.language);\n        }\n      }\n\n      if (this.player_.textTrackSettings) {\n        this.updateDisplayState(_track2);\n      }\n    }\n  };\n\n  return TextTrackDisplay;\n}(Component$1);\n\nComponent$1.registerComponent('TextTrackDisplay', TextTrackDisplay);\n\n/**\n * A loading spinner for use during waiting/loading events.\n *\n * @extends Component\n */\n\nvar LoadingSpinner = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(LoadingSpinner, _Component);\n\n  function LoadingSpinner() {\n    return _Component.apply(this, arguments) || this;\n  }\n\n  var _proto = LoadingSpinner.prototype;\n\n  /**\n   * Create the `LoadingSpinner`s DOM element.\n   *\n   * @return {Element}\n   *         The dom element that gets created.\n   */\n  _proto.createEl = function createEl$1() {\n    var isAudio = this.player_.isAudio();\n    var playerType = this.localize(isAudio ? 'Audio Player' : 'Video Player');\n    var controlText = createEl('span', {\n      className: 'vjs-control-text',\n      textContent: this.localize('{1} is loading.', [playerType])\n    });\n\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-loading-spinner',\n      dir: 'ltr'\n    });\n\n    el.appendChild(controlText);\n    return el;\n  };\n\n  return LoadingSpinner;\n}(Component$1);\n\nComponent$1.registerComponent('LoadingSpinner', LoadingSpinner);\n\n/**\n * Base class for all buttons.\n *\n * @extends ClickableComponent\n */\n\nvar Button = /*#__PURE__*/function (_ClickableComponent) {\n  _inheritsLoose(Button, _ClickableComponent);\n\n  function Button() {\n    return _ClickableComponent.apply(this, arguments) || this;\n  }\n\n  var _proto = Button.prototype;\n\n  /**\n   * Create the `Button`s DOM element.\n   *\n   * @param {string} [tag=\"button\"]\n   *        The element's node type. This argument is IGNORED: no matter what\n   *        is passed, it will always create a `button` element.\n   *\n   * @param {Object} [props={}]\n   *        An object of properties that should be set on the element.\n   *\n   * @param {Object} [attributes={}]\n   *        An object of attributes that should be set on the element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  _proto.createEl = function createEl$1(tag, props, attributes) {\n    if (props === void 0) {\n      props = {};\n    }\n\n    if (attributes === void 0) {\n      attributes = {};\n    }\n\n    tag = 'button';\n    props = assign({\n      className: this.buildCSSClass()\n    }, props); // Add attributes for button element\n\n    attributes = assign({\n      // Necessary since the default button type is \"submit\"\n      type: 'button'\n    }, attributes);\n\n    var el = createEl(tag, props, attributes);\n\n    el.appendChild(createEl('span', {\n      className: 'vjs-icon-placeholder'\n    }, {\n      'aria-hidden': true\n    }));\n    this.createControlTextEl(el);\n    return el;\n  }\n  /**\n   * Add a child `Component` inside of this `Button`.\n   *\n   * @param {string|Component} child\n   *        The name or instance of a child to add.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of options that will get passed to children of\n   *        the child.\n   *\n   * @return {Component}\n   *         The `Component` that gets added as a child. When using a string the\n   *         `Component` will get created by this process.\n   *\n   * @deprecated since version 5\n   */\n  ;\n\n  _proto.addChild = function addChild(child, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    var className = this.constructor.name;\n    log$1.warn(\"Adding an actionable (user controllable) child to a Button (\" + className + \") is not supported; use a ClickableComponent instead.\"); // Avoid the error message generated by ClickableComponent's addChild method\n\n    return Component$1.prototype.addChild.call(this, child, options);\n  }\n  /**\n   * Enable the `Button` element so that it can be activated or clicked. Use this with\n   * {@link Button#disable}.\n   */\n  ;\n\n  _proto.enable = function enable() {\n    _ClickableComponent.prototype.enable.call(this);\n\n    this.el_.removeAttribute('disabled');\n  }\n  /**\n   * Disable the `Button` element so that it cannot be activated or clicked. Use this with\n   * {@link Button#enable}.\n   */\n  ;\n\n  _proto.disable = function disable() {\n    _ClickableComponent.prototype.disable.call(this);\n\n    this.el_.setAttribute('disabled', 'disabled');\n  }\n  /**\n   * This gets called when a `Button` has focus and `keydown` is triggered via a key\n   * press.\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to get called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Ignore Space or Enter key operation, which is handled by the browser for\n    // a button - though not for its super class, ClickableComponent. Also,\n    // prevent the event from propagating through the DOM and triggering Player\n    // hotkeys. We do not preventDefault here because we _want_ the browser to\n    // handle it.\n    if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n      event.stopPropagation();\n      return;\n    } // Pass keypress handling up for unsupported keys\n\n\n    _ClickableComponent.prototype.handleKeyDown.call(this, event);\n  };\n\n  return Button;\n}(ClickableComponent);\n\nComponent$1.registerComponent('Button', Button);\n\n/**\n * The initial play button that shows before the video has played. The hiding of the\n * `BigPlayButton` get done via CSS and `Player` states.\n *\n * @extends Button\n */\n\nvar BigPlayButton = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(BigPlayButton, _Button);\n\n  function BigPlayButton(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this;\n    _this.mouseused_ = false;\n\n    _this.on('mousedown', function (e) {\n      return _this.handleMouseDown(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object. Always returns 'vjs-big-play-button'.\n   */\n\n\n  var _proto = BigPlayButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return 'vjs-big-play-button';\n  }\n  /**\n   * This gets called when a `BigPlayButton` \"clicked\". See {@link ClickableComponent}\n   * for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    var playPromise = this.player_.play(); // exit early if clicked via the mouse\n\n    if (this.mouseused_ && event.clientX && event.clientY) {\n      var sourceIsEncrypted = this.player_.usingPlugin('eme') && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;\n      silencePromise(playPromise);\n\n      if (this.player_.tech(true) && // We've observed a bug in IE and Edge when playing back DRM content where\n      // calling .focus() on the video element causes the video to go black,\n      // so we avoid it in that specific case\n      !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {\n        this.player_.tech(true).focus();\n      }\n\n      return;\n    }\n\n    var cb = this.player_.getChild('controlBar');\n    var playToggle = cb && cb.getChild('playToggle');\n\n    if (!playToggle) {\n      this.player_.tech(true).focus();\n      return;\n    }\n\n    var playFocus = function playFocus() {\n      return playToggle.focus();\n    };\n\n    if (isPromise(playPromise)) {\n      playPromise.then(playFocus, function () {});\n    } else {\n      this.setTimeout(playFocus, 1);\n    }\n  };\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    this.mouseused_ = false;\n\n    _Button.prototype.handleKeyDown.call(this, event);\n  };\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    this.mouseused_ = true;\n  };\n\n  return BigPlayButton;\n}(Button);\n/**\n * The text that should display over the `BigPlayButton`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n */\n\n\nBigPlayButton.prototype.controlText_ = 'Play Video';\nComponent$1.registerComponent('BigPlayButton', BigPlayButton);\n\n/**\n * The `CloseButton` is a `{@link Button}` that fires a `close` event when\n * it gets clicked.\n *\n * @extends Button\n */\n\nvar CloseButton = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(CloseButton, _Button);\n\n  /**\n  * Creates an instance of the this class.\n  *\n  * @param  {Player} player\n  *         The `Player` that this class should be attached to.\n  *\n  * @param  {Object} [options]\n  *         The key/value store of player options.\n  */\n  function CloseButton(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this;\n\n    _this.controlText(options && options.controlText || _this.localize('Close'));\n\n    return _this;\n  }\n  /**\n  * Builds the default DOM `className`.\n  *\n  * @return {string}\n  *         The DOM `className` for this object.\n  */\n\n\n  var _proto = CloseButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-close-button \" + _Button.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * This gets called when a `CloseButton` gets clicked. See\n   * {@link ClickableComponent#handleClick} for more information on when\n   * this will be triggered\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   * @fires CloseButton#close\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    /**\n     * Triggered when the a `CloseButton` is clicked.\n     *\n     * @event CloseButton#close\n     * @type {EventTarget~Event}\n     *\n     * @property {boolean} [bubbles=false]\n     *           set to false so that the close event does not\n     *           bubble up to parents if there is no listener\n     */\n    this.trigger({\n      type: 'close',\n      bubbles: false\n    });\n  }\n  /**\n   * Event handler that is called when a `CloseButton` receives a\n   * `keydown` event.\n   *\n   * By default, if the key is Esc, it will trigger a `click` event.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Esc button will trigger `click` event\n    if (keycode.isEventKey(event, 'Esc')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.trigger('click');\n    } else {\n      // Pass keypress handling up for unsupported keys\n      _Button.prototype.handleKeyDown.call(this, event);\n    }\n  };\n\n  return CloseButton;\n}(Button);\n\nComponent$1.registerComponent('CloseButton', CloseButton);\n\n/**\n * Button to toggle between play and pause.\n *\n * @extends Button\n */\n\nvar PlayToggle = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(PlayToggle, _Button);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function PlayToggle(player, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _Button.call(this, player, options) || this; // show or hide replay icon\n\n    options.replay = options.replay === undefined || options.replay;\n\n    _this.on(player, 'play', function (e) {\n      return _this.handlePlay(e);\n    });\n\n    _this.on(player, 'pause', function (e) {\n      return _this.handlePause(e);\n    });\n\n    if (options.replay) {\n      _this.on(player, 'ended', function (e) {\n        return _this.handleEnded(e);\n      });\n    }\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = PlayToggle.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-play-control \" + _Button.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * This gets called when an `PlayToggle` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    if (this.player_.paused()) {\n      silencePromise(this.player_.play());\n    } else {\n      this.player_.pause();\n    }\n  }\n  /**\n   * This gets called once after the video has ended and the user seeks so that\n   * we can change the replay button back to a play button.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#seeked\n   */\n  ;\n\n  _proto.handleSeeked = function handleSeeked(event) {\n    this.removeClass('vjs-ended');\n\n    if (this.player_.paused()) {\n      this.handlePause(event);\n    } else {\n      this.handlePlay(event);\n    }\n  }\n  /**\n   * Add the vjs-playing class to the element so it can change appearance.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#play\n   */\n  ;\n\n  _proto.handlePlay = function handlePlay(event) {\n    this.removeClass('vjs-ended');\n    this.removeClass('vjs-paused');\n    this.addClass('vjs-playing'); // change the button text to \"Pause\"\n\n    this.controlText('Pause');\n  }\n  /**\n   * Add the vjs-paused class to the element so it can change appearance.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#pause\n   */\n  ;\n\n  _proto.handlePause = function handlePause(event) {\n    this.removeClass('vjs-playing');\n    this.addClass('vjs-paused'); // change the button text to \"Play\"\n\n    this.controlText('Play');\n  }\n  /**\n   * Add the vjs-ended class to the element so it can change appearance\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#ended\n   */\n  ;\n\n  _proto.handleEnded = function handleEnded(event) {\n    var _this2 = this;\n\n    this.removeClass('vjs-playing');\n    this.addClass('vjs-ended'); // change the button text to \"Replay\"\n\n    this.controlText('Replay'); // on the next seek remove the replay button\n\n    this.one(this.player_, 'seeked', function (e) {\n      return _this2.handleSeeked(e);\n    });\n  };\n\n  return PlayToggle;\n}(Button);\n/**\n * The text that should display over the `PlayToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlayToggle.prototype.controlText_ = 'Play';\nComponent$1.registerComponent('PlayToggle', PlayToggle);\n\n/**\n * @file format-time.js\n * @module format-time\n */\n\n/**\n * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in\n * seconds) will force a number of leading zeros to cover the length of the\n * guide.\n *\n * @private\n * @param  {number} seconds\n *         Number of seconds to be turned into a string\n *\n * @param  {number} guide\n *         Number (in seconds) to model the string after\n *\n * @return {string}\n *         Time formatted as H:MM:SS or M:SS\n */\nvar defaultImplementation = function defaultImplementation(seconds, guide) {\n  seconds = seconds < 0 ? 0 : seconds;\n  var s = Math.floor(seconds % 60);\n  var m = Math.floor(seconds / 60 % 60);\n  var h = Math.floor(seconds / 3600);\n  var gm = Math.floor(guide / 60 % 60);\n  var gh = Math.floor(guide / 3600); // handle invalid times\n\n  if (isNaN(seconds) || seconds === Infinity) {\n    // '-' is false for all relational operators (e.g. <, >=) so this setting\n    // will add the minimum number of fields specified by the guide\n    h = m = s = '-';\n  } // Check if we need to show hours\n\n\n  h = h > 0 || gh > 0 ? h + ':' : ''; // If hours are showing, we may need to add a leading zero.\n  // Always show at least one digit of minutes.\n\n  m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':'; // Check if leading zero is need for seconds\n\n  s = s < 10 ? '0' + s : s;\n  return h + m + s;\n}; // Internal pointer to the current implementation.\n\n\nvar implementation = defaultImplementation;\n/**\n * Replaces the default formatTime implementation with a custom implementation.\n *\n * @param {Function} customImplementation\n *        A function which will be used in place of the default formatTime\n *        implementation. Will receive the current time in seconds and the\n *        guide (in seconds) as arguments.\n */\n\nfunction setFormatTime(customImplementation) {\n  implementation = customImplementation;\n}\n/**\n * Resets formatTime to the default implementation.\n */\n\nfunction resetFormatTime() {\n  implementation = defaultImplementation;\n}\n/**\n * Delegates to either the default time formatting function or a custom\n * function supplied via `setFormatTime`.\n *\n * Formats seconds as a time string (H:MM:SS or M:SS). Supplying a\n * guide (in seconds) will force a number of leading zeros to cover the\n * length of the guide.\n *\n * @static\n * @example  formatTime(125, 600) === \"02:05\"\n * @param    {number} seconds\n *           Number of seconds to be turned into a string\n *\n * @param    {number} guide\n *           Number (in seconds) to model the string after\n *\n * @return   {string}\n *           Time formatted as H:MM:SS or M:SS\n */\n\nfunction formatTime(seconds, guide) {\n  if (guide === void 0) {\n    guide = seconds;\n  }\n\n  return implementation(seconds, guide);\n}\n\n/**\n * Displays time information about the video\n *\n * @extends Component\n */\n\nvar TimeDisplay = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(TimeDisplay, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function TimeDisplay(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    _this.on(player, ['timeupdate', 'ended'], function (e) {\n      return _this.updateContent(e);\n    });\n\n    _this.updateTextNode_();\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = TimeDisplay.prototype;\n\n  _proto.createEl = function createEl$1() {\n    var className = this.buildCSSClass();\n\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: className + \" vjs-time-control vjs-control\"\n    });\n\n    var span = createEl('span', {\n      className: 'vjs-control-text',\n      textContent: this.localize(this.labelText_) + \"\\xA0\"\n    }, {\n      role: 'presentation'\n    });\n    el.appendChild(span);\n    this.contentEl_ = createEl('span', {\n      className: className + \"-display\"\n    }, {\n      // tell screen readers not to automatically read the time as it changes\n      'aria-live': 'off',\n      // span elements have no implicit role, but some screen readers (notably VoiceOver)\n      // treat them as a break between items in the DOM when using arrow keys\n      // (or left-to-right swipes on iOS) to read contents of a page. Using\n      // role='presentation' causes VoiceOver to NOT treat this span as a break.\n      'role': 'presentation'\n    });\n    el.appendChild(this.contentEl_);\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    this.contentEl_ = null;\n    this.textNode_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Updates the time display text node with a new time\n   *\n   * @param {number} [time=0] the time to update to\n   *\n   * @private\n   */\n  ;\n\n  _proto.updateTextNode_ = function updateTextNode_(time) {\n    var _this2 = this;\n\n    if (time === void 0) {\n      time = 0;\n    }\n\n    time = formatTime(time);\n\n    if (this.formattedTime_ === time) {\n      return;\n    }\n\n    this.formattedTime_ = time;\n    this.requestNamedAnimationFrame('TimeDisplay#updateTextNode_', function () {\n      if (!_this2.contentEl_) {\n        return;\n      }\n\n      var oldNode = _this2.textNode_;\n\n      if (oldNode && _this2.contentEl_.firstChild !== oldNode) {\n        oldNode = null;\n        log$1.warn('TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.');\n      }\n\n      _this2.textNode_ = document.createTextNode(_this2.formattedTime_);\n\n      if (!_this2.textNode_) {\n        return;\n      }\n\n      if (oldNode) {\n        _this2.contentEl_.replaceChild(_this2.textNode_, oldNode);\n      } else {\n        _this2.contentEl_.appendChild(_this2.textNode_);\n      }\n    });\n  }\n  /**\n   * To be filled out in the child class, should update the displayed time\n   * in accordance with the fact that the current time has changed.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `timeupdate`  event that caused this to run.\n   *\n   * @listens Player#timeupdate\n   */\n  ;\n\n  _proto.updateContent = function updateContent(event) {};\n\n  return TimeDisplay;\n}(Component$1);\n/**\n * The text that is added to the `TimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nTimeDisplay.prototype.labelText_ = 'Time';\n/**\n * The text that should display over the `TimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nTimeDisplay.prototype.controlText_ = 'Time';\nComponent$1.registerComponent('TimeDisplay', TimeDisplay);\n\n/**\n * Displays the current time\n *\n * @extends Component\n */\n\nvar CurrentTimeDisplay = /*#__PURE__*/function (_TimeDisplay) {\n  _inheritsLoose(CurrentTimeDisplay, _TimeDisplay);\n\n  function CurrentTimeDisplay() {\n    return _TimeDisplay.apply(this, arguments) || this;\n  }\n\n  var _proto = CurrentTimeDisplay.prototype;\n\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  _proto.buildCSSClass = function buildCSSClass() {\n    return 'vjs-current-time';\n  }\n  /**\n   * Update current time display\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `timeupdate` event that caused this function to run.\n   *\n   * @listens Player#timeupdate\n   */\n  ;\n\n  _proto.updateContent = function updateContent(event) {\n    // Allows for smooth scrubbing, when player can't keep up.\n    var time;\n\n    if (this.player_.ended()) {\n      time = this.player_.duration();\n    } else {\n      time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n    }\n\n    this.updateTextNode_(time);\n  };\n\n  return CurrentTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `CurrentTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nCurrentTimeDisplay.prototype.labelText_ = 'Current Time';\n/**\n * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nCurrentTimeDisplay.prototype.controlText_ = 'Current Time';\nComponent$1.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);\n\n/**\n * Displays the duration\n *\n * @extends Component\n */\n\nvar DurationDisplay = /*#__PURE__*/function (_TimeDisplay) {\n  _inheritsLoose(DurationDisplay, _TimeDisplay);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function DurationDisplay(player, options) {\n    var _this;\n\n    _this = _TimeDisplay.call(this, player, options) || this;\n\n    var updateContent = function updateContent(e) {\n      return _this.updateContent(e);\n    }; // we do not want to/need to throttle duration changes,\n    // as they should always display the changed duration as\n    // it has changed\n\n\n    _this.on(player, 'durationchange', updateContent); // Listen to loadstart because the player duration is reset when a new media element is loaded,\n    // but the durationchange on the user agent will not fire.\n    // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n\n    _this.on(player, 'loadstart', updateContent); // Also listen for timeupdate (in the parent) and loadedmetadata because removing those\n    // listeners could have broken dependent applications/libraries. These\n    // can likely be removed for 7.0.\n\n\n    _this.on(player, 'loadedmetadata', updateContent);\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = DurationDisplay.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return 'vjs-duration';\n  }\n  /**\n   * Update duration time display.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused\n   *        this function to be called.\n   *\n   * @listens Player#durationchange\n   * @listens Player#timeupdate\n   * @listens Player#loadedmetadata\n   */\n  ;\n\n  _proto.updateContent = function updateContent(event) {\n    var duration = this.player_.duration();\n    this.updateTextNode_(duration);\n  };\n\n  return DurationDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `DurationDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nDurationDisplay.prototype.labelText_ = 'Duration';\n/**\n * The text that should display over the `DurationDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nDurationDisplay.prototype.controlText_ = 'Duration';\nComponent$1.registerComponent('DurationDisplay', DurationDisplay);\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @extends Component\n */\n\nvar TimeDivider = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(TimeDivider, _Component);\n\n  function TimeDivider() {\n    return _Component.apply(this, arguments) || this;\n  }\n\n  var _proto = TimeDivider.prototype;\n\n  /**\n   * Create the component's DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  _proto.createEl = function createEl() {\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-time-control vjs-time-divider'\n    }, {\n      // this element and its contents can be hidden from assistive techs since\n      // it is made extraneous by the announcement of the control text\n      // for the current time and duration displays\n      'aria-hidden': true\n    });\n\n    var div = _Component.prototype.createEl.call(this, 'div');\n\n    var span = _Component.prototype.createEl.call(this, 'span', {\n      textContent: '/'\n    });\n\n    div.appendChild(span);\n    el.appendChild(div);\n    return el;\n  };\n\n  return TimeDivider;\n}(Component$1);\n\nComponent$1.registerComponent('TimeDivider', TimeDivider);\n\n/**\n * Displays the time left in the video\n *\n * @extends Component\n */\n\nvar RemainingTimeDisplay = /*#__PURE__*/function (_TimeDisplay) {\n  _inheritsLoose(RemainingTimeDisplay, _TimeDisplay);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function RemainingTimeDisplay(player, options) {\n    var _this;\n\n    _this = _TimeDisplay.call(this, player, options) || this;\n\n    _this.on(player, 'durationchange', function (e) {\n      return _this.updateContent(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = RemainingTimeDisplay.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return 'vjs-remaining-time';\n  }\n  /**\n   * Create the `Component`'s DOM element with the \"minus\" characted prepend to the time\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl$1() {\n    var el = _TimeDisplay.prototype.createEl.call(this);\n\n    if (this.options_.displayNegative !== false) {\n      el.insertBefore(createEl('span', {}, {\n        'aria-hidden': true\n      }, '-'), this.contentEl_);\n    }\n\n    return el;\n  }\n  /**\n   * Update remaining time display.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `timeupdate` or `durationchange` event that caused this to run.\n   *\n   * @listens Player#timeupdate\n   * @listens Player#durationchange\n   */\n  ;\n\n  _proto.updateContent = function updateContent(event) {\n    if (typeof this.player_.duration() !== 'number') {\n      return;\n    }\n\n    var time; // @deprecated We should only use remainingTimeDisplay\n    // as of video.js 7\n\n    if (this.player_.ended()) {\n      time = 0;\n    } else if (this.player_.remainingTimeDisplay) {\n      time = this.player_.remainingTimeDisplay();\n    } else {\n      time = this.player_.remainingTime();\n    }\n\n    this.updateTextNode_(time);\n  };\n\n  return RemainingTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `RemainingTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nRemainingTimeDisplay.prototype.labelText_ = 'Remaining Time';\n/**\n * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nRemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';\nComponent$1.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar LiveDisplay = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(LiveDisplay, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function LiveDisplay(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    _this.updateShowing();\n\n    _this.on(_this.player(), 'durationchange', function (e) {\n      return _this.updateShowing(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = LiveDisplay.prototype;\n\n  _proto.createEl = function createEl$1() {\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-live-control vjs-control'\n    });\n\n    this.contentEl_ = createEl('div', {\n      className: 'vjs-live-display'\n    }, {\n      'aria-live': 'off'\n    });\n    this.contentEl_.appendChild(createEl('span', {\n      className: 'vjs-control-text',\n      textContent: this.localize('Stream Type') + \"\\xA0\"\n    }));\n    this.contentEl_.appendChild(document.createTextNode(this.localize('LIVE')));\n    el.appendChild(this.contentEl_);\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    this.contentEl_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide\n   * it accordingly\n   *\n   * @param {EventTarget~Event} [event]\n   *        The {@link Player#durationchange} event that caused this function to run.\n   *\n   * @listens Player#durationchange\n   */\n  ;\n\n  _proto.updateShowing = function updateShowing(event) {\n    if (this.player().duration() === Infinity) {\n      this.show();\n    } else {\n      this.hide();\n    }\n  };\n\n  return LiveDisplay;\n}(Component$1);\n\nComponent$1.registerComponent('LiveDisplay', LiveDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar SeekToLive = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(SeekToLive, _Button);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function SeekToLive(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this;\n\n    _this.updateLiveEdgeStatus();\n\n    if (_this.player_.liveTracker) {\n      _this.updateLiveEdgeStatusHandler_ = function (e) {\n        return _this.updateLiveEdgeStatus(e);\n      };\n\n      _this.on(_this.player_.liveTracker, 'liveedgechange', _this.updateLiveEdgeStatusHandler_);\n    }\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = SeekToLive.prototype;\n\n  _proto.createEl = function createEl$1() {\n    var el = _Button.prototype.createEl.call(this, 'button', {\n      className: 'vjs-seek-to-live-control vjs-control'\n    });\n\n    this.textEl_ = createEl('span', {\n      className: 'vjs-seek-to-live-text',\n      textContent: this.localize('LIVE')\n    }, {\n      'aria-hidden': 'true'\n    });\n    el.appendChild(this.textEl_);\n    return el;\n  }\n  /**\n   * Update the state of this button if we are at the live edge\n   * or not\n   */\n  ;\n\n  _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() {\n    // default to live edge\n    if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {\n      this.setAttribute('aria-disabled', true);\n      this.addClass('vjs-at-live-edge');\n      this.controlText('Seek to live, currently playing live');\n    } else {\n      this.setAttribute('aria-disabled', false);\n      this.removeClass('vjs-at-live-edge');\n      this.controlText('Seek to live, currently behind live');\n    }\n  }\n  /**\n   * On click bring us as near to the live point as possible.\n   * This requires that we wait for the next `live-seekable-change`\n   * event which will happen every segment length seconds.\n   */\n  ;\n\n  _proto.handleClick = function handleClick() {\n    this.player_.liveTracker.seekToLiveEdge();\n  }\n  /**\n   * Dispose of the element and stop tracking\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    if (this.player_.liveTracker) {\n      this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_);\n    }\n\n    this.textEl_ = null;\n\n    _Button.prototype.dispose.call(this);\n  };\n\n  return SeekToLive;\n}(Button);\n\nSeekToLive.prototype.controlText_ = 'Seek to live, currently playing live';\nComponent$1.registerComponent('SeekToLive', SeekToLive);\n\n/**\n * Keep a number between a min and a max value\n *\n * @param {number} number\n *        The number to clamp\n *\n * @param {number} min\n *        The minimum value\n * @param {number} max\n *        The maximum value\n *\n * @return {number}\n *         the clamped number\n */\nvar clamp = function clamp(number, min, max) {\n  number = Number(number);\n  return Math.min(max, Math.max(min, isNaN(number) ? min : number));\n};\n\n/**\n * The base functionality for a slider. Can be vertical or horizontal.\n * For instance the volume bar or the seek bar on a video is a slider.\n *\n * @extends Component\n */\n\nvar Slider = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(Slider, _Component);\n\n  /**\n  * Create an instance of this class\n  *\n  * @param {Player} player\n  *        The `Player` that this class should be attached to.\n  *\n  * @param {Object} [options]\n  *        The key/value store of player options.\n  */\n  function Slider(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    _this.handleMouseDown_ = function (e) {\n      return _this.handleMouseDown(e);\n    };\n\n    _this.handleMouseUp_ = function (e) {\n      return _this.handleMouseUp(e);\n    };\n\n    _this.handleKeyDown_ = function (e) {\n      return _this.handleKeyDown(e);\n    };\n\n    _this.handleClick_ = function (e) {\n      return _this.handleClick(e);\n    };\n\n    _this.handleMouseMove_ = function (e) {\n      return _this.handleMouseMove(e);\n    };\n\n    _this.update_ = function (e) {\n      return _this.update(e);\n    }; // Set property names to bar to match with the child Slider class is looking for\n\n\n    _this.bar = _this.getChild(_this.options_.barName); // Set a horizontal or vertical class on the slider depending on the slider type\n\n    _this.vertical(!!_this.options_.vertical);\n\n    _this.enable();\n\n    return _this;\n  }\n  /**\n   * Are controls are currently enabled for this slider or not.\n   *\n   * @return {boolean}\n   *         true if controls are enabled, false otherwise\n   */\n\n\n  var _proto = Slider.prototype;\n\n  _proto.enabled = function enabled() {\n    return this.enabled_;\n  }\n  /**\n   * Enable controls for this slider if they are disabled\n   */\n  ;\n\n  _proto.enable = function enable() {\n    if (this.enabled()) {\n      return;\n    }\n\n    this.on('mousedown', this.handleMouseDown_);\n    this.on('touchstart', this.handleMouseDown_);\n    this.on('keydown', this.handleKeyDown_);\n    this.on('click', this.handleClick_); // TODO: deprecated, controlsvisible does not seem to be fired\n\n    this.on(this.player_, 'controlsvisible', this.update);\n\n    if (this.playerEvent) {\n      this.on(this.player_, this.playerEvent, this.update);\n    }\n\n    this.removeClass('disabled');\n    this.setAttribute('tabindex', 0);\n    this.enabled_ = true;\n  }\n  /**\n   * Disable controls for this slider if they are enabled\n   */\n  ;\n\n  _proto.disable = function disable() {\n    if (!this.enabled()) {\n      return;\n    }\n\n    var doc = this.bar.el_.ownerDocument;\n    this.off('mousedown', this.handleMouseDown_);\n    this.off('touchstart', this.handleMouseDown_);\n    this.off('keydown', this.handleKeyDown_);\n    this.off('click', this.handleClick_);\n    this.off(this.player_, 'controlsvisible', this.update_);\n    this.off(doc, 'mousemove', this.handleMouseMove_);\n    this.off(doc, 'mouseup', this.handleMouseUp_);\n    this.off(doc, 'touchmove', this.handleMouseMove_);\n    this.off(doc, 'touchend', this.handleMouseUp_);\n    this.removeAttribute('tabindex');\n    this.addClass('disabled');\n\n    if (this.playerEvent) {\n      this.off(this.player_, this.playerEvent, this.update);\n    }\n\n    this.enabled_ = false;\n  }\n  /**\n   * Create the `Slider`s DOM element.\n   *\n   * @param {string} type\n   *        Type of element to create.\n   *\n   * @param {Object} [props={}]\n   *        List of properties in Object form.\n   *\n   * @param {Object} [attributes={}]\n   *        list of attributes in Object form.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl(type, props, attributes) {\n    if (props === void 0) {\n      props = {};\n    }\n\n    if (attributes === void 0) {\n      attributes = {};\n    }\n\n    // Add the slider element class to all sub classes\n    props.className = props.className + ' vjs-slider';\n    props = assign({\n      tabIndex: 0\n    }, props);\n    attributes = assign({\n      'role': 'slider',\n      'aria-valuenow': 0,\n      'aria-valuemin': 0,\n      'aria-valuemax': 100,\n      'tabIndex': 0\n    }, attributes);\n    return _Component.prototype.createEl.call(this, type, props, attributes);\n  }\n  /**\n   * Handle `mousedown` or `touchstart` events on the `Slider`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown` or `touchstart` event that triggered this function\n   *\n   * @listens mousedown\n   * @listens touchstart\n   * @fires Slider#slideractive\n   */\n  ;\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    var doc = this.bar.el_.ownerDocument;\n\n    if (event.type === 'mousedown') {\n      event.preventDefault();\n    } // Do not call preventDefault() on touchstart in Chrome\n    // to avoid console warnings. Use a 'touch-action: none' style\n    // instead to prevent unintented scrolling.\n    // https://developers.google.com/web/updates/2017/01/scrolling-intervention\n\n\n    if (event.type === 'touchstart' && !IS_CHROME) {\n      event.preventDefault();\n    }\n\n    blockTextSelection();\n    this.addClass('vjs-sliding');\n    /**\n     * Triggered when the slider is in an active state\n     *\n     * @event Slider#slideractive\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('slideractive');\n    this.on(doc, 'mousemove', this.handleMouseMove_);\n    this.on(doc, 'mouseup', this.handleMouseUp_);\n    this.on(doc, 'touchmove', this.handleMouseMove_);\n    this.on(doc, 'touchend', this.handleMouseUp_);\n    this.handleMouseMove(event, true);\n  }\n  /**\n   * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.\n   * The `mousemove` and `touchmove` events will only only trigger this function during\n   * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and\n   * {@link Slider#handleMouseUp}.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered\n   *        this function\n   * @param {boolean} mouseDown this is a flag that should be set to true if `handleMouseMove` is called directly. It allows us to skip things that should not happen if coming from mouse down but should happen on regular mouse move handler. Defaults to false.\n   *\n   * @listens mousemove\n   * @listens touchmove\n   */\n  ;\n\n  _proto.handleMouseMove = function handleMouseMove(event) {}\n  /**\n   * Handle `mouseup` or `touchend` events on the `Slider`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mouseup` or `touchend` event that triggered this function.\n   *\n   * @listens touchend\n   * @listens mouseup\n   * @fires Slider#sliderinactive\n   */\n  ;\n\n  _proto.handleMouseUp = function handleMouseUp() {\n    var doc = this.bar.el_.ownerDocument;\n    unblockTextSelection();\n    this.removeClass('vjs-sliding');\n    /**\n     * Triggered when the slider is no longer in an active state.\n     *\n     * @event Slider#sliderinactive\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('sliderinactive');\n    this.off(doc, 'mousemove', this.handleMouseMove_);\n    this.off(doc, 'mouseup', this.handleMouseUp_);\n    this.off(doc, 'touchmove', this.handleMouseMove_);\n    this.off(doc, 'touchend', this.handleMouseUp_);\n    this.update();\n  }\n  /**\n   * Update the progress bar of the `Slider`.\n   *\n   * @return {number}\n   *          The percentage of progress the progress bar represents as a\n   *          number from 0 to 1.\n   */\n  ;\n\n  _proto.update = function update() {\n    var _this2 = this;\n\n    // In VolumeBar init we have a setTimeout for update that pops and update\n    // to the end of the execution stack. The player is destroyed before then\n    // update will cause an error\n    // If there's no bar...\n    if (!this.el_ || !this.bar) {\n      return;\n    } // clamp progress between 0 and 1\n    // and only round to four decimal places, as we round to two below\n\n\n    var progress = this.getProgress();\n\n    if (progress === this.progress_) {\n      return progress;\n    }\n\n    this.progress_ = progress;\n    this.requestNamedAnimationFrame('Slider#update', function () {\n      // Set the new bar width or height\n      var sizeKey = _this2.vertical() ? 'height' : 'width'; // Convert to a percentage for css value\n\n      _this2.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + '%';\n    });\n    return progress;\n  }\n  /**\n   * Get the percentage of the bar that should be filled\n   * but clamped and rounded.\n   *\n   * @return {number}\n   *         percentage filled that the slider is\n   */\n  ;\n\n  _proto.getProgress = function getProgress() {\n    return Number(clamp(this.getPercent(), 0, 1).toFixed(4));\n  }\n  /**\n   * Calculate distance for slider\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to run.\n   *\n   * @return {number}\n   *         The current position of the Slider.\n   *         - position.x for vertical `Slider`s\n   *         - position.y for horizontal `Slider`s\n   */\n  ;\n\n  _proto.calculateDistance = function calculateDistance(event) {\n    var position = getPointerPosition(this.el_, event);\n\n    if (this.vertical()) {\n      return position.y;\n    }\n\n    return position.x;\n  }\n  /**\n   * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down\n   * arrow keys. This function will only be called when the slider has focus. See\n   * {@link Slider#handleFocus} and {@link Slider#handleBlur}.\n   *\n   * @param {EventTarget~Event} event\n   *        the `keydown` event that caused this function to run.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Left and Down Arrows\n    if (keycode.isEventKey(event, 'Left') || keycode.isEventKey(event, 'Down')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.stepBack(); // Up and Right Arrows\n    } else if (keycode.isEventKey(event, 'Right') || keycode.isEventKey(event, 'Up')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.stepForward();\n    } else {\n      // Pass keydown handling up for unsupported keys\n      _Component.prototype.handleKeyDown.call(this, event);\n    }\n  }\n  /**\n   * Listener for click events on slider, used to prevent clicks\n   *   from bubbling up to parent elements like button menus.\n   *\n   * @param {Object} event\n   *        Event that caused this object to run\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    event.stopPropagation();\n    event.preventDefault();\n  }\n  /**\n   * Get/set if slider is horizontal for vertical\n   *\n   * @param {boolean} [bool]\n   *        - true if slider is vertical,\n   *        - false is horizontal\n   *\n   * @return {boolean}\n   *         - true if slider is vertical, and getting\n   *         - false if the slider is horizontal, and getting\n   */\n  ;\n\n  _proto.vertical = function vertical(bool) {\n    if (bool === undefined) {\n      return this.vertical_ || false;\n    }\n\n    this.vertical_ = !!bool;\n\n    if (this.vertical_) {\n      this.addClass('vjs-slider-vertical');\n    } else {\n      this.addClass('vjs-slider-horizontal');\n    }\n  };\n\n  return Slider;\n}(Component$1);\n\nComponent$1.registerComponent('Slider', Slider);\n\nvar percentify = function percentify(time, end) {\n  return clamp(time / end * 100, 0, 100).toFixed(2) + '%';\n};\n/**\n * Shows loading progress\n *\n * @extends Component\n */\n\n\nvar LoadProgressBar = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(LoadProgressBar, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function LoadProgressBar(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.partEls_ = [];\n\n    _this.on(player, 'progress', function (e) {\n      return _this.update(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = LoadProgressBar.prototype;\n\n  _proto.createEl = function createEl$1() {\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-load-progress'\n    });\n\n    var wrapper = createEl('span', {\n      className: 'vjs-control-text'\n    });\n    var loadedText = createEl('span', {\n      textContent: this.localize('Loaded')\n    });\n    var separator = document.createTextNode(': ');\n    this.percentageEl_ = createEl('span', {\n      className: 'vjs-control-text-loaded-percentage',\n      textContent: '0%'\n    });\n    el.appendChild(wrapper);\n    wrapper.appendChild(loadedText);\n    wrapper.appendChild(separator);\n    wrapper.appendChild(this.percentageEl_);\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    this.partEls_ = null;\n    this.percentageEl_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Update progress bar\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `progress` event that caused this function to run.\n   *\n   * @listens Player#progress\n   */\n  ;\n\n  _proto.update = function update(event) {\n    var _this2 = this;\n\n    this.requestNamedAnimationFrame('LoadProgressBar#update', function () {\n      var liveTracker = _this2.player_.liveTracker;\n\n      var buffered = _this2.player_.buffered();\n\n      var duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration();\n\n      var bufferedEnd = _this2.player_.bufferedEnd();\n\n      var children = _this2.partEls_;\n      var percent = percentify(bufferedEnd, duration);\n\n      if (_this2.percent_ !== percent) {\n        // update the width of the progress bar\n        _this2.el_.style.width = percent; // update the control-text\n\n        textContent(_this2.percentageEl_, percent);\n        _this2.percent_ = percent;\n      } // add child elements to represent the individual buffered time ranges\n\n\n      for (var i = 0; i < buffered.length; i++) {\n        var start = buffered.start(i);\n        var end = buffered.end(i);\n        var part = children[i];\n\n        if (!part) {\n          part = _this2.el_.appendChild(createEl());\n          children[i] = part;\n        } //  only update if changed\n\n\n        if (part.dataset.start === start && part.dataset.end === end) {\n          continue;\n        }\n\n        part.dataset.start = start;\n        part.dataset.end = end; // set the percent based on the width of the progress bar (bufferedEnd)\n\n        part.style.left = percentify(start, bufferedEnd);\n        part.style.width = percentify(end - start, bufferedEnd);\n      } // remove unused buffered range elements\n\n\n      for (var _i = children.length; _i > buffered.length; _i--) {\n        _this2.el_.removeChild(children[_i - 1]);\n      }\n\n      children.length = buffered.length;\n    });\n  };\n\n  return LoadProgressBar;\n}(Component$1);\n\nComponent$1.registerComponent('LoadProgressBar', LoadProgressBar);\n\n/**\n * Time tooltips display a time above the progress bar.\n *\n * @extends Component\n */\n\nvar TimeTooltip = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(TimeTooltip, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The {@link Player} that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function TimeTooltip(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n    return _this;\n  }\n  /**\n   * Create the time tooltip DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = TimeTooltip.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-time-tooltip'\n    }, {\n      'aria-hidden': 'true'\n    });\n  }\n  /**\n   * Updates the position of the time tooltip relative to the `SeekBar`.\n   *\n   * @param {Object} seekBarRect\n   *        The `ClientRect` for the {@link SeekBar} element.\n   *\n   * @param {number} seekBarPoint\n   *        A number from 0 to 1, representing a horizontal reference point\n   *        from the left edge of the {@link SeekBar}\n   */\n  ;\n\n  _proto.update = function update(seekBarRect, seekBarPoint, content) {\n    var tooltipRect = findPosition(this.el_);\n    var playerRect = getBoundingClientRect(this.player_.el());\n    var seekBarPointPx = seekBarRect.width * seekBarPoint; // do nothing if either rect isn't available\n    // for example, if the player isn't in the DOM for testing\n\n    if (!playerRect || !tooltipRect) {\n      return;\n    } // This is the space left of the `seekBarPoint` available within the bounds\n    // of the player. We calculate any gap between the left edge of the player\n    // and the left edge of the `SeekBar` and add the number of pixels in the\n    // `SeekBar` before hitting the `seekBarPoint`\n\n\n    var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx; // This is the space right of the `seekBarPoint` available within the bounds\n    // of the player. We calculate the number of pixels from the `seekBarPoint`\n    // to the right edge of the `SeekBar` and add to that any gap between the\n    // right edge of the `SeekBar` and the player.\n\n    var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right); // This is the number of pixels by which the tooltip will need to be pulled\n    // further to the right to center it over the `seekBarPoint`.\n\n    var pullTooltipBy = tooltipRect.width / 2; // Adjust the `pullTooltipBy` distance to the left or right depending on\n    // the results of the space calculations above.\n\n    if (spaceLeftOfPoint < pullTooltipBy) {\n      pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n    } else if (spaceRightOfPoint < pullTooltipBy) {\n      pullTooltipBy = spaceRightOfPoint;\n    } // Due to the imprecision of decimal/ratio based calculations and varying\n    // rounding behaviors, there are cases where the spacing adjustment is off\n    // by a pixel or two. This adds insurance to these calculations.\n\n\n    if (pullTooltipBy < 0) {\n      pullTooltipBy = 0;\n    } else if (pullTooltipBy > tooltipRect.width) {\n      pullTooltipBy = tooltipRect.width;\n    } // prevent small width fluctuations within 0.4px from\n    // changing the value below.\n    // This really helps for live to prevent the play\n    // progress time tooltip from jittering\n\n\n    pullTooltipBy = Math.round(pullTooltipBy);\n    this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n    this.write(content);\n  }\n  /**\n   * Write the time to the tooltip DOM element.\n   *\n   * @param {string} content\n   *        The formatted time for the tooltip.\n   */\n  ;\n\n  _proto.write = function write(content) {\n    textContent(this.el_, content);\n  }\n  /**\n   * Updates the position of the time tooltip relative to the `SeekBar`.\n   *\n   * @param {Object} seekBarRect\n   *        The `ClientRect` for the {@link SeekBar} element.\n   *\n   * @param {number} seekBarPoint\n   *        A number from 0 to 1, representing a horizontal reference point\n   *        from the left edge of the {@link SeekBar}\n   *\n   * @param {number} time\n   *        The time to update the tooltip to, not used during live playback\n   *\n   * @param {Function} cb\n   *        A function that will be called during the request animation frame\n   *        for tooltips that need to do additional animations from the default\n   */\n  ;\n\n  _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {\n    var _this2 = this;\n\n    this.requestNamedAnimationFrame('TimeTooltip#updateTime', function () {\n      var content;\n\n      var duration = _this2.player_.duration();\n\n      if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive()) {\n        var liveWindow = _this2.player_.liveTracker.liveWindow();\n\n        var secondsBehind = liveWindow - seekBarPoint * liveWindow;\n        content = (secondsBehind < 1 ? '' : '-') + formatTime(secondsBehind, liveWindow);\n      } else {\n        content = formatTime(time, duration);\n      }\n\n      _this2.update(seekBarRect, seekBarPoint, content);\n\n      if (cb) {\n        cb();\n      }\n    });\n  };\n\n  return TimeTooltip;\n}(Component$1);\n\nComponent$1.registerComponent('TimeTooltip', TimeTooltip);\n\n/**\n * Used by {@link SeekBar} to display media playback progress as part of the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar PlayProgressBar = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(PlayProgressBar, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The {@link Player} that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function PlayProgressBar(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n    return _this;\n  }\n  /**\n   * Create the the DOM element for this class.\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = PlayProgressBar.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-play-progress vjs-slider-bar'\n    }, {\n      'aria-hidden': 'true'\n    });\n  }\n  /**\n   * Enqueues updates to its own DOM as well as the DOM of its\n   * {@link TimeTooltip} child.\n   *\n   * @param {Object} seekBarRect\n   *        The `ClientRect` for the {@link SeekBar} element.\n   *\n   * @param {number} seekBarPoint\n   *        A number from 0 to 1, representing a horizontal reference point\n   *        from the left edge of the {@link SeekBar}\n   */\n  ;\n\n  _proto.update = function update(seekBarRect, seekBarPoint) {\n    var timeTooltip = this.getChild('timeTooltip');\n\n    if (!timeTooltip) {\n      return;\n    }\n\n    var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n    timeTooltip.updateTime(seekBarRect, seekBarPoint, time);\n  };\n\n  return PlayProgressBar;\n}(Component$1);\n/**\n * Default options for {@link PlayProgressBar}.\n *\n * @type {Object}\n * @private\n */\n\n\nPlayProgressBar.prototype.options_ = {\n  children: []\n}; // Time tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n  PlayProgressBar.prototype.options_.children.push('timeTooltip');\n}\n\nComponent$1.registerComponent('PlayProgressBar', PlayProgressBar);\n\n/**\n * The {@link MouseTimeDisplay} component tracks mouse movement over the\n * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}\n * indicating the time which is represented by a given point in the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar MouseTimeDisplay = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(MouseTimeDisplay, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The {@link Player} that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function MouseTimeDisplay(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n    return _this;\n  }\n  /**\n   * Create the DOM element for this class.\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = MouseTimeDisplay.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-mouse-display'\n    });\n  }\n  /**\n   * Enqueues updates to its own DOM as well as the DOM of its\n   * {@link TimeTooltip} child.\n   *\n   * @param {Object} seekBarRect\n   *        The `ClientRect` for the {@link SeekBar} element.\n   *\n   * @param {number} seekBarPoint\n   *        A number from 0 to 1, representing a horizontal reference point\n   *        from the left edge of the {@link SeekBar}\n   */\n  ;\n\n  _proto.update = function update(seekBarRect, seekBarPoint) {\n    var _this2 = this;\n\n    var time = seekBarPoint * this.player_.duration();\n    this.getChild('timeTooltip').updateTime(seekBarRect, seekBarPoint, time, function () {\n      _this2.el_.style.left = seekBarRect.width * seekBarPoint + \"px\";\n    });\n  };\n\n  return MouseTimeDisplay;\n}(Component$1);\n/**\n * Default options for `MouseTimeDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nMouseTimeDisplay.prototype.options_ = {\n  children: ['timeTooltip']\n};\nComponent$1.registerComponent('MouseTimeDisplay', MouseTimeDisplay);\n\nvar STEP_SECONDS = 5; // The multiplier of STEP_SECONDS that PgUp/PgDown move the timeline.\n\nvar PAGE_KEY_MULTIPLIER = 12;\n/**\n * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}\n * as its `bar`.\n *\n * @extends Slider\n */\n\nvar SeekBar = /*#__PURE__*/function (_Slider) {\n  _inheritsLoose(SeekBar, _Slider);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function SeekBar(player, options) {\n    var _this;\n\n    _this = _Slider.call(this, player, options) || this;\n\n    _this.setEventHandlers_();\n\n    return _this;\n  }\n  /**\n   * Sets the event handlers\n   *\n   * @private\n   */\n\n\n  var _proto = SeekBar.prototype;\n\n  _proto.setEventHandlers_ = function setEventHandlers_() {\n    var _this2 = this;\n\n    this.update_ = bind(this, this.update);\n    this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);\n    this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n\n    if (this.player_.liveTracker) {\n      this.on(this.player_.liveTracker, 'liveedgechange', this.update);\n    } // when playing, let's ensure we smoothly update the play progress bar\n    // via an interval\n\n\n    this.updateInterval = null;\n\n    this.enableIntervalHandler_ = function (e) {\n      return _this2.enableInterval_(e);\n    };\n\n    this.disableIntervalHandler_ = function (e) {\n      return _this2.disableInterval_(e);\n    };\n\n    this.on(this.player_, ['playing'], this.enableIntervalHandler_);\n    this.on(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_); // we don't need to update the play progress if the document is hidden,\n    // also, this causes the CPU to spike and eventually crash the page on IE11.\n\n    if ('hidden' in document && 'visibilityState' in document) {\n      this.on(document, 'visibilitychange', this.toggleVisibility_);\n    }\n  };\n\n  _proto.toggleVisibility_ = function toggleVisibility_(e) {\n    if (document.visibilityState === 'hidden') {\n      this.cancelNamedAnimationFrame('SeekBar#update');\n      this.cancelNamedAnimationFrame('Slider#update');\n      this.disableInterval_(e);\n    } else {\n      if (!this.player_.ended() && !this.player_.paused()) {\n        this.enableInterval_();\n      } // we just switched back to the page and someone may be looking, so, update ASAP\n\n\n      this.update();\n    }\n  };\n\n  _proto.enableInterval_ = function enableInterval_() {\n    if (this.updateInterval) {\n      return;\n    }\n\n    this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);\n  };\n\n  _proto.disableInterval_ = function disableInterval_(e) {\n    if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== 'ended') {\n      return;\n    }\n\n    if (!this.updateInterval) {\n      return;\n    }\n\n    this.clearInterval(this.updateInterval);\n    this.updateInterval = null;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    return _Slider.prototype.createEl.call(this, 'div', {\n      className: 'vjs-progress-holder'\n    }, {\n      'aria-label': this.localize('Progress Bar')\n    });\n  }\n  /**\n   * This function updates the play progress bar and accessibility\n   * attributes to whatever is passed in.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `timeupdate` or `ended` event that caused this to run.\n   *\n   * @listens Player#timeupdate\n   *\n   * @return {number}\n   *          The current percent at a number from 0-1\n   */\n  ;\n\n  _proto.update = function update(event) {\n    var _this3 = this;\n\n    // ignore updates while the tab is hidden\n    if (document.visibilityState === 'hidden') {\n      return;\n    }\n\n    var percent = _Slider.prototype.update.call(this);\n\n    this.requestNamedAnimationFrame('SeekBar#update', function () {\n      var currentTime = _this3.player_.ended() ? _this3.player_.duration() : _this3.getCurrentTime_();\n      var liveTracker = _this3.player_.liveTracker;\n\n      var duration = _this3.player_.duration();\n\n      if (liveTracker && liveTracker.isLive()) {\n        duration = _this3.player_.liveTracker.liveCurrentTime();\n      }\n\n      if (_this3.percent_ !== percent) {\n        // machine readable value of progress bar (percentage complete)\n        _this3.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2));\n\n        _this3.percent_ = percent;\n      }\n\n      if (_this3.currentTime_ !== currentTime || _this3.duration_ !== duration) {\n        // human readable value of progress bar (time complete)\n        _this3.el_.setAttribute('aria-valuetext', _this3.localize('progress bar timing: currentTime={1} duration={2}', [formatTime(currentTime, duration), formatTime(duration, duration)], '{1} of {2}'));\n\n        _this3.currentTime_ = currentTime;\n        _this3.duration_ = duration;\n      } // update the progress bar time tooltip with the current time\n\n\n      if (_this3.bar) {\n        _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress());\n      }\n    });\n    return percent;\n  }\n  /**\n   * Prevent liveThreshold from causing seeks to seem like they\n   * are not happening from a user perspective.\n   *\n   * @param {number} ct\n   *        current time to seek to\n   */\n  ;\n\n  _proto.userSeek_ = function userSeek_(ct) {\n    if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {\n      this.player_.liveTracker.nextSeekedFromUser();\n    }\n\n    this.player_.currentTime(ct);\n  }\n  /**\n   * Get the value of current time but allows for smooth scrubbing,\n   * when player can't keep up.\n   *\n   * @return {number}\n   *         The current time value to display\n   *\n   * @private\n   */\n  ;\n\n  _proto.getCurrentTime_ = function getCurrentTime_() {\n    return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n  }\n  /**\n   * Get the percentage of media played so far.\n   *\n   * @return {number}\n   *         The percentage of media played so far (0 to 1).\n   */\n  ;\n\n  _proto.getPercent = function getPercent() {\n    var currentTime = this.getCurrentTime_();\n    var percent;\n    var liveTracker = this.player_.liveTracker;\n\n    if (liveTracker && liveTracker.isLive()) {\n      percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow(); // prevent the percent from changing at the live edge\n\n      if (liveTracker.atLiveEdge()) {\n        percent = 1;\n      }\n    } else {\n      percent = currentTime / this.player_.duration();\n    }\n\n    return percent;\n  }\n  /**\n   * Handle mouse down on seek bar\n   *\n   * @param {EventTarget~Event} event\n   *        The `mousedown` event that caused this to run.\n   *\n   * @listens mousedown\n   */\n  ;\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    if (!isSingleLeftClick(event)) {\n      return;\n    } // Stop event propagation to prevent double fire in progress-control.js\n\n\n    event.stopPropagation();\n    this.videoWasPlaying = !this.player_.paused();\n    this.player_.pause();\n\n    _Slider.prototype.handleMouseDown.call(this, event);\n  }\n  /**\n   * Handle mouse move on seek bar\n   *\n   * @param {EventTarget~Event} event\n   *        The `mousemove` event that caused this to run.\n   * @param {boolean} mouseDown this is a flag that should be set to true if `handleMouseMove` is called directly. It allows us to skip things that should not happen if coming from mouse down but should happen on regular mouse move handler. Defaults to false\n   *\n   * @listens mousemove\n   */\n  ;\n\n  _proto.handleMouseMove = function handleMouseMove(event, mouseDown) {\n    if (mouseDown === void 0) {\n      mouseDown = false;\n    }\n\n    if (!isSingleLeftClick(event)) {\n      return;\n    }\n\n    if (!mouseDown && !this.player_.scrubbing()) {\n      this.player_.scrubbing(true);\n    }\n\n    var newTime;\n    var distance = this.calculateDistance(event);\n    var liveTracker = this.player_.liveTracker;\n\n    if (!liveTracker || !liveTracker.isLive()) {\n      newTime = distance * this.player_.duration(); // Don't let video end while scrubbing.\n\n      if (newTime === this.player_.duration()) {\n        newTime = newTime - 0.1;\n      }\n    } else {\n      if (distance >= 0.99) {\n        liveTracker.seekToLiveEdge();\n        return;\n      }\n\n      var seekableStart = liveTracker.seekableStart();\n      var seekableEnd = liveTracker.liveCurrentTime();\n      newTime = seekableStart + distance * liveTracker.liveWindow(); // Don't let video end while scrubbing.\n\n      if (newTime >= seekableEnd) {\n        newTime = seekableEnd;\n      } // Compensate for precision differences so that currentTime is not less\n      // than seekable start\n\n\n      if (newTime <= seekableStart) {\n        newTime = seekableStart + 0.1;\n      } // On android seekableEnd can be Infinity sometimes,\n      // this will cause newTime to be Infinity, which is\n      // not a valid currentTime.\n\n\n      if (newTime === Infinity) {\n        return;\n      }\n    } // Set new time (tell player to seek to new time)\n\n\n    this.userSeek_(newTime);\n  };\n\n  _proto.enable = function enable() {\n    _Slider.prototype.enable.call(this);\n\n    var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n    if (!mouseTimeDisplay) {\n      return;\n    }\n\n    mouseTimeDisplay.show();\n  };\n\n  _proto.disable = function disable() {\n    _Slider.prototype.disable.call(this);\n\n    var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n    if (!mouseTimeDisplay) {\n      return;\n    }\n\n    mouseTimeDisplay.hide();\n  }\n  /**\n   * Handle mouse up on seek bar\n   *\n   * @param {EventTarget~Event} event\n   *        The `mouseup` event that caused this to run.\n   *\n   * @listens mouseup\n   */\n  ;\n\n  _proto.handleMouseUp = function handleMouseUp(event) {\n    _Slider.prototype.handleMouseUp.call(this, event); // Stop event propagation to prevent double fire in progress-control.js\n\n\n    if (event) {\n      event.stopPropagation();\n    }\n\n    this.player_.scrubbing(false);\n    /**\n     * Trigger timeupdate because we're done seeking and the time has changed.\n     * This is particularly useful for if the player is paused to time the time displays.\n     *\n     * @event Tech#timeupdate\n     * @type {EventTarget~Event}\n     */\n\n    this.player_.trigger({\n      type: 'timeupdate',\n      target: this,\n      manuallyTriggered: true\n    });\n\n    if (this.videoWasPlaying) {\n      silencePromise(this.player_.play());\n    } else {\n      // We're done seeking and the time has changed.\n      // If the player is paused, make sure we display the correct time on the seek bar.\n      this.update_();\n    }\n  }\n  /**\n   * Move more quickly fast forward for keyboard-only users\n   */\n  ;\n\n  _proto.stepForward = function stepForward() {\n    this.userSeek_(this.player_.currentTime() + STEP_SECONDS);\n  }\n  /**\n   * Move more quickly rewind for keyboard-only users\n   */\n  ;\n\n  _proto.stepBack = function stepBack() {\n    this.userSeek_(this.player_.currentTime() - STEP_SECONDS);\n  }\n  /**\n   * Toggles the playback state of the player\n   * This gets called when enter or space is used on the seekbar\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called\n   *\n   */\n  ;\n\n  _proto.handleAction = function handleAction(event) {\n    if (this.player_.paused()) {\n      this.player_.play();\n    } else {\n      this.player_.pause();\n    }\n  }\n  /**\n   * Called when this SeekBar has focus and a key gets pressed down.\n   * Supports the following keys:\n   *\n   *   Space or Enter key fire a click event\n   *   Home key moves to start of the timeline\n   *   End key moves to end of the timeline\n   *   Digit \"0\" through \"9\" keys move to 0%, 10% ... 80%, 90% of the timeline\n   *   PageDown key moves back a larger step than ArrowDown\n   *   PageUp key moves forward a large step\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    var liveTracker = this.player_.liveTracker;\n\n    if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.handleAction(event);\n    } else if (keycode.isEventKey(event, 'Home')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.userSeek_(0);\n    } else if (keycode.isEventKey(event, 'End')) {\n      event.preventDefault();\n      event.stopPropagation();\n\n      if (liveTracker && liveTracker.isLive()) {\n        this.userSeek_(liveTracker.liveCurrentTime());\n      } else {\n        this.userSeek_(this.player_.duration());\n      }\n    } else if (/^[0-9]$/.test(keycode(event))) {\n      event.preventDefault();\n      event.stopPropagation();\n      var gotoFraction = (keycode.codes[keycode(event)] - keycode.codes['0']) * 10.0 / 100.0;\n\n      if (liveTracker && liveTracker.isLive()) {\n        this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);\n      } else {\n        this.userSeek_(this.player_.duration() * gotoFraction);\n      }\n    } else if (keycode.isEventKey(event, 'PgDn')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n    } else if (keycode.isEventKey(event, 'PgUp')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n    } else {\n      // Pass keydown handling up for unsupported keys\n      _Slider.prototype.handleKeyDown.call(this, event);\n    }\n  };\n\n  _proto.dispose = function dispose() {\n    this.disableInterval_();\n    this.off(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n\n    if (this.player_.liveTracker) {\n      this.off(this.player_.liveTracker, 'liveedgechange', this.update);\n    }\n\n    this.off(this.player_, ['playing'], this.enableIntervalHandler_);\n    this.off(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_); // we don't need to update the play progress if the document is hidden,\n    // also, this causes the CPU to spike and eventually crash the page on IE11.\n\n    if ('hidden' in document && 'visibilityState' in document) {\n      this.off(document, 'visibilitychange', this.toggleVisibility_);\n    }\n\n    _Slider.prototype.dispose.call(this);\n  };\n\n  return SeekBar;\n}(Slider);\n/**\n * Default options for the `SeekBar`\n *\n * @type {Object}\n * @private\n */\n\n\nSeekBar.prototype.options_ = {\n  children: ['loadProgressBar', 'playProgressBar'],\n  barName: 'playProgressBar'\n}; // MouseTimeDisplay tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n  SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');\n}\n\nComponent$1.registerComponent('SeekBar', SeekBar);\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress.\n *\n * @extends Component\n */\n\nvar ProgressControl = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(ProgressControl, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function ProgressControl(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.handleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n    _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_this), _this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);\n\n    _this.handleMouseUpHandler_ = function (e) {\n      return _this.handleMouseUp(e);\n    };\n\n    _this.handleMouseDownHandler_ = function (e) {\n      return _this.handleMouseDown(e);\n    };\n\n    _this.enable();\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = ProgressControl.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-progress-control vjs-control'\n    });\n  }\n  /**\n   * When the mouse moves over the `ProgressControl`, the pointer position\n   * gets passed down to the `MouseTimeDisplay` component.\n   *\n   * @param {EventTarget~Event} event\n   *        The `mousemove` event that caused this function to run.\n   *\n   * @listen mousemove\n   */\n  ;\n\n  _proto.handleMouseMove = function handleMouseMove(event) {\n    var seekBar = this.getChild('seekBar');\n\n    if (!seekBar) {\n      return;\n    }\n\n    var playProgressBar = seekBar.getChild('playProgressBar');\n    var mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');\n\n    if (!playProgressBar && !mouseTimeDisplay) {\n      return;\n    }\n\n    var seekBarEl = seekBar.el();\n    var seekBarRect = findPosition(seekBarEl);\n    var seekBarPoint = getPointerPosition(seekBarEl, event).x; // The default skin has a gap on either side of the `SeekBar`. This means\n    // that it's possible to trigger this behavior outside the boundaries of\n    // the `SeekBar`. This ensures we stay within it at all times.\n\n    seekBarPoint = clamp(seekBarPoint, 0, 1);\n\n    if (mouseTimeDisplay) {\n      mouseTimeDisplay.update(seekBarRect, seekBarPoint);\n    }\n\n    if (playProgressBar) {\n      playProgressBar.update(seekBarRect, seekBar.getProgress());\n    }\n  }\n  /**\n   * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.\n   *\n   * @method ProgressControl#throttledHandleMouseSeek\n   * @param {EventTarget~Event} event\n   *        The `mousemove` event that caused this function to run.\n   *\n   * @listen mousemove\n   * @listen touchmove\n   */\n\n  /**\n   * Handle `mousemove` or `touchmove` events on the `ProgressControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown` or `touchstart` event that triggered this function\n   *\n   * @listens mousemove\n   * @listens touchmove\n   */\n  ;\n\n  _proto.handleMouseSeek = function handleMouseSeek(event) {\n    var seekBar = this.getChild('seekBar');\n\n    if (seekBar) {\n      seekBar.handleMouseMove(event);\n    }\n  }\n  /**\n   * Are controls are currently enabled for this progress control.\n   *\n   * @return {boolean}\n   *         true if controls are enabled, false otherwise\n   */\n  ;\n\n  _proto.enabled = function enabled() {\n    return this.enabled_;\n  }\n  /**\n   * Disable all controls on the progress control and its children\n   */\n  ;\n\n  _proto.disable = function disable() {\n    this.children().forEach(function (child) {\n      return child.disable && child.disable();\n    });\n\n    if (!this.enabled()) {\n      return;\n    }\n\n    this.off(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n    this.off(this.el_, 'mousemove', this.handleMouseMove);\n    this.removeListenersAddedOnMousedownAndTouchstart();\n    this.addClass('disabled');\n    this.enabled_ = false; // Restore normal playback state if controls are disabled while scrubbing\n\n    if (this.player_.scrubbing()) {\n      var seekBar = this.getChild('seekBar');\n      this.player_.scrubbing(false);\n\n      if (seekBar.videoWasPlaying) {\n        silencePromise(this.player_.play());\n      }\n    }\n  }\n  /**\n   * Enable all controls on the progress control and its children\n   */\n  ;\n\n  _proto.enable = function enable() {\n    this.children().forEach(function (child) {\n      return child.enable && child.enable();\n    });\n\n    if (this.enabled()) {\n      return;\n    }\n\n    this.on(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n    this.on(this.el_, 'mousemove', this.handleMouseMove);\n    this.removeClass('disabled');\n    this.enabled_ = true;\n  }\n  /**\n   * Cleanup listeners after the user finishes interacting with the progress controls\n   */\n  ;\n\n  _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() {\n    var doc = this.el_.ownerDocument;\n    this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n    this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n    this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n    this.off(doc, 'touchend', this.handleMouseUpHandler_);\n  }\n  /**\n   * Handle `mousedown` or `touchstart` events on the `ProgressControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown` or `touchstart` event that triggered this function\n   *\n   * @listens mousedown\n   * @listens touchstart\n   */\n  ;\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    var doc = this.el_.ownerDocument;\n    var seekBar = this.getChild('seekBar');\n\n    if (seekBar) {\n      seekBar.handleMouseDown(event);\n    }\n\n    this.on(doc, 'mousemove', this.throttledHandleMouseSeek);\n    this.on(doc, 'touchmove', this.throttledHandleMouseSeek);\n    this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n    this.on(doc, 'touchend', this.handleMouseUpHandler_);\n  }\n  /**\n   * Handle `mouseup` or `touchend` events on the `ProgressControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mouseup` or `touchend` event that triggered this function.\n   *\n   * @listens touchend\n   * @listens mouseup\n   */\n  ;\n\n  _proto.handleMouseUp = function handleMouseUp(event) {\n    var seekBar = this.getChild('seekBar');\n\n    if (seekBar) {\n      seekBar.handleMouseUp(event);\n    }\n\n    this.removeListenersAddedOnMousedownAndTouchstart();\n  };\n\n  return ProgressControl;\n}(Component$1);\n/**\n * Default options for `ProgressControl`\n *\n * @type {Object}\n * @private\n */\n\n\nProgressControl.prototype.options_ = {\n  children: ['seekBar']\n};\nComponent$1.registerComponent('ProgressControl', ProgressControl);\n\n/**\n * Toggle Picture-in-Picture mode\n *\n * @extends Button\n */\n\nvar PictureInPictureToggle = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(PictureInPictureToggle, _Button);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @listens Player#enterpictureinpicture\n   * @listens Player#leavepictureinpicture\n   */\n  function PictureInPictureToggle(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this;\n\n    _this.on(player, ['enterpictureinpicture', 'leavepictureinpicture'], function (e) {\n      return _this.handlePictureInPictureChange(e);\n    });\n\n    _this.on(player, ['disablepictureinpicturechanged', 'loadedmetadata'], function (e) {\n      return _this.handlePictureInPictureEnabledChange(e);\n    });\n\n    _this.on(player, ['loadedmetadata', 'audioonlymodechange', 'audiopostermodechange'], function () {\n      // This audio detection will not detect HLS or DASH audio-only streams because there was no reliable way to detect them at the time\n      var isSourceAudio = player.currentType().substring(0, 5) === 'audio';\n\n      if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {\n        if (player.isInPictureInPicture()) {\n          player.exitPictureInPicture();\n        }\n\n        _this.hide();\n      } else {\n        _this.show();\n      }\n    }); // TODO: Deactivate button on player emptied event.\n\n\n    _this.disable();\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = PictureInPictureToggle.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-picture-in-picture-control \" + _Button.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Enables or disables button based on document.pictureInPictureEnabled property value\n   * or on value returned by player.disablePictureInPicture() method.\n   */\n  ;\n\n  _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() {\n    if (document.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false) {\n      this.enable();\n    } else {\n      this.disable();\n    }\n  }\n  /**\n   * Handles enterpictureinpicture and leavepictureinpicture on the player and change control text accordingly.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The {@link Player#enterpictureinpicture} or {@link Player#leavepictureinpicture} event that caused this function to be\n   *        called.\n   *\n   * @listens Player#enterpictureinpicture\n   * @listens Player#leavepictureinpicture\n   */\n  ;\n\n  _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event) {\n    if (this.player_.isInPictureInPicture()) {\n      this.controlText('Exit Picture-in-Picture');\n    } else {\n      this.controlText('Picture-in-Picture');\n    }\n\n    this.handlePictureInPictureEnabledChange();\n  }\n  /**\n   * This gets called when an `PictureInPictureToggle` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    if (!this.player_.isInPictureInPicture()) {\n      this.player_.requestPictureInPicture();\n    } else {\n      this.player_.exitPictureInPicture();\n    }\n  };\n\n  return PictureInPictureToggle;\n}(Button);\n/**\n * The text that should display over the `PictureInPictureToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPictureInPictureToggle.prototype.controlText_ = 'Picture-in-Picture';\nComponent$1.registerComponent('PictureInPictureToggle', PictureInPictureToggle);\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n */\n\nvar FullscreenToggle = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(FullscreenToggle, _Button);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function FullscreenToggle(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this;\n\n    _this.on(player, 'fullscreenchange', function (e) {\n      return _this.handleFullscreenChange(e);\n    });\n\n    if (document[player.fsApi_.fullscreenEnabled] === false) {\n      _this.disable();\n    }\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = FullscreenToggle.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-fullscreen-control \" + _Button.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Handles fullscreenchange on the player and change control text accordingly.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The {@link Player#fullscreenchange} event that caused this function to be\n   *        called.\n   *\n   * @listens Player#fullscreenchange\n   */\n  ;\n\n  _proto.handleFullscreenChange = function handleFullscreenChange(event) {\n    if (this.player_.isFullscreen()) {\n      this.controlText('Non-Fullscreen');\n    } else {\n      this.controlText('Fullscreen');\n    }\n  }\n  /**\n   * This gets called when an `FullscreenToggle` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    if (!this.player_.isFullscreen()) {\n      this.player_.requestFullscreen();\n    } else {\n      this.player_.exitFullscreen();\n    }\n  };\n\n  return FullscreenToggle;\n}(Button);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nFullscreenToggle.prototype.controlText_ = 'Fullscreen';\nComponent$1.registerComponent('FullscreenToggle', FullscreenToggle);\n\n/**\n * Check if volume control is supported and if it isn't hide the\n * `Component` that was passed  using the `vjs-hidden` class.\n *\n * @param {Component} self\n *        The component that should be hidden if volume is unsupported\n *\n * @param {Player} player\n *        A reference to the player\n *\n * @private\n */\nvar checkVolumeSupport = function checkVolumeSupport(self, player) {\n  // hide volume controls when they're not supported by the current tech\n  if (player.tech_ && !player.tech_.featuresVolumeControl) {\n    self.addClass('vjs-hidden');\n  }\n\n  self.on(player, 'loadstart', function () {\n    if (!player.tech_.featuresVolumeControl) {\n      self.addClass('vjs-hidden');\n    } else {\n      self.removeClass('vjs-hidden');\n    }\n  });\n};\n\n/**\n * Shows volume level\n *\n * @extends Component\n */\n\nvar VolumeLevel = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(VolumeLevel, _Component);\n\n  function VolumeLevel() {\n    return _Component.apply(this, arguments) || this;\n  }\n\n  var _proto = VolumeLevel.prototype;\n\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  _proto.createEl = function createEl() {\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-volume-level'\n    });\n\n    el.appendChild(_Component.prototype.createEl.call(this, 'span', {\n      className: 'vjs-control-text'\n    }));\n    return el;\n  };\n\n  return VolumeLevel;\n}(Component$1);\n\nComponent$1.registerComponent('VolumeLevel', VolumeLevel);\n\n/**\n * Volume level tooltips display a volume above or side by side the volume bar.\n *\n * @extends Component\n */\n\nvar VolumeLevelTooltip = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(VolumeLevelTooltip, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The {@link Player} that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function VolumeLevelTooltip(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n    return _this;\n  }\n  /**\n   * Create the volume tooltip DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = VolumeLevelTooltip.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-volume-tooltip'\n    }, {\n      'aria-hidden': 'true'\n    });\n  }\n  /**\n   * Updates the position of the tooltip relative to the `VolumeBar` and\n   * its content text.\n   *\n   * @param {Object} rangeBarRect\n   *        The `ClientRect` for the {@link VolumeBar} element.\n   *\n   * @param {number} rangeBarPoint\n   *        A number from 0 to 1, representing a horizontal/vertical reference point\n   *        from the left edge of the {@link VolumeBar}\n   *\n   * @param {boolean} vertical\n   *        Referees to the Volume control position\n   *        in the control bar{@link VolumeControl}\n   *\n   */\n  ;\n\n  _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) {\n    if (!vertical) {\n      var tooltipRect = getBoundingClientRect(this.el_);\n      var playerRect = getBoundingClientRect(this.player_.el());\n      var volumeBarPointPx = rangeBarRect.width * rangeBarPoint;\n\n      if (!playerRect || !tooltipRect) {\n        return;\n      }\n\n      var spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;\n      var spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);\n      var pullTooltipBy = tooltipRect.width / 2;\n\n      if (spaceLeftOfPoint < pullTooltipBy) {\n        pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n      } else if (spaceRightOfPoint < pullTooltipBy) {\n        pullTooltipBy = spaceRightOfPoint;\n      }\n\n      if (pullTooltipBy < 0) {\n        pullTooltipBy = 0;\n      } else if (pullTooltipBy > tooltipRect.width) {\n        pullTooltipBy = tooltipRect.width;\n      }\n\n      this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n    }\n\n    this.write(content + \"%\");\n  }\n  /**\n   * Write the volume to the tooltip DOM element.\n   *\n   * @param {string} content\n   *        The formatted volume for the tooltip.\n   */\n  ;\n\n  _proto.write = function write(content) {\n    textContent(this.el_, content);\n  }\n  /**\n   * Updates the position of the volume tooltip relative to the `VolumeBar`.\n   *\n   * @param {Object} rangeBarRect\n   *        The `ClientRect` for the {@link VolumeBar} element.\n   *\n   * @param {number} rangeBarPoint\n   *        A number from 0 to 1, representing a horizontal/vertical reference point\n   *        from the left edge of the {@link VolumeBar}\n   *\n   * @param {boolean} vertical\n   *        Referees to the Volume control position\n   *        in the control bar{@link VolumeControl}\n   *\n   * @param {number} volume\n   *        The volume level to update the tooltip to\n   *\n   * @param {Function} cb\n   *        A function that will be called during the request animation frame\n   *        for tooltips that need to do additional animations from the default\n   */\n  ;\n\n  _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {\n    var _this2 = this;\n\n    this.requestNamedAnimationFrame('VolumeLevelTooltip#updateVolume', function () {\n      _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));\n\n      if (cb) {\n        cb();\n      }\n    });\n  };\n\n  return VolumeLevelTooltip;\n}(Component$1);\n\nComponent$1.registerComponent('VolumeLevelTooltip', VolumeLevelTooltip);\n\n/**\n * The {@link MouseVolumeLevelDisplay} component tracks mouse movement over the\n * {@link VolumeControl}. It displays an indicator and a {@link VolumeLevelTooltip}\n * indicating the volume level which is represented by a given point in the\n * {@link VolumeBar}.\n *\n * @extends Component\n */\n\nvar MouseVolumeLevelDisplay = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(MouseVolumeLevelDisplay, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The {@link Player} that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function MouseVolumeLevelDisplay(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n    _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n    return _this;\n  }\n  /**\n   * Create the DOM element for this class.\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = MouseVolumeLevelDisplay.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-mouse-display'\n    });\n  }\n  /**\n   * Enquires updates to its own DOM as well as the DOM of its\n   * {@link VolumeLevelTooltip} child.\n   *\n   * @param {Object} rangeBarRect\n   *        The `ClientRect` for the {@link VolumeBar} element.\n   *\n   * @param {number} rangeBarPoint\n   *        A number from 0 to 1, representing a horizontal/vertical reference point\n   *        from the left edge of the {@link VolumeBar}\n   *\n   * @param {boolean} vertical\n   *        Referees to the Volume control position\n   *        in the control bar{@link VolumeControl}\n   *\n   */\n  ;\n\n  _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) {\n    var _this2 = this;\n\n    var volume = 100 * rangeBarPoint;\n    this.getChild('volumeLevelTooltip').updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function () {\n      if (vertical) {\n        _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + \"px\";\n      } else {\n        _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + \"px\";\n      }\n    });\n  };\n\n  return MouseVolumeLevelDisplay;\n}(Component$1);\n/**\n * Default options for `MouseVolumeLevelDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nMouseVolumeLevelDisplay.prototype.options_ = {\n  children: ['volumeLevelTooltip']\n};\nComponent$1.registerComponent('MouseVolumeLevelDisplay', MouseVolumeLevelDisplay);\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @extends Slider\n */\n\nvar VolumeBar = /*#__PURE__*/function (_Slider) {\n  _inheritsLoose(VolumeBar, _Slider);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function VolumeBar(player, options) {\n    var _this;\n\n    _this = _Slider.call(this, player, options) || this;\n\n    _this.on('slideractive', function (e) {\n      return _this.updateLastVolume_(e);\n    });\n\n    _this.on(player, 'volumechange', function (e) {\n      return _this.updateARIAAttributes(e);\n    });\n\n    player.ready(function () {\n      return _this.updateARIAAttributes();\n    });\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = VolumeBar.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Slider.prototype.createEl.call(this, 'div', {\n      className: 'vjs-volume-bar vjs-slider-bar'\n    }, {\n      'aria-label': this.localize('Volume Level'),\n      'aria-live': 'polite'\n    });\n  }\n  /**\n   * Handle mouse down on volume bar\n   *\n   * @param {EventTarget~Event} event\n   *        The `mousedown` event that caused this to run.\n   *\n   * @listens mousedown\n   */\n  ;\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    if (!isSingleLeftClick(event)) {\n      return;\n    }\n\n    _Slider.prototype.handleMouseDown.call(this, event);\n  }\n  /**\n   * Handle movement events on the {@link VolumeMenuButton}.\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to run.\n   *\n   * @listens mousemove\n   */\n  ;\n\n  _proto.handleMouseMove = function handleMouseMove(event) {\n    var mouseVolumeLevelDisplay = this.getChild('mouseVolumeLevelDisplay');\n\n    if (mouseVolumeLevelDisplay) {\n      var volumeBarEl = this.el();\n      var volumeBarRect = getBoundingClientRect(volumeBarEl);\n      var vertical = this.vertical();\n      var volumeBarPoint = getPointerPosition(volumeBarEl, event);\n      volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x; // The default skin has a gap on either side of the `VolumeBar`. This means\n      // that it's possible to trigger this behavior outside the boundaries of\n      // the `VolumeBar`. This ensures we stay within it at all times.\n\n      volumeBarPoint = clamp(volumeBarPoint, 0, 1);\n      mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);\n    }\n\n    if (!isSingleLeftClick(event)) {\n      return;\n    }\n\n    this.checkMuted();\n    this.player_.volume(this.calculateDistance(event));\n  }\n  /**\n   * If the player is muted unmute it.\n   */\n  ;\n\n  _proto.checkMuted = function checkMuted() {\n    if (this.player_.muted()) {\n      this.player_.muted(false);\n    }\n  }\n  /**\n   * Get percent of volume level\n   *\n   * @return {number}\n   *         Volume level percent as a decimal number.\n   */\n  ;\n\n  _proto.getPercent = function getPercent() {\n    if (this.player_.muted()) {\n      return 0;\n    }\n\n    return this.player_.volume();\n  }\n  /**\n   * Increase volume level for keyboard users\n   */\n  ;\n\n  _proto.stepForward = function stepForward() {\n    this.checkMuted();\n    this.player_.volume(this.player_.volume() + 0.1);\n  }\n  /**\n   * Decrease volume level for keyboard users\n   */\n  ;\n\n  _proto.stepBack = function stepBack() {\n    this.checkMuted();\n    this.player_.volume(this.player_.volume() - 0.1);\n  }\n  /**\n   * Update ARIA accessibility attributes\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `volumechange` event that caused this function to run.\n   *\n   * @listens Player#volumechange\n   */\n  ;\n\n  _proto.updateARIAAttributes = function updateARIAAttributes(event) {\n    var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();\n    this.el_.setAttribute('aria-valuenow', ariaValue);\n    this.el_.setAttribute('aria-valuetext', ariaValue + '%');\n  }\n  /**\n   * Returns the current value of the player volume as a percentage\n   *\n   * @private\n   */\n  ;\n\n  _proto.volumeAsPercentage_ = function volumeAsPercentage_() {\n    return Math.round(this.player_.volume() * 100);\n  }\n  /**\n   * When user starts dragging the VolumeBar, store the volume and listen for\n   * the end of the drag. When the drag ends, if the volume was set to zero,\n   * set lastVolume to the stored volume.\n   *\n   * @listens slideractive\n   * @private\n   */\n  ;\n\n  _proto.updateLastVolume_ = function updateLastVolume_() {\n    var _this2 = this;\n\n    var volumeBeforeDrag = this.player_.volume();\n    this.one('sliderinactive', function () {\n      if (_this2.player_.volume() === 0) {\n        _this2.player_.lastVolume_(volumeBeforeDrag);\n      }\n    });\n  };\n\n  return VolumeBar;\n}(Slider);\n/**\n * Default options for the `VolumeBar`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeBar.prototype.options_ = {\n  children: ['volumeLevel'],\n  barName: 'volumeLevel'\n}; // MouseVolumeLevelDisplay tooltip should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n  VolumeBar.prototype.options_.children.splice(0, 0, 'mouseVolumeLevelDisplay');\n}\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\n\nVolumeBar.prototype.playerEvent = 'volumechange';\nComponent$1.registerComponent('VolumeBar', VolumeBar);\n\n/**\n * The component for controlling the volume level\n *\n * @extends Component\n */\n\nvar VolumeControl = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(VolumeControl, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function VolumeControl(player, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    options.vertical = options.vertical || false; // Pass the vertical option down to the VolumeBar if\n    // the VolumeBar is turned on.\n\n    if (typeof options.volumeBar === 'undefined' || isPlain(options.volumeBar)) {\n      options.volumeBar = options.volumeBar || {};\n      options.volumeBar.vertical = options.vertical;\n    }\n\n    _this = _Component.call(this, player, options) || this; // hide this control if volume support is missing\n\n    checkVolumeSupport(_assertThisInitialized(_this), player);\n    _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n\n    _this.handleMouseUpHandler_ = function (e) {\n      return _this.handleMouseUp(e);\n    };\n\n    _this.on('mousedown', function (e) {\n      return _this.handleMouseDown(e);\n    });\n\n    _this.on('touchstart', function (e) {\n      return _this.handleMouseDown(e);\n    });\n\n    _this.on('mousemove', function (e) {\n      return _this.handleMouseMove(e);\n    }); // while the slider is active (the mouse has been pressed down and\n    // is dragging) or in focus we do not want to hide the VolumeBar\n\n\n    _this.on(_this.volumeBar, ['focus', 'slideractive'], function () {\n      _this.volumeBar.addClass('vjs-slider-active');\n\n      _this.addClass('vjs-slider-active');\n\n      _this.trigger('slideractive');\n    });\n\n    _this.on(_this.volumeBar, ['blur', 'sliderinactive'], function () {\n      _this.volumeBar.removeClass('vjs-slider-active');\n\n      _this.removeClass('vjs-slider-active');\n\n      _this.trigger('sliderinactive');\n    });\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = VolumeControl.prototype;\n\n  _proto.createEl = function createEl() {\n    var orientationClass = 'vjs-volume-horizontal';\n\n    if (this.options_.vertical) {\n      orientationClass = 'vjs-volume-vertical';\n    }\n\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: \"vjs-volume-control vjs-control \" + orientationClass\n    });\n  }\n  /**\n   * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown` or `touchstart` event that triggered this function\n   *\n   * @listens mousedown\n   * @listens touchstart\n   */\n  ;\n\n  _proto.handleMouseDown = function handleMouseDown(event) {\n    var doc = this.el_.ownerDocument;\n    this.on(doc, 'mousemove', this.throttledHandleMouseMove);\n    this.on(doc, 'touchmove', this.throttledHandleMouseMove);\n    this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n    this.on(doc, 'touchend', this.handleMouseUpHandler_);\n  }\n  /**\n   * Handle `mouseup` or `touchend` events on the `VolumeControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mouseup` or `touchend` event that triggered this function.\n   *\n   * @listens touchend\n   * @listens mouseup\n   */\n  ;\n\n  _proto.handleMouseUp = function handleMouseUp(event) {\n    var doc = this.el_.ownerDocument;\n    this.off(doc, 'mousemove', this.throttledHandleMouseMove);\n    this.off(doc, 'touchmove', this.throttledHandleMouseMove);\n    this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n    this.off(doc, 'touchend', this.handleMouseUpHandler_);\n  }\n  /**\n   * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        `mousedown` or `touchstart` event that triggered this function\n   *\n   * @listens mousedown\n   * @listens touchstart\n   */\n  ;\n\n  _proto.handleMouseMove = function handleMouseMove(event) {\n    this.volumeBar.handleMouseMove(event);\n  };\n\n  return VolumeControl;\n}(Component$1);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeControl.prototype.options_ = {\n  children: ['volumeBar']\n};\nComponent$1.registerComponent('VolumeControl', VolumeControl);\n\n/**\n * Check if muting volume is supported and if it isn't hide the mute toggle\n * button.\n *\n * @param {Component} self\n *        A reference to the mute toggle button\n *\n * @param {Player} player\n *        A reference to the player\n *\n * @private\n */\nvar checkMuteSupport = function checkMuteSupport(self, player) {\n  // hide mute toggle button if it's not supported by the current tech\n  if (player.tech_ && !player.tech_.featuresMuteControl) {\n    self.addClass('vjs-hidden');\n  }\n\n  self.on(player, 'loadstart', function () {\n    if (!player.tech_.featuresMuteControl) {\n      self.addClass('vjs-hidden');\n    } else {\n      self.removeClass('vjs-hidden');\n    }\n  });\n};\n\n/**\n * A button component for muting the audio.\n *\n * @extends Button\n */\n\nvar MuteToggle = /*#__PURE__*/function (_Button) {\n  _inheritsLoose(MuteToggle, _Button);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function MuteToggle(player, options) {\n    var _this;\n\n    _this = _Button.call(this, player, options) || this; // hide this control if volume support is missing\n\n    checkMuteSupport(_assertThisInitialized(_this), player);\n\n    _this.on(player, ['loadstart', 'volumechange'], function (e) {\n      return _this.update(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = MuteToggle.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-mute-control \" + _Button.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * This gets called when an `MuteToggle` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    var vol = this.player_.volume();\n    var lastVolume = this.player_.lastVolume_();\n\n    if (vol === 0) {\n      var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;\n      this.player_.volume(volumeToSet);\n      this.player_.muted(false);\n    } else {\n      this.player_.muted(this.player_.muted() ? false : true);\n    }\n  }\n  /**\n   * Update the `MuteToggle` button based on the state of `volume` and `muted`\n   * on the player.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The {@link Player#loadstart} event if this function was called\n   *        through an event.\n   *\n   * @listens Player#loadstart\n   * @listens Player#volumechange\n   */\n  ;\n\n  _proto.update = function update(event) {\n    this.updateIcon_();\n    this.updateControlText_();\n  }\n  /**\n   * Update the appearance of the `MuteToggle` icon.\n   *\n   * Possible states (given `level` variable below):\n   * - 0: crossed out\n   * - 1: zero bars of volume\n   * - 2: one bar of volume\n   * - 3: two bars of volume\n   *\n   * @private\n   */\n  ;\n\n  _proto.updateIcon_ = function updateIcon_() {\n    var vol = this.player_.volume();\n    var level = 3; // in iOS when a player is loaded with muted attribute\n    // and volume is changed with a native mute button\n    // we want to make sure muted state is updated\n\n    if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {\n      this.player_.muted(this.player_.tech_.el_.muted);\n    }\n\n    if (vol === 0 || this.player_.muted()) {\n      level = 0;\n    } else if (vol < 0.33) {\n      level = 1;\n    } else if (vol < 0.67) {\n      level = 2;\n    } // TODO improve muted icon classes\n\n\n    for (var i = 0; i < 4; i++) {\n      removeClass(this.el_, \"vjs-vol-\" + i);\n    }\n\n    addClass(this.el_, \"vjs-vol-\" + level);\n  }\n  /**\n   * If `muted` has changed on the player, update the control text\n   * (`title` attribute on `vjs-mute-control` element and content of\n   * `vjs-control-text` element).\n   *\n   * @private\n   */\n  ;\n\n  _proto.updateControlText_ = function updateControlText_() {\n    var soundOff = this.player_.muted() || this.player_.volume() === 0;\n    var text = soundOff ? 'Unmute' : 'Mute';\n\n    if (this.controlText() !== text) {\n      this.controlText(text);\n    }\n  };\n\n  return MuteToggle;\n}(Button);\n/**\n * The text that should display over the `MuteToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nMuteToggle.prototype.controlText_ = 'Mute';\nComponent$1.registerComponent('MuteToggle', MuteToggle);\n\n/**\n * A Component to contain the MuteToggle and VolumeControl so that\n * they can work together.\n *\n * @extends Component\n */\n\nvar VolumePanel = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(VolumePanel, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function VolumePanel(player, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    if (typeof options.inline !== 'undefined') {\n      options.inline = options.inline;\n    } else {\n      options.inline = true;\n    } // pass the inline option down to the VolumeControl as vertical if\n    // the VolumeControl is on.\n\n\n    if (typeof options.volumeControl === 'undefined' || isPlain(options.volumeControl)) {\n      options.volumeControl = options.volumeControl || {};\n      options.volumeControl.vertical = !options.inline;\n    }\n\n    _this = _Component.call(this, player, options) || this; // this handler is used by mouse handler methods below\n\n    _this.handleKeyPressHandler_ = function (e) {\n      return _this.handleKeyPress(e);\n    };\n\n    _this.on(player, ['loadstart'], function (e) {\n      return _this.volumePanelState_(e);\n    });\n\n    _this.on(_this.muteToggle, 'keyup', function (e) {\n      return _this.handleKeyPress(e);\n    });\n\n    _this.on(_this.volumeControl, 'keyup', function (e) {\n      return _this.handleVolumeControlKeyUp(e);\n    });\n\n    _this.on('keydown', function (e) {\n      return _this.handleKeyPress(e);\n    });\n\n    _this.on('mouseover', function (e) {\n      return _this.handleMouseOver(e);\n    });\n\n    _this.on('mouseout', function (e) {\n      return _this.handleMouseOut(e);\n    }); // while the slider is active (the mouse has been pressed down and\n    // is dragging) we do not want to hide the VolumeBar\n\n\n    _this.on(_this.volumeControl, ['slideractive'], _this.sliderActive_);\n\n    _this.on(_this.volumeControl, ['sliderinactive'], _this.sliderInactive_);\n\n    return _this;\n  }\n  /**\n   * Add vjs-slider-active class to the VolumePanel\n   *\n   * @listens VolumeControl#slideractive\n   * @private\n   */\n\n\n  var _proto = VolumePanel.prototype;\n\n  _proto.sliderActive_ = function sliderActive_() {\n    this.addClass('vjs-slider-active');\n  }\n  /**\n   * Removes vjs-slider-active class to the VolumePanel\n   *\n   * @listens VolumeControl#sliderinactive\n   * @private\n   */\n  ;\n\n  _proto.sliderInactive_ = function sliderInactive_() {\n    this.removeClass('vjs-slider-active');\n  }\n  /**\n   * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel\n   * depending on MuteToggle and VolumeControl state\n   *\n   * @listens Player#loadstart\n   * @private\n   */\n  ;\n\n  _proto.volumePanelState_ = function volumePanelState_() {\n    // hide volume panel if neither volume control or mute toggle\n    // are displayed\n    if (this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden')) {\n      this.addClass('vjs-hidden');\n    } // if only mute toggle is visible we don't want\n    // volume panel expanding when hovered or active\n\n\n    if (this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden')) {\n      this.addClass('vjs-mute-toggle-only');\n    }\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    var orientationClass = 'vjs-volume-panel-horizontal';\n\n    if (!this.options_.inline) {\n      orientationClass = 'vjs-volume-panel-vertical';\n    }\n\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: \"vjs-volume-panel vjs-control \" + orientationClass\n    });\n  }\n  /**\n   * Dispose of the `volume-panel` and all child components.\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.handleMouseOut();\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Handles `keyup` events on the `VolumeControl`, looking for ESC, which closes\n   * the volume panel and sets focus on `MuteToggle`.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keyup` event that caused this function to be called.\n   *\n   * @listens keyup\n   */\n  ;\n\n  _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event) {\n    if (keycode.isEventKey(event, 'Esc')) {\n      this.muteToggle.focus();\n    }\n  }\n  /**\n   * This gets called when a `VolumePanel` gains hover via a `mouseover` event.\n   * Turns on listening for `mouseover` event. When they happen it\n   * calls `this.handleMouseOver`.\n   *\n   * @param {EventTarget~Event} event\n   *        The `mouseover` event that caused this function to be called.\n   *\n   * @listens mouseover\n   */\n  ;\n\n  _proto.handleMouseOver = function handleMouseOver(event) {\n    this.addClass('vjs-hover');\n    on(document, 'keyup', this.handleKeyPressHandler_);\n  }\n  /**\n   * This gets called when a `VolumePanel` gains hover via a `mouseout` event.\n   * Turns on listening for `mouseout` event. When they happen it\n   * calls `this.handleMouseOut`.\n   *\n   * @param {EventTarget~Event} event\n   *        The `mouseout` event that caused this function to be called.\n   *\n   * @listens mouseout\n   */\n  ;\n\n  _proto.handleMouseOut = function handleMouseOut(event) {\n    this.removeClass('vjs-hover');\n    off(document, 'keyup', this.handleKeyPressHandler_);\n  }\n  /**\n   * Handles `keyup` event on the document or `keydown` event on the `VolumePanel`,\n   * looking for ESC, which hides the `VolumeControl`.\n   *\n   * @param {EventTarget~Event} event\n   *        The keypress that triggered this event.\n   *\n   * @listens keydown | keyup\n   */\n  ;\n\n  _proto.handleKeyPress = function handleKeyPress(event) {\n    if (keycode.isEventKey(event, 'Esc')) {\n      this.handleMouseOut();\n    }\n  };\n\n  return VolumePanel;\n}(Component$1);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumePanel.prototype.options_ = {\n  children: ['muteToggle', 'volumeControl']\n};\nComponent$1.registerComponent('VolumePanel', VolumePanel);\n\n/**\n * The Menu component is used to build popup menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n */\n\nvar Menu = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(Menu, _Component);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Player} player\n   *        the player that this component should attach to\n   *\n   * @param {Object} [options]\n   *        Object of option names and values\n   *\n   */\n  function Menu(player, options) {\n    var _this;\n\n    _this = _Component.call(this, player, options) || this;\n\n    if (options) {\n      _this.menuButton_ = options.menuButton;\n    }\n\n    _this.focusedChild_ = -1;\n\n    _this.on('keydown', function (e) {\n      return _this.handleKeyDown(e);\n    }); // All the menu item instances share the same blur handler provided by the menu container.\n\n\n    _this.boundHandleBlur_ = function (e) {\n      return _this.handleBlur(e);\n    };\n\n    _this.boundHandleTapClick_ = function (e) {\n      return _this.handleTapClick(e);\n    };\n\n    return _this;\n  }\n  /**\n   * Add event listeners to the {@link MenuItem}.\n   *\n   * @param {Object} component\n   *        The instance of the `MenuItem` to add listeners to.\n   *\n   */\n\n\n  var _proto = Menu.prototype;\n\n  _proto.addEventListenerForItem = function addEventListenerForItem(component) {\n    if (!(component instanceof Component$1)) {\n      return;\n    }\n\n    this.on(component, 'blur', this.boundHandleBlur_);\n    this.on(component, ['tap', 'click'], this.boundHandleTapClick_);\n  }\n  /**\n   * Remove event listeners from the {@link MenuItem}.\n   *\n   * @param {Object} component\n   *        The instance of the `MenuItem` to remove listeners.\n   *\n   */\n  ;\n\n  _proto.removeEventListenerForItem = function removeEventListenerForItem(component) {\n    if (!(component instanceof Component$1)) {\n      return;\n    }\n\n    this.off(component, 'blur', this.boundHandleBlur_);\n    this.off(component, ['tap', 'click'], this.boundHandleTapClick_);\n  }\n  /**\n   * This method will be called indirectly when the component has been added\n   * before the component adds to the new menu instance by `addItem`.\n   * In this case, the original menu instance will remove the component\n   * by calling `removeChild`.\n   *\n   * @param {Object} component\n   *        The instance of the `MenuItem`\n   */\n  ;\n\n  _proto.removeChild = function removeChild(component) {\n    if (typeof component === 'string') {\n      component = this.getChild(component);\n    }\n\n    this.removeEventListenerForItem(component);\n\n    _Component.prototype.removeChild.call(this, component);\n  }\n  /**\n   * Add a {@link MenuItem} to the menu.\n   *\n   * @param {Object|string} component\n   *        The name or instance of the `MenuItem` to add.\n   *\n   */\n  ;\n\n  _proto.addItem = function addItem(component) {\n    var childComponent = this.addChild(component);\n\n    if (childComponent) {\n      this.addEventListenerForItem(childComponent);\n    }\n  }\n  /**\n   * Create the `Menu`s DOM element.\n   *\n   * @return {Element}\n   *         the element that was created\n   */\n  ;\n\n  _proto.createEl = function createEl$1() {\n    var contentElType = this.options_.contentElType || 'ul';\n    this.contentEl_ = createEl(contentElType, {\n      className: 'vjs-menu-content'\n    });\n    this.contentEl_.setAttribute('role', 'menu');\n\n    var el = _Component.prototype.createEl.call(this, 'div', {\n      append: this.contentEl_,\n      className: 'vjs-menu'\n    });\n\n    el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons,\n    // where a click on the parent is significant\n\n    on(el, 'click', function (event) {\n      event.preventDefault();\n      event.stopImmediatePropagation();\n    });\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    this.contentEl_ = null;\n    this.boundHandleBlur_ = null;\n    this.boundHandleTapClick_ = null;\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Called when a `MenuItem` loses focus.\n   *\n   * @param {EventTarget~Event} event\n   *        The `blur` event that caused this function to be called.\n   *\n   * @listens blur\n   */\n  ;\n\n  _proto.handleBlur = function handleBlur(event) {\n    var relatedTarget = event.relatedTarget || document.activeElement; // Close menu popup when a user clicks outside the menu\n\n    if (!this.children().some(function (element) {\n      return element.el() === relatedTarget;\n    })) {\n      var btn = this.menuButton_;\n\n      if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {\n        btn.unpressButton();\n      }\n    }\n  }\n  /**\n   * Called when a `MenuItem` gets clicked or tapped.\n   *\n   * @param {EventTarget~Event} event\n   *        The `click` or `tap` event that caused this function to be called.\n   *\n   * @listens click,tap\n   */\n  ;\n\n  _proto.handleTapClick = function handleTapClick(event) {\n    // Unpress the associated MenuButton, and move focus back to it\n    if (this.menuButton_) {\n      this.menuButton_.unpressButton();\n      var childComponents = this.children();\n\n      if (!Array.isArray(childComponents)) {\n        return;\n      }\n\n      var foundComponent = childComponents.filter(function (component) {\n        return component.el() === event.target;\n      })[0];\n\n      if (!foundComponent) {\n        return;\n      } // don't focus menu button if item is a caption settings item\n      // because focus will move elsewhere\n\n\n      if (foundComponent.name() !== 'CaptionSettingsMenuItem') {\n        this.menuButton_.focus();\n      }\n    }\n  }\n  /**\n   * Handle a `keydown` event on this menu. This listener is added in the constructor.\n   *\n   * @param {EventTarget~Event} event\n   *        A `keydown` event that happened on the menu.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Left and Down Arrows\n    if (keycode.isEventKey(event, 'Left') || keycode.isEventKey(event, 'Down')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.stepForward(); // Up and Right Arrows\n    } else if (keycode.isEventKey(event, 'Right') || keycode.isEventKey(event, 'Up')) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.stepBack();\n    }\n  }\n  /**\n   * Move to next (lower) menu item for keyboard users.\n   */\n  ;\n\n  _proto.stepForward = function stepForward() {\n    var stepChild = 0;\n\n    if (this.focusedChild_ !== undefined) {\n      stepChild = this.focusedChild_ + 1;\n    }\n\n    this.focus(stepChild);\n  }\n  /**\n   * Move to previous (higher) menu item for keyboard users.\n   */\n  ;\n\n  _proto.stepBack = function stepBack() {\n    var stepChild = 0;\n\n    if (this.focusedChild_ !== undefined) {\n      stepChild = this.focusedChild_ - 1;\n    }\n\n    this.focus(stepChild);\n  }\n  /**\n   * Set focus on a {@link MenuItem} in the `Menu`.\n   *\n   * @param {Object|string} [item=0]\n   *        Index of child item set focus on.\n   */\n  ;\n\n  _proto.focus = function focus(item) {\n    if (item === void 0) {\n      item = 0;\n    }\n\n    var children = this.children().slice();\n    var haveTitle = children.length && children[0].hasClass('vjs-menu-title');\n\n    if (haveTitle) {\n      children.shift();\n    }\n\n    if (children.length > 0) {\n      if (item < 0) {\n        item = 0;\n      } else if (item >= children.length) {\n        item = children.length - 1;\n      }\n\n      this.focusedChild_ = item;\n      children[item].el_.focus();\n    }\n  };\n\n  return Menu;\n}(Component$1);\n\nComponent$1.registerComponent('Menu', Menu);\n\n/**\n * A `MenuButton` class for any popup {@link Menu}.\n *\n * @extends Component\n */\n\nvar MenuButton = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(MenuButton, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function MenuButton(player, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _Component.call(this, player, options) || this;\n    _this.menuButton_ = new Button(player, options);\n\n    _this.menuButton_.controlText(_this.controlText_);\n\n    _this.menuButton_.el_.setAttribute('aria-haspopup', 'true'); // Add buildCSSClass values to the button, not the wrapper\n\n\n    var buttonClass = Button.prototype.buildCSSClass();\n    _this.menuButton_.el_.className = _this.buildCSSClass() + ' ' + buttonClass;\n\n    _this.menuButton_.removeClass('vjs-control');\n\n    _this.addChild(_this.menuButton_);\n\n    _this.update();\n\n    _this.enabled_ = true;\n\n    var handleClick = function handleClick(e) {\n      return _this.handleClick(e);\n    };\n\n    _this.handleMenuKeyUp_ = function (e) {\n      return _this.handleMenuKeyUp(e);\n    };\n\n    _this.on(_this.menuButton_, 'tap', handleClick);\n\n    _this.on(_this.menuButton_, 'click', handleClick);\n\n    _this.on(_this.menuButton_, 'keydown', function (e) {\n      return _this.handleKeyDown(e);\n    });\n\n    _this.on(_this.menuButton_, 'mouseenter', function () {\n      _this.addClass('vjs-hover');\n\n      _this.menu.show();\n\n      on(document, 'keyup', _this.handleMenuKeyUp_);\n    });\n\n    _this.on('mouseleave', function (e) {\n      return _this.handleMouseLeave(e);\n    });\n\n    _this.on('keydown', function (e) {\n      return _this.handleSubmenuKeyDown(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Update the menu based on the current state of its items.\n   */\n\n\n  var _proto = MenuButton.prototype;\n\n  _proto.update = function update() {\n    var menu = this.createMenu();\n\n    if (this.menu) {\n      this.menu.dispose();\n      this.removeChild(this.menu);\n    }\n\n    this.menu = menu;\n    this.addChild(menu);\n    /**\n     * Track the state of the menu button\n     *\n     * @type {Boolean}\n     * @private\n     */\n\n    this.buttonPressed_ = false;\n    this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n\n    if (this.items && this.items.length <= this.hideThreshold_) {\n      this.hide();\n      this.menu.contentEl_.removeAttribute('role');\n    } else {\n      this.show();\n      this.menu.contentEl_.setAttribute('role', 'menu');\n    }\n  }\n  /**\n   * Create the menu and add all items to it.\n   *\n   * @return {Menu}\n   *         The constructed menu\n   */\n  ;\n\n  _proto.createMenu = function createMenu() {\n    var menu = new Menu(this.player_, {\n      menuButton: this\n    });\n    /**\n     * Hide the menu if the number of items is less than or equal to this threshold. This defaults\n     * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list\n     * it here because every time we run `createMenu` we need to reset the value.\n     *\n     * @protected\n     * @type {Number}\n     */\n\n    this.hideThreshold_ = 0; // Add a title list item to the top\n\n    if (this.options_.title) {\n      var titleEl = createEl('li', {\n        className: 'vjs-menu-title',\n        textContent: toTitleCase$1(this.options_.title),\n        tabIndex: -1\n      });\n      var titleComponent = new Component$1(this.player_, {\n        el: titleEl\n      });\n      menu.addItem(titleComponent);\n    }\n\n    this.items = this.createItems();\n\n    if (this.items) {\n      // Add menu items to the menu\n      for (var i = 0; i < this.items.length; i++) {\n        menu.addItem(this.items[i]);\n      }\n    }\n\n    return menu;\n  }\n  /**\n   * Create the list of menu items. Specific to each subclass.\n   *\n   * @abstract\n   */\n  ;\n\n  _proto.createItems = function createItems() {}\n  /**\n   * Create the `MenuButtons`s DOM element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: this.buildWrapperCSSClass()\n    }, {});\n  }\n  /**\n   * Allow sub components to stack CSS class names for the wrapper element\n   *\n   * @return {string}\n   *         The constructed wrapper DOM `className`\n   */\n  ;\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n    if (this.options_.inline === true) {\n      menuButtonClass += '-inline';\n    } else {\n      menuButtonClass += '-popup';\n    } // TODO: Fix the CSS so that this isn't necessary\n\n\n    var buttonClass = Button.prototype.buildCSSClass();\n    return \"vjs-menu-button \" + menuButtonClass + \" \" + buttonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n    if (this.options_.inline === true) {\n      menuButtonClass += '-inline';\n    } else {\n      menuButtonClass += '-popup';\n    }\n\n    return \"vjs-menu-button \" + menuButtonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Get or set the localized control text that will be used for accessibility.\n   *\n   * > NOTE: This will come from the internal `menuButton_` element.\n   *\n   * @param {string} [text]\n   *        Control text for element.\n   *\n   * @param {Element} [el=this.menuButton_.el()]\n   *        Element to set the title on.\n   *\n   * @return {string}\n   *         - The control text when getting\n   */\n  ;\n\n  _proto.controlText = function controlText(text, el) {\n    if (el === void 0) {\n      el = this.menuButton_.el();\n    }\n\n    return this.menuButton_.controlText(text, el);\n  }\n  /**\n   * Dispose of the `menu-button` and all child components.\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.handleMouseLeave();\n\n    _Component.prototype.dispose.call(this);\n  }\n  /**\n   * Handle a click on a `MenuButton`.\n   * See {@link ClickableComponent#handleClick} for instances where this is called.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    if (this.buttonPressed_) {\n      this.unpressButton();\n    } else {\n      this.pressButton();\n    }\n  }\n  /**\n   * Handle `mouseleave` for `MenuButton`.\n   *\n   * @param {EventTarget~Event} event\n   *        The `mouseleave` event that caused this function to be called.\n   *\n   * @listens mouseleave\n   */\n  ;\n\n  _proto.handleMouseLeave = function handleMouseLeave(event) {\n    this.removeClass('vjs-hover');\n    off(document, 'keyup', this.handleMenuKeyUp_);\n  }\n  /**\n   * Set the focus to the actual button, not to this element\n   */\n  ;\n\n  _proto.focus = function focus() {\n    this.menuButton_.focus();\n  }\n  /**\n   * Remove the focus from the actual button, not this element\n   */\n  ;\n\n  _proto.blur = function blur() {\n    this.menuButton_.blur();\n  }\n  /**\n   * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See\n   * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    // Escape or Tab unpress the 'button'\n    if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n      if (this.buttonPressed_) {\n        this.unpressButton();\n      } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n      if (!keycode.isEventKey(event, 'Tab')) {\n        event.preventDefault(); // Set focus back to the menu button's button\n\n        this.menuButton_.focus();\n      } // Up Arrow or Down Arrow also 'press' the button to open the menu\n\n    } else if (keycode.isEventKey(event, 'Up') || keycode.isEventKey(event, 'Down')) {\n      if (!this.buttonPressed_) {\n        event.preventDefault();\n        this.pressButton();\n      }\n    }\n  }\n  /**\n   * Handle a `keyup` event on a `MenuButton`. The listener for this is added in\n   * the constructor.\n   *\n   * @param {EventTarget~Event} event\n   *        Key press event\n   *\n   * @listens keyup\n   */\n  ;\n\n  _proto.handleMenuKeyUp = function handleMenuKeyUp(event) {\n    // Escape hides popup menu\n    if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n      this.removeClass('vjs-hover');\n    }\n  }\n  /**\n   * This method name now delegates to `handleSubmenuKeyDown`. This means\n   * anyone calling `handleSubmenuKeyPress` will not see their method calls\n   * stop working.\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to be called.\n   */\n  ;\n\n  _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) {\n    this.handleSubmenuKeyDown(event);\n  }\n  /**\n   * Handle a `keydown` event on a sub-menu. The listener for this is added in\n   * the constructor.\n   *\n   * @param {EventTarget~Event} event\n   *        Key press event\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event) {\n    // Escape or Tab unpress the 'button'\n    if (keycode.isEventKey(event, 'Esc') || keycode.isEventKey(event, 'Tab')) {\n      if (this.buttonPressed_) {\n        this.unpressButton();\n      } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n      if (!keycode.isEventKey(event, 'Tab')) {\n        event.preventDefault(); // Set focus back to the menu button's button\n\n        this.menuButton_.focus();\n      }\n    }\n  }\n  /**\n   * Put the current `MenuButton` into a pressed state.\n   */\n  ;\n\n  _proto.pressButton = function pressButton() {\n    if (this.enabled_) {\n      this.buttonPressed_ = true;\n      this.menu.show();\n      this.menu.lockShowing();\n      this.menuButton_.el_.setAttribute('aria-expanded', 'true'); // set the focus into the submenu, except on iOS where it is resulting in\n      // undesired scrolling behavior when the player is in an iframe\n\n      if (IS_IOS && isInFrame()) {\n        // Return early so that the menu isn't focused\n        return;\n      }\n\n      this.menu.focus();\n    }\n  }\n  /**\n   * Take the current `MenuButton` out of a pressed state.\n   */\n  ;\n\n  _proto.unpressButton = function unpressButton() {\n    if (this.enabled_) {\n      this.buttonPressed_ = false;\n      this.menu.unlockShowing();\n      this.menu.hide();\n      this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n    }\n  }\n  /**\n   * Disable the `MenuButton`. Don't allow it to be clicked.\n   */\n  ;\n\n  _proto.disable = function disable() {\n    this.unpressButton();\n    this.enabled_ = false;\n    this.addClass('vjs-disabled');\n    this.menuButton_.disable();\n  }\n  /**\n   * Enable the `MenuButton`. Allow it to be clicked.\n   */\n  ;\n\n  _proto.enable = function enable() {\n    this.enabled_ = true;\n    this.removeClass('vjs-disabled');\n    this.menuButton_.enable();\n  };\n\n  return MenuButton;\n}(Component$1);\n\nComponent$1.registerComponent('MenuButton', MenuButton);\n\n/**\n * The base class for buttons that toggle specific  track types (e.g. subtitles).\n *\n * @extends MenuButton\n */\n\nvar TrackButton = /*#__PURE__*/function (_MenuButton) {\n  _inheritsLoose(TrackButton, _MenuButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function TrackButton(player, options) {\n    var _this;\n\n    var tracks = options.tracks;\n    _this = _MenuButton.call(this, player, options) || this;\n\n    if (_this.items.length <= 1) {\n      _this.hide();\n    }\n\n    if (!tracks) {\n      return _assertThisInitialized(_this);\n    }\n\n    var updateHandler = bind(_assertThisInitialized(_this), _this.update);\n    tracks.addEventListener('removetrack', updateHandler);\n    tracks.addEventListener('addtrack', updateHandler);\n    tracks.addEventListener('labelchange', updateHandler);\n\n    _this.player_.on('ready', updateHandler);\n\n    _this.player_.on('dispose', function () {\n      tracks.removeEventListener('removetrack', updateHandler);\n      tracks.removeEventListener('addtrack', updateHandler);\n      tracks.removeEventListener('labelchange', updateHandler);\n    });\n\n    return _this;\n  }\n\n  return TrackButton;\n}(MenuButton);\n\nComponent$1.registerComponent('TrackButton', TrackButton);\n\n/**\n * @file menu-keys.js\n */\n\n/**\n  * All keys used for operation of a menu (`MenuButton`, `Menu`, and `MenuItem`)\n  * Note that 'Enter' and 'Space' are not included here (otherwise they would\n  * prevent the `MenuButton` and `MenuItem` from being keyboard-clickable)\n  * @typedef MenuKeys\n  * @array\n  */\nvar MenuKeys = ['Tab', 'Esc', 'Up', 'Down', 'Right', 'Left'];\n\n/**\n * The component for a menu item. `<li>`\n *\n * @extends ClickableComponent\n */\n\nvar MenuItem = /*#__PURE__*/function (_ClickableComponent) {\n  _inheritsLoose(MenuItem, _ClickableComponent);\n\n  /**\n   * Creates an instance of the this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   *\n   */\n  function MenuItem(player, options) {\n    var _this;\n\n    _this = _ClickableComponent.call(this, player, options) || this;\n    _this.selectable = options.selectable;\n    _this.isSelected_ = options.selected || false;\n    _this.multiSelectable = options.multiSelectable;\n\n    _this.selected(_this.isSelected_);\n\n    if (_this.selectable) {\n      if (_this.multiSelectable) {\n        _this.el_.setAttribute('role', 'menuitemcheckbox');\n      } else {\n        _this.el_.setAttribute('role', 'menuitemradio');\n      }\n    } else {\n      _this.el_.setAttribute('role', 'menuitem');\n    }\n\n    return _this;\n  }\n  /**\n   * Create the `MenuItem's DOM element\n   *\n   * @param {string} [type=li]\n   *        Element's node type, not actually used, always set to `li`.\n   *\n   * @param {Object} [props={}]\n   *        An object of properties that should be set on the element\n   *\n   * @param {Object} [attrs={}]\n   *        An object of attributes that should be set on the element\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n\n\n  var _proto = MenuItem.prototype;\n\n  _proto.createEl = function createEl$1(type, props, attrs) {\n    // The control is textual, not just an icon\n    this.nonIconControl = true;\n\n    var el = _ClickableComponent.prototype.createEl.call(this, 'li', assign({\n      className: 'vjs-menu-item',\n      tabIndex: -1\n    }, props), attrs); // swap icon with menu item text.\n\n\n    el.replaceChild(createEl('span', {\n      className: 'vjs-menu-item-text',\n      textContent: this.localize(this.options_.label)\n    }), el.querySelector('.vjs-icon-placeholder'));\n    return el;\n  }\n  /**\n   * Ignore keys which are used by the menu, but pass any other ones up. See\n   * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    if (!MenuKeys.some(function (key) {\n      return keycode.isEventKey(event, key);\n    })) {\n      // Pass keydown handling up for unused keys\n      _ClickableComponent.prototype.handleKeyDown.call(this, event);\n    }\n  }\n  /**\n   * Any click on a `MenuItem` puts it into the selected state.\n   * See {@link ClickableComponent#handleClick} for instances where this is called.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    this.selected(true);\n  }\n  /**\n   * Set the state for this menu item as selected or not.\n   *\n   * @param {boolean} selected\n   *        if the menu item is selected or not\n   */\n  ;\n\n  _proto.selected = function selected(_selected) {\n    if (this.selectable) {\n      if (_selected) {\n        this.addClass('vjs-selected');\n        this.el_.setAttribute('aria-checked', 'true'); // aria-checked isn't fully supported by browsers/screen readers,\n        // so indicate selected state to screen reader in the control text.\n\n        this.controlText(', selected');\n        this.isSelected_ = true;\n      } else {\n        this.removeClass('vjs-selected');\n        this.el_.setAttribute('aria-checked', 'false'); // Indicate un-selected state to screen reader\n\n        this.controlText('');\n        this.isSelected_ = false;\n      }\n    }\n  };\n\n  return MenuItem;\n}(ClickableComponent);\n\nComponent$1.registerComponent('MenuItem', MenuItem);\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @extends MenuItem\n */\n\nvar TextTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n  _inheritsLoose(TextTrackMenuItem, _MenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function TextTrackMenuItem(player, options) {\n    var _this;\n\n    var track = options.track;\n    var tracks = player.textTracks(); // Modify options for parent MenuItem class's init.\n\n    options.label = track.label || track.language || 'Unknown';\n    options.selected = track.mode === 'showing';\n    _this = _MenuItem.call(this, player, options) || this;\n    _this.track = track; // Determine the relevant kind(s) of tracks for this component and filter\n    // out empty kinds.\n\n    _this.kinds = (options.kinds || [options.kind || _this.track.kind]).filter(Boolean);\n\n    var changeHandler = function changeHandler() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this.handleTracksChange.apply(_assertThisInitialized(_this), args);\n    };\n\n    var selectedLanguageChangeHandler = function selectedLanguageChangeHandler() {\n      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        args[_key2] = arguments[_key2];\n      }\n\n      _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_this), args);\n    };\n\n    player.on(['loadstart', 'texttrackchange'], changeHandler);\n    tracks.addEventListener('change', changeHandler);\n    tracks.addEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n\n    _this.on('dispose', function () {\n      player.off(['loadstart', 'texttrackchange'], changeHandler);\n      tracks.removeEventListener('change', changeHandler);\n      tracks.removeEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n    }); // iOS7 doesn't dispatch change events to TextTrackLists when an\n    // associated track's mode changes. Without something like\n    // Object.observe() (also not present on iOS7), it's not\n    // possible to detect changes to the mode attribute and polyfill\n    // the change event. As a poor substitute, we manually dispatch\n    // change events whenever the controls modify the mode.\n\n\n    if (tracks.onchange === undefined) {\n      var event;\n\n      _this.on(['tap', 'click'], function () {\n        if (typeof window$1.Event !== 'object') {\n          // Android 2.3 throws an Illegal Constructor error for window.Event\n          try {\n            event = new window$1.Event('change');\n          } catch (err) {// continue regardless of error\n          }\n        }\n\n        if (!event) {\n          event = document.createEvent('Event');\n          event.initEvent('change', true, true);\n        }\n\n        tracks.dispatchEvent(event);\n      });\n    } // set the default state based on current tracks\n\n\n    _this.handleTracksChange();\n\n    return _this;\n  }\n  /**\n   * This gets called when an `TextTrackMenuItem` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n\n\n  var _proto = TextTrackMenuItem.prototype;\n\n  _proto.handleClick = function handleClick(event) {\n    var referenceTrack = this.track;\n    var tracks = this.player_.textTracks();\n\n    _MenuItem.prototype.handleClick.call(this, event);\n\n    if (!tracks) {\n      return;\n    }\n\n    for (var i = 0; i < tracks.length; i++) {\n      var track = tracks[i]; // If the track from the text tracks list is not of the right kind,\n      // skip it. We do not want to affect tracks of incompatible kind(s).\n\n      if (this.kinds.indexOf(track.kind) === -1) {\n        continue;\n      } // If this text track is the component's track and it is not showing,\n      // set it to showing.\n\n\n      if (track === referenceTrack) {\n        if (track.mode !== 'showing') {\n          track.mode = 'showing';\n        } // If this text track is not the component's track and it is not\n        // disabled, set it to disabled.\n\n      } else if (track.mode !== 'disabled') {\n        track.mode = 'disabled';\n      }\n    }\n  }\n  /**\n   * Handle text track list change\n   *\n   * @param {EventTarget~Event} event\n   *        The `change` event that caused this function to be called.\n   *\n   * @listens TextTrackList#change\n   */\n  ;\n\n  _proto.handleTracksChange = function handleTracksChange(event) {\n    var shouldBeSelected = this.track.mode === 'showing'; // Prevent redundant selected() calls because they may cause\n    // screen readers to read the appended control text unnecessarily\n\n    if (shouldBeSelected !== this.isSelected_) {\n      this.selected(shouldBeSelected);\n    }\n  };\n\n  _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n    if (this.track.mode === 'showing') {\n      var selectedLanguage = this.player_.cache_.selectedLanguage; // Don't replace the kind of track across the same language\n\n      if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {\n        return;\n      }\n\n      this.player_.cache_.selectedLanguage = {\n        enabled: true,\n        language: this.track.language,\n        kind: this.track.kind\n      };\n    }\n  };\n\n  _proto.dispose = function dispose() {\n    // remove reference to track object on dispose\n    this.track = null;\n\n    _MenuItem.prototype.dispose.call(this);\n  };\n\n  return TextTrackMenuItem;\n}(MenuItem);\n\nComponent$1.registerComponent('TextTrackMenuItem', TextTrackMenuItem);\n\n/**\n * A special menu item for turning of a specific type of text track\n *\n * @extends TextTrackMenuItem\n */\n\nvar OffTextTrackMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n  _inheritsLoose(OffTextTrackMenuItem, _TextTrackMenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function OffTextTrackMenuItem(player, options) {\n    // Create pseudo track info\n    // Requires options['kind']\n    options.track = {\n      player: player,\n      // it is no longer necessary to store `kind` or `kinds` on the track itself\n      // since they are now stored in the `kinds` property of all instances of\n      // TextTrackMenuItem, but this will remain for backwards compatibility\n      kind: options.kind,\n      kinds: options.kinds,\n      \"default\": false,\n      mode: 'disabled'\n    };\n\n    if (!options.kinds) {\n      options.kinds = [options.kind];\n    }\n\n    if (options.label) {\n      options.track.label = options.label;\n    } else {\n      options.track.label = options.kinds.join(' and ') + ' off';\n    } // MenuItem is selectable\n\n\n    options.selectable = true; // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n\n    options.multiSelectable = false;\n    return _TextTrackMenuItem.call(this, player, options) || this;\n  }\n  /**\n   * Handle text track change\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to run\n   */\n\n\n  var _proto = OffTextTrackMenuItem.prototype;\n\n  _proto.handleTracksChange = function handleTracksChange(event) {\n    var tracks = this.player().textTracks();\n    var shouldBeSelected = true;\n\n    for (var i = 0, l = tracks.length; i < l; i++) {\n      var track = tracks[i];\n\n      if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') {\n        shouldBeSelected = false;\n        break;\n      }\n    } // Prevent redundant selected() calls because they may cause\n    // screen readers to read the appended control text unnecessarily\n\n\n    if (shouldBeSelected !== this.isSelected_) {\n      this.selected(shouldBeSelected);\n    }\n  };\n\n  _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n    var tracks = this.player().textTracks();\n    var allHidden = true;\n\n    for (var i = 0, l = tracks.length; i < l; i++) {\n      var track = tracks[i];\n\n      if (['captions', 'descriptions', 'subtitles'].indexOf(track.kind) > -1 && track.mode === 'showing') {\n        allHidden = false;\n        break;\n      }\n    }\n\n    if (allHidden) {\n      this.player_.cache_.selectedLanguage = {\n        enabled: false\n      };\n    }\n  };\n\n  return OffTextTrackMenuItem;\n}(TextTrackMenuItem);\n\nComponent$1.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @extends MenuButton\n */\n\nvar TextTrackButton = /*#__PURE__*/function (_TrackButton) {\n  _inheritsLoose(TextTrackButton, _TrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function TextTrackButton(player, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    options.tracks = player.textTracks();\n    return _TrackButton.call(this, player, options) || this;\n  }\n  /**\n   * Create a menu item for each text track\n   *\n   * @param {TextTrackMenuItem[]} [items=[]]\n   *        Existing array of items to use during creation\n   *\n   * @return {TextTrackMenuItem[]}\n   *         Array of menu items that were created\n   */\n\n\n  var _proto = TextTrackButton.prototype;\n\n  _proto.createItems = function createItems(items, TrackMenuItem) {\n    if (items === void 0) {\n      items = [];\n    }\n\n    if (TrackMenuItem === void 0) {\n      TrackMenuItem = TextTrackMenuItem;\n    }\n\n    // Label is an override for the [track] off label\n    // USed to localise captions/subtitles\n    var label;\n\n    if (this.label_) {\n      label = this.label_ + \" off\";\n    } // Add an OFF menu item to turn all tracks off\n\n\n    items.push(new OffTextTrackMenuItem(this.player_, {\n      kinds: this.kinds_,\n      kind: this.kind_,\n      label: label\n    }));\n    this.hideThreshold_ += 1;\n    var tracks = this.player_.textTracks();\n\n    if (!Array.isArray(this.kinds_)) {\n      this.kinds_ = [this.kind_];\n    }\n\n    for (var i = 0; i < tracks.length; i++) {\n      var track = tracks[i]; // only add tracks that are of an appropriate kind and have a label\n\n      if (this.kinds_.indexOf(track.kind) > -1) {\n        var item = new TrackMenuItem(this.player_, {\n          track: track,\n          kinds: this.kinds_,\n          kind: this.kind_,\n          // MenuItem is selectable\n          selectable: true,\n          // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n          multiSelectable: false\n        });\n        item.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n        items.push(item);\n      }\n    }\n\n    return items;\n  };\n\n  return TextTrackButton;\n}(TrackButton);\n\nComponent$1.registerComponent('TextTrackButton', TextTrackButton);\n\n/**\n * The chapter track menu item\n *\n * @extends MenuItem\n */\n\nvar ChaptersTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n  _inheritsLoose(ChaptersTrackMenuItem, _MenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function ChaptersTrackMenuItem(player, options) {\n    var _this;\n\n    var track = options.track;\n    var cue = options.cue;\n    var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init.\n\n    options.selectable = true;\n    options.multiSelectable = false;\n    options.label = cue.text;\n    options.selected = cue.startTime <= currentTime && currentTime < cue.endTime;\n    _this = _MenuItem.call(this, player, options) || this;\n    _this.track = track;\n    _this.cue = cue;\n    return _this;\n  }\n  /**\n   * This gets called when an `ChaptersTrackMenuItem` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n\n\n  var _proto = ChaptersTrackMenuItem.prototype;\n\n  _proto.handleClick = function handleClick(event) {\n    _MenuItem.prototype.handleClick.call(this);\n\n    this.player_.currentTime(this.cue.startTime);\n  };\n\n  return ChaptersTrackMenuItem;\n}(MenuItem);\n\nComponent$1.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @extends TextTrackButton\n */\n\nvar ChaptersButton = /*#__PURE__*/function (_TextTrackButton) {\n  _inheritsLoose(ChaptersButton, _TextTrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function to call when this function is ready.\n   */\n  function ChaptersButton(player, options, ready) {\n    var _this;\n\n    _this = _TextTrackButton.call(this, player, options, ready) || this;\n\n    _this.selectCurrentItem_ = function () {\n      _this.items.forEach(function (item) {\n        item.selected(_this.track_.activeCues[0] === item.cue);\n      });\n    };\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = ChaptersButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n  }\n  /**\n   * Update the menu based on the current state of its items.\n   *\n   * @param {EventTarget~Event} [event]\n   *        An event that triggered this function to run.\n   *\n   * @listens TextTrackList#addtrack\n   * @listens TextTrackList#removetrack\n   * @listens TextTrackList#change\n   */\n  ;\n\n  _proto.update = function update(event) {\n    if (event && event.track && event.track.kind !== 'chapters') {\n      return;\n    }\n\n    var track = this.findChaptersTrack();\n\n    if (track !== this.track_) {\n      this.setTrack(track);\n\n      _TextTrackButton.prototype.update.call(this);\n    } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {\n      // Update the menu initially or if the number of cues has changed since set\n      _TextTrackButton.prototype.update.call(this);\n    }\n  }\n  /**\n   * Set the currently selected track for the chapters button.\n   *\n   * @param {TextTrack} track\n   *        The new track to select. Nothing will change if this is the currently selected\n   *        track.\n   */\n  ;\n\n  _proto.setTrack = function setTrack(track) {\n    if (this.track_ === track) {\n      return;\n    }\n\n    if (!this.updateHandler_) {\n      this.updateHandler_ = this.update.bind(this);\n    } // here this.track_ refers to the old track instance\n\n\n    if (this.track_) {\n      var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n      if (remoteTextTrackEl) {\n        remoteTextTrackEl.removeEventListener('load', this.updateHandler_);\n      }\n\n      this.track_.removeEventListener('cuechange', this.selectCurrentItem_);\n      this.track_ = null;\n    }\n\n    this.track_ = track; // here this.track_ refers to the new track instance\n\n    if (this.track_) {\n      this.track_.mode = 'hidden';\n\n      var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n      if (_remoteTextTrackEl) {\n        _remoteTextTrackEl.addEventListener('load', this.updateHandler_);\n      }\n\n      this.track_.addEventListener('cuechange', this.selectCurrentItem_);\n    }\n  }\n  /**\n   * Find the track object that is currently in use by this ChaptersButton\n   *\n   * @return {TextTrack|undefined}\n   *         The current track or undefined if none was found.\n   */\n  ;\n\n  _proto.findChaptersTrack = function findChaptersTrack() {\n    var tracks = this.player_.textTracks() || [];\n\n    for (var i = tracks.length - 1; i >= 0; i--) {\n      // We will always choose the last track as our chaptersTrack\n      var track = tracks[i];\n\n      if (track.kind === this.kind_) {\n        return track;\n      }\n    }\n  }\n  /**\n   * Get the caption for the ChaptersButton based on the track label. This will also\n   * use the current tracks localized kind as a fallback if a label does not exist.\n   *\n   * @return {string}\n   *         The tracks current label or the localized track kind.\n   */\n  ;\n\n  _proto.getMenuCaption = function getMenuCaption() {\n    if (this.track_ && this.track_.label) {\n      return this.track_.label;\n    }\n\n    return this.localize(toTitleCase$1(this.kind_));\n  }\n  /**\n   * Create menu from chapter track\n   *\n   * @return {Menu}\n   *         New menu for the chapter buttons\n   */\n  ;\n\n  _proto.createMenu = function createMenu() {\n    this.options_.title = this.getMenuCaption();\n    return _TextTrackButton.prototype.createMenu.call(this);\n  }\n  /**\n   * Create a menu item for each text track\n   *\n   * @return {TextTrackMenuItem[]}\n   *         Array of menu items\n   */\n  ;\n\n  _proto.createItems = function createItems() {\n    var items = [];\n\n    if (!this.track_) {\n      return items;\n    }\n\n    var cues = this.track_.cues;\n\n    if (!cues) {\n      return items;\n    }\n\n    for (var i = 0, l = cues.length; i < l; i++) {\n      var cue = cues[i];\n      var mi = new ChaptersTrackMenuItem(this.player_, {\n        track: this.track_,\n        cue: cue\n      });\n      items.push(mi);\n    }\n\n    return items;\n  };\n\n  return ChaptersButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nChaptersButton.prototype.kind_ = 'chapters';\n/**\n * The text that should display over the `ChaptersButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nChaptersButton.prototype.controlText_ = 'Chapters';\nComponent$1.registerComponent('ChaptersButton', ChaptersButton);\n\n/**\n * The button component for toggling and selecting descriptions\n *\n * @extends TextTrackButton\n */\n\nvar DescriptionsButton = /*#__PURE__*/function (_TextTrackButton) {\n  _inheritsLoose(DescriptionsButton, _TextTrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function to call when this component is ready.\n   */\n  function DescriptionsButton(player, options, ready) {\n    var _this;\n\n    _this = _TextTrackButton.call(this, player, options, ready) || this;\n    var tracks = player.textTracks();\n    var changeHandler = bind(_assertThisInitialized(_this), _this.handleTracksChange);\n    tracks.addEventListener('change', changeHandler);\n\n    _this.on('dispose', function () {\n      tracks.removeEventListener('change', changeHandler);\n    });\n\n    return _this;\n  }\n  /**\n   * Handle text track change\n   *\n   * @param {EventTarget~Event} event\n   *        The event that caused this function to run\n   *\n   * @listens TextTrackList#change\n   */\n\n\n  var _proto = DescriptionsButton.prototype;\n\n  _proto.handleTracksChange = function handleTracksChange(event) {\n    var tracks = this.player().textTracks();\n    var disabled = false; // Check whether a track of a different kind is showing\n\n    for (var i = 0, l = tracks.length; i < l; i++) {\n      var track = tracks[i];\n\n      if (track.kind !== this.kind_ && track.mode === 'showing') {\n        disabled = true;\n        break;\n      }\n    } // If another track is showing, disable this menu button\n\n\n    if (disabled) {\n      this.disable();\n    } else {\n      this.enable();\n    }\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n  };\n\n  return DescriptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nDescriptionsButton.prototype.kind_ = 'descriptions';\n/**\n * The text that should display over the `DescriptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nDescriptionsButton.prototype.controlText_ = 'Descriptions';\nComponent$1.registerComponent('DescriptionsButton', DescriptionsButton);\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubtitlesButton = /*#__PURE__*/function (_TextTrackButton) {\n  _inheritsLoose(SubtitlesButton, _TextTrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function to call when this component is ready.\n   */\n  function SubtitlesButton(player, options, ready) {\n    return _TextTrackButton.call(this, player, options, ready) || this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = SubtitlesButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n  };\n\n  return SubtitlesButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nSubtitlesButton.prototype.kind_ = 'subtitles';\n/**\n * The text that should display over the `SubtitlesButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nSubtitlesButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubtitlesButton', SubtitlesButton);\n\n/**\n * The menu item for caption track settings menu\n *\n * @extends TextTrackMenuItem\n */\n\nvar CaptionSettingsMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n  _inheritsLoose(CaptionSettingsMenuItem, _TextTrackMenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function CaptionSettingsMenuItem(player, options) {\n    var _this;\n\n    options.track = {\n      player: player,\n      kind: options.kind,\n      label: options.kind + ' settings',\n      selectable: false,\n      \"default\": false,\n      mode: 'disabled'\n    }; // CaptionSettingsMenuItem has no concept of 'selected'\n\n    options.selectable = false;\n    options.name = 'CaptionSettingsMenuItem';\n    _this = _TextTrackMenuItem.call(this, player, options) || this;\n\n    _this.addClass('vjs-texttrack-settings');\n\n    _this.controlText(', opens ' + options.kind + ' settings dialog');\n\n    return _this;\n  }\n  /**\n   * This gets called when an `CaptionSettingsMenuItem` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n\n\n  var _proto = CaptionSettingsMenuItem.prototype;\n\n  _proto.handleClick = function handleClick(event) {\n    this.player().getChild('textTrackSettings').open();\n  };\n\n  return CaptionSettingsMenuItem;\n}(TextTrackMenuItem);\n\nComponent$1.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);\n\n/**\n * The button component for toggling and selecting captions\n *\n * @extends TextTrackButton\n */\n\nvar CaptionsButton = /*#__PURE__*/function (_TextTrackButton) {\n  _inheritsLoose(CaptionsButton, _TextTrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        The function to call when this component is ready.\n   */\n  function CaptionsButton(player, options, ready) {\n    return _TextTrackButton.call(this, player, options, ready) || this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = CaptionsButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-captions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-captions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n  }\n  /**\n   * Create caption menu items\n   *\n   * @return {CaptionSettingsMenuItem[]}\n   *         The array of current menu items.\n   */\n  ;\n\n  _proto.createItems = function createItems() {\n    var items = [];\n\n    if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n      items.push(new CaptionSettingsMenuItem(this.player_, {\n        kind: this.kind_\n      }));\n      this.hideThreshold_ += 1;\n    }\n\n    return _TextTrackButton.prototype.createItems.call(this, items);\n  };\n\n  return CaptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nCaptionsButton.prototype.kind_ = 'captions';\n/**\n * The text that should display over the `CaptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nCaptionsButton.prototype.controlText_ = 'Captions';\nComponent$1.registerComponent('CaptionsButton', CaptionsButton);\n\n/**\n * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles\n * in the SubsCapsMenu.\n *\n * @extends TextTrackMenuItem\n */\n\nvar SubsCapsMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n  _inheritsLoose(SubsCapsMenuItem, _TextTrackMenuItem);\n\n  function SubsCapsMenuItem() {\n    return _TextTrackMenuItem.apply(this, arguments) || this;\n  }\n\n  var _proto = SubsCapsMenuItem.prototype;\n\n  _proto.createEl = function createEl$1(type, props, attrs) {\n    var el = _TextTrackMenuItem.prototype.createEl.call(this, type, props, attrs);\n\n    var parentSpan = el.querySelector('.vjs-menu-item-text');\n\n    if (this.options_.track.kind === 'captions') {\n      parentSpan.appendChild(createEl('span', {\n        className: 'vjs-icon-placeholder'\n      }, {\n        'aria-hidden': true\n      }));\n      parentSpan.appendChild(createEl('span', {\n        className: 'vjs-control-text',\n        // space added as the text will visually flow with the\n        // label\n        textContent: \" \" + this.localize('Captions')\n      }));\n    }\n\n    return el;\n  };\n\n  return SubsCapsMenuItem;\n}(TextTrackMenuItem);\n\nComponent$1.registerComponent('SubsCapsMenuItem', SubsCapsMenuItem);\n\n/**\n * The button component for toggling and selecting captions and/or subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubsCapsButton = /*#__PURE__*/function (_TextTrackButton) {\n  _inheritsLoose(SubsCapsButton, _TextTrackButton);\n\n  function SubsCapsButton(player, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _TextTrackButton.call(this, player, options) || this; // Although North America uses \"captions\" in most cases for\n    // \"captions and subtitles\" other locales use \"subtitles\"\n\n    _this.label_ = 'subtitles';\n\n    if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(_this.player_.language_) > -1) {\n      _this.label_ = 'captions';\n    }\n\n    _this.menuButton_.controlText(toTitleCase$1(_this.label_));\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = SubsCapsButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n  }\n  /**\n   * Create caption/subtitles menu items\n   *\n   * @return {CaptionSettingsMenuItem[]}\n   *         The array of current menu items.\n   */\n  ;\n\n  _proto.createItems = function createItems() {\n    var items = [];\n\n    if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n      items.push(new CaptionSettingsMenuItem(this.player_, {\n        kind: this.label_\n      }));\n      this.hideThreshold_ += 1;\n    }\n\n    items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);\n    return items;\n  };\n\n  return SubsCapsButton;\n}(TextTrackButton);\n/**\n * `kind`s of TextTrack to look for to associate it with this menu.\n *\n * @type {array}\n * @private\n */\n\n\nSubsCapsButton.prototype.kinds_ = ['captions', 'subtitles'];\n/**\n * The text that should display over the `SubsCapsButton`s controls.\n *\n *\n * @type {string}\n * @private\n */\n\nSubsCapsButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubsCapsButton', SubsCapsButton);\n\n/**\n * An {@link AudioTrack} {@link MenuItem}\n *\n * @extends MenuItem\n */\n\nvar AudioTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n  _inheritsLoose(AudioTrackMenuItem, _MenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function AudioTrackMenuItem(player, options) {\n    var _this;\n\n    var track = options.track;\n    var tracks = player.audioTracks(); // Modify options for parent MenuItem class's init.\n\n    options.label = track.label || track.language || 'Unknown';\n    options.selected = track.enabled;\n    _this = _MenuItem.call(this, player, options) || this;\n    _this.track = track;\n\n    _this.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n\n    var changeHandler = function changeHandler() {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this.handleTracksChange.apply(_assertThisInitialized(_this), args);\n    };\n\n    tracks.addEventListener('change', changeHandler);\n\n    _this.on('dispose', function () {\n      tracks.removeEventListener('change', changeHandler);\n    });\n\n    return _this;\n  }\n\n  var _proto = AudioTrackMenuItem.prototype;\n\n  _proto.createEl = function createEl$1(type, props, attrs) {\n    var el = _MenuItem.prototype.createEl.call(this, type, props, attrs);\n\n    var parentSpan = el.querySelector('.vjs-menu-item-text');\n\n    if (this.options_.track.kind === 'main-desc') {\n      parentSpan.appendChild(createEl('span', {\n        className: 'vjs-icon-placeholder'\n      }, {\n        'aria-hidden': true\n      }));\n      parentSpan.appendChild(createEl('span', {\n        className: 'vjs-control-text',\n        textContent: ' ' + this.localize('Descriptions')\n      }));\n    }\n\n    return el;\n  }\n  /**\n   * This gets called when an `AudioTrackMenuItem is \"clicked\". See {@link ClickableComponent}\n   * for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    _MenuItem.prototype.handleClick.call(this, event); // the audio track list will automatically toggle other tracks\n    // off for us.\n\n\n    this.track.enabled = true; // when native audio tracks are used, we want to make sure that other tracks are turned off\n\n    if (this.player_.tech_.featuresNativeAudioTracks) {\n      var tracks = this.player_.audioTracks();\n\n      for (var i = 0; i < tracks.length; i++) {\n        var track = tracks[i]; // skip the current track since we enabled it above\n\n        if (track === this.track) {\n          continue;\n        }\n\n        track.enabled = track === this.track;\n      }\n    }\n  }\n  /**\n   * Handle any {@link AudioTrack} change.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The {@link AudioTrackList#change} event that caused this to run.\n   *\n   * @listens AudioTrackList#change\n   */\n  ;\n\n  _proto.handleTracksChange = function handleTracksChange(event) {\n    this.selected(this.track.enabled);\n  };\n\n  return AudioTrackMenuItem;\n}(MenuItem);\n\nComponent$1.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific {@link AudioTrack} types.\n *\n * @extends TrackButton\n */\n\nvar AudioTrackButton = /*#__PURE__*/function (_TrackButton) {\n  _inheritsLoose(AudioTrackButton, _TrackButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options={}]\n   *        The key/value store of player options.\n   */\n  function AudioTrackButton(player, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    options.tracks = player.audioTracks();\n    return _TrackButton.call(this, player, options) || this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n\n\n  var _proto = AudioTrackButton.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-audio-button \" + _TrackButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-audio-button \" + _TrackButton.prototype.buildWrapperCSSClass.call(this);\n  }\n  /**\n   * Create a menu item for each audio track\n   *\n   * @param {AudioTrackMenuItem[]} [items=[]]\n   *        An array of existing menu items to use.\n   *\n   * @return {AudioTrackMenuItem[]}\n   *         An array of menu items\n   */\n  ;\n\n  _proto.createItems = function createItems(items) {\n    if (items === void 0) {\n      items = [];\n    }\n\n    // if there's only one audio track, there no point in showing it\n    this.hideThreshold_ = 1;\n    var tracks = this.player_.audioTracks();\n\n    for (var i = 0; i < tracks.length; i++) {\n      var track = tracks[i];\n      items.push(new AudioTrackMenuItem(this.player_, {\n        track: track,\n        // MenuItem is selectable\n        selectable: true,\n        // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n        multiSelectable: false\n      }));\n    }\n\n    return items;\n  };\n\n  return AudioTrackButton;\n}(TrackButton);\n/**\n * The text that should display over the `AudioTrackButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nAudioTrackButton.prototype.controlText_ = 'Audio Track';\nComponent$1.registerComponent('AudioTrackButton', AudioTrackButton);\n\n/**\n * The specific menu item type for selecting a playback rate.\n *\n * @extends MenuItem\n */\n\nvar PlaybackRateMenuItem = /*#__PURE__*/function (_MenuItem) {\n  _inheritsLoose(PlaybackRateMenuItem, _MenuItem);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function PlaybackRateMenuItem(player, options) {\n    var _this;\n\n    var label = options.rate;\n    var rate = parseFloat(label, 10); // Modify options for parent MenuItem class's init.\n\n    options.label = label;\n    options.selected = rate === player.playbackRate();\n    options.selectable = true;\n    options.multiSelectable = false;\n    _this = _MenuItem.call(this, player, options) || this;\n    _this.label = label;\n    _this.rate = rate;\n\n    _this.on(player, 'ratechange', function (e) {\n      return _this.update(e);\n    });\n\n    return _this;\n  }\n  /**\n   * This gets called when an `PlaybackRateMenuItem` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n\n\n  var _proto = PlaybackRateMenuItem.prototype;\n\n  _proto.handleClick = function handleClick(event) {\n    _MenuItem.prototype.handleClick.call(this);\n\n    this.player().playbackRate(this.rate);\n  }\n  /**\n   * Update the PlaybackRateMenuItem when the playbackrate changes.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `ratechange` event that caused this function to run.\n   *\n   * @listens Player#ratechange\n   */\n  ;\n\n  _proto.update = function update(event) {\n    this.selected(this.player().playbackRate() === this.rate);\n  };\n\n  return PlaybackRateMenuItem;\n}(MenuItem);\n/**\n * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuItem.prototype.contentElType = 'button';\nComponent$1.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);\n\n/**\n * The component for controlling the playback rate.\n *\n * @extends MenuButton\n */\n\nvar PlaybackRateMenuButton = /*#__PURE__*/function (_MenuButton) {\n  _inheritsLoose(PlaybackRateMenuButton, _MenuButton);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   */\n  function PlaybackRateMenuButton(player, options) {\n    var _this;\n\n    _this = _MenuButton.call(this, player, options) || this;\n\n    _this.menuButton_.el_.setAttribute('aria-describedby', _this.labelElId_);\n\n    _this.updateVisibility();\n\n    _this.updateLabel();\n\n    _this.on(player, 'loadstart', function (e) {\n      return _this.updateVisibility(e);\n    });\n\n    _this.on(player, 'ratechange', function (e) {\n      return _this.updateLabel(e);\n    });\n\n    _this.on(player, 'playbackrateschange', function (e) {\n      return _this.handlePlaybackRateschange(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n\n\n  var _proto = PlaybackRateMenuButton.prototype;\n\n  _proto.createEl = function createEl$1() {\n    var el = _MenuButton.prototype.createEl.call(this);\n\n    this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_;\n    this.labelEl_ = createEl('div', {\n      className: 'vjs-playback-rate-value',\n      id: this.labelElId_,\n      textContent: '1x'\n    });\n    el.appendChild(this.labelEl_);\n    return el;\n  };\n\n  _proto.dispose = function dispose() {\n    this.labelEl_ = null;\n\n    _MenuButton.prototype.dispose.call(this);\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  ;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-playback-rate \" + _MenuButton.prototype.buildCSSClass.call(this);\n  };\n\n  _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n    return \"vjs-playback-rate \" + _MenuButton.prototype.buildWrapperCSSClass.call(this);\n  }\n  /**\n   * Create the list of menu items. Specific to each subclass.\n   *\n   */\n  ;\n\n  _proto.createItems = function createItems() {\n    var rates = this.playbackRates();\n    var items = [];\n\n    for (var i = rates.length - 1; i >= 0; i--) {\n      items.push(new PlaybackRateMenuItem(this.player(), {\n        rate: rates[i] + 'x'\n      }));\n    }\n\n    return items;\n  }\n  /**\n   * Updates ARIA accessibility attributes\n   */\n  ;\n\n  _proto.updateARIAAttributes = function updateARIAAttributes() {\n    // Current playback rate\n    this.el().setAttribute('aria-valuenow', this.player().playbackRate());\n  }\n  /**\n   * This gets called when an `PlaybackRateMenuButton` is \"clicked\". See\n   * {@link ClickableComponent} for more detailed information on what a click can be.\n   *\n   * @param {EventTarget~Event} [event]\n   *        The `keydown`, `tap`, or `click` event that caused this function to be\n   *        called.\n   *\n   * @listens tap\n   * @listens click\n   */\n  ;\n\n  _proto.handleClick = function handleClick(event) {\n    // select next rate option\n    var currentRate = this.player().playbackRate();\n    var rates = this.playbackRates();\n    var currentIndex = rates.indexOf(currentRate); // this get the next rate and it will select first one if the last one currently selected\n\n    var newIndex = (currentIndex + 1) % rates.length;\n    this.player().playbackRate(rates[newIndex]);\n  }\n  /**\n   * On playbackrateschange, update the menu to account for the new items.\n   *\n   * @listens Player#playbackrateschange\n   */\n  ;\n\n  _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event) {\n    this.update();\n  }\n  /**\n   * Get possible playback rates\n   *\n   * @return {Array}\n   *         All possible playback rates\n   */\n  ;\n\n  _proto.playbackRates = function playbackRates() {\n    var player = this.player();\n    return player.playbackRates && player.playbackRates() || [];\n  }\n  /**\n   * Get whether playback rates is supported by the tech\n   * and an array of playback rates exists\n   *\n   * @return {boolean}\n   *         Whether changing playback rate is supported\n   */\n  ;\n\n  _proto.playbackRateSupported = function playbackRateSupported() {\n    return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;\n  }\n  /**\n   * Hide playback rate controls when they're no playback rate options to select\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#loadstart\n   */\n  ;\n\n  _proto.updateVisibility = function updateVisibility(event) {\n    if (this.playbackRateSupported()) {\n      this.removeClass('vjs-hidden');\n    } else {\n      this.addClass('vjs-hidden');\n    }\n  }\n  /**\n   * Update button label when rate changed\n   *\n   * @param {EventTarget~Event} [event]\n   *        The event that caused this function to run.\n   *\n   * @listens Player#ratechange\n   */\n  ;\n\n  _proto.updateLabel = function updateLabel(event) {\n    if (this.playbackRateSupported()) {\n      this.labelEl_.textContent = this.player().playbackRate() + 'x';\n    }\n  };\n\n  return PlaybackRateMenuButton;\n}(MenuButton);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\nComponent$1.registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton);\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n */\n\nvar Spacer = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(Spacer, _Component);\n\n  function Spacer() {\n    return _Component.apply(this, arguments) || this;\n  }\n\n  var _proto = Spacer.prototype;\n\n  /**\n  * Builds the default DOM `className`.\n  *\n  * @return {string}\n  *         The DOM `className` for this object.\n  */\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-spacer \" + _Component.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl(tag, props, attributes) {\n    if (tag === void 0) {\n      tag = 'div';\n    }\n\n    if (props === void 0) {\n      props = {};\n    }\n\n    if (attributes === void 0) {\n      attributes = {};\n    }\n\n    if (!props.className) {\n      props.className = this.buildCSSClass();\n    }\n\n    return _Component.prototype.createEl.call(this, tag, props, attributes);\n  };\n\n  return Spacer;\n}(Component$1);\n\nComponent$1.registerComponent('Spacer', Spacer);\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n */\n\nvar CustomControlSpacer = /*#__PURE__*/function (_Spacer) {\n  _inheritsLoose(CustomControlSpacer, _Spacer);\n\n  function CustomControlSpacer() {\n    return _Spacer.apply(this, arguments) || this;\n  }\n\n  var _proto = CustomControlSpacer.prototype;\n\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   */\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-custom-control-spacer \" + _Spacer.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    return _Spacer.prototype.createEl.call(this, 'div', {\n      className: this.buildCSSClass(),\n      // No-flex/table-cell mode requires there be some content\n      // in the cell to fill the remaining space of the table.\n      textContent: \"\\xA0\"\n    });\n  };\n\n  return CustomControlSpacer;\n}(Spacer);\n\nComponent$1.registerComponent('CustomControlSpacer', CustomControlSpacer);\n\n/**\n * Container of main controls.\n *\n * @extends Component\n */\n\nvar ControlBar = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(ControlBar, _Component);\n\n  function ControlBar() {\n    return _Component.apply(this, arguments) || this;\n  }\n\n  var _proto = ControlBar.prototype;\n\n  /**\n   * Create the `Component`'s DOM element\n   *\n   * @return {Element}\n   *         The element that was created.\n   */\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'div', {\n      className: 'vjs-control-bar',\n      dir: 'ltr'\n    });\n  };\n\n  return ControlBar;\n}(Component$1);\n/**\n * Default options for `ControlBar`\n *\n * @type {Object}\n * @private\n */\n\n\nControlBar.prototype.options_ = {\n  children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'seekToLive', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'fullscreenToggle']\n};\n\nif ('exitPictureInPicture' in document) {\n  ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length - 1, 0, 'pictureInPictureToggle');\n}\n\nComponent$1.registerComponent('ControlBar', ControlBar);\n\n/**\n * A display that indicates an error has occurred. This means that the video\n * is unplayable.\n *\n * @extends ModalDialog\n */\n\nvar ErrorDisplay = /*#__PURE__*/function (_ModalDialog) {\n  _inheritsLoose(ErrorDisplay, _ModalDialog);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param  {Player} player\n   *         The `Player` that this class should be attached to.\n   *\n   * @param  {Object} [options]\n   *         The key/value store of player options.\n   */\n  function ErrorDisplay(player, options) {\n    var _this;\n\n    _this = _ModalDialog.call(this, player, options) || this;\n\n    _this.on(player, 'error', function (e) {\n      return _this.open(e);\n    });\n\n    return _this;\n  }\n  /**\n   * Builds the default DOM `className`.\n   *\n   * @return {string}\n   *         The DOM `className` for this object.\n   *\n   * @deprecated Since version 5.\n   */\n\n\n  var _proto = ErrorDisplay.prototype;\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return \"vjs-error-display \" + _ModalDialog.prototype.buildCSSClass.call(this);\n  }\n  /**\n   * Gets the localized error message based on the `Player`s error.\n   *\n   * @return {string}\n   *         The `Player`s error message localized or an empty string.\n   */\n  ;\n\n  _proto.content = function content() {\n    var error = this.player().error();\n    return error ? this.localize(error.message) : '';\n  };\n\n  return ErrorDisplay;\n}(ModalDialog);\n/**\n * The default options for an `ErrorDisplay`.\n *\n * @private\n */\n\n\nErrorDisplay.prototype.options_ = _extends({}, ModalDialog.prototype.options_, {\n  pauseOnOpen: false,\n  fillAlways: true,\n  temporary: false,\n  uncloseable: true\n});\nComponent$1.registerComponent('ErrorDisplay', ErrorDisplay);\n\nvar LOCAL_STORAGE_KEY$1 = 'vjs-text-track-settings';\nvar COLOR_BLACK = ['#000', 'Black'];\nvar COLOR_BLUE = ['#00F', 'Blue'];\nvar COLOR_CYAN = ['#0FF', 'Cyan'];\nvar COLOR_GREEN = ['#0F0', 'Green'];\nvar COLOR_MAGENTA = ['#F0F', 'Magenta'];\nvar COLOR_RED = ['#F00', 'Red'];\nvar COLOR_WHITE = ['#FFF', 'White'];\nvar COLOR_YELLOW = ['#FF0', 'Yellow'];\nvar OPACITY_OPAQUE = ['1', 'Opaque'];\nvar OPACITY_SEMI = ['0.5', 'Semi-Transparent'];\nvar OPACITY_TRANS = ['0', 'Transparent']; // Configuration for the various <select> elements in the DOM of this component.\n//\n// Possible keys include:\n//\n// `default`:\n//   The default option index. Only needs to be provided if not zero.\n// `parser`:\n//   A function which is used to parse the value from the selected option in\n//   a customized way.\n// `selector`:\n//   The selector used to find the associated <select> element.\n\nvar selectConfigs = {\n  backgroundColor: {\n    selector: '.vjs-bg-color > select',\n    id: 'captions-background-color-%s',\n    label: 'Color',\n    options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n  },\n  backgroundOpacity: {\n    selector: '.vjs-bg-opacity > select',\n    id: 'captions-background-opacity-%s',\n    label: 'Transparency',\n    options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]\n  },\n  color: {\n    selector: '.vjs-fg-color > select',\n    id: 'captions-foreground-color-%s',\n    label: 'Color',\n    options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n  },\n  edgeStyle: {\n    selector: '.vjs-edge-style > select',\n    id: '%s',\n    label: 'Text Edge Style',\n    options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Dropshadow']]\n  },\n  fontFamily: {\n    selector: '.vjs-font-family > select',\n    id: 'captions-font-family-%s',\n    label: 'Font Family',\n    options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]\n  },\n  fontPercent: {\n    selector: '.vjs-font-percent > select',\n    id: 'captions-font-size-%s',\n    label: 'Font Size',\n    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%']],\n    \"default\": 2,\n    parser: function parser(v) {\n      return v === '1.00' ? null : Number(v);\n    }\n  },\n  textOpacity: {\n    selector: '.vjs-text-opacity > select',\n    id: 'captions-foreground-opacity-%s',\n    label: 'Transparency',\n    options: [OPACITY_OPAQUE, OPACITY_SEMI]\n  },\n  // Options for this object are defined below.\n  windowColor: {\n    selector: '.vjs-window-color > select',\n    id: 'captions-window-color-%s',\n    label: 'Color'\n  },\n  // Options for this object are defined below.\n  windowOpacity: {\n    selector: '.vjs-window-opacity > select',\n    id: 'captions-window-opacity-%s',\n    label: 'Transparency',\n    options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]\n  }\n};\nselectConfigs.windowColor.options = selectConfigs.backgroundColor.options;\n/**\n * Get the actual value of an option.\n *\n * @param  {string} value\n *         The value to get\n *\n * @param  {Function} [parser]\n *         Optional function to adjust the value.\n *\n * @return {Mixed}\n *         - Will be `undefined` if no value exists\n *         - Will be `undefined` if the given value is \"none\".\n *         - Will be the actual value otherwise.\n *\n * @private\n */\n\nfunction parseOptionValue(value, parser) {\n  if (parser) {\n    value = parser(value);\n  }\n\n  if (value && value !== 'none') {\n    return value;\n  }\n}\n/**\n * Gets the value of the selected <option> element within a <select> element.\n *\n * @param  {Element} el\n *         the element to look in\n *\n * @param  {Function} [parser]\n *         Optional function to adjust the value.\n *\n * @return {Mixed}\n *         - Will be `undefined` if no value exists\n *         - Will be `undefined` if the given value is \"none\".\n *         - Will be the actual value otherwise.\n *\n * @private\n */\n\n\nfunction getSelectedOptionValue(el, parser) {\n  var value = el.options[el.options.selectedIndex].value;\n  return parseOptionValue(value, parser);\n}\n/**\n * Sets the selected <option> element within a <select> element based on a\n * given value.\n *\n * @param {Element} el\n *        The element to look in.\n *\n * @param {string} value\n *        the property to look on.\n *\n * @param {Function} [parser]\n *        Optional function to adjust the value before comparing.\n *\n * @private\n */\n\n\nfunction setSelectedOption(el, value, parser) {\n  if (!value) {\n    return;\n  }\n\n  for (var i = 0; i < el.options.length; i++) {\n    if (parseOptionValue(el.options[i].value, parser) === value) {\n      el.selectedIndex = i;\n      break;\n    }\n  }\n}\n/**\n * Manipulate Text Tracks settings.\n *\n * @extends ModalDialog\n */\n\n\nvar TextTrackSettings = /*#__PURE__*/function (_ModalDialog) {\n  _inheritsLoose(TextTrackSettings, _ModalDialog);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *         The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *         The key/value store of player options.\n   */\n  function TextTrackSettings(player, options) {\n    var _this;\n\n    options.temporary = false;\n    _this = _ModalDialog.call(this, player, options) || this;\n    _this.updateDisplay = _this.updateDisplay.bind(_assertThisInitialized(_this)); // fill the modal and pretend we have opened it\n\n    _this.fill();\n\n    _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;\n    _this.endDialog = createEl('p', {\n      className: 'vjs-control-text',\n      textContent: _this.localize('End of dialog window.')\n    });\n\n    _this.el().appendChild(_this.endDialog);\n\n    _this.setDefaults(); // Grab `persistTextTrackSettings` from the player options if not passed in child options\n\n\n    if (options.persistTextTrackSettings === undefined) {\n      _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;\n    }\n\n    _this.on(_this.$('.vjs-done-button'), 'click', function () {\n      _this.saveSettings();\n\n      _this.close();\n    });\n\n    _this.on(_this.$('.vjs-default-button'), 'click', function () {\n      _this.setDefaults();\n\n      _this.updateDisplay();\n    });\n\n    each(selectConfigs, function (config) {\n      _this.on(_this.$(config.selector), 'change', _this.updateDisplay);\n    });\n\n    if (_this.options_.persistTextTrackSettings) {\n      _this.restoreSettings();\n    }\n\n    return _this;\n  }\n\n  var _proto = TextTrackSettings.prototype;\n\n  _proto.dispose = function dispose() {\n    this.endDialog = null;\n\n    _ModalDialog.prototype.dispose.call(this);\n  }\n  /**\n   * Create a <select> element with configured options.\n   *\n   * @param {string} key\n   *        Configuration key to use during creation.\n   *\n   * @return {string}\n   *         An HTML string.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElSelect_ = function createElSelect_(key, legendId, type) {\n    var _this2 = this;\n\n    if (legendId === void 0) {\n      legendId = '';\n    }\n\n    if (type === void 0) {\n      type = 'label';\n    }\n\n    var config = selectConfigs[key];\n    var id = config.id.replace('%s', this.id_);\n    var selectLabelledbyIds = [legendId, id].join(' ').trim();\n    return [\"<\" + type + \" id=\\\"\" + id + \"\\\" class=\\\"\" + (type === 'label' ? 'vjs-label' : '') + \"\\\">\", this.localize(config.label), \"</\" + type + \">\", \"<select aria-labelledby=\\\"\" + selectLabelledbyIds + \"\\\">\"].concat(config.options.map(function (o) {\n      var optionId = id + '-' + o[1].replace(/\\W+/g, '');\n      return [\"<option id=\\\"\" + optionId + \"\\\" value=\\\"\" + o[0] + \"\\\" \", \"aria-labelledby=\\\"\" + selectLabelledbyIds + \" \" + optionId + \"\\\">\", _this2.localize(o[1]), '</option>'].join('');\n    })).concat('</select>').join('');\n  }\n  /**\n   * Create foreground color element for the component\n   *\n   * @return {string}\n   *         An HTML string.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElFgColor_ = function createElFgColor_() {\n    var legendId = \"captions-text-legend-\" + this.id_;\n    return ['<fieldset class=\"vjs-fg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Text'), '</legend>', this.createElSelect_('color', legendId), '<span class=\"vjs-text-opacity vjs-opacity\">', this.createElSelect_('textOpacity', legendId), '</span>', '</fieldset>'].join('');\n  }\n  /**\n   * Create background color element for the component\n   *\n   * @return {string}\n   *         An HTML string.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElBgColor_ = function createElBgColor_() {\n    var legendId = \"captions-background-\" + this.id_;\n    return ['<fieldset class=\"vjs-bg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Background'), '</legend>', this.createElSelect_('backgroundColor', legendId), '<span class=\"vjs-bg-opacity vjs-opacity\">', this.createElSelect_('backgroundOpacity', legendId), '</span>', '</fieldset>'].join('');\n  }\n  /**\n   * Create window color element for the component\n   *\n   * @return {string}\n   *         An HTML string.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElWinColor_ = function createElWinColor_() {\n    var legendId = \"captions-window-\" + this.id_;\n    return ['<fieldset class=\"vjs-window-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Window'), '</legend>', this.createElSelect_('windowColor', legendId), '<span class=\"vjs-window-opacity vjs-opacity\">', this.createElSelect_('windowOpacity', legendId), '</span>', '</fieldset>'].join('');\n  }\n  /**\n   * Create color elements for the component\n   *\n   * @return {Element}\n   *         The element that was created\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElColors_ = function createElColors_() {\n    return createEl('div', {\n      className: 'vjs-track-settings-colors',\n      innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('')\n    });\n  }\n  /**\n   * Create font elements for the component\n   *\n   * @return {Element}\n   *         The element that was created.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElFont_ = function createElFont_() {\n    return createEl('div', {\n      className: 'vjs-track-settings-font',\n      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('')\n    });\n  }\n  /**\n   * Create controls for the component\n   *\n   * @return {Element}\n   *         The element that was created.\n   *\n   * @private\n   */\n  ;\n\n  _proto.createElControls_ = function createElControls_() {\n    var defaultsDescription = this.localize('restore all settings to the default values');\n    return createEl('div', {\n      className: 'vjs-track-settings-controls',\n      innerHTML: [\"<button type=\\\"button\\\" class=\\\"vjs-default-button\\\" title=\\\"\" + defaultsDescription + \"\\\">\", this.localize('Reset'), \"<span class=\\\"vjs-control-text\\\"> \" + defaultsDescription + \"</span>\", '</button>', \"<button type=\\\"button\\\" class=\\\"vjs-done-button\\\">\" + this.localize('Done') + \"</button>\"].join('')\n    });\n  };\n\n  _proto.content = function content() {\n    return [this.createElColors_(), this.createElFont_(), this.createElControls_()];\n  };\n\n  _proto.label = function label() {\n    return this.localize('Caption Settings Dialog');\n  };\n\n  _proto.description = function description() {\n    return this.localize('Beginning of dialog window. Escape will cancel and close the window.');\n  };\n\n  _proto.buildCSSClass = function buildCSSClass() {\n    return _ModalDialog.prototype.buildCSSClass.call(this) + ' vjs-text-track-settings';\n  }\n  /**\n   * Gets an object of text track settings (or null).\n   *\n   * @return {Object}\n   *         An object with config values parsed from the DOM or localStorage.\n   */\n  ;\n\n  _proto.getValues = function getValues() {\n    var _this3 = this;\n\n    return reduce(selectConfigs, function (accum, config, key) {\n      var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);\n\n      if (value !== undefined) {\n        accum[key] = value;\n      }\n\n      return accum;\n    }, {});\n  }\n  /**\n   * Sets text track settings from an object of values.\n   *\n   * @param {Object} values\n   *        An object with config values parsed from the DOM or localStorage.\n   */\n  ;\n\n  _proto.setValues = function setValues(values) {\n    var _this4 = this;\n\n    each(selectConfigs, function (config, key) {\n      setSelectedOption(_this4.$(config.selector), values[key], config.parser);\n    });\n  }\n  /**\n   * Sets all `<select>` elements to their default values.\n   */\n  ;\n\n  _proto.setDefaults = function setDefaults() {\n    var _this5 = this;\n\n    each(selectConfigs, function (config) {\n      var index = config.hasOwnProperty('default') ? config[\"default\"] : 0;\n      _this5.$(config.selector).selectedIndex = index;\n    });\n  }\n  /**\n   * Restore texttrack settings from localStorage\n   */\n  ;\n\n  _proto.restoreSettings = function restoreSettings() {\n    var values;\n\n    try {\n      values = JSON.parse(window$1.localStorage.getItem(LOCAL_STORAGE_KEY$1));\n    } catch (err) {\n      log$1.warn(err);\n    }\n\n    if (values) {\n      this.setValues(values);\n    }\n  }\n  /**\n   * Save text track settings to localStorage\n   */\n  ;\n\n  _proto.saveSettings = function saveSettings() {\n    if (!this.options_.persistTextTrackSettings) {\n      return;\n    }\n\n    var values = this.getValues();\n\n    try {\n      if (Object.keys(values).length) {\n        window$1.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values));\n      } else {\n        window$1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);\n      }\n    } catch (err) {\n      log$1.warn(err);\n    }\n  }\n  /**\n   * Update display of text track settings\n   */\n  ;\n\n  _proto.updateDisplay = function updateDisplay() {\n    var ttDisplay = this.player_.getChild('textTrackDisplay');\n\n    if (ttDisplay) {\n      ttDisplay.updateDisplay();\n    }\n  }\n  /**\n   * conditionally blur the element and refocus the captions button\n   *\n   * @private\n   */\n  ;\n\n  _proto.conditionalBlur_ = function conditionalBlur_() {\n    this.previouslyActiveEl_ = null;\n    var cb = this.player_.controlBar;\n    var subsCapsBtn = cb && cb.subsCapsButton;\n    var ccBtn = cb && cb.captionsButton;\n\n    if (subsCapsBtn) {\n      subsCapsBtn.focus();\n    } else if (ccBtn) {\n      ccBtn.focus();\n    }\n  };\n\n  return TextTrackSettings;\n}(ModalDialog);\n\nComponent$1.registerComponent('TextTrackSettings', TextTrackSettings);\n\n/**\n * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.\n *\n * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.\n *\n * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.\n * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.\n * @example <caption>How to disable the resize manager</caption>\n * const player = videojs('#vid', {\n *   resizeManager: false\n * });\n *\n * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}\n *\n * @extends Component\n */\n\nvar ResizeManager = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(ResizeManager, _Component);\n\n  /**\n   * Create the ResizeManager.\n   *\n   * @param {Object} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of ResizeManager options.\n   *\n   * @param {Object} [options.ResizeObserver]\n   *        A polyfill for ResizeObserver can be passed in here.\n   *        If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.\n   */\n  function ResizeManager(player, options) {\n    var _this;\n\n    var RESIZE_OBSERVER_AVAILABLE = options.ResizeObserver || window$1.ResizeObserver; // if `null` was passed, we want to disable the ResizeObserver\n\n    if (options.ResizeObserver === null) {\n      RESIZE_OBSERVER_AVAILABLE = false;\n    } // Only create an element when ResizeObserver isn't available\n\n\n    var options_ = mergeOptions$3({\n      createEl: !RESIZE_OBSERVER_AVAILABLE,\n      reportTouchActivity: false\n    }, options);\n    _this = _Component.call(this, player, options_) || this;\n    _this.ResizeObserver = options.ResizeObserver || window$1.ResizeObserver;\n    _this.loadListener_ = null;\n    _this.resizeObserver_ = null;\n    _this.debouncedHandler_ = debounce(function () {\n      _this.resizeHandler();\n    }, 100, false, _assertThisInitialized(_this));\n\n    if (RESIZE_OBSERVER_AVAILABLE) {\n      _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);\n\n      _this.resizeObserver_.observe(player.el());\n    } else {\n      _this.loadListener_ = function () {\n        if (!_this.el_ || !_this.el_.contentWindow) {\n          return;\n        }\n\n        var debouncedHandler_ = _this.debouncedHandler_;\n\n        var unloadListener_ = _this.unloadListener_ = function () {\n          off(this, 'resize', debouncedHandler_);\n          off(this, 'unload', unloadListener_);\n          unloadListener_ = null;\n        }; // safari and edge can unload the iframe before resizemanager dispose\n        // we have to dispose of event handlers correctly before that happens\n\n\n        on(_this.el_.contentWindow, 'unload', unloadListener_);\n        on(_this.el_.contentWindow, 'resize', debouncedHandler_);\n      };\n\n      _this.one('load', _this.loadListener_);\n    }\n\n    return _this;\n  }\n\n  var _proto = ResizeManager.prototype;\n\n  _proto.createEl = function createEl() {\n    return _Component.prototype.createEl.call(this, 'iframe', {\n      className: 'vjs-resize-manager',\n      tabIndex: -1,\n      title: this.localize('No content')\n    }, {\n      'aria-hidden': 'true'\n    });\n  }\n  /**\n   * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver\n   *\n   * @fires Player#playerresize\n   */\n  ;\n\n  _proto.resizeHandler = function resizeHandler() {\n    /**\n     * Called when the player size has changed\n     *\n     * @event Player#playerresize\n     * @type {EventTarget~Event}\n     */\n    // make sure player is still around to trigger\n    // prevents this from causing an error after dispose\n    if (!this.player_ || !this.player_.trigger) {\n      return;\n    }\n\n    this.player_.trigger('playerresize');\n  };\n\n  _proto.dispose = function dispose() {\n    if (this.debouncedHandler_) {\n      this.debouncedHandler_.cancel();\n    }\n\n    if (this.resizeObserver_) {\n      if (this.player_.el()) {\n        this.resizeObserver_.unobserve(this.player_.el());\n      }\n\n      this.resizeObserver_.disconnect();\n    }\n\n    if (this.loadListener_) {\n      this.off('load', this.loadListener_);\n    }\n\n    if (this.el_ && this.el_.contentWindow && this.unloadListener_) {\n      this.unloadListener_.call(this.el_.contentWindow);\n    }\n\n    this.ResizeObserver = null;\n    this.resizeObserver = null;\n    this.debouncedHandler_ = null;\n    this.loadListener_ = null;\n\n    _Component.prototype.dispose.call(this);\n  };\n\n  return ResizeManager;\n}(Component$1);\n\nComponent$1.registerComponent('ResizeManager', ResizeManager);\n\nvar defaults = {\n  trackingThreshold: 20,\n  liveTolerance: 15\n};\n/*\n  track when we are at the live edge, and other helpers for live playback */\n\n/**\n * A class for checking live current time and determining when the player\n * is at or behind the live edge.\n */\n\nvar LiveTracker = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(LiveTracker, _Component);\n\n  /**\n   * Creates an instance of this class.\n   *\n   * @param {Player} player\n   *        The `Player` that this class should be attached to.\n   *\n   * @param {Object} [options]\n   *        The key/value store of player options.\n   *\n   * @param {number} [options.trackingThreshold=20]\n   *        Number of seconds of live window (seekableEnd - seekableStart) that\n   *        media needs to have before the liveui will be shown.\n   *\n   * @param {number} [options.liveTolerance=15]\n   *        Number of seconds behind live that we have to be\n   *        before we will be considered non-live. Note that this will only\n   *        be used when playing at the live edge. This allows large seekable end\n   *        changes to not effect wether we are live or not.\n   */\n  function LiveTracker(player, options) {\n    var _this;\n\n    // LiveTracker does not need an element\n    var options_ = mergeOptions$3(defaults, options, {\n      createEl: false\n    });\n    _this = _Component.call(this, player, options_) || this;\n\n    _this.handleVisibilityChange_ = function (e) {\n      return _this.handleVisibilityChange(e);\n    };\n\n    _this.trackLiveHandler_ = function () {\n      return _this.trackLive_();\n    };\n\n    _this.handlePlay_ = function (e) {\n      return _this.handlePlay(e);\n    };\n\n    _this.handleFirstTimeupdate_ = function (e) {\n      return _this.handleFirstTimeupdate(e);\n    };\n\n    _this.handleSeeked_ = function (e) {\n      return _this.handleSeeked(e);\n    };\n\n    _this.seekToLiveEdge_ = function (e) {\n      return _this.seekToLiveEdge(e);\n    };\n\n    _this.reset_();\n\n    _this.on(_this.player_, 'durationchange', function (e) {\n      return _this.handleDurationchange(e);\n    }); // we should try to toggle tracking on canplay as native playback engines, like Safari\n    // may not have the proper values for things like seekableEnd until then\n\n\n    _this.on(_this.player_, 'canplay', function () {\n      return _this.toggleTracking();\n    }); // we don't need to track live playback if the document is hidden,\n    // also, tracking when the document is hidden can\n    // cause the CPU to spike and eventually crash the page on IE11.\n\n\n    if (IE_VERSION && 'hidden' in document && 'visibilityState' in document) {\n      _this.on(document, 'visibilitychange', _this.handleVisibilityChange_);\n    }\n\n    return _this;\n  }\n  /**\n   * toggle tracking based on document visiblility\n   */\n\n\n  var _proto = LiveTracker.prototype;\n\n  _proto.handleVisibilityChange = function handleVisibilityChange() {\n    if (this.player_.duration() !== Infinity) {\n      return;\n    }\n\n    if (document.hidden) {\n      this.stopTracking();\n    } else {\n      this.startTracking();\n    }\n  }\n  /**\n   * all the functionality for tracking when seek end changes\n   * and for tracking how far past seek end we should be\n   */\n  ;\n\n  _proto.trackLive_ = function trackLive_() {\n    var seekable = this.player_.seekable(); // skip undefined seekable\n\n    if (!seekable || !seekable.length) {\n      return;\n    }\n\n    var newTime = Number(window$1.performance.now().toFixed(4));\n    var deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1000;\n    this.lastTime_ = newTime;\n    this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;\n    var liveCurrentTime = this.liveCurrentTime();\n    var currentTime = this.player_.currentTime(); // we are behind live if any are true\n    // 1. the player is paused\n    // 2. the user seeked to a location 2 seconds away from live\n    // 3. the difference between live and current time is greater\n    //    liveTolerance which defaults to 15s\n\n    var isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance; // we cannot be behind if\n    // 1. until we have not seen a timeupdate yet\n    // 2. liveCurrentTime is Infinity, which happens on Android and Native Safari\n\n    if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {\n      isBehind = false;\n    }\n\n    if (isBehind !== this.behindLiveEdge_) {\n      this.behindLiveEdge_ = isBehind;\n      this.trigger('liveedgechange');\n    }\n  }\n  /**\n   * handle a durationchange event on the player\n   * and start/stop tracking accordingly.\n   */\n  ;\n\n  _proto.handleDurationchange = function handleDurationchange() {\n    this.toggleTracking();\n  }\n  /**\n   * start/stop tracking\n   */\n  ;\n\n  _proto.toggleTracking = function toggleTracking() {\n    if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {\n      if (this.player_.options_.liveui) {\n        this.player_.addClass('vjs-liveui');\n      }\n\n      this.startTracking();\n    } else {\n      this.player_.removeClass('vjs-liveui');\n      this.stopTracking();\n    }\n  }\n  /**\n   * start tracking live playback\n   */\n  ;\n\n  _proto.startTracking = function startTracking() {\n    if (this.isTracking()) {\n      return;\n    } // If we haven't seen a timeupdate, we need to check whether playback\n    // began before this component started tracking. This can happen commonly\n    // when using autoplay.\n\n\n    if (!this.timeupdateSeen_) {\n      this.timeupdateSeen_ = this.player_.hasStarted();\n    }\n\n    this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);\n    this.trackLive_();\n    this.on(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n\n    if (!this.timeupdateSeen_) {\n      this.one(this.player_, 'play', this.handlePlay_);\n      this.one(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n    } else {\n      this.on(this.player_, 'seeked', this.handleSeeked_);\n    }\n  }\n  /**\n   * handle the first timeupdate on the player if it wasn't already playing\n   * when live tracker started tracking.\n   */\n  ;\n\n  _proto.handleFirstTimeupdate = function handleFirstTimeupdate() {\n    this.timeupdateSeen_ = true;\n    this.on(this.player_, 'seeked', this.handleSeeked_);\n  }\n  /**\n   * Keep track of what time a seek starts, and listen for seeked\n   * to find where a seek ends.\n   */\n  ;\n\n  _proto.handleSeeked = function handleSeeked() {\n    var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());\n    this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;\n    this.nextSeekedFromUser_ = false;\n    this.trackLive_();\n  }\n  /**\n   * handle the first play on the player, and make sure that we seek\n   * right to the live edge.\n   */\n  ;\n\n  _proto.handlePlay = function handlePlay() {\n    this.one(this.player_, 'timeupdate', this.seekToLiveEdge_);\n  }\n  /**\n   * Stop tracking, and set all internal variables to\n   * their initial value.\n   */\n  ;\n\n  _proto.reset_ = function reset_() {\n    this.lastTime_ = -1;\n    this.pastSeekEnd_ = 0;\n    this.lastSeekEnd_ = -1;\n    this.behindLiveEdge_ = true;\n    this.timeupdateSeen_ = false;\n    this.seekedBehindLive_ = false;\n    this.nextSeekedFromUser_ = false;\n    this.clearInterval(this.trackingInterval_);\n    this.trackingInterval_ = null;\n    this.off(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n    this.off(this.player_, 'seeked', this.handleSeeked_);\n    this.off(this.player_, 'play', this.handlePlay_);\n    this.off(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n    this.off(this.player_, 'timeupdate', this.seekToLiveEdge_);\n  }\n  /**\n   * The next seeked event is from the user. Meaning that any seek\n   * > 2s behind live will be considered behind live for real and\n   * liveTolerance will be ignored.\n   */\n  ;\n\n  _proto.nextSeekedFromUser = function nextSeekedFromUser() {\n    this.nextSeekedFromUser_ = true;\n  }\n  /**\n   * stop tracking live playback\n   */\n  ;\n\n  _proto.stopTracking = function stopTracking() {\n    if (!this.isTracking()) {\n      return;\n    }\n\n    this.reset_();\n    this.trigger('liveedgechange');\n  }\n  /**\n   * A helper to get the player seekable end\n   * so that we don't have to null check everywhere\n   *\n   * @return {number}\n   *         The furthest seekable end or Infinity.\n   */\n  ;\n\n  _proto.seekableEnd = function seekableEnd() {\n    var seekable = this.player_.seekable();\n    var seekableEnds = [];\n    var i = seekable ? seekable.length : 0;\n\n    while (i--) {\n      seekableEnds.push(seekable.end(i));\n    } // grab the furthest seekable end after sorting, or if there are none\n    // default to Infinity\n\n\n    return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;\n  }\n  /**\n   * A helper to get the player seekable start\n   * so that we don't have to null check everywhere\n   *\n   * @return {number}\n   *         The earliest seekable start or 0.\n   */\n  ;\n\n  _proto.seekableStart = function seekableStart() {\n    var seekable = this.player_.seekable();\n    var seekableStarts = [];\n    var i = seekable ? seekable.length : 0;\n\n    while (i--) {\n      seekableStarts.push(seekable.start(i));\n    } // grab the first seekable start after sorting, or if there are none\n    // default to 0\n\n\n    return seekableStarts.length ? seekableStarts.sort()[0] : 0;\n  }\n  /**\n   * Get the live time window aka\n   * the amount of time between seekable start and\n   * live current time.\n   *\n   * @return {number}\n   *         The amount of seconds that are seekable in\n   *         the live video.\n   */\n  ;\n\n  _proto.liveWindow = function liveWindow() {\n    var liveCurrentTime = this.liveCurrentTime(); // if liveCurrenTime is Infinity then we don't have a liveWindow at all\n\n    if (liveCurrentTime === Infinity) {\n      return 0;\n    }\n\n    return liveCurrentTime - this.seekableStart();\n  }\n  /**\n   * Determines if the player is live, only checks if this component\n   * is tracking live playback or not\n   *\n   * @return {boolean}\n   *         Wether liveTracker is tracking\n   */\n  ;\n\n  _proto.isLive = function isLive() {\n    return this.isTracking();\n  }\n  /**\n   * Determines if currentTime is at the live edge and won't fall behind\n   * on each seekableendchange\n   *\n   * @return {boolean}\n   *         Wether playback is at the live edge\n   */\n  ;\n\n  _proto.atLiveEdge = function atLiveEdge() {\n    return !this.behindLiveEdge();\n  }\n  /**\n   * get what we expect the live current time to be\n   *\n   * @return {number}\n   *         The expected live current time\n   */\n  ;\n\n  _proto.liveCurrentTime = function liveCurrentTime() {\n    return this.pastSeekEnd() + this.seekableEnd();\n  }\n  /**\n   * The number of seconds that have occured after seekable end\n   * changed. This will be reset to 0 once seekable end changes.\n   *\n   * @return {number}\n   *         Seconds past the current seekable end\n   */\n  ;\n\n  _proto.pastSeekEnd = function pastSeekEnd() {\n    var seekableEnd = this.seekableEnd();\n\n    if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {\n      this.pastSeekEnd_ = 0;\n    }\n\n    this.lastSeekEnd_ = seekableEnd;\n    return this.pastSeekEnd_;\n  }\n  /**\n   * If we are currently behind the live edge, aka currentTime will be\n   * behind on a seekableendchange\n   *\n   * @return {boolean}\n   *         If we are behind the live edge\n   */\n  ;\n\n  _proto.behindLiveEdge = function behindLiveEdge() {\n    return this.behindLiveEdge_;\n  }\n  /**\n   * Wether live tracker is currently tracking or not.\n   */\n  ;\n\n  _proto.isTracking = function isTracking() {\n    return typeof this.trackingInterval_ === 'number';\n  }\n  /**\n   * Seek to the live edge if we are behind the live edge\n   */\n  ;\n\n  _proto.seekToLiveEdge = function seekToLiveEdge() {\n    this.seekedBehindLive_ = false;\n\n    if (this.atLiveEdge()) {\n      return;\n    }\n\n    this.nextSeekedFromUser_ = false;\n    this.player_.currentTime(this.liveCurrentTime());\n  }\n  /**\n   * Dispose of liveTracker\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.off(document, 'visibilitychange', this.handleVisibilityChange_);\n    this.stopTracking();\n\n    _Component.prototype.dispose.call(this);\n  };\n\n  return LiveTracker;\n}(Component$1);\n\nComponent$1.registerComponent('LiveTracker', LiveTracker);\n\n/**\n * This function is used to fire a sourceset when there is something\n * similar to `mediaEl.load()` being called. It will try to find the source via\n * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`\n * with the source that was found or empty string if we cannot know. If it cannot\n * find a source then `sourceset` will not be fired.\n *\n * @param {Html5} tech\n *        The tech object that sourceset was setup on\n *\n * @return {boolean}\n *         returns false if the sourceset was not fired and true otherwise.\n */\n\nvar sourcesetLoad = function sourcesetLoad(tech) {\n  var el = tech.el(); // if `el.src` is set, that source will be loaded.\n\n  if (el.hasAttribute('src')) {\n    tech.triggerSourceset(el.src);\n    return true;\n  }\n  /**\n   * Since there isn't a src property on the media element, source elements will be used for\n   * implementing the source selection algorithm. This happens asynchronously and\n   * for most cases were there is more than one source we cannot tell what source will\n   * be loaded, without re-implementing the source selection algorithm. At this time we are not\n   * going to do that. There are three special cases that we do handle here though:\n   *\n   * 1. If there are no sources, do not fire `sourceset`.\n   * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`\n   * 3. If there is more than one `<source>` but all of them have the same `src` url.\n   *    That will be our src.\n   */\n\n\n  var sources = tech.$$('source');\n  var srcUrls = [];\n  var src = ''; // if there are no sources, do not fire sourceset\n\n  if (!sources.length) {\n    return false;\n  } // only count valid/non-duplicate source elements\n\n\n  for (var i = 0; i < sources.length; i++) {\n    var url = sources[i].src;\n\n    if (url && srcUrls.indexOf(url) === -1) {\n      srcUrls.push(url);\n    }\n  } // there were no valid sources\n\n\n  if (!srcUrls.length) {\n    return false;\n  } // there is only one valid source element url\n  // use that\n\n\n  if (srcUrls.length === 1) {\n    src = srcUrls[0];\n  }\n\n  tech.triggerSourceset(src);\n  return true;\n};\n/**\n * our implementation of an `innerHTML` descriptor for browsers\n * that do not have one.\n */\n\n\nvar innerHTMLDescriptorPolyfill = Object.defineProperty({}, 'innerHTML', {\n  get: function get() {\n    return this.cloneNode(true).innerHTML;\n  },\n  set: function set(v) {\n    // make a dummy node to use innerHTML on\n    var dummy = document.createElement(this.nodeName.toLowerCase()); // set innerHTML to the value provided\n\n    dummy.innerHTML = v; // make a document fragment to hold the nodes from dummy\n\n    var docFrag = document.createDocumentFragment(); // copy all of the nodes created by the innerHTML on dummy\n    // to the document fragment\n\n    while (dummy.childNodes.length) {\n      docFrag.appendChild(dummy.childNodes[0]);\n    } // remove content\n\n\n    this.innerText = ''; // now we add all of that html in one by appending the\n    // document fragment. This is how innerHTML does it.\n\n    window$1.Element.prototype.appendChild.call(this, docFrag); // then return the result that innerHTML's setter would\n\n    return this.innerHTML;\n  }\n});\n/**\n * Get a property descriptor given a list of priorities and the\n * property to get.\n */\n\nvar getDescriptor = function getDescriptor(priority, prop) {\n  var descriptor = {};\n\n  for (var i = 0; i < priority.length; i++) {\n    descriptor = Object.getOwnPropertyDescriptor(priority[i], prop);\n\n    if (descriptor && descriptor.set && descriptor.get) {\n      break;\n    }\n  }\n\n  descriptor.enumerable = true;\n  descriptor.configurable = true;\n  return descriptor;\n};\n\nvar getInnerHTMLDescriptor = function getInnerHTMLDescriptor(tech) {\n  return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, window$1.Element.prototype, innerHTMLDescriptorPolyfill], 'innerHTML');\n};\n/**\n * Patches browser internal functions so that we can tell synchronously\n * if a `<source>` was appended to the media element. For some reason this\n * causes a `sourceset` if the the media element is ready and has no source.\n * This happens when:\n * - The page has just loaded and the media element does not have a source.\n * - The media element was emptied of all sources, then `load()` was called.\n *\n * It does this by patching the following functions/properties when they are supported:\n *\n * - `append()` - can be used to add a `<source>` element to the media element\n * - `appendChild()` - can be used to add a `<source>` element to the media element\n * - `insertAdjacentHTML()` -  can be used to add a `<source>` element to the media element\n * - `innerHTML` -  can be used to add a `<source>` element to the media element\n *\n * @param {Html5} tech\n *        The tech object that sourceset is being setup on.\n */\n\n\nvar firstSourceWatch = function firstSourceWatch(tech) {\n  var el = tech.el(); // make sure firstSourceWatch isn't setup twice.\n\n  if (el.resetSourceWatch_) {\n    return;\n  }\n\n  var old = {};\n  var innerDescriptor = getInnerHTMLDescriptor(tech);\n\n  var appendWrapper = function appendWrapper(appendFn) {\n    return function () {\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      var retval = appendFn.apply(el, args);\n      sourcesetLoad(tech);\n      return retval;\n    };\n  };\n\n  ['append', 'appendChild', 'insertAdjacentHTML'].forEach(function (k) {\n    if (!el[k]) {\n      return;\n    } // store the old function\n\n\n    old[k] = el[k]; // call the old function with a sourceset if a source\n    // was loaded\n\n    el[k] = appendWrapper(old[k]);\n  });\n  Object.defineProperty(el, 'innerHTML', mergeOptions$3(innerDescriptor, {\n    set: appendWrapper(innerDescriptor.set)\n  }));\n\n  el.resetSourceWatch_ = function () {\n    el.resetSourceWatch_ = null;\n    Object.keys(old).forEach(function (k) {\n      el[k] = old[k];\n    });\n    Object.defineProperty(el, 'innerHTML', innerDescriptor);\n  }; // on the first sourceset, we need to revert our changes\n\n\n  tech.one('sourceset', el.resetSourceWatch_);\n};\n/**\n * our implementation of a `src` descriptor for browsers\n * that do not have one.\n */\n\n\nvar srcDescriptorPolyfill = Object.defineProperty({}, 'src', {\n  get: function get() {\n    if (this.hasAttribute('src')) {\n      return getAbsoluteURL(window$1.Element.prototype.getAttribute.call(this, 'src'));\n    }\n\n    return '';\n  },\n  set: function set(v) {\n    window$1.Element.prototype.setAttribute.call(this, 'src', v);\n    return v;\n  }\n});\n\nvar getSrcDescriptor = function getSrcDescriptor(tech) {\n  return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, srcDescriptorPolyfill], 'src');\n};\n/**\n * setup `sourceset` handling on the `Html5` tech. This function\n * patches the following element properties/functions:\n *\n * - `src` - to determine when `src` is set\n * - `setAttribute()` - to determine when `src` is set\n * - `load()` - this re-triggers the source selection algorithm, and can\n *              cause a sourceset.\n *\n * If there is no source when we are adding `sourceset` support or during a `load()`\n * we also patch the functions listed in `firstSourceWatch`.\n *\n * @param {Html5} tech\n *        The tech to patch\n */\n\n\nvar setupSourceset = function setupSourceset(tech) {\n  if (!tech.featuresSourceset) {\n    return;\n  }\n\n  var el = tech.el(); // make sure sourceset isn't setup twice.\n\n  if (el.resetSourceset_) {\n    return;\n  }\n\n  var srcDescriptor = getSrcDescriptor(tech);\n  var oldSetAttribute = el.setAttribute;\n  var oldLoad = el.load;\n  Object.defineProperty(el, 'src', mergeOptions$3(srcDescriptor, {\n    set: function set(v) {\n      var retval = srcDescriptor.set.call(el, v); // we use the getter here to get the actual value set on src\n\n      tech.triggerSourceset(el.src);\n      return retval;\n    }\n  }));\n\n  el.setAttribute = function (n, v) {\n    var retval = oldSetAttribute.call(el, n, v);\n\n    if (/src/i.test(n)) {\n      tech.triggerSourceset(el.src);\n    }\n\n    return retval;\n  };\n\n  el.load = function () {\n    var retval = oldLoad.call(el); // if load was called, but there was no source to fire\n    // sourceset on. We have to watch for a source append\n    // as that can trigger a `sourceset` when the media element\n    // has no source\n\n    if (!sourcesetLoad(tech)) {\n      tech.triggerSourceset('');\n      firstSourceWatch(tech);\n    }\n\n    return retval;\n  };\n\n  if (el.currentSrc) {\n    tech.triggerSourceset(el.currentSrc);\n  } else if (!sourcesetLoad(tech)) {\n    firstSourceWatch(tech);\n  }\n\n  el.resetSourceset_ = function () {\n    el.resetSourceset_ = null;\n    el.load = oldLoad;\n    el.setAttribute = oldSetAttribute;\n    Object.defineProperty(el, 'src', srcDescriptor);\n\n    if (el.resetSourceWatch_) {\n      el.resetSourceWatch_();\n    }\n  };\n};\n\n/**\n * Object.defineProperty but \"lazy\", which means that the value is only set after\n * it retrieved the first time, rather than being set right away.\n *\n * @param {Object} obj the object to set the property on\n * @param {string} key the key for the property to set\n * @param {Function} getValue the function used to get the value when it is needed.\n * @param {boolean} setter wether a setter shoould be allowed or not\n */\nvar defineLazyProperty = function defineLazyProperty(obj, key, getValue, setter) {\n  if (setter === void 0) {\n    setter = true;\n  }\n\n  var set = function set(value) {\n    return Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      writable: true\n    });\n  };\n\n  var options = {\n    configurable: true,\n    enumerable: true,\n    get: function get() {\n      var value = getValue();\n      set(value);\n      return value;\n    }\n  };\n\n  if (setter) {\n    options.set = set;\n  }\n\n  return Object.defineProperty(obj, key, options);\n};\n\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @mixes Tech~SourceHandlerAdditions\n * @extends Tech\n */\n\nvar Html5 = /*#__PURE__*/function (_Tech) {\n  _inheritsLoose(Html5, _Tech);\n\n  /**\n  * Create an instance of this Tech.\n  *\n  * @param {Object} [options]\n  *        The key/value store of player options.\n  *\n  * @param {Component~ReadyCallback} ready\n  *        Callback function to call when the `HTML5` Tech is ready.\n  */\n  function Html5(options, ready) {\n    var _this;\n\n    _this = _Tech.call(this, options, ready) || this;\n    var source = options.source;\n    var crossoriginTracks = false;\n    _this.featuresVideoFrameCallback = _this.featuresVideoFrameCallback && _this.el_.tagName === 'VIDEO'; // Set the source if one is provided\n    // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n    // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n    // anyway so the error gets fired.\n\n    if (source && (_this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) {\n      _this.setSource(source);\n    } else {\n      _this.handleLateInit_(_this.el_);\n    } // setup sourceset after late sourceset/init\n\n\n    if (options.enableSourceset) {\n      _this.setupSourcesetHandling_();\n    }\n\n    _this.isScrubbing_ = false;\n\n    if (_this.el_.hasChildNodes()) {\n      var nodes = _this.el_.childNodes;\n      var nodesLength = nodes.length;\n      var removeNodes = [];\n\n      while (nodesLength--) {\n        var node = nodes[nodesLength];\n        var nodeName = node.nodeName.toLowerCase();\n\n        if (nodeName === 'track') {\n          if (!_this.featuresNativeTextTracks) {\n            // Empty video tag tracks so the built-in player doesn't use them also.\n            // This may not be fast enough to stop HTML5 browsers from reading the tags\n            // so we'll need to turn off any default tracks if we're manually doing\n            // captions and subtitles. videoElement.textTracks\n            removeNodes.push(node);\n          } else {\n            // store HTMLTrackElement and TextTrack to remote list\n            _this.remoteTextTrackEls().addTrackElement_(node);\n\n            _this.remoteTextTracks().addTrack(node.track);\n\n            _this.textTracks().addTrack(node.track);\n\n            if (!crossoriginTracks && !_this.el_.hasAttribute('crossorigin') && isCrossOrigin(node.src)) {\n              crossoriginTracks = true;\n            }\n          }\n        }\n      }\n\n      for (var i = 0; i < removeNodes.length; i++) {\n        _this.el_.removeChild(removeNodes[i]);\n      }\n    }\n\n    _this.proxyNativeTracks_();\n\n    if (_this.featuresNativeTextTracks && crossoriginTracks) {\n      log$1.warn('Text Tracks are being loaded from another origin but the crossorigin attribute isn\\'t used.\\n' + 'This may prevent text tracks from loading.');\n    } // prevent iOS Safari from disabling metadata text tracks during native playback\n\n\n    _this.restoreMetadataTracksInIOSNativePlayer_(); // Determine if native controls should be used\n    // Our goal should be to get the custom controls on mobile solid everywhere\n    // so we can remove this all together. Right now this will block custom\n    // controls on touch enabled laptops like the Chrome Pixel\n\n\n    if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options.nativeControlsForTouch === true) {\n      _this.setControls(true);\n    } // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`\n    // into a `fullscreenchange` event\n\n\n    _this.proxyWebkitFullscreen_();\n\n    _this.triggerReady();\n\n    return _this;\n  }\n  /**\n   * Dispose of `HTML5` media element and remove all tracks.\n   */\n\n\n  var _proto = Html5.prototype;\n\n  _proto.dispose = function dispose() {\n    if (this.el_ && this.el_.resetSourceset_) {\n      this.el_.resetSourceset_();\n    }\n\n    Html5.disposeMediaElement(this.el_);\n    this.options_ = null; // tech will handle clearing of the emulated track list\n\n    _Tech.prototype.dispose.call(this);\n  }\n  /**\n   * Modify the media element so that we can detect when\n   * the source is changed. Fires `sourceset` just after the source has changed\n   */\n  ;\n\n  _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {\n    setupSourceset(this);\n  }\n  /**\n   * When a captions track is enabled in the iOS Safari native player, all other\n   * tracks are disabled (including metadata tracks), which nulls all of their\n   * associated cue points. This will restore metadata tracks to their pre-fullscreen\n   * state in those cases so that cue points are not needlessly lost.\n   *\n   * @private\n   */\n  ;\n\n  _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {\n    var textTracks = this.textTracks();\n    var metadataTracksPreFullscreenState; // captures a snapshot of every metadata track's current state\n\n    var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot() {\n      metadataTracksPreFullscreenState = [];\n\n      for (var i = 0; i < textTracks.length; i++) {\n        var track = textTracks[i];\n\n        if (track.kind === 'metadata') {\n          metadataTracksPreFullscreenState.push({\n            track: track,\n            storedMode: track.mode\n          });\n        }\n      }\n    }; // snapshot each metadata track's initial state, and update the snapshot\n    // each time there is a track 'change' event\n\n\n    takeMetadataTrackSnapshot();\n    textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n    this.on('dispose', function () {\n      return textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n    });\n\n    var restoreTrackMode = function restoreTrackMode() {\n      for (var i = 0; i < metadataTracksPreFullscreenState.length; i++) {\n        var storedTrack = metadataTracksPreFullscreenState[i];\n\n        if (storedTrack.track.mode === 'disabled' && storedTrack.track.mode !== storedTrack.storedMode) {\n          storedTrack.track.mode = storedTrack.storedMode;\n        }\n      } // we only want this handler to be executed on the first 'change' event\n\n\n      textTracks.removeEventListener('change', restoreTrackMode);\n    }; // when we enter fullscreen playback, stop updating the snapshot and\n    // restore all track modes to their pre-fullscreen state\n\n\n    this.on('webkitbeginfullscreen', function () {\n      textTracks.removeEventListener('change', takeMetadataTrackSnapshot); // remove the listener before adding it just in case it wasn't previously removed\n\n      textTracks.removeEventListener('change', restoreTrackMode);\n      textTracks.addEventListener('change', restoreTrackMode);\n    }); // start updating the snapshot again after leaving fullscreen\n\n    this.on('webkitendfullscreen', function () {\n      // remove the listener before adding it just in case it wasn't previously removed\n      textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n      textTracks.addEventListener('change', takeMetadataTrackSnapshot); // remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback\n\n      textTracks.removeEventListener('change', restoreTrackMode);\n    });\n  }\n  /**\n   * Attempt to force override of tracks for the given type\n   *\n   * @param {string} type - Track type to override, possible values include 'Audio',\n   * 'Video', and 'Text'.\n   * @param {boolean} override - If set to true native audio/video will be overridden,\n   * otherwise native audio/video will potentially be used.\n   * @private\n   */\n  ;\n\n  _proto.overrideNative_ = function overrideNative_(type, override) {\n    var _this2 = this;\n\n    // If there is no behavioral change don't add/remove listeners\n    if (override !== this[\"featuresNative\" + type + \"Tracks\"]) {\n      return;\n    }\n\n    var lowerCaseType = type.toLowerCase();\n\n    if (this[lowerCaseType + \"TracksListeners_\"]) {\n      Object.keys(this[lowerCaseType + \"TracksListeners_\"]).forEach(function (eventName) {\n        var elTracks = _this2.el()[lowerCaseType + \"Tracks\"];\n\n        elTracks.removeEventListener(eventName, _this2[lowerCaseType + \"TracksListeners_\"][eventName]);\n      });\n    }\n\n    this[\"featuresNative\" + type + \"Tracks\"] = !override;\n    this[lowerCaseType + \"TracksListeners_\"] = null;\n    this.proxyNativeTracksForType_(lowerCaseType);\n  }\n  /**\n   * Attempt to force override of native audio tracks.\n   *\n   * @param {boolean} override - If set to true native audio will be overridden,\n   * otherwise native audio will potentially be used.\n   */\n  ;\n\n  _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {\n    this.overrideNative_('Audio', override);\n  }\n  /**\n   * Attempt to force override of native video tracks.\n   *\n   * @param {boolean} override - If set to true native video will be overridden,\n   * otherwise native video will potentially be used.\n   */\n  ;\n\n  _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {\n    this.overrideNative_('Video', override);\n  }\n  /**\n   * Proxy native track list events for the given type to our track\n   * lists if the browser we are playing in supports that type of track list.\n   *\n   * @param {string} name - Track type; values include 'audio', 'video', and 'text'\n   * @private\n   */\n  ;\n\n  _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {\n    var _this3 = this;\n\n    var props = NORMAL[name];\n    var elTracks = this.el()[props.getterName];\n    var techTracks = this[props.getterName]();\n\n    if (!this[\"featuresNative\" + props.capitalName + \"Tracks\"] || !elTracks || !elTracks.addEventListener) {\n      return;\n    }\n\n    var listeners = {\n      change: function change(e) {\n        var event = {\n          type: 'change',\n          target: techTracks,\n          currentTarget: techTracks,\n          srcElement: techTracks\n        };\n        techTracks.trigger(event); // if we are a text track change event, we should also notify the\n        // remote text track list. This can potentially cause a false positive\n        // if we were to get a change event on a non-remote track and\n        // we triggered the event on the remote text track list which doesn't\n        // contain that track. However, best practices mean looping through the\n        // list of tracks and searching for the appropriate mode value, so,\n        // this shouldn't pose an issue\n\n        if (name === 'text') {\n          _this3[REMOTE.remoteText.getterName]().trigger(event);\n        }\n      },\n      addtrack: function addtrack(e) {\n        techTracks.addTrack(e.track);\n      },\n      removetrack: function removetrack(e) {\n        techTracks.removeTrack(e.track);\n      }\n    };\n\n    var removeOldTracks = function removeOldTracks() {\n      var removeTracks = [];\n\n      for (var i = 0; i < techTracks.length; i++) {\n        var found = false;\n\n        for (var j = 0; j < elTracks.length; j++) {\n          if (elTracks[j] === techTracks[i]) {\n            found = true;\n            break;\n          }\n        }\n\n        if (!found) {\n          removeTracks.push(techTracks[i]);\n        }\n      }\n\n      while (removeTracks.length) {\n        techTracks.removeTrack(removeTracks.shift());\n      }\n    };\n\n    this[props.getterName + 'Listeners_'] = listeners;\n    Object.keys(listeners).forEach(function (eventName) {\n      var listener = listeners[eventName];\n      elTracks.addEventListener(eventName, listener);\n\n      _this3.on('dispose', function (e) {\n        return elTracks.removeEventListener(eventName, listener);\n      });\n    }); // Remove (native) tracks that are not used anymore\n\n    this.on('loadstart', removeOldTracks);\n    this.on('dispose', function (e) {\n      return _this3.off('loadstart', removeOldTracks);\n    });\n  }\n  /**\n   * Proxy all native track list events to our track lists if the browser we are playing\n   * in supports that type of track list.\n   *\n   * @private\n   */\n  ;\n\n  _proto.proxyNativeTracks_ = function proxyNativeTracks_() {\n    var _this4 = this;\n\n    NORMAL.names.forEach(function (name) {\n      _this4.proxyNativeTracksForType_(name);\n    });\n  }\n  /**\n   * Create the `Html5` Tech's DOM element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    var el = this.options_.tag; // Check if this browser supports moving the element into the box.\n    // On the iPhone video will break if you move the element,\n    // So we have to create a brand new element.\n    // If we ingested the player div, we do not need to move the media element.\n\n    if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {\n      // If the original tag is still there, clone and remove it.\n      if (el) {\n        var clone = el.cloneNode(true);\n\n        if (el.parentNode) {\n          el.parentNode.insertBefore(clone, el);\n        }\n\n        Html5.disposeMediaElement(el);\n        el = clone;\n      } else {\n        el = document.createElement('video'); // determine if native controls should be used\n\n        var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);\n        var attributes = mergeOptions$3({}, tagAttributes);\n\n        if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {\n          delete attributes.controls;\n        }\n\n        setAttributes(el, assign(attributes, {\n          id: this.options_.techId,\n          \"class\": 'vjs-tech'\n        }));\n      }\n\n      el.playerId = this.options_.playerId;\n    }\n\n    if (typeof this.options_.preload !== 'undefined') {\n      setAttribute(el, 'preload', this.options_.preload);\n    }\n\n    if (this.options_.disablePictureInPicture !== undefined) {\n      el.disablePictureInPicture = this.options_.disablePictureInPicture;\n    } // Update specific tag settings, in case they were overridden\n    // `autoplay` has to be *last* so that `muted` and `playsinline` are present\n    // when iOS/Safari or other browsers attempt to autoplay.\n\n\n    var settingsAttrs = ['loop', 'muted', 'playsinline', 'autoplay'];\n\n    for (var i = 0; i < settingsAttrs.length; i++) {\n      var attr = settingsAttrs[i];\n      var value = this.options_[attr];\n\n      if (typeof value !== 'undefined') {\n        if (value) {\n          setAttribute(el, attr, attr);\n        } else {\n          removeAttribute(el, attr);\n        }\n\n        el[attr] = value;\n      }\n    }\n\n    return el;\n  }\n  /**\n   * This will be triggered if the loadstart event has already fired, before videojs was\n   * ready. Two known examples of when this can happen are:\n   * 1. If we're loading the playback object after it has started loading\n   * 2. The media is already playing the (often with autoplay on) then\n   *\n   * This function will fire another loadstart so that videojs can catchup.\n   *\n   * @fires Tech#loadstart\n   *\n   * @return {undefined}\n   *         returns nothing.\n   */\n  ;\n\n  _proto.handleLateInit_ = function handleLateInit_(el) {\n    if (el.networkState === 0 || el.networkState === 3) {\n      // The video element hasn't started loading the source yet\n      // or didn't find a source\n      return;\n    }\n\n    if (el.readyState === 0) {\n      // NetworkState is set synchronously BUT loadstart is fired at the\n      // end of the current stack, usually before setInterval(fn, 0).\n      // So at this point we know loadstart may have already fired or is\n      // about to fire, and either way the player hasn't seen it yet.\n      // We don't want to fire loadstart prematurely here and cause a\n      // double loadstart so we'll wait and see if it happens between now\n      // and the next loop, and fire it if not.\n      // HOWEVER, we also want to make sure it fires before loadedmetadata\n      // which could also happen between now and the next loop, so we'll\n      // watch for that also.\n      var loadstartFired = false;\n\n      var setLoadstartFired = function setLoadstartFired() {\n        loadstartFired = true;\n      };\n\n      this.on('loadstart', setLoadstartFired);\n\n      var triggerLoadstart = function triggerLoadstart() {\n        // We did miss the original loadstart. Make sure the player\n        // sees loadstart before loadedmetadata\n        if (!loadstartFired) {\n          this.trigger('loadstart');\n        }\n      };\n\n      this.on('loadedmetadata', triggerLoadstart);\n      this.ready(function () {\n        this.off('loadstart', setLoadstartFired);\n        this.off('loadedmetadata', triggerLoadstart);\n\n        if (!loadstartFired) {\n          // We did miss the original native loadstart. Fire it now.\n          this.trigger('loadstart');\n        }\n      });\n      return;\n    } // From here on we know that loadstart already fired and we missed it.\n    // The other readyState events aren't as much of a problem if we double\n    // them, so not going to go to as much trouble as loadstart to prevent\n    // that unless we find reason to.\n\n\n    var eventsToTrigger = ['loadstart']; // loadedmetadata: newly equal to HAVE_METADATA (1) or greater\n\n    eventsToTrigger.push('loadedmetadata'); // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater\n\n    if (el.readyState >= 2) {\n      eventsToTrigger.push('loadeddata');\n    } // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater\n\n\n    if (el.readyState >= 3) {\n      eventsToTrigger.push('canplay');\n    } // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)\n\n\n    if (el.readyState >= 4) {\n      eventsToTrigger.push('canplaythrough');\n    } // We still need to give the player time to add event listeners\n\n\n    this.ready(function () {\n      eventsToTrigger.forEach(function (type) {\n        this.trigger(type);\n      }, this);\n    });\n  }\n  /**\n   * Set whether we are scrubbing or not.\n   * This is used to decide whether we should use `fastSeek` or not.\n   * `fastSeek` is used to provide trick play on Safari browsers.\n   *\n   * @param {boolean} isScrubbing\n   *                  - true for we are currently scrubbing\n   *                  - false for we are no longer scrubbing\n   */\n  ;\n\n  _proto.setScrubbing = function setScrubbing(isScrubbing) {\n    this.isScrubbing_ = isScrubbing;\n  }\n  /**\n   * Get whether we are scrubbing or not.\n   *\n   * @return {boolean} isScrubbing\n   *                  - true for we are currently scrubbing\n   *                  - false for we are no longer scrubbing\n   */\n  ;\n\n  _proto.scrubbing = function scrubbing() {\n    return this.isScrubbing_;\n  }\n  /**\n   * Set current time for the `HTML5` tech.\n   *\n   * @param {number} seconds\n   *        Set the current time of the media to this.\n   */\n  ;\n\n  _proto.setCurrentTime = function setCurrentTime(seconds) {\n    try {\n      if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {\n        this.el_.fastSeek(seconds);\n      } else {\n        this.el_.currentTime = seconds;\n      }\n    } catch (e) {\n      log$1(e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady);\n    }\n  }\n  /**\n   * Get the current duration of the HTML5 media element.\n   *\n   * @return {number}\n   *         The duration of the media or 0 if there is no duration.\n   */\n  ;\n\n  _proto.duration = function duration() {\n    var _this5 = this;\n\n    // Android Chrome will report duration as Infinity for VOD HLS until after\n    // playback has started, which triggers the live display erroneously.\n    // Return NaN if playback has not started and trigger a durationupdate once\n    // the duration can be reliably known.\n    if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {\n      // Wait for the first `timeupdate` with currentTime > 0 - there may be\n      // several with 0\n      var checkProgress = function checkProgress() {\n        if (_this5.el_.currentTime > 0) {\n          // Trigger durationchange for genuinely live video\n          if (_this5.el_.duration === Infinity) {\n            _this5.trigger('durationchange');\n          }\n\n          _this5.off('timeupdate', checkProgress);\n        }\n      };\n\n      this.on('timeupdate', checkProgress);\n      return NaN;\n    }\n\n    return this.el_.duration || NaN;\n  }\n  /**\n   * Get the current width of the HTML5 media element.\n   *\n   * @return {number}\n   *         The width of the HTML5 media element.\n   */\n  ;\n\n  _proto.width = function width() {\n    return this.el_.offsetWidth;\n  }\n  /**\n   * Get the current height of the HTML5 media element.\n   *\n   * @return {number}\n   *         The height of the HTML5 media element.\n   */\n  ;\n\n  _proto.height = function height() {\n    return this.el_.offsetHeight;\n  }\n  /**\n   * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into\n   * `fullscreenchange` event.\n   *\n   * @private\n   * @fires fullscreenchange\n   * @listens webkitendfullscreen\n   * @listens webkitbeginfullscreen\n   * @listens webkitbeginfullscreen\n   */\n  ;\n\n  _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {\n    var _this6 = this;\n\n    if (!('webkitDisplayingFullscreen' in this.el_)) {\n      return;\n    }\n\n    var endFn = function endFn() {\n      this.trigger('fullscreenchange', {\n        isFullscreen: false\n      }); // Safari will sometimes set contols on the videoelement when existing fullscreen.\n\n      if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {\n        this.el_.controls = false;\n      }\n    };\n\n    var beginFn = function beginFn() {\n      if ('webkitPresentationMode' in this.el_ && this.el_.webkitPresentationMode !== 'picture-in-picture') {\n        this.one('webkitendfullscreen', endFn);\n        this.trigger('fullscreenchange', {\n          isFullscreen: true,\n          // set a flag in case another tech triggers fullscreenchange\n          nativeIOSFullscreen: true\n        });\n      }\n    };\n\n    this.on('webkitbeginfullscreen', beginFn);\n    this.on('dispose', function () {\n      _this6.off('webkitbeginfullscreen', beginFn);\n\n      _this6.off('webkitendfullscreen', endFn);\n    });\n  }\n  /**\n   * Check if fullscreen is supported on the current playback device.\n   *\n   * @return {boolean}\n   *         - True if fullscreen is supported.\n   *         - False if fullscreen is not supported.\n   */\n  ;\n\n  _proto.supportsFullScreen = function supportsFullScreen() {\n    if (typeof this.el_.webkitEnterFullScreen === 'function') {\n      var userAgent = window$1.navigator && window$1.navigator.userAgent || ''; // Seems to be broken in Chromium/Chrome && Safari in Leopard\n\n      if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n  /**\n   * Request that the `HTML5` Tech enter fullscreen.\n   */\n  ;\n\n  _proto.enterFullScreen = function enterFullScreen() {\n    var video = this.el_;\n\n    if (video.paused && video.networkState <= video.HAVE_METADATA) {\n      // attempt to prime the video element for programmatic access\n      // this isn't necessary on the desktop but shouldn't hurt\n      silencePromise(this.el_.play()); // playing and pausing synchronously during the transition to fullscreen\n      // can get iOS ~6.1 devices into a play/pause loop\n\n      this.setTimeout(function () {\n        video.pause();\n\n        try {\n          video.webkitEnterFullScreen();\n        } catch (e) {\n          this.trigger('fullscreenerror', e);\n        }\n      }, 0);\n    } else {\n      try {\n        video.webkitEnterFullScreen();\n      } catch (e) {\n        this.trigger('fullscreenerror', e);\n      }\n    }\n  }\n  /**\n   * Request that the `HTML5` Tech exit fullscreen.\n   */\n  ;\n\n  _proto.exitFullScreen = function exitFullScreen() {\n    if (!this.el_.webkitDisplayingFullscreen) {\n      this.trigger('fullscreenerror', new Error('The video is not fullscreen'));\n      return;\n    }\n\n    this.el_.webkitExitFullScreen();\n  }\n  /**\n   * Create a floating video window always on top of other windows so that users may\n   * continue consuming media while they interact with other content sites, or\n   * applications on their device.\n   *\n   * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n   *\n   * @return {Promise}\n   *         A promise with a Picture-in-Picture window.\n   */\n  ;\n\n  _proto.requestPictureInPicture = function requestPictureInPicture() {\n    return this.el_.requestPictureInPicture();\n  }\n  /**\n   * Native requestVideoFrameCallback if supported by browser/tech, or fallback\n   * Don't use rVCF on Safari when DRM is playing, as it doesn't fire\n   * Needs to be checked later than the constructor\n   * This will be a false positive for clear sources loaded after a Fairplay source\n   *\n   * @param {function} cb function to call\n   * @return {number} id of request\n   */\n  ;\n\n  _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {\n    if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {\n      return this.el_.requestVideoFrameCallback(cb);\n    }\n\n    return _Tech.prototype.requestVideoFrameCallback.call(this, cb);\n  }\n  /**\n   * Native or fallback requestVideoFrameCallback\n   *\n   * @param {number} id request id to cancel\n   */\n  ;\n\n  _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {\n    if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {\n      this.el_.cancelVideoFrameCallback(id);\n    } else {\n      _Tech.prototype.cancelVideoFrameCallback.call(this, id);\n    }\n  }\n  /**\n   * A getter/setter for the `Html5` Tech's source object.\n   * > Note: Please use {@link Html5#setSource}\n   *\n   * @param {Tech~SourceObject} [src]\n   *        The source object you want to set on the `HTML5` techs element.\n   *\n   * @return {Tech~SourceObject|undefined}\n   *         - The current source object when a source is not passed in.\n   *         - undefined when setting\n   *\n   * @deprecated Since version 5.\n   */\n  ;\n\n  _proto.src = function src(_src) {\n    if (_src === undefined) {\n      return this.el_.src;\n    } // Setting src through `src` instead of `setSrc` will be deprecated\n\n\n    this.setSrc(_src);\n  }\n  /**\n   * Reset the tech by removing all sources and then calling\n   * {@link Html5.resetMediaElement}.\n   */\n  ;\n\n  _proto.reset = function reset() {\n    Html5.resetMediaElement(this.el_);\n  }\n  /**\n   * Get the current source on the `HTML5` Tech. Falls back to returning the source from\n   * the HTML5 media element.\n   *\n   * @return {Tech~SourceObject}\n   *         The current source object from the HTML5 tech. With a fallback to the\n   *         elements source.\n   */\n  ;\n\n  _proto.currentSrc = function currentSrc() {\n    if (this.currentSource_) {\n      return this.currentSource_.src;\n    }\n\n    return this.el_.currentSrc;\n  }\n  /**\n   * Set controls attribute for the HTML5 media Element.\n   *\n   * @param {string} val\n   *        Value to set the controls attribute to\n   */\n  ;\n\n  _proto.setControls = function setControls(val) {\n    this.el_.controls = !!val;\n  }\n  /**\n   * Create and returns a remote {@link TextTrack} object.\n   *\n   * @param {string} kind\n   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n   *\n   * @param {string} [label]\n   *        Label to identify the text track\n   *\n   * @param {string} [language]\n   *        Two letter language abbreviation\n   *\n   * @return {TextTrack}\n   *         The TextTrack that gets created.\n   */\n  ;\n\n  _proto.addTextTrack = function addTextTrack(kind, label, language) {\n    if (!this.featuresNativeTextTracks) {\n      return _Tech.prototype.addTextTrack.call(this, kind, label, language);\n    }\n\n    return this.el_.addTextTrack(kind, label, language);\n  }\n  /**\n   * Creates either native TextTrack or an emulated TextTrack depending\n   * on the value of `featuresNativeTextTracks`\n   *\n   * @param {Object} options\n   *        The object should contain the options to initialize the TextTrack with.\n   *\n   * @param {string} [options.kind]\n   *        `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n   *\n   * @param {string} [options.label]\n   *        Label to identify the text track\n   *\n   * @param {string} [options.language]\n   *        Two letter language abbreviation.\n   *\n   * @param {boolean} [options.default]\n   *        Default this track to on.\n   *\n   * @param {string} [options.id]\n   *        The internal id to assign this track.\n   *\n   * @param {string} [options.src]\n   *        A source url for the track.\n   *\n   * @return {HTMLTrackElement}\n   *         The track element that gets created.\n   */\n  ;\n\n  _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n    if (!this.featuresNativeTextTracks) {\n      return _Tech.prototype.createRemoteTextTrack.call(this, options);\n    }\n\n    var htmlTrackElement = document.createElement('track');\n\n    if (options.kind) {\n      htmlTrackElement.kind = options.kind;\n    }\n\n    if (options.label) {\n      htmlTrackElement.label = options.label;\n    }\n\n    if (options.language || options.srclang) {\n      htmlTrackElement.srclang = options.language || options.srclang;\n    }\n\n    if (options[\"default\"]) {\n      htmlTrackElement[\"default\"] = options[\"default\"];\n    }\n\n    if (options.id) {\n      htmlTrackElement.id = options.id;\n    }\n\n    if (options.src) {\n      htmlTrackElement.src = options.src;\n    }\n\n    return htmlTrackElement;\n  }\n  /**\n   * Creates a remote text track object and returns an html track element.\n   *\n   * @param {Object} options The object should contain values for\n   * kind, language, label, and src (location of the WebVTT file)\n   * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n   * automatically removed from the video element whenever the source changes\n   * @return {HTMLTrackElement} An Html Track Element.\n   * This can be an emulated {@link HTMLTrackElement} or a native one.\n   * @deprecated The default value of the \"manualCleanup\" parameter will default\n   * to \"false\" in upcoming versions of Video.js\n   */\n  ;\n\n  _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n    var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup);\n\n    if (this.featuresNativeTextTracks) {\n      this.el().appendChild(htmlTrackElement);\n    }\n\n    return htmlTrackElement;\n  }\n  /**\n   * Remove remote `TextTrack` from `TextTrackList` object\n   *\n   * @param {TextTrack} track\n   *        `TextTrack` object to remove\n   */\n  ;\n\n  _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n    _Tech.prototype.removeRemoteTextTrack.call(this, track);\n\n    if (this.featuresNativeTextTracks) {\n      var tracks = this.$$('track');\n      var i = tracks.length;\n\n      while (i--) {\n        if (track === tracks[i] || track === tracks[i].track) {\n          this.el().removeChild(tracks[i]);\n        }\n      }\n    }\n  }\n  /**\n   * Gets available media playback quality metrics as specified by the W3C's Media\n   * Playback Quality API.\n   *\n   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n   *\n   * @return {Object}\n   *         An object with supported media playback quality metrics\n   */\n  ;\n\n  _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n    if (typeof this.el().getVideoPlaybackQuality === 'function') {\n      return this.el().getVideoPlaybackQuality();\n    }\n\n    var videoPlaybackQuality = {};\n\n    if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') {\n      videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;\n      videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;\n    }\n\n    if (window$1.performance && typeof window$1.performance.now === 'function') {\n      videoPlaybackQuality.creationTime = window$1.performance.now();\n    } else if (window$1.performance && window$1.performance.timing && typeof window$1.performance.timing.navigationStart === 'number') {\n      videoPlaybackQuality.creationTime = window$1.Date.now() - window$1.performance.timing.navigationStart;\n    }\n\n    return videoPlaybackQuality;\n  };\n\n  return Html5;\n}(Tech);\n/* HTML5 Support Testing ---------------------------------------------------- */\n\n/**\n * Element for testing browser HTML5 media capabilities\n *\n * @type {Element}\n * @constant\n * @private\n */\n\n\ndefineLazyProperty(Html5, 'TEST_VID', function () {\n  if (!isReal()) {\n    return;\n  }\n\n  var video = document.createElement('video');\n  var track = document.createElement('track');\n  track.kind = 'captions';\n  track.srclang = 'en';\n  track.label = 'English';\n  video.appendChild(track);\n  return video;\n});\n/**\n * Check if HTML5 media is supported by this browser/device.\n *\n * @return {boolean}\n *         - True if HTML5 media is supported.\n *         - False if HTML5 media is not supported.\n */\n\nHtml5.isSupported = function () {\n  // IE with no Media Player is a LIAR! (#984)\n  try {\n    Html5.TEST_VID.volume = 0.5;\n  } catch (e) {\n    return false;\n  }\n\n  return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType);\n};\n/**\n * Check if the tech can support the given type\n *\n * @param {string} type\n *        The mimetype to check\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlayType = function (type) {\n  return Html5.TEST_VID.canPlayType(type);\n};\n/**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n *        The source object\n * @param {Object} options\n *        The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlaySource = function (srcObj, options) {\n  return Html5.canPlayType(srcObj.type);\n};\n/**\n * Check if the volume can be changed in this browser/device.\n * Volume cannot be changed in a lot of mobile devices.\n * Specifically, it can't be changed from 1 on iOS.\n *\n * @return {boolean}\n *         - True if volume can be controlled\n *         - False otherwise\n */\n\n\nHtml5.canControlVolume = function () {\n  // IE will error if Windows Media Player not installed #3315\n  try {\n    var volume = Html5.TEST_VID.volume;\n    Html5.TEST_VID.volume = volume / 2 + 0.1;\n    var canControl = volume !== Html5.TEST_VID.volume; // With the introduction of iOS 15, there are cases where the volume is read as\n    // changed but reverts back to its original state at the start of the next tick.\n    // To determine whether volume can be controlled on iOS,\n    // a timeout is set and the volume is checked asynchronously.\n    // Since `features` doesn't currently work asynchronously, the value is manually set.\n\n    if (canControl && IS_IOS) {\n      window$1.setTimeout(function () {\n        if (Html5 && Html5.prototype) {\n          Html5.prototype.featuresVolumeControl = volume !== Html5.TEST_VID.volume;\n        }\n      }); // default iOS to false, which will be updated in the timeout above.\n\n      return false;\n    }\n\n    return canControl;\n  } catch (e) {\n    return false;\n  }\n};\n/**\n * Check if the volume can be muted in this browser/device.\n * Some devices, e.g. iOS, don't allow changing volume\n * but permits muting/unmuting.\n *\n * @return {bolean}\n *      - True if volume can be muted\n *      - False otherwise\n */\n\n\nHtml5.canMuteVolume = function () {\n  try {\n    var muted = Html5.TEST_VID.muted; // in some versions of iOS muted property doesn't always\n    // work, so we want to set both property and attribute\n\n    Html5.TEST_VID.muted = !muted;\n\n    if (Html5.TEST_VID.muted) {\n      setAttribute(Html5.TEST_VID, 'muted', 'muted');\n    } else {\n      removeAttribute(Html5.TEST_VID, 'muted', 'muted');\n    }\n\n    return muted !== Html5.TEST_VID.muted;\n  } catch (e) {\n    return false;\n  }\n};\n/**\n * Check if the playback rate can be changed in this browser/device.\n *\n * @return {boolean}\n *         - True if playback rate can be controlled\n *         - False otherwise\n */\n\n\nHtml5.canControlPlaybackRate = function () {\n  // Playback rate API is implemented in Android Chrome, but doesn't do anything\n  // https://github.com/videojs/video.js/issues/3180\n  if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {\n    return false;\n  } // IE will error if Windows Media Player not installed #3315\n\n\n  try {\n    var playbackRate = Html5.TEST_VID.playbackRate;\n    Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1;\n    return playbackRate !== Html5.TEST_VID.playbackRate;\n  } catch (e) {\n    return false;\n  }\n};\n/**\n * Check if we can override a video/audio elements attributes, with\n * Object.defineProperty.\n *\n * @return {boolean}\n *         - True if builtin attributes can be overridden\n *         - False otherwise\n */\n\n\nHtml5.canOverrideAttributes = function () {\n  // if we cannot overwrite the src/innerHTML property, there is no support\n  // iOS 7 safari for instance cannot do this.\n  try {\n    var noop = function noop() {};\n\n    Object.defineProperty(document.createElement('video'), 'src', {\n      get: noop,\n      set: noop\n    });\n    Object.defineProperty(document.createElement('audio'), 'src', {\n      get: noop,\n      set: noop\n    });\n    Object.defineProperty(document.createElement('video'), 'innerHTML', {\n      get: noop,\n      set: noop\n    });\n    Object.defineProperty(document.createElement('audio'), 'innerHTML', {\n      get: noop,\n      set: noop\n    });\n  } catch (e) {\n    return false;\n  }\n\n  return true;\n};\n/**\n * Check to see if native `TextTrack`s are supported by this browser/device.\n *\n * @return {boolean}\n *         - True if native `TextTrack`s are supported.\n *         - False otherwise\n */\n\n\nHtml5.supportsNativeTextTracks = function () {\n  return IS_ANY_SAFARI || IS_IOS && IS_CHROME;\n};\n/**\n * Check to see if native `VideoTrack`s are supported by this browser/device\n *\n * @return {boolean}\n *        - True if native `VideoTrack`s are supported.\n *        - False otherwise\n */\n\n\nHtml5.supportsNativeVideoTracks = function () {\n  return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks);\n};\n/**\n * Check to see if native `AudioTrack`s are supported by this browser/device\n *\n * @return {boolean}\n *        - True if native `AudioTrack`s are supported.\n *        - False otherwise\n */\n\n\nHtml5.supportsNativeAudioTracks = function () {\n  return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks);\n};\n/**\n * An array of events available on the Html5 tech.\n *\n * @private\n * @type {Array}\n */\n\n\nHtml5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default {@link Html5.canControlVolume}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default {@link Html5.canMuteVolume}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the media\n * plays. Examples:\n *   - Set player to play 2x (twice) as fast\n *   - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default {@link Html5.canControlPlaybackRate}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * @type {boolean}\n * @default\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeTextTracks}\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeVideoTracks}\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeAudioTracks}\n */\n\n[['featuresMuteControl', 'canMuteVolume'], ['featuresPlaybackRate', 'canControlPlaybackRate'], ['featuresSourceset', 'canOverrideAttributes'], ['featuresNativeTextTracks', 'supportsNativeTextTracks'], ['featuresNativeVideoTracks', 'supportsNativeVideoTracks'], ['featuresNativeAudioTracks', 'supportsNativeAudioTracks']].forEach(function (_ref) {\n  var key = _ref[0],\n      fn = _ref[1];\n  defineLazyProperty(Html5.prototype, key, function () {\n    return Html5[fn]();\n  }, true);\n});\nHtml5.prototype.featuresVolumeControl = Html5.canControlVolume();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the media element\n * moving in the DOM. iOS breaks if you move the media element, so this is set this to\n * false there. Everywhere else this should be true.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.movingMediaElementInDOM = !IS_IOS; // TODO: Previous comment: No longer appears to be used. Can probably be removed.\n//       Is this true?\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports automatic media resize\n * when going into fullscreen.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresFullscreenResize = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the progress event.\n * If this is false, manual `progress` events will be triggered instead.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresProgressEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.\n * If this is false, manual `timeupdate` events will be triggered instead.\n *\n * @default\n */\n\nHtml5.prototype.featuresTimeupdateEvents = true;\n/**\n * Whether the HTML5 el supports `requestVideoFrameCallback`\n *\n * @type {boolean}\n */\n\nHtml5.prototype.featuresVideoFrameCallback = !!(Html5.TEST_VID && Html5.TEST_VID.requestVideoFrameCallback); // HTML5 Feature detection and Device Fixes --------------------------------- //\n\nvar canPlayType;\n\nHtml5.patchCanPlayType = function () {\n  // Android 4.0 and above can play HLS to some extent but it reports being unable to do so\n  // Firefox and Chrome report correctly\n  if (ANDROID_VERSION >= 4.0 && !IS_FIREFOX && !IS_CHROME) {\n    canPlayType = Html5.TEST_VID && Html5.TEST_VID.constructor.prototype.canPlayType;\n\n    Html5.TEST_VID.constructor.prototype.canPlayType = function (type) {\n      var mpegurlRE = /^application\\/(?:x-|vnd\\.apple\\.)mpegurl/i;\n\n      if (type && mpegurlRE.test(type)) {\n        return 'maybe';\n      }\n\n      return canPlayType.call(this, type);\n    };\n  }\n};\n\nHtml5.unpatchCanPlayType = function () {\n  var r = Html5.TEST_VID.constructor.prototype.canPlayType;\n\n  if (canPlayType) {\n    Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType;\n  }\n\n  return r;\n}; // by default, patch the media element\n\n\nHtml5.patchCanPlayType();\n\nHtml5.disposeMediaElement = function (el) {\n  if (!el) {\n    return;\n  }\n\n  if (el.parentNode) {\n    el.parentNode.removeChild(el);\n  } // remove any child track or source nodes to prevent their loading\n\n\n  while (el.hasChildNodes()) {\n    el.removeChild(el.firstChild);\n  } // remove any src reference. not setting `src=''` because that causes a warning\n  // in firefox\n\n\n  el.removeAttribute('src'); // force the media element to update its loading state by calling load()\n  // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)\n\n  if (typeof el.load === 'function') {\n    // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n    (function () {\n      try {\n        el.load();\n      } catch (e) {// not supported\n      }\n    })();\n  }\n};\n\nHtml5.resetMediaElement = function (el) {\n  if (!el) {\n    return;\n  }\n\n  var sources = el.querySelectorAll('source');\n  var i = sources.length;\n\n  while (i--) {\n    el.removeChild(sources[i]);\n  } // remove any src reference.\n  // not setting `src=''` because that throws an error\n\n\n  el.removeAttribute('src');\n\n  if (typeof el.load === 'function') {\n    // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n    (function () {\n      try {\n        el.load();\n      } catch (e) {// satisfy linter\n      }\n    })();\n  }\n};\n/* Native HTML5 element property wrapping ----------------------------------- */\n// Wrap native boolean attributes with getters that check both property and attribute\n// The list is as followed:\n// muted, defaultMuted, autoplay, controls, loop, playsinline\n\n\n[\n/**\n * Get the value of `muted` from the media element. `muted` indicates\n * that the volume for the media should be set to silent. This does not actually change\n * the `volume` attribute.\n *\n * @method Html5#muted\n * @return {boolean}\n *         - True if the value of `volume` should be ignored and the audio set to silent.\n *         - False if the value of `volume` should be used.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the\n * current state.\n *\n * @method Html5#defaultMuted\n * @return {boolean}\n *         - The value of `defaultMuted` from the media element.\n *         - True indicates that the media should start muted.\n *         - False indicates that the media should not start muted\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Get the value of `autoplay` from the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#autoplay\n * @return {boolean}\n *         - The value of `autoplay` from the media element.\n *         - True indicates that the media should start as soon as the page loads.\n *         - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Get the value of `controls` from the media element. `controls` indicates\n * whether the native media controls should be shown or hidden.\n *\n * @method Html5#controls\n * @return {boolean}\n *         - The value of `controls` from the media element.\n *         - True indicates that native controls should be showing.\n *         - False indicates that native controls should be hidden.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}\n */\n'controls',\n/**\n * Get the value of `loop` from the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#loop\n * @return {boolean}\n *         - The value of `loop` from the media element.\n *         - True indicates that playback should seek back to start once\n *           the end of a media is reached.\n *         - False indicates that playback should not loop back to the start when the\n *           end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Get the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#playsinline\n * @return {boolean}\n *         - The value of `playsinline` from the media element.\n *         - True indicates that the media should play inline.\n *         - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n  Html5.prototype[prop] = function () {\n    return this.el_[prop] || this.el_.hasAttribute(prop);\n  };\n}); // Wrap native boolean attributes with setters that set both property and attribute\n// The list is as followed:\n// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline\n// setControls is special-cased above\n\n[\n/**\n * Set the value of `muted` on the media element. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Html5#setMuted\n * @param {boolean} muted\n *        - True if the audio should be set to silent\n *        - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current\n * audio level should be silent, but will only effect the muted level on initial playback..\n *\n * @method Html5.prototype.setDefaultMuted\n * @param {boolean} defaultMuted\n *        - True if the audio should be set to silent\n *        - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Set the value of `autoplay` on the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#setAutoplay\n * @param {boolean} autoplay\n *         - True indicates that the media should start as soon as the page loads.\n *         - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Set the value of `loop` on the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#setLoop\n * @param {boolean} loop\n *         - True indicates that playback should seek back to start once\n *           the end of a media is reached.\n *         - False indicates that playback should not loop back to the start when the\n *           end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Set the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#setPlaysinline\n * @param {boolean} playsinline\n *         - True indicates that the media should play inline.\n *         - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n  Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n    this.el_[prop] = v;\n\n    if (v) {\n      this.el_.setAttribute(prop, prop);\n    } else {\n      this.el_.removeAttribute(prop);\n    }\n  };\n}); // Wrap native properties with a getter\n// The list is as followed\n// paused, currentTime, buffered, volume, poster, preload, error, seeking\n// seekable, ended, playbackRate, defaultPlaybackRate, disablePictureInPicture\n// played, networkState, readyState, videoWidth, videoHeight, crossOrigin\n\n[\n/**\n * Get the value of `paused` from the media element. `paused` indicates whether the media element\n * is currently paused or not.\n *\n * @method Html5#paused\n * @return {boolean}\n *         The value of `paused` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}\n */\n'paused',\n/**\n * Get the value of `currentTime` from the media element. `currentTime` indicates\n * the current second that the media is at in playback.\n *\n * @method Html5#currentTime\n * @return {number}\n *         The value of `currentTime` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}\n */\n'currentTime',\n/**\n * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`\n * object that represents the parts of the media that are already downloaded and\n * available for playback.\n *\n * @method Html5#buffered\n * @return {TimeRange}\n *         The value of `buffered` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}\n */\n'buffered',\n/**\n * Get the value of `volume` from the media element. `volume` indicates\n * the current playback volume of audio for a media. `volume` will be a value from 0\n * (silent) to 1 (loudest and default).\n *\n * @method Html5#volume\n * @return {number}\n *         The value of `volume` from the media element. Value will be between 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Get the value of `poster` from the media element. `poster` indicates\n * that the url of an image file that can/will be shown when no media data is available.\n *\n * @method Html5#poster\n * @return {string}\n *         The value of `poster` from the media element. Value will be a url to an\n *         image.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}\n */\n'poster',\n/**\n * Get the value of `preload` from the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n *   media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n *    interaction\n *\n * @method Html5#preload\n * @return {string}\n *         The value of `preload` from the media element. Will be 'none', 'metadata',\n *         or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Get the value of the `error` from the media element. `error` indicates any\n * MediaError that may have occurred during playback. If error returns null there is no\n * current error.\n *\n * @method Html5#error\n * @return {MediaError|null}\n *         The value of `error` from the media element. Will be `MediaError` if there\n *         is a current error and null otherwise.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}\n */\n'error',\n/**\n * Get the value of `seeking` from the media element. `seeking` indicates whether the\n * media is currently seeking to a new position or not.\n *\n * @method Html5#seeking\n * @return {boolean}\n *         - The value of `seeking` from the media element.\n *         - True indicates that the media is currently seeking to a new position.\n *         - False indicates that the media is not seeking to a new position at this time.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}\n */\n'seeking',\n/**\n * Get the value of `seekable` from the media element. `seekable` returns a\n * `TimeRange` object indicating ranges of time that can currently be `seeked` to.\n *\n * @method Html5#seekable\n * @return {TimeRange}\n *         The value of `seekable` from the media element. A `TimeRange` object\n *         indicating the current ranges of time that can be seeked to.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}\n */\n'seekable',\n/**\n * Get the value of `ended` from the media element. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Html5#ended\n * @return {boolean}\n *         - The value of `ended` from the media element.\n *         - True indicates that the media has ended.\n *         - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n'ended',\n/**\n * Get the value of `playbackRate` from the media element. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n *   - if playbackRate is set to 2, media will play twice as fast.\n *   - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#playbackRate\n * @return {number}\n *         The value of `playbackRate` from the media element. A number indicating\n *         the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates\n * the rate at which the media is currently playing back. This value will not indicate the current\n * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.\n *\n * Examples:\n *   - if defaultPlaybackRate is set to 2, media will play twice as fast.\n *   - if defaultPlaybackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.defaultPlaybackRate\n * @return {number}\n *         The value of `defaultPlaybackRate` from the media element. A number indicating\n *         the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'defaultPlaybackRate',\n/**\n * Get the value of 'disablePictureInPicture' from the video element.\n *\n * @method Html5#disablePictureInPicture\n * @return {boolean} value\n *         - The value of `disablePictureInPicture` from the video element.\n *         - True indicates that the video can't be played in Picture-In-Picture mode\n *         - False indicates that the video can be played in Picture-In-Picture mode\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Get the value of `played` from the media element. `played` returns a `TimeRange`\n * object representing points in the media timeline that have been played.\n *\n * @method Html5#played\n * @return {TimeRange}\n *         The value of `played` from the media element. A `TimeRange` object indicating\n *         the ranges of time that have been played.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}\n */\n'played',\n/**\n * Get the value of `networkState` from the media element. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NETWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Html5#networkState\n * @return {number}\n *         The value of `networkState` from the media element. This will be a number\n *         from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}\n */\n'networkState',\n/**\n * Get the value of `readyState` from the media element. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Html5#readyState\n * @return {number}\n *         The value of `readyState` from the media element. This will be a number\n *         from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}\n */\n'readyState',\n/**\n * Get the value of `videoWidth` from the video element. `videoWidth` indicates\n * the current width of the video in css pixels.\n *\n * @method Html5#videoWidth\n * @return {number}\n *         The value of `videoWidth` from the video element. This will be a number\n *         in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoWidth',\n/**\n * Get the value of `videoHeight` from the video element. `videoHeight` indicates\n * the current height of the video in css pixels.\n *\n * @method Html5#videoHeight\n * @return {number}\n *         The value of `videoHeight` from the video element. This will be a number\n *         in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoHeight',\n/**\n * Get the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#crossOrigin\n * @return {string}\n *         - anonymous indicates that the media should not sent cookies.\n *         - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n  Html5.prototype[prop] = function () {\n    return this.el_[prop];\n  };\n}); // Wrap native properties with a setter in this format:\n// set + toTitleCase(name)\n// The list is as follows:\n// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate,\n// setDisablePictureInPicture, setCrossOrigin\n\n[\n/**\n * Set the value of `volume` on the media element. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Html5#setVolume\n * @param {number} percentAsDecimal\n *        The volume percent as a decimal. Valid range is from 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Set the value of `src` on the media element. `src` indicates the current\n * {@link Tech~SourceObject} for the media.\n *\n * @method Html5#setSrc\n * @param {Tech~SourceObject} src\n *        The source object to set as the current source.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}\n */\n'src',\n/**\n * Set the value of `poster` on the media element. `poster` is the url to\n * an image file that can/will be shown when no media data is available.\n *\n * @method Html5#setPoster\n * @param {string} poster\n *        The url to an image that should be used as the `poster` for the media\n *        element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}\n */\n'poster',\n/**\n * Set the value of `preload` on the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n *   media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n *    interaction\n *\n * @method Html5#setPreload\n * @param {string} preload\n *         The value of `preload` to set on the media element. Must be 'none', 'metadata',\n *         or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Set the value of `playbackRate` on the media element. `playbackRate` indicates\n * the rate at which the media should play back. Examples:\n *   - if playbackRate is set to 2, media will play twice as fast.\n *   - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#setPlaybackRate\n * @return {number}\n *         The value of `playbackRate` from the media element. A number indicating\n *         the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates\n * the rate at which the media should play back upon initial startup. Changing this value\n * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.\n *\n * Example Values:\n *   - if playbackRate is set to 2, media will play twice as fast.\n *   - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.setDefaultPlaybackRate\n * @return {number}\n *         The value of `defaultPlaybackRate` from the media element. A number indicating\n *         the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}\n */\n'defaultPlaybackRate',\n/**\n * Prevents the browser from suggesting a Picture-in-Picture context menu\n * or to request Picture-in-Picture automatically in some cases.\n *\n * @method Html5#setDisablePictureInPicture\n * @param {boolean} value\n *         The true value will disable Picture-in-Picture mode.\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Set the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#setCrossOrigin\n * @param {string} crossOrigin\n *         - anonymous indicates that the media should not sent cookies.\n *         - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n  Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n    this.el_[prop] = v;\n  };\n}); // wrap native functions with a function\n// The list is as follows:\n// pause, load, play\n\n[\n/**\n * A wrapper around the media elements `pause` function. This will call the `HTML5`\n * media elements `pause` function.\n *\n * @method Html5#pause\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}\n */\n'pause',\n/**\n * A wrapper around the media elements `load` function. This will call the `HTML5`s\n * media element `load` function.\n *\n * @method Html5#load\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}\n */\n'load',\n/**\n * A wrapper around the media elements `play` function. This will call the `HTML5`s\n * media element `play` function.\n *\n * @method Html5#play\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}\n */\n'play'].forEach(function (prop) {\n  Html5.prototype[prop] = function () {\n    return this.el_[prop]();\n  };\n});\nTech.withSourceHandlers(Html5);\n/**\n * Native source handler for Html5, simply passes the source to the media element.\n *\n * @property {Tech~SourceObject} source\n *        The source object\n *\n * @property {Html5} tech\n *        The instance of the HTML5 tech.\n */\n\nHtml5.nativeSourceHandler = {};\n/**\n * Check if the media element can play the given mime type.\n *\n * @param {string} type\n *        The mimetype to check\n *\n * @return {string}\n *         'probably', 'maybe', or '' (empty string)\n */\n\nHtml5.nativeSourceHandler.canPlayType = function (type) {\n  // IE without MediaPlayer throws an error (#519)\n  try {\n    return Html5.TEST_VID.canPlayType(type);\n  } catch (e) {\n    return '';\n  }\n};\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n *         The source object\n *\n * @param {Object} [options]\n *         Options to be passed to the tech.\n *\n * @return {string}\n *         'probably', 'maybe', or '' (empty string).\n */\n\n\nHtml5.nativeSourceHandler.canHandleSource = function (source, options) {\n  // If a type was provided we should rely on that\n  if (source.type) {\n    return Html5.nativeSourceHandler.canPlayType(source.type); // If no type, fall back to checking 'video/[EXTENSION]'\n  } else if (source.src) {\n    var ext = getFileExtension(source.src);\n    return Html5.nativeSourceHandler.canPlayType(\"video/\" + ext);\n  }\n\n  return '';\n};\n/**\n * Pass the source to the native media element.\n *\n * @param {Tech~SourceObject} source\n *        The source object\n *\n * @param {Html5} tech\n *        The instance of the Html5 tech\n *\n * @param {Object} [options]\n *        The options to pass to the source\n */\n\n\nHtml5.nativeSourceHandler.handleSource = function (source, tech, options) {\n  tech.setSrc(source.src);\n};\n/**\n * A noop for the native dispose function, as cleanup is not needed.\n */\n\n\nHtml5.nativeSourceHandler.dispose = function () {}; // Register the native source handler\n\n\nHtml5.registerSourceHandler(Html5.nativeSourceHandler);\nTech.registerTech('Html5', Html5);\n\n// on the player when they happen\n\nvar TECH_EVENTS_RETRIGGER = [\n/**\n * Fired while the user agent is downloading media data.\n *\n * @event Player#progress\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `progress` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechProgress_\n * @fires Player#progress\n * @listens Tech#progress\n */\n'progress',\n/**\n * Fires when the loading of an audio/video is aborted.\n *\n * @event Player#abort\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `abort` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechAbort_\n * @fires Player#abort\n * @listens Tech#abort\n */\n'abort',\n/**\n * Fires when the browser is intentionally not getting media data.\n *\n * @event Player#suspend\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `suspend` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechSuspend_\n * @fires Player#suspend\n * @listens Tech#suspend\n */\n'suspend',\n/**\n * Fires when the current playlist is empty.\n *\n * @event Player#emptied\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `emptied` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechEmptied_\n * @fires Player#emptied\n * @listens Tech#emptied\n */\n'emptied',\n/**\n * Fires when the browser is trying to get media data, but data is not available.\n *\n * @event Player#stalled\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechStalled_\n * @fires Player#stalled\n * @listens Tech#stalled\n */\n'stalled',\n/**\n * Fires when the browser has loaded meta data for the audio/video.\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `loadedmetadata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoadedmetadata_\n * @fires Player#loadedmetadata\n * @listens Tech#loadedmetadata\n */\n'loadedmetadata',\n/**\n * Fires when the browser has loaded the current frame of the audio/video.\n *\n * @event Player#loadeddata\n * @type {event}\n */\n\n/**\n * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoaddeddata_\n * @fires Player#loadeddata\n * @listens Tech#loadeddata\n */\n'loadeddata',\n/**\n * Fires when the current playback position has changed.\n *\n * @event Player#timeupdate\n * @type {event}\n */\n\n/**\n * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTimeUpdate_\n * @fires Player#timeupdate\n * @listens Tech#timeupdate\n */\n'timeupdate',\n/**\n * Fires when the video's intrinsic dimensions change\n *\n * @event Player#resize\n * @type {event}\n */\n\n/**\n * Retrigger the `resize` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechResize_\n * @fires Player#resize\n * @listens Tech#resize\n */\n'resize',\n/**\n * Fires when the volume has been changed\n *\n * @event Player#volumechange\n * @type {event}\n */\n\n/**\n * Retrigger the `volumechange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechVolumechange_\n * @fires Player#volumechange\n * @listens Tech#volumechange\n */\n'volumechange',\n/**\n * Fires when the text track has been changed\n *\n * @event Player#texttrackchange\n * @type {event}\n */\n\n/**\n * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTexttrackchange_\n * @fires Player#texttrackchange\n * @listens Tech#texttrackchange\n */\n'texttrackchange']; // events to queue when playback rate is zero\n// this is a hash for the sole purpose of mapping non-camel-cased event names\n// to camel-cased function names\n\nvar TECH_EVENTS_QUEUE = {\n  canplay: 'CanPlay',\n  canplaythrough: 'CanPlayThrough',\n  playing: 'Playing',\n  seeked: 'Seeked'\n};\nvar BREAKPOINT_ORDER = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'];\nvar BREAKPOINT_CLASSES = {}; // grep: vjs-layout-tiny\n// grep: vjs-layout-x-small\n// grep: vjs-layout-small\n// grep: vjs-layout-medium\n// grep: vjs-layout-large\n// grep: vjs-layout-x-large\n// grep: vjs-layout-huge\n\nBREAKPOINT_ORDER.forEach(function (k) {\n  var v = k.charAt(0) === 'x' ? \"x-\" + k.substring(1) : k;\n  BREAKPOINT_CLASSES[k] = \"vjs-layout-\" + v;\n});\nvar DEFAULT_BREAKPOINTS = {\n  tiny: 210,\n  xsmall: 320,\n  small: 425,\n  medium: 768,\n  large: 1440,\n  xlarge: 2560,\n  huge: Infinity\n};\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods\n * are used to initialize a video.\n *\n * After an instance has been created it can be accessed globally in two ways:\n * 1. By calling `videojs('example_video_1');`\n * 2. By using it directly via  `videojs.players.example_video_1;`\n *\n * @extends Component\n */\n\nvar Player = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(Player, _Component);\n\n  /**\n   * Create an instance of this class.\n   *\n   * @param {Element} tag\n   *        The original video DOM element used for configuring options.\n   *\n   * @param {Object} [options]\n   *        Object of option names and values.\n   *\n   * @param {Component~ReadyCallback} [ready]\n   *        Ready callback function.\n   */\n  function Player(tag, options, ready) {\n    var _this;\n\n    // Make sure tag ID exists\n    tag.id = tag.id || options.id || \"vjs_video_\" + newGUID(); // Set Options\n    // The options argument overrides options set in the video tag\n    // which overrides globally set options.\n    // This latter part coincides with the load order\n    // (tag must exist before Player)\n\n    options = assign(Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up\n    // player properties first, and can't use `this` before `super()`\n\n    options.initChildren = false; // Same with creating the element\n\n    options.createEl = false; // don't auto mixin the evented mixin\n\n    options.evented = false; // we don't want the player to report touch activity on itself\n    // see enableTouchActivity in Component\n\n    options.reportTouchActivity = false; // If language is not set, get the closest lang attribute\n\n    if (!options.language) {\n      if (typeof tag.closest === 'function') {\n        var closest = tag.closest('[lang]');\n\n        if (closest && closest.getAttribute) {\n          options.language = closest.getAttribute('lang');\n        }\n      } else {\n        var element = tag;\n\n        while (element && element.nodeType === 1) {\n          if (getAttributes(element).hasOwnProperty('lang')) {\n            options.language = element.getAttribute('lang');\n            break;\n          }\n\n          element = element.parentNode;\n        }\n      }\n    } // Run base component initializing with new options\n\n\n    _this = _Component.call(this, null, options, ready) || this; // Create bound methods for document listeners.\n\n    _this.boundDocumentFullscreenChange_ = function (e) {\n      return _this.documentFullscreenChange_(e);\n    };\n\n    _this.boundFullWindowOnEscKey_ = function (e) {\n      return _this.fullWindowOnEscKey(e);\n    };\n\n    _this.boundUpdateStyleEl_ = function (e) {\n      return _this.updateStyleEl_(e);\n    };\n\n    _this.boundApplyInitTime_ = function (e) {\n      return _this.applyInitTime_(e);\n    };\n\n    _this.boundUpdateCurrentBreakpoint_ = function (e) {\n      return _this.updateCurrentBreakpoint_(e);\n    };\n\n    _this.boundHandleTechClick_ = function (e) {\n      return _this.handleTechClick_(e);\n    };\n\n    _this.boundHandleTechDoubleClick_ = function (e) {\n      return _this.handleTechDoubleClick_(e);\n    };\n\n    _this.boundHandleTechTouchStart_ = function (e) {\n      return _this.handleTechTouchStart_(e);\n    };\n\n    _this.boundHandleTechTouchMove_ = function (e) {\n      return _this.handleTechTouchMove_(e);\n    };\n\n    _this.boundHandleTechTouchEnd_ = function (e) {\n      return _this.handleTechTouchEnd_(e);\n    };\n\n    _this.boundHandleTechTap_ = function (e) {\n      return _this.handleTechTap_(e);\n    }; // default isFullscreen_ to false\n\n\n    _this.isFullscreen_ = false; // create logger\n\n    _this.log = createLogger(_this.id_); // Hold our own reference to fullscreen api so it can be mocked in tests\n\n    _this.fsApi_ = FullscreenApi; // Tracks when a tech changes the poster\n\n    _this.isPosterFromTech_ = false; // Holds callback info that gets queued when playback rate is zero\n    // and a seek is happening\n\n    _this.queuedCallbacks_ = []; // Turn off API access because we're loading a new tech that might load asynchronously\n\n    _this.isReady_ = false; // Init state hasStarted_\n\n    _this.hasStarted_ = false; // Init state userActive_\n\n    _this.userActive_ = false; // Init debugEnabled_\n\n    _this.debugEnabled_ = false; // Init state audioOnlyMode_\n\n    _this.audioOnlyMode_ = false; // Init state audioPosterMode_\n\n    _this.audioPosterMode_ = false; // Init state audioOnlyCache_\n\n    _this.audioOnlyCache_ = {\n      playerHeight: null,\n      hiddenChildren: []\n    }; // if the global option object was accidentally blown away by\n    // someone, bail early with an informative error\n\n    if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {\n      throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?');\n    } // Store the original tag used to set options\n\n\n    _this.tag = tag; // Store the tag attributes used to restore html5 element\n\n    _this.tagAttributes = tag && getAttributes(tag); // Update current language\n\n    _this.language(_this.options_.language); // Update Supported Languages\n\n\n    if (options.languages) {\n      // Normalise player option languages to lowercase\n      var languagesToLower = {};\n      Object.getOwnPropertyNames(options.languages).forEach(function (name) {\n        languagesToLower[name.toLowerCase()] = options.languages[name];\n      });\n      _this.languages_ = languagesToLower;\n    } else {\n      _this.languages_ = Player.prototype.options_.languages;\n    }\n\n    _this.resetCache_(); // Set poster\n\n\n    _this.poster_ = options.poster || ''; // Set controls\n\n    _this.controls_ = !!options.controls; // Original tag settings stored in options\n    // now remove immediately so native controls don't flash.\n    // May be turned back on by HTML5 tech if nativeControlsForTouch is true\n\n    tag.controls = false;\n    tag.removeAttribute('controls');\n    _this.changingSrc_ = false;\n    _this.playCallbacks_ = [];\n    _this.playTerminatedQueue_ = []; // the attribute overrides the option\n\n    if (tag.hasAttribute('autoplay')) {\n      _this.autoplay(true);\n    } else {\n      // otherwise use the setter to validate and\n      // set the correct value.\n      _this.autoplay(_this.options_.autoplay);\n    } // check plugins\n\n\n    if (options.plugins) {\n      Object.keys(options.plugins).forEach(function (name) {\n        if (typeof _this[name] !== 'function') {\n          throw new Error(\"plugin \\\"\" + name + \"\\\" does not exist\");\n        }\n      });\n    }\n    /*\n     * Store the internal state of scrubbing\n     *\n     * @private\n     * @return {Boolean} True if the user is scrubbing\n     */\n\n\n    _this.scrubbing_ = false;\n    _this.el_ = _this.createEl(); // Make this an evented object and use `el_` as its event bus.\n\n    evented(_assertThisInitialized(_this), {\n      eventBusKey: 'el_'\n    }); // listen to document and player fullscreenchange handlers so we receive those events\n    // before a user can receive them so we can update isFullscreen appropriately.\n    // make sure that we listen to fullscreenchange events before everything else to make sure that\n    // our isFullscreen method is updated properly for internal components as well as external.\n\n    if (_this.fsApi_.requestFullscreen) {\n      on(document, _this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);\n\n      _this.on(_this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);\n    }\n\n    if (_this.fluid_) {\n      _this.on(['playerreset', 'resize'], _this.boundUpdateStyleEl_);\n    } // We also want to pass the original player options to each component and plugin\n    // as well so they don't need to reach back into the player for options later.\n    // We also need to do another copy of this.options_ so we don't end up with\n    // an infinite loop.\n\n\n    var playerOptionsCopy = mergeOptions$3(_this.options_); // Load plugins\n\n    if (options.plugins) {\n      Object.keys(options.plugins).forEach(function (name) {\n        _this[name](options.plugins[name]);\n      });\n    } // Enable debug mode to fire debugon event for all plugins.\n\n\n    if (options.debug) {\n      _this.debug(true);\n    }\n\n    _this.options_.playerOptions = playerOptionsCopy;\n    _this.middleware_ = [];\n\n    _this.playbackRates(options.playbackRates);\n\n    _this.initChildren(); // Set isAudio based on whether or not an audio tag was used\n\n\n    _this.isAudio(tag.nodeName.toLowerCase() === 'audio'); // Update controls className. Can't do this when the controls are initially\n    // set because the element doesn't exist yet.\n\n\n    if (_this.controls()) {\n      _this.addClass('vjs-controls-enabled');\n    } else {\n      _this.addClass('vjs-controls-disabled');\n    } // Set ARIA label and region role depending on player type\n\n\n    _this.el_.setAttribute('role', 'region');\n\n    if (_this.isAudio()) {\n      _this.el_.setAttribute('aria-label', _this.localize('Audio Player'));\n    } else {\n      _this.el_.setAttribute('aria-label', _this.localize('Video Player'));\n    }\n\n    if (_this.isAudio()) {\n      _this.addClass('vjs-audio');\n    }\n\n    if (_this.flexNotSupported_()) {\n      _this.addClass('vjs-no-flex');\n    } // TODO: Make this smarter. Toggle user state between touching/mousing\n    // using events, since devices can have both touch and mouse events.\n    // TODO: Make this check be performed again when the window switches between monitors\n    // (See https://github.com/videojs/video.js/issues/5683)\n\n\n    if (TOUCH_ENABLED) {\n      _this.addClass('vjs-touch-enabled');\n    } // iOS Safari has broken hover handling\n\n\n    if (!IS_IOS) {\n      _this.addClass('vjs-workinghover');\n    } // Make player easily findable by ID\n\n\n    Player.players[_this.id_] = _assertThisInitialized(_this); // Add a major version class to aid css in plugins\n\n    var majorVersion = version$5.split('.')[0];\n\n    _this.addClass(\"vjs-v\" + majorVersion); // When the player is first initialized, trigger activity so components\n    // like the control bar show themselves if needed\n\n\n    _this.userActive(true);\n\n    _this.reportUserActivity();\n\n    _this.one('play', function (e) {\n      return _this.listenForUserActivity_(e);\n    });\n\n    _this.on('stageclick', function (e) {\n      return _this.handleStageClick_(e);\n    });\n\n    _this.on('keydown', function (e) {\n      return _this.handleKeyDown(e);\n    });\n\n    _this.on('languagechange', function (e) {\n      return _this.handleLanguagechange(e);\n    });\n\n    _this.breakpoints(_this.options_.breakpoints);\n\n    _this.responsive(_this.options_.responsive); // Calling both the audio mode methods after the player is fully\n    // setup to be able to listen to the events triggered by them\n\n\n    _this.on('ready', function () {\n      // Calling the audioPosterMode method first so that\n      // the audioOnlyMode can take precedence when both options are set to true\n      _this.audioPosterMode(_this.options_.audioPosterMode);\n\n      _this.audioOnlyMode(_this.options_.audioOnlyMode);\n    });\n\n    return _this;\n  }\n  /**\n   * Destroys the video player and does any necessary cleanup.\n   *\n   * This is especially helpful if you are dynamically adding and removing videos\n   * to/from the DOM.\n   *\n   * @fires Player#dispose\n   */\n\n\n  var _proto = Player.prototype;\n\n  _proto.dispose = function dispose() {\n    var _this2 = this;\n\n    /**\n     * Called when the player is being disposed of.\n     *\n     * @event Player#dispose\n     * @type {EventTarget~Event}\n     */\n    this.trigger('dispose'); // prevent dispose from being called twice\n\n    this.off('dispose'); // Make sure all player-specific document listeners are unbound. This is\n\n    off(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);\n    off(document, 'keydown', this.boundFullWindowOnEscKey_);\n\n    if (this.styleEl_ && this.styleEl_.parentNode) {\n      this.styleEl_.parentNode.removeChild(this.styleEl_);\n      this.styleEl_ = null;\n    } // Kill reference to this player\n\n\n    Player.players[this.id_] = null;\n\n    if (this.tag && this.tag.player) {\n      this.tag.player = null;\n    }\n\n    if (this.el_ && this.el_.player) {\n      this.el_.player = null;\n    }\n\n    if (this.tech_) {\n      this.tech_.dispose();\n      this.isPosterFromTech_ = false;\n      this.poster_ = '';\n    }\n\n    if (this.playerElIngest_) {\n      this.playerElIngest_ = null;\n    }\n\n    if (this.tag) {\n      this.tag = null;\n    }\n\n    clearCacheForPlayer(this); // remove all event handlers for track lists\n    // all tracks and track listeners are removed on\n    // tech dispose\n\n    ALL.names.forEach(function (name) {\n      var props = ALL[name];\n\n      var list = _this2[props.getterName](); // if it is not a native list\n      // we have to manually remove event listeners\n\n\n      if (list && list.off) {\n        list.off();\n      }\n    }); // the actual .el_ is removed here, or replaced if\n\n    _Component.prototype.dispose.call(this, {\n      restoreEl: this.options_.restoreEl\n    });\n  }\n  /**\n   * Create the `Player`'s DOM element.\n   *\n   * @return {Element}\n   *         The DOM element that gets created.\n   */\n  ;\n\n  _proto.createEl = function createEl() {\n    var tag = this.tag;\n    var el;\n    var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');\n    var divEmbed = this.tag.tagName.toLowerCase() === 'video-js';\n\n    if (playerElIngest) {\n      el = this.el_ = tag.parentNode;\n    } else if (!divEmbed) {\n      el = this.el_ = _Component.prototype.createEl.call(this, 'div');\n    } // Copy over all the attributes from the tag, including ID and class\n    // ID will now reference player box, not the video tag\n\n\n    var attrs = getAttributes(tag);\n\n    if (divEmbed) {\n      el = this.el_ = tag;\n      tag = this.tag = document.createElement('video');\n\n      while (el.children.length) {\n        tag.appendChild(el.firstChild);\n      }\n\n      if (!hasClass(el, 'video-js')) {\n        addClass(el, 'video-js');\n      }\n\n      el.appendChild(tag);\n      playerElIngest = this.playerElIngest_ = el; // move properties over from our custom `video-js` element\n      // to our new `video` element. This will move things like\n      // `src` or `controls` that were set via js before the player\n      // was initialized.\n\n      Object.keys(el).forEach(function (k) {\n        try {\n          tag[k] = el[k];\n        } catch (e) {// we got a a property like outerHTML which we can't actually copy, ignore it\n        }\n      });\n    } // set tabindex to -1 to remove the video element from the focus order\n\n\n    tag.setAttribute('tabindex', '-1');\n    attrs.tabindex = '-1'; // Workaround for #4583 (JAWS+IE doesn't announce BPB or play button), and\n    // for the same issue with Chrome (on Windows) with JAWS.\n    // See https://github.com/FreedomScientific/VFO-standards-support/issues/78\n    // Note that we can't detect if JAWS is being used, but this ARIA attribute\n    //  doesn't change behavior of IE11 or Chrome if JAWS is not being used\n\n    if (IE_VERSION || IS_CHROME && IS_WINDOWS) {\n      tag.setAttribute('role', 'application');\n      attrs.role = 'application';\n    } // Remove width/height attrs from tag so CSS can make it 100% width/height\n\n\n    tag.removeAttribute('width');\n    tag.removeAttribute('height');\n\n    if ('width' in attrs) {\n      delete attrs.width;\n    }\n\n    if ('height' in attrs) {\n      delete attrs.height;\n    }\n\n    Object.getOwnPropertyNames(attrs).forEach(function (attr) {\n      // don't copy over the class attribute to the player element when we're in a div embed\n      // the class is already set up properly in the divEmbed case\n      // and we want to make sure that the `video-js` class doesn't get lost\n      if (!(divEmbed && attr === 'class')) {\n        el.setAttribute(attr, attrs[attr]);\n      }\n\n      if (divEmbed) {\n        tag.setAttribute(attr, attrs[attr]);\n      }\n    }); // Update tag id/class for use as HTML5 playback tech\n    // Might think we should do this after embedding in container so .vjs-tech class\n    // doesn't flash 100% width/height, but class only applies with .video-js parent\n\n    tag.playerId = tag.id;\n    tag.id += '_html5_api';\n    tag.className = 'vjs-tech'; // Make player findable on elements\n\n    tag.player = el.player = this; // Default state of video is paused\n\n    this.addClass('vjs-paused'); // Add a style element in the player that we'll use to set the width/height\n    // of the player in a way that's still overrideable by CSS, just like the\n    // video element\n\n    if (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {\n      this.styleEl_ = createStyleElement('vjs-styles-dimensions');\n      var defaultsStyleEl = $('.vjs-styles-defaults');\n      var head = $('head');\n      head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);\n    }\n\n    this.fill_ = false;\n    this.fluid_ = false; // Pass in the width/height/aspectRatio options which will update the style el\n\n    this.width(this.options_.width);\n    this.height(this.options_.height);\n    this.fill(this.options_.fill);\n    this.fluid(this.options_.fluid);\n    this.aspectRatio(this.options_.aspectRatio); // support both crossOrigin and crossorigin to reduce confusion and issues around the name\n\n    this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin); // Hide any links within the video/audio tag,\n    // because IE doesn't hide them completely from screen readers.\n\n    var links = tag.getElementsByTagName('a');\n\n    for (var i = 0; i < links.length; i++) {\n      var linkEl = links.item(i);\n      addClass(linkEl, 'vjs-hidden');\n      linkEl.setAttribute('hidden', 'hidden');\n    } // insertElFirst seems to cause the networkState to flicker from 3 to 2, so\n    // keep track of the original for later so we can know if the source originally failed\n\n\n    tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container\n\n    if (tag.parentNode && !playerElIngest) {\n      tag.parentNode.insertBefore(el, tag);\n    } // insert the tag as the first child of the player element\n    // then manually add it to the children array so that this.addChild\n    // will work properly for other components\n    //\n    // Breaks iPhone, fixed in HTML5 setup.\n\n\n    prependTo(tag, el);\n    this.children_.unshift(tag); // Set lang attr on player to ensure CSS :lang() in consistent with player\n    // if it's been set to something different to the doc\n\n    this.el_.setAttribute('lang', this.language_);\n    this.el_.setAttribute('translate', 'no');\n    this.el_ = el;\n    return el;\n  }\n  /**\n   * Get or set the `Player`'s crossOrigin option. For the HTML5 player, this\n   * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n   * behavior.\n   *\n   * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n   *\n   * @param {string} [value]\n   *        The value to set the `Player`'s crossOrigin to. If an argument is\n   *        given, must be one of `anonymous` or `use-credentials`.\n   *\n   * @return {string|undefined}\n   *         - The current crossOrigin value of the `Player` when getting.\n   *         - undefined when setting\n   */\n  ;\n\n  _proto.crossOrigin = function crossOrigin(value) {\n    if (!value) {\n      return this.techGet_('crossOrigin');\n    }\n\n    if (value !== 'anonymous' && value !== 'use-credentials') {\n      log$1.warn(\"crossOrigin must be \\\"anonymous\\\" or \\\"use-credentials\\\", given \\\"\" + value + \"\\\"\");\n      return;\n    }\n\n    this.techCall_('setCrossOrigin', value);\n    return;\n  }\n  /**\n   * A getter/setter for the `Player`'s width. Returns the player's configured value.\n   * To get the current width use `currentWidth()`.\n   *\n   * @param {number} [value]\n   *        The value to set the `Player`'s width to.\n   *\n   * @return {number}\n   *         The current width of the `Player` when getting.\n   */\n  ;\n\n  _proto.width = function width(value) {\n    return this.dimension('width', value);\n  }\n  /**\n   * A getter/setter for the `Player`'s height. Returns the player's configured value.\n   * To get the current height use `currentheight()`.\n   *\n   * @param {number} [value]\n   *        The value to set the `Player`'s heigth to.\n   *\n   * @return {number}\n   *         The current height of the `Player` when getting.\n   */\n  ;\n\n  _proto.height = function height(value) {\n    return this.dimension('height', value);\n  }\n  /**\n   * A getter/setter for the `Player`'s width & height.\n   *\n   * @param {string} dimension\n   *        This string can be:\n   *        - 'width'\n   *        - 'height'\n   *\n   * @param {number} [value]\n   *        Value for dimension specified in the first argument.\n   *\n   * @return {number}\n   *         The dimension arguments value when getting (width/height).\n   */\n  ;\n\n  _proto.dimension = function dimension(_dimension, value) {\n    var privDimension = _dimension + '_';\n\n    if (value === undefined) {\n      return this[privDimension] || 0;\n    }\n\n    if (value === '' || value === 'auto') {\n      // If an empty string is given, reset the dimension to be automatic\n      this[privDimension] = undefined;\n      this.updateStyleEl_();\n      return;\n    }\n\n    var parsedVal = parseFloat(value);\n\n    if (isNaN(parsedVal)) {\n      log$1.error(\"Improper value \\\"\" + value + \"\\\" supplied for for \" + _dimension);\n      return;\n    }\n\n    this[privDimension] = parsedVal;\n    this.updateStyleEl_();\n  }\n  /**\n   * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.\n   *\n   * Turning this on will turn off fill mode.\n   *\n   * @param {boolean} [bool]\n   *        - A value of true adds the class.\n   *        - A value of false removes the class.\n   *        - No value will be a getter.\n   *\n   * @return {boolean|undefined}\n   *         - The value of fluid when getting.\n   *         - `undefined` when setting.\n   */\n  ;\n\n  _proto.fluid = function fluid(bool) {\n    var _this3 = this;\n\n    if (bool === undefined) {\n      return !!this.fluid_;\n    }\n\n    this.fluid_ = !!bool;\n\n    if (isEvented(this)) {\n      this.off(['playerreset', 'resize'], this.boundUpdateStyleEl_);\n    }\n\n    if (bool) {\n      this.addClass('vjs-fluid');\n      this.fill(false);\n      addEventedCallback(this, function () {\n        _this3.on(['playerreset', 'resize'], _this3.boundUpdateStyleEl_);\n      });\n    } else {\n      this.removeClass('vjs-fluid');\n    }\n\n    this.updateStyleEl_();\n  }\n  /**\n   * A getter/setter/toggler for the vjs-fill `className` on the `Player`.\n   *\n   * Turning this on will turn off fluid mode.\n   *\n   * @param {boolean} [bool]\n   *        - A value of true adds the class.\n   *        - A value of false removes the class.\n   *        - No value will be a getter.\n   *\n   * @return {boolean|undefined}\n   *         - The value of fluid when getting.\n   *         - `undefined` when setting.\n   */\n  ;\n\n  _proto.fill = function fill(bool) {\n    if (bool === undefined) {\n      return !!this.fill_;\n    }\n\n    this.fill_ = !!bool;\n\n    if (bool) {\n      this.addClass('vjs-fill');\n      this.fluid(false);\n    } else {\n      this.removeClass('vjs-fill');\n    }\n  }\n  /**\n   * Get/Set the aspect ratio\n   *\n   * @param {string} [ratio]\n   *        Aspect ratio for player\n   *\n   * @return {string|undefined}\n   *         returns the current aspect ratio when getting\n   */\n\n  /**\n   * A getter/setter for the `Player`'s aspect ratio.\n   *\n   * @param {string} [ratio]\n   *        The value to set the `Player`'s aspect ratio to.\n   *\n   * @return {string|undefined}\n   *         - The current aspect ratio of the `Player` when getting.\n   *         - undefined when setting\n   */\n  ;\n\n  _proto.aspectRatio = function aspectRatio(ratio) {\n    if (ratio === undefined) {\n      return this.aspectRatio_;\n    } // Check for width:height format\n\n\n    if (!/^\\d+\\:\\d+$/.test(ratio)) {\n      throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');\n    }\n\n    this.aspectRatio_ = ratio; // We're assuming if you set an aspect ratio you want fluid mode,\n    // because in fixed mode you could calculate width and height yourself.\n\n    this.fluid(true);\n    this.updateStyleEl_();\n  }\n  /**\n   * Update styles of the `Player` element (height, width and aspect ratio).\n   *\n   * @private\n   * @listens Tech#loadedmetadata\n   */\n  ;\n\n  _proto.updateStyleEl_ = function updateStyleEl_() {\n    if (window$1.VIDEOJS_NO_DYNAMIC_STYLE === true) {\n      var _width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;\n\n      var _height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;\n\n      var techEl = this.tech_ && this.tech_.el();\n\n      if (techEl) {\n        if (_width >= 0) {\n          techEl.width = _width;\n        }\n\n        if (_height >= 0) {\n          techEl.height = _height;\n        }\n      }\n\n      return;\n    }\n\n    var width;\n    var height;\n    var aspectRatio;\n    var idClass; // The aspect ratio is either used directly or to calculate width and height.\n\n    if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {\n      // Use any aspectRatio that's been specifically set\n      aspectRatio = this.aspectRatio_;\n    } else if (this.videoWidth() > 0) {\n      // Otherwise try to get the aspect ratio from the video metadata\n      aspectRatio = this.videoWidth() + ':' + this.videoHeight();\n    } else {\n      // Or use a default. The video element's is 2:1, but 16:9 is more common.\n      aspectRatio = '16:9';\n    } // Get the ratio as a decimal we can use to calculate dimensions\n\n\n    var ratioParts = aspectRatio.split(':');\n    var ratioMultiplier = ratioParts[1] / ratioParts[0];\n\n    if (this.width_ !== undefined) {\n      // Use any width that's been specifically set\n      width = this.width_;\n    } else if (this.height_ !== undefined) {\n      // Or calulate the width from the aspect ratio if a height has been set\n      width = this.height_ / ratioMultiplier;\n    } else {\n      // Or use the video's metadata, or use the video el's default of 300\n      width = this.videoWidth() || 300;\n    }\n\n    if (this.height_ !== undefined) {\n      // Use any height that's been specifically set\n      height = this.height_;\n    } else {\n      // Otherwise calculate the height from the ratio and the width\n      height = width * ratioMultiplier;\n    } // Ensure the CSS class is valid by starting with an alpha character\n\n\n    if (/^[^a-zA-Z]/.test(this.id())) {\n      idClass = 'dimensions-' + this.id();\n    } else {\n      idClass = this.id() + '-dimensions';\n    } // Ensure the right class is still on the player for the style element\n\n\n    this.addClass(idClass);\n    setTextContent(this.styleEl_, \"\\n      .\" + idClass + \" {\\n        width: \" + width + \"px;\\n        height: \" + height + \"px;\\n      }\\n\\n      .\" + idClass + \".vjs-fluid:not(.vjs-audio-only-mode) {\\n        padding-top: \" + ratioMultiplier * 100 + \"%;\\n      }\\n    \");\n  }\n  /**\n   * Load/Create an instance of playback {@link Tech} including element\n   * and API methods. Then append the `Tech` element in `Player` as a child.\n   *\n   * @param {string} techName\n   *        name of the playback technology\n   *\n   * @param {string} source\n   *        video source\n   *\n   * @private\n   */\n  ;\n\n  _proto.loadTech_ = function loadTech_(techName, source) {\n    var _this4 = this;\n\n    // Pause and remove current playback technology\n    if (this.tech_) {\n      this.unloadTech_();\n    }\n\n    var titleTechName = toTitleCase$1(techName);\n    var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); // get rid of the HTML5 video tag as soon as we are using another tech\n\n    if (titleTechName !== 'Html5' && this.tag) {\n      Tech.getTech('Html5').disposeMediaElement(this.tag);\n      this.tag.player = null;\n      this.tag = null;\n    }\n\n    this.techName_ = titleTechName; // Turn off API access because we're loading a new tech that might load asynchronously\n\n    this.isReady_ = false;\n    var autoplay = this.autoplay(); // if autoplay is a string (or `true` with normalizeAutoplay: true) we pass false to the tech\n    // because the player is going to handle autoplay on `loadstart`\n\n    if (typeof this.autoplay() === 'string' || this.autoplay() === true && this.options_.normalizeAutoplay) {\n      autoplay = false;\n    } // Grab tech-specific options from player options and add source and parent element to use.\n\n\n    var techOptions = {\n      source: source,\n      autoplay: autoplay,\n      'nativeControlsForTouch': this.options_.nativeControlsForTouch,\n      'playerId': this.id(),\n      'techId': this.id() + \"_\" + camelTechName + \"_api\",\n      'playsinline': this.options_.playsinline,\n      'preload': this.options_.preload,\n      'loop': this.options_.loop,\n      'disablePictureInPicture': this.options_.disablePictureInPicture,\n      'muted': this.options_.muted,\n      'poster': this.poster(),\n      'language': this.language(),\n      'playerElIngest': this.playerElIngest_ || false,\n      'vtt.js': this.options_['vtt.js'],\n      'canOverridePoster': !!this.options_.techCanOverridePoster,\n      'enableSourceset': this.options_.enableSourceset,\n      'Promise': this.options_.Promise\n    };\n    ALL.names.forEach(function (name) {\n      var props = ALL[name];\n      techOptions[props.getterName] = _this4[props.privateName];\n    });\n    assign(techOptions, this.options_[titleTechName]);\n    assign(techOptions, this.options_[camelTechName]);\n    assign(techOptions, this.options_[techName.toLowerCase()]);\n\n    if (this.tag) {\n      techOptions.tag = this.tag;\n    }\n\n    if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {\n      techOptions.startTime = this.cache_.currentTime;\n    } // Initialize tech instance\n\n\n    var TechClass = Tech.getTech(techName);\n\n    if (!TechClass) {\n      throw new Error(\"No Tech named '\" + titleTechName + \"' exists! '\" + titleTechName + \"' should be registered using videojs.registerTech()'\");\n    }\n\n    this.tech_ = new TechClass(techOptions); // player.triggerReady is always async, so don't need this to be async\n\n    this.tech_.ready(bind(this, this.handleTechReady_), true);\n    textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_); // Listen to all HTML5-defined events and trigger them on the player\n\n    TECH_EVENTS_RETRIGGER.forEach(function (event) {\n      _this4.on(_this4.tech_, event, function (e) {\n        return _this4[\"handleTech\" + toTitleCase$1(event) + \"_\"](e);\n      });\n    });\n    Object.keys(TECH_EVENTS_QUEUE).forEach(function (event) {\n      _this4.on(_this4.tech_, event, function (eventObj) {\n        if (_this4.tech_.playbackRate() === 0 && _this4.tech_.seeking()) {\n          _this4.queuedCallbacks_.push({\n            callback: _this4[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"].bind(_this4),\n            event: eventObj\n          });\n\n          return;\n        }\n\n        _this4[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"](eventObj);\n      });\n    });\n    this.on(this.tech_, 'loadstart', function (e) {\n      return _this4.handleTechLoadStart_(e);\n    });\n    this.on(this.tech_, 'sourceset', function (e) {\n      return _this4.handleTechSourceset_(e);\n    });\n    this.on(this.tech_, 'waiting', function (e) {\n      return _this4.handleTechWaiting_(e);\n    });\n    this.on(this.tech_, 'ended', function (e) {\n      return _this4.handleTechEnded_(e);\n    });\n    this.on(this.tech_, 'seeking', function (e) {\n      return _this4.handleTechSeeking_(e);\n    });\n    this.on(this.tech_, 'play', function (e) {\n      return _this4.handleTechPlay_(e);\n    });\n    this.on(this.tech_, 'firstplay', function (e) {\n      return _this4.handleTechFirstPlay_(e);\n    });\n    this.on(this.tech_, 'pause', function (e) {\n      return _this4.handleTechPause_(e);\n    });\n    this.on(this.tech_, 'durationchange', function (e) {\n      return _this4.handleTechDurationChange_(e);\n    });\n    this.on(this.tech_, 'fullscreenchange', function (e, data) {\n      return _this4.handleTechFullscreenChange_(e, data);\n    });\n    this.on(this.tech_, 'fullscreenerror', function (e, err) {\n      return _this4.handleTechFullscreenError_(e, err);\n    });\n    this.on(this.tech_, 'enterpictureinpicture', function (e) {\n      return _this4.handleTechEnterPictureInPicture_(e);\n    });\n    this.on(this.tech_, 'leavepictureinpicture', function (e) {\n      return _this4.handleTechLeavePictureInPicture_(e);\n    });\n    this.on(this.tech_, 'error', function (e) {\n      return _this4.handleTechError_(e);\n    });\n    this.on(this.tech_, 'posterchange', function (e) {\n      return _this4.handleTechPosterChange_(e);\n    });\n    this.on(this.tech_, 'textdata', function (e) {\n      return _this4.handleTechTextData_(e);\n    });\n    this.on(this.tech_, 'ratechange', function (e) {\n      return _this4.handleTechRateChange_(e);\n    });\n    this.on(this.tech_, 'loadedmetadata', this.boundUpdateStyleEl_);\n    this.usingNativeControls(this.techGet_('controls'));\n\n    if (this.controls() && !this.usingNativeControls()) {\n      this.addTechControlsListeners_();\n    } // Add the tech element in the DOM if it was not already there\n    // Make sure to not insert the original video element if using Html5\n\n\n    if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) {\n      prependTo(this.tech_.el(), this.el());\n    } // Get rid of the original video tag reference after the first tech is loaded\n\n\n    if (this.tag) {\n      this.tag.player = null;\n      this.tag = null;\n    }\n  }\n  /**\n   * Unload and dispose of the current playback {@link Tech}.\n   *\n   * @private\n   */\n  ;\n\n  _proto.unloadTech_ = function unloadTech_() {\n    var _this5 = this;\n\n    // Save the current text tracks so that we can reuse the same text tracks with the next tech\n    ALL.names.forEach(function (name) {\n      var props = ALL[name];\n      _this5[props.privateName] = _this5[props.getterName]();\n    });\n    this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);\n    this.isReady_ = false;\n    this.tech_.dispose();\n    this.tech_ = false;\n\n    if (this.isPosterFromTech_) {\n      this.poster_ = '';\n      this.trigger('posterchange');\n    }\n\n    this.isPosterFromTech_ = false;\n  }\n  /**\n   * Return a reference to the current {@link Tech}.\n   * It will print a warning by default about the danger of using the tech directly\n   * but any argument that is passed in will silence the warning.\n   *\n   * @param {*} [safety]\n   *        Anything passed in to silence the warning\n   *\n   * @return {Tech}\n   *         The Tech\n   */\n  ;\n\n  _proto.tech = function tech(safety) {\n    if (safety === undefined) {\n      log$1.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');\n    }\n\n    return this.tech_;\n  }\n  /**\n   * Set up click and touch listeners for the playback element\n   *\n   * - On desktops: a click on the video itself will toggle playback\n   * - On mobile devices: a click on the video toggles controls\n   *   which is done by toggling the user state between active and\n   *   inactive\n   * - A tap can signal that a user has become active or has become inactive\n   *   e.g. a quick tap on an iPhone movie should reveal the controls. Another\n   *   quick tap should hide them again (signaling the user is in an inactive\n   *   viewing state)\n   * - In addition to this, we still want the user to be considered inactive after\n   *   a few seconds of inactivity.\n   *\n   * > Note: the only part of iOS interaction we can't mimic with this setup\n   * is a touch and hold on the video element counting as activity in order to\n   * keep the controls showing, but that shouldn't be an issue. A touch and hold\n   * on any controls will still keep the user active\n   *\n   * @private\n   */\n  ;\n\n  _proto.addTechControlsListeners_ = function addTechControlsListeners_() {\n    // Make sure to remove all the previous listeners in case we are called multiple times.\n    this.removeTechControlsListeners_();\n    this.on(this.tech_, 'click', this.boundHandleTechClick_);\n    this.on(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_); // If the controls were hidden we don't want that to change without a tap event\n    // so we'll check if the controls were already showing before reporting user\n    // activity\n\n    this.on(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n    this.on(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n    this.on(this.tech_, 'touchend', this.boundHandleTechTouchEnd_); // The tap listener needs to come after the touchend listener because the tap\n    // listener cancels out any reportedUserActivity when setting userActive(false)\n\n    this.on(this.tech_, 'tap', this.boundHandleTechTap_);\n  }\n  /**\n   * Remove the listeners used for click and tap controls. This is needed for\n   * toggling to controls disabled, where a tap/touch should do nothing.\n   *\n   * @private\n   */\n  ;\n\n  _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {\n    // We don't want to just use `this.off()` because there might be other needed\n    // listeners added by techs that extend this.\n    this.off(this.tech_, 'tap', this.boundHandleTechTap_);\n    this.off(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n    this.off(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n    this.off(this.tech_, 'touchend', this.boundHandleTechTouchEnd_);\n    this.off(this.tech_, 'click', this.boundHandleTechClick_);\n    this.off(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_);\n  }\n  /**\n   * Player waits for the tech to be ready\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleTechReady_ = function handleTechReady_() {\n    this.triggerReady(); // Keep the same volume as before\n\n    if (this.cache_.volume) {\n      this.techCall_('setVolume', this.cache_.volume);\n    } // Look if the tech found a higher resolution poster while loading\n\n\n    this.handleTechPosterChange_(); // Update the duration if available\n\n    this.handleTechDurationChange_();\n  }\n  /**\n   * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This\n   * function will also trigger {@link Player#firstplay} if it is the first loadstart\n   * for a video.\n   *\n   * @fires Player#loadstart\n   * @fires Player#firstplay\n   * @listens Tech#loadstart\n   * @private\n   */\n  ;\n\n  _proto.handleTechLoadStart_ = function handleTechLoadStart_() {\n    // TODO: Update to use `emptied` event instead. See #1277.\n    this.removeClass('vjs-ended');\n    this.removeClass('vjs-seeking'); // reset the error state\n\n    this.error(null); // Update the duration\n\n    this.handleTechDurationChange_(); // If it's already playing we want to trigger a firstplay event now.\n    // The firstplay event relies on both the play and loadstart events\n    // which can happen in any order for a new source\n\n    if (!this.paused()) {\n      /**\n       * Fired when the user agent begins looking for media data\n       *\n       * @event Player#loadstart\n       * @type {EventTarget~Event}\n       */\n      this.trigger('loadstart');\n      this.trigger('firstplay');\n    } else {\n      // reset the hasStarted state\n      this.hasStarted(false);\n      this.trigger('loadstart');\n    } // autoplay happens after loadstart for the browser,\n    // so we mimic that behavior\n\n\n    this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? 'play' : this.autoplay());\n  }\n  /**\n   * Handle autoplay string values, rather than the typical boolean\n   * values that should be handled by the tech. Note that this is not\n   * part of any specification. Valid values and what they do can be\n   * found on the autoplay getter at Player#autoplay()\n   */\n  ;\n\n  _proto.manualAutoplay_ = function manualAutoplay_(type) {\n    var _this6 = this;\n\n    if (!this.tech_ || typeof type !== 'string') {\n      return;\n    } // Save original muted() value, set muted to true, and attempt to play().\n    // On promise rejection, restore muted from saved value\n\n\n    var resolveMuted = function resolveMuted() {\n      var previouslyMuted = _this6.muted();\n\n      _this6.muted(true);\n\n      var restoreMuted = function restoreMuted() {\n        _this6.muted(previouslyMuted);\n      }; // restore muted on play terminatation\n\n\n      _this6.playTerminatedQueue_.push(restoreMuted);\n\n      var mutedPromise = _this6.play();\n\n      if (!isPromise(mutedPromise)) {\n        return;\n      }\n\n      return mutedPromise[\"catch\"](function (err) {\n        restoreMuted();\n        throw new Error(\"Rejection at manualAutoplay. Restoring muted value. \" + (err ? err : ''));\n      });\n    };\n\n    var promise; // if muted defaults to true\n    // the only thing we can do is call play\n\n    if (type === 'any' && !this.muted()) {\n      promise = this.play();\n\n      if (isPromise(promise)) {\n        promise = promise[\"catch\"](resolveMuted);\n      }\n    } else if (type === 'muted' && !this.muted()) {\n      promise = resolveMuted();\n    } else {\n      promise = this.play();\n    }\n\n    if (!isPromise(promise)) {\n      return;\n    }\n\n    return promise.then(function () {\n      _this6.trigger({\n        type: 'autoplay-success',\n        autoplay: type\n      });\n    })[\"catch\"](function () {\n      _this6.trigger({\n        type: 'autoplay-failure',\n        autoplay: type\n      });\n    });\n  }\n  /**\n   * Update the internal source caches so that we return the correct source from\n   * `src()`, `currentSource()`, and `currentSources()`.\n   *\n   * > Note: `currentSources` will not be updated if the source that is passed in exists\n   *         in the current `currentSources` cache.\n   *\n   *\n   * @param {Tech~SourceObject} srcObj\n   *        A string or object source to update our caches to.\n   */\n  ;\n\n  _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {\n    if (srcObj === void 0) {\n      srcObj = '';\n    }\n\n    var src = srcObj;\n    var type = '';\n\n    if (typeof src !== 'string') {\n      src = srcObj.src;\n      type = srcObj.type;\n    } // make sure all the caches are set to default values\n    // to prevent null checking\n\n\n    this.cache_.source = this.cache_.source || {};\n    this.cache_.sources = this.cache_.sources || []; // try to get the type of the src that was passed in\n\n    if (src && !type) {\n      type = findMimetype(this, src);\n    } // update `currentSource` cache always\n\n\n    this.cache_.source = mergeOptions$3({}, srcObj, {\n      src: src,\n      type: type\n    });\n    var matchingSources = this.cache_.sources.filter(function (s) {\n      return s.src && s.src === src;\n    });\n    var sourceElSources = [];\n    var sourceEls = this.$$('source');\n    var matchingSourceEls = [];\n\n    for (var i = 0; i < sourceEls.length; i++) {\n      var sourceObj = getAttributes(sourceEls[i]);\n      sourceElSources.push(sourceObj);\n\n      if (sourceObj.src && sourceObj.src === src) {\n        matchingSourceEls.push(sourceObj.src);\n      }\n    } // if we have matching source els but not matching sources\n    // the current source cache is not up to date\n\n\n    if (matchingSourceEls.length && !matchingSources.length) {\n      this.cache_.sources = sourceElSources; // if we don't have matching source or source els set the\n      // sources cache to the `currentSource` cache\n    } else if (!matchingSources.length) {\n      this.cache_.sources = [this.cache_.source];\n    } // update the tech `src` cache\n\n\n    this.cache_.src = src;\n  }\n  /**\n   * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}\n   * causing the media element to reload.\n   *\n   * It will fire for the initial source and each subsequent source.\n   * This event is a custom event from Video.js and is triggered by the {@link Tech}.\n   *\n   * The event object for this event contains a `src` property that will contain the source\n   * that was available when the event was triggered. This is generally only necessary if Video.js\n   * is switching techs while the source was being changed.\n   *\n   * It is also fired when `load` is called on the player (or media element)\n   * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}\n   * says that the resource selection algorithm needs to be aborted and restarted.\n   * In this case, it is very likely that the `src` property will be set to the\n   * empty string `\"\"` to indicate we do not know what the source will be but\n   * that it is changing.\n   *\n   * *This event is currently still experimental and may change in minor releases.*\n   * __To use this, pass `enableSourceset` option to the player.__\n   *\n   * @event Player#sourceset\n   * @type {EventTarget~Event}\n   * @prop {string} src\n   *                The source url available when the `sourceset` was triggered.\n   *                It will be an empty string if we cannot know what the source is\n   *                but know that the source will change.\n   */\n\n  /**\n   * Retrigger the `sourceset` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#sourceset\n   * @listens Tech#sourceset\n   * @private\n   */\n  ;\n\n  _proto.handleTechSourceset_ = function handleTechSourceset_(event) {\n    var _this7 = this;\n\n    // only update the source cache when the source\n    // was not updated using the player api\n    if (!this.changingSrc_) {\n      var updateSourceCaches = function updateSourceCaches(src) {\n        return _this7.updateSourceCaches_(src);\n      };\n\n      var playerSrc = this.currentSource().src;\n      var eventSrc = event.src; // if we have a playerSrc that is not a blob, and a tech src that is a blob\n\n      if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {\n        // if both the tech source and the player source were updated we assume\n        // something like @videojs/http-streaming did the sourceset and skip updating the source cache.\n        if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {\n          updateSourceCaches = function updateSourceCaches() {};\n        }\n      } // update the source to the initial source right away\n      // in some cases this will be empty string\n\n\n      updateSourceCaches(eventSrc); // if the `sourceset` `src` was an empty string\n      // wait for a `loadstart` to update the cache to `currentSrc`.\n      // If a sourceset happens before a `loadstart`, we reset the state\n\n      if (!event.src) {\n        this.tech_.any(['sourceset', 'loadstart'], function (e) {\n          // if a sourceset happens before a `loadstart` there\n          // is nothing to do as this `handleTechSourceset_`\n          // will be called again and this will be handled there.\n          if (e.type === 'sourceset') {\n            return;\n          }\n\n          var techSrc = _this7.techGet('currentSrc');\n\n          _this7.lastSource_.tech = techSrc;\n\n          _this7.updateSourceCaches_(techSrc);\n        });\n      }\n    }\n\n    this.lastSource_ = {\n      player: this.currentSource().src,\n      tech: event.src\n    };\n    this.trigger({\n      src: event.src,\n      type: 'sourceset'\n    });\n  }\n  /**\n   * Add/remove the vjs-has-started class\n   *\n   * @fires Player#firstplay\n   *\n   * @param {boolean} request\n   *        - true: adds the class\n   *        - false: remove the class\n   *\n   * @return {boolean}\n   *         the boolean value of hasStarted_\n   */\n  ;\n\n  _proto.hasStarted = function hasStarted(request) {\n    if (request === undefined) {\n      // act as getter, if we have no request to change\n      return this.hasStarted_;\n    }\n\n    if (request === this.hasStarted_) {\n      return;\n    }\n\n    this.hasStarted_ = request;\n\n    if (this.hasStarted_) {\n      this.addClass('vjs-has-started');\n      this.trigger('firstplay');\n    } else {\n      this.removeClass('vjs-has-started');\n    }\n  }\n  /**\n   * Fired whenever the media begins or resumes playback\n   *\n   * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}\n   * @fires Player#play\n   * @listens Tech#play\n   * @private\n   */\n  ;\n\n  _proto.handleTechPlay_ = function handleTechPlay_() {\n    this.removeClass('vjs-ended');\n    this.removeClass('vjs-paused');\n    this.addClass('vjs-playing'); // hide the poster when the user hits play\n\n    this.hasStarted(true);\n    /**\n     * Triggered whenever an {@link Tech#play} event happens. Indicates that\n     * playback has started or resumed.\n     *\n     * @event Player#play\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('play');\n  }\n  /**\n   * Retrigger the `ratechange` event that was triggered by the {@link Tech}.\n   *\n   * If there were any events queued while the playback rate was zero, fire\n   * those events now.\n   *\n   * @private\n   * @method Player#handleTechRateChange_\n   * @fires Player#ratechange\n   * @listens Tech#ratechange\n   */\n  ;\n\n  _proto.handleTechRateChange_ = function handleTechRateChange_() {\n    if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {\n      this.queuedCallbacks_.forEach(function (queued) {\n        return queued.callback(queued.event);\n      });\n      this.queuedCallbacks_ = [];\n    }\n\n    this.cache_.lastPlaybackRate = this.tech_.playbackRate();\n    /**\n     * Fires when the playing speed of the audio/video is changed\n     *\n     * @event Player#ratechange\n     * @type {event}\n     */\n\n    this.trigger('ratechange');\n  }\n  /**\n   * Retrigger the `waiting` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#waiting\n   * @listens Tech#waiting\n   * @private\n   */\n  ;\n\n  _proto.handleTechWaiting_ = function handleTechWaiting_() {\n    var _this8 = this;\n\n    this.addClass('vjs-waiting');\n    /**\n     * A readyState change on the DOM element has caused playback to stop.\n     *\n     * @event Player#waiting\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('waiting'); // Browsers may emit a timeupdate event after a waiting event. In order to prevent\n    // premature removal of the waiting class, wait for the time to change.\n\n    var timeWhenWaiting = this.currentTime();\n\n    var timeUpdateListener = function timeUpdateListener() {\n      if (timeWhenWaiting !== _this8.currentTime()) {\n        _this8.removeClass('vjs-waiting');\n\n        _this8.off('timeupdate', timeUpdateListener);\n      }\n    };\n\n    this.on('timeupdate', timeUpdateListener);\n  }\n  /**\n   * Retrigger the `canplay` event that was triggered by the {@link Tech}.\n   * > Note: This is not consistent between browsers. See #1351\n   *\n   * @fires Player#canplay\n   * @listens Tech#canplay\n   * @private\n   */\n  ;\n\n  _proto.handleTechCanPlay_ = function handleTechCanPlay_() {\n    this.removeClass('vjs-waiting');\n    /**\n     * The media has a readyState of HAVE_FUTURE_DATA or greater.\n     *\n     * @event Player#canplay\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('canplay');\n  }\n  /**\n   * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#canplaythrough\n   * @listens Tech#canplaythrough\n   * @private\n   */\n  ;\n\n  _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {\n    this.removeClass('vjs-waiting');\n    /**\n     * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the\n     * entire media file can be played without buffering.\n     *\n     * @event Player#canplaythrough\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('canplaythrough');\n  }\n  /**\n   * Retrigger the `playing` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#playing\n   * @listens Tech#playing\n   * @private\n   */\n  ;\n\n  _proto.handleTechPlaying_ = function handleTechPlaying_() {\n    this.removeClass('vjs-waiting');\n    /**\n     * The media is no longer blocked from playback, and has started playing.\n     *\n     * @event Player#playing\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('playing');\n  }\n  /**\n   * Retrigger the `seeking` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#seeking\n   * @listens Tech#seeking\n   * @private\n   */\n  ;\n\n  _proto.handleTechSeeking_ = function handleTechSeeking_() {\n    this.addClass('vjs-seeking');\n    /**\n     * Fired whenever the player is jumping to a new time\n     *\n     * @event Player#seeking\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('seeking');\n  }\n  /**\n   * Retrigger the `seeked` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#seeked\n   * @listens Tech#seeked\n   * @private\n   */\n  ;\n\n  _proto.handleTechSeeked_ = function handleTechSeeked_() {\n    this.removeClass('vjs-seeking');\n    this.removeClass('vjs-ended');\n    /**\n     * Fired when the player has finished jumping to a new time\n     *\n     * @event Player#seeked\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('seeked');\n  }\n  /**\n   * Retrigger the `firstplay` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#firstplay\n   * @listens Tech#firstplay\n   * @deprecated As of 6.0 firstplay event is deprecated.\n   *             As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated.\n   * @private\n   */\n  ;\n\n  _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {\n    // If the first starttime attribute is specified\n    // then we will start at the given offset in seconds\n    if (this.options_.starttime) {\n      log$1.warn('Passing the `starttime` option to the player will be deprecated in 6.0');\n      this.currentTime(this.options_.starttime);\n    }\n\n    this.addClass('vjs-has-started');\n    /**\n     * Fired the first time a video is played. Not part of the HLS spec, and this is\n     * probably not the best implementation yet, so use sparingly. If you don't have a\n     * reason to prevent playback, use `myPlayer.one('play');` instead.\n     *\n     * @event Player#firstplay\n     * @deprecated As of 6.0 firstplay event is deprecated.\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('firstplay');\n  }\n  /**\n   * Retrigger the `pause` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#pause\n   * @listens Tech#pause\n   * @private\n   */\n  ;\n\n  _proto.handleTechPause_ = function handleTechPause_() {\n    this.removeClass('vjs-playing');\n    this.addClass('vjs-paused');\n    /**\n     * Fired whenever the media has been paused\n     *\n     * @event Player#pause\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('pause');\n  }\n  /**\n   * Retrigger the `ended` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#ended\n   * @listens Tech#ended\n   * @private\n   */\n  ;\n\n  _proto.handleTechEnded_ = function handleTechEnded_() {\n    this.addClass('vjs-ended');\n    this.removeClass('vjs-waiting');\n\n    if (this.options_.loop) {\n      this.currentTime(0);\n      this.play();\n    } else if (!this.paused()) {\n      this.pause();\n    }\n    /**\n     * Fired when the end of the media resource is reached (currentTime == duration)\n     *\n     * @event Player#ended\n     * @type {EventTarget~Event}\n     */\n\n\n    this.trigger('ended');\n  }\n  /**\n   * Fired when the duration of the media resource is first known or changed\n   *\n   * @listens Tech#durationchange\n   * @private\n   */\n  ;\n\n  _proto.handleTechDurationChange_ = function handleTechDurationChange_() {\n    this.duration(this.techGet_('duration'));\n  }\n  /**\n   * Handle a click on the media element to play/pause\n   *\n   * @param {EventTarget~Event} event\n   *        the event that caused this function to trigger\n   *\n   * @listens Tech#click\n   * @private\n   */\n  ;\n\n  _proto.handleTechClick_ = function handleTechClick_(event) {\n    // When controls are disabled a click should not toggle playback because\n    // the click is considered a control\n    if (!this.controls_) {\n      return;\n    }\n\n    if (this.options_ === undefined || this.options_.userActions === undefined || this.options_.userActions.click === undefined || this.options_.userActions.click !== false) {\n      if (this.options_ !== undefined && this.options_.userActions !== undefined && typeof this.options_.userActions.click === 'function') {\n        this.options_.userActions.click.call(this, event);\n      } else if (this.paused()) {\n        silencePromise(this.play());\n      } else {\n        this.pause();\n      }\n    }\n  }\n  /**\n   * Handle a double-click on the media element to enter/exit fullscreen\n   *\n   * @param {EventTarget~Event} event\n   *        the event that caused this function to trigger\n   *\n   * @listens Tech#dblclick\n   * @private\n   */\n  ;\n\n  _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event) {\n    if (!this.controls_) {\n      return;\n    } // we do not want to toggle fullscreen state\n    // when double-clicking inside a control bar or a modal\n\n\n    var inAllowedEls = Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), function (el) {\n      return el.contains(event.target);\n    });\n\n    if (!inAllowedEls) {\n      /*\n       * options.userActions.doubleClick\n       *\n       * If `undefined` or `true`, double-click toggles fullscreen if controls are present\n       * Set to `false` to disable double-click handling\n       * Set to a function to substitute an external double-click handler\n       */\n      if (this.options_ === undefined || this.options_.userActions === undefined || this.options_.userActions.doubleClick === undefined || this.options_.userActions.doubleClick !== false) {\n        if (this.options_ !== undefined && this.options_.userActions !== undefined && typeof this.options_.userActions.doubleClick === 'function') {\n          this.options_.userActions.doubleClick.call(this, event);\n        } else if (this.isFullscreen()) {\n          this.exitFullscreen();\n        } else {\n          this.requestFullscreen();\n        }\n      }\n    }\n  }\n  /**\n   * Handle a tap on the media element. It will toggle the user\n   * activity state, which hides and shows the controls.\n   *\n   * @listens Tech#tap\n   * @private\n   */\n  ;\n\n  _proto.handleTechTap_ = function handleTechTap_() {\n    this.userActive(!this.userActive());\n  }\n  /**\n   * Handle touch to start\n   *\n   * @listens Tech#touchstart\n   * @private\n   */\n  ;\n\n  _proto.handleTechTouchStart_ = function handleTechTouchStart_() {\n    this.userWasActive = this.userActive();\n  }\n  /**\n   * Handle touch to move\n   *\n   * @listens Tech#touchmove\n   * @private\n   */\n  ;\n\n  _proto.handleTechTouchMove_ = function handleTechTouchMove_() {\n    if (this.userWasActive) {\n      this.reportUserActivity();\n    }\n  }\n  /**\n   * Handle touch to end\n   *\n   * @param {EventTarget~Event} event\n   *        the touchend event that triggered\n   *        this function\n   *\n   * @listens Tech#touchend\n   * @private\n   */\n  ;\n\n  _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event) {\n    // Stop the mouse events from also happening\n    if (event.cancelable) {\n      event.preventDefault();\n    }\n  }\n  /**\n   * native click events on the SWF aren't triggered on IE11, Win8.1RT\n   * use stageclick events triggered from inside the SWF instead\n   *\n   * @private\n   * @listens stageclick\n   */\n  ;\n\n  _proto.handleStageClick_ = function handleStageClick_() {\n    this.reportUserActivity();\n  }\n  /**\n   * @private\n   */\n  ;\n\n  _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() {\n    if (this.isFullscreen()) {\n      this.addClass('vjs-fullscreen');\n    } else {\n      this.removeClass('vjs-fullscreen');\n    }\n  }\n  /**\n   * when the document fschange event triggers it calls this\n   */\n  ;\n\n  _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) {\n    var targetPlayer = e.target.player; // if another player was fullscreen\n    // do a null check for targetPlayer because older firefox's would put document as e.target\n\n    if (targetPlayer && targetPlayer !== this) {\n      return;\n    }\n\n    var el = this.el();\n    var isFs = document[this.fsApi_.fullscreenElement] === el;\n\n    if (!isFs && el.matches) {\n      isFs = el.matches(':' + this.fsApi_.fullscreen);\n    } else if (!isFs && el.msMatchesSelector) {\n      isFs = el.msMatchesSelector(':' + this.fsApi_.fullscreen);\n    }\n\n    this.isFullscreen(isFs);\n  }\n  /**\n   * Handle Tech Fullscreen Change\n   *\n   * @param {EventTarget~Event} event\n   *        the fullscreenchange event that triggered this function\n   *\n   * @param {Object} data\n   *        the data that was sent with the event\n   *\n   * @private\n   * @listens Tech#fullscreenchange\n   * @fires Player#fullscreenchange\n   */\n  ;\n\n  _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) {\n    var _this9 = this;\n\n    if (data) {\n      if (data.nativeIOSFullscreen) {\n        this.addClass('vjs-ios-native-fs');\n        this.tech_.one('webkitendfullscreen', function () {\n          _this9.removeClass('vjs-ios-native-fs');\n        });\n      }\n\n      this.isFullscreen(data.isFullscreen);\n    }\n  };\n\n  _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event, err) {\n    this.trigger('fullscreenerror', err);\n  }\n  /**\n   * @private\n   */\n  ;\n\n  _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() {\n    if (this.isInPictureInPicture()) {\n      this.addClass('vjs-picture-in-picture');\n    } else {\n      this.removeClass('vjs-picture-in-picture');\n    }\n  }\n  /**\n   * Handle Tech Enter Picture-in-Picture.\n   *\n   * @param {EventTarget~Event} event\n   *        the enterpictureinpicture event that triggered this function\n   *\n   * @private\n   * @listens Tech#enterpictureinpicture\n   */\n  ;\n\n  _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event) {\n    this.isInPictureInPicture(true);\n  }\n  /**\n   * Handle Tech Leave Picture-in-Picture.\n   *\n   * @param {EventTarget~Event} event\n   *        the leavepictureinpicture event that triggered this function\n   *\n   * @private\n   * @listens Tech#leavepictureinpicture\n   */\n  ;\n\n  _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event) {\n    this.isInPictureInPicture(false);\n  }\n  /**\n   * Fires when an error occurred during the loading of an audio/video.\n   *\n   * @private\n   * @listens Tech#error\n   */\n  ;\n\n  _proto.handleTechError_ = function handleTechError_() {\n    var error = this.tech_.error();\n    this.error(error);\n  }\n  /**\n   * Retrigger the `textdata` event that was triggered by the {@link Tech}.\n   *\n   * @fires Player#textdata\n   * @listens Tech#textdata\n   * @private\n   */\n  ;\n\n  _proto.handleTechTextData_ = function handleTechTextData_() {\n    var data = null;\n\n    if (arguments.length > 1) {\n      data = arguments[1];\n    }\n    /**\n     * Fires when we get a textdata event from tech\n     *\n     * @event Player#textdata\n     * @type {EventTarget~Event}\n     */\n\n\n    this.trigger('textdata', data);\n  }\n  /**\n   * Get object for cached values.\n   *\n   * @return {Object}\n   *         get the current object cache\n   */\n  ;\n\n  _proto.getCache = function getCache() {\n    return this.cache_;\n  }\n  /**\n   * Resets the internal cache object.\n   *\n   * Using this function outside the player constructor or reset method may\n   * have unintended side-effects.\n   *\n   * @private\n   */\n  ;\n\n  _proto.resetCache_ = function resetCache_() {\n    this.cache_ = {\n      // Right now, the currentTime is not _really_ cached because it is always\n      // retrieved from the tech (see: currentTime). However, for completeness,\n      // we set it to zero here to ensure that if we do start actually caching\n      // it, we reset it along with everything else.\n      currentTime: 0,\n      initTime: 0,\n      inactivityTimeout: this.options_.inactivityTimeout,\n      duration: NaN,\n      lastVolume: 1,\n      lastPlaybackRate: this.defaultPlaybackRate(),\n      media: null,\n      src: '',\n      source: {},\n      sources: [],\n      playbackRates: [],\n      volume: 1\n    };\n  }\n  /**\n   * Pass values to the playback tech\n   *\n   * @param {string} [method]\n   *        the method to call\n   *\n   * @param {Object} arg\n   *        the argument to pass\n   *\n   * @private\n   */\n  ;\n\n  _proto.techCall_ = function techCall_(method, arg) {\n    // If it's not ready yet, call method when it is\n    this.ready(function () {\n      if (method in allowedSetters) {\n        return set(this.middleware_, this.tech_, method, arg);\n      } else if (method in allowedMediators) {\n        return mediate(this.middleware_, this.tech_, method, arg);\n      }\n\n      try {\n        if (this.tech_) {\n          this.tech_[method](arg);\n        }\n      } catch (e) {\n        log$1(e);\n        throw e;\n      }\n    }, true);\n  }\n  /**\n   * Get calls can't wait for the tech, and sometimes don't need to.\n   *\n   * @param {string} method\n   *        Tech method\n   *\n   * @return {Function|undefined}\n   *         the method or undefined\n   *\n   * @private\n   */\n  ;\n\n  _proto.techGet_ = function techGet_(method) {\n    if (!this.tech_ || !this.tech_.isReady_) {\n      return;\n    }\n\n    if (method in allowedGetters) {\n      return get(this.middleware_, this.tech_, method);\n    } else if (method in allowedMediators) {\n      return mediate(this.middleware_, this.tech_, method);\n    } // Flash likes to die and reload when you hide or reposition it.\n    // In these cases the object methods go away and we get errors.\n    // TODO: Is this needed for techs other than Flash?\n    // When that happens we'll catch the errors and inform tech that it's not ready any more.\n\n\n    try {\n      return this.tech_[method]();\n    } catch (e) {\n      // When building additional tech libs, an expected method may not be defined yet\n      if (this.tech_[method] === undefined) {\n        log$1(\"Video.js: \" + method + \" method not defined for \" + this.techName_ + \" playback technology.\", e);\n        throw e;\n      } // When a method isn't available on the object it throws a TypeError\n\n\n      if (e.name === 'TypeError') {\n        log$1(\"Video.js: \" + method + \" unavailable on \" + this.techName_ + \" playback technology element.\", e);\n        this.tech_.isReady_ = false;\n        throw e;\n      } // If error unknown, just log and throw\n\n\n      log$1(e);\n      throw e;\n    }\n  }\n  /**\n   * Attempt to begin playback at the first opportunity.\n   *\n   * @return {Promise|undefined}\n   *         Returns a promise if the browser supports Promises (or one\n   *         was passed in as an option). This promise will be resolved on\n   *         the return value of play. If this is undefined it will fulfill the\n   *         promise chain otherwise the promise chain will be fulfilled when\n   *         the promise from play is fulfilled.\n   */\n  ;\n\n  _proto.play = function play() {\n    var _this10 = this;\n\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      return new PromiseClass(function (resolve) {\n        _this10.play_(resolve);\n      });\n    }\n\n    return this.play_();\n  }\n  /**\n   * The actual logic for play, takes a callback that will be resolved on the\n   * return value of play. This allows us to resolve to the play promise if there\n   * is one on modern browsers.\n   *\n   * @private\n   * @param {Function} [callback]\n   *        The callback that should be called when the techs play is actually called\n   */\n  ;\n\n  _proto.play_ = function play_(callback) {\n    var _this11 = this;\n\n    if (callback === void 0) {\n      callback = silencePromise;\n    }\n\n    this.playCallbacks_.push(callback);\n    var isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc())); // treat calls to play_ somewhat like the `one` event function\n\n    if (this.waitToPlay_) {\n      this.off(['ready', 'loadstart'], this.waitToPlay_);\n      this.waitToPlay_ = null;\n    } // if the player/tech is not ready or the src itself is not ready\n    // queue up a call to play on `ready` or `loadstart`\n\n\n    if (!this.isReady_ || !isSrcReady) {\n      this.waitToPlay_ = function (e) {\n        _this11.play_();\n      };\n\n      this.one(['ready', 'loadstart'], this.waitToPlay_); // if we are in Safari, there is a high chance that loadstart will trigger after the gesture timeperiod\n      // in that case, we need to prime the video element by calling load so it'll be ready in time\n\n      if (!isSrcReady && (IS_ANY_SAFARI || IS_IOS)) {\n        this.load();\n      }\n\n      return;\n    } // If the player/tech is ready and we have a source, we can attempt playback.\n\n\n    var val = this.techGet_('play'); // play was terminated if the returned value is null\n\n    if (val === null) {\n      this.runPlayTerminatedQueue_();\n    } else {\n      this.runPlayCallbacks_(val);\n    }\n  }\n  /**\n   * These functions will be run when if play is terminated. If play\n   * runPlayCallbacks_ is run these function will not be run. This allows us\n   * to differenciate between a terminated play and an actual call to play.\n   */\n  ;\n\n  _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() {\n    var queue = this.playTerminatedQueue_.slice(0);\n    this.playTerminatedQueue_ = [];\n    queue.forEach(function (q) {\n      q();\n    });\n  }\n  /**\n   * When a callback to play is delayed we have to run these\n   * callbacks when play is actually called on the tech. This function\n   * runs the callbacks that were delayed and accepts the return value\n   * from the tech.\n   *\n   * @param {undefined|Promise} val\n   *        The return value from the tech.\n   */\n  ;\n\n  _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) {\n    var callbacks = this.playCallbacks_.slice(0);\n    this.playCallbacks_ = []; // clear play terminatedQueue since we finished a real play\n\n    this.playTerminatedQueue_ = [];\n    callbacks.forEach(function (cb) {\n      cb(val);\n    });\n  }\n  /**\n   * Pause the video playback\n   *\n   * @return {Player}\n   *         A reference to the player object this function was called on\n   */\n  ;\n\n  _proto.pause = function pause() {\n    this.techCall_('pause');\n  }\n  /**\n   * Check if the player is paused or has yet to play\n   *\n   * @return {boolean}\n   *         - false: if the media is currently playing\n   *         - true: if media is not currently playing\n   */\n  ;\n\n  _proto.paused = function paused() {\n    // The initial state of paused should be true (in Safari it's actually false)\n    return this.techGet_('paused') === false ? false : true;\n  }\n  /**\n   * Get a TimeRange object representing the current ranges of time that the user\n   * has played.\n   *\n   * @return {TimeRange}\n   *         A time range object that represents all the increments of time that have\n   *         been played.\n   */\n  ;\n\n  _proto.played = function played() {\n    return this.techGet_('played') || createTimeRanges(0, 0);\n  }\n  /**\n   * Returns whether or not the user is \"scrubbing\". Scrubbing is\n   * when the user has clicked the progress bar handle and is\n   * dragging it along the progress bar.\n   *\n   * @param {boolean} [isScrubbing]\n   *        whether the user is or is not scrubbing\n   *\n   * @return {boolean}\n   *         The value of scrubbing when getting\n   */\n  ;\n\n  _proto.scrubbing = function scrubbing(isScrubbing) {\n    if (typeof isScrubbing === 'undefined') {\n      return this.scrubbing_;\n    }\n\n    this.scrubbing_ = !!isScrubbing;\n    this.techCall_('setScrubbing', this.scrubbing_);\n\n    if (isScrubbing) {\n      this.addClass('vjs-scrubbing');\n    } else {\n      this.removeClass('vjs-scrubbing');\n    }\n  }\n  /**\n   * Get or set the current time (in seconds)\n   *\n   * @param {number|string} [seconds]\n   *        The time to seek to in seconds\n   *\n   * @return {number}\n   *         - the current time in seconds when getting\n   */\n  ;\n\n  _proto.currentTime = function currentTime(seconds) {\n    if (typeof seconds !== 'undefined') {\n      if (seconds < 0) {\n        seconds = 0;\n      }\n\n      if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {\n        this.cache_.initTime = seconds;\n        this.off('canplay', this.boundApplyInitTime_);\n        this.one('canplay', this.boundApplyInitTime_);\n        return;\n      }\n\n      this.techCall_('setCurrentTime', seconds);\n      this.cache_.initTime = 0;\n      return;\n    } // cache last currentTime and return. default to 0 seconds\n    //\n    // Caching the currentTime is meant to prevent a massive amount of reads on the tech's\n    // currentTime when scrubbing, but may not provide much performance benefit afterall.\n    // Should be tested. Also something has to read the actual current time or the cache will\n    // never get updated.\n\n\n    this.cache_.currentTime = this.techGet_('currentTime') || 0;\n    return this.cache_.currentTime;\n  }\n  /**\n   * Apply the value of initTime stored in cache as currentTime.\n   *\n   * @private\n   */\n  ;\n\n  _proto.applyInitTime_ = function applyInitTime_() {\n    this.currentTime(this.cache_.initTime);\n  }\n  /**\n   * Normally gets the length in time of the video in seconds;\n   * in all but the rarest use cases an argument will NOT be passed to the method\n   *\n   * > **NOTE**: The video must have started loading before the duration can be\n   * known, and depending on preload behaviour may not be known until the video starts\n   * playing.\n   *\n   * @fires Player#durationchange\n   *\n   * @param {number} [seconds]\n   *        The duration of the video to set in seconds\n   *\n   * @return {number}\n   *         - The duration of the video in seconds when getting\n   */\n  ;\n\n  _proto.duration = function duration(seconds) {\n    if (seconds === undefined) {\n      // return NaN if the duration is not known\n      return this.cache_.duration !== undefined ? this.cache_.duration : NaN;\n    }\n\n    seconds = parseFloat(seconds); // Standardize on Infinity for signaling video is live\n\n    if (seconds < 0) {\n      seconds = Infinity;\n    }\n\n    if (seconds !== this.cache_.duration) {\n      // Cache the last set value for optimized scrubbing (esp. Flash)\n      // TODO: Required for techs other than Flash?\n      this.cache_.duration = seconds;\n\n      if (seconds === Infinity) {\n        this.addClass('vjs-live');\n      } else {\n        this.removeClass('vjs-live');\n      }\n\n      if (!isNaN(seconds)) {\n        // Do not fire durationchange unless the duration value is known.\n        // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n        /**\n         * @event Player#durationchange\n         * @type {EventTarget~Event}\n         */\n        this.trigger('durationchange');\n      }\n    }\n  }\n  /**\n   * Calculates how much time is left in the video. Not part\n   * of the native video API.\n   *\n   * @return {number}\n   *         The time remaining in seconds\n   */\n  ;\n\n  _proto.remainingTime = function remainingTime() {\n    return this.duration() - this.currentTime();\n  }\n  /**\n   * A remaining time function that is intented to be used when\n   * the time is to be displayed directly to the user.\n   *\n   * @return {number}\n   *         The rounded time remaining in seconds\n   */\n  ;\n\n  _proto.remainingTimeDisplay = function remainingTimeDisplay() {\n    return Math.floor(this.duration()) - Math.floor(this.currentTime());\n  } //\n  // Kind of like an array of portions of the video that have been downloaded.\n\n  /**\n   * Get a TimeRange object with an array of the times of the video\n   * that have been downloaded. If you just want the percent of the\n   * video that's been downloaded, use bufferedPercent.\n   *\n   * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}\n   *\n   * @return {TimeRange}\n   *         A mock TimeRange object (following HTML spec)\n   */\n  ;\n\n  _proto.buffered = function buffered() {\n    var buffered = this.techGet_('buffered');\n\n    if (!buffered || !buffered.length) {\n      buffered = createTimeRanges(0, 0);\n    }\n\n    return buffered;\n  }\n  /**\n   * Get the percent (as a decimal) of the video that's been downloaded.\n   * This method is not a part of the native HTML video API.\n   *\n   * @return {number}\n   *         A decimal between 0 and 1 representing the percent\n   *         that is buffered 0 being 0% and 1 being 100%\n   */\n  ;\n\n  _proto.bufferedPercent = function bufferedPercent$1() {\n    return bufferedPercent(this.buffered(), this.duration());\n  }\n  /**\n   * Get the ending time of the last buffered time range\n   * This is used in the progress bar to encapsulate all time ranges.\n   *\n   * @return {number}\n   *         The end of the last buffered time range\n   */\n  ;\n\n  _proto.bufferedEnd = function bufferedEnd() {\n    var buffered = this.buffered();\n    var duration = this.duration();\n    var end = buffered.end(buffered.length - 1);\n\n    if (end > duration) {\n      end = duration;\n    }\n\n    return end;\n  }\n  /**\n   * Get or set the current volume of the media\n   *\n   * @param  {number} [percentAsDecimal]\n   *         The new volume as a decimal percent:\n   *         - 0 is muted/0%/off\n   *         - 1.0 is 100%/full\n   *         - 0.5 is half volume or 50%\n   *\n   * @return {number}\n   *         The current volume as a percent when getting\n   */\n  ;\n\n  _proto.volume = function volume(percentAsDecimal) {\n    var vol;\n\n    if (percentAsDecimal !== undefined) {\n      // Force value to between 0 and 1\n      vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));\n      this.cache_.volume = vol;\n      this.techCall_('setVolume', vol);\n\n      if (vol > 0) {\n        this.lastVolume_(vol);\n      }\n\n      return;\n    } // Default to 1 when returning current volume.\n\n\n    vol = parseFloat(this.techGet_('volume'));\n    return isNaN(vol) ? 1 : vol;\n  }\n  /**\n   * Get the current muted state, or turn mute on or off\n   *\n   * @param {boolean} [muted]\n   *        - true to mute\n   *        - false to unmute\n   *\n   * @return {boolean}\n   *         - true if mute is on and getting\n   *         - false if mute is off and getting\n   */\n  ;\n\n  _proto.muted = function muted(_muted) {\n    if (_muted !== undefined) {\n      this.techCall_('setMuted', _muted);\n      return;\n    }\n\n    return this.techGet_('muted') || false;\n  }\n  /**\n   * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted\n   * indicates the state of muted on initial playback.\n   *\n   * ```js\n   *   var myPlayer = videojs('some-player-id');\n   *\n   *   myPlayer.src(\"http://www.example.com/path/to/video.mp4\");\n   *\n   *   // get, should be false\n   *   console.log(myPlayer.defaultMuted());\n   *   // set to true\n   *   myPlayer.defaultMuted(true);\n   *   // get should be true\n   *   console.log(myPlayer.defaultMuted());\n   * ```\n   *\n   * @param {boolean} [defaultMuted]\n   *        - true to mute\n   *        - false to unmute\n   *\n   * @return {boolean|Player}\n   *         - true if defaultMuted is on and getting\n   *         - false if defaultMuted is off and getting\n   *         - A reference to the current player when setting\n   */\n  ;\n\n  _proto.defaultMuted = function defaultMuted(_defaultMuted) {\n    if (_defaultMuted !== undefined) {\n      return this.techCall_('setDefaultMuted', _defaultMuted);\n    }\n\n    return this.techGet_('defaultMuted') || false;\n  }\n  /**\n   * Get the last volume, or set it\n   *\n   * @param  {number} [percentAsDecimal]\n   *         The new last volume as a decimal percent:\n   *         - 0 is muted/0%/off\n   *         - 1.0 is 100%/full\n   *         - 0.5 is half volume or 50%\n   *\n   * @return {number}\n   *         the current value of lastVolume as a percent when getting\n   *\n   * @private\n   */\n  ;\n\n  _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {\n    if (percentAsDecimal !== undefined && percentAsDecimal !== 0) {\n      this.cache_.lastVolume = percentAsDecimal;\n      return;\n    }\n\n    return this.cache_.lastVolume;\n  }\n  /**\n   * Check if current tech can support native fullscreen\n   * (e.g. with built in controls like iOS)\n   *\n   * @return {boolean}\n   *         if native fullscreen is supported\n   */\n  ;\n\n  _proto.supportsFullScreen = function supportsFullScreen() {\n    return this.techGet_('supportsFullScreen') || false;\n  }\n  /**\n   * Check if the player is in fullscreen mode or tell the player that it\n   * is or is not in fullscreen mode.\n   *\n   * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official\n   * property and instead document.fullscreenElement is used. But isFullscreen is\n   * still a valuable property for internal player workings.\n   *\n   * @param  {boolean} [isFS]\n   *         Set the players current fullscreen state\n   *\n   * @return {boolean}\n   *         - true if fullscreen is on and getting\n   *         - false if fullscreen is off and getting\n   */\n  ;\n\n  _proto.isFullscreen = function isFullscreen(isFS) {\n    if (isFS !== undefined) {\n      var oldValue = this.isFullscreen_;\n      this.isFullscreen_ = Boolean(isFS); // if we changed fullscreen state and we're in prefixed mode, trigger fullscreenchange\n      // this is the only place where we trigger fullscreenchange events for older browsers\n      // fullWindow mode is treated as a prefixed event and will get a fullscreenchange event as well\n\n      if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {\n        /**\n           * @event Player#fullscreenchange\n           * @type {EventTarget~Event}\n           */\n        this.trigger('fullscreenchange');\n      }\n\n      this.toggleFullscreenClass_();\n      return;\n    }\n\n    return this.isFullscreen_;\n  }\n  /**\n   * Increase the size of the video to full screen\n   * In some browsers, full screen is not supported natively, so it enters\n   * \"full window mode\", where the video fills the browser window.\n   * In browsers and devices that support native full screen, sometimes the\n   * browser's default controls will be shown, and not the Video.js custom skin.\n   * This includes most mobile devices (iOS, Android) and older versions of\n   * Safari.\n   *\n   * @param  {Object} [fullscreenOptions]\n   *         Override the player fullscreen options\n   *\n   * @fires Player#fullscreenchange\n   */\n  ;\n\n  _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) {\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      var self = this;\n      return new PromiseClass(function (resolve, reject) {\n        function offHandler() {\n          self.off('fullscreenerror', errorHandler);\n          self.off('fullscreenchange', changeHandler);\n        }\n\n        function changeHandler() {\n          offHandler();\n          resolve();\n        }\n\n        function errorHandler(e, err) {\n          offHandler();\n          reject(err);\n        }\n\n        self.one('fullscreenchange', changeHandler);\n        self.one('fullscreenerror', errorHandler);\n        var promise = self.requestFullscreenHelper_(fullscreenOptions);\n\n        if (promise) {\n          promise.then(offHandler, offHandler);\n          promise.then(resolve, reject);\n        }\n      });\n    }\n\n    return this.requestFullscreenHelper_();\n  };\n\n  _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) {\n    var _this12 = this;\n\n    var fsOptions; // Only pass fullscreen options to requestFullscreen in spec-compliant browsers.\n    // Use defaults or player configured option unless passed directly to this method.\n\n    if (!this.fsApi_.prefixed) {\n      fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};\n\n      if (fullscreenOptions !== undefined) {\n        fsOptions = fullscreenOptions;\n      }\n    } // This method works as follows:\n    // 1. if a fullscreen api is available, use it\n    //   1. call requestFullscreen with potential options\n    //   2. if we got a promise from above, use it to update isFullscreen()\n    // 2. otherwise, if the tech supports fullscreen, call `enterFullScreen` on it.\n    //   This is particularly used for iPhone, older iPads, and non-safari browser on iOS.\n    // 3. otherwise, use \"fullWindow\" mode\n\n\n    if (this.fsApi_.requestFullscreen) {\n      var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);\n\n      if (promise) {\n        promise.then(function () {\n          return _this12.isFullscreen(true);\n        }, function () {\n          return _this12.isFullscreen(false);\n        });\n      }\n\n      return promise;\n    } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n      // we can't take the video.js controls fullscreen but we can go fullscreen\n      // with native controls\n      this.techCall_('enterFullScreen');\n    } else {\n      // fullscreen isn't supported so we'll just stretch the video element to\n      // fill the viewport\n      this.enterFullWindow();\n    }\n  }\n  /**\n   * Return the video to its normal size after having been in full screen mode\n   *\n   * @fires Player#fullscreenchange\n   */\n  ;\n\n  _proto.exitFullscreen = function exitFullscreen() {\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      var self = this;\n      return new PromiseClass(function (resolve, reject) {\n        function offHandler() {\n          self.off('fullscreenerror', errorHandler);\n          self.off('fullscreenchange', changeHandler);\n        }\n\n        function changeHandler() {\n          offHandler();\n          resolve();\n        }\n\n        function errorHandler(e, err) {\n          offHandler();\n          reject(err);\n        }\n\n        self.one('fullscreenchange', changeHandler);\n        self.one('fullscreenerror', errorHandler);\n        var promise = self.exitFullscreenHelper_();\n\n        if (promise) {\n          promise.then(offHandler, offHandler); // map the promise to our resolve/reject methods\n\n          promise.then(resolve, reject);\n        }\n      });\n    }\n\n    return this.exitFullscreenHelper_();\n  };\n\n  _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() {\n    var _this13 = this;\n\n    if (this.fsApi_.requestFullscreen) {\n      var promise = document[this.fsApi_.exitFullscreen]();\n\n      if (promise) {\n        // we're splitting the promise here, so, we want to catch the\n        // potential error so that this chain doesn't have unhandled errors\n        silencePromise(promise.then(function () {\n          return _this13.isFullscreen(false);\n        }));\n      }\n\n      return promise;\n    } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n      this.techCall_('exitFullScreen');\n    } else {\n      this.exitFullWindow();\n    }\n  }\n  /**\n   * When fullscreen isn't supported we can stretch the\n   * video container to as wide as the browser will let us.\n   *\n   * @fires Player#enterFullWindow\n   */\n  ;\n\n  _proto.enterFullWindow = function enterFullWindow() {\n    this.isFullscreen(true);\n    this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off\n\n    this.docOrigOverflow = document.documentElement.style.overflow; // Add listener for esc key to exit fullscreen\n\n    on(document, 'keydown', this.boundFullWindowOnEscKey_); // Hide any scroll bars\n\n    document.documentElement.style.overflow = 'hidden'; // Apply fullscreen styles\n\n    addClass(document.body, 'vjs-full-window');\n    /**\n     * @event Player#enterFullWindow\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('enterFullWindow');\n  }\n  /**\n   * Check for call to either exit full window or\n   * full screen on ESC key\n   *\n   * @param {string} event\n   *        Event to check for key press\n   */\n  ;\n\n  _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event) {\n    if (keycode.isEventKey(event, 'Esc')) {\n      if (this.isFullscreen() === true) {\n        if (!this.isFullWindow) {\n          this.exitFullscreen();\n        } else {\n          this.exitFullWindow();\n        }\n      }\n    }\n  }\n  /**\n   * Exit full window\n   *\n   * @fires Player#exitFullWindow\n   */\n  ;\n\n  _proto.exitFullWindow = function exitFullWindow() {\n    this.isFullscreen(false);\n    this.isFullWindow = false;\n    off(document, 'keydown', this.boundFullWindowOnEscKey_); // Unhide scroll bars.\n\n    document.documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles\n\n    removeClass(document.body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes\n    // this.positionAll();\n\n    /**\n     * @event Player#exitFullWindow\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('exitFullWindow');\n  }\n  /**\n   * Disable Picture-in-Picture mode.\n   *\n   * @param {boolean} value\n   *                  - true will disable Picture-in-Picture mode\n   *                  - false will enable Picture-in-Picture mode\n   */\n  ;\n\n  _proto.disablePictureInPicture = function disablePictureInPicture(value) {\n    if (value === undefined) {\n      return this.techGet_('disablePictureInPicture');\n    }\n\n    this.techCall_('setDisablePictureInPicture', value);\n    this.options_.disablePictureInPicture = value;\n    this.trigger('disablepictureinpicturechanged');\n  }\n  /**\n   * Check if the player is in Picture-in-Picture mode or tell the player that it\n   * is or is not in Picture-in-Picture mode.\n   *\n   * @param  {boolean} [isPiP]\n   *         Set the players current Picture-in-Picture state\n   *\n   * @return {boolean}\n   *         - true if Picture-in-Picture is on and getting\n   *         - false if Picture-in-Picture is off and getting\n   */\n  ;\n\n  _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) {\n    if (isPiP !== undefined) {\n      this.isInPictureInPicture_ = !!isPiP;\n      this.togglePictureInPictureClass_();\n      return;\n    }\n\n    return !!this.isInPictureInPicture_;\n  }\n  /**\n   * Create a floating video window always on top of other windows so that users may\n   * continue consuming media while they interact with other content sites, or\n   * applications on their device.\n   *\n   * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n   *\n   * @fires Player#enterpictureinpicture\n   *\n   * @return {Promise}\n   *         A promise with a Picture-in-Picture window.\n   */\n  ;\n\n  _proto.requestPictureInPicture = function requestPictureInPicture() {\n    if ('pictureInPictureEnabled' in document && this.disablePictureInPicture() === false) {\n      /**\n       * This event fires when the player enters picture in picture mode\n       *\n       * @event Player#enterpictureinpicture\n       * @type {EventTarget~Event}\n       */\n      return this.techGet_('requestPictureInPicture');\n    }\n  }\n  /**\n   * Exit Picture-in-Picture mode.\n   *\n   * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n   *\n   * @fires Player#leavepictureinpicture\n   *\n   * @return {Promise}\n   *         A promise.\n   */\n  ;\n\n  _proto.exitPictureInPicture = function exitPictureInPicture() {\n    if ('pictureInPictureEnabled' in document) {\n      /**\n       * This event fires when the player leaves picture in picture mode\n       *\n       * @event Player#leavepictureinpicture\n       * @type {EventTarget~Event}\n       */\n      return document.exitPictureInPicture();\n    }\n  }\n  /**\n   * Called when this Player has focus and a key gets pressed down, or when\n   * any Component of this player receives a key press that it doesn't handle.\n   * This allows player-wide hotkeys (either as defined below, or optionally\n   * by an external function).\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   *\n   * @listens keydown\n   */\n  ;\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    var userActions = this.options_.userActions; // Bail out if hotkeys are not configured.\n\n    if (!userActions || !userActions.hotkeys) {\n      return;\n    } // Function that determines whether or not to exclude an element from\n    // hotkeys handling.\n\n\n    var excludeElement = function excludeElement(el) {\n      var tagName = el.tagName.toLowerCase(); // The first and easiest test is for `contenteditable` elements.\n\n      if (el.isContentEditable) {\n        return true;\n      } // Inputs matching these types will still trigger hotkey handling as\n      // they are not text inputs.\n\n\n      var allowedInputTypes = ['button', 'checkbox', 'hidden', 'radio', 'reset', 'submit'];\n\n      if (tagName === 'input') {\n        return allowedInputTypes.indexOf(el.type) === -1;\n      } // The final test is by tag name. These tags will be excluded entirely.\n\n\n      var excludedTags = ['textarea'];\n      return excludedTags.indexOf(tagName) !== -1;\n    }; // Bail out if the user is focused on an interactive form element.\n\n\n    if (excludeElement(this.el_.ownerDocument.activeElement)) {\n      return;\n    }\n\n    if (typeof userActions.hotkeys === 'function') {\n      userActions.hotkeys.call(this, event);\n    } else {\n      this.handleHotkeys(event);\n    }\n  }\n  /**\n   * Called when this Player receives a hotkey keydown event.\n   * Supported player-wide hotkeys are:\n   *\n   *   f          - toggle fullscreen\n   *   m          - toggle mute\n   *   k or Space - toggle play/pause\n   *\n   * @param {EventTarget~Event} event\n   *        The `keydown` event that caused this function to be called.\n   */\n  ;\n\n  _proto.handleHotkeys = function handleHotkeys(event) {\n    var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {}; // set fullscreenKey, muteKey, playPauseKey from `hotkeys`, use defaults if not set\n\n    var _hotkeys$fullscreenKe = hotkeys.fullscreenKey,\n        fullscreenKey = _hotkeys$fullscreenKe === void 0 ? function (keydownEvent) {\n      return keycode.isEventKey(keydownEvent, 'f');\n    } : _hotkeys$fullscreenKe,\n        _hotkeys$muteKey = hotkeys.muteKey,\n        muteKey = _hotkeys$muteKey === void 0 ? function (keydownEvent) {\n      return keycode.isEventKey(keydownEvent, 'm');\n    } : _hotkeys$muteKey,\n        _hotkeys$playPauseKey = hotkeys.playPauseKey,\n        playPauseKey = _hotkeys$playPauseKey === void 0 ? function (keydownEvent) {\n      return keycode.isEventKey(keydownEvent, 'k') || keycode.isEventKey(keydownEvent, 'Space');\n    } : _hotkeys$playPauseKey;\n\n    if (fullscreenKey.call(this, event)) {\n      event.preventDefault();\n      event.stopPropagation();\n      var FSToggle = Component$1.getComponent('FullscreenToggle');\n\n      if (document[this.fsApi_.fullscreenEnabled] !== false) {\n        FSToggle.prototype.handleClick.call(this, event);\n      }\n    } else if (muteKey.call(this, event)) {\n      event.preventDefault();\n      event.stopPropagation();\n      var MuteToggle = Component$1.getComponent('MuteToggle');\n      MuteToggle.prototype.handleClick.call(this, event);\n    } else if (playPauseKey.call(this, event)) {\n      event.preventDefault();\n      event.stopPropagation();\n      var PlayToggle = Component$1.getComponent('PlayToggle');\n      PlayToggle.prototype.handleClick.call(this, event);\n    }\n  }\n  /**\n   * Check whether the player can play a given mimetype\n   *\n   * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype\n   *\n   * @param {string} type\n   *        The mimetype to check\n   *\n   * @return {string}\n   *         'probably', 'maybe', or '' (empty string)\n   */\n  ;\n\n  _proto.canPlayType = function canPlayType(type) {\n    var can; // Loop through each playback technology in the options order\n\n    for (var i = 0, j = this.options_.techOrder; i < j.length; i++) {\n      var techName = j[i];\n      var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n      // Remove once that deprecated behavior is removed.\n\n      if (!tech) {\n        tech = Component$1.getComponent(techName);\n      } // Check if the current tech is defined before continuing\n\n\n      if (!tech) {\n        log$1.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n        continue;\n      } // Check if the browser supports this technology\n\n\n      if (tech.isSupported()) {\n        can = tech.canPlayType(type);\n\n        if (can) {\n          return can;\n        }\n      }\n    }\n\n    return '';\n  }\n  /**\n   * Select source based on tech-order or source-order\n   * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,\n   * defaults to tech-order selection\n   *\n   * @param {Array} sources\n   *        The sources for a media asset\n   *\n   * @return {Object|boolean}\n   *         Object of source and tech order or false\n   */\n  ;\n\n  _proto.selectSource = function selectSource(sources) {\n    var _this14 = this;\n\n    // Get only the techs specified in `techOrder` that exist and are supported by the\n    // current platform\n    var techs = this.options_.techOrder.map(function (techName) {\n      return [techName, Tech.getTech(techName)];\n    }).filter(function (_ref) {\n      var techName = _ref[0],\n          tech = _ref[1];\n\n      // Check if the current tech is defined before continuing\n      if (tech) {\n        // Check if the browser supports this technology\n        return tech.isSupported();\n      }\n\n      log$1.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n      return false;\n    }); // Iterate over each `innerArray` element once per `outerArray` element and execute\n    // `tester` with both. If `tester` returns a non-falsy value, exit early and return\n    // that value.\n\n    var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair(outerArray, innerArray, tester) {\n      var found;\n      outerArray.some(function (outerChoice) {\n        return innerArray.some(function (innerChoice) {\n          found = tester(outerChoice, innerChoice);\n\n          if (found) {\n            return true;\n          }\n        });\n      });\n      return found;\n    };\n\n    var foundSourceAndTech;\n\n    var flip = function flip(fn) {\n      return function (a, b) {\n        return fn(b, a);\n      };\n    };\n\n    var finder = function finder(_ref2, source) {\n      var techName = _ref2[0],\n          tech = _ref2[1];\n\n      if (tech.canPlaySource(source, _this14.options_[techName.toLowerCase()])) {\n        return {\n          source: source,\n          tech: techName\n        };\n      }\n    }; // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources\n    // to select from them based on their priority.\n\n\n    if (this.options_.sourceOrder) {\n      // Source-first ordering\n      foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));\n    } else {\n      // Tech-first ordering\n      foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);\n    }\n\n    return foundSourceAndTech || false;\n  }\n  /**\n   * Executes source setting and getting logic\n   *\n   * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n   *        A SourceObject, an array of SourceObjects, or a string referencing\n   *        a URL to a media source. It is _highly recommended_ that an object\n   *        or array of objects is used here, so that source selection\n   *        algorithms can take the `type` into account.\n   *\n   *        If not provided, this method acts as a getter.\n   * @param {boolean} isRetry\n   *        Indicates whether this is being called internally as a result of a retry\n   *\n   * @return {string|undefined}\n   *         If the `source` argument is missing, returns the current source\n   *         URL. Otherwise, returns nothing/undefined.\n   */\n  ;\n\n  _proto.handleSrc_ = function handleSrc_(source, isRetry) {\n    var _this15 = this;\n\n    // getter usage\n    if (typeof source === 'undefined') {\n      return this.cache_.src || '';\n    } // Reset retry behavior for new source\n\n\n    if (this.resetRetryOnError_) {\n      this.resetRetryOnError_();\n    } // filter out invalid sources and turn our source into\n    // an array of source objects\n\n\n    var sources = filterSource(source); // if a source was passed in then it is invalid because\n    // it was filtered to a zero length Array. So we have to\n    // show an error\n\n    if (!sources.length) {\n      this.setTimeout(function () {\n        this.error({\n          code: 4,\n          message: this.options_.notSupportedMessage\n        });\n      }, 0);\n      return;\n    } // initial sources\n\n\n    this.changingSrc_ = true; // Only update the cached source list if we are not retrying a new source after error,\n    // since in that case we want to include the failed source(s) in the cache\n\n    if (!isRetry) {\n      this.cache_.sources = sources;\n    }\n\n    this.updateSourceCaches_(sources[0]); // middlewareSource is the source after it has been changed by middleware\n\n    setSource(this, sources[0], function (middlewareSource, mws) {\n      _this15.middleware_ = mws; // since sourceSet is async we have to update the cache again after we select a source since\n      // the source that is selected could be out of order from the cache update above this callback.\n\n      if (!isRetry) {\n        _this15.cache_.sources = sources;\n      }\n\n      _this15.updateSourceCaches_(middlewareSource);\n\n      var err = _this15.src_(middlewareSource);\n\n      if (err) {\n        if (sources.length > 1) {\n          return _this15.handleSrc_(sources.slice(1));\n        }\n\n        _this15.changingSrc_ = false; // We need to wrap this in a timeout to give folks a chance to add error event handlers\n\n        _this15.setTimeout(function () {\n          this.error({\n            code: 4,\n            message: this.options_.notSupportedMessage\n          });\n        }, 0); // we could not find an appropriate tech, but let's still notify the delegate that this is it\n        // this needs a better comment about why this is needed\n\n\n        _this15.triggerReady();\n\n        return;\n      }\n\n      setTech(mws, _this15.tech_);\n    }); // Try another available source if this one fails before playback.\n\n    if (this.options_.retryOnError && sources.length > 1) {\n      var retry = function retry() {\n        // Remove the error modal\n        _this15.error(null);\n\n        _this15.handleSrc_(sources.slice(1), true);\n      };\n\n      var stopListeningForErrors = function stopListeningForErrors() {\n        _this15.off('error', retry);\n      };\n\n      this.one('error', retry);\n      this.one('playing', stopListeningForErrors);\n\n      this.resetRetryOnError_ = function () {\n        _this15.off('error', retry);\n\n        _this15.off('playing', stopListeningForErrors);\n      };\n    }\n  }\n  /**\n   * Get or set the video source.\n   *\n   * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n   *        A SourceObject, an array of SourceObjects, or a string referencing\n   *        a URL to a media source. It is _highly recommended_ that an object\n   *        or array of objects is used here, so that source selection\n   *        algorithms can take the `type` into account.\n   *\n   *        If not provided, this method acts as a getter.\n   *\n   * @return {string|undefined}\n   *         If the `source` argument is missing, returns the current source\n   *         URL. Otherwise, returns nothing/undefined.\n   */\n  ;\n\n  _proto.src = function src(source) {\n    return this.handleSrc_(source, false);\n  }\n  /**\n   * Set the source object on the tech, returns a boolean that indicates whether\n   * there is a tech that can play the source or not\n   *\n   * @param {Tech~SourceObject} source\n   *        The source object to set on the Tech\n   *\n   * @return {boolean}\n   *         - True if there is no Tech to playback this source\n   *         - False otherwise\n   *\n   * @private\n   */\n  ;\n\n  _proto.src_ = function src_(source) {\n    var _this16 = this;\n\n    var sourceTech = this.selectSource([source]);\n\n    if (!sourceTech) {\n      return true;\n    }\n\n    if (!titleCaseEquals(sourceTech.tech, this.techName_)) {\n      this.changingSrc_ = true; // load this technology with the chosen source\n\n      this.loadTech_(sourceTech.tech, sourceTech.source);\n      this.tech_.ready(function () {\n        _this16.changingSrc_ = false;\n      });\n      return false;\n    } // wait until the tech is ready to set the source\n    // and set it synchronously if possible (#2326)\n\n\n    this.ready(function () {\n      // The setSource tech method was added with source handlers\n      // so older techs won't support it\n      // We need to check the direct prototype for the case where subclasses\n      // of the tech do not support source handlers\n      if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) {\n        this.techCall_('setSource', source);\n      } else {\n        this.techCall_('src', source.src);\n      }\n\n      this.changingSrc_ = false;\n    }, true);\n    return false;\n  }\n  /**\n   * Begin loading the src data.\n   */\n  ;\n\n  _proto.load = function load() {\n    this.techCall_('load');\n  }\n  /**\n   * Reset the player. Loads the first tech in the techOrder,\n   * removes all the text tracks in the existing `tech`,\n   * and calls `reset` on the `tech`.\n   */\n  ;\n\n  _proto.reset = function reset() {\n    var _this17 = this;\n\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (this.paused() || !PromiseClass) {\n      this.doReset_();\n    } else {\n      var playPromise = this.play();\n      silencePromise(playPromise.then(function () {\n        return _this17.doReset_();\n      }));\n    }\n  };\n\n  _proto.doReset_ = function doReset_() {\n    if (this.tech_) {\n      this.tech_.clearTracks('text');\n    }\n\n    this.resetCache_();\n    this.poster('');\n    this.loadTech_(this.options_.techOrder[0], null);\n    this.techCall_('reset');\n    this.resetControlBarUI_();\n\n    if (isEvented(this)) {\n      this.trigger('playerreset');\n    }\n  }\n  /**\n   * Reset Control Bar's UI by calling sub-methods that reset\n   * all of Control Bar's components\n   */\n  ;\n\n  _proto.resetControlBarUI_ = function resetControlBarUI_() {\n    this.resetProgressBar_();\n    this.resetPlaybackRate_();\n    this.resetVolumeBar_();\n  }\n  /**\n   * Reset tech's progress so progress bar is reset in the UI\n   */\n  ;\n\n  _proto.resetProgressBar_ = function resetProgressBar_() {\n    this.currentTime(0);\n\n    var _ref3 = this.controlBar || {},\n        durationDisplay = _ref3.durationDisplay,\n        remainingTimeDisplay = _ref3.remainingTimeDisplay;\n\n    if (durationDisplay) {\n      durationDisplay.updateContent();\n    }\n\n    if (remainingTimeDisplay) {\n      remainingTimeDisplay.updateContent();\n    }\n  }\n  /**\n   * Reset Playback ratio\n   */\n  ;\n\n  _proto.resetPlaybackRate_ = function resetPlaybackRate_() {\n    this.playbackRate(this.defaultPlaybackRate());\n    this.handleTechRateChange_();\n  }\n  /**\n   * Reset Volume bar\n   */\n  ;\n\n  _proto.resetVolumeBar_ = function resetVolumeBar_() {\n    this.volume(1.0);\n    this.trigger('volumechange');\n  }\n  /**\n   * Returns all of the current source objects.\n   *\n   * @return {Tech~SourceObject[]}\n   *         The current source objects\n   */\n  ;\n\n  _proto.currentSources = function currentSources() {\n    var source = this.currentSource();\n    var sources = []; // assume `{}` or `{ src }`\n\n    if (Object.keys(source).length !== 0) {\n      sources.push(source);\n    }\n\n    return this.cache_.sources || sources;\n  }\n  /**\n   * Returns the current source object.\n   *\n   * @return {Tech~SourceObject}\n   *         The current source object\n   */\n  ;\n\n  _proto.currentSource = function currentSource() {\n    return this.cache_.source || {};\n  }\n  /**\n   * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4\n   * Can be used in conjunction with `currentType` to assist in rebuilding the current source object.\n   *\n   * @return {string}\n   *         The current source\n   */\n  ;\n\n  _proto.currentSrc = function currentSrc() {\n    return this.currentSource() && this.currentSource().src || '';\n  }\n  /**\n   * Get the current source type e.g. video/mp4\n   * This can allow you rebuild the current source object so that you could load the same\n   * source and tech later\n   *\n   * @return {string}\n   *         The source MIME type\n   */\n  ;\n\n  _proto.currentType = function currentType() {\n    return this.currentSource() && this.currentSource().type || '';\n  }\n  /**\n   * Get or set the preload attribute\n   *\n   * @param {boolean} [value]\n   *        - true means that we should preload\n   *        - false means that we should not preload\n   *\n   * @return {string}\n   *         The preload attribute value when getting\n   */\n  ;\n\n  _proto.preload = function preload(value) {\n    if (value !== undefined) {\n      this.techCall_('setPreload', value);\n      this.options_.preload = value;\n      return;\n    }\n\n    return this.techGet_('preload');\n  }\n  /**\n   * Get or set the autoplay option. When this is a boolean it will\n   * modify the attribute on the tech. When this is a string the attribute on\n   * the tech will be removed and `Player` will handle autoplay on loadstarts.\n   *\n   * @param {boolean|string} [value]\n   *        - true: autoplay using the browser behavior\n   *        - false: do not autoplay\n   *        - 'play': call play() on every loadstart\n   *        - 'muted': call muted() then play() on every loadstart\n   *        - 'any': call play() on every loadstart. if that fails call muted() then play().\n   *        - *: values other than those listed here will be set `autoplay` to true\n   *\n   * @return {boolean|string}\n   *         The current value of autoplay when getting\n   */\n  ;\n\n  _proto.autoplay = function autoplay(value) {\n    // getter usage\n    if (value === undefined) {\n      return this.options_.autoplay || false;\n    }\n\n    var techAutoplay; // if the value is a valid string set it to that, or normalize `true` to 'play', if need be\n\n    if (typeof value === 'string' && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {\n      this.options_.autoplay = value;\n      this.manualAutoplay_(typeof value === 'string' ? value : 'play');\n      techAutoplay = false; // any falsy value sets autoplay to false in the browser,\n      // lets do the same\n    } else if (!value) {\n      this.options_.autoplay = false; // any other value (ie truthy) sets autoplay to true\n    } else {\n      this.options_.autoplay = true;\n    }\n\n    techAutoplay = typeof techAutoplay === 'undefined' ? this.options_.autoplay : techAutoplay; // if we don't have a tech then we do not queue up\n    // a setAutoplay call on tech ready. We do this because the\n    // autoplay option will be passed in the constructor and we\n    // do not need to set it twice\n\n    if (this.tech_) {\n      this.techCall_('setAutoplay', techAutoplay);\n    }\n  }\n  /**\n   * Set or unset the playsinline attribute.\n   * Playsinline tells the browser that non-fullscreen playback is preferred.\n   *\n   * @param {boolean} [value]\n   *        - true means that we should try to play inline by default\n   *        - false means that we should use the browser's default playback mode,\n   *          which in most cases is inline. iOS Safari is a notable exception\n   *          and plays fullscreen by default.\n   *\n   * @return {string|Player}\n   *         - the current value of playsinline\n   *         - the player when setting\n   *\n   * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n   */\n  ;\n\n  _proto.playsinline = function playsinline(value) {\n    if (value !== undefined) {\n      this.techCall_('setPlaysinline', value);\n      this.options_.playsinline = value;\n      return this;\n    }\n\n    return this.techGet_('playsinline');\n  }\n  /**\n   * Get or set the loop attribute on the video element.\n   *\n   * @param {boolean} [value]\n   *        - true means that we should loop the video\n   *        - false means that we should not loop the video\n   *\n   * @return {boolean}\n   *         The current value of loop when getting\n   */\n  ;\n\n  _proto.loop = function loop(value) {\n    if (value !== undefined) {\n      this.techCall_('setLoop', value);\n      this.options_.loop = value;\n      return;\n    }\n\n    return this.techGet_('loop');\n  }\n  /**\n   * Get or set the poster image source url\n   *\n   * @fires Player#posterchange\n   *\n   * @param {string} [src]\n   *        Poster image source URL\n   *\n   * @return {string}\n   *         The current value of poster when getting\n   */\n  ;\n\n  _proto.poster = function poster(src) {\n    if (src === undefined) {\n      return this.poster_;\n    } // The correct way to remove a poster is to set as an empty string\n    // other falsey values will throw errors\n\n\n    if (!src) {\n      src = '';\n    }\n\n    if (src === this.poster_) {\n      return;\n    } // update the internal poster variable\n\n\n    this.poster_ = src; // update the tech's poster\n\n    this.techCall_('setPoster', src);\n    this.isPosterFromTech_ = false; // alert components that the poster has been set\n\n    /**\n     * This event fires when the poster image is changed on the player.\n     *\n     * @event Player#posterchange\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('posterchange');\n  }\n  /**\n   * Some techs (e.g. YouTube) can provide a poster source in an\n   * asynchronous way. We want the poster component to use this\n   * poster source so that it covers up the tech's controls.\n   * (YouTube's play button). However we only want to use this\n   * source if the player user hasn't set a poster through\n   * the normal APIs.\n   *\n   * @fires Player#posterchange\n   * @listens Tech#posterchange\n   * @private\n   */\n  ;\n\n  _proto.handleTechPosterChange_ = function handleTechPosterChange_() {\n    if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {\n      var newPoster = this.tech_.poster() || '';\n\n      if (newPoster !== this.poster_) {\n        this.poster_ = newPoster;\n        this.isPosterFromTech_ = true; // Let components know the poster has changed\n\n        this.trigger('posterchange');\n      }\n    }\n  }\n  /**\n   * Get or set whether or not the controls are showing.\n   *\n   * @fires Player#controlsenabled\n   *\n   * @param {boolean} [bool]\n   *        - true to turn controls on\n   *        - false to turn controls off\n   *\n   * @return {boolean}\n   *         The current value of controls when getting\n   */\n  ;\n\n  _proto.controls = function controls(bool) {\n    if (bool === undefined) {\n      return !!this.controls_;\n    }\n\n    bool = !!bool; // Don't trigger a change event unless it actually changed\n\n    if (this.controls_ === bool) {\n      return;\n    }\n\n    this.controls_ = bool;\n\n    if (this.usingNativeControls()) {\n      this.techCall_('setControls', bool);\n    }\n\n    if (this.controls_) {\n      this.removeClass('vjs-controls-disabled');\n      this.addClass('vjs-controls-enabled');\n      /**\n       * @event Player#controlsenabled\n       * @type {EventTarget~Event}\n       */\n\n      this.trigger('controlsenabled');\n\n      if (!this.usingNativeControls()) {\n        this.addTechControlsListeners_();\n      }\n    } else {\n      this.removeClass('vjs-controls-enabled');\n      this.addClass('vjs-controls-disabled');\n      /**\n       * @event Player#controlsdisabled\n       * @type {EventTarget~Event}\n       */\n\n      this.trigger('controlsdisabled');\n\n      if (!this.usingNativeControls()) {\n        this.removeTechControlsListeners_();\n      }\n    }\n  }\n  /**\n   * Toggle native controls on/off. Native controls are the controls built into\n   * devices (e.g. default iPhone controls) or other techs\n   * (e.g. Vimeo Controls)\n   * **This should only be set by the current tech, because only the tech knows\n   * if it can support native controls**\n   *\n   * @fires Player#usingnativecontrols\n   * @fires Player#usingcustomcontrols\n   *\n   * @param {boolean} [bool]\n   *        - true to turn native controls on\n   *        - false to turn native controls off\n   *\n   * @return {boolean}\n   *         The current value of native controls when getting\n   */\n  ;\n\n  _proto.usingNativeControls = function usingNativeControls(bool) {\n    if (bool === undefined) {\n      return !!this.usingNativeControls_;\n    }\n\n    bool = !!bool; // Don't trigger a change event unless it actually changed\n\n    if (this.usingNativeControls_ === bool) {\n      return;\n    }\n\n    this.usingNativeControls_ = bool;\n\n    if (this.usingNativeControls_) {\n      this.addClass('vjs-using-native-controls');\n      /**\n       * player is using the native device controls\n       *\n       * @event Player#usingnativecontrols\n       * @type {EventTarget~Event}\n       */\n\n      this.trigger('usingnativecontrols');\n    } else {\n      this.removeClass('vjs-using-native-controls');\n      /**\n       * player is using the custom HTML controls\n       *\n       * @event Player#usingcustomcontrols\n       * @type {EventTarget~Event}\n       */\n\n      this.trigger('usingcustomcontrols');\n    }\n  }\n  /**\n   * Set or get the current MediaError\n   *\n   * @fires Player#error\n   *\n   * @param  {MediaError|string|number} [err]\n   *         A MediaError or a string/number to be turned\n   *         into a MediaError\n   *\n   * @return {MediaError|null}\n   *         The current MediaError when getting (or null)\n   */\n  ;\n\n  _proto.error = function error(err) {\n    var _this18 = this;\n\n    if (err === undefined) {\n      return this.error_ || null;\n    } // allow hooks to modify error object\n\n\n    hooks('beforeerror').forEach(function (hookFunction) {\n      var newErr = hookFunction(_this18, err);\n\n      if (!(isObject(newErr) && !Array.isArray(newErr) || typeof newErr === 'string' || typeof newErr === 'number' || newErr === null)) {\n        _this18.log.error('please return a value that MediaError expects in beforeerror hooks');\n\n        return;\n      }\n\n      err = newErr;\n    }); // Suppress the first error message for no compatible source until\n    // user interaction\n\n    if (this.options_.suppressNotSupportedError && err && err.code === 4) {\n      var triggerSuppressedError = function triggerSuppressedError() {\n        this.error(err);\n      };\n\n      this.options_.suppressNotSupportedError = false;\n      this.any(['click', 'touchstart'], triggerSuppressedError);\n      this.one('loadstart', function () {\n        this.off(['click', 'touchstart'], triggerSuppressedError);\n      });\n      return;\n    } // restoring to default\n\n\n    if (err === null) {\n      this.error_ = err;\n      this.removeClass('vjs-error');\n\n      if (this.errorDisplay) {\n        this.errorDisplay.close();\n      }\n\n      return;\n    }\n\n    this.error_ = new MediaError(err); // add the vjs-error classname to the player\n\n    this.addClass('vjs-error'); // log the name of the error type and any message\n    // IE11 logs \"[object object]\" and required you to expand message to see error object\n\n    log$1.error(\"(CODE:\" + this.error_.code + \" \" + MediaError.errorTypes[this.error_.code] + \")\", this.error_.message, this.error_);\n    /**\n     * @event Player#error\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('error'); // notify hooks of the per player error\n\n    hooks('error').forEach(function (hookFunction) {\n      return hookFunction(_this18, _this18.error_);\n    });\n    return;\n  }\n  /**\n   * Report user activity\n   *\n   * @param {Object} event\n   *        Event object\n   */\n  ;\n\n  _proto.reportUserActivity = function reportUserActivity(event) {\n    this.userActivity_ = true;\n  }\n  /**\n   * Get/set if user is active\n   *\n   * @fires Player#useractive\n   * @fires Player#userinactive\n   *\n   * @param {boolean} [bool]\n   *        - true if the user is active\n   *        - false if the user is inactive\n   *\n   * @return {boolean}\n   *         The current value of userActive when getting\n   */\n  ;\n\n  _proto.userActive = function userActive(bool) {\n    if (bool === undefined) {\n      return this.userActive_;\n    }\n\n    bool = !!bool;\n\n    if (bool === this.userActive_) {\n      return;\n    }\n\n    this.userActive_ = bool;\n\n    if (this.userActive_) {\n      this.userActivity_ = true;\n      this.removeClass('vjs-user-inactive');\n      this.addClass('vjs-user-active');\n      /**\n       * @event Player#useractive\n       * @type {EventTarget~Event}\n       */\n\n      this.trigger('useractive');\n      return;\n    } // Chrome/Safari/IE have bugs where when you change the cursor it can\n    // trigger a mousemove event. This causes an issue when you're hiding\n    // the cursor when the user is inactive, and a mousemove signals user\n    // activity. Making it impossible to go into inactive mode. Specifically\n    // this happens in fullscreen when we really need to hide the cursor.\n    //\n    // When this gets resolved in ALL browsers it can be removed\n    // https://code.google.com/p/chromium/issues/detail?id=103041\n\n\n    if (this.tech_) {\n      this.tech_.one('mousemove', function (e) {\n        e.stopPropagation();\n        e.preventDefault();\n      });\n    }\n\n    this.userActivity_ = false;\n    this.removeClass('vjs-user-active');\n    this.addClass('vjs-user-inactive');\n    /**\n     * @event Player#userinactive\n     * @type {EventTarget~Event}\n     */\n\n    this.trigger('userinactive');\n  }\n  /**\n   * Listen for user activity based on timeout value\n   *\n   * @private\n   */\n  ;\n\n  _proto.listenForUserActivity_ = function listenForUserActivity_() {\n    var mouseInProgress;\n    var lastMoveX;\n    var lastMoveY;\n    var handleActivity = bind(this, this.reportUserActivity);\n\n    var handleMouseMove = function handleMouseMove(e) {\n      // #1068 - Prevent mousemove spamming\n      // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970\n      if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {\n        lastMoveX = e.screenX;\n        lastMoveY = e.screenY;\n        handleActivity();\n      }\n    };\n\n    var handleMouseDown = function handleMouseDown() {\n      handleActivity(); // For as long as the they are touching the device or have their mouse down,\n      // we consider them active even if they're not moving their finger or mouse.\n      // So we want to continue to update that they are active\n\n      this.clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time\n      // as the activityCheck interval (250) should ensure we never miss the\n      // next activityCheck\n\n      mouseInProgress = this.setInterval(handleActivity, 250);\n    };\n\n    var handleMouseUpAndMouseLeave = function handleMouseUpAndMouseLeave(event) {\n      handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down\n\n      this.clearInterval(mouseInProgress);\n    }; // Any mouse movement will be considered user activity\n\n\n    this.on('mousedown', handleMouseDown);\n    this.on('mousemove', handleMouseMove);\n    this.on('mouseup', handleMouseUpAndMouseLeave);\n    this.on('mouseleave', handleMouseUpAndMouseLeave);\n    var controlBar = this.getChild('controlBar'); // Fixes bug on Android & iOS where when tapping progressBar (when control bar is displayed)\n    // controlBar would no longer be hidden by default timeout.\n\n    if (controlBar && !IS_IOS && !IS_ANDROID) {\n      controlBar.on('mouseenter', function (event) {\n        if (this.player().options_.inactivityTimeout !== 0) {\n          this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;\n        }\n\n        this.player().options_.inactivityTimeout = 0;\n      });\n      controlBar.on('mouseleave', function (event) {\n        this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;\n      });\n    } // Listen for keyboard navigation\n    // Shouldn't need to use inProgress interval because of key repeat\n\n\n    this.on('keydown', handleActivity);\n    this.on('keyup', handleActivity); // Run an interval every 250 milliseconds instead of stuffing everything into\n    // the mousemove/touchmove function itself, to prevent performance degradation.\n    // `this.reportUserActivity` simply sets this.userActivity_ to true, which\n    // then gets picked up by this loop\n    // http://ejohn.org/blog/learning-from-twitter/\n\n    var inactivityTimeout;\n    this.setInterval(function () {\n      // Check to see if mouse/touch activity has happened\n      if (!this.userActivity_) {\n        return;\n      } // Reset the activity tracker\n\n\n      this.userActivity_ = false; // If the user state was inactive, set the state to active\n\n      this.userActive(true); // Clear any existing inactivity timeout to start the timer over\n\n      this.clearTimeout(inactivityTimeout);\n      var timeout = this.options_.inactivityTimeout;\n\n      if (timeout <= 0) {\n        return;\n      } // In <timeout> milliseconds, if no more activity has occurred the\n      // user will be considered inactive\n\n\n      inactivityTimeout = this.setTimeout(function () {\n        // Protect against the case where the inactivityTimeout can trigger just\n        // before the next user activity is picked up by the activity check loop\n        // causing a flicker\n        if (!this.userActivity_) {\n          this.userActive(false);\n        }\n      }, timeout);\n    }, 250);\n  }\n  /**\n   * Gets or sets the current playback rate. A playback rate of\n   * 1.0 represents normal speed and 0.5 would indicate half-speed\n   * playback, for instance.\n   *\n   * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate\n   *\n   * @param {number} [rate]\n   *       New playback rate to set.\n   *\n   * @return {number}\n   *         The current playback rate when getting or 1.0\n   */\n  ;\n\n  _proto.playbackRate = function playbackRate(rate) {\n    if (rate !== undefined) {\n      // NOTE: this.cache_.lastPlaybackRate is set from the tech handler\n      // that is registered above\n      this.techCall_('setPlaybackRate', rate);\n      return;\n    }\n\n    if (this.tech_ && this.tech_.featuresPlaybackRate) {\n      return this.cache_.lastPlaybackRate || this.techGet_('playbackRate');\n    }\n\n    return 1.0;\n  }\n  /**\n   * Gets or sets the current default playback rate. A default playback rate of\n   * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.\n   * defaultPlaybackRate will only represent what the initial playbackRate of a video was, not\n   * not the current playbackRate.\n   *\n   * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate\n   *\n   * @param {number} [rate]\n   *       New default playback rate to set.\n   *\n   * @return {number|Player}\n   *         - The default playback rate when getting or 1.0\n   *         - the player when setting\n   */\n  ;\n\n  _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {\n    if (rate !== undefined) {\n      return this.techCall_('setDefaultPlaybackRate', rate);\n    }\n\n    if (this.tech_ && this.tech_.featuresPlaybackRate) {\n      return this.techGet_('defaultPlaybackRate');\n    }\n\n    return 1.0;\n  }\n  /**\n   * Gets or sets the audio flag\n   *\n   * @param {boolean} bool\n   *        - true signals that this is an audio player\n   *        - false signals that this is not an audio player\n   *\n   * @return {boolean}\n   *         The current value of isAudio when getting\n   */\n  ;\n\n  _proto.isAudio = function isAudio(bool) {\n    if (bool !== undefined) {\n      this.isAudio_ = !!bool;\n      return;\n    }\n\n    return !!this.isAudio_;\n  };\n\n  _proto.enableAudioOnlyUI_ = function enableAudioOnlyUI_() {\n    var _this19 = this;\n\n    // Update styling immediately to show the control bar so we can get its height\n    this.addClass('vjs-audio-only-mode');\n    var playerChildren = this.children();\n    var controlBar = this.getChild('ControlBar');\n    var controlBarHeight = controlBar && controlBar.currentHeight(); // Hide all player components except the control bar. Control bar components\n    // needed only for video are hidden with CSS\n\n    playerChildren.forEach(function (child) {\n      if (child === controlBar) {\n        return;\n      }\n\n      if (child.el_ && !child.hasClass('vjs-hidden')) {\n        child.hide();\n\n        _this19.audioOnlyCache_.hiddenChildren.push(child);\n      }\n    });\n    this.audioOnlyCache_.playerHeight = this.currentHeight(); // Set the player height the same as the control bar\n\n    this.height(controlBarHeight);\n    this.trigger('audioonlymodechange');\n  };\n\n  _proto.disableAudioOnlyUI_ = function disableAudioOnlyUI_() {\n    this.removeClass('vjs-audio-only-mode'); // Show player components that were previously hidden\n\n    this.audioOnlyCache_.hiddenChildren.forEach(function (child) {\n      return child.show();\n    }); // Reset player height\n\n    this.height(this.audioOnlyCache_.playerHeight);\n    this.trigger('audioonlymodechange');\n  }\n  /**\n   * Get the current audioOnlyMode state or set audioOnlyMode to true or false.\n   *\n   * Setting this to `true` will hide all player components except the control bar,\n   * as well as control bar components needed only for video.\n   *\n   * @param {boolean} [value]\n   *         The value to set audioOnlyMode to.\n   *\n   * @return {Promise|boolean}\n   *        A Promise is returned when setting the state, and a boolean when getting\n   *        the present state\n   */\n  ;\n\n  _proto.audioOnlyMode = function audioOnlyMode(value) {\n    var _this20 = this;\n\n    if (typeof value !== 'boolean' || value === this.audioOnlyMode_) {\n      return this.audioOnlyMode_;\n    }\n\n    this.audioOnlyMode_ = value;\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      // Enable Audio Only Mode\n      if (value) {\n        var exitPromises = []; // Fullscreen and PiP are not supported in audioOnlyMode, so exit if we need to.\n\n        if (this.isInPictureInPicture()) {\n          exitPromises.push(this.exitPictureInPicture());\n        }\n\n        if (this.isFullscreen()) {\n          exitPromises.push(this.exitFullscreen());\n        }\n\n        if (this.audioPosterMode()) {\n          exitPromises.push(this.audioPosterMode(false));\n        }\n\n        return PromiseClass.all(exitPromises).then(function () {\n          return _this20.enableAudioOnlyUI_();\n        });\n      } // Disable Audio Only Mode\n\n\n      return PromiseClass.resolve().then(function () {\n        return _this20.disableAudioOnlyUI_();\n      });\n    }\n\n    if (value) {\n      if (this.isInPictureInPicture()) {\n        this.exitPictureInPicture();\n      }\n\n      if (this.isFullscreen()) {\n        this.exitFullscreen();\n      }\n\n      this.enableAudioOnlyUI_();\n    } else {\n      this.disableAudioOnlyUI_();\n    }\n  };\n\n  _proto.enablePosterModeUI_ = function enablePosterModeUI_() {\n    // Hide the video element and show the poster image to enable posterModeUI\n    var tech = this.tech_ && this.tech_;\n    tech.hide();\n    this.addClass('vjs-audio-poster-mode');\n    this.trigger('audiopostermodechange');\n  };\n\n  _proto.disablePosterModeUI_ = function disablePosterModeUI_() {\n    // Show the video element and hide the poster image to disable posterModeUI\n    var tech = this.tech_ && this.tech_;\n    tech.show();\n    this.removeClass('vjs-audio-poster-mode');\n    this.trigger('audiopostermodechange');\n  }\n  /**\n   * Get the current audioPosterMode state or set audioPosterMode to true or false\n   *\n   * @param {boolean} [value]\n   *         The value to set audioPosterMode to.\n   *\n   * @return {Promise|boolean}\n   *         A Promise is returned when setting the state, and a boolean when getting\n   *        the present state\n   */\n  ;\n\n  _proto.audioPosterMode = function audioPosterMode(value) {\n    var _this21 = this;\n\n    if (typeof value !== 'boolean' || value === this.audioPosterMode_) {\n      return this.audioPosterMode_;\n    }\n\n    this.audioPosterMode_ = value;\n    var PromiseClass = this.options_.Promise || window$1.Promise;\n\n    if (PromiseClass) {\n      if (value) {\n        if (this.audioOnlyMode()) {\n          var audioOnlyModePromise = this.audioOnlyMode(false);\n          return audioOnlyModePromise.then(function () {\n            // enable audio poster mode after audio only mode is disabled\n            _this21.enablePosterModeUI_();\n          });\n        }\n\n        return PromiseClass.resolve().then(function () {\n          // enable audio poster mode\n          _this21.enablePosterModeUI_();\n        });\n      }\n\n      return PromiseClass.resolve().then(function () {\n        // disable audio poster mode\n        _this21.disablePosterModeUI_();\n      });\n    }\n\n    if (value) {\n      if (this.audioOnlyMode()) {\n        this.audioOnlyMode(false);\n      }\n\n      this.enablePosterModeUI_();\n      return;\n    }\n\n    this.disablePosterModeUI_();\n  }\n  /**\n   * A helper method for adding a {@link TextTrack} to our\n   * {@link TextTrackList}.\n   *\n   * In addition to the W3C settings we allow adding additional info through options.\n   *\n   * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack\n   *\n   * @param {string} [kind]\n   *        the kind of TextTrack you are adding\n   *\n   * @param {string} [label]\n   *        the label to give the TextTrack label\n   *\n   * @param {string} [language]\n   *        the language to set on the TextTrack\n   *\n   * @return {TextTrack|undefined}\n   *         the TextTrack that was added or undefined\n   *         if there is no tech\n   */\n  ;\n\n  _proto.addTextTrack = function addTextTrack(kind, label, language) {\n    if (this.tech_) {\n      return this.tech_.addTextTrack(kind, label, language);\n    }\n  }\n  /**\n   * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}.\n   * When manualCleanup is set to false, the track will be automatically removed\n   * on source changes.\n   *\n   * @param {Object} options\n   *        Options to pass to {@link HTMLTrackElement} during creation. See\n   *        {@link HTMLTrackElement} for object properties that you should use.\n   *\n   * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n   *                                       removed on a source change\n   *\n   * @return {HtmlTrackElement}\n   *         the HTMLTrackElement that was created and added\n   *         to the HtmlTrackElementList and the remote\n   *         TextTrackList\n   *\n   * @deprecated The default value of the \"manualCleanup\" parameter will default\n   *             to \"false\" in upcoming versions of Video.js\n   */\n  ;\n\n  _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n    if (this.tech_) {\n      return this.tech_.addRemoteTextTrack(options, manualCleanup);\n    }\n  }\n  /**\n   * Remove a remote {@link TextTrack} from the respective\n   * {@link TextTrackList} and {@link HtmlTrackElementList}.\n   *\n   * @param {Object} track\n   *        Remote {@link TextTrack} to remove\n   *\n   * @return {undefined}\n   *         does not return anything\n   */\n  ;\n\n  _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {\n    if (obj === void 0) {\n      obj = {};\n    }\n\n    var _obj = obj,\n        track = _obj.track;\n\n    if (!track) {\n      track = obj;\n    } // destructure the input into an object with a track argument, defaulting to arguments[0]\n    // default the whole argument to an empty object if nothing was passed in\n\n\n    if (this.tech_) {\n      return this.tech_.removeRemoteTextTrack(track);\n    }\n  }\n  /**\n   * Gets available media playback quality metrics as specified by the W3C's Media\n   * Playback Quality API.\n   *\n   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n   *\n   * @return {Object|undefined}\n   *         An object with supported media playback quality metrics or undefined if there\n   *         is no tech or the tech does not support it.\n   */\n  ;\n\n  _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n    return this.techGet_('getVideoPlaybackQuality');\n  }\n  /**\n   * Get video width\n   *\n   * @return {number}\n   *         current video width\n   */\n  ;\n\n  _proto.videoWidth = function videoWidth() {\n    return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;\n  }\n  /**\n   * Get video height\n   *\n   * @return {number}\n   *         current video height\n   */\n  ;\n\n  _proto.videoHeight = function videoHeight() {\n    return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;\n  }\n  /**\n   * The player's language code.\n   *\n   * Changing the language will trigger\n   * [languagechange]{@link Player#event:languagechange}\n   * which Components can use to update control text.\n   * ClickableComponent will update its control text by default on\n   * [languagechange]{@link Player#event:languagechange}.\n   *\n   * @fires Player#languagechange\n   *\n   * @param {string} [code]\n   *        the language code to set the player to\n   *\n   * @return {string}\n   *         The current language code when getting\n   */\n  ;\n\n  _proto.language = function language(code) {\n    if (code === undefined) {\n      return this.language_;\n    }\n\n    if (this.language_ !== String(code).toLowerCase()) {\n      this.language_ = String(code).toLowerCase(); // during first init, it's possible some things won't be evented\n\n      if (isEvented(this)) {\n        /**\n        * fires when the player language change\n        *\n        * @event Player#languagechange\n        * @type {EventTarget~Event}\n        */\n        this.trigger('languagechange');\n      }\n    }\n  }\n  /**\n   * Get the player's language dictionary\n   * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time\n   * Languages specified directly in the player options have precedence\n   *\n   * @return {Array}\n   *         An array of of supported languages\n   */\n  ;\n\n  _proto.languages = function languages() {\n    return mergeOptions$3(Player.prototype.options_.languages, this.languages_);\n  }\n  /**\n   * returns a JavaScript object reperesenting the current track\n   * information. **DOES not return it as JSON**\n   *\n   * @return {Object}\n   *         Object representing the current of track info\n   */\n  ;\n\n  _proto.toJSON = function toJSON() {\n    var options = mergeOptions$3(this.options_);\n    var tracks = options.tracks;\n    options.tracks = [];\n\n    for (var i = 0; i < tracks.length; i++) {\n      var track = tracks[i]; // deep merge tracks and null out player so no circular references\n\n      track = mergeOptions$3(track);\n      track.player = undefined;\n      options.tracks[i] = track;\n    }\n\n    return options;\n  }\n  /**\n   * Creates a simple modal dialog (an instance of the {@link ModalDialog}\n   * component) that immediately overlays the player with arbitrary\n   * content and removes itself when closed.\n   *\n   * @param {string|Function|Element|Array|null} content\n   *        Same as {@link ModalDialog#content}'s param of the same name.\n   *        The most straight-forward usage is to provide a string or DOM\n   *        element.\n   *\n   * @param {Object} [options]\n   *        Extra options which will be passed on to the {@link ModalDialog}.\n   *\n   * @return {ModalDialog}\n   *         the {@link ModalDialog} that was created\n   */\n  ;\n\n  _proto.createModal = function createModal(content, options) {\n    var _this22 = this;\n\n    options = options || {};\n    options.content = content || '';\n    var modal = new ModalDialog(this, options);\n    this.addChild(modal);\n    modal.on('dispose', function () {\n      _this22.removeChild(modal);\n    });\n    modal.open();\n    return modal;\n  }\n  /**\n   * Change breakpoint classes when the player resizes.\n   *\n   * @private\n   */\n  ;\n\n  _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {\n    if (!this.responsive()) {\n      return;\n    }\n\n    var currentBreakpoint = this.currentBreakpoint();\n    var currentWidth = this.currentWidth();\n\n    for (var i = 0; i < BREAKPOINT_ORDER.length; i++) {\n      var candidateBreakpoint = BREAKPOINT_ORDER[i];\n      var maxWidth = this.breakpoints_[candidateBreakpoint];\n\n      if (currentWidth <= maxWidth) {\n        // The current breakpoint did not change, nothing to do.\n        if (currentBreakpoint === candidateBreakpoint) {\n          return;\n        } // Only remove a class if there is a current breakpoint.\n\n\n        if (currentBreakpoint) {\n          this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);\n        }\n\n        this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);\n        this.breakpoint_ = candidateBreakpoint;\n        break;\n      }\n    }\n  }\n  /**\n   * Removes the current breakpoint.\n   *\n   * @private\n   */\n  ;\n\n  _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {\n    var className = this.currentBreakpointClass();\n    this.breakpoint_ = '';\n\n    if (className) {\n      this.removeClass(className);\n    }\n  }\n  /**\n   * Get or set breakpoints on the player.\n   *\n   * Calling this method with an object or `true` will remove any previous\n   * custom breakpoints and start from the defaults again.\n   *\n   * @param  {Object|boolean} [breakpoints]\n   *         If an object is given, it can be used to provide custom\n   *         breakpoints. If `true` is given, will set default breakpoints.\n   *         If this argument is not given, will simply return the current\n   *         breakpoints.\n   *\n   * @param  {number} [breakpoints.tiny]\n   *         The maximum width for the \"vjs-layout-tiny\" class.\n   *\n   * @param  {number} [breakpoints.xsmall]\n   *         The maximum width for the \"vjs-layout-x-small\" class.\n   *\n   * @param  {number} [breakpoints.small]\n   *         The maximum width for the \"vjs-layout-small\" class.\n   *\n   * @param  {number} [breakpoints.medium]\n   *         The maximum width for the \"vjs-layout-medium\" class.\n   *\n   * @param  {number} [breakpoints.large]\n   *         The maximum width for the \"vjs-layout-large\" class.\n   *\n   * @param  {number} [breakpoints.xlarge]\n   *         The maximum width for the \"vjs-layout-x-large\" class.\n   *\n   * @param  {number} [breakpoints.huge]\n   *         The maximum width for the \"vjs-layout-huge\" class.\n   *\n   * @return {Object}\n   *         An object mapping breakpoint names to maximum width values.\n   */\n  ;\n\n  _proto.breakpoints = function breakpoints(_breakpoints) {\n    // Used as a getter.\n    if (_breakpoints === undefined) {\n      return assign(this.breakpoints_);\n    }\n\n    this.breakpoint_ = '';\n    this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints); // When breakpoint definitions change, we need to update the currently\n    // selected breakpoint.\n\n    this.updateCurrentBreakpoint_(); // Clone the breakpoints before returning.\n\n    return assign(this.breakpoints_);\n  }\n  /**\n   * Get or set a flag indicating whether or not this player should adjust\n   * its UI based on its dimensions.\n   *\n   * @param  {boolean} value\n   *         Should be `true` if the player should adjust its UI based on its\n   *         dimensions; otherwise, should be `false`.\n   *\n   * @return {boolean}\n   *         Will be `true` if this player should adjust its UI based on its\n   *         dimensions; otherwise, will be `false`.\n   */\n  ;\n\n  _proto.responsive = function responsive(value) {\n    // Used as a getter.\n    if (value === undefined) {\n      return this.responsive_;\n    }\n\n    value = Boolean(value);\n    var current = this.responsive_; // Nothing changed.\n\n    if (value === current) {\n      return;\n    } // The value actually changed, set it.\n\n\n    this.responsive_ = value; // Start listening for breakpoints and set the initial breakpoint if the\n    // player is now responsive.\n\n    if (value) {\n      this.on('playerresize', this.boundUpdateCurrentBreakpoint_);\n      this.updateCurrentBreakpoint_(); // Stop listening for breakpoints if the player is no longer responsive.\n    } else {\n      this.off('playerresize', this.boundUpdateCurrentBreakpoint_);\n      this.removeCurrentBreakpoint_();\n    }\n\n    return value;\n  }\n  /**\n   * Get current breakpoint name, if any.\n   *\n   * @return {string}\n   *         If there is currently a breakpoint set, returns a the key from the\n   *         breakpoints object matching it. Otherwise, returns an empty string.\n   */\n  ;\n\n  _proto.currentBreakpoint = function currentBreakpoint() {\n    return this.breakpoint_;\n  }\n  /**\n   * Get the current breakpoint class name.\n   *\n   * @return {string}\n   *         The matching class name (e.g. `\"vjs-layout-tiny\"` or\n   *         `\"vjs-layout-large\"`) for the current breakpoint. Empty string if\n   *         there is no current breakpoint.\n   */\n  ;\n\n  _proto.currentBreakpointClass = function currentBreakpointClass() {\n    return BREAKPOINT_CLASSES[this.breakpoint_] || '';\n  }\n  /**\n   * An object that describes a single piece of media.\n   *\n   * Properties that are not part of this type description will be retained; so,\n   * this can be viewed as a generic metadata storage mechanism as well.\n   *\n   * @see      {@link https://wicg.github.io/mediasession/#the-mediametadata-interface}\n   * @typedef  {Object} Player~MediaObject\n   *\n   * @property {string} [album]\n   *           Unused, except if this object is passed to the `MediaSession`\n   *           API.\n   *\n   * @property {string} [artist]\n   *           Unused, except if this object is passed to the `MediaSession`\n   *           API.\n   *\n   * @property {Object[]} [artwork]\n   *           Unused, except if this object is passed to the `MediaSession`\n   *           API. If not specified, will be populated via the `poster`, if\n   *           available.\n   *\n   * @property {string} [poster]\n   *           URL to an image that will display before playback.\n   *\n   * @property {Tech~SourceObject|Tech~SourceObject[]|string} [src]\n   *           A single source object, an array of source objects, or a string\n   *           referencing a URL to a media source. It is _highly recommended_\n   *           that an object or array of objects is used here, so that source\n   *           selection algorithms can take the `type` into account.\n   *\n   * @property {string} [title]\n   *           Unused, except if this object is passed to the `MediaSession`\n   *           API.\n   *\n   * @property {Object[]} [textTracks]\n   *           An array of objects to be used to create text tracks, following\n   *           the {@link https://www.w3.org/TR/html50/embedded-content-0.html#the-track-element|native track element format}.\n   *           For ease of removal, these will be created as \"remote\" text\n   *           tracks and set to automatically clean up on source changes.\n   *\n   *           These objects may have properties like `src`, `kind`, `label`,\n   *           and `language`, see {@link Tech#createRemoteTextTrack}.\n   */\n\n  /**\n   * Populate the player using a {@link Player~MediaObject|MediaObject}.\n   *\n   * @param  {Player~MediaObject} media\n   *         A media object.\n   *\n   * @param  {Function} ready\n   *         A callback to be called when the player is ready.\n   */\n  ;\n\n  _proto.loadMedia = function loadMedia(media, ready) {\n    var _this23 = this;\n\n    if (!media || typeof media !== 'object') {\n      return;\n    }\n\n    this.reset(); // Clone the media object so it cannot be mutated from outside.\n\n    this.cache_.media = mergeOptions$3(media);\n    var _this$cache_$media = this.cache_.media,\n        artwork = _this$cache_$media.artwork,\n        poster = _this$cache_$media.poster,\n        src = _this$cache_$media.src,\n        textTracks = _this$cache_$media.textTracks; // If `artwork` is not given, create it using `poster`.\n\n    if (!artwork && poster) {\n      this.cache_.media.artwork = [{\n        src: poster,\n        type: getMimetype(poster)\n      }];\n    }\n\n    if (src) {\n      this.src(src);\n    }\n\n    if (poster) {\n      this.poster(poster);\n    }\n\n    if (Array.isArray(textTracks)) {\n      textTracks.forEach(function (tt) {\n        return _this23.addRemoteTextTrack(tt, false);\n      });\n    }\n\n    this.ready(ready);\n  }\n  /**\n   * Get a clone of the current {@link Player~MediaObject} for this player.\n   *\n   * If the `loadMedia` method has not been used, will attempt to return a\n   * {@link Player~MediaObject} based on the current state of the player.\n   *\n   * @return {Player~MediaObject}\n   */\n  ;\n\n  _proto.getMedia = function getMedia() {\n    if (!this.cache_.media) {\n      var poster = this.poster();\n      var src = this.currentSources();\n      var textTracks = Array.prototype.map.call(this.remoteTextTracks(), function (tt) {\n        return {\n          kind: tt.kind,\n          label: tt.label,\n          language: tt.language,\n          src: tt.src\n        };\n      });\n      var media = {\n        src: src,\n        textTracks: textTracks\n      };\n\n      if (poster) {\n        media.poster = poster;\n        media.artwork = [{\n          src: media.poster,\n          type: getMimetype(media.poster)\n        }];\n      }\n\n      return media;\n    }\n\n    return mergeOptions$3(this.cache_.media);\n  }\n  /**\n   * Gets tag settings\n   *\n   * @param {Element} tag\n   *        The player tag\n   *\n   * @return {Object}\n   *         An object containing all of the settings\n   *         for a player tag\n   */\n  ;\n\n  Player.getTagSettings = function getTagSettings(tag) {\n    var baseOptions = {\n      sources: [],\n      tracks: []\n    };\n    var tagOptions = getAttributes(tag);\n    var dataSetup = tagOptions['data-setup'];\n\n    if (hasClass(tag, 'vjs-fill')) {\n      tagOptions.fill = true;\n    }\n\n    if (hasClass(tag, 'vjs-fluid')) {\n      tagOptions.fluid = true;\n    } // Check if data-setup attr exists.\n\n\n    if (dataSetup !== null) {\n      // Parse options JSON\n      // If empty string, make it a parsable json object.\n      var _safeParseTuple = safeParseTuple(dataSetup || '{}'),\n          err = _safeParseTuple[0],\n          data = _safeParseTuple[1];\n\n      if (err) {\n        log$1.error(err);\n      }\n\n      assign(tagOptions, data);\n    }\n\n    assign(baseOptions, tagOptions); // Get tag children settings\n\n    if (tag.hasChildNodes()) {\n      var children = tag.childNodes;\n\n      for (var i = 0, j = children.length; i < j; i++) {\n        var child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/\n\n        var childName = child.nodeName.toLowerCase();\n\n        if (childName === 'source') {\n          baseOptions.sources.push(getAttributes(child));\n        } else if (childName === 'track') {\n          baseOptions.tracks.push(getAttributes(child));\n        }\n      }\n    }\n\n    return baseOptions;\n  }\n  /**\n   * Determine whether or not flexbox is supported\n   *\n   * @return {boolean}\n   *         - true if flexbox is supported\n   *         - false if flexbox is not supported\n   */\n  ;\n\n  _proto.flexNotSupported_ = function flexNotSupported_() {\n    var elem = document.createElement('i'); // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more\n    // common flex features that we can rely on when checking for flex support.\n\n    return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || // IE10-specific (2012 flex spec), available for completeness\n    'msFlexOrder' in elem.style);\n  }\n  /**\n   * Set debug mode to enable/disable logs at info level.\n   *\n   * @param {boolean} enabled\n   * @fires Player#debugon\n   * @fires Player#debugoff\n   */\n  ;\n\n  _proto.debug = function debug(enabled) {\n    if (enabled === undefined) {\n      return this.debugEnabled_;\n    }\n\n    if (enabled) {\n      this.trigger('debugon');\n      this.previousLogLevel_ = this.log.level;\n      this.log.level('debug');\n      this.debugEnabled_ = true;\n    } else {\n      this.trigger('debugoff');\n      this.log.level(this.previousLogLevel_);\n      this.previousLogLevel_ = undefined;\n      this.debugEnabled_ = false;\n    }\n  }\n  /**\n   * Set or get current playback rates.\n   * Takes an array and updates the playback rates menu with the new items.\n   * Pass in an empty array to hide the menu.\n   * Values other than arrays are ignored.\n   *\n   * @fires Player#playbackrateschange\n   * @param {number[]} newRates\n   *                   The new rates that the playback rates menu should update to.\n   *                   An empty array will hide the menu\n   * @return {number[]} When used as a getter will return the current playback rates\n   */\n  ;\n\n  _proto.playbackRates = function playbackRates(newRates) {\n    if (newRates === undefined) {\n      return this.cache_.playbackRates;\n    } // ignore any value that isn't an array\n\n\n    if (!Array.isArray(newRates)) {\n      return;\n    } // ignore any arrays that don't only contain numbers\n\n\n    if (!newRates.every(function (rate) {\n      return typeof rate === 'number';\n    })) {\n      return;\n    }\n\n    this.cache_.playbackRates = newRates;\n    /**\n    * fires when the playback rates in a player are changed\n    *\n    * @event Player#playbackrateschange\n    * @type {EventTarget~Event}\n    */\n\n    this.trigger('playbackrateschange');\n  };\n\n  return Player;\n}(Component$1);\n/**\n * Get the {@link VideoTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist\n *\n * @return {VideoTrackList}\n *         the current video track list\n *\n * @method Player.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist\n *\n * @return {AudioTrackList}\n *         the current audio track list\n *\n * @method Player.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks\n *\n * @return {TextTrackList}\n *         the current text track list\n *\n * @method Player.prototype.textTracks\n */\n\n/**\n * Get the remote {@link TextTrackList}\n *\n * @return {TextTrackList}\n *         The current remote text track list\n *\n * @method Player.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote {@link HtmlTrackElementList} tracks.\n *\n * @return {HtmlTrackElementList}\n *         The current remote text track element list\n *\n * @method Player.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n  var props = ALL[name];\n\n  Player.prototype[props.getterName] = function () {\n    if (this.tech_) {\n      return this.tech_[props.getterName]();\n    } // if we have not yet loadTech_, we create {video,audio,text}Tracks_\n    // these will be passed to the tech during loading\n\n\n    this[props.privateName] = this[props.privateName] || new props.ListClass();\n    return this[props.privateName];\n  };\n});\n/**\n * Get or set the `Player`'s crossorigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n * behavior.\n *\n * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n *\n * @param {string} [value]\n *        The value to set the `Player`'s crossorigin to. If an argument is\n *        given, must be one of `anonymous` or `use-credentials`.\n *\n * @return {string|undefined}\n *         - The current crossorigin value of the `Player` when getting.\n *         - undefined when setting\n */\n\nPlayer.prototype.crossorigin = Player.prototype.crossOrigin;\n/**\n * Global enumeration of players.\n *\n * The keys are the player IDs and the values are either the {@link Player}\n * instance or `null` for disposed players.\n *\n * @type {Object}\n */\n\nPlayer.players = {};\nvar navigator = window$1.navigator;\n/*\n * Player instance options, surfaced using options\n * options = Player.prototype.options_\n * Make changes in options, not here.\n *\n * @type {Object}\n * @private\n */\n\nPlayer.prototype.options_ = {\n  // Default order of fallback technology\n  techOrder: Tech.defaultTechOrder_,\n  html5: {},\n  // default inactivity timeout\n  inactivityTimeout: 2000,\n  // default playback rates\n  playbackRates: [],\n  // Add playback rate selection by adding rates\n  // 'playbackRates': [0.5, 1, 1.5, 2],\n  liveui: false,\n  // Included control sets\n  children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],\n  language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en',\n  // locales and their language translations\n  languages: {},\n  // Default message to show when a video cannot be played.\n  notSupportedMessage: 'No compatible source was found for this media.',\n  normalizeAutoplay: false,\n  fullscreen: {\n    options: {\n      navigationUI: 'hide'\n    }\n  },\n  breakpoints: {},\n  responsive: false,\n  audioOnlyMode: false,\n  audioPosterMode: false\n};\n[\n/**\n * Returns whether or not the player is in the \"ended\" state.\n *\n * @return {Boolean} True if the player is in the ended state, false if not.\n * @method Player#ended\n */\n'ended',\n/**\n * Returns whether or not the player is in the \"seeking\" state.\n *\n * @return {Boolean} True if the player is in the seeking state, false if not.\n * @method Player#seeking\n */\n'seeking',\n/**\n * Returns the TimeRanges of the media that are currently available\n * for seeking to.\n *\n * @return {TimeRanges} the seekable intervals of the media timeline\n * @method Player#seekable\n */\n'seekable',\n/**\n * Returns the current state of network activity for the element, from\n * the codes in the list below.\n * - NETWORK_EMPTY (numeric value 0)\n *   The element has not yet been initialised. All attributes are in\n *   their initial states.\n * - NETWORK_IDLE (numeric value 1)\n *   The element's resource selection algorithm is active and has\n *   selected a resource, but it is not actually using the network at\n *   this time.\n * - NETWORK_LOADING (numeric value 2)\n *   The user agent is actively trying to download data.\n * - NETWORK_NO_SOURCE (numeric value 3)\n *   The element's resource selection algorithm is active, but it has\n *   not yet found a resource to use.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states\n * @return {number} the current network activity state\n * @method Player#networkState\n */\n'networkState',\n/**\n * Returns a value that expresses the current state of the element\n * with respect to rendering the current playback position, from the\n * codes in the list below.\n * - HAVE_NOTHING (numeric value 0)\n *   No information regarding the media resource is available.\n * - HAVE_METADATA (numeric value 1)\n *   Enough of the resource has been obtained that the duration of the\n *   resource is available.\n * - HAVE_CURRENT_DATA (numeric value 2)\n *   Data for the immediate current playback position is available.\n * - HAVE_FUTURE_DATA (numeric value 3)\n *   Data for the immediate current playback position is available, as\n *   well as enough data for the user agent to advance the current\n *   playback position in the direction of playback.\n * - HAVE_ENOUGH_DATA (numeric value 4)\n *   The user agent estimates that enough data is available for\n *   playback to proceed uninterrupted.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate\n * @return {number} the current playback rendering state\n * @method Player#readyState\n */\n'readyState'].forEach(function (fn) {\n  Player.prototype[fn] = function () {\n    return this.techGet_(fn);\n  };\n});\nTECH_EVENTS_RETRIGGER.forEach(function (event) {\n  Player.prototype[\"handleTech\" + toTitleCase$1(event) + \"_\"] = function () {\n    return this.trigger(event);\n  };\n});\n/**\n * Fired when the player has initial duration and dimension information\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the player has downloaded data at the current playback position\n *\n * @event Player#loadeddata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the current playback position has changed *\n * During playback this is fired every 15-250 milliseconds, depending on the\n * playback technology in use.\n *\n * @event Player#timeupdate\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the volume changes\n *\n * @event Player#volumechange\n * @type {EventTarget~Event}\n */\n\n/**\n * Reports whether or not a player has a plugin available.\n *\n * This does not report whether or not the plugin has ever been initialized\n * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.\n *\n * @method Player#hasPlugin\n * @param  {string}  name\n *         The name of a plugin.\n *\n * @return {boolean}\n *         Whether or not this player has the requested plugin available.\n */\n\n/**\n * Reports whether or not a player is using a plugin by name.\n *\n * For basic plugins, this only reports whether the plugin has _ever_ been\n * initialized on this player.\n *\n * @method Player#usingPlugin\n * @param  {string} name\n *         The name of a plugin.\n *\n * @return {boolean}\n *         Whether or not this player is using the requested plugin.\n */\n\nComponent$1.registerComponent('Player', Player);\n\n/**\n * The base plugin name.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar BASE_PLUGIN_NAME = 'plugin';\n/**\n * The key on which a player's active plugins cache is stored.\n *\n * @private\n * @constant\n * @type     {string}\n */\n\nvar PLUGIN_CACHE_KEY = 'activePlugins_';\n/**\n * Stores registered plugins in a private space.\n *\n * @private\n * @type    {Object}\n */\n\nvar pluginStorage = {};\n/**\n * Reports whether or not a plugin has been registered.\n *\n * @private\n * @param   {string} name\n *          The name of a plugin.\n *\n * @return {boolean}\n *          Whether or not the plugin has been registered.\n */\n\nvar pluginExists = function pluginExists(name) {\n  return pluginStorage.hasOwnProperty(name);\n};\n/**\n * Get a single registered plugin by name.\n *\n * @private\n * @param   {string} name\n *          The name of a plugin.\n *\n * @return {Function|undefined}\n *          The plugin (or undefined).\n */\n\n\nvar getPlugin = function getPlugin(name) {\n  return pluginExists(name) ? pluginStorage[name] : undefined;\n};\n/**\n * Marks a plugin as \"active\" on a player.\n *\n * Also, ensures that the player has an object for tracking active plugins.\n *\n * @private\n * @param   {Player} player\n *          A Video.js player instance.\n *\n * @param   {string} name\n *          The name of a plugin.\n */\n\n\nvar markPluginAsActive = function markPluginAsActive(player, name) {\n  player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};\n  player[PLUGIN_CACHE_KEY][name] = true;\n};\n/**\n * Triggers a pair of plugin setup events.\n *\n * @private\n * @param  {Player} player\n *         A Video.js player instance.\n *\n * @param  {Plugin~PluginEventHash} hash\n *         A plugin event hash.\n *\n * @param  {boolean} [before]\n *         If true, prefixes the event name with \"before\". In other words,\n *         use this to trigger \"beforepluginsetup\" instead of \"pluginsetup\".\n */\n\n\nvar triggerSetupEvent = function triggerSetupEvent(player, hash, before) {\n  var eventName = (before ? 'before' : '') + 'pluginsetup';\n  player.trigger(eventName, hash);\n  player.trigger(eventName + ':' + hash.name, hash);\n};\n/**\n * Takes a basic plugin function and returns a wrapper function which marks\n * on the player that the plugin has been activated.\n *\n * @private\n * @param   {string} name\n *          The name of the plugin.\n *\n * @param   {Function} plugin\n *          The basic plugin.\n *\n * @return {Function}\n *          A wrapper function for the given plugin.\n */\n\n\nvar createBasicPlugin = function createBasicPlugin(name, plugin) {\n  var basicPluginWrapper = function basicPluginWrapper() {\n    // We trigger the \"beforepluginsetup\" and \"pluginsetup\" events on the player\n    // regardless, but we want the hash to be consistent with the hash provided\n    // for advanced plugins.\n    //\n    // The only potentially counter-intuitive thing here is the `instance` in\n    // the \"pluginsetup\" event is the value returned by the `plugin` function.\n    triggerSetupEvent(this, {\n      name: name,\n      plugin: plugin,\n      instance: null\n    }, true);\n    var instance = plugin.apply(this, arguments);\n    markPluginAsActive(this, name);\n    triggerSetupEvent(this, {\n      name: name,\n      plugin: plugin,\n      instance: instance\n    });\n    return instance;\n  };\n\n  Object.keys(plugin).forEach(function (prop) {\n    basicPluginWrapper[prop] = plugin[prop];\n  });\n  return basicPluginWrapper;\n};\n/**\n * Takes a plugin sub-class and returns a factory function for generating\n * instances of it.\n *\n * This factory function will replace itself with an instance of the requested\n * sub-class of Plugin.\n *\n * @private\n * @param   {string} name\n *          The name of the plugin.\n *\n * @param   {Plugin} PluginSubClass\n *          The advanced plugin.\n *\n * @return {Function}\n */\n\n\nvar createPluginFactory = function createPluginFactory(name, PluginSubClass) {\n  // Add a `name` property to the plugin prototype so that each plugin can\n  // refer to itself by name.\n  PluginSubClass.prototype.name = name;\n  return function () {\n    triggerSetupEvent(this, {\n      name: name,\n      plugin: PluginSubClass,\n      instance: null\n    }, true);\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    var instance = _construct(PluginSubClass, [this].concat(args)); // The plugin is replaced by a function that returns the current instance.\n\n\n    this[name] = function () {\n      return instance;\n    };\n\n    triggerSetupEvent(this, instance.getEventHash());\n    return instance;\n  };\n};\n/**\n * Parent class for all advanced plugins.\n *\n * @mixes   module:evented~EventedMixin\n * @mixes   module:stateful~StatefulMixin\n * @fires   Player#beforepluginsetup\n * @fires   Player#beforepluginsetup:$name\n * @fires   Player#pluginsetup\n * @fires   Player#pluginsetup:$name\n * @listens Player#dispose\n * @throws  {Error}\n *          If attempting to instantiate the base {@link Plugin} class\n *          directly instead of via a sub-class.\n */\n\n\nvar Plugin = /*#__PURE__*/function () {\n  /**\n   * Creates an instance of this class.\n   *\n   * Sub-classes should call `super` to ensure plugins are properly initialized.\n   *\n   * @param {Player} player\n   *        A Video.js player instance.\n   */\n  function Plugin(player) {\n    if (this.constructor === Plugin) {\n      throw new Error('Plugin must be sub-classed; not directly instantiated.');\n    }\n\n    this.player = player;\n\n    if (!this.log) {\n      this.log = this.player.log.createLogger(this.name);\n    } // Make this object evented, but remove the added `trigger` method so we\n    // use the prototype version instead.\n\n\n    evented(this);\n    delete this.trigger;\n    stateful(this, this.constructor.defaultState);\n    markPluginAsActive(player, this.name); // Auto-bind the dispose method so we can use it as a listener and unbind\n    // it later easily.\n\n    this.dispose = this.dispose.bind(this); // If the player is disposed, dispose the plugin.\n\n    player.on('dispose', this.dispose);\n  }\n  /**\n   * Get the version of the plugin that was set on <pluginName>.VERSION\n   */\n\n\n  var _proto = Plugin.prototype;\n\n  _proto.version = function version() {\n    return this.constructor.VERSION;\n  }\n  /**\n   * Each event triggered by plugins includes a hash of additional data with\n   * conventional properties.\n   *\n   * This returns that object or mutates an existing hash.\n   *\n   * @param   {Object} [hash={}]\n   *          An object to be used as event an event hash.\n   *\n   * @return {Plugin~PluginEventHash}\n   *          An event hash object with provided properties mixed-in.\n   */\n  ;\n\n  _proto.getEventHash = function getEventHash(hash) {\n    if (hash === void 0) {\n      hash = {};\n    }\n\n    hash.name = this.name;\n    hash.plugin = this.constructor;\n    hash.instance = this;\n    return hash;\n  }\n  /**\n   * Triggers an event on the plugin object and overrides\n   * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.\n   *\n   * @param   {string|Object} event\n   *          An event type or an object with a type property.\n   *\n   * @param   {Object} [hash={}]\n   *          Additional data hash to merge with a\n   *          {@link Plugin~PluginEventHash|PluginEventHash}.\n   *\n   * @return {boolean}\n   *          Whether or not default was prevented.\n   */\n  ;\n\n  _proto.trigger = function trigger$1(event, hash) {\n    if (hash === void 0) {\n      hash = {};\n    }\n\n    return trigger(this.eventBusEl_, event, this.getEventHash(hash));\n  }\n  /**\n   * Handles \"statechanged\" events on the plugin. No-op by default, override by\n   * subclassing.\n   *\n   * @abstract\n   * @param    {Event} e\n   *           An event object provided by a \"statechanged\" event.\n   *\n   * @param    {Object} e.changes\n   *           An object describing changes that occurred with the \"statechanged\"\n   *           event.\n   */\n  ;\n\n  _proto.handleStateChanged = function handleStateChanged(e) {}\n  /**\n   * Disposes a plugin.\n   *\n   * Subclasses can override this if they want, but for the sake of safety,\n   * it's probably best to subscribe the \"dispose\" event.\n   *\n   * @fires Plugin#dispose\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    var name = this.name,\n        player = this.player;\n    /**\n     * Signals that a advanced plugin is about to be disposed.\n     *\n     * @event Plugin#dispose\n     * @type  {EventTarget~Event}\n     */\n\n    this.trigger('dispose');\n    this.off();\n    player.off('dispose', this.dispose); // Eliminate any possible sources of leaking memory by clearing up\n    // references between the player and the plugin instance and nulling out\n    // the plugin's state and replacing methods with a function that throws.\n\n    player[PLUGIN_CACHE_KEY][name] = false;\n    this.player = this.state = null; // Finally, replace the plugin name on the player with a new factory\n    // function, so that the plugin is ready to be set up again.\n\n    player[name] = createPluginFactory(name, pluginStorage[name]);\n  }\n  /**\n   * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).\n   *\n   * @param   {string|Function} plugin\n   *          If a string, matches the name of a plugin. If a function, will be\n   *          tested directly.\n   *\n   * @return {boolean}\n   *          Whether or not a plugin is a basic plugin.\n   */\n  ;\n\n  Plugin.isBasic = function isBasic(plugin) {\n    var p = typeof plugin === 'string' ? getPlugin(plugin) : plugin;\n    return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype);\n  }\n  /**\n   * Register a Video.js plugin.\n   *\n   * @param   {string} name\n   *          The name of the plugin to be registered. Must be a string and\n   *          must not match an existing plugin or a method on the `Player`\n   *          prototype.\n   *\n   * @param   {Function} plugin\n   *          A sub-class of `Plugin` or a function for basic plugins.\n   *\n   * @return {Function}\n   *          For advanced plugins, a factory function for that plugin. For\n   *          basic plugins, a wrapper function that initializes the plugin.\n   */\n  ;\n\n  Plugin.registerPlugin = function registerPlugin(name, plugin) {\n    if (typeof name !== 'string') {\n      throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", must be a string, was \" + typeof name + \".\");\n    }\n\n    if (pluginExists(name)) {\n      log$1.warn(\"A plugin named \\\"\" + name + \"\\\" already exists. You may want to avoid re-registering plugins!\");\n    } else if (Player.prototype.hasOwnProperty(name)) {\n      throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", cannot share a name with an existing player method!\");\n    }\n\n    if (typeof plugin !== 'function') {\n      throw new Error(\"Illegal plugin for \\\"\" + name + \"\\\", must be a function, was \" + typeof plugin + \".\");\n    }\n\n    pluginStorage[name] = plugin; // Add a player prototype method for all sub-classed plugins (but not for\n    // the base Plugin class).\n\n    if (name !== BASE_PLUGIN_NAME) {\n      if (Plugin.isBasic(plugin)) {\n        Player.prototype[name] = createBasicPlugin(name, plugin);\n      } else {\n        Player.prototype[name] = createPluginFactory(name, plugin);\n      }\n    }\n\n    return plugin;\n  }\n  /**\n   * De-register a Video.js plugin.\n   *\n   * @param  {string} name\n   *         The name of the plugin to be de-registered. Must be a string that\n   *         matches an existing plugin.\n   *\n   * @throws {Error}\n   *         If an attempt is made to de-register the base plugin.\n   */\n  ;\n\n  Plugin.deregisterPlugin = function deregisterPlugin(name) {\n    if (name === BASE_PLUGIN_NAME) {\n      throw new Error('Cannot de-register base plugin.');\n    }\n\n    if (pluginExists(name)) {\n      delete pluginStorage[name];\n      delete Player.prototype[name];\n    }\n  }\n  /**\n   * Gets an object containing multiple Video.js plugins.\n   *\n   * @param   {Array} [names]\n   *          If provided, should be an array of plugin names. Defaults to _all_\n   *          plugin names.\n   *\n   * @return {Object|undefined}\n   *          An object containing plugin(s) associated with their name(s) or\n   *          `undefined` if no matching plugins exist).\n   */\n  ;\n\n  Plugin.getPlugins = function getPlugins(names) {\n    if (names === void 0) {\n      names = Object.keys(pluginStorage);\n    }\n\n    var result;\n    names.forEach(function (name) {\n      var plugin = getPlugin(name);\n\n      if (plugin) {\n        result = result || {};\n        result[name] = plugin;\n      }\n    });\n    return result;\n  }\n  /**\n   * Gets a plugin's version, if available\n   *\n   * @param   {string} name\n   *          The name of a plugin.\n   *\n   * @return {string}\n   *          The plugin's version or an empty string.\n   */\n  ;\n\n  Plugin.getPluginVersion = function getPluginVersion(name) {\n    var plugin = getPlugin(name);\n    return plugin && plugin.VERSION || '';\n  };\n\n  return Plugin;\n}();\n/**\n * Gets a plugin by name if it exists.\n *\n * @static\n * @method   getPlugin\n * @memberOf Plugin\n * @param    {string} name\n *           The name of a plugin.\n *\n * @returns  {Function|undefined}\n *           The plugin (or `undefined`).\n */\n\n\nPlugin.getPlugin = getPlugin;\n/**\n * The name of the base plugin class as it is registered.\n *\n * @type {string}\n */\n\nPlugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;\nPlugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\nPlayer.prototype.usingPlugin = function (name) {\n  return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;\n};\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\n\nPlayer.prototype.hasPlugin = function (name) {\n  return !!pluginExists(name);\n};\n/**\n * Signals that a plugin is about to be set up on a player.\n *\n * @event    Player#beforepluginsetup\n * @type     {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin is about to be set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event    Player#beforepluginsetup:$name\n * @type     {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player.\n *\n * @event    Player#pluginsetup\n * @type     {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event    Player#pluginsetup:$name\n * @type     {Plugin~PluginEventHash}\n */\n\n/**\n * @typedef  {Object} Plugin~PluginEventHash\n *\n * @property {string} instance\n *           For basic plugins, the return value of the plugin function. For\n *           advanced plugins, the plugin instance on which the event is fired.\n *\n * @property {string} name\n *           The name of the plugin.\n *\n * @property {string} plugin\n *           For basic plugins, the plugin function. For advanced plugins, the\n *           plugin class/constructor.\n */\n\n/**\n * @file extend.js\n * @module extend\n */\n/**\n * Used to subclass an existing class by emulating ES subclassing using the\n * `extends` keyword.\n *\n * @function\n * @example\n * var MyComponent = videojs.extend(videojs.getComponent('Component'), {\n *   myCustomMethod: function() {\n *     // Do things in my method.\n *   }\n * });\n *\n * @param    {Function} superClass\n *           The class to inherit from\n *\n * @param    {Object}   [subClassMethods={}]\n *           Methods of the new class\n *\n * @return   {Function}\n *           The new class with subClassMethods that inherited superClass.\n */\n\nvar extend = function extend(superClass, subClassMethods) {\n  if (subClassMethods === void 0) {\n    subClassMethods = {};\n  }\n\n  var subClass = function subClass() {\n    superClass.apply(this, arguments);\n  };\n\n  var methods = {};\n\n  if (typeof subClassMethods === 'object') {\n    if (subClassMethods.constructor !== Object.prototype.constructor) {\n      subClass = subClassMethods.constructor;\n    }\n\n    methods = subClassMethods;\n  } else if (typeof subClassMethods === 'function') {\n    subClass = subClassMethods;\n  }\n\n  _inherits(subClass, superClass); // this is needed for backward-compatibility and node compatibility.\n\n\n  if (superClass) {\n    subClass.super_ = superClass;\n  } // Extend subObj's prototype with functions and other properties from props\n\n\n  for (var name in methods) {\n    if (methods.hasOwnProperty(name)) {\n      subClass.prototype[name] = methods[name];\n    }\n  }\n\n  return subClass;\n};\n\n/**\n * @file video.js\n * @module videojs\n */\n/**\n * Normalize an `id` value by trimming off a leading `#`\n *\n * @private\n * @param   {string} id\n *          A string, maybe with a leading `#`.\n *\n * @return {string}\n *          The string, without any leading `#`.\n */\n\nvar normalizeId = function normalizeId(id) {\n  return id.indexOf('#') === 0 ? id.slice(1) : id;\n};\n/**\n * The `videojs()` function doubles as the main function for users to create a\n * {@link Player} instance as well as the main library namespace.\n *\n * It can also be used as a getter for a pre-existing {@link Player} instance.\n * However, we _strongly_ recommend using `videojs.getPlayer()` for this\n * purpose because it avoids any potential for unintended initialization.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### id\n * string|Element, **required**\n *\n * Video element or video element ID.\n *\n * ##### options\n * Object, optional\n *\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * ##### ready\n * {@link Component~ReadyCallback}, optional\n *\n * A function to be called when the {@link Player} and {@link Tech} are ready.\n *\n * #### Return Value\n *\n * The `videojs()` function returns a {@link Player} instance.\n *\n * @namespace\n *\n * @borrows AudioTrack as AudioTrack\n * @borrows Component.getComponent as getComponent\n * @borrows module:computed-style~computedStyle as computedStyle\n * @borrows module:events.on as on\n * @borrows module:events.one as one\n * @borrows module:events.off as off\n * @borrows module:events.trigger as trigger\n * @borrows EventTarget as EventTarget\n * @borrows module:extend~extend as extend\n * @borrows module:fn.bind as bind\n * @borrows module:format-time.formatTime as formatTime\n * @borrows module:format-time.resetFormatTime as resetFormatTime\n * @borrows module:format-time.setFormatTime as setFormatTime\n * @borrows module:merge-options.mergeOptions as mergeOptions\n * @borrows module:middleware.use as use\n * @borrows Player.players as players\n * @borrows Plugin.registerPlugin as registerPlugin\n * @borrows Plugin.deregisterPlugin as deregisterPlugin\n * @borrows Plugin.getPlugins as getPlugins\n * @borrows Plugin.getPlugin as getPlugin\n * @borrows Plugin.getPluginVersion as getPluginVersion\n * @borrows Tech.getTech as getTech\n * @borrows Tech.registerTech as registerTech\n * @borrows TextTrack as TextTrack\n * @borrows module:time-ranges.createTimeRanges as createTimeRange\n * @borrows module:time-ranges.createTimeRanges as createTimeRanges\n * @borrows module:url.isCrossOrigin as isCrossOrigin\n * @borrows module:url.parseUrl as parseUrl\n * @borrows VideoTrack as VideoTrack\n *\n * @param  {string|Element} id\n *         Video element or video element ID.\n *\n * @param  {Object} [options]\n *         Options object for providing settings.\n *         See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * @param  {Component~ReadyCallback} [ready]\n *         A function to be called when the {@link Player} and {@link Tech} are\n *         ready.\n *\n * @return {Player}\n *         The `videojs()` function returns a {@link Player|Player} instance.\n */\n\n\nfunction videojs(id, options, ready) {\n  var player = videojs.getPlayer(id);\n\n  if (player) {\n    if (options) {\n      log$1.warn(\"Player \\\"\" + id + \"\\\" is already initialised. Options will not be applied.\");\n    }\n\n    if (ready) {\n      player.ready(ready);\n    }\n\n    return player;\n  }\n\n  var el = typeof id === 'string' ? $('#' + normalizeId(id)) : id;\n\n  if (!isEl(el)) {\n    throw new TypeError('The element or ID supplied is not valid. (videojs)');\n  } // document.body.contains(el) will only check if el is contained within that one document.\n  // This causes problems for elements in iframes.\n  // Instead, use the element's ownerDocument instead of the global document.\n  // This will make sure that the element is indeed in the dom of that document.\n  // Additionally, check that the document in question has a default view.\n  // If the document is no longer attached to the dom, the defaultView of the document will be null.\n\n\n  if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {\n    log$1.warn('The element supplied is not included in the DOM');\n  }\n\n  options = options || {}; // Store a copy of the el before modification, if it is to be restored in destroy()\n  // If div ingest, store the parent div\n\n  if (options.restoreEl === true) {\n    options.restoreEl = (el.parentNode && el.parentNode.hasAttribute('data-vjs-player') ? el.parentNode : el).cloneNode(true);\n  }\n\n  hooks('beforesetup').forEach(function (hookFunction) {\n    var opts = hookFunction(el, mergeOptions$3(options));\n\n    if (!isObject(opts) || Array.isArray(opts)) {\n      log$1.error('please return an object in beforesetup hooks');\n      return;\n    }\n\n    options = mergeOptions$3(options, opts);\n  }); // We get the current \"Player\" component here in case an integration has\n  // replaced it with a custom player.\n\n  var PlayerComponent = Component$1.getComponent('Player');\n  player = new PlayerComponent(el, options, ready);\n  hooks('setup').forEach(function (hookFunction) {\n    return hookFunction(player);\n  });\n  return player;\n}\n\nvideojs.hooks_ = hooks_;\nvideojs.hooks = hooks;\nvideojs.hook = hook;\nvideojs.hookOnce = hookOnce;\nvideojs.removeHook = removeHook; // Add default styles\n\nif (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {\n  var style = $('.vjs-styles-defaults');\n\n  if (!style) {\n    style = createStyleElement('vjs-styles-defaults');\n    var head = $('head');\n\n    if (head) {\n      head.insertBefore(style, head.firstChild);\n    }\n\n    setTextContent(style, \"\\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    \");\n  }\n} // Run Auto-load players\n// You have to wait at least once in case this script is loaded after your\n// video in the DOM (weird behavior only with minified version)\n\n\nautoSetupTimeout(1, videojs);\n/**\n * Current Video.js version. Follows [semantic versioning](https://semver.org/).\n *\n * @type {string}\n */\n\nvideojs.VERSION = version$5;\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * @type {Object}\n */\n\nvideojs.options = Player.prototype.options_;\n/**\n * Get an object with the currently created players, keyed by player ID\n *\n * @return {Object}\n *         The created players\n */\n\nvideojs.getPlayers = function () {\n  return Player.players;\n};\n/**\n * Get a single player based on an ID or DOM element.\n *\n * This is useful if you want to check if an element or ID has an associated\n * Video.js player, but not create one if it doesn't.\n *\n * @param   {string|Element} id\n *          An HTML element - `<video>`, `<audio>`, or `<video-js>` -\n *          or a string matching the `id` of such an element.\n *\n * @return {Player|undefined}\n *          A player instance or `undefined` if there is no player instance\n *          matching the argument.\n */\n\n\nvideojs.getPlayer = function (id) {\n  var players = Player.players;\n  var tag;\n\n  if (typeof id === 'string') {\n    var nId = normalizeId(id);\n    var player = players[nId];\n\n    if (player) {\n      return player;\n    }\n\n    tag = $('#' + nId);\n  } else {\n    tag = id;\n  }\n\n  if (isEl(tag)) {\n    var _tag = tag,\n        _player = _tag.player,\n        playerId = _tag.playerId; // Element may have a `player` property referring to an already created\n    // player instance. If so, return that.\n\n    if (_player || players[playerId]) {\n      return _player || players[playerId];\n    }\n  }\n};\n/**\n * Returns an array of all current players.\n *\n * @return {Array}\n *         An array of all players. The array will be in the order that\n *         `Object.keys` provides, which could potentially vary between\n *         JavaScript engines.\n *\n */\n\n\nvideojs.getAllPlayers = function () {\n  return (// Disposed players leave a key with a `null` value, so we need to make sure\n    // we filter those out.\n    Object.keys(Player.players).map(function (k) {\n      return Player.players[k];\n    }).filter(Boolean)\n  );\n};\n\nvideojs.players = Player.players;\nvideojs.getComponent = Component$1.getComponent;\n/**\n * Register a component so it can referred to by name. Used when adding to other\n * components, either through addChild `component.addChild('myComponent')` or through\n * default children options  `{ children: ['myComponent'] }`.\n *\n * > NOTE: You could also just initialize the component before adding.\n * `component.addChild(new MyComponent());`\n *\n * @param {string} name\n *        The class name of the component\n *\n * @param {Component} comp\n *        The component class\n *\n * @return {Component}\n *         The newly registered component\n */\n\nvideojs.registerComponent = function (name, comp) {\n  if (Tech.isTech(comp)) {\n    log$1.warn(\"The \" + name + \" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)\");\n  }\n\n  Component$1.registerComponent.call(Component$1, name, comp);\n};\n\nvideojs.getTech = Tech.getTech;\nvideojs.registerTech = Tech.registerTech;\nvideojs.use = use;\n/**\n * An object that can be returned by a middleware to signify\n * that the middleware is being terminated.\n *\n * @type {object}\n * @property {object} middleware.TERMINATOR\n */\n\nObject.defineProperty(videojs, 'middleware', {\n  value: {},\n  writeable: false,\n  enumerable: true\n});\nObject.defineProperty(videojs.middleware, 'TERMINATOR', {\n  value: TERMINATOR,\n  writeable: false,\n  enumerable: true\n});\n/**\n * A reference to the {@link module:browser|browser utility module} as an object.\n *\n * @type {Object}\n * @see  {@link module:browser|browser}\n */\n\nvideojs.browser = browser;\n/**\n * Use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED} instead; only\n * included for backward-compatibility with 4.x.\n *\n * @deprecated Since version 5.0, use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED instead.\n * @type {boolean}\n */\n\nvideojs.TOUCH_ENABLED = TOUCH_ENABLED;\nvideojs.extend = extend;\nvideojs.mergeOptions = mergeOptions$3;\nvideojs.bind = bind;\nvideojs.registerPlugin = Plugin.registerPlugin;\nvideojs.deregisterPlugin = Plugin.deregisterPlugin;\n/**\n * Deprecated method to register a plugin with Video.js\n *\n * @deprecated videojs.plugin() is deprecated; use videojs.registerPlugin() instead\n *\n * @param {string} name\n *        The plugin name\n *\n * @param {Plugin|Function} plugin\n *         The plugin sub-class or function\n */\n\nvideojs.plugin = function (name, plugin) {\n  log$1.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');\n  return Plugin.registerPlugin(name, plugin);\n};\n\nvideojs.getPlugins = Plugin.getPlugins;\nvideojs.getPlugin = Plugin.getPlugin;\nvideojs.getPluginVersion = Plugin.getPluginVersion;\n/**\n * Adding languages so that they're available to all players.\n * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`\n *\n * @param {string} code\n *        The language code or dictionary property\n *\n * @param {Object} data\n *        The data values to be translated\n *\n * @return {Object}\n *         The resulting language dictionary object\n */\n\nvideojs.addLanguage = function (code, data) {\n  var _mergeOptions;\n\n  code = ('' + code).toLowerCase();\n  videojs.options.languages = mergeOptions$3(videojs.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));\n  return videojs.options.languages[code];\n};\n/**\n * A reference to the {@link module:log|log utility module} as an object.\n *\n * @type {Function}\n * @see  {@link module:log|log}\n */\n\n\nvideojs.log = log$1;\nvideojs.createLogger = createLogger;\nvideojs.createTimeRange = videojs.createTimeRanges = createTimeRanges;\nvideojs.formatTime = formatTime;\nvideojs.setFormatTime = setFormatTime;\nvideojs.resetFormatTime = resetFormatTime;\nvideojs.parseUrl = parseUrl;\nvideojs.isCrossOrigin = isCrossOrigin;\nvideojs.EventTarget = EventTarget$2;\nvideojs.on = on;\nvideojs.one = one;\nvideojs.off = off;\nvideojs.trigger = trigger;\n/**\n * A cross-browser XMLHttpRequest wrapper.\n *\n * @function\n * @param    {Object} options\n *           Settings for the request.\n *\n * @return   {XMLHttpRequest|XDomainRequest}\n *           The request object.\n *\n * @see      https://github.com/Raynos/xhr\n */\n\nvideojs.xhr = XHR;\nvideojs.TextTrack = TextTrack;\nvideojs.AudioTrack = AudioTrack;\nvideojs.VideoTrack = VideoTrack;\n['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(function (k) {\n  videojs[k] = function () {\n    log$1.warn(\"videojs.\" + k + \"() is deprecated; use videojs.dom.\" + k + \"() instead\");\n    return Dom[k].apply(null, arguments);\n  };\n});\nvideojs.computedStyle = computedStyle;\n/**\n * A reference to the {@link module:dom|DOM utility module} as an object.\n *\n * @type {Object}\n * @see  {@link module:dom|dom}\n */\n\nvideojs.dom = Dom;\n/**\n * A reference to the {@link module:url|URL utility module} as an object.\n *\n * @type {Object}\n * @see  {@link module:url|url}\n */\n\nvideojs.url = Url;\nvideojs.defineLazyProperty = defineLazyProperty; // Adding less ambiguous text for fullscreen button.\n// In a major update this could become the default text and key.\n\nvideojs.addLanguage('en', {\n  'Non-Fullscreen': 'Exit Fullscreen'\n});\n\n/*! @name @videojs/http-streaming @version 2.14.3 @license Apache-2.0 */\n/**\n * @file resolve-url.js - Handling how URLs are resolved and manipulated\n */\n\nvar resolveUrl = _resolveUrl;\n/**\n * Checks whether xhr request was redirected and returns correct url depending\n * on `handleManifestRedirects` option\n *\n * @api private\n *\n * @param  {string} url - an url being requested\n * @param  {XMLHttpRequest} req - xhr request result\n *\n * @return {string}\n */\n\nvar resolveManifestRedirect = function resolveManifestRedirect(handleManifestRedirect, url, req) {\n  // To understand how the responseURL below is set and generated:\n  // - https://fetch.spec.whatwg.org/#concept-response-url\n  // - https://fetch.spec.whatwg.org/#atomic-http-redirect-handling\n  if (handleManifestRedirect && req && req.responseURL && url !== req.responseURL) {\n    return req.responseURL;\n  }\n\n  return url;\n};\n\nvar logger = function logger(source) {\n  if (videojs.log.debug) {\n    return videojs.log.debug.bind(videojs, 'VHS:', source + \" >\");\n  }\n\n  return function () {};\n};\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n\n\nvar TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nvar SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\n\nvar filterRanges = function filterRanges(timeRanges, predicate) {\n  var results = [];\n  var i;\n\n  if (timeRanges && timeRanges.length) {\n    // Search for ranges that match the predicate\n    for (i = 0; i < timeRanges.length; i++) {\n      if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n        results.push([timeRanges.start(i), timeRanges.end(i)]);\n      }\n    }\n  }\n\n  return videojs.createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n *\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time  - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object\n */\n\n\nvar findRange = function findRange(buffered, time) {\n  return filterRanges(buffered, function (start, end) {\n    return start - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;\n  });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n *\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object.\n */\n\n\nvar findNextRange = function findNextRange(timeRanges, time) {\n  return filterRanges(timeRanges, function (start) {\n    return start - TIME_FUDGE_FACTOR >= time;\n  });\n};\n/**\n * Returns gaps within a list of TimeRanges\n *\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\n\nvar findGaps = function findGaps(buffered) {\n  if (buffered.length < 2) {\n    return videojs.createTimeRanges();\n  }\n\n  var ranges = [];\n\n  for (var i = 1; i < buffered.length; i++) {\n    var start = buffered.end(i - 1);\n    var end = buffered.start(i);\n    ranges.push([start, end]);\n  }\n\n  return videojs.createTimeRanges(ranges);\n};\n/**\n * Calculate the intersection of two TimeRanges\n *\n * @param {TimeRanges} bufferA\n * @param {TimeRanges} bufferB\n * @return {TimeRanges} The interesection of `bufferA` with `bufferB`\n */\n\n\nvar bufferIntersection = function bufferIntersection(bufferA, bufferB) {\n  var start = null;\n  var end = null;\n  var arity = 0;\n  var extents = [];\n  var ranges = [];\n\n  if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {\n    return videojs.createTimeRange();\n  } // Handle the case where we have both buffers and create an\n  // intersection of the two\n\n\n  var count = bufferA.length; // A) Gather up all start and end times\n\n  while (count--) {\n    extents.push({\n      time: bufferA.start(count),\n      type: 'start'\n    });\n    extents.push({\n      time: bufferA.end(count),\n      type: 'end'\n    });\n  }\n\n  count = bufferB.length;\n\n  while (count--) {\n    extents.push({\n      time: bufferB.start(count),\n      type: 'start'\n    });\n    extents.push({\n      time: bufferB.end(count),\n      type: 'end'\n    });\n  } // B) Sort them by time\n\n\n  extents.sort(function (a, b) {\n    return a.time - b.time;\n  }); // C) Go along one by one incrementing arity for start and decrementing\n  //    arity for ends\n\n  for (count = 0; count < extents.length; count++) {\n    if (extents[count].type === 'start') {\n      arity++; // D) If arity is ever incremented to 2 we are entering an\n      //    overlapping range\n\n      if (arity === 2) {\n        start = extents[count].time;\n      }\n    } else if (extents[count].type === 'end') {\n      arity--; // E) If arity is ever decremented to 1 we leaving an\n      //    overlapping range\n\n      if (arity === 1) {\n        end = extents[count].time;\n      }\n    } // F) Record overlapping ranges\n\n\n    if (start !== null && end !== null) {\n      ranges.push([start, end]);\n      start = null;\n      end = null;\n    }\n  }\n\n  return videojs.createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @return {string} a human readable string\n */\n\n\nvar printableRange = function printableRange(range) {\n  var strArr = [];\n\n  if (!range || !range.length) {\n    return '';\n  }\n\n  for (var i = 0; i < range.length; i++) {\n    strArr.push(range.start(i) + ' => ' + range.end(i));\n  }\n\n  return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n *        The state of the buffer\n * @param {Numnber} currentTime\n *        The current time of the player\n * @param {number} playbackRate\n *        The current playback rate of the player. Defaults to 1.\n * @return {number}\n *         Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\n\nvar timeUntilRebuffer = function timeUntilRebuffer(buffered, currentTime, playbackRate) {\n  if (playbackRate === void 0) {\n    playbackRate = 1;\n  }\n\n  var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n  return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n *\n * @param {TimeRanges} timeRanges\n * @return {Array}\n */\n\n\nvar timeRangesToArray = function timeRangesToArray(timeRanges) {\n  var timeRangesList = [];\n\n  for (var i = 0; i < timeRanges.length; i++) {\n    timeRangesList.push({\n      start: timeRanges.start(i),\n      end: timeRanges.end(i)\n    });\n  }\n\n  return timeRangesList;\n};\n/**\n * Determines if two time range objects are different.\n *\n * @param {TimeRange} a\n *        the first time range object to check\n *\n * @param {TimeRange} b\n *        the second time range object to check\n *\n * @return {Boolean}\n *         Whether the time range objects differ\n */\n\n\nvar isRangeDifferent = function isRangeDifferent(a, b) {\n  // same object\n  if (a === b) {\n    return false;\n  } // one or the other is undefined\n\n\n  if (!a && b || !b && a) {\n    return true;\n  } // length is different\n\n\n  if (a.length !== b.length) {\n    return true;\n  } // see if any start/end pair is different\n\n\n  for (var i = 0; i < a.length; i++) {\n    if (a.start(i) !== b.start(i) || a.end(i) !== b.end(i)) {\n      return true;\n    }\n  } // if the length and every pair is the same\n  // this is the same time range\n\n\n  return false;\n};\n\nvar lastBufferedEnd = function lastBufferedEnd(a) {\n  if (!a || !a.length || !a.end) {\n    return;\n  }\n\n  return a.end(a.length - 1);\n};\n/**\n * A utility function to add up the amount of time in a timeRange\n * after a specified startTime.\n * ie:[[0, 10], [20, 40], [50, 60]] with a startTime 0\n *     would return 40 as there are 40s seconds after 0 in the timeRange\n *\n * @param {TimeRange} range\n *        The range to check against\n * @param {number} startTime\n *        The time in the time range that you should start counting from\n *\n * @return {number}\n *          The number of seconds in the buffer passed the specified time.\n */\n\n\nvar timeAheadOf = function timeAheadOf(range, startTime) {\n  var time = 0;\n\n  if (!range || !range.length) {\n    return time;\n  }\n\n  for (var i = 0; i < range.length; i++) {\n    var start = range.start(i);\n    var end = range.end(i); // startTime is after this range entirely\n\n    if (startTime > end) {\n      continue;\n    } // startTime is within this range\n\n\n    if (startTime > start && startTime <= end) {\n      time += end - startTime;\n      continue;\n    } // startTime is before this range.\n\n\n    time += end - start;\n  }\n\n  return time;\n};\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n\n\nvar createTimeRange = videojs.createTimeRange;\n/**\n * Get the duration of a segment, with special cases for\n * llhls segments that do not have a duration yet.\n *\n * @param {Object} playlist\n *        the playlist that the segment belongs to.\n * @param {Object} segment\n *        the segment to get a duration for.\n *\n * @return {number}\n *          the segment duration\n */\n\nvar segmentDurationWithParts = function segmentDurationWithParts(playlist, segment) {\n  // if this isn't a preload segment\n  // then we will have a segment duration that is accurate.\n  if (!segment.preload) {\n    return segment.duration;\n  } // otherwise we have to add up parts and preload hints\n  // to get an up to date duration.\n\n\n  var result = 0;\n  (segment.parts || []).forEach(function (p) {\n    result += p.duration;\n  }); // for preload hints we have to use partTargetDuration\n  // as they won't even have a duration yet.\n\n  (segment.preloadHints || []).forEach(function (p) {\n    if (p.type === 'PART') {\n      result += playlist.partTargetDuration;\n    }\n  });\n  return result;\n};\n/**\n * A function to get a combined list of parts and segments with durations\n * and indexes.\n *\n * @param {Playlist} playlist the playlist to get the list for.\n *\n * @return {Array} The part/segment list.\n */\n\n\nvar getPartsAndSegments = function getPartsAndSegments(playlist) {\n  return (playlist.segments || []).reduce(function (acc, segment, si) {\n    if (segment.parts) {\n      segment.parts.forEach(function (part, pi) {\n        acc.push({\n          duration: part.duration,\n          segmentIndex: si,\n          partIndex: pi,\n          part: part,\n          segment: segment\n        });\n      });\n    } else {\n      acc.push({\n        duration: segment.duration,\n        segmentIndex: si,\n        partIndex: null,\n        segment: segment,\n        part: null\n      });\n    }\n\n    return acc;\n  }, []);\n};\n\nvar getLastParts = function getLastParts(media) {\n  var lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];\n  return lastSegment && lastSegment.parts || [];\n};\n\nvar getKnownPartCount = function getKnownPartCount(_ref) {\n  var preloadSegment = _ref.preloadSegment;\n\n  if (!preloadSegment) {\n    return;\n  }\n\n  var parts = preloadSegment.parts,\n      preloadHints = preloadSegment.preloadHints;\n  var partCount = (preloadHints || []).reduce(function (count, hint) {\n    return count + (hint.type === 'PART' ? 1 : 0);\n  }, 0);\n  partCount += parts && parts.length ? parts.length : 0;\n  return partCount;\n};\n/**\n * Get the number of seconds to delay from the end of a\n * live playlist.\n *\n * @param {Playlist} master the master playlist\n * @param {Playlist} media the media playlist\n * @return {number} the hold back in seconds.\n */\n\n\nvar liveEdgeDelay = function liveEdgeDelay(master, media) {\n  if (media.endList) {\n    return 0;\n  } // dash suggestedPresentationDelay trumps everything\n\n\n  if (master && master.suggestedPresentationDelay) {\n    return master.suggestedPresentationDelay;\n  }\n\n  var hasParts = getLastParts(media).length > 0; // look for \"part\" delays from ll-hls first\n\n  if (hasParts && media.serverControl && media.serverControl.partHoldBack) {\n    return media.serverControl.partHoldBack;\n  } else if (hasParts && media.partTargetDuration) {\n    return media.partTargetDuration * 3; // finally look for full segment delays\n  } else if (media.serverControl && media.serverControl.holdBack) {\n    return media.serverControl.holdBack;\n  } else if (media.targetDuration) {\n    return media.targetDuration * 3;\n  }\n\n  return 0;\n};\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar backwardDuration = function backwardDuration(playlist, endSequence) {\n  var result = 0;\n  var i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n  // the interval, use it\n\n  var segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n  // information that is earlier than endSequence\n\n  if (segment) {\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: segment.start,\n        precise: true\n      };\n    }\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: segment.end - segment.duration,\n        precise: true\n      };\n    }\n  }\n\n  while (i--) {\n    segment = playlist.segments[i];\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: result + segment.end,\n        precise: true\n      };\n    }\n\n    result += segmentDurationWithParts(playlist, segment);\n\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: result + segment.start,\n        precise: true\n      };\n    }\n  }\n\n  return {\n    result: result,\n    precise: false\n  };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar forwardDuration = function forwardDuration(playlist, endSequence) {\n  var result = 0;\n  var segment;\n  var i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n  // information\n\n  for (; i < playlist.segments.length; i++) {\n    segment = playlist.segments[i];\n\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: segment.start - result,\n        precise: true\n      };\n    }\n\n    result += segmentDurationWithParts(playlist, segment);\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: segment.end - result,\n        precise: true\n      };\n    }\n  } // indicate we didn't find a useful duration estimate\n\n\n  return {\n    result: -1,\n    precise: false\n  };\n};\n/**\n  * Calculate the media duration from the segments associated with a\n  * playlist. The duration of a subinterval of the available segments\n  * may be calculated by specifying an end index.\n  *\n  * @param {Object} playlist a media playlist object\n  * @param {number=} endSequence an exclusive upper boundary\n  * for the playlist.  Defaults to playlist length.\n  * @param {number} expired the amount of time that has dropped\n  * off the front of the playlist in a live scenario\n  * @return {number} the duration between the first available segment\n  * and end index.\n  */\n\n\nvar intervalDuration = function intervalDuration(playlist, endSequence, expired) {\n  if (typeof endSequence === 'undefined') {\n    endSequence = playlist.mediaSequence + playlist.segments.length;\n  }\n\n  if (endSequence < playlist.mediaSequence) {\n    return 0;\n  } // do a backward walk to estimate the duration\n\n\n  var backward = backwardDuration(playlist, endSequence);\n\n  if (backward.precise) {\n    // if we were able to base our duration estimate on timing\n    // information provided directly from the Media Source, return\n    // it\n    return backward.result;\n  } // walk forward to see if a precise duration estimate can be made\n  // that way\n\n\n  var forward = forwardDuration(playlist, endSequence);\n\n  if (forward.precise) {\n    // we found a segment that has been buffered and so it's\n    // position is known precisely\n    return forward.result;\n  } // return the less-precise, playlist-based duration estimate\n\n\n  return backward.result + expired;\n};\n/**\n  * Calculates the duration of a playlist. If a start and end index\n  * are specified, the duration will be for the subset of the media\n  * timeline between those two indices. The total duration for live\n  * playlists is always Infinity.\n  *\n  * @param {Object} playlist a media playlist object\n  * @param {number=} endSequence an exclusive upper\n  * boundary for the playlist. Defaults to the playlist media\n  * sequence number plus its length.\n  * @param {number=} expired the amount of time that has\n  * dropped off the front of the playlist in a live scenario\n  * @return {number} the duration between the start index and end\n  * index.\n  */\n\n\nvar duration = function duration(playlist, endSequence, expired) {\n  if (!playlist) {\n    return 0;\n  }\n\n  if (typeof expired !== 'number') {\n    expired = 0;\n  } // if a slice of the total duration is not requested, use\n  // playlist-level duration indicators when they're present\n\n\n  if (typeof endSequence === 'undefined') {\n    // if present, use the duration specified in the playlist\n    if (playlist.totalDuration) {\n      return playlist.totalDuration;\n    } // duration should be Infinity for live playlists\n\n\n    if (!playlist.endList) {\n      return window$1.Infinity;\n    }\n  } // calculate the total duration based on the segment durations\n\n\n  return intervalDuration(playlist, endSequence, expired);\n};\n/**\n  * Calculate the time between two indexes in the current playlist\n  * neight the start- nor the end-index need to be within the current\n  * playlist in which case, the targetDuration of the playlist is used\n  * to approximate the durations of the segments\n  *\n  * @param {Array} options.durationList list to iterate over for durations.\n  * @param {number} options.defaultDuration duration to use for elements before or after the durationList\n  * @param {number} options.startIndex partsAndSegments index to start\n  * @param {number} options.endIndex partsAndSegments index to end.\n  * @return {number} the number of seconds between startIndex and endIndex\n  */\n\n\nvar sumDurations = function sumDurations(_ref2) {\n  var defaultDuration = _ref2.defaultDuration,\n      durationList = _ref2.durationList,\n      startIndex = _ref2.startIndex,\n      endIndex = _ref2.endIndex;\n  var durations = 0;\n\n  if (startIndex > endIndex) {\n    var _ref3 = [endIndex, startIndex];\n    startIndex = _ref3[0];\n    endIndex = _ref3[1];\n  }\n\n  if (startIndex < 0) {\n    for (var i = startIndex; i < Math.min(0, endIndex); i++) {\n      durations += defaultDuration;\n    }\n\n    startIndex = 0;\n  }\n\n  for (var _i = startIndex; _i < endIndex; _i++) {\n    durations += durationList[_i].duration;\n  }\n\n  return durations;\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} expired the amount of time that has\n *                  dropped off the front of the playlist in a live scenario\n * @param {boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n *                        playlist end calculation should consider the safe live end\n *                        (truncate the playlist end by three segments). This is normally\n *                        used for calculating the end of the playlist's seekable range.\n *                        This takes into account the value of liveEdgePadding.\n *                        Setting liveEdgePadding to 0 is equivalent to setting this to false.\n * @param {number} liveEdgePadding a number indicating how far from the end of the playlist we should be in seconds.\n *                 If this is provided, it is used in the safe live end calculation.\n *                 Setting useSafeLiveEnd=false or liveEdgePadding=0 are equivalent.\n *                 Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {number} the end time of playlist\n * @function playlistEnd\n */\n\n\nvar playlistEnd = function playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding) {\n  if (!playlist || !playlist.segments) {\n    return null;\n  }\n\n  if (playlist.endList) {\n    return duration(playlist);\n  }\n\n  if (expired === null) {\n    return null;\n  }\n\n  expired = expired || 0;\n  var lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);\n\n  if (useSafeLiveEnd) {\n    liveEdgePadding = typeof liveEdgePadding === 'number' ? liveEdgePadding : liveEdgeDelay(null, playlist);\n    lastSegmentEndTime -= liveEdgePadding;\n  } // don't return a time less than zero\n\n\n  return Math.max(0, lastSegmentEndTime);\n};\n/**\n  * Calculates the interval of time that is currently seekable in a\n  * playlist. The returned time ranges are relative to the earliest\n  * moment in the specified playlist that is still available. A full\n  * seekable implementation for live streams would need to offset\n  * these values by the duration of content that has expired from the\n  * stream.\n  *\n  * @param {Object} playlist a media playlist object\n  * dropped off the front of the playlist in a live scenario\n  * @param {number=} expired the amount of time that has\n  * dropped off the front of the playlist in a live scenario\n  * @param {number} liveEdgePadding how far from the end of the playlist we should be in seconds.\n  *        Corresponds to suggestedPresentationDelay in DASH manifests.\n  * @return {TimeRanges} the periods of time that are valid targets\n  * for seeking\n  */\n\n\nvar seekable = function seekable(playlist, expired, liveEdgePadding) {\n  var useSafeLiveEnd = true;\n  var seekableStart = expired || 0;\n  var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);\n\n  if (seekableEnd === null) {\n    return createTimeRange();\n  }\n\n  return createTimeRange(seekableStart, seekableEnd);\n};\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} options.playlist the media playlist to query\n * @param {number} options.currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {number} options.startTime the time when the segment/part starts\n * @param {number} options.startingSegmentIndex the segment index to start looking at.\n * @param {number?} [options.startingPartIndex] the part index to look at within the segment.\n *\n * @return {Object} an object with partIndex, segmentIndex, and startTime.\n */\n\n\nvar getMediaInfoForTime = function getMediaInfoForTime(_ref4) {\n  var playlist = _ref4.playlist,\n      currentTime = _ref4.currentTime,\n      startingSegmentIndex = _ref4.startingSegmentIndex,\n      startingPartIndex = _ref4.startingPartIndex,\n      startTime = _ref4.startTime,\n      experimentalExactManifestTimings = _ref4.experimentalExactManifestTimings;\n  var time = currentTime - startTime;\n  var partsAndSegments = getPartsAndSegments(playlist);\n  var startIndex = 0;\n\n  for (var i = 0; i < partsAndSegments.length; i++) {\n    var partAndSegment = partsAndSegments[i];\n\n    if (startingSegmentIndex !== partAndSegment.segmentIndex) {\n      continue;\n    } // skip this if part index does not match.\n\n\n    if (typeof startingPartIndex === 'number' && typeof partAndSegment.partIndex === 'number' && startingPartIndex !== partAndSegment.partIndex) {\n      continue;\n    }\n\n    startIndex = i;\n    break;\n  }\n\n  if (time < 0) {\n    // Walk backward from startIndex in the playlist, adding durations\n    // until we find a segment that contains `time` and return it\n    if (startIndex > 0) {\n      for (var _i2 = startIndex - 1; _i2 >= 0; _i2--) {\n        var _partAndSegment = partsAndSegments[_i2];\n        time += _partAndSegment.duration;\n\n        if (experimentalExactManifestTimings) {\n          if (time < 0) {\n            continue;\n          }\n        } else if (time + TIME_FUDGE_FACTOR <= 0) {\n          continue;\n        }\n\n        return {\n          partIndex: _partAndSegment.partIndex,\n          segmentIndex: _partAndSegment.segmentIndex,\n          startTime: startTime - sumDurations({\n            defaultDuration: playlist.targetDuration,\n            durationList: partsAndSegments,\n            startIndex: startIndex,\n            endIndex: _i2\n          })\n        };\n      }\n    } // We were unable to find a good segment within the playlist\n    // so select the first segment\n\n\n    return {\n      partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n      segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n      startTime: currentTime\n    };\n  } // When startIndex is negative, we first walk forward to first segment\n  // adding target durations. If we \"run out of time\" before getting to\n  // the first segment, return the first segment\n\n\n  if (startIndex < 0) {\n    for (var _i3 = startIndex; _i3 < 0; _i3++) {\n      time -= playlist.targetDuration;\n\n      if (time < 0) {\n        return {\n          partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n          segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n          startTime: currentTime\n        };\n      }\n    }\n\n    startIndex = 0;\n  } // Walk forward from startIndex in the playlist, subtracting durations\n  // until we find a segment that contains `time` and return it\n\n\n  for (var _i4 = startIndex; _i4 < partsAndSegments.length; _i4++) {\n    var _partAndSegment2 = partsAndSegments[_i4];\n    time -= _partAndSegment2.duration;\n\n    if (experimentalExactManifestTimings) {\n      if (time > 0) {\n        continue;\n      }\n    } else if (time - TIME_FUDGE_FACTOR >= 0) {\n      continue;\n    }\n\n    return {\n      partIndex: _partAndSegment2.partIndex,\n      segmentIndex: _partAndSegment2.segmentIndex,\n      startTime: startTime + sumDurations({\n        defaultDuration: playlist.targetDuration,\n        durationList: partsAndSegments,\n        startIndex: startIndex,\n        endIndex: _i4\n      })\n    };\n  } // We are out of possible candidates so load the last one...\n\n\n  return {\n    segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,\n    partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,\n    startTime: currentTime\n  };\n};\n/**\n * Check whether the playlist is blacklisted or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is blacklisted or not\n * @function isBlacklisted\n */\n\n\nvar isBlacklisted = function isBlacklisted(playlist) {\n  return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been blacklisted permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\n\nvar isIncompatible = function isIncompatible(playlist) {\n  return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\n\nvar isEnabled = function isEnabled(playlist) {\n  var blacklisted = isBlacklisted(playlist);\n  return !playlist.disabled && !blacklisted;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\n\nvar isDisabled = function isDisabled(playlist) {\n  return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {boolean} true if it's an AES encrypted HLS stream\n */\n\n\nvar isAes = function isAes(media) {\n  for (var i = 0; i < media.segments.length; i++) {\n    if (media.segments[i].key) {\n      return true;\n    }\n  }\n\n  return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {string} attr\n *        Attribute to check for\n * @param {Object} playlist\n *        The media playlist object\n * @return {boolean}\n *         Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\n\nvar hasAttribute = function hasAttribute(attr, playlist) {\n  return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {number} segmentDuration\n *        Duration of requested segment\n * @param {number} bandwidth\n *        Current measured bandwidth of the player\n * @param {Object} playlist\n *        The media playlist object\n * @param {number=} bytesReceived\n *        Number of bytes already received for the request. Defaults to 0\n * @return {number|NaN}\n *         The estimated time to request the segment. NaN if bandwidth information for\n *         the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\n\nvar estimateSegmentRequestTime = function estimateSegmentRequestTime(segmentDuration, bandwidth, playlist, bytesReceived) {\n  if (bytesReceived === void 0) {\n    bytesReceived = 0;\n  }\n\n  if (!hasAttribute('BANDWIDTH', playlist)) {\n    return NaN;\n  }\n\n  var size = segmentDuration * playlist.attributes.BANDWIDTH;\n  return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\n\nvar isLowestEnabledRendition = function isLowestEnabledRendition(master, media) {\n  if (master.playlists.length === 1) {\n    return true;\n  }\n\n  var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n  return master.playlists.filter(function (playlist) {\n    if (!isEnabled(playlist)) {\n      return false;\n    }\n\n    return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n  }).length === 0;\n};\n\nvar playlistMatch = function playlistMatch(a, b) {\n  // both playlits are null\n  // or only one playlist is non-null\n  // no match\n  if (!a && !b || !a && b || a && !b) {\n    return false;\n  } // playlist objects are the same, match\n\n\n  if (a === b) {\n    return true;\n  } // first try to use id as it should be the most\n  // accurate\n\n\n  if (a.id && b.id && a.id === b.id) {\n    return true;\n  } // next try to use reslovedUri as it should be the\n  // second most accurate.\n\n\n  if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {\n    return true;\n  } // finally try to use uri as it should be accurate\n  // but might miss a few cases for relative uris\n\n\n  if (a.uri && b.uri && a.uri === b.uri) {\n    return true;\n  }\n\n  return false;\n};\n\nvar someAudioVariant = function someAudioVariant(master, callback) {\n  var AUDIO = master && master.mediaGroups && master.mediaGroups.AUDIO || {};\n  var found = false;\n\n  for (var groupName in AUDIO) {\n    for (var label in AUDIO[groupName]) {\n      found = callback(AUDIO[groupName][label]);\n\n      if (found) {\n        break;\n      }\n    }\n\n    if (found) {\n      break;\n    }\n  }\n\n  return !!found;\n};\n\nvar isAudioOnly = function isAudioOnly(master) {\n  // we are audio only if we have no main playlists but do\n  // have media group playlists.\n  if (!master || !master.playlists || !master.playlists.length) {\n    // without audio variants or playlists this\n    // is not an audio only master.\n    var found = someAudioVariant(master, function (variant) {\n      return variant.playlists && variant.playlists.length || variant.uri;\n    });\n    return found;\n  } // if every playlist has only an audio codec it is audio only\n\n\n  var _loop = function _loop(i) {\n    var playlist = master.playlists[i];\n    var CODECS = playlist.attributes && playlist.attributes.CODECS; // all codecs are audio, this is an audio playlist.\n\n    if (CODECS && CODECS.split(',').every(function (c) {\n      return isAudioCodec(c);\n    })) {\n      return \"continue\";\n    } // playlist is in an audio group it is audio only\n\n\n    var found = someAudioVariant(master, function (variant) {\n      return playlistMatch(playlist, variant);\n    });\n\n    if (found) {\n      return \"continue\";\n    } // if we make it here this playlist isn't audio and we\n    // are not audio only\n\n\n    return {\n      v: false\n    };\n  };\n\n  for (var i = 0; i < master.playlists.length; i++) {\n    var _ret = _loop(i);\n\n    if (_ret === \"continue\") continue;\n    if (typeof _ret === \"object\") return _ret.v;\n  } // if we make it past every playlist without returning, then\n  // this is an audio only playlist.\n\n\n  return true;\n}; // exports\n\n\nvar Playlist = {\n  liveEdgeDelay: liveEdgeDelay,\n  duration: duration,\n  seekable: seekable,\n  getMediaInfoForTime: getMediaInfoForTime,\n  isEnabled: isEnabled,\n  isDisabled: isDisabled,\n  isBlacklisted: isBlacklisted,\n  isIncompatible: isIncompatible,\n  playlistEnd: playlistEnd,\n  isAes: isAes,\n  hasAttribute: hasAttribute,\n  estimateSegmentRequestTime: estimateSegmentRequestTime,\n  isLowestEnabledRendition: isLowestEnabledRendition,\n  isAudioOnly: isAudioOnly,\n  playlistMatch: playlistMatch,\n  segmentDurationWithParts: segmentDurationWithParts\n};\nvar log = videojs.log;\n\nvar createPlaylistID = function createPlaylistID(index, uri) {\n  return index + \"-\" + uri;\n};\n/**\n * Parses a given m3u8 playlist\n *\n * @param {Function} [onwarn]\n *        a function to call when the parser triggers a warning event.\n * @param {Function} [oninfo]\n *        a function to call when the parser triggers an info event.\n * @param {string} manifestString\n *        The downloaded manifest string\n * @param {Object[]} [customTagParsers]\n *        An array of custom tag parsers for the m3u8-parser instance\n * @param {Object[]} [customTagMappers]\n *        An array of custom tag mappers for the m3u8-parser instance\n * @param {boolean} [experimentalLLHLS=false]\n *        Whether to keep ll-hls features in the manifest after parsing.\n * @return {Object}\n *         The manifest object\n */\n\n\nvar parseManifest = function parseManifest(_ref) {\n  var onwarn = _ref.onwarn,\n      oninfo = _ref.oninfo,\n      manifestString = _ref.manifestString,\n      _ref$customTagParsers = _ref.customTagParsers,\n      customTagParsers = _ref$customTagParsers === void 0 ? [] : _ref$customTagParsers,\n      _ref$customTagMappers = _ref.customTagMappers,\n      customTagMappers = _ref$customTagMappers === void 0 ? [] : _ref$customTagMappers,\n      experimentalLLHLS = _ref.experimentalLLHLS;\n  var parser = new Parser();\n\n  if (onwarn) {\n    parser.on('warn', onwarn);\n  }\n\n  if (oninfo) {\n    parser.on('info', oninfo);\n  }\n\n  customTagParsers.forEach(function (customParser) {\n    return parser.addParser(customParser);\n  });\n  customTagMappers.forEach(function (mapper) {\n    return parser.addTagMapper(mapper);\n  });\n  parser.push(manifestString);\n  parser.end();\n  var manifest = parser.manifest; // remove llhls features from the parsed manifest\n  // if we don't want llhls support.\n\n  if (!experimentalLLHLS) {\n    ['preloadSegment', 'skip', 'serverControl', 'renditionReports', 'partInf', 'partTargetDuration'].forEach(function (k) {\n      if (manifest.hasOwnProperty(k)) {\n        delete manifest[k];\n      }\n    });\n\n    if (manifest.segments) {\n      manifest.segments.forEach(function (segment) {\n        ['parts', 'preloadHints'].forEach(function (k) {\n          if (segment.hasOwnProperty(k)) {\n            delete segment[k];\n          }\n        });\n      });\n    }\n  }\n\n  if (!manifest.targetDuration) {\n    var targetDuration = 10;\n\n    if (manifest.segments && manifest.segments.length) {\n      targetDuration = manifest.segments.reduce(function (acc, s) {\n        return Math.max(acc, s.duration);\n      }, 0);\n    }\n\n    if (onwarn) {\n      onwarn(\"manifest has no targetDuration defaulting to \" + targetDuration);\n    }\n\n    manifest.targetDuration = targetDuration;\n  }\n\n  var parts = getLastParts(manifest);\n\n  if (parts.length && !manifest.partTargetDuration) {\n    var partTargetDuration = parts.reduce(function (acc, p) {\n      return Math.max(acc, p.duration);\n    }, 0);\n\n    if (onwarn) {\n      onwarn(\"manifest has no partTargetDuration defaulting to \" + partTargetDuration);\n      log.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.');\n    }\n\n    manifest.partTargetDuration = partTargetDuration;\n  }\n\n  return manifest;\n};\n/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n *        The parsed master manifest object\n * @param {Function} callback\n *        Callback to call for each media group\n */\n\n\nvar forEachMediaGroup = function forEachMediaGroup(master, callback) {\n  if (!master.mediaGroups) {\n    return;\n  }\n\n  ['AUDIO', 'SUBTITLES'].forEach(function (mediaType) {\n    if (!master.mediaGroups[mediaType]) {\n      return;\n    }\n\n    for (var groupKey in master.mediaGroups[mediaType]) {\n      for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n        var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n        callback(mediaProperties, mediaType, groupKey, labelKey);\n      }\n    }\n  });\n};\n/**\n * Adds properties and attributes to the playlist to keep consistent functionality for\n * playlists throughout VHS.\n *\n * @param {Object} config\n *        Arguments object\n * @param {Object} config.playlist\n *        The media playlist\n * @param {string} [config.uri]\n *        The uri to the media playlist (if media playlist is not from within a master\n *        playlist)\n * @param {string} id\n *        ID to use for the playlist\n */\n\n\nvar setupMediaPlaylist = function setupMediaPlaylist(_ref2) {\n  var playlist = _ref2.playlist,\n      uri = _ref2.uri,\n      id = _ref2.id;\n  playlist.id = id;\n  playlist.playlistErrors_ = 0;\n\n  if (uri) {\n    // For media playlists, m3u8-parser does not have access to a URI, as HLS media\n    // playlists do not contain their own source URI, but one is needed for consistency in\n    // VHS.\n    playlist.uri = uri;\n  } // For HLS master playlists, even though certain attributes MUST be defined, the\n  // stream may still be played without them.\n  // For HLS media playlists, m3u8-parser does not attach an attributes object to the\n  // manifest.\n  //\n  // To avoid undefined reference errors through the project, and make the code easier\n  // to write/read, add an empty attributes object for these cases.\n\n\n  playlist.attributes = playlist.attributes || {};\n};\n/**\n * Adds ID, resolvedUri, and attributes properties to each playlist of the master, where\n * necessary. In addition, creates playlist IDs for each playlist and adds playlist ID to\n * playlist references to the playlists array.\n *\n * @param {Object} master\n *        The master playlist\n */\n\n\nvar setupMediaPlaylists = function setupMediaPlaylists(master) {\n  var i = master.playlists.length;\n\n  while (i--) {\n    var playlist = master.playlists[i];\n    setupMediaPlaylist({\n      playlist: playlist,\n      id: createPlaylistID(i, playlist.uri)\n    });\n    playlist.resolvedUri = resolveUrl(master.uri, playlist.uri);\n    master.playlists[playlist.id] = playlist; // URI reference added for backwards compatibility\n\n    master.playlists[playlist.uri] = playlist; // Although the spec states an #EXT-X-STREAM-INF tag MUST have a BANDWIDTH attribute,\n    // the stream can be played without it. Although an attributes property may have been\n    // added to the playlist to prevent undefined references, issue a warning to fix the\n    // manifest.\n\n    if (!playlist.attributes.BANDWIDTH) {\n      log.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n    }\n  }\n};\n/**\n * Adds resolvedUri properties to each media group.\n *\n * @param {Object} master\n *        The master playlist\n */\n\n\nvar resolveMediaGroupUris = function resolveMediaGroupUris(master) {\n  forEachMediaGroup(master, function (properties) {\n    if (properties.uri) {\n      properties.resolvedUri = resolveUrl(master.uri, properties.uri);\n    }\n  });\n};\n/**\n * Creates a master playlist wrapper to insert a sole media playlist into.\n *\n * @param {Object} media\n *        Media playlist\n * @param {string} uri\n *        The media URI\n *\n * @return {Object}\n *         Master playlist\n */\n\n\nvar masterForMedia = function masterForMedia(media, uri) {\n  var id = createPlaylistID(0, uri);\n  var master = {\n    mediaGroups: {\n      'AUDIO': {},\n      'VIDEO': {},\n      'CLOSED-CAPTIONS': {},\n      'SUBTITLES': {}\n    },\n    uri: window$1.location.href,\n    resolvedUri: window$1.location.href,\n    playlists: [{\n      uri: uri,\n      id: id,\n      resolvedUri: uri,\n      // m3u8-parser does not attach an attributes property to media playlists so make\n      // sure that the property is attached to avoid undefined reference errors\n      attributes: {}\n    }]\n  }; // set up ID reference\n\n  master.playlists[id] = master.playlists[0]; // URI reference added for backwards compatibility\n\n  master.playlists[uri] = master.playlists[0];\n  return master;\n};\n/**\n * Does an in-place update of the master manifest to add updated playlist URI references\n * as well as other properties needed by VHS that aren't included by the parser.\n *\n * @param {Object} master\n *        Master manifest object\n * @param {string} uri\n *        The source URI\n */\n\n\nvar addPropertiesToMaster = function addPropertiesToMaster(master, uri) {\n  master.uri = uri;\n\n  for (var i = 0; i < master.playlists.length; i++) {\n    if (!master.playlists[i].uri) {\n      // Set up phony URIs for the playlists since playlists are referenced by their URIs\n      // throughout VHS, but some formats (e.g., DASH) don't have external URIs\n      // TODO: consider adding dummy URIs in mpd-parser\n      var phonyUri = \"placeholder-uri-\" + i;\n      master.playlists[i].uri = phonyUri;\n    }\n  }\n\n  var audioOnlyMaster = isAudioOnly(master);\n  forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n    var groupId = \"placeholder-uri-\" + mediaType + \"-\" + groupKey + \"-\" + labelKey; // add a playlist array under properties\n\n    if (!properties.playlists || !properties.playlists.length) {\n      // If the manifest is audio only and this media group does not have a uri, check\n      // if the media group is located in the main list of playlists. If it is, don't add\n      // placeholder properties as it shouldn't be considered an alternate audio track.\n      if (audioOnlyMaster && mediaType === 'AUDIO' && !properties.uri) {\n        for (var _i = 0; _i < master.playlists.length; _i++) {\n          var p = master.playlists[_i];\n\n          if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {\n            return;\n          }\n        }\n      }\n\n      properties.playlists = [_extends({}, properties)];\n    }\n\n    properties.playlists.forEach(function (p, i) {\n      var id = createPlaylistID(i, groupId);\n\n      if (p.uri) {\n        p.resolvedUri = p.resolvedUri || resolveUrl(master.uri, p.uri);\n      } else {\n        // DEPRECATED, this has been added to prevent a breaking change.\n        // previously we only ever had a single media group playlist, so\n        // we mark the first playlist uri without prepending the index as we used to\n        // ideally we would do all of the playlists the same way.\n        p.uri = i === 0 ? groupId : id; // don't resolve a placeholder uri to an absolute url, just use\n        // the placeholder again\n\n        p.resolvedUri = p.uri;\n      }\n\n      p.id = p.id || id; // add an empty attributes object, all playlists are\n      // expected to have this.\n\n      p.attributes = p.attributes || {}; // setup ID and URI references (URI for backwards compatibility)\n\n      master.playlists[p.id] = p;\n      master.playlists[p.uri] = p;\n    });\n  });\n  setupMediaPlaylists(master);\n  resolveMediaGroupUris(master);\n};\n\nvar mergeOptions$2 = videojs.mergeOptions,\n    EventTarget$1 = videojs.EventTarget;\n\nvar addLLHLSQueryDirectives = function addLLHLSQueryDirectives(uri, media) {\n  if (media.endList || !media.serverControl) {\n    return uri;\n  }\n\n  var parameters = {};\n\n  if (media.serverControl.canBlockReload) {\n    var preloadSegment = media.preloadSegment; // next msn is a zero based value, length is not.\n\n    var nextMSN = media.mediaSequence + media.segments.length; // If preload segment has parts then it is likely\n    // that we are going to request a part of that preload segment.\n    // the logic below is used to determine that.\n\n    if (preloadSegment) {\n      var parts = preloadSegment.parts || []; // _HLS_part is a zero based index\n\n      var nextPart = getKnownPartCount(media) - 1; // if nextPart is > -1 and not equal to just the\n      // length of parts, then we know we had part preload hints\n      // and we need to add the _HLS_part= query\n\n      if (nextPart > -1 && nextPart !== parts.length - 1) {\n        // add existing parts to our preload hints\n        // eslint-disable-next-line\n        parameters._HLS_part = nextPart;\n      } // this if statement makes sure that we request the msn\n      // of the preload segment if:\n      // 1. the preload segment had parts (and was not yet a full segment)\n      //    but was added to our segments array\n      // 2. the preload segment had preload hints for parts that are not in\n      //    the manifest yet.\n      // in all other cases we want the segment after the preload segment\n      // which will be given by using media.segments.length because it is 1 based\n      // rather than 0 based.\n\n\n      if (nextPart > -1 || parts.length) {\n        nextMSN--;\n      }\n    } // add _HLS_msn= in front of any _HLS_part query\n    // eslint-disable-next-line\n\n\n    parameters._HLS_msn = nextMSN;\n  }\n\n  if (media.serverControl && media.serverControl.canSkipUntil) {\n    // add _HLS_skip= infront of all other queries.\n    // eslint-disable-next-line\n    parameters._HLS_skip = media.serverControl.canSkipDateranges ? 'v2' : 'YES';\n  }\n\n  if (Object.keys(parameters).length) {\n    var parsedUri = new window$1.URL(uri);\n    ['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function (name) {\n      if (!parameters.hasOwnProperty(name)) {\n        return;\n      }\n\n      parsedUri.searchParams.set(name, parameters[name]);\n    });\n    uri = parsedUri.toString();\n  }\n\n  return uri;\n};\n/**\n * Returns a new segment object with properties and\n * the parts array merged.\n *\n * @param {Object} a the old segment\n * @param {Object} b the new segment\n *\n * @return {Object} the merged segment\n */\n\n\nvar updateSegment = function updateSegment(a, b) {\n  if (!a) {\n    return b;\n  }\n\n  var result = mergeOptions$2(a, b); // if only the old segment has preload hints\n  // and the new one does not, remove preload hints.\n\n  if (a.preloadHints && !b.preloadHints) {\n    delete result.preloadHints;\n  } // if only the old segment has parts\n  // then the parts are no longer valid\n\n\n  if (a.parts && !b.parts) {\n    delete result.parts; // if both segments have parts\n    // copy part propeties from the old segment\n    // to the new one.\n  } else if (a.parts && b.parts) {\n    for (var i = 0; i < b.parts.length; i++) {\n      if (a.parts && a.parts[i]) {\n        result.parts[i] = mergeOptions$2(a.parts[i], b.parts[i]);\n      }\n    }\n  } // set skipped to false for segments that have\n  // have had information merged from the old segment.\n\n\n  if (!a.skipped && b.skipped) {\n    result.skipped = false;\n  } // set preload to false for segments that have\n  // had information added in the new segment.\n\n\n  if (a.preload && !b.preload) {\n    result.preload = false;\n  }\n\n  return result;\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be ovewritten.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return {Array} a list of merged segment objects\n */\n\n\nvar updateSegments = function updateSegments(original, update, offset) {\n  var oldSegments = original.slice();\n  var newSegments = update.slice();\n  offset = offset || 0;\n  var result = [];\n  var currentMap;\n\n  for (var newIndex = 0; newIndex < newSegments.length; newIndex++) {\n    var oldSegment = oldSegments[newIndex + offset];\n    var newSegment = newSegments[newIndex];\n\n    if (oldSegment) {\n      currentMap = oldSegment.map || currentMap;\n      result.push(updateSegment(oldSegment, newSegment));\n    } else {\n      // carry over map to new segment if it is missing\n      if (currentMap && !newSegment.map) {\n        newSegment.map = currentMap;\n      }\n\n      result.push(newSegment);\n    }\n  }\n\n  return result;\n};\n\nvar resolveSegmentUris = function resolveSegmentUris(segment, baseUri) {\n  // preloadSegment will not have a uri at all\n  // as the segment isn't actually in the manifest yet, only parts\n  if (!segment.resolvedUri && segment.uri) {\n    segment.resolvedUri = resolveUrl(baseUri, segment.uri);\n  }\n\n  if (segment.key && !segment.key.resolvedUri) {\n    segment.key.resolvedUri = resolveUrl(baseUri, segment.key.uri);\n  }\n\n  if (segment.map && !segment.map.resolvedUri) {\n    segment.map.resolvedUri = resolveUrl(baseUri, segment.map.uri);\n  }\n\n  if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {\n    segment.map.key.resolvedUri = resolveUrl(baseUri, segment.map.key.uri);\n  }\n\n  if (segment.parts && segment.parts.length) {\n    segment.parts.forEach(function (p) {\n      if (p.resolvedUri) {\n        return;\n      }\n\n      p.resolvedUri = resolveUrl(baseUri, p.uri);\n    });\n  }\n\n  if (segment.preloadHints && segment.preloadHints.length) {\n    segment.preloadHints.forEach(function (p) {\n      if (p.resolvedUri) {\n        return;\n      }\n\n      p.resolvedUri = resolveUrl(baseUri, p.uri);\n    });\n  }\n};\n\nvar getAllSegments = function getAllSegments(media) {\n  var segments = media.segments || [];\n  var preloadSegment = media.preloadSegment; // a preloadSegment with only preloadHints is not currently\n  // a usable segment, only include a preloadSegment that has\n  // parts.\n\n  if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {\n    // if preloadHints has a MAP that means that the\n    // init segment is going to change. We cannot use any of the parts\n    // from this preload segment.\n    if (preloadSegment.preloadHints) {\n      for (var i = 0; i < preloadSegment.preloadHints.length; i++) {\n        if (preloadSegment.preloadHints[i].type === 'MAP') {\n          return segments;\n        }\n      }\n    } // set the duration for our preload segment to target duration.\n\n\n    preloadSegment.duration = media.targetDuration;\n    preloadSegment.preload = true;\n    segments.push(preloadSegment);\n  }\n\n  return segments;\n}; // consider the playlist unchanged if the playlist object is the same or\n// the number of segments is equal, the media sequence number is unchanged,\n// and this playlist hasn't become the end of the playlist\n\n\nvar isPlaylistUnchanged = function isPlaylistUnchanged(a, b) {\n  return a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;\n};\n/**\n  * Returns a new master playlist that is the result of merging an\n  * updated media playlist into the original version. If the\n  * updated media playlist does not match any of the playlist\n  * entries in the original master playlist, null is returned.\n  *\n  * @param {Object} master a parsed master M3U8 object\n  * @param {Object} media a parsed media M3U8 object\n  * @return {Object} a new object that represents the original\n  * master playlist with the updated media playlist merged in, or\n  * null if the merge produced no change.\n  */\n\n\nvar updateMaster$1 = function updateMaster(master, newMedia, unchangedCheck) {\n  if (unchangedCheck === void 0) {\n    unchangedCheck = isPlaylistUnchanged;\n  }\n\n  var result = mergeOptions$2(master, {});\n  var oldMedia = result.playlists[newMedia.id];\n\n  if (!oldMedia) {\n    return null;\n  }\n\n  if (unchangedCheck(oldMedia, newMedia)) {\n    return null;\n  }\n\n  newMedia.segments = getAllSegments(newMedia);\n  var mergedPlaylist = mergeOptions$2(oldMedia, newMedia); // always use the new media's preload segment\n\n  if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {\n    delete mergedPlaylist.preloadSegment;\n  } // if the update could overlap existing segment information, merge the two segment lists\n\n\n  if (oldMedia.segments) {\n    if (newMedia.skip) {\n      newMedia.segments = newMedia.segments || []; // add back in objects for skipped segments, so that we merge\n      // old properties into the new segments\n\n      for (var i = 0; i < newMedia.skip.skippedSegments; i++) {\n        newMedia.segments.unshift({\n          skipped: true\n        });\n      }\n    }\n\n    mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);\n  } // resolve any segment URIs to prevent us from having to do it later\n\n\n  mergedPlaylist.segments.forEach(function (segment) {\n    resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n  }); // TODO Right now in the playlists array there are two references to each playlist, one\n  // that is referenced by index, and one by URI. The index reference may no longer be\n  // necessary.\n\n  for (var _i = 0; _i < result.playlists.length; _i++) {\n    if (result.playlists[_i].id === newMedia.id) {\n      result.playlists[_i] = mergedPlaylist;\n    }\n  }\n\n  result.playlists[newMedia.id] = mergedPlaylist; // URI reference added for backwards compatibility\n\n  result.playlists[newMedia.uri] = mergedPlaylist; // update media group playlist references.\n\n  forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n    if (!properties.playlists) {\n      return;\n    }\n\n    for (var _i2 = 0; _i2 < properties.playlists.length; _i2++) {\n      if (newMedia.id === properties.playlists[_i2].id) {\n        properties.playlists[_i2] = mergedPlaylist;\n      }\n    }\n  });\n  return result;\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n *        The current media\n * @param {boolean} update\n *        True if there were any updates from the last refresh, false otherwise\n * @return {number}\n *         The time in ms to wait before refreshing the live playlist\n */\n\n\nvar refreshDelay = function refreshDelay(media, update) {\n  var segments = media.segments || [];\n  var lastSegment = segments[segments.length - 1];\n  var lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];\n  var lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;\n\n  if (update && lastDuration) {\n    return lastDuration * 1000;\n  } // if the playlist is unchanged since the last reload or last segment duration\n  // cannot be determined, try again after half the target duration\n\n\n  return (media.partTargetDuration || media.targetDuration || 10) * 500;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {string|Object} src url or object of manifest\n * @param {boolean} withCredentials the withCredentials xhr option\n * @class\n */\n\n\nvar PlaylistLoader = /*#__PURE__*/function (_EventTarget) {\n  _inheritsLoose(PlaylistLoader, _EventTarget);\n\n  function PlaylistLoader(src, vhs, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _EventTarget.call(this) || this;\n\n    if (!src) {\n      throw new Error('A non-empty playlist URL or object is required');\n    }\n\n    _this.logger_ = logger('PlaylistLoader');\n    var _options = options,\n        _options$withCredenti = _options.withCredentials,\n        withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti,\n        _options$handleManife = _options.handleManifestRedirects,\n        handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;\n    _this.src = src;\n    _this.vhs_ = vhs;\n    _this.withCredentials = withCredentials;\n    _this.handleManifestRedirects = handleManifestRedirects;\n    var vhsOptions = vhs.options_;\n    _this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];\n    _this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];\n    _this.experimentalLLHLS = vhsOptions && vhsOptions.experimentalLLHLS || false; // force experimentalLLHLS for IE 11\n\n    if (videojs.browser.IE_VERSION) {\n      _this.experimentalLLHLS = false;\n    } // initialize the loader state\n\n\n    _this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n    _this.handleMediaupdatetimeout_ = _this.handleMediaupdatetimeout_.bind(_assertThisInitialized(_this));\n\n    _this.on('mediaupdatetimeout', _this.handleMediaupdatetimeout_);\n\n    return _this;\n  }\n\n  var _proto = PlaylistLoader.prototype;\n\n  _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() {\n    var _this2 = this;\n\n    if (this.state !== 'HAVE_METADATA') {\n      // only refresh the media playlist if no other activity is going on\n      return;\n    }\n\n    var media = this.media();\n    var uri = resolveUrl(this.master.uri, media.uri);\n\n    if (this.experimentalLLHLS) {\n      uri = addLLHLSQueryDirectives(uri, media);\n    }\n\n    this.state = 'HAVE_CURRENT_METADATA';\n    this.request = this.vhs_.xhr({\n      uri: uri,\n      withCredentials: this.withCredentials\n    }, function (error, req) {\n      // disposed\n      if (!_this2.request) {\n        return;\n      }\n\n      if (error) {\n        return _this2.playlistRequestError(_this2.request, _this2.media(), 'HAVE_METADATA');\n      }\n\n      _this2.haveMetadata({\n        playlistString: _this2.request.responseText,\n        url: _this2.media().uri,\n        id: _this2.media().id\n      });\n    });\n  };\n\n  _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) {\n    var uri = playlist.uri,\n        id = playlist.id; // any in-flight request is now finished\n\n    this.request = null;\n\n    if (startingState) {\n      this.state = startingState;\n    }\n\n    this.error = {\n      playlist: this.master.playlists[id],\n      status: xhr.status,\n      message: \"HLS playlist request error at URL: \" + uri + \".\",\n      responseText: xhr.responseText,\n      code: xhr.status >= 500 ? 4 : 2\n    };\n    this.trigger('error');\n  };\n\n  _proto.parseManifest_ = function parseManifest_(_ref) {\n    var _this3 = this;\n\n    var url = _ref.url,\n        manifestString = _ref.manifestString;\n    return parseManifest({\n      onwarn: function onwarn(_ref2) {\n        var message = _ref2.message;\n        return _this3.logger_(\"m3u8-parser warn for \" + url + \": \" + message);\n      },\n      oninfo: function oninfo(_ref3) {\n        var message = _ref3.message;\n        return _this3.logger_(\"m3u8-parser info for \" + url + \": \" + message);\n      },\n      manifestString: manifestString,\n      customTagParsers: this.customTagParsers,\n      customTagMappers: this.customTagMappers,\n      experimentalLLHLS: this.experimentalLLHLS\n    });\n  }\n  /**\n   * Update the playlist loader's state in response to a new or updated playlist.\n   *\n   * @param {string} [playlistString]\n   *        Playlist string (if playlistObject is not provided)\n   * @param {Object} [playlistObject]\n   *        Playlist object (if playlistString is not provided)\n   * @param {string} url\n   *        URL of playlist\n   * @param {string} id\n   *        ID to use for playlist\n   */\n  ;\n\n  _proto.haveMetadata = function haveMetadata(_ref4) {\n    var playlistString = _ref4.playlistString,\n        playlistObject = _ref4.playlistObject,\n        url = _ref4.url,\n        id = _ref4.id; // any in-flight request is now finished\n\n    this.request = null;\n    this.state = 'HAVE_METADATA';\n    var playlist = playlistObject || this.parseManifest_({\n      url: url,\n      manifestString: playlistString\n    });\n    playlist.lastRequest = Date.now();\n    setupMediaPlaylist({\n      playlist: playlist,\n      uri: url,\n      id: id\n    }); // merge this playlist into the master\n\n    var update = updateMaster$1(this.master, playlist);\n    this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;\n    this.pendingMedia_ = null;\n\n    if (update) {\n      this.master = update;\n      this.media_ = this.master.playlists[id];\n    } else {\n      this.trigger('playlistunchanged');\n    }\n\n    this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));\n    this.trigger('loadedplaylist');\n  }\n  /**\n    * Abort any outstanding work and clean up.\n    */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.trigger('dispose');\n    this.stopRequest();\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    window$1.clearTimeout(this.finalRenditionTimeout);\n    this.off();\n  };\n\n  _proto.stopRequest = function stopRequest() {\n    if (this.request) {\n      var oldRequest = this.request;\n      this.request = null;\n      oldRequest.onreadystatechange = null;\n      oldRequest.abort();\n    }\n  }\n  /**\n    * When called without any arguments, returns the currently\n    * active media playlist. When called with a single argument,\n    * triggers the playlist loader to asynchronously switch to the\n    * specified media playlist. Calling this method while the\n    * loader is in the HAVE_NOTHING causes an error to be emitted\n    * but otherwise has no effect.\n    *\n    * @param {Object=} playlist the parsed media playlist\n    * object to switch to\n    * @param {boolean=} shouldDelay whether we should delay the request by half target duration\n    *\n    * @return {Playlist} the current loaded media\n    */\n  ;\n\n  _proto.media = function media(playlist, shouldDelay) {\n    var _this4 = this; // getter\n\n\n    if (!playlist) {\n      return this.media_;\n    } // setter\n\n\n    if (this.state === 'HAVE_NOTHING') {\n      throw new Error('Cannot switch media playlist from ' + this.state);\n    } // find the playlist object if the target playlist has been\n    // specified by URI\n\n\n    if (typeof playlist === 'string') {\n      if (!this.master.playlists[playlist]) {\n        throw new Error('Unknown playlist URI: ' + playlist);\n      }\n\n      playlist = this.master.playlists[playlist];\n    }\n\n    window$1.clearTimeout(this.finalRenditionTimeout);\n\n    if (shouldDelay) {\n      var delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1000 || 5 * 1000;\n      this.finalRenditionTimeout = window$1.setTimeout(this.media.bind(this, playlist, false), delay);\n      return;\n    }\n\n    var startingState = this.state;\n    var mediaChange = !this.media_ || playlist.id !== this.media_.id;\n    var masterPlaylistRef = this.master.playlists[playlist.id]; // switch to fully loaded playlists immediately\n\n    if (masterPlaylistRef && masterPlaylistRef.endList || // handle the case of a playlist object (e.g., if using vhs-json with a resolved\n    // media playlist or, for the case of demuxed audio, a resolved audio media group)\n    playlist.endList && playlist.segments.length) {\n      // abort outstanding playlist requests\n      if (this.request) {\n        this.request.onreadystatechange = null;\n        this.request.abort();\n        this.request = null;\n      }\n\n      this.state = 'HAVE_METADATA';\n      this.media_ = playlist; // trigger media change if the active media has been updated\n\n      if (mediaChange) {\n        this.trigger('mediachanging');\n\n        if (startingState === 'HAVE_MASTER') {\n          // The initial playlist was a master manifest, and the first media selected was\n          // also provided (in the form of a resolved playlist object) as part of the\n          // source object (rather than just a URL). Therefore, since the media playlist\n          // doesn't need to be requested, loadedmetadata won't trigger as part of the\n          // normal flow, and needs an explicit trigger here.\n          this.trigger('loadedmetadata');\n        } else {\n          this.trigger('mediachange');\n        }\n      }\n\n      return;\n    } // We update/set the timeout here so that live playlists\n    // that are not a media change will \"start\" the loader as expected.\n    // We expect that this function will start the media update timeout\n    // cycle again. This also prevents a playlist switch failure from\n    // causing us to stall during live.\n\n\n    this.updateMediaUpdateTimeout_(refreshDelay(playlist, true)); // switching to the active playlist is a no-op\n\n    if (!mediaChange) {\n      return;\n    }\n\n    this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n    if (this.request) {\n      if (playlist.resolvedUri === this.request.url) {\n        // requesting to switch to the same playlist multiple times\n        // has no effect after the first\n        return;\n      }\n\n      this.request.onreadystatechange = null;\n      this.request.abort();\n      this.request = null;\n    } // request the new playlist\n\n\n    if (this.media_) {\n      this.trigger('mediachanging');\n    }\n\n    this.pendingMedia_ = playlist;\n    this.request = this.vhs_.xhr({\n      uri: playlist.resolvedUri,\n      withCredentials: this.withCredentials\n    }, function (error, req) {\n      // disposed\n      if (!_this4.request) {\n        return;\n      }\n\n      playlist.lastRequest = Date.now();\n      playlist.resolvedUri = resolveManifestRedirect(_this4.handleManifestRedirects, playlist.resolvedUri, req);\n\n      if (error) {\n        return _this4.playlistRequestError(_this4.request, playlist, startingState);\n      }\n\n      _this4.haveMetadata({\n        playlistString: req.responseText,\n        url: playlist.uri,\n        id: playlist.id\n      }); // fire loadedmetadata the first time a media playlist is loaded\n\n\n      if (startingState === 'HAVE_MASTER') {\n        _this4.trigger('loadedmetadata');\n      } else {\n        _this4.trigger('mediachange');\n      }\n    });\n  }\n  /**\n   * pause loading of the playlist\n   */\n  ;\n\n  _proto.pause = function pause() {\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    }\n\n    this.stopRequest();\n\n    if (this.state === 'HAVE_NOTHING') {\n      // If we pause the loader before any data has been retrieved, its as if we never\n      // started, so reset to an unstarted state.\n      this.started = false;\n    } // Need to restore state now that no activity is happening\n\n\n    if (this.state === 'SWITCHING_MEDIA') {\n      // if the loader was in the process of switching media, it should either return to\n      // HAVE_MASTER or HAVE_METADATA depending on if the loader has loaded a media\n      // playlist yet. This is determined by the existence of loader.media_\n      if (this.media_) {\n        this.state = 'HAVE_METADATA';\n      } else {\n        this.state = 'HAVE_MASTER';\n      }\n    } else if (this.state === 'HAVE_CURRENT_METADATA') {\n      this.state = 'HAVE_METADATA';\n    }\n  }\n  /**\n   * start loading of the playlist\n   */\n  ;\n\n  _proto.load = function load(shouldDelay) {\n    var _this5 = this;\n\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    }\n\n    var media = this.media();\n\n    if (shouldDelay) {\n      var delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1000 : 5 * 1000;\n      this.mediaUpdateTimeout = window$1.setTimeout(function () {\n        _this5.mediaUpdateTimeout = null;\n\n        _this5.load();\n      }, delay);\n      return;\n    }\n\n    if (!this.started) {\n      this.start();\n      return;\n    }\n\n    if (media && !media.endList) {\n      this.trigger('mediaupdatetimeout');\n    } else {\n      this.trigger('loadedplaylist');\n    }\n  };\n\n  _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) {\n    var _this6 = this;\n\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    } // we only have use mediaupdatetimeout for live playlists.\n\n\n    if (!this.media() || this.media().endList) {\n      return;\n    }\n\n    this.mediaUpdateTimeout = window$1.setTimeout(function () {\n      _this6.mediaUpdateTimeout = null;\n\n      _this6.trigger('mediaupdatetimeout');\n\n      _this6.updateMediaUpdateTimeout_(delay);\n    }, delay);\n  }\n  /**\n   * start loading of the playlist\n   */\n  ;\n\n  _proto.start = function start() {\n    var _this7 = this;\n\n    this.started = true;\n\n    if (typeof this.src === 'object') {\n      // in the case of an entirely constructed manifest object (meaning there's no actual\n      // manifest on a server), default the uri to the page's href\n      if (!this.src.uri) {\n        this.src.uri = window$1.location.href;\n      } // resolvedUri is added on internally after the initial request. Since there's no\n      // request for pre-resolved manifests, add on resolvedUri here.\n\n\n      this.src.resolvedUri = this.src.uri; // Since a manifest object was passed in as the source (instead of a URL), the first\n      // request can be skipped (since the top level of the manifest, at a minimum, is\n      // already available as a parsed manifest object). However, if the manifest object\n      // represents a master playlist, some media playlists may need to be resolved before\n      // the starting segment list is available. Therefore, go directly to setup of the\n      // initial playlist, and let the normal flow continue from there.\n      //\n      // Note that the call to setup is asynchronous, as other sections of VHS may assume\n      // that the first request is asynchronous.\n\n      setTimeout(function () {\n        _this7.setupInitialPlaylist(_this7.src);\n      }, 0);\n      return;\n    } // request the specified URL\n\n\n    this.request = this.vhs_.xhr({\n      uri: this.src,\n      withCredentials: this.withCredentials\n    }, function (error, req) {\n      // disposed\n      if (!_this7.request) {\n        return;\n      } // clear the loader's request reference\n\n\n      _this7.request = null;\n\n      if (error) {\n        _this7.error = {\n          status: req.status,\n          message: \"HLS playlist request error at URL: \" + _this7.src + \".\",\n          responseText: req.responseText,\n          // MEDIA_ERR_NETWORK\n          code: 2\n        };\n\n        if (_this7.state === 'HAVE_NOTHING') {\n          _this7.started = false;\n        }\n\n        return _this7.trigger('error');\n      }\n\n      _this7.src = resolveManifestRedirect(_this7.handleManifestRedirects, _this7.src, req);\n\n      var manifest = _this7.parseManifest_({\n        manifestString: req.responseText,\n        url: _this7.src\n      });\n\n      _this7.setupInitialPlaylist(manifest);\n    });\n  };\n\n  _proto.srcUri = function srcUri() {\n    return typeof this.src === 'string' ? this.src : this.src.uri;\n  }\n  /**\n   * Given a manifest object that's either a master or media playlist, trigger the proper\n   * events and set the state of the playlist loader.\n   *\n   * If the manifest object represents a master playlist, `loadedplaylist` will be\n   * triggered to allow listeners to select a playlist. If none is selected, the loader\n   * will default to the first one in the playlists array.\n   *\n   * If the manifest object represents a media playlist, `loadedplaylist` will be\n   * triggered followed by `loadedmetadata`, as the only available playlist is loaded.\n   *\n   * In the case of a media playlist, a master playlist object wrapper with one playlist\n   * will be created so that all logic can handle playlists in the same fashion (as an\n   * assumed manifest object schema).\n   *\n   * @param {Object} manifest\n   *        The parsed manifest object\n   */\n  ;\n\n  _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) {\n    this.state = 'HAVE_MASTER';\n\n    if (manifest.playlists) {\n      this.master = manifest;\n      addPropertiesToMaster(this.master, this.srcUri()); // If the initial master playlist has playlists wtih segments already resolved,\n      // then resolve URIs in advance, as they are usually done after a playlist request,\n      // which may not happen if the playlist is resolved.\n\n      manifest.playlists.forEach(function (playlist) {\n        playlist.segments = getAllSegments(playlist);\n        playlist.segments.forEach(function (segment) {\n          resolveSegmentUris(segment, playlist.resolvedUri);\n        });\n      });\n      this.trigger('loadedplaylist');\n\n      if (!this.request) {\n        // no media playlist was specifically selected so start\n        // from the first listed one\n        this.media(this.master.playlists[0]);\n      }\n\n      return;\n    } // In order to support media playlists passed in as vhs-json, the case where the uri\n    // is not provided as part of the manifest should be considered, and an appropriate\n    // default used.\n\n\n    var uri = this.srcUri() || window$1.location.href;\n    this.master = masterForMedia(manifest, uri);\n    this.haveMetadata({\n      playlistObject: manifest,\n      url: uri,\n      id: this.master.playlists[0].id\n    });\n    this.trigger('loadedmetadata');\n  };\n\n  return PlaylistLoader;\n}(EventTarget$1);\n/**\n * @file xhr.js\n */\n\n\nvar videojsXHR = videojs.xhr,\n    mergeOptions$1 = videojs.mergeOptions;\n\nvar callbackWrapper = function callbackWrapper(request, error, response, callback) {\n  var reqResponse = request.responseType === 'arraybuffer' ? request.response : request.responseText;\n\n  if (!error && reqResponse) {\n    request.responseTime = Date.now();\n    request.roundTripTime = request.responseTime - request.requestTime;\n    request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n\n    if (!request.bandwidth) {\n      request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n    }\n  }\n\n  if (response.headers) {\n    request.responseHeaders = response.headers;\n  } // videojs.xhr now uses a specific code on the error\n  // object to signal that a request has timed out instead\n  // of setting a boolean on the request object\n\n\n  if (error && error.code === 'ETIMEDOUT') {\n    request.timedout = true;\n  } // videojs.xhr no longer considers status codes outside of 200 and 0\n  // (for file uris) to be errors, but the old XHR did, so emulate that\n  // behavior. Status 206 may be used in response to byterange requests.\n\n\n  if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n    error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n  }\n\n  callback(error, request);\n};\n\nvar xhrFactory = function xhrFactory() {\n  var xhr = function XhrFunction(options, callback) {\n    // Add a default timeout\n    options = mergeOptions$1({\n      timeout: 45e3\n    }, options); // Allow an optional user-specified function to modify the option\n    // object before we construct the xhr request\n\n    var beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest;\n\n    if (beforeRequest && typeof beforeRequest === 'function') {\n      var newOptions = beforeRequest(options);\n\n      if (newOptions) {\n        options = newOptions;\n      }\n    } // Use the standard videojs.xhr() method unless `videojs.Vhs.xhr` has been overriden\n    // TODO: switch back to videojs.Vhs.xhr.name === 'XhrFunction' when we drop IE11\n\n\n    var xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr;\n    var request = xhrMethod(options, function (error, response) {\n      return callbackWrapper(request, error, response, callback);\n    });\n    var originalAbort = request.abort;\n\n    request.abort = function () {\n      request.aborted = true;\n      return originalAbort.apply(request, arguments);\n    };\n\n    request.uri = options.uri;\n    request.requestTime = Date.now();\n    return request;\n  };\n\n  xhr.original = true;\n  return xhr;\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n *                             of a byte-range\n */\n\n\nvar byterangeStr = function byterangeStr(byterange) {\n  // `byterangeEnd` is one less than `offset + length` because the HTTP range\n  // header uses inclusive ranges\n  var byterangeEnd;\n  var byterangeStart = byterange.offset;\n\n  if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n    byterangeEnd = window$1.BigInt(byterange.offset) + window$1.BigInt(byterange.length) - window$1.BigInt(1);\n  } else {\n    byterangeEnd = byterange.offset + byterange.length - 1;\n  }\n\n  return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n */\n\n\nvar segmentXhrHeaders = function segmentXhrHeaders(segment) {\n  var headers = {};\n\n  if (segment.byterange) {\n    headers.Range = byterangeStr(segment.byterange);\n  }\n\n  return headers;\n};\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {number} i the iterator on the range to convert\n * @return {string} the range in string format\n */\n\n\nvar textRange = function textRange(range, i) {\n  return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {number} e The number\n * @param {number} i the iterator\n * @return {string} the hex formatted number as a string\n */\n\n\nvar formatHexString = function formatHexString(e, i) {\n  var value = e.toString(16);\n  return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\n\nvar formatAsciiString = function formatAsciiString(e) {\n  if (e >= 0x20 && e < 0x7e) {\n    return String.fromCharCode(e);\n  }\n\n  return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n *        Object of properties and values to send to the web worker\n * @return {Object}\n *         Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\nvar createTransferableMessage = function createTransferableMessage(message) {\n  var transferable = {};\n  Object.keys(message).forEach(function (key) {\n    var value = message[key];\n\n    if (isArrayBufferView(value)) {\n      transferable[key] = {\n        bytes: value.buffer,\n        byteOffset: value.byteOffset,\n        byteLength: value.byteLength\n      };\n    } else {\n      transferable[key] = value;\n    }\n  });\n  return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n *\n * @param {Object} initSegment\n *        the init segment object.\n *\n * @return {string} the generated init segment id\n */\n\n\nvar initSegmentId = function initSegmentId(initSegment) {\n  var byterange = initSegment.byterange || {\n    length: Infinity,\n    offset: 0\n  };\n  return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * Returns a unique string identifier for a media segment key.\n *\n * @param {Object} key the encryption key\n * @return {string} the unique id for the media segment key.\n */\n\n\nvar segmentKeyId = function segmentKeyId(key) {\n  return key.resolvedUri;\n};\n/**\n * utils to help dump binary data to the console\n *\n * @param {Array|TypedArray} data\n *        data to dump to a string\n *\n * @return {string} the data as a hex string.\n */\n\n\nvar hexDump = function hexDump(data) {\n  var bytes = Array.prototype.slice.call(data);\n  var step = 16;\n  var result = '';\n  var hex;\n  var ascii;\n\n  for (var j = 0; j < bytes.length / step; j++) {\n    hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n    ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n    result += hex + ' ' + ascii + '\\n';\n  }\n\n  return result;\n};\n\nvar tagDump = function tagDump(_ref) {\n  var bytes = _ref.bytes;\n  return hexDump(bytes);\n};\n\nvar textRanges = function textRanges(ranges) {\n  var result = '';\n  var i;\n\n  for (i = 0; i < ranges.length; i++) {\n    result += textRange(ranges, i) + ' ';\n  }\n\n  return result;\n};\n\nvar utils = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  createTransferableMessage: createTransferableMessage,\n  initSegmentId: initSegmentId,\n  segmentKeyId: segmentKeyId,\n  hexDump: hexDump,\n  tagDump: tagDump,\n  textRanges: textRanges\n}); // TODO handle fmp4 case where the timing info is accurate and doesn't involve transmux\n// 25% was arbitrarily chosen, and may need to be refined over time.\n\nvar SEGMENT_END_FUDGE_PERCENT = 0.25;\n/**\n * Converts a player time (any time that can be gotten/set from player.currentTime(),\n * e.g., any time within player.seekable().start(0) to player.seekable().end(0)) to a\n * program time (any time referencing the real world (e.g., EXT-X-PROGRAM-DATE-TIME)).\n *\n * The containing segment is required as the EXT-X-PROGRAM-DATE-TIME serves as an \"anchor\n * point\" (a point where we have a mapping from program time to player time, with player\n * time being the post transmux start of the segment).\n *\n * For more details, see [this doc](../../docs/program-time-from-player-time.md).\n *\n * @param {number} playerTime the player time\n * @param {Object} segment the segment which contains the player time\n * @return {Date} program time\n */\n\nvar playerTimeToProgramTime = function playerTimeToProgramTime(playerTime, segment) {\n  if (!segment.dateTimeObject) {\n    // Can't convert without an \"anchor point\" for the program time (i.e., a time that can\n    // be used to map the start of a segment with a real world time).\n    return null;\n  }\n\n  var transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;\n  var transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart; // get the start of the content from before old content is prepended\n\n  var startOfSegment = transmuxedStart + transmuxerPrependedSeconds;\n  var offsetFromSegmentStart = playerTime - startOfSegment;\n  return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1000);\n};\n\nvar originalSegmentVideoDuration = function originalSegmentVideoDuration(videoTimingInfo) {\n  return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;\n};\n/**\n * Finds a segment that contains the time requested given as an ISO-8601 string. The\n * returned segment might be an estimate or an accurate match.\n *\n * @param {string} programTime The ISO-8601 programTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForProgramTime = function findSegmentForProgramTime(programTime, playlist) {\n  // Assumptions:\n  //  - verifyProgramDateTimeTags has already been run\n  //  - live streams have been started\n  var dateTimeObject;\n\n  try {\n    dateTimeObject = new Date(programTime);\n  } catch (e) {\n    return null;\n  }\n\n  if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n    return null;\n  }\n\n  var segment = playlist.segments[0];\n\n  if (dateTimeObject < segment.dateTimeObject) {\n    // Requested time is before stream start.\n    return null;\n  }\n\n  for (var i = 0; i < playlist.segments.length - 1; i++) {\n    segment = playlist.segments[i];\n    var nextSegmentStart = playlist.segments[i + 1].dateTimeObject;\n\n    if (dateTimeObject < nextSegmentStart) {\n      break;\n    }\n  }\n\n  var lastSegment = playlist.segments[playlist.segments.length - 1];\n  var lastSegmentStart = lastSegment.dateTimeObject;\n  var lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;\n  var lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1000);\n\n  if (dateTimeObject > lastSegmentEnd) {\n    // Beyond the end of the stream, or our best guess of the end of the stream.\n    return null;\n  }\n\n  if (dateTimeObject > lastSegmentStart) {\n    segment = lastSegment;\n  }\n\n  return {\n    segment: segment,\n    estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),\n    // Although, given that all segments have accurate date time objects, the segment\n    // selected should be accurate, unless the video has been transmuxed at some point\n    // (determined by the presence of the videoTimingInfo object), the segment's \"player\n    // time\" (the start time in the player) can't be considered accurate.\n    type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n  };\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForPlayerTime = function findSegmentForPlayerTime(time, playlist) {\n  // Assumptions:\n  // - there will always be a segment.duration\n  // - we can start from zero\n  // - segments are in time order\n  if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n    return null;\n  }\n\n  var segmentEnd = 0;\n  var segment;\n\n  for (var i = 0; i < playlist.segments.length; i++) {\n    segment = playlist.segments[i]; // videoTimingInfo is set after the segment is downloaded and transmuxed, and\n    // should contain the most accurate values we have for the segment's player times.\n    //\n    // Use the accurate transmuxedPresentationEnd value if it is available, otherwise fall\n    // back to an estimate based on the manifest derived (inaccurate) segment.duration, to\n    // calculate an end value.\n\n    segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;\n\n    if (time <= segmentEnd) {\n      break;\n    }\n  }\n\n  var lastSegment = playlist.segments[playlist.segments.length - 1];\n\n  if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {\n    // The time requested is beyond the stream end.\n    return null;\n  }\n\n  if (time > segmentEnd) {\n    // The time is within or beyond the last segment.\n    //\n    // Check to see if the time is beyond a reasonable guess of the end of the stream.\n    if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {\n      // Technically, because the duration value is only an estimate, the time may still\n      // exist in the last segment, however, there isn't enough information to make even\n      // a reasonable estimate.\n      return null;\n    }\n\n    segment = lastSegment;\n  }\n\n  return {\n    segment: segment,\n    estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,\n    // Because videoTimingInfo is only set after transmux, it is the only way to get\n    // accurate timing values.\n    type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n  };\n};\n/**\n * Gives the offset of the comparisonTimestamp from the programTime timestamp in seconds.\n * If the offset returned is positive, the programTime occurs after the\n * comparisonTimestamp.\n * If the offset is negative, the programTime occurs before the comparisonTimestamp.\n *\n * @param {string} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {string} programTime The programTime as an ISO-8601 string\n * @return {number} offset\n */\n\n\nvar getOffsetFromTimestamp = function getOffsetFromTimestamp(comparisonTimeStamp, programTime) {\n  var segmentDateTime;\n  var programDateTime;\n\n  try {\n    segmentDateTime = new Date(comparisonTimeStamp);\n    programDateTime = new Date(programTime);\n  } catch (e) {// TODO handle error\n  }\n\n  var segmentTimeEpoch = segmentDateTime.getTime();\n  var programTimeEpoch = programDateTime.getTime();\n  return (programTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\n\nvar verifyProgramDateTimeTags = function verifyProgramDateTimeTags(playlist) {\n  if (!playlist.segments || playlist.segments.length === 0) {\n    return false;\n  }\n\n  for (var i = 0; i < playlist.segments.length; i++) {\n    var segment = playlist.segments[i];\n\n    if (!segment.dateTimeObject) {\n      return false;\n    }\n  }\n\n  return true;\n};\n/**\n * Returns the programTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {number} time A playerTime in seconds\n * @param {Function} callback(err, programTime)\n * @return {string} err.message A detailed error message\n * @return {Object} programTime\n * @return {number} programTime.mediaSeconds The streamTime in seconds\n * @return {string} programTime.programDateTime The programTime as an ISO-8601 String\n */\n\n\nvar getProgramTime = function getProgramTime(_ref) {\n  var playlist = _ref.playlist,\n      _ref$time = _ref.time,\n      time = _ref$time === void 0 ? undefined : _ref$time,\n      callback = _ref.callback;\n\n  if (!callback) {\n    throw new Error('getProgramTime: callback must be provided');\n  }\n\n  if (!playlist || time === undefined) {\n    return callback({\n      message: 'getProgramTime: playlist and time must be provided'\n    });\n  }\n\n  var matchedSegment = findSegmentForPlayerTime(time, playlist);\n\n  if (!matchedSegment) {\n    return callback({\n      message: 'valid programTime was not found'\n    });\n  }\n\n  if (matchedSegment.type === 'estimate') {\n    return callback({\n      message: 'Accurate programTime could not be determined.' + ' Please seek to e.seekTime and try again',\n      seekTime: matchedSegment.estimatedStart\n    });\n  }\n\n  var programTimeObject = {\n    mediaSeconds: time\n  };\n  var programTime = playerTimeToProgramTime(time, matchedSegment.segment);\n\n  if (programTime) {\n    programTimeObject.programDateTime = programTime.toISOString();\n  }\n\n  return callback(null, programTimeObject);\n};\n/**\n * Seeks in the player to a time that matches the given programTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {string} args.programTime A programTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @return {string} err.message A detailed error message\n * @return {number} newTime The exact time that was seeked to in seconds\n */\n\n\nvar seekToProgramTime = function seekToProgramTime(_ref2) {\n  var programTime = _ref2.programTime,\n      playlist = _ref2.playlist,\n      _ref2$retryCount = _ref2.retryCount,\n      retryCount = _ref2$retryCount === void 0 ? 2 : _ref2$retryCount,\n      seekTo = _ref2.seekTo,\n      _ref2$pauseAfterSeek = _ref2.pauseAfterSeek,\n      pauseAfterSeek = _ref2$pauseAfterSeek === void 0 ? true : _ref2$pauseAfterSeek,\n      tech = _ref2.tech,\n      callback = _ref2.callback;\n\n  if (!callback) {\n    throw new Error('seekToProgramTime: callback must be provided');\n  }\n\n  if (typeof programTime === 'undefined' || !playlist || !seekTo) {\n    return callback({\n      message: 'seekToProgramTime: programTime, seekTo and playlist must be provided'\n    });\n  }\n\n  if (!playlist.endList && !tech.hasStarted_) {\n    return callback({\n      message: 'player must be playing a live stream to start buffering'\n    });\n  }\n\n  if (!verifyProgramDateTimeTags(playlist)) {\n    return callback({\n      message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n    });\n  }\n\n  var matchedSegment = findSegmentForProgramTime(programTime, playlist); // no match\n\n  if (!matchedSegment) {\n    return callback({\n      message: programTime + \" was not found in the stream\"\n    });\n  }\n\n  var segment = matchedSegment.segment;\n  var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);\n\n  if (matchedSegment.type === 'estimate') {\n    // we've run out of retries\n    if (retryCount === 0) {\n      return callback({\n        message: programTime + \" is not buffered yet. Try again\"\n      });\n    }\n\n    seekTo(matchedSegment.estimatedStart + mediaOffset);\n    tech.one('seeked', function () {\n      seekToProgramTime({\n        programTime: programTime,\n        playlist: playlist,\n        retryCount: retryCount - 1,\n        seekTo: seekTo,\n        pauseAfterSeek: pauseAfterSeek,\n        tech: tech,\n        callback: callback\n      });\n    });\n    return;\n  } // Since the segment.start value is determined from the buffered end or ending time\n  // of the prior segment, the seekToTime doesn't need to account for any transmuxer\n  // modifications.\n\n\n  var seekToTime = segment.start + mediaOffset;\n\n  var seekedCallback = function seekedCallback() {\n    return callback(null, tech.currentTime());\n  }; // listen for seeked event\n\n\n  tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n  if (pauseAfterSeek) {\n    tech.pause();\n  }\n\n  seekTo(seekToTime);\n}; // which will only happen if the request is complete.\n\n\nvar callbackOnCompleted = function callbackOnCompleted(request, cb) {\n  if (request.readyState === 4) {\n    return cb();\n  }\n\n  return;\n};\n\nvar containerRequest = function containerRequest(uri, xhr, cb) {\n  var bytes = [];\n  var id3Offset;\n  var finished = false;\n\n  var endRequestAndCallback = function endRequestAndCallback(err, req, type, _bytes) {\n    req.abort();\n    finished = true;\n    return cb(err, req, type, _bytes);\n  };\n\n  var progressListener = function progressListener(error, request) {\n    if (finished) {\n      return;\n    }\n\n    if (error) {\n      return endRequestAndCallback(error, request, '', bytes);\n    } // grap the new part of content that was just downloaded\n\n\n    var newPart = request.responseText.substring(bytes && bytes.byteLength || 0, request.responseText.length); // add that onto bytes\n\n    bytes = concatTypedArrays(bytes, stringToBytes(newPart, true));\n    id3Offset = id3Offset || getId3Offset(bytes); // we need at least 10 bytes to determine a type\n    // or we need at least two bytes after an id3Offset\n\n    if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {\n      return callbackOnCompleted(request, function () {\n        return endRequestAndCallback(error, request, '', bytes);\n      });\n    }\n\n    var type = detectContainerForBytes(bytes); // if this looks like a ts segment but we don't have enough data\n    // to see the second sync byte, wait until we have enough data\n    // before declaring it ts\n\n    if (type === 'ts' && bytes.length < 188) {\n      return callbackOnCompleted(request, function () {\n        return endRequestAndCallback(error, request, '', bytes);\n      });\n    } // this may be an unsynced ts segment\n    // wait for 376 bytes before detecting no container\n\n\n    if (!type && bytes.length < 376) {\n      return callbackOnCompleted(request, function () {\n        return endRequestAndCallback(error, request, '', bytes);\n      });\n    }\n\n    return endRequestAndCallback(null, request, type, bytes);\n  };\n\n  var options = {\n    uri: uri,\n    beforeSend: function beforeSend(request) {\n      // this forces the browser to pass the bytes to us unprocessed\n      request.overrideMimeType('text/plain; charset=x-user-defined');\n      request.addEventListener('progress', function (_ref) {\n        _ref.total;\n        _ref.loaded;\n        return callbackWrapper(request, null, {\n          statusCode: request.status\n        }, progressListener);\n      });\n    }\n  };\n  var request = xhr(options, function (error, response) {\n    return callbackWrapper(request, error, response, progressListener);\n  });\n  return request;\n};\n\nvar EventTarget = videojs.EventTarget,\n    mergeOptions = videojs.mergeOptions;\n\nvar dashPlaylistUnchanged = function dashPlaylistUnchanged(a, b) {\n  if (!isPlaylistUnchanged(a, b)) {\n    return false;\n  } // for dash the above check will often return true in scenarios where\n  // the playlist actually has changed because mediaSequence isn't a\n  // dash thing, and we often set it to 1. So if the playlists have the same amount\n  // of segments we return true.\n  // So for dash we need to make sure that the underlying segments are different.\n  // if sidx changed then the playlists are different.\n\n\n  if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {\n    return false;\n  } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {\n    return false;\n  } // one or the other does not have segments\n  // there was a change.\n\n\n  if (a.segments && !b.segments || !a.segments && b.segments) {\n    return false;\n  } // neither has segments nothing changed\n\n\n  if (!a.segments && !b.segments) {\n    return true;\n  } // check segments themselves\n\n\n  for (var i = 0; i < a.segments.length; i++) {\n    var aSegment = a.segments[i];\n    var bSegment = b.segments[i]; // if uris are different between segments there was a change\n\n    if (aSegment.uri !== bSegment.uri) {\n      return false;\n    } // neither segment has a byterange, there will be no byterange change.\n\n\n    if (!aSegment.byterange && !bSegment.byterange) {\n      continue;\n    }\n\n    var aByterange = aSegment.byterange;\n    var bByterange = bSegment.byterange; // if byterange only exists on one of the segments, there was a change.\n\n    if (aByterange && !bByterange || !aByterange && bByterange) {\n      return false;\n    } // if both segments have byterange with different offsets, there was a change.\n\n\n    if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {\n      return false;\n    }\n  } // if everything was the same with segments, this is the same playlist.\n\n\n  return true;\n};\n/**\n * Parses the master XML string and updates playlist URI references.\n *\n * @param {Object} config\n *        Object of arguments\n * @param {string} config.masterXml\n *        The mpd XML\n * @param {string} config.srcUrl\n *        The mpd URL\n * @param {Date} config.clientOffset\n *         A time difference between server and client\n * @param {Object} config.sidxMapping\n *        SIDX mappings for moof/mdat URIs and byte ranges\n * @return {Object}\n *         The parsed mpd manifest object\n */\n\n\nvar parseMasterXml = function parseMasterXml(_ref) {\n  var masterXml = _ref.masterXml,\n      srcUrl = _ref.srcUrl,\n      clientOffset = _ref.clientOffset,\n      sidxMapping = _ref.sidxMapping,\n      previousManifest = _ref.previousManifest;\n  var manifest = parse(masterXml, {\n    manifestUri: srcUrl,\n    clientOffset: clientOffset,\n    sidxMapping: sidxMapping,\n    previousManifest: previousManifest\n  });\n  addPropertiesToMaster(manifest, srcUrl);\n  return manifest;\n};\n/**\n * Returns a new master manifest that is the result of merging an updated master manifest\n * into the original version.\n *\n * @param {Object} oldMaster\n *        The old parsed mpd object\n * @param {Object} newMaster\n *        The updated parsed mpd object\n * @return {Object}\n *         A new object representing the original master manifest with the updated media\n *         playlists merged in\n */\n\n\nvar updateMaster = function updateMaster(oldMaster, newMaster, sidxMapping) {\n  var noChanges = true;\n  var update = mergeOptions(oldMaster, {\n    // These are top level properties that can be updated\n    duration: newMaster.duration,\n    minimumUpdatePeriod: newMaster.minimumUpdatePeriod,\n    timelineStarts: newMaster.timelineStarts\n  }); // First update the playlists in playlist list\n\n  for (var i = 0; i < newMaster.playlists.length; i++) {\n    var playlist = newMaster.playlists[i];\n\n    if (playlist.sidx) {\n      var sidxKey = generateSidxKey(playlist.sidx); // add sidx segments to the playlist if we have all the sidx info already\n\n      if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {\n        addSidxSegmentsToPlaylist(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);\n      }\n    }\n\n    var playlistUpdate = updateMaster$1(update, playlist, dashPlaylistUnchanged);\n\n    if (playlistUpdate) {\n      update = playlistUpdate;\n      noChanges = false;\n    }\n  } // Then update media group playlists\n\n\n  forEachMediaGroup(newMaster, function (properties, type, group, label) {\n    if (properties.playlists && properties.playlists.length) {\n      var id = properties.playlists[0].id;\n\n      var _playlistUpdate = updateMaster$1(update, properties.playlists[0], dashPlaylistUnchanged);\n\n      if (_playlistUpdate) {\n        update = _playlistUpdate; // update the playlist reference within media groups\n\n        update.mediaGroups[type][group][label].playlists[0] = update.playlists[id];\n        noChanges = false;\n      }\n    }\n  });\n\n  if (newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {\n    noChanges = false;\n  }\n\n  if (noChanges) {\n    return null;\n  }\n\n  return update;\n}; // SIDX should be equivalent if the URI and byteranges of the SIDX match.\n// If the SIDXs have maps, the two maps should match,\n// both `a` and `b` missing SIDXs is considered matching.\n// If `a` or `b` but not both have a map, they aren't matching.\n\n\nvar equivalentSidx = function equivalentSidx(a, b) {\n  var neitherMap = Boolean(!a.map && !b.map);\n  var equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);\n  return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;\n}; // exported for testing\n\n\nvar compareSidxEntry = function compareSidxEntry(playlists, oldSidxMapping) {\n  var newSidxMapping = {};\n\n  for (var id in playlists) {\n    var playlist = playlists[id];\n    var currentSidxInfo = playlist.sidx;\n\n    if (currentSidxInfo) {\n      var key = generateSidxKey(currentSidxInfo);\n\n      if (!oldSidxMapping[key]) {\n        break;\n      }\n\n      var savedSidxInfo = oldSidxMapping[key].sidxInfo;\n\n      if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {\n        newSidxMapping[key] = oldSidxMapping[key];\n      }\n    }\n  }\n\n  return newSidxMapping;\n};\n/**\n *  A function that filters out changed items as they need to be requested separately.\n *\n *  The method is exported for testing\n *\n *  @param {Object} master the parsed mpd XML returned via mpd-parser\n *  @param {Object} oldSidxMapping the SIDX to compare against\n */\n\n\nvar filterChangedSidxMappings = function filterChangedSidxMappings(master, oldSidxMapping) {\n  var videoSidx = compareSidxEntry(master.playlists, oldSidxMapping);\n  var mediaGroupSidx = videoSidx;\n  forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n    if (properties.playlists && properties.playlists.length) {\n      var playlists = properties.playlists;\n      mediaGroupSidx = mergeOptions(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));\n    }\n  });\n  return mediaGroupSidx;\n};\n\nvar DashPlaylistLoader = /*#__PURE__*/function (_EventTarget) {\n  _inheritsLoose(DashPlaylistLoader, _EventTarget); // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n  // playlist loader setups from media groups will expect to be able to pass a playlist\n  // (since there aren't external URLs to media playlists with DASH)\n\n\n  function DashPlaylistLoader(srcUrlOrPlaylist, vhs, options, masterPlaylistLoader) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _EventTarget.call(this) || this;\n    _this.masterPlaylistLoader_ = masterPlaylistLoader || _assertThisInitialized(_this);\n\n    if (!masterPlaylistLoader) {\n      _this.isMaster_ = true;\n    }\n\n    var _options = options,\n        _options$withCredenti = _options.withCredentials,\n        withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti,\n        _options$handleManife = _options.handleManifestRedirects,\n        handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;\n    _this.vhs_ = vhs;\n    _this.withCredentials = withCredentials;\n    _this.handleManifestRedirects = handleManifestRedirects;\n\n    if (!srcUrlOrPlaylist) {\n      throw new Error('A non-empty playlist URL or object is required');\n    } // event naming?\n\n\n    _this.on('minimumUpdatePeriod', function () {\n      _this.refreshXml_();\n    }); // live playlist staleness timeout\n\n\n    _this.on('mediaupdatetimeout', function () {\n      _this.refreshMedia_(_this.media().id);\n    });\n\n    _this.state = 'HAVE_NOTHING';\n    _this.loadedPlaylists_ = {};\n    _this.logger_ = logger('DashPlaylistLoader'); // initialize the loader state\n    // The masterPlaylistLoader will be created with a string\n\n    if (_this.isMaster_) {\n      _this.masterPlaylistLoader_.srcUrl = srcUrlOrPlaylist; // TODO: reset sidxMapping between period changes\n      // once multi-period is refactored\n\n      _this.masterPlaylistLoader_.sidxMapping_ = {};\n    } else {\n      _this.childPlaylist_ = srcUrlOrPlaylist;\n    }\n\n    return _this;\n  }\n\n  var _proto = DashPlaylistLoader.prototype;\n\n  _proto.requestErrored_ = function requestErrored_(err, request, startingState) {\n    // disposed\n    if (!this.request) {\n      return true;\n    } // pending request is cleared\n\n\n    this.request = null;\n\n    if (err) {\n      // use the provided error object or create one\n      // based on the request/response\n      this.error = typeof err === 'object' && !(err instanceof Error) ? err : {\n        status: request.status,\n        message: 'DASH request error at URL: ' + request.uri,\n        response: request.response,\n        // MEDIA_ERR_NETWORK\n        code: 2\n      };\n\n      if (startingState) {\n        this.state = startingState;\n      }\n\n      this.trigger('error');\n      return true;\n    }\n  }\n  /**\n   * Verify that the container of the sidx segment can be parsed\n   * and if it can, get and parse that segment.\n   */\n  ;\n\n  _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) {\n    var _this2 = this;\n\n    var sidxKey = playlist.sidx && generateSidxKey(playlist.sidx); // playlist lacks sidx or sidx segments were added to this playlist already.\n\n    if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) {\n      // keep this function async\n      this.mediaRequest_ = window$1.setTimeout(function () {\n        return cb(false);\n      }, 0);\n      return;\n    } // resolve the segment URL relative to the playlist\n\n\n    var uri = resolveManifestRedirect(this.handleManifestRedirects, playlist.sidx.resolvedUri);\n\n    var fin = function fin(err, request) {\n      if (_this2.requestErrored_(err, request, startingState)) {\n        return;\n      }\n\n      var sidxMapping = _this2.masterPlaylistLoader_.sidxMapping_;\n      var sidx;\n\n      try {\n        sidx = parseSidx(toUint8(request.response).subarray(8));\n      } catch (e) {\n        // sidx parsing failed.\n        _this2.requestErrored_(e, request, startingState);\n\n        return;\n      }\n\n      sidxMapping[sidxKey] = {\n        sidxInfo: playlist.sidx,\n        sidx: sidx\n      };\n      addSidxSegmentsToPlaylist(playlist, sidx, playlist.sidx.resolvedUri);\n      return cb(true);\n    };\n\n    this.request = containerRequest(uri, this.vhs_.xhr, function (err, request, container, bytes) {\n      if (err) {\n        return fin(err, request);\n      }\n\n      if (!container || container !== 'mp4') {\n        return fin({\n          status: request.status,\n          message: \"Unsupported \" + (container || 'unknown') + \" container type for sidx segment at URL: \" + uri,\n          // response is just bytes in this case\n          // but we really don't want to return that.\n          response: '',\n          playlist: playlist,\n          internal: true,\n          blacklistDuration: Infinity,\n          // MEDIA_ERR_NETWORK\n          code: 2\n        }, request);\n      } // if we already downloaded the sidx bytes in the container request, use them\n\n\n      var _playlist$sidx$bytera = playlist.sidx.byterange,\n          offset = _playlist$sidx$bytera.offset,\n          length = _playlist$sidx$bytera.length;\n\n      if (bytes.length >= length + offset) {\n        return fin(err, {\n          response: bytes.subarray(offset, offset + length),\n          status: request.status,\n          uri: request.uri\n        });\n      } // otherwise request sidx bytes\n\n\n      _this2.request = _this2.vhs_.xhr({\n        uri: uri,\n        responseType: 'arraybuffer',\n        headers: segmentXhrHeaders({\n          byterange: playlist.sidx.byterange\n        })\n      }, fin);\n    });\n  };\n\n  _proto.dispose = function dispose() {\n    this.trigger('dispose');\n    this.stopRequest();\n    this.loadedPlaylists_ = {};\n    window$1.clearTimeout(this.minimumUpdatePeriodTimeout_);\n    window$1.clearTimeout(this.mediaRequest_);\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n    this.mediaRequest_ = null;\n    this.minimumUpdatePeriodTimeout_ = null;\n\n    if (this.masterPlaylistLoader_.createMupOnMedia_) {\n      this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_);\n      this.masterPlaylistLoader_.createMupOnMedia_ = null;\n    }\n\n    this.off();\n  };\n\n  _proto.hasPendingRequest = function hasPendingRequest() {\n    return this.request || this.mediaRequest_;\n  };\n\n  _proto.stopRequest = function stopRequest() {\n    if (this.request) {\n      var oldRequest = this.request;\n      this.request = null;\n      oldRequest.onreadystatechange = null;\n      oldRequest.abort();\n    }\n  };\n\n  _proto.media = function media(playlist) {\n    var _this3 = this; // getter\n\n\n    if (!playlist) {\n      return this.media_;\n    } // setter\n\n\n    if (this.state === 'HAVE_NOTHING') {\n      throw new Error('Cannot switch media playlist from ' + this.state);\n    }\n\n    var startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n    if (typeof playlist === 'string') {\n      if (!this.masterPlaylistLoader_.master.playlists[playlist]) {\n        throw new Error('Unknown playlist URI: ' + playlist);\n      }\n\n      playlist = this.masterPlaylistLoader_.master.playlists[playlist];\n    }\n\n    var mediaChange = !this.media_ || playlist.id !== this.media_.id; // switch to previously loaded playlists immediately\n\n    if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {\n      this.state = 'HAVE_METADATA';\n      this.media_ = playlist; // trigger media change if the active media has been updated\n\n      if (mediaChange) {\n        this.trigger('mediachanging');\n        this.trigger('mediachange');\n      }\n\n      return;\n    } // switching to the active playlist is a no-op\n\n\n    if (!mediaChange) {\n      return;\n    } // switching from an already loaded playlist\n\n\n    if (this.media_) {\n      this.trigger('mediachanging');\n    }\n\n    this.addSidxSegments_(playlist, startingState, function (sidxChanged) {\n      // everything is ready just continue to haveMetadata\n      _this3.haveMetadata({\n        startingState: startingState,\n        playlist: playlist\n      });\n    });\n  };\n\n  _proto.haveMetadata = function haveMetadata(_ref2) {\n    var startingState = _ref2.startingState,\n        playlist = _ref2.playlist;\n    this.state = 'HAVE_METADATA';\n    this.loadedPlaylists_[playlist.id] = playlist;\n    this.mediaRequest_ = null; // This will trigger loadedplaylist\n\n    this.refreshMedia_(playlist.id); // fire loadedmetadata the first time a media playlist is loaded\n    // to resolve setup of media groups\n\n    if (startingState === 'HAVE_MASTER') {\n      this.trigger('loadedmetadata');\n    } else {\n      // trigger media change if the active media has been updated\n      this.trigger('mediachange');\n    }\n  };\n\n  _proto.pause = function pause() {\n    if (this.masterPlaylistLoader_.createMupOnMedia_) {\n      this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_);\n      this.masterPlaylistLoader_.createMupOnMedia_ = null;\n    }\n\n    this.stopRequest();\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n\n    if (this.isMaster_) {\n      window$1.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_);\n      this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;\n    }\n\n    if (this.state === 'HAVE_NOTHING') {\n      // If we pause the loader before any data has been retrieved, its as if we never\n      // started, so reset to an unstarted state.\n      this.started = false;\n    }\n  };\n\n  _proto.load = function load(isFinalRendition) {\n    var _this4 = this;\n\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n    var media = this.media();\n\n    if (isFinalRendition) {\n      var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n      this.mediaUpdateTimeout = window$1.setTimeout(function () {\n        return _this4.load();\n      }, delay);\n      return;\n    } // because the playlists are internal to the manifest, load should either load the\n    // main manifest, or do nothing but trigger an event\n\n\n    if (!this.started) {\n      this.start();\n      return;\n    }\n\n    if (media && !media.endList) {\n      // Check to see if this is the master loader and the MUP was cleared (this happens\n      // when the loader was paused). `media` should be set at this point since one is always\n      // set during `start()`.\n      if (this.isMaster_ && !this.minimumUpdatePeriodTimeout_) {\n        // Trigger minimumUpdatePeriod to refresh the master manifest\n        this.trigger('minimumUpdatePeriod'); // Since there was no prior minimumUpdatePeriodTimeout it should be recreated\n\n        this.updateMinimumUpdatePeriodTimeout_();\n      }\n\n      this.trigger('mediaupdatetimeout');\n    } else {\n      this.trigger('loadedplaylist');\n    }\n  };\n\n  _proto.start = function start() {\n    var _this5 = this;\n\n    this.started = true; // We don't need to request the master manifest again\n    // Call this asynchronously to match the xhr request behavior below\n\n    if (!this.isMaster_) {\n      this.mediaRequest_ = window$1.setTimeout(function () {\n        return _this5.haveMaster_();\n      }, 0);\n      return;\n    }\n\n    this.requestMaster_(function (req, masterChanged) {\n      _this5.haveMaster_();\n\n      if (!_this5.hasPendingRequest() && !_this5.media_) {\n        _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]);\n      }\n    });\n  };\n\n  _proto.requestMaster_ = function requestMaster_(cb) {\n    var _this6 = this;\n\n    this.request = this.vhs_.xhr({\n      uri: this.masterPlaylistLoader_.srcUrl,\n      withCredentials: this.withCredentials\n    }, function (error, req) {\n      if (_this6.requestErrored_(error, req)) {\n        if (_this6.state === 'HAVE_NOTHING') {\n          _this6.started = false;\n        }\n\n        return;\n      }\n\n      var masterChanged = req.responseText !== _this6.masterPlaylistLoader_.masterXml_;\n      _this6.masterPlaylistLoader_.masterXml_ = req.responseText;\n\n      if (req.responseHeaders && req.responseHeaders.date) {\n        _this6.masterLoaded_ = Date.parse(req.responseHeaders.date);\n      } else {\n        _this6.masterLoaded_ = Date.now();\n      }\n\n      _this6.masterPlaylistLoader_.srcUrl = resolveManifestRedirect(_this6.handleManifestRedirects, _this6.masterPlaylistLoader_.srcUrl, req);\n\n      if (masterChanged) {\n        _this6.handleMaster_();\n\n        _this6.syncClientServerClock_(function () {\n          return cb(req, masterChanged);\n        });\n\n        return;\n      }\n\n      return cb(req, masterChanged);\n    });\n  }\n  /**\n   * Parses the master xml for UTCTiming node to sync the client clock to the server\n   * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n   *\n   * @param {Function} done\n   *        Function to call when clock sync has completed\n   */\n  ;\n\n  _proto.syncClientServerClock_ = function syncClientServerClock_(done) {\n    var _this7 = this;\n\n    var utcTiming = parseUTCTiming(this.masterPlaylistLoader_.masterXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n    // server clock\n\n    if (utcTiming === null) {\n      this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now();\n      return done();\n    }\n\n    if (utcTiming.method === 'DIRECT') {\n      this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();\n      return done();\n    }\n\n    this.request = this.vhs_.xhr({\n      uri: resolveUrl(this.masterPlaylistLoader_.srcUrl, utcTiming.value),\n      method: utcTiming.method,\n      withCredentials: this.withCredentials\n    }, function (error, req) {\n      // disposed\n      if (!_this7.request) {\n        return;\n      }\n\n      if (error) {\n        // sync request failed, fall back to using date header from mpd\n        // TODO: log warning\n        _this7.masterPlaylistLoader_.clientOffset_ = _this7.masterLoaded_ - Date.now();\n        return done();\n      }\n\n      var serverTime;\n\n      if (utcTiming.method === 'HEAD') {\n        if (!req.responseHeaders || !req.responseHeaders.date) {\n          // expected date header not preset, fall back to using date header from mpd\n          // TODO: log warning\n          serverTime = _this7.masterLoaded_;\n        } else {\n          serverTime = Date.parse(req.responseHeaders.date);\n        }\n      } else {\n        serverTime = Date.parse(req.responseText);\n      }\n\n      _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now();\n      done();\n    });\n  };\n\n  _proto.haveMaster_ = function haveMaster_() {\n    this.state = 'HAVE_MASTER';\n\n    if (this.isMaster_) {\n      // We have the master playlist at this point, so\n      // trigger this to allow MasterPlaylistController\n      // to make an initial playlist selection\n      this.trigger('loadedplaylist');\n    } else if (!this.media_) {\n      // no media playlist was specifically selected so select\n      // the one the child playlist loader was created with\n      this.media(this.childPlaylist_);\n    }\n  };\n\n  _proto.handleMaster_ = function handleMaster_() {\n    // clear media request\n    this.mediaRequest_ = null;\n    var oldMaster = this.masterPlaylistLoader_.master;\n    var newMaster = parseMasterXml({\n      masterXml: this.masterPlaylistLoader_.masterXml_,\n      srcUrl: this.masterPlaylistLoader_.srcUrl,\n      clientOffset: this.masterPlaylistLoader_.clientOffset_,\n      sidxMapping: this.masterPlaylistLoader_.sidxMapping_,\n      previousManifest: oldMaster\n    }); // if we have an old master to compare the new master against\n\n    if (oldMaster) {\n      newMaster = updateMaster(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_);\n    } // only update master if we have a new master\n\n\n    this.masterPlaylistLoader_.master = newMaster ? newMaster : oldMaster;\n    var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0];\n\n    if (location && location !== this.masterPlaylistLoader_.srcUrl) {\n      this.masterPlaylistLoader_.srcUrl = location;\n    }\n\n    if (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {\n      this.updateMinimumUpdatePeriodTimeout_();\n    }\n\n    return Boolean(newMaster);\n  };\n\n  _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() {\n    var mpl = this.masterPlaylistLoader_; // cancel any pending creation of mup on media\n    // a new one will be added if needed.\n\n    if (mpl.createMupOnMedia_) {\n      mpl.off('loadedmetadata', mpl.createMupOnMedia_);\n      mpl.createMupOnMedia_ = null;\n    } // clear any pending timeouts\n\n\n    if (mpl.minimumUpdatePeriodTimeout_) {\n      window$1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);\n      mpl.minimumUpdatePeriodTimeout_ = null;\n    }\n\n    var mup = mpl.master && mpl.master.minimumUpdatePeriod; // If the minimumUpdatePeriod has a value of 0, that indicates that the current\n    // MPD has no future validity, so a new one will need to be acquired when new\n    // media segments are to be made available. Thus, we use the target duration\n    // in this case\n\n    if (mup === 0) {\n      if (mpl.media()) {\n        mup = mpl.media().targetDuration * 1000;\n      } else {\n        mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;\n        mpl.one('loadedmetadata', mpl.createMupOnMedia_);\n      }\n    } // if minimumUpdatePeriod is invalid or <= zero, which\n    // can happen when a live video becomes VOD. skip timeout\n    // creation.\n\n\n    if (typeof mup !== 'number' || mup <= 0) {\n      if (mup < 0) {\n        this.logger_(\"found invalid minimumUpdatePeriod of \" + mup + \", not setting a timeout\");\n      }\n\n      return;\n    }\n\n    this.createMUPTimeout_(mup);\n  };\n\n  _proto.createMUPTimeout_ = function createMUPTimeout_(mup) {\n    var mpl = this.masterPlaylistLoader_;\n    mpl.minimumUpdatePeriodTimeout_ = window$1.setTimeout(function () {\n      mpl.minimumUpdatePeriodTimeout_ = null;\n      mpl.trigger('minimumUpdatePeriod');\n      mpl.createMUPTimeout_(mup);\n    }, mup);\n  }\n  /**\n   * Sends request to refresh the master xml and updates the parsed master manifest\n   */\n  ;\n\n  _proto.refreshXml_ = function refreshXml_() {\n    var _this8 = this;\n\n    this.requestMaster_(function (req, masterChanged) {\n      if (!masterChanged) {\n        return;\n      }\n\n      if (_this8.media_) {\n        _this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id];\n      } // This will filter out updated sidx info from the mapping\n\n\n      _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_);\n\n      _this8.addSidxSegments_(_this8.media(), _this8.state, function (sidxChanged) {\n        // TODO: do we need to reload the current playlist?\n        _this8.refreshMedia_(_this8.media().id);\n      });\n    });\n  }\n  /**\n   * Refreshes the media playlist by re-parsing the master xml and updating playlist\n   * references. If this is an alternate loader, the updated parsed manifest is retrieved\n   * from the master loader.\n   */\n  ;\n\n  _proto.refreshMedia_ = function refreshMedia_(mediaID) {\n    var _this9 = this;\n\n    if (!mediaID) {\n      throw new Error('refreshMedia_ must take a media id');\n    } // for master we have to reparse the master xml\n    // to re-create segments based on current timing values\n    // which may change media. We only skip updating master\n    // if this is the first time this.media_ is being set.\n    // as master was just parsed in that case.\n\n\n    if (this.media_ && this.isMaster_) {\n      this.handleMaster_();\n    }\n\n    var playlists = this.masterPlaylistLoader_.master.playlists;\n    var mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];\n\n    if (mediaChanged) {\n      this.media_ = playlists[mediaID];\n    } else {\n      this.trigger('playlistunchanged');\n    }\n\n    if (!this.mediaUpdateTimeout) {\n      var createMediaUpdateTimeout = function createMediaUpdateTimeout() {\n        if (_this9.media().endList) {\n          return;\n        }\n\n        _this9.mediaUpdateTimeout = window$1.setTimeout(function () {\n          _this9.trigger('mediaupdatetimeout');\n\n          createMediaUpdateTimeout();\n        }, refreshDelay(_this9.media(), Boolean(mediaChanged)));\n      };\n\n      createMediaUpdateTimeout();\n    }\n\n    this.trigger('loadedplaylist');\n  };\n\n  return DashPlaylistLoader;\n}(EventTarget);\n\nvar Config = {\n  GOAL_BUFFER_LENGTH: 30,\n  MAX_GOAL_BUFFER_LENGTH: 60,\n  BACK_BUFFER_LENGTH: 30,\n  GOAL_BUFFER_LENGTH_RATE: 1,\n  // 0.5 MB/s\n  INITIAL_BANDWIDTH: 4194304,\n  // A fudge factor to apply to advertised playlist bitrates to account for\n  // temporary flucations in client bandwidth\n  BANDWIDTH_VARIANCE: 1.2,\n  // How much of the buffer must be filled before we consider upswitching\n  BUFFER_LOW_WATER_LINE: 0,\n  MAX_BUFFER_LOW_WATER_LINE: 30,\n  // TODO: Remove this when experimentalBufferBasedABR is removed\n  EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,\n  BUFFER_LOW_WATER_LINE_RATE: 1,\n  // If the buffer is greater than the high water line, we won't switch down\n  BUFFER_HIGH_WATER_LINE: 30\n};\n\nvar stringToArrayBuffer = function stringToArrayBuffer(string) {\n  var view = new Uint8Array(new ArrayBuffer(string.length));\n\n  for (var i = 0; i < string.length; i++) {\n    view[i] = string.charCodeAt(i);\n  }\n\n  return view.buffer;\n};\n/* global Blob, BlobBuilder, Worker */\n// unify worker interface\n\n\nvar browserWorkerPolyFill = function browserWorkerPolyFill(workerObj) {\n  // node only supports on/off\n  workerObj.on = workerObj.addEventListener;\n  workerObj.off = workerObj.removeEventListener;\n  return workerObj;\n};\n\nvar createObjectURL = function createObjectURL(str) {\n  try {\n    return URL.createObjectURL(new Blob([str], {\n      type: 'application/javascript'\n    }));\n  } catch (e) {\n    var blob = new BlobBuilder();\n    blob.append(str);\n    return URL.createObjectURL(blob.getBlob());\n  }\n};\n\nvar factory = function factory(code) {\n  return function () {\n    var objectUrl = createObjectURL(code);\n    var worker = browserWorkerPolyFill(new Worker(objectUrl));\n    worker.objURL = objectUrl;\n    var terminate = worker.terminate;\n    worker.on = worker.addEventListener;\n    worker.off = worker.removeEventListener;\n\n    worker.terminate = function () {\n      URL.revokeObjectURL(objectUrl);\n      return terminate.call(this);\n    };\n\n    return worker;\n  };\n};\n\nvar transform = function transform(code) {\n  return \"var browserWorkerPolyFill = \" + browserWorkerPolyFill.toString() + \";\\n\" + 'browserWorkerPolyFill(self);\\n' + code;\n};\n\nvar getWorkerString = function getWorkerString(fn) {\n  return fn.toString().replace(/^function.+?{/, '').slice(0, -1);\n};\n/* rollup-plugin-worker-factory start for worker!/Users/abarstow/videojs/http-streaming/src/transmuxer-worker.js */\n\n\nvar workerCode$1 = transform(getWorkerString(function () {\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * A lightweight readable stream implemention that handles event dispatching.\n   * Objects that inherit from streams should call init in their constructors.\n   */\n  var Stream = function Stream() {\n    this.init = function () {\n      var listeners = {};\n      /**\n       * Add a listener for a specified event type.\n       * @param type {string} the event name\n       * @param listener {function} the callback to be invoked when an event of\n       * the specified type occurs\n       */\n\n      this.on = function (type, listener) {\n        if (!listeners[type]) {\n          listeners[type] = [];\n        }\n\n        listeners[type] = listeners[type].concat(listener);\n      };\n      /**\n       * Remove a listener for a specified event type.\n       * @param type {string} the event name\n       * @param listener {function} a function previously registered for this\n       * type of event through `on`\n       */\n\n\n      this.off = function (type, listener) {\n        var index;\n\n        if (!listeners[type]) {\n          return false;\n        }\n\n        index = listeners[type].indexOf(listener);\n        listeners[type] = listeners[type].slice();\n        listeners[type].splice(index, 1);\n        return index > -1;\n      };\n      /**\n       * Trigger an event of the specified type on this stream. Any additional\n       * arguments to this function are passed as parameters to event listeners.\n       * @param type {string} the event name\n       */\n\n\n      this.trigger = function (type) {\n        var callbacks, i, length, args;\n        callbacks = listeners[type];\n\n        if (!callbacks) {\n          return;\n        } // Slicing the arguments on every invocation of this method\n        // can add a significant amount of overhead. Avoid the\n        // intermediate object creation for the common case of a\n        // single callback argument\n\n\n        if (arguments.length === 2) {\n          length = callbacks.length;\n\n          for (i = 0; i < length; ++i) {\n            callbacks[i].call(this, arguments[1]);\n          }\n        } else {\n          args = [];\n          i = arguments.length;\n\n          for (i = 1; i < arguments.length; ++i) {\n            args.push(arguments[i]);\n          }\n\n          length = callbacks.length;\n\n          for (i = 0; i < length; ++i) {\n            callbacks[i].apply(this, args);\n          }\n        }\n      };\n      /**\n       * Destroys the stream and cleans up.\n       */\n\n\n      this.dispose = function () {\n        listeners = {};\n      };\n    };\n  };\n  /**\n   * Forwards all `data` events on this stream to the destination stream. The\n   * destination stream should provide a method `push` to receive the data\n   * events as they arrive.\n   * @param destination {stream} the stream that will receive all `data` events\n   * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n   *                            when the current stream emits a 'done' event\n   * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n   */\n\n\n  Stream.prototype.pipe = function (destination) {\n    this.on('data', function (data) {\n      destination.push(data);\n    });\n    this.on('done', function (flushSource) {\n      destination.flush(flushSource);\n    });\n    this.on('partialdone', function (flushSource) {\n      destination.partialFlush(flushSource);\n    });\n    this.on('endedtimeline', function (flushSource) {\n      destination.endTimeline(flushSource);\n    });\n    this.on('reset', function (flushSource) {\n      destination.reset(flushSource);\n    });\n    return destination;\n  }; // Default stream functions that are expected to be overridden to perform\n  // actual work. These are provided by the prototype as a sort of no-op\n  // implementation so that we don't have to check for their existence in the\n  // `pipe` function above.\n\n\n  Stream.prototype.push = function (data) {\n    this.trigger('data', data);\n  };\n\n  Stream.prototype.flush = function (flushSource) {\n    this.trigger('done', flushSource);\n  };\n\n  Stream.prototype.partialFlush = function (flushSource) {\n    this.trigger('partialdone', flushSource);\n  };\n\n  Stream.prototype.endTimeline = function (flushSource) {\n    this.trigger('endedtimeline', flushSource);\n  };\n\n  Stream.prototype.reset = function (flushSource) {\n    this.trigger('reset', flushSource);\n  };\n\n  var stream = Stream;\n  var MAX_UINT32$1 = Math.pow(2, 32);\n\n  var getUint64$2 = function getUint64(uint8) {\n    var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);\n    var value;\n\n    if (dv.getBigUint64) {\n      value = dv.getBigUint64(0);\n\n      if (value < Number.MAX_SAFE_INTEGER) {\n        return Number(value);\n      }\n\n      return value;\n    }\n\n    return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);\n  };\n\n  var numbers = {\n    getUint64: getUint64$2,\n    MAX_UINT32: MAX_UINT32$1\n  };\n  var MAX_UINT32 = numbers.MAX_UINT32;\n  var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n  (function () {\n    var i;\n    types = {\n      avc1: [],\n      // codingname\n      avcC: [],\n      btrt: [],\n      dinf: [],\n      dref: [],\n      esds: [],\n      ftyp: [],\n      hdlr: [],\n      mdat: [],\n      mdhd: [],\n      mdia: [],\n      mfhd: [],\n      minf: [],\n      moof: [],\n      moov: [],\n      mp4a: [],\n      // codingname\n      mvex: [],\n      mvhd: [],\n      pasp: [],\n      sdtp: [],\n      smhd: [],\n      stbl: [],\n      stco: [],\n      stsc: [],\n      stsd: [],\n      stsz: [],\n      stts: [],\n      styp: [],\n      tfdt: [],\n      tfhd: [],\n      traf: [],\n      trak: [],\n      trun: [],\n      trex: [],\n      tkhd: [],\n      vmhd: []\n    }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n    // don't throw an error\n\n    if (typeof Uint8Array === 'undefined') {\n      return;\n    }\n\n    for (i in types) {\n      if (types.hasOwnProperty(i)) {\n        types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n      }\n    }\n\n    MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n    AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n    MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n    VIDEO_HDLR = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // pre_defined\n    0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n    ]);\n    AUDIO_HDLR = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // pre_defined\n    0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n    ]);\n    HDLR_TYPES = {\n      video: VIDEO_HDLR,\n      audio: AUDIO_HDLR\n    };\n    DREF = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x01, // entry_count\n    0x00, 0x00, 0x00, 0x0c, // entry_size\n    0x75, 0x72, 0x6c, 0x20, // 'url' type\n    0x00, // version 0\n    0x00, 0x00, 0x01 // entry_flags\n    ]);\n    SMHD = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, // balance, 0 means centered\n    0x00, 0x00 // reserved\n    ]);\n    STCO = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00 // entry_count\n    ]);\n    STSC = STCO;\n    STSZ = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // sample_size\n    0x00, 0x00, 0x00, 0x00 // sample_count\n    ]);\n    STTS = STCO;\n    VMHD = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x01, // flags\n    0x00, 0x00, // graphicsmode\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n    ]);\n  })();\n\n  box = function box(type) {\n    var payload = [],\n        size = 0,\n        i,\n        result,\n        view;\n\n    for (i = 1; i < arguments.length; i++) {\n      payload.push(arguments[i]);\n    }\n\n    i = payload.length; // calculate the total size we need to allocate\n\n    while (i--) {\n      size += payload[i].byteLength;\n    }\n\n    result = new Uint8Array(size + 8);\n    view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n    view.setUint32(0, result.byteLength);\n    result.set(type, 4); // copy the payload into the result\n\n    for (i = 0, size = 8; i < payload.length; i++) {\n      result.set(payload[i], size);\n      size += payload[i].byteLength;\n    }\n\n    return result;\n  };\n\n  dinf = function dinf() {\n    return box(types.dinf, box(types.dref, DREF));\n  };\n\n  esds = function esds(track) {\n    return box(types.esds, new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    // ES_Descriptor\n    0x03, // tag, ES_DescrTag\n    0x19, // length\n    0x00, 0x00, // ES_ID\n    0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n    // DecoderConfigDescriptor\n    0x04, // tag, DecoderConfigDescrTag\n    0x11, // length\n    0x40, // object type\n    0x15, // streamType\n    0x00, 0x06, 0x00, // bufferSizeDB\n    0x00, 0x00, 0xda, 0xc0, // maxBitrate\n    0x00, 0x00, 0xda, 0xc0, // avgBitrate\n    // DecoderSpecificInfo\n    0x05, // tag, DecoderSpecificInfoTag\n    0x02, // length\n    // ISO/IEC 14496-3, AudioSpecificConfig\n    // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n    track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n    ]));\n  };\n\n  ftyp = function ftyp() {\n    return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n  };\n\n  hdlr = function hdlr(type) {\n    return box(types.hdlr, HDLR_TYPES[type]);\n  };\n\n  mdat = function mdat(data) {\n    return box(types.mdat, data);\n  };\n\n  mdhd = function mdhd(track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x02, // creation_time\n    0x00, 0x00, 0x00, 0x03, // modification_time\n    0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n    track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF, // duration\n    0x55, 0xc4, // 'und' language (undetermined)\n    0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n    // defined. The sample rate can be parsed out of an ADTS header, for\n    // instance.\n\n    if (track.samplerate) {\n      result[12] = track.samplerate >>> 24 & 0xFF;\n      result[13] = track.samplerate >>> 16 & 0xFF;\n      result[14] = track.samplerate >>> 8 & 0xFF;\n      result[15] = track.samplerate & 0xFF;\n    }\n\n    return box(types.mdhd, result);\n  };\n\n  mdia = function mdia(track) {\n    return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n  };\n\n  mfhd = function mfhd(sequenceNumber) {\n    return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n    (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n    ]));\n  };\n\n  minf = function minf(track) {\n    return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n  };\n\n  moof = function moof(sequenceNumber, tracks) {\n    var trackFragments = [],\n        i = tracks.length; // build traf boxes for each track fragment\n\n    while (i--) {\n      trackFragments[i] = traf(tracks[i]);\n    }\n\n    return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n  };\n  /**\n   * Returns a movie box.\n   * @param tracks {array} the tracks associated with this movie\n   * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n   */\n\n\n  moov = function moov(tracks) {\n    var i = tracks.length,\n        boxes = [];\n\n    while (i--) {\n      boxes[i] = trak(tracks[i]);\n    }\n\n    return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n  };\n\n  mvex = function mvex(tracks) {\n    var i = tracks.length,\n        boxes = [];\n\n    while (i--) {\n      boxes[i] = trex(tracks[i]);\n    }\n\n    return box.apply(null, [types.mvex].concat(boxes));\n  };\n\n  mvhd = function mvhd(duration) {\n    var bytes = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x01, // creation_time\n    0x00, 0x00, 0x00, 0x02, // modification_time\n    0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n    (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF, // duration\n    0x00, 0x01, 0x00, 0x00, // 1.0 rate\n    0x01, 0x00, // 1.0 volume\n    0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n    0xff, 0xff, 0xff, 0xff // next_track_ID\n    ]);\n    return box(types.mvhd, bytes);\n  };\n\n  sdtp = function sdtp(track) {\n    var samples = track.samples || [],\n        bytes = new Uint8Array(4 + samples.length),\n        flags,\n        i; // leave the full box header (4 bytes) all zero\n    // write the sample table\n\n    for (i = 0; i < samples.length; i++) {\n      flags = samples[i].flags;\n      bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n    }\n\n    return box(types.sdtp, bytes);\n  };\n\n  stbl = function stbl(track) {\n    return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n  };\n\n  (function () {\n    var videoSample, audioSample;\n\n    stsd = function stsd(track) {\n      return box(types.stsd, new Uint8Array([0x00, // version 0\n      0x00, 0x00, 0x00, // flags\n      0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n    };\n\n    videoSample = function videoSample(track) {\n      var sps = track.sps || [],\n          pps = track.pps || [],\n          sequenceParameterSets = [],\n          pictureParameterSets = [],\n          i,\n          avc1Box; // assemble the SPSs\n\n      for (i = 0; i < sps.length; i++) {\n        sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n        sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n        sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n      } // assemble the PPSs\n\n\n      for (i = 0; i < pps.length; i++) {\n        pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n        pictureParameterSets.push(pps[i].byteLength & 0xFF);\n        pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n      }\n\n      avc1Box = [types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // data_reference_index\n      0x00, 0x00, // pre_defined\n      0x00, 0x00, // reserved\n      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n      (track.width & 0xff00) >> 8, track.width & 0xff, // width\n      (track.height & 0xff00) >> 8, track.height & 0xff, // height\n      0x00, 0x48, 0x00, 0x00, // horizresolution\n      0x00, 0x48, 0x00, 0x00, // vertresolution\n      0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // frame_count\n      0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n      0x00, 0x18, // depth = 24\n      0x11, 0x11 // pre_defined = -1\n      ]), box(types.avcC, new Uint8Array([0x01, // configurationVersion\n      track.profileIdc, // AVCProfileIndication\n      track.profileCompatibility, // profile_compatibility\n      track.levelIdc, // AVCLevelIndication\n      0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n      ].concat([sps.length], // numOfSequenceParameterSets\n      sequenceParameterSets, // \"SPS\"\n      [pps.length], // numOfPictureParameterSets\n      pictureParameterSets // \"PPS\"\n      ))), box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n      0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n      0x00, 0x2d, 0xc6, 0xc0 // avgBitrate\n      ]))];\n\n      if (track.sarRatio) {\n        var hSpacing = track.sarRatio[0],\n            vSpacing = track.sarRatio[1];\n        avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 0xFF000000) >> 24, (hSpacing & 0xFF0000) >> 16, (hSpacing & 0xFF00) >> 8, hSpacing & 0xFF, (vSpacing & 0xFF000000) >> 24, (vSpacing & 0xFF0000) >> 16, (vSpacing & 0xFF00) >> 8, vSpacing & 0xFF])));\n      }\n\n      return box.apply(null, avc1Box);\n    };\n\n    audioSample = function audioSample(track) {\n      return box(types.mp4a, new Uint8Array([// SampleEntry, ISO/IEC 14496-12\n      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // data_reference_index\n      // AudioSampleEntry, ISO/IEC 14496-12\n      0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x00, 0x00, 0x00, // reserved\n      (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff, // channelcount\n      (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff, // samplesize\n      0x00, 0x00, // pre_defined\n      0x00, 0x00, // reserved\n      (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n      // MP4AudioSampleEntry, ISO/IEC 14496-14\n      ]), esds(track));\n    };\n  })();\n\n  tkhd = function tkhd(track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x07, // flags\n    0x00, 0x00, 0x00, 0x00, // creation_time\n    0x00, 0x00, 0x00, 0x00, // modification_time\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x00, // reserved\n    (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF, // duration\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, // layer\n    0x00, 0x00, // alternate_group\n    0x01, 0x00, // non-audio track volume\n    0x00, 0x00, // reserved\n    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n    (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00, // width\n    (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n    ]);\n    return box(types.tkhd, result);\n  };\n  /**\n   * Generate a track fragment (traf) box. A traf box collects metadata\n   * about tracks in a movie fragment (moof) box.\n   */\n\n\n  traf = function traf(track) {\n    var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n    trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x3a, // flags\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x01, // sample_description_index\n    0x00, 0x00, 0x00, 0x00, // default_sample_duration\n    0x00, 0x00, 0x00, 0x00, // default_sample_size\n    0x00, 0x00, 0x00, 0x00 // default_sample_flags\n    ]));\n    upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT32);\n    lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT32);\n    trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01, // version 1\n    0x00, 0x00, 0x00, // flags\n    // baseMediaDecodeTime\n    upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n    // the containing moof to the first payload byte of the associated\n    // mdat\n\n    dataOffset = 32 + // tfhd\n    20 + // tfdt\n    8 + // traf header\n    16 + // mfhd\n    8 + // moof header\n    8; // mdat header\n    // audio tracks require less metadata\n\n    if (track.type === 'audio') {\n      trackFragmentRun = trun$1(track, dataOffset);\n      return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n    } // video tracks should contain an independent and disposable samples\n    // box (sdtp)\n    // generate one and adjust offsets to match\n\n\n    sampleDependencyTable = sdtp(track);\n    trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);\n    return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n  };\n  /**\n   * Generate a track box.\n   * @param track {object} a track definition\n   * @return {Uint8Array} the track box\n   */\n\n\n  trak = function trak(track) {\n    track.duration = track.duration || 0xffffffff;\n    return box(types.trak, tkhd(track), mdia(track));\n  };\n\n  trex = function trex(track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n    0x00, 0x00, 0x00, 0x00, // default_sample_duration\n    0x00, 0x00, 0x00, 0x00, // default_sample_size\n    0x00, 0x01, 0x00, 0x01 // default_sample_flags\n    ]); // the last two bytes of default_sample_flags is the sample\n    // degradation priority, a hint about the importance of this sample\n    // relative to others. Lower the degradation priority for all sample\n    // types other than video.\n\n    if (track.type !== 'video') {\n      result[result.length - 1] = 0x00;\n    }\n\n    return box(types.trex, result);\n  };\n\n  (function () {\n    var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n    // duration is present for the first sample, it will be present for\n    // all subsequent samples.\n    // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n    trunHeader = function trunHeader(samples, offset) {\n      var durationPresent = 0,\n          sizePresent = 0,\n          flagsPresent = 0,\n          compositionTimeOffset = 0; // trun flag constants\n\n      if (samples.length) {\n        if (samples[0].duration !== undefined) {\n          durationPresent = 0x1;\n        }\n\n        if (samples[0].size !== undefined) {\n          sizePresent = 0x2;\n        }\n\n        if (samples[0].flags !== undefined) {\n          flagsPresent = 0x4;\n        }\n\n        if (samples[0].compositionTimeOffset !== undefined) {\n          compositionTimeOffset = 0x8;\n        }\n      }\n\n      return [0x00, // version 0\n      0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01, // flags\n      (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF, // sample_count\n      (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n      ];\n    };\n\n    videoTrun = function videoTrun(track, offset) {\n      var bytesOffest, bytes, header, samples, sample, i;\n      samples = track.samples || [];\n      offset += 8 + 12 + 16 * samples.length;\n      header = trunHeader(samples, offset);\n      bytes = new Uint8Array(header.length + samples.length * 16);\n      bytes.set(header);\n      bytesOffest = header.length;\n\n      for (i = 0; i < samples.length; i++) {\n        sample = samples[i];\n        bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n        bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n\n        bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;\n        bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;\n        bytes[bytesOffest++] = sample.flags.degradationPriority & 0xF0 << 8;\n        bytes[bytesOffest++] = sample.flags.degradationPriority & 0x0F; // sample_flags\n\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.compositionTimeOffset & 0xFF; // sample_composition_time_offset\n      }\n\n      return box(types.trun, bytes);\n    };\n\n    audioTrun = function audioTrun(track, offset) {\n      var bytes, bytesOffest, header, samples, sample, i;\n      samples = track.samples || [];\n      offset += 8 + 12 + 8 * samples.length;\n      header = trunHeader(samples, offset);\n      bytes = new Uint8Array(header.length + samples.length * 8);\n      bytes.set(header);\n      bytesOffest = header.length;\n\n      for (i = 0; i < samples.length; i++) {\n        sample = samples[i];\n        bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n        bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n      }\n\n      return box(types.trun, bytes);\n    };\n\n    trun$1 = function trun(track, offset) {\n      if (track.type === 'audio') {\n        return audioTrun(track, offset);\n      }\n\n      return videoTrun(track, offset);\n    };\n  })();\n\n  var mp4Generator = {\n    ftyp: ftyp,\n    mdat: mdat,\n    moof: moof,\n    moov: moov,\n    initSegment: function initSegment(tracks) {\n      var fileType = ftyp(),\n          movie = moov(tracks),\n          result;\n      result = new Uint8Array(fileType.byteLength + movie.byteLength);\n      result.set(fileType);\n      result.set(movie, fileType.byteLength);\n      return result;\n    }\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n  // Convert an array of nal units into an array of frames with each frame being\n  // composed of the nal units that make up that frame\n  // Also keep track of cummulative data about the frame from the nal units such\n  // as the frame duration, starting pts, etc.\n\n  var groupNalsIntoFrames = function groupNalsIntoFrames(nalUnits) {\n    var i,\n        currentNal,\n        currentFrame = [],\n        frames = []; // TODO added for LHLS, make sure this is OK\n\n    frames.byteLength = 0;\n    frames.nalCount = 0;\n    frames.duration = 0;\n    currentFrame.byteLength = 0;\n\n    for (i = 0; i < nalUnits.length; i++) {\n      currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n      if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n        // Since the very first nal unit is expected to be an AUD\n        // only push to the frames array when currentFrame is not empty\n        if (currentFrame.length) {\n          currentFrame.duration = currentNal.dts - currentFrame.dts; // TODO added for LHLS, make sure this is OK\n\n          frames.byteLength += currentFrame.byteLength;\n          frames.nalCount += currentFrame.length;\n          frames.duration += currentFrame.duration;\n          frames.push(currentFrame);\n        }\n\n        currentFrame = [currentNal];\n        currentFrame.byteLength = currentNal.data.byteLength;\n        currentFrame.pts = currentNal.pts;\n        currentFrame.dts = currentNal.dts;\n      } else {\n        // Specifically flag key frames for ease of use later\n        if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n          currentFrame.keyFrame = true;\n        }\n\n        currentFrame.duration = currentNal.dts - currentFrame.dts;\n        currentFrame.byteLength += currentNal.data.byteLength;\n        currentFrame.push(currentNal);\n      }\n    } // For the last frame, use the duration of the previous frame if we\n    // have nothing better to go on\n\n\n    if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n      currentFrame.duration = frames[frames.length - 1].duration;\n    } // Push the final frame\n    // TODO added for LHLS, make sure this is OK\n\n\n    frames.byteLength += currentFrame.byteLength;\n    frames.nalCount += currentFrame.length;\n    frames.duration += currentFrame.duration;\n    frames.push(currentFrame);\n    return frames;\n  }; // Convert an array of frames into an array of Gop with each Gop being composed\n  // of the frames that make up that Gop\n  // Also keep track of cummulative data about the Gop from the frames such as the\n  // Gop duration, starting pts, etc.\n\n\n  var groupFramesIntoGops = function groupFramesIntoGops(frames) {\n    var i,\n        currentFrame,\n        currentGop = [],\n        gops = []; // We must pre-set some of the values on the Gop since we\n    // keep running totals of these values\n\n    currentGop.byteLength = 0;\n    currentGop.nalCount = 0;\n    currentGop.duration = 0;\n    currentGop.pts = frames[0].pts;\n    currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n    gops.byteLength = 0;\n    gops.nalCount = 0;\n    gops.duration = 0;\n    gops.pts = frames[0].pts;\n    gops.dts = frames[0].dts;\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n\n      if (currentFrame.keyFrame) {\n        // Since the very first frame is expected to be an keyframe\n        // only push to the gops array when currentGop is not empty\n        if (currentGop.length) {\n          gops.push(currentGop);\n          gops.byteLength += currentGop.byteLength;\n          gops.nalCount += currentGop.nalCount;\n          gops.duration += currentGop.duration;\n        }\n\n        currentGop = [currentFrame];\n        currentGop.nalCount = currentFrame.length;\n        currentGop.byteLength = currentFrame.byteLength;\n        currentGop.pts = currentFrame.pts;\n        currentGop.dts = currentFrame.dts;\n        currentGop.duration = currentFrame.duration;\n      } else {\n        currentGop.duration += currentFrame.duration;\n        currentGop.nalCount += currentFrame.length;\n        currentGop.byteLength += currentFrame.byteLength;\n        currentGop.push(currentFrame);\n      }\n    }\n\n    if (gops.length && currentGop.duration <= 0) {\n      currentGop.duration = gops[gops.length - 1].duration;\n    }\n\n    gops.byteLength += currentGop.byteLength;\n    gops.nalCount += currentGop.nalCount;\n    gops.duration += currentGop.duration; // push the final Gop\n\n    gops.push(currentGop);\n    return gops;\n  };\n  /*\n   * Search for the first keyframe in the GOPs and throw away all frames\n   * until that keyframe. Then extend the duration of the pulled keyframe\n   * and pull the PTS and DTS of the keyframe so that it covers the time\n   * range of the frames that were disposed.\n   *\n   * @param {Array} gops video GOPs\n   * @returns {Array} modified video GOPs\n   */\n\n\n  var extendFirstKeyFrame = function extendFirstKeyFrame(gops) {\n    var currentGop;\n\n    if (!gops[0][0].keyFrame && gops.length > 1) {\n      // Remove the first GOP\n      currentGop = gops.shift();\n      gops.byteLength -= currentGop.byteLength;\n      gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n      // first gop to cover the time period of the\n      // frames we just removed\n\n      gops[0][0].dts = currentGop.dts;\n      gops[0][0].pts = currentGop.pts;\n      gops[0][0].duration += currentGop.duration;\n    }\n\n    return gops;\n  };\n  /**\n   * Default sample object\n   * see ISO/IEC 14496-12:2012, section 8.6.4.3\n   */\n\n\n  var createDefaultSample = function createDefaultSample() {\n    return {\n      size: 0,\n      flags: {\n        isLeading: 0,\n        dependsOn: 1,\n        isDependedOn: 0,\n        hasRedundancy: 0,\n        degradationPriority: 0,\n        isNonSyncSample: 1\n      }\n    };\n  };\n  /*\n   * Collates information from a video frame into an object for eventual\n   * entry into an MP4 sample table.\n   *\n   * @param {Object} frame the video frame\n   * @param {Number} dataOffset the byte offset to position the sample\n   * @return {Object} object containing sample table info for a frame\n   */\n\n\n  var sampleForFrame = function sampleForFrame(frame, dataOffset) {\n    var sample = createDefaultSample();\n    sample.dataOffset = dataOffset;\n    sample.compositionTimeOffset = frame.pts - frame.dts;\n    sample.duration = frame.duration;\n    sample.size = 4 * frame.length; // Space for nal unit size\n\n    sample.size += frame.byteLength;\n\n    if (frame.keyFrame) {\n      sample.flags.dependsOn = 2;\n      sample.flags.isNonSyncSample = 0;\n    }\n\n    return sample;\n  }; // generate the track's sample table from an array of gops\n\n\n  var generateSampleTable$1 = function generateSampleTable(gops, baseDataOffset) {\n    var h,\n        i,\n        sample,\n        currentGop,\n        currentFrame,\n        dataOffset = baseDataOffset || 0,\n        samples = [];\n\n    for (h = 0; h < gops.length; h++) {\n      currentGop = gops[h];\n\n      for (i = 0; i < currentGop.length; i++) {\n        currentFrame = currentGop[i];\n        sample = sampleForFrame(currentFrame, dataOffset);\n        dataOffset += sample.size;\n        samples.push(sample);\n      }\n    }\n\n    return samples;\n  }; // generate the track's raw mdat data from an array of gops\n\n\n  var concatenateNalData = function concatenateNalData(gops) {\n    var h,\n        i,\n        j,\n        currentGop,\n        currentFrame,\n        currentNal,\n        dataOffset = 0,\n        nalsByteLength = gops.byteLength,\n        numberOfNals = gops.nalCount,\n        totalByteLength = nalsByteLength + 4 * numberOfNals,\n        data = new Uint8Array(totalByteLength),\n        view = new DataView(data.buffer); // For each Gop..\n\n    for (h = 0; h < gops.length; h++) {\n      currentGop = gops[h]; // For each Frame..\n\n      for (i = 0; i < currentGop.length; i++) {\n        currentFrame = currentGop[i]; // For each NAL..\n\n        for (j = 0; j < currentFrame.length; j++) {\n          currentNal = currentFrame[j];\n          view.setUint32(dataOffset, currentNal.data.byteLength);\n          dataOffset += 4;\n          data.set(currentNal.data, dataOffset);\n          dataOffset += currentNal.data.byteLength;\n        }\n      }\n    }\n\n    return data;\n  }; // generate the track's sample table from a frame\n\n\n  var generateSampleTableForFrame = function generateSampleTableForFrame(frame, baseDataOffset) {\n    var sample,\n        dataOffset = baseDataOffset || 0,\n        samples = [];\n    sample = sampleForFrame(frame, dataOffset);\n    samples.push(sample);\n    return samples;\n  }; // generate the track's raw mdat data from a frame\n\n\n  var concatenateNalDataForFrame = function concatenateNalDataForFrame(frame) {\n    var i,\n        currentNal,\n        dataOffset = 0,\n        nalsByteLength = frame.byteLength,\n        numberOfNals = frame.length,\n        totalByteLength = nalsByteLength + 4 * numberOfNals,\n        data = new Uint8Array(totalByteLength),\n        view = new DataView(data.buffer); // For each NAL..\n\n    for (i = 0; i < frame.length; i++) {\n      currentNal = frame[i];\n      view.setUint32(dataOffset, currentNal.data.byteLength);\n      dataOffset += 4;\n      data.set(currentNal.data, dataOffset);\n      dataOffset += currentNal.data.byteLength;\n    }\n\n    return data;\n  };\n\n  var frameUtils = {\n    groupNalsIntoFrames: groupNalsIntoFrames,\n    groupFramesIntoGops: groupFramesIntoGops,\n    extendFirstKeyFrame: extendFirstKeyFrame,\n    generateSampleTable: generateSampleTable$1,\n    concatenateNalData: concatenateNalData,\n    generateSampleTableForFrame: generateSampleTableForFrame,\n    concatenateNalDataForFrame: concatenateNalDataForFrame\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var highPrefix = [33, 16, 5, 32, 164, 27];\n  var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n\n  var zeroFill = function zeroFill(count) {\n    var a = [];\n\n    while (count--) {\n      a.push(0);\n    }\n\n    return a;\n  };\n\n  var makeTable = function makeTable(metaTable) {\n    return Object.keys(metaTable).reduce(function (obj, key) {\n      obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n        return arr.concat(part);\n      }, []));\n      return obj;\n    }, {});\n  };\n\n  var silence;\n\n  var silence_1 = function silence_1() {\n    if (!silence) {\n      // Frames-of-silence to use for filling in missing AAC frames\n      var coneOfSilence = {\n        96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n        88200: [highPrefix, [231], zeroFill(170), [56]],\n        64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n        48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n        44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n        32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n        24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n        16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n        12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n        11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n        8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n      };\n      silence = makeTable(coneOfSilence);\n    }\n\n    return silence;\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n\n  var ONE_SECOND_IN_TS$4 = 90000,\n      // 90kHz clock\n  secondsToVideoTs,\n      secondsToAudioTs,\n      videoTsToSeconds,\n      audioTsToSeconds,\n      audioTsToVideoTs,\n      videoTsToAudioTs,\n      metadataTsToSeconds;\n\n  secondsToVideoTs = function secondsToVideoTs(seconds) {\n    return seconds * ONE_SECOND_IN_TS$4;\n  };\n\n  secondsToAudioTs = function secondsToAudioTs(seconds, sampleRate) {\n    return seconds * sampleRate;\n  };\n\n  videoTsToSeconds = function videoTsToSeconds(timestamp) {\n    return timestamp / ONE_SECOND_IN_TS$4;\n  };\n\n  audioTsToSeconds = function audioTsToSeconds(timestamp, sampleRate) {\n    return timestamp / sampleRate;\n  };\n\n  audioTsToVideoTs = function audioTsToVideoTs(timestamp, sampleRate) {\n    return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n  };\n\n  videoTsToAudioTs = function videoTsToAudioTs(timestamp, sampleRate) {\n    return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n  };\n  /**\n   * Adjust ID3 tag or caption timing information by the timeline pts values\n   * (if keepOriginalTimestamps is false) and convert to seconds\n   */\n\n\n  metadataTsToSeconds = function metadataTsToSeconds(timestamp, timelineStartPts, keepOriginalTimestamps) {\n    return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n  };\n\n  var clock = {\n    ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,\n    secondsToVideoTs: secondsToVideoTs,\n    secondsToAudioTs: secondsToAudioTs,\n    videoTsToSeconds: videoTsToSeconds,\n    audioTsToSeconds: audioTsToSeconds,\n    audioTsToVideoTs: audioTsToVideoTs,\n    videoTsToAudioTs: videoTsToAudioTs,\n    metadataTsToSeconds: metadataTsToSeconds\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  /**\n   * Sum the `byteLength` properties of the data in each AAC frame\n   */\n\n  var sumFrameByteLengths = function sumFrameByteLengths(array) {\n    var i,\n        currentObj,\n        sum = 0; // sum the byteLength's all each nal unit in the frame\n\n    for (i = 0; i < array.length; i++) {\n      currentObj = array[i];\n      sum += currentObj.data.byteLength;\n    }\n\n    return sum;\n  }; // Possibly pad (prefix) the audio track with silence if appending this track\n  // would lead to the introduction of a gap in the audio buffer\n\n\n  var prefixWithSilence = function prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n    var baseMediaDecodeTimeTs,\n        frameDuration = 0,\n        audioGapDuration = 0,\n        audioFillFrameCount = 0,\n        audioFillDuration = 0,\n        silentFrame,\n        i,\n        firstFrame;\n\n    if (!frames.length) {\n      return;\n    }\n\n    baseMediaDecodeTimeTs = clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n    frameDuration = Math.ceil(clock.ONE_SECOND_IN_TS / (track.samplerate / 1024));\n\n    if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n      // insert the shortest possible amount (audio gap or audio to video gap)\n      audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n      audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n      audioFillDuration = audioFillFrameCount * frameDuration;\n    } // don't attempt to fill gaps smaller than a single frame or larger\n    // than a half second\n\n\n    if (audioFillFrameCount < 1 || audioFillDuration > clock.ONE_SECOND_IN_TS / 2) {\n      return;\n    }\n\n    silentFrame = silence_1()[track.samplerate];\n\n    if (!silentFrame) {\n      // we don't have a silent frame pregenerated for the sample rate, so use a frame\n      // from the content instead\n      silentFrame = frames[0].data;\n    }\n\n    for (i = 0; i < audioFillFrameCount; i++) {\n      firstFrame = frames[0];\n      frames.splice(0, 0, {\n        data: silentFrame,\n        dts: firstFrame.dts - frameDuration,\n        pts: firstFrame.pts - frameDuration\n      });\n    }\n\n    track.baseMediaDecodeTime -= Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n    return audioFillDuration;\n  }; // If the audio segment extends before the earliest allowed dts\n  // value, remove AAC frames until starts at or after the earliest\n  // allowed DTS so that we don't end up with a negative baseMedia-\n  // DecodeTime for the audio track\n\n\n  var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts) {\n    if (track.minSegmentDts >= earliestAllowedDts) {\n      return adtsFrames;\n    } // We will need to recalculate the earliest segment Dts\n\n\n    track.minSegmentDts = Infinity;\n    return adtsFrames.filter(function (currentFrame) {\n      // If this is an allowed frame, keep it and record it's Dts\n      if (currentFrame.dts >= earliestAllowedDts) {\n        track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n        track.minSegmentPts = track.minSegmentDts;\n        return true;\n      } // Otherwise, discard it\n\n\n      return false;\n    });\n  }; // generate the track's raw mdat data from an array of frames\n\n\n  var generateSampleTable = function generateSampleTable(frames) {\n    var i,\n        currentFrame,\n        samples = [];\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n      samples.push({\n        size: currentFrame.data.byteLength,\n        duration: 1024 // For AAC audio, all samples contain 1024 samples\n\n      });\n    }\n\n    return samples;\n  }; // generate the track's sample table from an array of frames\n\n\n  var concatenateFrameData = function concatenateFrameData(frames) {\n    var i,\n        currentFrame,\n        dataOffset = 0,\n        data = new Uint8Array(sumFrameByteLengths(frames));\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n      data.set(currentFrame.data, dataOffset);\n      dataOffset += currentFrame.data.byteLength;\n    }\n\n    return data;\n  };\n\n  var audioFrameUtils = {\n    prefixWithSilence: prefixWithSilence,\n    trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n    generateSampleTable: generateSampleTable,\n    concatenateFrameData: concatenateFrameData\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var ONE_SECOND_IN_TS$3 = clock.ONE_SECOND_IN_TS;\n  /**\n   * Store information about the start and end of the track and the\n   * duration for each frame/sample we process in order to calculate\n   * the baseMediaDecodeTime\n   */\n\n  var collectDtsInfo = function collectDtsInfo(track, data) {\n    if (typeof data.pts === 'number') {\n      if (track.timelineStartInfo.pts === undefined) {\n        track.timelineStartInfo.pts = data.pts;\n      }\n\n      if (track.minSegmentPts === undefined) {\n        track.minSegmentPts = data.pts;\n      } else {\n        track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n      }\n\n      if (track.maxSegmentPts === undefined) {\n        track.maxSegmentPts = data.pts;\n      } else {\n        track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n      }\n    }\n\n    if (typeof data.dts === 'number') {\n      if (track.timelineStartInfo.dts === undefined) {\n        track.timelineStartInfo.dts = data.dts;\n      }\n\n      if (track.minSegmentDts === undefined) {\n        track.minSegmentDts = data.dts;\n      } else {\n        track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n      }\n\n      if (track.maxSegmentDts === undefined) {\n        track.maxSegmentDts = data.dts;\n      } else {\n        track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n      }\n    }\n  };\n  /**\n   * Clear values used to calculate the baseMediaDecodeTime between\n   * tracks\n   */\n\n\n  var clearDtsInfo = function clearDtsInfo(track) {\n    delete track.minSegmentDts;\n    delete track.maxSegmentDts;\n    delete track.minSegmentPts;\n    delete track.maxSegmentPts;\n  };\n  /**\n   * Calculate the track's baseMediaDecodeTime based on the earliest\n   * DTS the transmuxer has ever seen and the minimum DTS for the\n   * current track\n   * @param track {object} track metadata configuration\n   * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n\n  var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime(track, keepOriginalTimestamps) {\n    var baseMediaDecodeTime,\n        scale,\n        minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n    if (!keepOriginalTimestamps) {\n      minSegmentDts -= track.timelineStartInfo.dts;\n    } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n    // we want the start of the first segment to be placed\n\n\n    baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n    baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n    baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n    if (track.type === 'audio') {\n      // Audio has a different clock equal to the sampling_rate so we need to\n      // scale the PTS values into the clock rate of the track\n      scale = track.samplerate / ONE_SECOND_IN_TS$3;\n      baseMediaDecodeTime *= scale;\n      baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n    }\n\n    return baseMediaDecodeTime;\n  };\n\n  var trackDecodeInfo = {\n    clearDtsInfo: clearDtsInfo,\n    calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n    collectDtsInfo: collectDtsInfo\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Reads in-band caption information from a video elementary\n   * stream. Captions must follow the CEA-708 standard for injection\n   * into an MPEG-2 transport streams.\n   * @see https://en.wikipedia.org/wiki/CEA-708\n   * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n   */\n  // payload type field to indicate how they are to be\n  // interpreted. CEAS-708 caption content is always transmitted with\n  // payload type 0x04.\n\n  var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n      RBSP_TRAILING_BITS = 128;\n  /**\n    * Parse a supplemental enhancement information (SEI) NAL unit.\n    * Stops parsing once a message of type ITU T T35 has been found.\n    *\n    * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n    * @return {object} the parsed SEI payload\n    * @see Rec. ITU-T H.264, 7.3.2.3.1\n    */\n\n  var parseSei = function parseSei(bytes) {\n    var i = 0,\n        result = {\n      payloadType: -1,\n      payloadSize: 0\n    },\n        payloadType = 0,\n        payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n    while (i < bytes.byteLength) {\n      // stop once we have hit the end of the sei_rbsp\n      if (bytes[i] === RBSP_TRAILING_BITS) {\n        break;\n      } // Parse payload type\n\n\n      while (bytes[i] === 0xFF) {\n        payloadType += 255;\n        i++;\n      }\n\n      payloadType += bytes[i++]; // Parse payload size\n\n      while (bytes[i] === 0xFF) {\n        payloadSize += 255;\n        i++;\n      }\n\n      payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n      // there can only ever be one caption message in a frame's sei\n\n      if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n        var userIdentifier = String.fromCharCode(bytes[i + 3], bytes[i + 4], bytes[i + 5], bytes[i + 6]);\n\n        if (userIdentifier === 'GA94') {\n          result.payloadType = payloadType;\n          result.payloadSize = payloadSize;\n          result.payload = bytes.subarray(i, i + payloadSize);\n          break;\n        } else {\n          result.payload = void 0;\n        }\n      } // skip the payload and parse the next message\n\n\n      i += payloadSize;\n      payloadType = 0;\n      payloadSize = 0;\n    }\n\n    return result;\n  }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n\n  var parseUserData = function parseUserData(sei) {\n    // itu_t_t35_contry_code must be 181 (United States) for\n    // captions\n    if (sei.payload[0] !== 181) {\n      return null;\n    } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n\n    if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n      return null;\n    } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n\n    if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n      return null;\n    } // finally, user_data_type_code should be 0x03 for caption data\n\n\n    if (sei.payload[7] !== 0x03) {\n      return null;\n    } // return the user_data_type_structure and strip the trailing\n    // marker bits\n\n\n    return sei.payload.subarray(8, sei.payload.length - 1);\n  }; // see CEA-708-D, section 4.4\n\n\n  var parseCaptionPackets = function parseCaptionPackets(pts, userData) {\n    var results = [],\n        i,\n        count,\n        offset,\n        data; // if this is just filler, return immediately\n\n    if (!(userData[0] & 0x40)) {\n      return results;\n    } // parse out the cc_data_1 and cc_data_2 fields\n\n\n    count = userData[0] & 0x1f;\n\n    for (i = 0; i < count; i++) {\n      offset = i * 3;\n      data = {\n        type: userData[offset + 2] & 0x03,\n        pts: pts\n      }; // capture cc data when cc_valid is 1\n\n      if (userData[offset + 2] & 0x04) {\n        data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n        results.push(data);\n      }\n    }\n\n    return results;\n  };\n\n  var discardEmulationPreventionBytes$1 = function discardEmulationPreventionBytes(data) {\n    var length = data.byteLength,\n        emulationPreventionBytesPositions = [],\n        i = 1,\n        newLength,\n        newData; // Find all `Emulation Prevention Bytes`\n\n    while (i < length - 2) {\n      if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n        emulationPreventionBytesPositions.push(i + 2);\n        i += 2;\n      } else {\n        i++;\n      }\n    } // If no Emulation Prevention Bytes were found just return the original\n    // array\n\n\n    if (emulationPreventionBytesPositions.length === 0) {\n      return data;\n    } // Create a new array to hold the NAL unit data\n\n\n    newLength = length - emulationPreventionBytesPositions.length;\n    newData = new Uint8Array(newLength);\n    var sourceIndex = 0;\n\n    for (i = 0; i < newLength; sourceIndex++, i++) {\n      if (sourceIndex === emulationPreventionBytesPositions[0]) {\n        // Skip this byte\n        sourceIndex++; // Remove this position index\n\n        emulationPreventionBytesPositions.shift();\n      }\n\n      newData[i] = data[sourceIndex];\n    }\n\n    return newData;\n  }; // exports\n\n\n  var captionPacketParser = {\n    parseSei: parseSei,\n    parseUserData: parseUserData,\n    parseCaptionPackets: parseCaptionPackets,\n    discardEmulationPreventionBytes: discardEmulationPreventionBytes$1,\n    USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n  }; // Link To Transport\n  // -----------------\n\n  var CaptionStream$1 = function CaptionStream(options) {\n    options = options || {};\n    CaptionStream.prototype.init.call(this); // parse708captions flag, default to true\n\n    this.parse708captions_ = typeof options.parse708captions === 'boolean' ? options.parse708captions : true;\n    this.captionPackets_ = [];\n    this.ccStreams_ = [new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n    new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n    new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n    new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n    ];\n\n    if (this.parse708captions_) {\n      this.cc708Stream_ = new Cea708Stream({\n        captionServices: options.captionServices\n      }); // eslint-disable-line no-use-before-define\n    }\n\n    this.reset(); // forward data and done events from CCs to this CaptionStream\n\n    this.ccStreams_.forEach(function (cc) {\n      cc.on('data', this.trigger.bind(this, 'data'));\n      cc.on('partialdone', this.trigger.bind(this, 'partialdone'));\n      cc.on('done', this.trigger.bind(this, 'done'));\n    }, this);\n\n    if (this.parse708captions_) {\n      this.cc708Stream_.on('data', this.trigger.bind(this, 'data'));\n      this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone'));\n      this.cc708Stream_.on('done', this.trigger.bind(this, 'done'));\n    }\n  };\n\n  CaptionStream$1.prototype = new stream();\n\n  CaptionStream$1.prototype.push = function (event) {\n    var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n    if (event.nalUnitType !== 'sei_rbsp') {\n      return;\n    } // parse the sei\n\n\n    sei = captionPacketParser.parseSei(event.escapedRBSP); // no payload data, skip\n\n    if (!sei.payload) {\n      return;\n    } // ignore everything but user_data_registered_itu_t_t35\n\n\n    if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {\n      return;\n    } // parse out the user data payload\n\n\n    userData = captionPacketParser.parseUserData(sei); // ignore unrecognized userData\n\n    if (!userData) {\n      return;\n    } // Sometimes, the same segment # will be downloaded twice. To stop the\n    // caption data from being processed twice, we track the latest dts we've\n    // received and ignore everything with a dts before that. However, since\n    // data for a specific dts can be split across packets on either side of\n    // a segment boundary, we need to make sure we *don't* ignore the packets\n    // from the *next* segment that have dts === this.latestDts_. By constantly\n    // tracking the number of packets received with dts === this.latestDts_, we\n    // know how many should be ignored once we start receiving duplicates.\n\n\n    if (event.dts < this.latestDts_) {\n      // We've started getting older data, so set the flag.\n      this.ignoreNextEqualDts_ = true;\n      return;\n    } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n      this.numSameDts_--;\n\n      if (!this.numSameDts_) {\n        // We've received the last duplicate packet, time to start processing again\n        this.ignoreNextEqualDts_ = false;\n      }\n\n      return;\n    } // parse out CC data packets and save them for later\n\n\n    newCaptionPackets = captionPacketParser.parseCaptionPackets(event.pts, userData);\n    this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n\n    if (this.latestDts_ !== event.dts) {\n      this.numSameDts_ = 0;\n    }\n\n    this.numSameDts_++;\n    this.latestDts_ = event.dts;\n  };\n\n  CaptionStream$1.prototype.flushCCStreams = function (flushType) {\n    this.ccStreams_.forEach(function (cc) {\n      return flushType === 'flush' ? cc.flush() : cc.partialFlush();\n    }, this);\n  };\n\n  CaptionStream$1.prototype.flushStream = function (flushType) {\n    // make sure we actually parsed captions before proceeding\n    if (!this.captionPackets_.length) {\n      this.flushCCStreams(flushType);\n      return;\n    } // In Chrome, the Array#sort function is not stable so add a\n    // presortIndex that we can use to ensure we get a stable-sort\n\n\n    this.captionPackets_.forEach(function (elem, idx) {\n      elem.presortIndex = idx;\n    }); // sort caption byte-pairs based on their PTS values\n\n    this.captionPackets_.sort(function (a, b) {\n      if (a.pts === b.pts) {\n        return a.presortIndex - b.presortIndex;\n      }\n\n      return a.pts - b.pts;\n    });\n    this.captionPackets_.forEach(function (packet) {\n      if (packet.type < 2) {\n        // Dispatch packet to the right Cea608Stream\n        this.dispatchCea608Packet(packet);\n      } else {\n        // Dispatch packet to the Cea708Stream\n        this.dispatchCea708Packet(packet);\n      }\n    }, this);\n    this.captionPackets_.length = 0;\n    this.flushCCStreams(flushType);\n  };\n\n  CaptionStream$1.prototype.flush = function () {\n    return this.flushStream('flush');\n  }; // Only called if handling partial data\n\n\n  CaptionStream$1.prototype.partialFlush = function () {\n    return this.flushStream('partialFlush');\n  };\n\n  CaptionStream$1.prototype.reset = function () {\n    this.latestDts_ = null;\n    this.ignoreNextEqualDts_ = false;\n    this.numSameDts_ = 0;\n    this.activeCea608Channel_ = [null, null];\n    this.ccStreams_.forEach(function (ccStream) {\n      ccStream.reset();\n    });\n  }; // From the CEA-608 spec:\n\n  /*\n   * When XDS sub-packets are interleaved with other services, the end of each sub-packet shall be followed\n   * by a control pair to change to a different service. When any of the control codes from 0x10 to 0x1F is\n   * used to begin a control code pair, it indicates the return to captioning or Text data. The control code pair\n   * and subsequent data should then be processed according to the FCC rules. It may be necessary for the\n   * line 21 data encoder to automatically insert a control code pair (i.e. RCL, RU2, RU3, RU4, RDC, or RTD)\n   * to switch to captioning or Text.\n  */\n  // With that in mind, we ignore any data between an XDS control code and a\n  // subsequent closed-captioning control code.\n\n\n  CaptionStream$1.prototype.dispatchCea608Packet = function (packet) {\n    // NOTE: packet.type is the CEA608 field\n    if (this.setsTextOrXDSActive(packet)) {\n      this.activeCea608Channel_[packet.type] = null;\n    } else if (this.setsChannel1Active(packet)) {\n      this.activeCea608Channel_[packet.type] = 0;\n    } else if (this.setsChannel2Active(packet)) {\n      this.activeCea608Channel_[packet.type] = 1;\n    }\n\n    if (this.activeCea608Channel_[packet.type] === null) {\n      // If we haven't received anything to set the active channel, or the\n      // packets are Text/XDS data, discard the data; we don't want jumbled\n      // captions\n      return;\n    }\n\n    this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n  };\n\n  CaptionStream$1.prototype.setsChannel1Active = function (packet) {\n    return (packet.ccData & 0x7800) === 0x1000;\n  };\n\n  CaptionStream$1.prototype.setsChannel2Active = function (packet) {\n    return (packet.ccData & 0x7800) === 0x1800;\n  };\n\n  CaptionStream$1.prototype.setsTextOrXDSActive = function (packet) {\n    return (packet.ccData & 0x7100) === 0x0100 || (packet.ccData & 0x78fe) === 0x102a || (packet.ccData & 0x78fe) === 0x182a;\n  };\n\n  CaptionStream$1.prototype.dispatchCea708Packet = function (packet) {\n    if (this.parse708captions_) {\n      this.cc708Stream_.push(packet);\n    }\n  }; // ----------------------\n  // Session to Application\n  // ----------------------\n  // This hash maps special and extended character codes to their\n  // proper Unicode equivalent. The first one-byte key is just a\n  // non-standard character code. The two-byte keys that follow are\n  // the extended CEA708 character codes, along with the preceding\n  // 0x10 extended character byte to distinguish these codes from\n  // non-extended character codes. Every CEA708 character code that\n  // is not in this object maps directly to a standard unicode\n  // character code.\n  // The transparent space and non-breaking transparent space are\n  // technically not fully supported since there is no code to\n  // make them transparent, so they have normal non-transparent\n  // stand-ins.\n  // The special closed caption (CC) character isn't a standard\n  // unicode character, so a fairly similar unicode character was\n  // chosen in it's place.\n\n\n  var CHARACTER_TRANSLATION_708 = {\n    0x7f: 0x266a,\n    // ♪\n    0x1020: 0x20,\n    // Transparent Space\n    0x1021: 0xa0,\n    // Nob-breaking Transparent Space\n    0x1025: 0x2026,\n    // …\n    0x102a: 0x0160,\n    // Š\n    0x102c: 0x0152,\n    // Œ\n    0x1030: 0x2588,\n    // █\n    0x1031: 0x2018,\n    // ‘\n    0x1032: 0x2019,\n    // ’\n    0x1033: 0x201c,\n    // “\n    0x1034: 0x201d,\n    // ”\n    0x1035: 0x2022,\n    // •\n    0x1039: 0x2122,\n    // ™\n    0x103a: 0x0161,\n    // š\n    0x103c: 0x0153,\n    // œ\n    0x103d: 0x2120,\n    // ℠\n    0x103f: 0x0178,\n    // Ÿ\n    0x1076: 0x215b,\n    // ⅛\n    0x1077: 0x215c,\n    // ⅜\n    0x1078: 0x215d,\n    // ⅝\n    0x1079: 0x215e,\n    // ⅞\n    0x107a: 0x23d0,\n    // ⏐\n    0x107b: 0x23a4,\n    // ⎤\n    0x107c: 0x23a3,\n    // ⎣\n    0x107d: 0x23af,\n    // ⎯\n    0x107e: 0x23a6,\n    // ⎦\n    0x107f: 0x23a1,\n    // ⎡\n    0x10a0: 0x3138 // ㄸ (CC char)\n\n  };\n\n  var get708CharFromCode = function get708CharFromCode(code) {\n    var newCode = CHARACTER_TRANSLATION_708[code] || code;\n\n    if (code & 0x1000 && code === newCode) {\n      // Invalid extended code\n      return '';\n    }\n\n    return String.fromCharCode(newCode);\n  };\n\n  var within708TextBlock = function within708TextBlock(b) {\n    return 0x20 <= b && b <= 0x7f || 0xa0 <= b && b <= 0xff;\n  };\n\n  var Cea708Window = function Cea708Window(windowNum) {\n    this.windowNum = windowNum;\n    this.reset();\n  };\n\n  Cea708Window.prototype.reset = function () {\n    this.clearText();\n    this.pendingNewLine = false;\n    this.winAttr = {};\n    this.penAttr = {};\n    this.penLoc = {};\n    this.penColor = {}; // These default values are arbitrary,\n    // defineWindow will usually override them\n\n    this.visible = 0;\n    this.rowLock = 0;\n    this.columnLock = 0;\n    this.priority = 0;\n    this.relativePositioning = 0;\n    this.anchorVertical = 0;\n    this.anchorHorizontal = 0;\n    this.anchorPoint = 0;\n    this.rowCount = 1;\n    this.virtualRowCount = this.rowCount + 1;\n    this.columnCount = 41;\n    this.windowStyle = 0;\n    this.penStyle = 0;\n  };\n\n  Cea708Window.prototype.getText = function () {\n    return this.rows.join('\\n');\n  };\n\n  Cea708Window.prototype.clearText = function () {\n    this.rows = [''];\n    this.rowIdx = 0;\n  };\n\n  Cea708Window.prototype.newLine = function (pts) {\n    if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === 'function') {\n      this.beforeRowOverflow(pts);\n    }\n\n    if (this.rows.length > 0) {\n      this.rows.push('');\n      this.rowIdx++;\n    } // Show all virtual rows since there's no visible scrolling\n\n\n    while (this.rows.length > this.virtualRowCount) {\n      this.rows.shift();\n      this.rowIdx--;\n    }\n  };\n\n  Cea708Window.prototype.isEmpty = function () {\n    if (this.rows.length === 0) {\n      return true;\n    } else if (this.rows.length === 1) {\n      return this.rows[0] === '';\n    }\n\n    return false;\n  };\n\n  Cea708Window.prototype.addText = function (text) {\n    this.rows[this.rowIdx] += text;\n  };\n\n  Cea708Window.prototype.backspace = function () {\n    if (!this.isEmpty()) {\n      var row = this.rows[this.rowIdx];\n      this.rows[this.rowIdx] = row.substr(0, row.length - 1);\n    }\n  };\n\n  var Cea708Service = function Cea708Service(serviceNum, encoding, stream) {\n    this.serviceNum = serviceNum;\n    this.text = '';\n    this.currentWindow = new Cea708Window(-1);\n    this.windows = [];\n    this.stream = stream; // Try to setup a TextDecoder if an `encoding` value was provided\n\n    if (typeof encoding === 'string') {\n      this.createTextDecoder(encoding);\n    }\n  };\n  /**\n   * Initialize service windows\n   * Must be run before service use\n   *\n   * @param  {Integer}  pts               PTS value\n   * @param  {Function} beforeRowOverflow Function to execute before row overflow of a window\n   */\n\n\n  Cea708Service.prototype.init = function (pts, beforeRowOverflow) {\n    this.startPts = pts;\n\n    for (var win = 0; win < 8; win++) {\n      this.windows[win] = new Cea708Window(win);\n\n      if (typeof beforeRowOverflow === 'function') {\n        this.windows[win].beforeRowOverflow = beforeRowOverflow;\n      }\n    }\n  };\n  /**\n   * Set current window of service to be affected by commands\n   *\n   * @param  {Integer} windowNum Window number\n   */\n\n\n  Cea708Service.prototype.setCurrentWindow = function (windowNum) {\n    this.currentWindow = this.windows[windowNum];\n  };\n  /**\n   * Try to create a TextDecoder if it is natively supported\n   */\n\n\n  Cea708Service.prototype.createTextDecoder = function (encoding) {\n    if (typeof TextDecoder === 'undefined') {\n      this.stream.trigger('log', {\n        level: 'warn',\n        message: 'The `encoding` option is unsupported without TextDecoder support'\n      });\n    } else {\n      try {\n        this.textDecoder_ = new TextDecoder(encoding);\n      } catch (error) {\n        this.stream.trigger('log', {\n          level: 'warn',\n          message: 'TextDecoder could not be created with ' + encoding + ' encoding. ' + error\n        });\n      }\n    }\n  };\n\n  var Cea708Stream = function Cea708Stream(options) {\n    options = options || {};\n    Cea708Stream.prototype.init.call(this);\n    var self = this;\n    var captionServices = options.captionServices || {};\n    var captionServiceEncodings = {};\n    var serviceProps; // Get service encodings from captionServices option block\n\n    Object.keys(captionServices).forEach(function (serviceName) {\n      serviceProps = captionServices[serviceName];\n\n      if (/^SERVICE/.test(serviceName)) {\n        captionServiceEncodings[serviceName] = serviceProps.encoding;\n      }\n    });\n    this.serviceEncodings = captionServiceEncodings;\n    this.current708Packet = null;\n    this.services = {};\n\n    this.push = function (packet) {\n      if (packet.type === 3) {\n        // 708 packet start\n        self.new708Packet();\n        self.add708Bytes(packet);\n      } else {\n        if (self.current708Packet === null) {\n          // This should only happen at the start of a file if there's no packet start.\n          self.new708Packet();\n        }\n\n        self.add708Bytes(packet);\n      }\n    };\n  };\n\n  Cea708Stream.prototype = new stream();\n  /**\n   * Push current 708 packet, create new 708 packet.\n   */\n\n  Cea708Stream.prototype.new708Packet = function () {\n    if (this.current708Packet !== null) {\n      this.push708Packet();\n    }\n\n    this.current708Packet = {\n      data: [],\n      ptsVals: []\n    };\n  };\n  /**\n   * Add pts and both bytes from packet into current 708 packet.\n   */\n\n\n  Cea708Stream.prototype.add708Bytes = function (packet) {\n    var data = packet.ccData;\n    var byte0 = data >>> 8;\n    var byte1 = data & 0xff; // I would just keep a list of packets instead of bytes, but it isn't clear in the spec\n    // that service blocks will always line up with byte pairs.\n\n    this.current708Packet.ptsVals.push(packet.pts);\n    this.current708Packet.data.push(byte0);\n    this.current708Packet.data.push(byte1);\n  };\n  /**\n   * Parse completed 708 packet into service blocks and push each service block.\n   */\n\n\n  Cea708Stream.prototype.push708Packet = function () {\n    var packet708 = this.current708Packet;\n    var packetData = packet708.data;\n    var serviceNum = null;\n    var blockSize = null;\n    var i = 0;\n    var b = packetData[i++];\n    packet708.seq = b >> 6;\n    packet708.sizeCode = b & 0x3f; // 0b00111111;\n\n    for (; i < packetData.length; i++) {\n      b = packetData[i++];\n      serviceNum = b >> 5;\n      blockSize = b & 0x1f; // 0b00011111\n\n      if (serviceNum === 7 && blockSize > 0) {\n        // Extended service num\n        b = packetData[i++];\n        serviceNum = b;\n      }\n\n      this.pushServiceBlock(serviceNum, i, blockSize);\n\n      if (blockSize > 0) {\n        i += blockSize - 1;\n      }\n    }\n  };\n  /**\n   * Parse service block, execute commands, read text.\n   *\n   * Note: While many of these commands serve important purposes,\n   * many others just parse out the parameters or attributes, but\n   * nothing is done with them because this is not a full and complete\n   * implementation of the entire 708 spec.\n   *\n   * @param  {Integer} serviceNum Service number\n   * @param  {Integer} start      Start index of the 708 packet data\n   * @param  {Integer} size       Block size\n   */\n\n\n  Cea708Stream.prototype.pushServiceBlock = function (serviceNum, start, size) {\n    var b;\n    var i = start;\n    var packetData = this.current708Packet.data;\n    var service = this.services[serviceNum];\n\n    if (!service) {\n      service = this.initService(serviceNum, i);\n    }\n\n    for (; i < start + size && i < packetData.length; i++) {\n      b = packetData[i];\n\n      if (within708TextBlock(b)) {\n        i = this.handleText(i, service);\n      } else if (b === 0x18) {\n        i = this.multiByteCharacter(i, service);\n      } else if (b === 0x10) {\n        i = this.extendedCommands(i, service);\n      } else if (0x80 <= b && b <= 0x87) {\n        i = this.setCurrentWindow(i, service);\n      } else if (0x98 <= b && b <= 0x9f) {\n        i = this.defineWindow(i, service);\n      } else if (b === 0x88) {\n        i = this.clearWindows(i, service);\n      } else if (b === 0x8c) {\n        i = this.deleteWindows(i, service);\n      } else if (b === 0x89) {\n        i = this.displayWindows(i, service);\n      } else if (b === 0x8a) {\n        i = this.hideWindows(i, service);\n      } else if (b === 0x8b) {\n        i = this.toggleWindows(i, service);\n      } else if (b === 0x97) {\n        i = this.setWindowAttributes(i, service);\n      } else if (b === 0x90) {\n        i = this.setPenAttributes(i, service);\n      } else if (b === 0x91) {\n        i = this.setPenColor(i, service);\n      } else if (b === 0x92) {\n        i = this.setPenLocation(i, service);\n      } else if (b === 0x8f) {\n        service = this.reset(i, service);\n      } else if (b === 0x08) {\n        // BS: Backspace\n        service.currentWindow.backspace();\n      } else if (b === 0x0c) {\n        // FF: Form feed\n        service.currentWindow.clearText();\n      } else if (b === 0x0d) {\n        // CR: Carriage return\n        service.currentWindow.pendingNewLine = true;\n      } else if (b === 0x0e) {\n        // HCR: Horizontal carriage return\n        service.currentWindow.clearText();\n      } else if (b === 0x8d) {\n        // DLY: Delay, nothing to do\n        i++;\n      } else ;\n    }\n  };\n  /**\n   * Execute an extended command\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.extendedCommands = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n\n    if (within708TextBlock(b)) {\n      i = this.handleText(i, service, {\n        isExtended: true\n      });\n    }\n\n    return i;\n  };\n  /**\n   * Get PTS value of a given byte index\n   *\n   * @param  {Integer} byteIndex  Index of the byte\n   * @return {Integer}            PTS\n   */\n\n\n  Cea708Stream.prototype.getPts = function (byteIndex) {\n    // There's 1 pts value per 2 bytes\n    return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];\n  };\n  /**\n   * Initializes a service\n   *\n   * @param  {Integer} serviceNum Service number\n   * @return {Service}            Initialized service object\n   */\n\n\n  Cea708Stream.prototype.initService = function (serviceNum, i) {\n    var serviceName = 'SERVICE' + serviceNum;\n    var self = this;\n    var serviceName;\n    var encoding;\n\n    if (serviceName in this.serviceEncodings) {\n      encoding = this.serviceEncodings[serviceName];\n    }\n\n    this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self);\n    this.services[serviceNum].init(this.getPts(i), function (pts) {\n      self.flushDisplayed(pts, self.services[serviceNum]);\n    });\n    return this.services[serviceNum];\n  };\n  /**\n   * Execute text writing to current window\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.handleText = function (i, service, options) {\n    var isExtended = options && options.isExtended;\n    var isMultiByte = options && options.isMultiByte;\n    var packetData = this.current708Packet.data;\n    var extended = isExtended ? 0x1000 : 0x0000;\n    var currentByte = packetData[i];\n    var nextByte = packetData[i + 1];\n    var win = service.currentWindow;\n\n    var _char;\n\n    var charCodeArray; // Use the TextDecoder if one was created for this service\n\n    if (service.textDecoder_ && !isExtended) {\n      if (isMultiByte) {\n        charCodeArray = [currentByte, nextByte];\n        i++;\n      } else {\n        charCodeArray = [currentByte];\n      }\n\n      _char = service.textDecoder_.decode(new Uint8Array(charCodeArray));\n    } else {\n      _char = get708CharFromCode(extended | currentByte);\n    }\n\n    if (win.pendingNewLine && !win.isEmpty()) {\n      win.newLine(this.getPts(i));\n    }\n\n    win.pendingNewLine = false;\n    win.addText(_char);\n    return i;\n  };\n  /**\n   * Handle decoding of multibyte character\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.multiByteCharacter = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var firstByte = packetData[i + 1];\n    var secondByte = packetData[i + 2];\n\n    if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {\n      i = this.handleText(++i, service, {\n        isMultiByte: true\n      });\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the CW# command.\n   *\n   * Set the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setCurrentWindow = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var windowNum = b & 0x07;\n    service.setCurrentWindow(windowNum);\n    return i;\n  };\n  /**\n   * Parse and execute the DF# command.\n   *\n   * Define a window and set it as the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.defineWindow = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var windowNum = b & 0x07;\n    service.setCurrentWindow(windowNum);\n    var win = service.currentWindow;\n    b = packetData[++i];\n    win.visible = (b & 0x20) >> 5; // v\n\n    win.rowLock = (b & 0x10) >> 4; // rl\n\n    win.columnLock = (b & 0x08) >> 3; // cl\n\n    win.priority = b & 0x07; // p\n\n    b = packetData[++i];\n    win.relativePositioning = (b & 0x80) >> 7; // rp\n\n    win.anchorVertical = b & 0x7f; // av\n\n    b = packetData[++i];\n    win.anchorHorizontal = b; // ah\n\n    b = packetData[++i];\n    win.anchorPoint = (b & 0xf0) >> 4; // ap\n\n    win.rowCount = b & 0x0f; // rc\n\n    b = packetData[++i];\n    win.columnCount = b & 0x3f; // cc\n\n    b = packetData[++i];\n    win.windowStyle = (b & 0x38) >> 3; // ws\n\n    win.penStyle = b & 0x07; // ps\n    // The spec says there are (rowCount+1) \"virtual rows\"\n\n    win.virtualRowCount = win.rowCount + 1;\n    return i;\n  };\n  /**\n   * Parse and execute the SWA command.\n   *\n   * Set attributes of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setWindowAttributes = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var winAttr = service.currentWindow.winAttr;\n    b = packetData[++i];\n    winAttr.fillOpacity = (b & 0xc0) >> 6; // fo\n\n    winAttr.fillRed = (b & 0x30) >> 4; // fr\n\n    winAttr.fillGreen = (b & 0x0c) >> 2; // fg\n\n    winAttr.fillBlue = b & 0x03; // fb\n\n    b = packetData[++i];\n    winAttr.borderType = (b & 0xc0) >> 6; // bt\n\n    winAttr.borderRed = (b & 0x30) >> 4; // br\n\n    winAttr.borderGreen = (b & 0x0c) >> 2; // bg\n\n    winAttr.borderBlue = b & 0x03; // bb\n\n    b = packetData[++i];\n    winAttr.borderType += (b & 0x80) >> 5; // bt\n\n    winAttr.wordWrap = (b & 0x40) >> 6; // ww\n\n    winAttr.printDirection = (b & 0x30) >> 4; // pd\n\n    winAttr.scrollDirection = (b & 0x0c) >> 2; // sd\n\n    winAttr.justify = b & 0x03; // j\n\n    b = packetData[++i];\n    winAttr.effectSpeed = (b & 0xf0) >> 4; // es\n\n    winAttr.effectDirection = (b & 0x0c) >> 2; // ed\n\n    winAttr.displayEffect = b & 0x03; // de\n\n    return i;\n  };\n  /**\n   * Gather text from all displayed windows and push a caption to output.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   */\n\n\n  Cea708Stream.prototype.flushDisplayed = function (pts, service) {\n    var displayedText = []; // TODO: Positioning not supported, displaying multiple windows will not necessarily\n    // display text in the correct order, but sample files so far have not shown any issue.\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {\n        displayedText.push(service.windows[winId].getText());\n      }\n    }\n\n    service.endPts = pts;\n    service.text = displayedText.join('\\n\\n');\n    this.pushCaption(service);\n    service.startPts = pts;\n  };\n  /**\n   * Push a caption to output if the caption contains text.\n   *\n   * @param  {Service} service  The service object to be affected\n   */\n\n\n  Cea708Stream.prototype.pushCaption = function (service) {\n    if (service.text !== '') {\n      this.trigger('data', {\n        startPts: service.startPts,\n        endPts: service.endPts,\n        text: service.text,\n        stream: 'cc708_' + service.serviceNum\n      });\n      service.text = '';\n      service.startPts = service.endPts;\n    }\n  };\n  /**\n   * Parse and execute the DSW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.displayWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible = 1;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the HDW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.hideWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible = 0;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the TGW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.toggleWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible ^= 1;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the CLW command.\n   *\n   * Clear text of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.clearWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].clearText();\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the DLW command.\n   *\n   * Re-initialize windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.deleteWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].reset();\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPA command.\n   *\n   * Set pen attributes of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenAttributes = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penAttr = service.currentWindow.penAttr;\n    b = packetData[++i];\n    penAttr.textTag = (b & 0xf0) >> 4; // tt\n\n    penAttr.offset = (b & 0x0c) >> 2; // o\n\n    penAttr.penSize = b & 0x03; // s\n\n    b = packetData[++i];\n    penAttr.italics = (b & 0x80) >> 7; // i\n\n    penAttr.underline = (b & 0x40) >> 6; // u\n\n    penAttr.edgeType = (b & 0x38) >> 3; // et\n\n    penAttr.fontStyle = b & 0x07; // fs\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPC command.\n   *\n   * Set pen color of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenColor = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penColor = service.currentWindow.penColor;\n    b = packetData[++i];\n    penColor.fgOpacity = (b & 0xc0) >> 6; // fo\n\n    penColor.fgRed = (b & 0x30) >> 4; // fr\n\n    penColor.fgGreen = (b & 0x0c) >> 2; // fg\n\n    penColor.fgBlue = b & 0x03; // fb\n\n    b = packetData[++i];\n    penColor.bgOpacity = (b & 0xc0) >> 6; // bo\n\n    penColor.bgRed = (b & 0x30) >> 4; // br\n\n    penColor.bgGreen = (b & 0x0c) >> 2; // bg\n\n    penColor.bgBlue = b & 0x03; // bb\n\n    b = packetData[++i];\n    penColor.edgeRed = (b & 0x30) >> 4; // er\n\n    penColor.edgeGreen = (b & 0x0c) >> 2; // eg\n\n    penColor.edgeBlue = b & 0x03; // eb\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPL command.\n   *\n   * Set pen location of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenLocation = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penLoc = service.currentWindow.penLoc; // Positioning isn't really supported at the moment, so this essentially just inserts a linebreak\n\n    service.currentWindow.pendingNewLine = true;\n    b = packetData[++i];\n    penLoc.row = b & 0x0f; // r\n\n    b = packetData[++i];\n    penLoc.column = b & 0x3f; // c\n\n    return i;\n  };\n  /**\n   * Execute the RST command.\n   *\n   * Reset service to a clean slate. Re-initialize.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Service}          Re-initialized service\n   */\n\n\n  Cea708Stream.prototype.reset = function (i, service) {\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n    return this.initService(service.serviceNum, i);\n  }; // This hash maps non-ASCII, special, and extended character codes to their\n  // proper Unicode equivalent. The first keys that are only a single byte\n  // are the non-standard ASCII characters, which simply map the CEA608 byte\n  // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n  // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n  // can be performed regardless of the field and data channel on which the\n  // character code was received.\n\n\n  var CHARACTER_TRANSLATION = {\n    0x2a: 0xe1,\n    // á\n    0x5c: 0xe9,\n    // é\n    0x5e: 0xed,\n    // í\n    0x5f: 0xf3,\n    // ó\n    0x60: 0xfa,\n    // ú\n    0x7b: 0xe7,\n    // ç\n    0x7c: 0xf7,\n    // ÷\n    0x7d: 0xd1,\n    // Ñ\n    0x7e: 0xf1,\n    // ñ\n    0x7f: 0x2588,\n    // █\n    0x0130: 0xae,\n    // ®\n    0x0131: 0xb0,\n    // °\n    0x0132: 0xbd,\n    // ½\n    0x0133: 0xbf,\n    // ¿\n    0x0134: 0x2122,\n    // ™\n    0x0135: 0xa2,\n    // ¢\n    0x0136: 0xa3,\n    // £\n    0x0137: 0x266a,\n    // ♪\n    0x0138: 0xe0,\n    // à\n    0x0139: 0xa0,\n    //\n    0x013a: 0xe8,\n    // è\n    0x013b: 0xe2,\n    // â\n    0x013c: 0xea,\n    // ê\n    0x013d: 0xee,\n    // î\n    0x013e: 0xf4,\n    // ô\n    0x013f: 0xfb,\n    // û\n    0x0220: 0xc1,\n    // Á\n    0x0221: 0xc9,\n    // É\n    0x0222: 0xd3,\n    // Ó\n    0x0223: 0xda,\n    // Ú\n    0x0224: 0xdc,\n    // Ü\n    0x0225: 0xfc,\n    // ü\n    0x0226: 0x2018,\n    // ‘\n    0x0227: 0xa1,\n    // ¡\n    0x0228: 0x2a,\n    // *\n    0x0229: 0x27,\n    // '\n    0x022a: 0x2014,\n    // —\n    0x022b: 0xa9,\n    // ©\n    0x022c: 0x2120,\n    // ℠\n    0x022d: 0x2022,\n    // •\n    0x022e: 0x201c,\n    // “\n    0x022f: 0x201d,\n    // ”\n    0x0230: 0xc0,\n    // À\n    0x0231: 0xc2,\n    // Â\n    0x0232: 0xc7,\n    // Ç\n    0x0233: 0xc8,\n    // È\n    0x0234: 0xca,\n    // Ê\n    0x0235: 0xcb,\n    // Ë\n    0x0236: 0xeb,\n    // ë\n    0x0237: 0xce,\n    // Î\n    0x0238: 0xcf,\n    // Ï\n    0x0239: 0xef,\n    // ï\n    0x023a: 0xd4,\n    // Ô\n    0x023b: 0xd9,\n    // Ù\n    0x023c: 0xf9,\n    // ù\n    0x023d: 0xdb,\n    // Û\n    0x023e: 0xab,\n    // «\n    0x023f: 0xbb,\n    // »\n    0x0320: 0xc3,\n    // Ã\n    0x0321: 0xe3,\n    // ã\n    0x0322: 0xcd,\n    // Í\n    0x0323: 0xcc,\n    // Ì\n    0x0324: 0xec,\n    // ì\n    0x0325: 0xd2,\n    // Ò\n    0x0326: 0xf2,\n    // ò\n    0x0327: 0xd5,\n    // Õ\n    0x0328: 0xf5,\n    // õ\n    0x0329: 0x7b,\n    // {\n    0x032a: 0x7d,\n    // }\n    0x032b: 0x5c,\n    // \\\n    0x032c: 0x5e,\n    // ^\n    0x032d: 0x5f,\n    // _\n    0x032e: 0x7c,\n    // |\n    0x032f: 0x7e,\n    // ~\n    0x0330: 0xc4,\n    // Ä\n    0x0331: 0xe4,\n    // ä\n    0x0332: 0xd6,\n    // Ö\n    0x0333: 0xf6,\n    // ö\n    0x0334: 0xdf,\n    // ß\n    0x0335: 0xa5,\n    // ¥\n    0x0336: 0xa4,\n    // ¤\n    0x0337: 0x2502,\n    // │\n    0x0338: 0xc5,\n    // Å\n    0x0339: 0xe5,\n    // å\n    0x033a: 0xd8,\n    // Ø\n    0x033b: 0xf8,\n    // ø\n    0x033c: 0x250c,\n    // ┌\n    0x033d: 0x2510,\n    // ┐\n    0x033e: 0x2514,\n    // └\n    0x033f: 0x2518 // ┘\n\n  };\n\n  var getCharFromCode = function getCharFromCode(code) {\n    if (code === null) {\n      return '';\n    }\n\n    code = CHARACTER_TRANSLATION[code] || code;\n    return String.fromCharCode(code);\n  }; // the index of the last row in a CEA-608 display buffer\n\n\n  var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n  // getting it through bit logic.\n\n  var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n  // cells. The \"bottom\" row is the last element in the outer array.\n\n  var createDisplayBuffer = function createDisplayBuffer() {\n    var result = [],\n        i = BOTTOM_ROW + 1;\n\n    while (i--) {\n      result.push('');\n    }\n\n    return result;\n  };\n\n  var Cea608Stream = function Cea608Stream(field, dataChannel) {\n    Cea608Stream.prototype.init.call(this);\n    this.field_ = field || 0;\n    this.dataChannel_ = dataChannel || 0;\n    this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n    this.setConstants();\n    this.reset();\n\n    this.push = function (packet) {\n      var data, swap, char0, char1, text; // remove the parity bits\n\n      data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n      if (data === this.lastControlCode_) {\n        this.lastControlCode_ = null;\n        return;\n      } // Store control codes\n\n\n      if ((data & 0xf000) === 0x1000) {\n        this.lastControlCode_ = data;\n      } else if (data !== this.PADDING_) {\n        this.lastControlCode_ = null;\n      }\n\n      char0 = data >>> 8;\n      char1 = data & 0xff;\n\n      if (data === this.PADDING_) {\n        return;\n      } else if (data === this.RESUME_CAPTION_LOADING_) {\n        this.mode_ = 'popOn';\n      } else if (data === this.END_OF_CAPTION_) {\n        // If an EOC is received while in paint-on mode, the displayed caption\n        // text should be swapped to non-displayed memory as if it was a pop-on\n        // caption. Because of that, we should explicitly switch back to pop-on\n        // mode\n        this.mode_ = 'popOn';\n        this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n        this.flushDisplayed(packet.pts); // flip memory\n\n        swap = this.displayed_;\n        this.displayed_ = this.nonDisplayed_;\n        this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n        this.startPts_ = packet.pts;\n      } else if (data === this.ROLL_UP_2_ROWS_) {\n        this.rollUpRows_ = 2;\n        this.setRollUp(packet.pts);\n      } else if (data === this.ROLL_UP_3_ROWS_) {\n        this.rollUpRows_ = 3;\n        this.setRollUp(packet.pts);\n      } else if (data === this.ROLL_UP_4_ROWS_) {\n        this.rollUpRows_ = 4;\n        this.setRollUp(packet.pts);\n      } else if (data === this.CARRIAGE_RETURN_) {\n        this.clearFormatting(packet.pts);\n        this.flushDisplayed(packet.pts);\n        this.shiftRowsUp_();\n        this.startPts_ = packet.pts;\n      } else if (data === this.BACKSPACE_) {\n        if (this.mode_ === 'popOn') {\n          this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n        } else {\n          this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n        }\n      } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n        this.flushDisplayed(packet.pts);\n        this.displayed_ = createDisplayBuffer();\n      } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n        this.nonDisplayed_ = createDisplayBuffer();\n      } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n        if (this.mode_ !== 'paintOn') {\n          // NOTE: This should be removed when proper caption positioning is\n          // implemented\n          this.flushDisplayed(packet.pts);\n          this.displayed_ = createDisplayBuffer();\n        }\n\n        this.mode_ = 'paintOn';\n        this.startPts_ = packet.pts; // Append special characters to caption text\n      } else if (this.isSpecialCharacter(char0, char1)) {\n        // Bitmask char0 so that we can apply character transformations\n        // regardless of field and data channel.\n        // Then byte-shift to the left and OR with char1 so we can pass the\n        // entire character code to `getCharFromCode`.\n        char0 = (char0 & 0x03) << 8;\n        text = getCharFromCode(char0 | char1);\n        this[this.mode_](packet.pts, text);\n        this.column_++; // Append extended characters to caption text\n      } else if (this.isExtCharacter(char0, char1)) {\n        // Extended characters always follow their \"non-extended\" equivalents.\n        // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n        // decoders are supposed to drop the \"è\", while compliant decoders\n        // backspace the \"e\" and insert \"è\".\n        // Delete the previous character\n        if (this.mode_ === 'popOn') {\n          this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n        } else {\n          this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n        } // Bitmask char0 so that we can apply character transformations\n        // regardless of field and data channel.\n        // Then byte-shift to the left and OR with char1 so we can pass the\n        // entire character code to `getCharFromCode`.\n\n\n        char0 = (char0 & 0x03) << 8;\n        text = getCharFromCode(char0 | char1);\n        this[this.mode_](packet.pts, text);\n        this.column_++; // Process mid-row codes\n      } else if (this.isMidRowCode(char0, char1)) {\n        // Attributes are not additive, so clear all formatting\n        this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n        // should be replaced with spaces, so add one now\n\n        this[this.mode_](packet.pts, ' ');\n        this.column_++;\n\n        if ((char1 & 0xe) === 0xe) {\n          this.addFormatting(packet.pts, ['i']);\n        }\n\n        if ((char1 & 0x1) === 0x1) {\n          this.addFormatting(packet.pts, ['u']);\n        } // Detect offset control codes and adjust cursor\n\n      } else if (this.isOffsetControlCode(char0, char1)) {\n        // Cursor position is set by indent PAC (see below) in 4-column\n        // increments, with an additional offset code of 1-3 to reach any\n        // of the 32 columns specified by CEA-608. So all we need to do\n        // here is increment the column cursor by the given offset.\n        this.column_ += char1 & 0x03; // Detect PACs (Preamble Address Codes)\n      } else if (this.isPAC(char0, char1)) {\n        // There's no logic for PAC -> row mapping, so we have to just\n        // find the row code in an array and use its index :(\n        var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n        if (this.mode_ === 'rollUp') {\n          // This implies that the base row is incorrectly set.\n          // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n          // of roll-up rows set.\n          if (row - this.rollUpRows_ + 1 < 0) {\n            row = this.rollUpRows_ - 1;\n          }\n\n          this.setRollUp(packet.pts, row);\n        }\n\n        if (row !== this.row_) {\n          // formatting is only persistent for current row\n          this.clearFormatting(packet.pts);\n          this.row_ = row;\n        } // All PACs can apply underline, so detect and apply\n        // (All odd-numbered second bytes set underline)\n\n\n        if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n          this.addFormatting(packet.pts, ['u']);\n        }\n\n        if ((data & 0x10) === 0x10) {\n          // We've got an indent level code. Each successive even number\n          // increments the column cursor by 4, so we can get the desired\n          // column position by bit-shifting to the right (to get n/2)\n          // and multiplying by 4.\n          this.column_ = ((data & 0xe) >> 1) * 4;\n        }\n\n        if (this.isColorPAC(char1)) {\n          // it's a color code, though we only support white, which\n          // can be either normal or italicized. white italics can be\n          // either 0x4e or 0x6e depending on the row, so we just\n          // bitwise-and with 0xe to see if italics should be turned on\n          if ((char1 & 0xe) === 0xe) {\n            this.addFormatting(packet.pts, ['i']);\n          }\n        } // We have a normal character in char0, and possibly one in char1\n\n      } else if (this.isNormalChar(char0)) {\n        if (char1 === 0x00) {\n          char1 = null;\n        }\n\n        text = getCharFromCode(char0);\n        text += getCharFromCode(char1);\n        this[this.mode_](packet.pts, text);\n        this.column_ += text.length;\n      } // finish data processing\n\n    };\n  };\n\n  Cea608Stream.prototype = new stream(); // Trigger a cue point that captures the current state of the\n  // display buffer\n\n  Cea608Stream.prototype.flushDisplayed = function (pts) {\n    var content = this.displayed_ // remove spaces from the start and end of the string\n    .map(function (row, index) {\n      try {\n        return row.trim();\n      } catch (e) {\n        // Ordinarily, this shouldn't happen. However, caption\n        // parsing errors should not throw exceptions and\n        // break playback.\n        this.trigger('log', {\n          level: 'warn',\n          message: 'Skipping a malformed 608 caption at index ' + index + '.'\n        });\n        return '';\n      }\n    }, this) // combine all text rows to display in one cue\n    .join('\\n') // and remove blank rows from the start and end, but not the middle\n    .replace(/^\\n+|\\n+$/g, '');\n\n    if (content.length) {\n      this.trigger('data', {\n        startPts: this.startPts_,\n        endPts: pts,\n        text: content,\n        stream: this.name_\n      });\n    }\n  };\n  /**\n   * Zero out the data, used for startup and on seek\n   */\n\n\n  Cea608Stream.prototype.reset = function () {\n    this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n    // actually display captions. If a caption is shifted to a row\n    // with a lower index than this, it is cleared from the display\n    // buffer\n\n    this.topRow_ = 0;\n    this.startPts_ = 0;\n    this.displayed_ = createDisplayBuffer();\n    this.nonDisplayed_ = createDisplayBuffer();\n    this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n    this.column_ = 0;\n    this.row_ = BOTTOM_ROW;\n    this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n    this.formatting_ = [];\n  };\n  /**\n   * Sets up control code and related constants for this instance\n   */\n\n\n  Cea608Stream.prototype.setConstants = function () {\n    // The following attributes have these uses:\n    // ext_ :    char0 for mid-row codes, and the base for extended\n    //           chars (ext_+0, ext_+1, and ext_+2 are char0s for\n    //           extended codes)\n    // control_: char0 for control codes, except byte-shifted to the\n    //           left so that we can do this.control_ | CONTROL_CODE\n    // offset_:  char0 for tab offset codes\n    //\n    // It's also worth noting that control codes, and _only_ control codes,\n    // differ between field 1 and field2. Field 2 control codes are always\n    // their field 1 value plus 1. That's why there's the \"| field\" on the\n    // control value.\n    if (this.dataChannel_ === 0) {\n      this.BASE_ = 0x10;\n      this.EXT_ = 0x11;\n      this.CONTROL_ = (0x14 | this.field_) << 8;\n      this.OFFSET_ = 0x17;\n    } else if (this.dataChannel_ === 1) {\n      this.BASE_ = 0x18;\n      this.EXT_ = 0x19;\n      this.CONTROL_ = (0x1c | this.field_) << 8;\n      this.OFFSET_ = 0x1f;\n    } // Constants for the LSByte command codes recognized by Cea608Stream. This\n    // list is not exhaustive. For a more comprehensive listing and semantics see\n    // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n    // Padding\n\n\n    this.PADDING_ = 0x0000; // Pop-on Mode\n\n    this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n    this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n    this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n    this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n    this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n    this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n    this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n    this.BACKSPACE_ = this.CONTROL_ | 0x21;\n    this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n    this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n  };\n  /**\n   * Detects if the 2-byte packet data is a special character\n   *\n   * Special characters have a second byte in the range 0x30 to 0x3f,\n   * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n   * data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an special character\n   */\n\n\n  Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n    return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n  };\n  /**\n   * Detects if the 2-byte packet data is an extended character\n   *\n   * Extended characters have a second byte in the range 0x20 to 0x3f,\n   * with the first byte being 0x12 or 0x13 (for data channel 1) or\n   * 0x1a or 0x1b (for data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an extended character\n   */\n\n\n  Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n    return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n  };\n  /**\n   * Detects if the 2-byte packet is a mid-row code\n   *\n   * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n   * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n   * channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are a mid-row code\n   */\n\n\n  Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n    return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n  };\n  /**\n   * Detects if the 2-byte packet is an offset control code\n   *\n   * Offset control codes have a second byte in the range 0x21 to 0x23,\n   * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n   * data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an offset control code\n   */\n\n\n  Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n    return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n  };\n  /**\n   * Detects if the 2-byte packet is a Preamble Address Code\n   *\n   * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n   * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n   * range 0x40 to 0x7f.\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are a PAC\n   */\n\n\n  Cea608Stream.prototype.isPAC = function (char0, char1) {\n    return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n  };\n  /**\n   * Detects if a packet's second byte is in the range of a PAC color code\n   *\n   * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n   * 0x60 to 0x6f.\n   *\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the byte is a color PAC\n   */\n\n\n  Cea608Stream.prototype.isColorPAC = function (char1) {\n    return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n  };\n  /**\n   * Detects if a single byte is in the range of a normal character\n   *\n   * Normal text bytes are in the range 0x20 to 0x7f.\n   *\n   * @param  {Integer} char  The byte\n   * @return {Boolean}       Whether the byte is a normal character\n   */\n\n\n  Cea608Stream.prototype.isNormalChar = function (_char2) {\n    return _char2 >= 0x20 && _char2 <= 0x7f;\n  };\n  /**\n   * Configures roll-up\n   *\n   * @param  {Integer} pts         Current PTS\n   * @param  {Integer} newBaseRow  Used by PACs to slide the current window to\n   *                               a new position\n   */\n\n\n  Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n    // Reset the base row to the bottom row when switching modes\n    if (this.mode_ !== 'rollUp') {\n      this.row_ = BOTTOM_ROW;\n      this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n      this.flushDisplayed(pts);\n      this.nonDisplayed_ = createDisplayBuffer();\n      this.displayed_ = createDisplayBuffer();\n    }\n\n    if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n      // move currently displayed captions (up or down) to the new base row\n      for (var i = 0; i < this.rollUpRows_; i++) {\n        this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n        this.displayed_[this.row_ - i] = '';\n      }\n    }\n\n    if (newBaseRow === undefined) {\n      newBaseRow = this.row_;\n    }\n\n    this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n  }; // Adds the opening HTML tag for the passed character to the caption text,\n  // and keeps track of it for later closing\n\n\n  Cea608Stream.prototype.addFormatting = function (pts, format) {\n    this.formatting_ = this.formatting_.concat(format);\n    var text = format.reduce(function (text, format) {\n      return text + '<' + format + '>';\n    }, '');\n    this[this.mode_](pts, text);\n  }; // Adds HTML closing tags for current formatting to caption text and\n  // clears remembered formatting\n\n\n  Cea608Stream.prototype.clearFormatting = function (pts) {\n    if (!this.formatting_.length) {\n      return;\n    }\n\n    var text = this.formatting_.reverse().reduce(function (text, format) {\n      return text + '</' + format + '>';\n    }, '');\n    this.formatting_ = [];\n    this[this.mode_](pts, text);\n  }; // Mode Implementations\n\n\n  Cea608Stream.prototype.popOn = function (pts, text) {\n    var baseRow = this.nonDisplayed_[this.row_]; // buffer characters\n\n    baseRow += text;\n    this.nonDisplayed_[this.row_] = baseRow;\n  };\n\n  Cea608Stream.prototype.rollUp = function (pts, text) {\n    var baseRow = this.displayed_[this.row_];\n    baseRow += text;\n    this.displayed_[this.row_] = baseRow;\n  };\n\n  Cea608Stream.prototype.shiftRowsUp_ = function () {\n    var i; // clear out inactive rows\n\n    for (i = 0; i < this.topRow_; i++) {\n      this.displayed_[i] = '';\n    }\n\n    for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n      this.displayed_[i] = '';\n    } // shift displayed rows up\n\n\n    for (i = this.topRow_; i < this.row_; i++) {\n      this.displayed_[i] = this.displayed_[i + 1];\n    } // clear out the bottom row\n\n\n    this.displayed_[this.row_] = '';\n  };\n\n  Cea608Stream.prototype.paintOn = function (pts, text) {\n    var baseRow = this.displayed_[this.row_];\n    baseRow += text;\n    this.displayed_[this.row_] = baseRow;\n  }; // exports\n\n\n  var captionStream = {\n    CaptionStream: CaptionStream$1,\n    Cea608Stream: Cea608Stream,\n    Cea708Stream: Cea708Stream\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var streamTypes = {\n    H264_STREAM_TYPE: 0x1B,\n    ADTS_STREAM_TYPE: 0x0F,\n    METADATA_STREAM_TYPE: 0x15\n  };\n  var MAX_TS = 8589934592;\n  var RO_THRESH = 4294967296;\n  var TYPE_SHARED = 'shared';\n\n  var handleRollover$1 = function handleRollover(value, reference) {\n    var direction = 1;\n\n    if (value > reference) {\n      // If the current timestamp value is greater than our reference timestamp and we detect a\n      // timestamp rollover, this means the roll over is happening in the opposite direction.\n      // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n      // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n      // rollover point. In loading this segment, the timestamp values will be very large,\n      // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n      // the time stamp to be `value - 2^33`.\n      direction = -1;\n    } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n    // cause an incorrect adjustment.\n\n\n    while (Math.abs(reference - value) > RO_THRESH) {\n      value += direction * MAX_TS;\n    }\n\n    return value;\n  };\n\n  var TimestampRolloverStream$1 = function TimestampRolloverStream(type) {\n    var lastDTS, referenceDTS;\n    TimestampRolloverStream.prototype.init.call(this); // The \"shared\" type is used in cases where a stream will contain muxed\n    // video and audio. We could use `undefined` here, but having a string\n    // makes debugging a little clearer.\n\n    this.type_ = type || TYPE_SHARED;\n\n    this.push = function (data) {\n      // Any \"shared\" rollover streams will accept _all_ data. Otherwise,\n      // streams will only accept data that matches their type.\n      if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {\n        return;\n      }\n\n      if (referenceDTS === undefined) {\n        referenceDTS = data.dts;\n      }\n\n      data.dts = handleRollover$1(data.dts, referenceDTS);\n      data.pts = handleRollover$1(data.pts, referenceDTS);\n      lastDTS = data.dts;\n      this.trigger('data', data);\n    };\n\n    this.flush = function () {\n      referenceDTS = lastDTS;\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n\n    this.discontinuity = function () {\n      referenceDTS = void 0;\n      lastDTS = void 0;\n    };\n\n    this.reset = function () {\n      this.discontinuity();\n      this.trigger('reset');\n    };\n  };\n\n  TimestampRolloverStream$1.prototype = new stream();\n  var timestampRolloverStream = {\n    TimestampRolloverStream: TimestampRolloverStream$1,\n    handleRollover: handleRollover$1\n  };\n\n  var percentEncode$1 = function percentEncode(bytes, start, end) {\n    var i,\n        result = '';\n\n    for (i = start; i < end; i++) {\n      result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n    }\n\n    return result;\n  },\n      // return the string representation of the specified byte range,\n  // interpreted as UTf-8.\n  parseUtf8 = function parseUtf8(bytes, start, end) {\n    return decodeURIComponent(percentEncode$1(bytes, start, end));\n  },\n      // return the string representation of the specified byte range,\n  // interpreted as ISO-8859-1.\n  parseIso88591$1 = function parseIso88591(bytes, start, end) {\n    return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n  },\n      parseSyncSafeInteger$1 = function parseSyncSafeInteger(data) {\n    return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n  },\n      tagParsers = {\n    TXXX: function TXXX(tag) {\n      var i;\n\n      if (tag.data[0] !== 3) {\n        // ignore frames with unrecognized character encodings\n        return;\n      }\n\n      for (i = 1; i < tag.data.length; i++) {\n        if (tag.data[i] === 0) {\n          // parse the text fields\n          tag.description = parseUtf8(tag.data, 1, i); // do not include the null terminator in the tag value\n\n          tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n          break;\n        }\n      }\n\n      tag.data = tag.value;\n    },\n    WXXX: function WXXX(tag) {\n      var i;\n\n      if (tag.data[0] !== 3) {\n        // ignore frames with unrecognized character encodings\n        return;\n      }\n\n      for (i = 1; i < tag.data.length; i++) {\n        if (tag.data[i] === 0) {\n          // parse the description and URL fields\n          tag.description = parseUtf8(tag.data, 1, i);\n          tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n          break;\n        }\n      }\n    },\n    PRIV: function PRIV(tag) {\n      var i;\n\n      for (i = 0; i < tag.data.length; i++) {\n        if (tag.data[i] === 0) {\n          // parse the description and URL fields\n          tag.owner = parseIso88591$1(tag.data, 0, i);\n          break;\n        }\n      }\n\n      tag.privateData = tag.data.subarray(i + 1);\n      tag.data = tag.privateData;\n    }\n  },\n      _MetadataStream;\n\n  _MetadataStream = function MetadataStream(options) {\n    var settings = {\n      // the bytes of the program-level descriptor field in MP2T\n      // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n      // program element descriptors\"\n      descriptor: options && options.descriptor\n    },\n        // the total size in bytes of the ID3 tag being parsed\n    tagSize = 0,\n        // tag data that is not complete enough to be parsed\n    buffer = [],\n        // the total number of bytes currently in the buffer\n    bufferSize = 0,\n        i;\n\n    _MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n    // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n\n    this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);\n\n    if (settings.descriptor) {\n      for (i = 0; i < settings.descriptor.length; i++) {\n        this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n      }\n    }\n\n    this.push = function (chunk) {\n      var tag, frameStart, frameSize, frame, i, frameHeader;\n\n      if (chunk.type !== 'timed-metadata') {\n        return;\n      } // if data_alignment_indicator is set in the PES header,\n      // we must have the start of a new ID3 tag. Assume anything\n      // remaining in the buffer was malformed and throw it out\n\n\n      if (chunk.dataAlignmentIndicator) {\n        bufferSize = 0;\n        buffer.length = 0;\n      } // ignore events that don't look like ID3 data\n\n\n      if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n        this.trigger('log', {\n          level: 'warn',\n          message: 'Skipping unrecognized metadata packet'\n        });\n        return;\n      } // add this chunk to the data we've collected so far\n\n\n      buffer.push(chunk);\n      bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n      if (buffer.length === 1) {\n        // the frame size is transmitted as a 28-bit integer in the\n        // last four bytes of the ID3 header.\n        // The most significant bit of each byte is dropped and the\n        // results concatenated to recover the actual value.\n        tagSize = parseSyncSafeInteger$1(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n        // convenient for our comparisons to include it\n\n        tagSize += 10;\n      } // if the entire frame has not arrived, wait for more data\n\n\n      if (bufferSize < tagSize) {\n        return;\n      } // collect the entire frame so it can be parsed\n\n\n      tag = {\n        data: new Uint8Array(tagSize),\n        frames: [],\n        pts: buffer[0].pts,\n        dts: buffer[0].dts\n      };\n\n      for (i = 0; i < tagSize;) {\n        tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n        i += buffer[0].data.byteLength;\n        bufferSize -= buffer[0].data.byteLength;\n        buffer.shift();\n      } // find the start of the first frame and the end of the tag\n\n\n      frameStart = 10;\n\n      if (tag.data[5] & 0x40) {\n        // advance the frame start past the extended header\n        frameStart += 4; // header size field\n\n        frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14)); // clip any padding off the end\n\n        tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20));\n      } // parse one or more ID3 frames\n      // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n      do {\n        // determine the number of bytes in this frame\n        frameSize = parseSyncSafeInteger$1(tag.data.subarray(frameStart + 4, frameStart + 8));\n\n        if (frameSize < 1) {\n          this.trigger('log', {\n            level: 'warn',\n            message: 'Malformed ID3 frame encountered. Skipping metadata parsing.'\n          });\n          return;\n        }\n\n        frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n        frame = {\n          id: frameHeader,\n          data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n        };\n        frame.key = frame.id;\n\n        if (tagParsers[frame.id]) {\n          tagParsers[frame.id](frame); // handle the special PRIV frame used to indicate the start\n          // time for raw AAC data\n\n          if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n            var d = frame.data,\n                size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n            size *= 4;\n            size += d[7] & 0x03;\n            frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n            // on the value of this frame\n            // we couldn't have known the appropriate pts and dts before\n            // parsing this ID3 tag so set those values now\n\n            if (tag.pts === undefined && tag.dts === undefined) {\n              tag.pts = frame.timeStamp;\n              tag.dts = frame.timeStamp;\n            }\n\n            this.trigger('timestamp', frame);\n          }\n        }\n\n        tag.frames.push(frame);\n        frameStart += 10; // advance past the frame header\n\n        frameStart += frameSize; // advance past the frame body\n      } while (frameStart < tagSize);\n\n      this.trigger('data', tag);\n    };\n  };\n\n  _MetadataStream.prototype = new stream();\n  var metadataStream = _MetadataStream;\n  var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream; // object types\n\n  var _TransportPacketStream, _TransportParseStream, _ElementaryStream; // constants\n\n\n  var MP2T_PACKET_LENGTH$1 = 188,\n      // bytes\n  SYNC_BYTE$1 = 0x47;\n  /**\n   * Splits an incoming stream of binary data into MPEG-2 Transport\n   * Stream packets.\n   */\n\n  _TransportPacketStream = function TransportPacketStream() {\n    var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1),\n        bytesInBuffer = 0;\n\n    _TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n    /**\n     * Split a stream of data into M2TS packets\n    **/\n\n\n    this.push = function (bytes) {\n      var startIndex = 0,\n          endIndex = MP2T_PACKET_LENGTH$1,\n          everything; // If there are bytes remaining from the last segment, prepend them to the\n      // bytes that were pushed in\n\n      if (bytesInBuffer) {\n        everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n        everything.set(buffer.subarray(0, bytesInBuffer));\n        everything.set(bytes, bytesInBuffer);\n        bytesInBuffer = 0;\n      } else {\n        everything = bytes;\n      } // While we have enough data for a packet\n\n\n      while (endIndex < everything.byteLength) {\n        // Look for a pair of start and end sync bytes in the data..\n        if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {\n          // We found a packet so emit it and jump one whole packet forward in\n          // the stream\n          this.trigger('data', everything.subarray(startIndex, endIndex));\n          startIndex += MP2T_PACKET_LENGTH$1;\n          endIndex += MP2T_PACKET_LENGTH$1;\n          continue;\n        } // If we get here, we have somehow become de-synchronized and we need to step\n        // forward one byte at a time until we find a pair of sync bytes that denote\n        // a packet\n\n\n        startIndex++;\n        endIndex++;\n      } // If there was some data left over at the end of the segment that couldn't\n      // possibly be a whole packet, keep it because it might be the start of a packet\n      // that continues in the next segment\n\n\n      if (startIndex < everything.byteLength) {\n        buffer.set(everything.subarray(startIndex), 0);\n        bytesInBuffer = everything.byteLength - startIndex;\n      }\n    };\n    /**\n     * Passes identified M2TS packets to the TransportParseStream to be parsed\n    **/\n\n\n    this.flush = function () {\n      // If the buffer contains a whole packet when we are being flushed, emit it\n      // and empty the buffer. Otherwise hold onto the data because it may be\n      // important for decoding the next segment\n      if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {\n        this.trigger('data', buffer);\n        bytesInBuffer = 0;\n      }\n\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n\n    this.reset = function () {\n      bytesInBuffer = 0;\n      this.trigger('reset');\n    };\n  };\n\n  _TransportPacketStream.prototype = new stream();\n  /**\n   * Accepts an MP2T TransportPacketStream and emits data events with parsed\n   * forms of the individual transport stream packets.\n   */\n\n  _TransportParseStream = function TransportParseStream() {\n    var parsePsi, parsePat, parsePmt, self;\n\n    _TransportParseStream.prototype.init.call(this);\n\n    self = this;\n    this.packetsWaitingForPmt = [];\n    this.programMapTable = undefined;\n\n    parsePsi = function parsePsi(payload, psi) {\n      var offset = 0; // PSI packets may be split into multiple sections and those\n      // sections may be split into multiple packets. If a PSI\n      // section starts in this packet, the payload_unit_start_indicator\n      // will be true and the first byte of the payload will indicate\n      // the offset from the current position to the start of the\n      // section.\n\n      if (psi.payloadUnitStartIndicator) {\n        offset += payload[offset] + 1;\n      }\n\n      if (psi.type === 'pat') {\n        parsePat(payload.subarray(offset), psi);\n      } else {\n        parsePmt(payload.subarray(offset), psi);\n      }\n    };\n\n    parsePat = function parsePat(payload, pat) {\n      pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n      pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n      // skip the PSI header and parse the first PMT entry\n\n      self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n      pat.pmtPid = self.pmtPid;\n    };\n    /**\n     * Parse out the relevant fields of a Program Map Table (PMT).\n     * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n     * packet. The first byte in this array should be the table_id\n     * field.\n     * @param pmt {object} the object that should be decorated with\n     * fields parsed from the PMT.\n     */\n\n\n    parsePmt = function parsePmt(payload, pmt) {\n      var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n      // take effect. We don't believe this should ever be the case\n      // for HLS but we'll ignore \"forward\" PMT declarations if we see\n      // them. Future PMT declarations have the current_next_indicator\n      // set to zero.\n\n      if (!(payload[5] & 0x01)) {\n        return;\n      } // overwrite any existing program map table\n\n\n      self.programMapTable = {\n        video: null,\n        audio: null,\n        'timed-metadata': {}\n      }; // the mapping table ends at the end of the current section\n\n      sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n      tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n      // long the program info descriptors are\n\n      programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n      offset = 12 + programInfoLength;\n\n      while (offset < tableEnd) {\n        var streamType = payload[offset];\n        var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n        // TODO: should this be done for metadata too? for now maintain behavior of\n        //       multiple metadata streams\n\n        if (streamType === streamTypes.H264_STREAM_TYPE && self.programMapTable.video === null) {\n          self.programMapTable.video = pid;\n        } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n          self.programMapTable.audio = pid;\n        } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {\n          // map pid to stream type for metadata streams\n          self.programMapTable['timed-metadata'][pid] = streamType;\n        } // move to the next table entry\n        // skip past the elementary stream descriptors, if present\n\n\n        offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n      } // record the map on the packet as well\n\n\n      pmt.programMapTable = self.programMapTable;\n    };\n    /**\n     * Deliver a new MP2T packet to the next stream in the pipeline.\n     */\n\n\n    this.push = function (packet) {\n      var result = {},\n          offset = 4;\n      result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n      result.pid = packet[1] & 0x1f;\n      result.pid <<= 8;\n      result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n      // fifth byte of the TS packet header. The adaptation field is\n      // used to add stuffing to PES packets that don't fill a complete\n      // TS packet, and to specify some forms of timing and control data\n      // that we do not currently use.\n\n      if ((packet[3] & 0x30) >>> 4 > 0x01) {\n        offset += packet[offset] + 1;\n      } // parse the rest of the packet based on the type\n\n\n      if (result.pid === 0) {\n        result.type = 'pat';\n        parsePsi(packet.subarray(offset), result);\n        this.trigger('data', result);\n      } else if (result.pid === this.pmtPid) {\n        result.type = 'pmt';\n        parsePsi(packet.subarray(offset), result);\n        this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n        while (this.packetsWaitingForPmt.length) {\n          this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n        }\n      } else if (this.programMapTable === undefined) {\n        // When we have not seen a PMT yet, defer further processing of\n        // PES packets until one has been parsed\n        this.packetsWaitingForPmt.push([packet, offset, result]);\n      } else {\n        this.processPes_(packet, offset, result);\n      }\n    };\n\n    this.processPes_ = function (packet, offset, result) {\n      // set the appropriate stream type\n      if (result.pid === this.programMapTable.video) {\n        result.streamType = streamTypes.H264_STREAM_TYPE;\n      } else if (result.pid === this.programMapTable.audio) {\n        result.streamType = streamTypes.ADTS_STREAM_TYPE;\n      } else {\n        // if not video or audio, it is timed-metadata or unknown\n        // if unknown, streamType will be undefined\n        result.streamType = this.programMapTable['timed-metadata'][result.pid];\n      }\n\n      result.type = 'pes';\n      result.data = packet.subarray(offset);\n      this.trigger('data', result);\n    };\n  };\n\n  _TransportParseStream.prototype = new stream();\n  _TransportParseStream.STREAM_TYPES = {\n    h264: 0x1b,\n    adts: 0x0f\n  };\n  /**\n   * Reconsistutes program elementary stream (PES) packets from parsed\n   * transport stream packets. That is, if you pipe an\n   * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n   * events will be events which capture the bytes for individual PES\n   * packets plus relevant metadata that has been extracted from the\n   * container.\n   */\n\n  _ElementaryStream = function ElementaryStream() {\n    var self = this,\n        segmentHadPmt = false,\n        // PES packet fragments\n    video = {\n      data: [],\n      size: 0\n    },\n        audio = {\n      data: [],\n      size: 0\n    },\n        timedMetadata = {\n      data: [],\n      size: 0\n    },\n        programMapTable,\n        parsePes = function parsePes(payload, pes) {\n      var ptsDtsFlags;\n      var startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2]; // default to an empty array\n\n      pes.data = new Uint8Array(); // In certain live streams, the start of a TS fragment has ts packets\n      // that are frame data that is continuing from the previous fragment. This\n      // is to check that the pes data is the start of a new pes payload\n\n      if (startPrefix !== 1) {\n        return;\n      } // get the packet length, this will be 0 for video\n\n\n      pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n      pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n      // and a DTS value. Determine what combination of values is\n      // available to work with.\n\n      ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number.  Javascript\n      // performs all bitwise operations on 32-bit integers but javascript\n      // supports a much greater range (52-bits) of integer using standard\n      // mathematical operations.\n      // We construct a 31-bit value using bitwise operators over the 31\n      // most significant bits and then multiply by 4 (equal to a left-shift\n      // of 2) before we add the final 2 least significant bits of the\n      // timestamp (equal to an OR.)\n\n      if (ptsDtsFlags & 0xC0) {\n        // the PTS and DTS are not written out directly. For information\n        // on how they are encoded, see\n        // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n        pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n        pes.pts *= 4; // Left shift by 2\n\n        pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n        pes.dts = pes.pts;\n\n        if (ptsDtsFlags & 0x40) {\n          pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n          pes.dts *= 4; // Left shift by 2\n\n          pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n        }\n      } // the data section starts immediately after the PES header.\n      // pes_header_data_length specifies the number of header bytes\n      // that follow the last byte of the field.\n\n\n      pes.data = payload.subarray(9 + payload[8]);\n    },\n\n    /**\n      * Pass completely parsed PES packets to the next stream in the pipeline\n     **/\n    flushStream = function flushStream(stream, type, forceFlush) {\n      var packetData = new Uint8Array(stream.size),\n          event = {\n        type: type\n      },\n          i = 0,\n          offset = 0,\n          packetFlushable = false,\n          fragment; // do nothing if there is not enough buffered data for a complete\n      // PES header\n\n      if (!stream.data.length || stream.size < 9) {\n        return;\n      }\n\n      event.trackId = stream.data[0].pid; // reassemble the packet\n\n      for (i = 0; i < stream.data.length; i++) {\n        fragment = stream.data[i];\n        packetData.set(fragment.data, offset);\n        offset += fragment.data.byteLength;\n      } // parse assembled packet's PES header\n\n\n      parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n      // check that there is enough stream data to fill the packet\n\n      packetFlushable = type === 'video' || event.packetLength <= stream.size; // flush pending packets if the conditions are right\n\n      if (forceFlush || packetFlushable) {\n        stream.size = 0;\n        stream.data.length = 0;\n      } // only emit packets that are complete. this is to avoid assembling\n      // incomplete PES packets due to poor segmentation\n\n\n      if (packetFlushable) {\n        self.trigger('data', event);\n      }\n    };\n\n    _ElementaryStream.prototype.init.call(this);\n    /**\n     * Identifies M2TS packet types and parses PES packets using metadata\n     * parsed from the PMT\n     **/\n\n\n    this.push = function (data) {\n      ({\n        pat: function pat() {// we have to wait for the PMT to arrive as well before we\n          // have any meaningful metadata\n        },\n        pes: function pes() {\n          var stream, streamType;\n\n          switch (data.streamType) {\n            case streamTypes.H264_STREAM_TYPE:\n              stream = video;\n              streamType = 'video';\n              break;\n\n            case streamTypes.ADTS_STREAM_TYPE:\n              stream = audio;\n              streamType = 'audio';\n              break;\n\n            case streamTypes.METADATA_STREAM_TYPE:\n              stream = timedMetadata;\n              streamType = 'timed-metadata';\n              break;\n\n            default:\n              // ignore unknown stream types\n              return;\n          } // if a new packet is starting, we can flush the completed\n          // packet\n\n\n          if (data.payloadUnitStartIndicator) {\n            flushStream(stream, streamType, true);\n          } // buffer this fragment until we are sure we've received the\n          // complete payload\n\n\n          stream.data.push(data);\n          stream.size += data.data.byteLength;\n        },\n        pmt: function pmt() {\n          var event = {\n            type: 'metadata',\n            tracks: []\n          };\n          programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n          if (programMapTable.video !== null) {\n            event.tracks.push({\n              timelineStartInfo: {\n                baseMediaDecodeTime: 0\n              },\n              id: +programMapTable.video,\n              codec: 'avc',\n              type: 'video'\n            });\n          }\n\n          if (programMapTable.audio !== null) {\n            event.tracks.push({\n              timelineStartInfo: {\n                baseMediaDecodeTime: 0\n              },\n              id: +programMapTable.audio,\n              codec: 'adts',\n              type: 'audio'\n            });\n          }\n\n          segmentHadPmt = true;\n          self.trigger('data', event);\n        }\n      })[data.type]();\n    };\n\n    this.reset = function () {\n      video.size = 0;\n      video.data.length = 0;\n      audio.size = 0;\n      audio.data.length = 0;\n      this.trigger('reset');\n    };\n    /**\n     * Flush any remaining input. Video PES packets may be of variable\n     * length. Normally, the start of a new video packet can trigger the\n     * finalization of the previous packet. That is not possible if no\n     * more video is forthcoming, however. In that case, some other\n     * mechanism (like the end of the file) has to be employed. When it is\n     * clear that no additional data is forthcoming, calling this method\n     * will flush the buffered packets.\n     */\n\n\n    this.flushStreams_ = function () {\n      // !!THIS ORDER IS IMPORTANT!!\n      // video first then audio\n      flushStream(video, 'video');\n      flushStream(audio, 'audio');\n      flushStream(timedMetadata, 'timed-metadata');\n    };\n\n    this.flush = function () {\n      // if on flush we haven't had a pmt emitted\n      // and we have a pmt to emit. emit the pmt\n      // so that we trigger a trackinfo downstream.\n      if (!segmentHadPmt && programMapTable) {\n        var pmt = {\n          type: 'metadata',\n          tracks: []\n        }; // translate audio and video streams to tracks\n\n        if (programMapTable.video !== null) {\n          pmt.tracks.push({\n            timelineStartInfo: {\n              baseMediaDecodeTime: 0\n            },\n            id: +programMapTable.video,\n            codec: 'avc',\n            type: 'video'\n          });\n        }\n\n        if (programMapTable.audio !== null) {\n          pmt.tracks.push({\n            timelineStartInfo: {\n              baseMediaDecodeTime: 0\n            },\n            id: +programMapTable.audio,\n            codec: 'adts',\n            type: 'audio'\n          });\n        }\n\n        self.trigger('data', pmt);\n      }\n\n      segmentHadPmt = false;\n      this.flushStreams_();\n      this.trigger('done');\n    };\n  };\n\n  _ElementaryStream.prototype = new stream();\n  var m2ts = {\n    PAT_PID: 0x0000,\n    MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,\n    TransportPacketStream: _TransportPacketStream,\n    TransportParseStream: _TransportParseStream,\n    ElementaryStream: _ElementaryStream,\n    TimestampRolloverStream: TimestampRolloverStream,\n    CaptionStream: captionStream.CaptionStream,\n    Cea608Stream: captionStream.Cea608Stream,\n    Cea708Stream: captionStream.Cea708Stream,\n    MetadataStream: metadataStream\n  };\n\n  for (var type in streamTypes) {\n    if (streamTypes.hasOwnProperty(type)) {\n      m2ts[type] = streamTypes[type];\n    }\n  }\n\n  var m2ts_1 = m2ts;\n  var ONE_SECOND_IN_TS$2 = clock.ONE_SECOND_IN_TS;\n\n  var _AdtsStream;\n\n  var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n  /*\n   * Accepts a ElementaryStream and emits data events with parsed\n   * AAC Audio Frames of the individual packets. Input audio in ADTS\n   * format is unpacked and re-emitted as AAC frames.\n   *\n   * @see http://wiki.multimedia.cx/index.php?title=ADTS\n   * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n   */\n\n  _AdtsStream = function AdtsStream(handlePartialSegments) {\n    var buffer,\n        frameNum = 0;\n\n    _AdtsStream.prototype.init.call(this);\n\n    this.skipWarn_ = function (start, end) {\n      this.trigger('log', {\n        level: 'warn',\n        message: \"adts skiping bytes \" + start + \" to \" + end + \" in frame \" + frameNum + \" outside syncword\"\n      });\n    };\n\n    this.push = function (packet) {\n      var i = 0,\n          frameLength,\n          protectionSkipBytes,\n          oldBuffer,\n          sampleCount,\n          adtsFrameDuration;\n\n      if (!handlePartialSegments) {\n        frameNum = 0;\n      }\n\n      if (packet.type !== 'audio') {\n        // ignore non-audio data\n        return;\n      } // Prepend any data in the buffer to the input data so that we can parse\n      // aac frames the cross a PES packet boundary\n\n\n      if (buffer && buffer.length) {\n        oldBuffer = buffer;\n        buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n        buffer.set(oldBuffer);\n        buffer.set(packet.data, oldBuffer.byteLength);\n      } else {\n        buffer = packet.data;\n      } // unpack any ADTS frames which have been fully received\n      // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n\n      var skip; // We use i + 7 here because we want to be able to parse the entire header.\n      // If we don't have enough bytes to do that, then we definitely won't have a full frame.\n\n      while (i + 7 < buffer.length) {\n        // Look for the start of an ADTS header..\n        if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n          if (typeof skip !== 'number') {\n            skip = i;\n          } // If a valid header was not found,  jump one forward and attempt to\n          // find a valid ADTS header starting at the next byte\n\n\n          i++;\n          continue;\n        }\n\n        if (typeof skip === 'number') {\n          this.skipWarn_(skip, i);\n          skip = null;\n        } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n        // end of the ADTS header\n\n\n        protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n        // end of the sync sequence\n        // NOTE: frame length includes the size of the header\n\n        frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n        sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n        adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2]; // If we don't have enough data to actually finish this ADTS frame,\n        // then we have to wait for more data\n\n        if (buffer.byteLength - i < frameLength) {\n          break;\n        } // Otherwise, deliver the complete AAC frame\n\n\n        this.trigger('data', {\n          pts: packet.pts + frameNum * adtsFrameDuration,\n          dts: packet.dts + frameNum * adtsFrameDuration,\n          sampleCount: sampleCount,\n          audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n          channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n          samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2],\n          samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n          // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n          samplesize: 16,\n          // data is the frame without it's header\n          data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength)\n        });\n        frameNum++;\n        i += frameLength;\n      }\n\n      if (typeof skip === 'number') {\n        this.skipWarn_(skip, i);\n        skip = null;\n      } // remove processed bytes from the buffer.\n\n\n      buffer = buffer.subarray(i);\n    };\n\n    this.flush = function () {\n      frameNum = 0;\n      this.trigger('done');\n    };\n\n    this.reset = function () {\n      buffer = void 0;\n      this.trigger('reset');\n    };\n\n    this.endTimeline = function () {\n      buffer = void 0;\n      this.trigger('endedtimeline');\n    };\n  };\n\n  _AdtsStream.prototype = new stream();\n  var adts = _AdtsStream;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var ExpGolomb;\n  /**\n   * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n   * scheme used by h264.\n   */\n\n  ExpGolomb = function ExpGolomb(workingData) {\n    var // the number of bytes left to examine in workingData\n    workingBytesAvailable = workingData.byteLength,\n        // the current word being examined\n    workingWord = 0,\n        // :uint\n    // the number of bits left to examine in the current word\n    workingBitsAvailable = 0; // :uint;\n    // ():uint\n\n    this.length = function () {\n      return 8 * workingBytesAvailable;\n    }; // ():uint\n\n\n    this.bitsAvailable = function () {\n      return 8 * workingBytesAvailable + workingBitsAvailable;\n    }; // ():void\n\n\n    this.loadWord = function () {\n      var position = workingData.byteLength - workingBytesAvailable,\n          workingBytes = new Uint8Array(4),\n          availableBytes = Math.min(4, workingBytesAvailable);\n\n      if (availableBytes === 0) {\n        throw new Error('no bytes available');\n      }\n\n      workingBytes.set(workingData.subarray(position, position + availableBytes));\n      workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n      workingBitsAvailable = availableBytes * 8;\n      workingBytesAvailable -= availableBytes;\n    }; // (count:int):void\n\n\n    this.skipBits = function (count) {\n      var skipBytes; // :int\n\n      if (workingBitsAvailable > count) {\n        workingWord <<= count;\n        workingBitsAvailable -= count;\n      } else {\n        count -= workingBitsAvailable;\n        skipBytes = Math.floor(count / 8);\n        count -= skipBytes * 8;\n        workingBytesAvailable -= skipBytes;\n        this.loadWord();\n        workingWord <<= count;\n        workingBitsAvailable -= count;\n      }\n    }; // (size:int):uint\n\n\n    this.readBits = function (size) {\n      var bits = Math.min(workingBitsAvailable, size),\n          // :uint\n      valu = workingWord >>> 32 - bits; // :uint\n      // if size > 31, handle error\n\n      workingBitsAvailable -= bits;\n\n      if (workingBitsAvailable > 0) {\n        workingWord <<= bits;\n      } else if (workingBytesAvailable > 0) {\n        this.loadWord();\n      }\n\n      bits = size - bits;\n\n      if (bits > 0) {\n        return valu << bits | this.readBits(bits);\n      }\n\n      return valu;\n    }; // ():uint\n\n\n    this.skipLeadingZeros = function () {\n      var leadingZeroCount; // :uint\n\n      for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n        if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n          // the first bit of working word is 1\n          workingWord <<= leadingZeroCount;\n          workingBitsAvailable -= leadingZeroCount;\n          return leadingZeroCount;\n        }\n      } // we exhausted workingWord and still have not found a 1\n\n\n      this.loadWord();\n      return leadingZeroCount + this.skipLeadingZeros();\n    }; // ():void\n\n\n    this.skipUnsignedExpGolomb = function () {\n      this.skipBits(1 + this.skipLeadingZeros());\n    }; // ():void\n\n\n    this.skipExpGolomb = function () {\n      this.skipBits(1 + this.skipLeadingZeros());\n    }; // ():uint\n\n\n    this.readUnsignedExpGolomb = function () {\n      var clz = this.skipLeadingZeros(); // :uint\n\n      return this.readBits(clz + 1) - 1;\n    }; // ():int\n\n\n    this.readExpGolomb = function () {\n      var valu = this.readUnsignedExpGolomb(); // :int\n\n      if (0x01 & valu) {\n        // the number is odd if the low order bit is set\n        return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n      }\n\n      return -1 * (valu >>> 1); // divide by two then make it negative\n    }; // Some convenience functions\n    // :Boolean\n\n\n    this.readBoolean = function () {\n      return this.readBits(1) === 1;\n    }; // ():int\n\n\n    this.readUnsignedByte = function () {\n      return this.readBits(8);\n    };\n\n    this.loadWord();\n  };\n\n  var expGolomb = ExpGolomb;\n\n  var _H264Stream, _NalByteStream;\n\n  var PROFILES_WITH_OPTIONAL_SPS_DATA;\n  /**\n   * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n   */\n\n  _NalByteStream = function NalByteStream() {\n    var syncPoint = 0,\n        i,\n        buffer;\n\n    _NalByteStream.prototype.init.call(this);\n    /*\n     * Scans a byte stream and triggers a data event with the NAL units found.\n     * @param {Object} data Event received from H264Stream\n     * @param {Uint8Array} data.data The h264 byte stream to be scanned\n     *\n     * @see H264Stream.push\n     */\n\n\n    this.push = function (data) {\n      var swapBuffer;\n\n      if (!buffer) {\n        buffer = data.data;\n      } else {\n        swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n        swapBuffer.set(buffer);\n        swapBuffer.set(data.data, buffer.byteLength);\n        buffer = swapBuffer;\n      }\n\n      var len = buffer.byteLength; // Rec. ITU-T H.264, Annex B\n      // scan for NAL unit boundaries\n      // a match looks like this:\n      // 0 0 1 .. NAL .. 0 0 1\n      // ^ sync point        ^ i\n      // or this:\n      // 0 0 1 .. NAL .. 0 0 0\n      // ^ sync point        ^ i\n      // advance the sync point to a NAL start, if necessary\n\n      for (; syncPoint < len - 3; syncPoint++) {\n        if (buffer[syncPoint + 2] === 1) {\n          // the sync point is properly aligned\n          i = syncPoint + 5;\n          break;\n        }\n      }\n\n      while (i < len) {\n        // look at the current byte to determine if we've hit the end of\n        // a NAL unit boundary\n        switch (buffer[i]) {\n          case 0:\n            // skip past non-sync sequences\n            if (buffer[i - 1] !== 0) {\n              i += 2;\n              break;\n            } else if (buffer[i - 2] !== 0) {\n              i++;\n              break;\n            } // deliver the NAL unit if it isn't empty\n\n\n            if (syncPoint + 3 !== i - 2) {\n              this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n            } // drop trailing zeroes\n\n\n            do {\n              i++;\n            } while (buffer[i] !== 1 && i < len);\n\n            syncPoint = i - 2;\n            i += 3;\n            break;\n\n          case 1:\n            // skip past non-sync sequences\n            if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n              i += 3;\n              break;\n            } // deliver the NAL unit\n\n\n            this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n            syncPoint = i - 2;\n            i += 3;\n            break;\n\n          default:\n            // the current byte isn't a one or zero, so it cannot be part\n            // of a sync sequence\n            i += 3;\n            break;\n        }\n      } // filter out the NAL units that were delivered\n\n\n      buffer = buffer.subarray(syncPoint);\n      i -= syncPoint;\n      syncPoint = 0;\n    };\n\n    this.reset = function () {\n      buffer = null;\n      syncPoint = 0;\n      this.trigger('reset');\n    };\n\n    this.flush = function () {\n      // deliver the last buffered NAL unit\n      if (buffer && buffer.byteLength > 3) {\n        this.trigger('data', buffer.subarray(syncPoint + 3));\n      } // reset the stream state\n\n\n      buffer = null;\n      syncPoint = 0;\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n  };\n\n  _NalByteStream.prototype = new stream(); // values of profile_idc that indicate additional fields are included in the SPS\n  // see Recommendation ITU-T H.264 (4/2013),\n  // 7.3.2.1.1 Sequence parameter set data syntax\n\n  PROFILES_WITH_OPTIONAL_SPS_DATA = {\n    100: true,\n    110: true,\n    122: true,\n    244: true,\n    44: true,\n    83: true,\n    86: true,\n    118: true,\n    128: true,\n    // TODO: the three profiles below don't\n    // appear to have sps data in the specificiation anymore?\n    138: true,\n    139: true,\n    134: true\n  };\n  /**\n   * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n   * events.\n   */\n\n  _H264Stream = function H264Stream() {\n    var nalByteStream = new _NalByteStream(),\n        self,\n        trackId,\n        currentPts,\n        currentDts,\n        discardEmulationPreventionBytes,\n        readSequenceParameterSet,\n        skipScalingList;\n\n    _H264Stream.prototype.init.call(this);\n\n    self = this;\n    /*\n     * Pushes a packet from a stream onto the NalByteStream\n     *\n     * @param {Object} packet - A packet received from a stream\n     * @param {Uint8Array} packet.data - The raw bytes of the packet\n     * @param {Number} packet.dts - Decode timestamp of the packet\n     * @param {Number} packet.pts - Presentation timestamp of the packet\n     * @param {Number} packet.trackId - The id of the h264 track this packet came from\n     * @param {('video'|'audio')} packet.type - The type of packet\n     *\n     */\n\n    this.push = function (packet) {\n      if (packet.type !== 'video') {\n        return;\n      }\n\n      trackId = packet.trackId;\n      currentPts = packet.pts;\n      currentDts = packet.dts;\n      nalByteStream.push(packet);\n    };\n    /*\n     * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n     * for the NALUs to the next stream component.\n     * Also, preprocess caption and sequence parameter NALUs.\n     *\n     * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n     * @see NalByteStream.push\n     */\n\n\n    nalByteStream.on('data', function (data) {\n      var event = {\n        trackId: trackId,\n        pts: currentPts,\n        dts: currentDts,\n        data: data,\n        nalUnitTypeCode: data[0] & 0x1f\n      };\n\n      switch (event.nalUnitTypeCode) {\n        case 0x05:\n          event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n          break;\n\n        case 0x06:\n          event.nalUnitType = 'sei_rbsp';\n          event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n          break;\n\n        case 0x07:\n          event.nalUnitType = 'seq_parameter_set_rbsp';\n          event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n          event.config = readSequenceParameterSet(event.escapedRBSP);\n          break;\n\n        case 0x08:\n          event.nalUnitType = 'pic_parameter_set_rbsp';\n          break;\n\n        case 0x09:\n          event.nalUnitType = 'access_unit_delimiter_rbsp';\n          break;\n      } // This triggers data on the H264Stream\n\n\n      self.trigger('data', event);\n    });\n    nalByteStream.on('done', function () {\n      self.trigger('done');\n    });\n    nalByteStream.on('partialdone', function () {\n      self.trigger('partialdone');\n    });\n    nalByteStream.on('reset', function () {\n      self.trigger('reset');\n    });\n    nalByteStream.on('endedtimeline', function () {\n      self.trigger('endedtimeline');\n    });\n\n    this.flush = function () {\n      nalByteStream.flush();\n    };\n\n    this.partialFlush = function () {\n      nalByteStream.partialFlush();\n    };\n\n    this.reset = function () {\n      nalByteStream.reset();\n    };\n\n    this.endTimeline = function () {\n      nalByteStream.endTimeline();\n    };\n    /**\n     * Advance the ExpGolomb decoder past a scaling list. The scaling\n     * list is optionally transmitted as part of a sequence parameter\n     * set and is not relevant to transmuxing.\n     * @param count {number} the number of entries in this scaling list\n     * @param expGolombDecoder {object} an ExpGolomb pointed to the\n     * start of a scaling list\n     * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n     */\n\n\n    skipScalingList = function skipScalingList(count, expGolombDecoder) {\n      var lastScale = 8,\n          nextScale = 8,\n          j,\n          deltaScale;\n\n      for (j = 0; j < count; j++) {\n        if (nextScale !== 0) {\n          deltaScale = expGolombDecoder.readExpGolomb();\n          nextScale = (lastScale + deltaScale + 256) % 256;\n        }\n\n        lastScale = nextScale === 0 ? lastScale : nextScale;\n      }\n    };\n    /**\n     * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n     * Sequence Payload\"\n     * @param data {Uint8Array} the bytes of a RBSP from a NAL\n     * unit\n     * @return {Uint8Array} the RBSP without any Emulation\n     * Prevention Bytes\n     */\n\n\n    discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n      var length = data.byteLength,\n          emulationPreventionBytesPositions = [],\n          i = 1,\n          newLength,\n          newData; // Find all `Emulation Prevention Bytes`\n\n      while (i < length - 2) {\n        if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n          emulationPreventionBytesPositions.push(i + 2);\n          i += 2;\n        } else {\n          i++;\n        }\n      } // If no Emulation Prevention Bytes were found just return the original\n      // array\n\n\n      if (emulationPreventionBytesPositions.length === 0) {\n        return data;\n      } // Create a new array to hold the NAL unit data\n\n\n      newLength = length - emulationPreventionBytesPositions.length;\n      newData = new Uint8Array(newLength);\n      var sourceIndex = 0;\n\n      for (i = 0; i < newLength; sourceIndex++, i++) {\n        if (sourceIndex === emulationPreventionBytesPositions[0]) {\n          // Skip this byte\n          sourceIndex++; // Remove this position index\n\n          emulationPreventionBytesPositions.shift();\n        }\n\n        newData[i] = data[sourceIndex];\n      }\n\n      return newData;\n    };\n    /**\n     * Read a sequence parameter set and return some interesting video\n     * properties. A sequence parameter set is the H264 metadata that\n     * describes the properties of upcoming video frames.\n     * @param data {Uint8Array} the bytes of a sequence parameter set\n     * @return {object} an object with configuration parsed from the\n     * sequence parameter set, including the dimensions of the\n     * associated video frames.\n     */\n\n\n    readSequenceParameterSet = function readSequenceParameterSet(data) {\n      var frameCropLeftOffset = 0,\n          frameCropRightOffset = 0,\n          frameCropTopOffset = 0,\n          frameCropBottomOffset = 0,\n          expGolombDecoder,\n          profileIdc,\n          levelIdc,\n          profileCompatibility,\n          chromaFormatIdc,\n          picOrderCntType,\n          numRefFramesInPicOrderCntCycle,\n          picWidthInMbsMinus1,\n          picHeightInMapUnitsMinus1,\n          frameMbsOnlyFlag,\n          scalingListCount,\n          sarRatio = [1, 1],\n          aspectRatioIdc,\n          i;\n      expGolombDecoder = new expGolomb(data);\n      profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n      profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n      levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n      // some profiles have more optional data we don't need\n\n      if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n        chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n\n        if (chromaFormatIdc === 3) {\n          expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n        }\n\n        expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n        expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n        expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n        if (expGolombDecoder.readBoolean()) {\n          // seq_scaling_matrix_present_flag\n          scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\n          for (i = 0; i < scalingListCount; i++) {\n            if (expGolombDecoder.readBoolean()) {\n              // seq_scaling_list_present_flag[ i ]\n              if (i < 6) {\n                skipScalingList(16, expGolombDecoder);\n              } else {\n                skipScalingList(64, expGolombDecoder);\n              }\n            }\n          }\n        }\n      }\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n      picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n      if (picOrderCntType === 0) {\n        expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n      } else if (picOrderCntType === 1) {\n        expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n        expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n        expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n        numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n\n        for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n          expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n        }\n      }\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n      expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n      picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n      picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n      frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n\n      if (frameMbsOnlyFlag === 0) {\n        expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n      }\n\n      expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n      if (expGolombDecoder.readBoolean()) {\n        // frame_cropping_flag\n        frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n      }\n\n      if (expGolombDecoder.readBoolean()) {\n        // vui_parameters_present_flag\n        if (expGolombDecoder.readBoolean()) {\n          // aspect_ratio_info_present_flag\n          aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n\n          switch (aspectRatioIdc) {\n            case 1:\n              sarRatio = [1, 1];\n              break;\n\n            case 2:\n              sarRatio = [12, 11];\n              break;\n\n            case 3:\n              sarRatio = [10, 11];\n              break;\n\n            case 4:\n              sarRatio = [16, 11];\n              break;\n\n            case 5:\n              sarRatio = [40, 33];\n              break;\n\n            case 6:\n              sarRatio = [24, 11];\n              break;\n\n            case 7:\n              sarRatio = [20, 11];\n              break;\n\n            case 8:\n              sarRatio = [32, 11];\n              break;\n\n            case 9:\n              sarRatio = [80, 33];\n              break;\n\n            case 10:\n              sarRatio = [18, 11];\n              break;\n\n            case 11:\n              sarRatio = [15, 11];\n              break;\n\n            case 12:\n              sarRatio = [64, 33];\n              break;\n\n            case 13:\n              sarRatio = [160, 99];\n              break;\n\n            case 14:\n              sarRatio = [4, 3];\n              break;\n\n            case 15:\n              sarRatio = [3, 2];\n              break;\n\n            case 16:\n              sarRatio = [2, 1];\n              break;\n\n            case 255:\n              {\n                sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n                break;\n              }\n          }\n\n          if (sarRatio) {\n            sarRatio[0] / sarRatio[1];\n          }\n        }\n      }\n\n      return {\n        profileIdc: profileIdc,\n        levelIdc: levelIdc,\n        profileCompatibility: profileCompatibility,\n        width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,\n        height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,\n        // sar is sample aspect ratio\n        sarRatio: sarRatio\n      };\n    };\n  };\n\n  _H264Stream.prototype = new stream();\n  var h264 = {\n    H264Stream: _H264Stream,\n    NalByteStream: _NalByteStream\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Utilities to detect basic properties and metadata about Aac data.\n   */\n\n  var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n  var parseId3TagSize = function parseId3TagSize(header, byteIndex) {\n    var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n        flags = header[byteIndex + 5],\n        footerPresent = (flags & 16) >> 4; // if we get a negative returnSize clamp it to 0\n\n    returnSize = returnSize >= 0 ? returnSize : 0;\n\n    if (footerPresent) {\n      return returnSize + 20;\n    }\n\n    return returnSize + 10;\n  };\n\n  var getId3Offset = function getId3Offset(data, offset) {\n    if (data.length - offset < 10 || data[offset] !== 'I'.charCodeAt(0) || data[offset + 1] !== 'D'.charCodeAt(0) || data[offset + 2] !== '3'.charCodeAt(0)) {\n      return offset;\n    }\n\n    offset += parseId3TagSize(data, offset);\n    return getId3Offset(data, offset);\n  }; // TODO: use vhs-utils\n\n\n  var isLikelyAacData$1 = function isLikelyAacData(data) {\n    var offset = getId3Offset(data, 0);\n    return data.length >= offset + 2 && (data[offset] & 0xFF) === 0xFF && (data[offset + 1] & 0xF0) === 0xF0 && // verify that the 2 layer bits are 0, aka this\n    // is not mp3 data but aac data.\n    (data[offset + 1] & 0x16) === 0x10;\n  };\n\n  var parseSyncSafeInteger = function parseSyncSafeInteger(data) {\n    return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n  }; // return a percent-encoded representation of the specified byte range\n  // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n\n  var percentEncode = function percentEncode(bytes, start, end) {\n    var i,\n        result = '';\n\n    for (i = start; i < end; i++) {\n      result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n    }\n\n    return result;\n  }; // return the string representation of the specified byte range,\n  // interpreted as ISO-8859-1.\n\n\n  var parseIso88591 = function parseIso88591(bytes, start, end) {\n    return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n  };\n\n  var parseAdtsSize = function parseAdtsSize(header, byteIndex) {\n    var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n        middle = header[byteIndex + 4] << 3,\n        highTwo = header[byteIndex + 3] & 0x3 << 11;\n    return highTwo | middle | lowThree;\n  };\n\n  var parseType$2 = function parseType(header, byteIndex) {\n    if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n      return 'timed-metadata';\n    } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n      return 'audio';\n    }\n\n    return null;\n  };\n\n  var parseSampleRate = function parseSampleRate(packet) {\n    var i = 0;\n\n    while (i + 5 < packet.length) {\n      if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n        // If a valid header was not found,  jump one forward and attempt to\n        // find a valid ADTS header starting at the next byte\n        i++;\n        continue;\n      }\n\n      return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n    }\n\n    return null;\n  };\n\n  var parseAacTimestamp = function parseAacTimestamp(packet) {\n    var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n    frameStart = 10;\n\n    if (packet[5] & 0x40) {\n      // advance the frame start past the extended header\n      frameStart += 4; // header size field\n\n      frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n    } // parse one or more ID3 frames\n    // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n    do {\n      // determine the number of bytes in this frame\n      frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n\n      if (frameSize < 1) {\n        return null;\n      }\n\n      frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n\n      if (frameHeader === 'PRIV') {\n        frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n        for (var i = 0; i < frame.byteLength; i++) {\n          if (frame[i] === 0) {\n            var owner = parseIso88591(frame, 0, i);\n\n            if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n              var d = frame.subarray(i + 1);\n              var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n              size *= 4;\n              size += d[7] & 0x03;\n              return size;\n            }\n\n            break;\n          }\n        }\n      }\n\n      frameStart += 10; // advance past the frame header\n\n      frameStart += frameSize; // advance past the frame body\n    } while (frameStart < packet.byteLength);\n\n    return null;\n  };\n\n  var utils = {\n    isLikelyAacData: isLikelyAacData$1,\n    parseId3TagSize: parseId3TagSize,\n    parseAdtsSize: parseAdtsSize,\n    parseType: parseType$2,\n    parseSampleRate: parseSampleRate,\n    parseAacTimestamp: parseAacTimestamp\n  };\n\n  var _AacStream;\n  /**\n   * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n   */\n\n\n  _AacStream = function AacStream() {\n    var everything = new Uint8Array(),\n        timeStamp = 0;\n\n    _AacStream.prototype.init.call(this);\n\n    this.setTimestamp = function (timestamp) {\n      timeStamp = timestamp;\n    };\n\n    this.push = function (bytes) {\n      var frameSize = 0,\n          byteIndex = 0,\n          bytesLeft,\n          chunk,\n          packet,\n          tempLength; // If there are bytes remaining from the last segment, prepend them to the\n      // bytes that were pushed in\n\n      if (everything.length) {\n        tempLength = everything.length;\n        everything = new Uint8Array(bytes.byteLength + tempLength);\n        everything.set(everything.subarray(0, tempLength));\n        everything.set(bytes, tempLength);\n      } else {\n        everything = bytes;\n      }\n\n      while (everything.length - byteIndex >= 3) {\n        if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n          // Exit early because we don't have enough to parse\n          // the ID3 tag header\n          if (everything.length - byteIndex < 10) {\n            break;\n          } // check framesize\n\n\n          frameSize = utils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n          // Add to byteIndex to support multiple ID3 tags in sequence\n\n          if (byteIndex + frameSize > everything.length) {\n            break;\n          }\n\n          chunk = {\n            type: 'timed-metadata',\n            data: everything.subarray(byteIndex, byteIndex + frameSize)\n          };\n          this.trigger('data', chunk);\n          byteIndex += frameSize;\n          continue;\n        } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n          // Exit early because we don't have enough to parse\n          // the ADTS frame header\n          if (everything.length - byteIndex < 7) {\n            break;\n          }\n\n          frameSize = utils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (byteIndex + frameSize > everything.length) {\n            break;\n          }\n\n          packet = {\n            type: 'audio',\n            data: everything.subarray(byteIndex, byteIndex + frameSize),\n            pts: timeStamp,\n            dts: timeStamp\n          };\n          this.trigger('data', packet);\n          byteIndex += frameSize;\n          continue;\n        }\n\n        byteIndex++;\n      }\n\n      bytesLeft = everything.length - byteIndex;\n\n      if (bytesLeft > 0) {\n        everything = everything.subarray(byteIndex);\n      } else {\n        everything = new Uint8Array();\n      }\n    };\n\n    this.reset = function () {\n      everything = new Uint8Array();\n      this.trigger('reset');\n    };\n\n    this.endTimeline = function () {\n      everything = new Uint8Array();\n      this.trigger('endedtimeline');\n    };\n  };\n\n  _AacStream.prototype = new stream();\n  var aac = _AacStream; // constants\n\n  var AUDIO_PROPERTIES = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n  var audioProperties = AUDIO_PROPERTIES;\n  var VIDEO_PROPERTIES = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'];\n  var videoProperties = VIDEO_PROPERTIES;\n  var H264Stream = h264.H264Stream;\n  var isLikelyAacData = utils.isLikelyAacData;\n  var ONE_SECOND_IN_TS$1 = clock.ONE_SECOND_IN_TS; // object types\n\n  var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;\n\n  var retriggerForStream = function retriggerForStream(key, event) {\n    event.stream = key;\n    this.trigger('log', event);\n  };\n\n  var addPipelineLogRetriggers = function addPipelineLogRetriggers(transmuxer, pipeline) {\n    var keys = Object.keys(pipeline);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]; // skip non-stream keys and headOfPipeline\n      // which is just a duplicate\n\n      if (key === 'headOfPipeline' || !pipeline[key].on) {\n        continue;\n      }\n\n      pipeline[key].on('log', retriggerForStream.bind(transmuxer, key));\n    }\n  };\n  /**\n   * Compare two arrays (even typed) for same-ness\n   */\n\n\n  var arrayEquals = function arrayEquals(a, b) {\n    var i;\n\n    if (a.length !== b.length) {\n      return false;\n    } // compare the value of each element in the array\n\n\n    for (i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var generateSegmentTimingInfo = function generateSegmentTimingInfo(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {\n    var ptsOffsetFromDts = startPts - startDts,\n        decodeDuration = endDts - startDts,\n        presentationDuration = endPts - startPts; // The PTS and DTS values are based on the actual stream times from the segment,\n    // however, the player time values will reflect a start from the baseMediaDecodeTime.\n    // In order to provide relevant values for the player times, base timing info on the\n    // baseMediaDecodeTime and the DTS and PTS durations of the segment.\n\n    return {\n      start: {\n        dts: baseMediaDecodeTime,\n        pts: baseMediaDecodeTime + ptsOffsetFromDts\n      },\n      end: {\n        dts: baseMediaDecodeTime + decodeDuration,\n        pts: baseMediaDecodeTime + presentationDuration\n      },\n      prependedContentDuration: prependedContentDuration,\n      baseMediaDecodeTime: baseMediaDecodeTime\n    };\n  };\n  /**\n   * Constructs a single-track, ISO BMFF media segment from AAC data\n   * events. The output of this stream can be fed to a SourceBuffer\n   * configured with a suitable initialization segment.\n   * @param track {object} track metadata configuration\n   * @param options {object} transmuxer options object\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n\n  _AudioSegmentStream = function AudioSegmentStream(track, options) {\n    var adtsFrames = [],\n        sequenceNumber,\n        earliestAllowedDts = 0,\n        audioAppendStartTs = 0,\n        videoBaseMediaDecodeTime = Infinity;\n    options = options || {};\n    sequenceNumber = options.firstSequenceNumber || 0;\n\n    _AudioSegmentStream.prototype.init.call(this);\n\n    this.push = function (data) {\n      trackDecodeInfo.collectDtsInfo(track, data);\n\n      if (track) {\n        audioProperties.forEach(function (prop) {\n          track[prop] = data[prop];\n        });\n      } // buffer audio data until end() is called\n\n\n      adtsFrames.push(data);\n    };\n\n    this.setEarliestDts = function (earliestDts) {\n      earliestAllowedDts = earliestDts;\n    };\n\n    this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n      videoBaseMediaDecodeTime = baseMediaDecodeTime;\n    };\n\n    this.setAudioAppendStart = function (timestamp) {\n      audioAppendStartTs = timestamp;\n    };\n\n    this.flush = function () {\n      var frames, moof, mdat, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed; // return early if no audio data has been observed\n\n      if (adtsFrames.length === 0) {\n        this.trigger('done', 'AudioSegmentStream');\n        return;\n      }\n\n      frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n      track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps); // amount of audio filled but the value is in video clock rather than audio clock\n\n      videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n      // samples (that is, adts frames) in the audio data\n\n      track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n      mdat = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));\n      adtsFrames = [];\n      moof = mp4Generator.moof(sequenceNumber, [track]);\n      boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n      sequenceNumber++;\n      boxes.set(moof);\n      boxes.set(mdat, moof.byteLength);\n      trackDecodeInfo.clearDtsInfo(track);\n      frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 * 1024 / track.samplerate); // TODO this check was added to maintain backwards compatibility (particularly with\n      // tests) on adding the timingInfo event. However, it seems unlikely that there's a\n      // valid use-case where an init segment/data should be triggered without associated\n      // frames. Leaving for now, but should be looked into.\n\n      if (frames.length) {\n        segmentDuration = frames.length * frameDuration;\n        this.trigger('segmentTimingInfo', generateSegmentTimingInfo( // The audio track's baseMediaDecodeTime is in audio clock cycles, but the\n        // frame info is in video clock cycles. Convert to match expectation of\n        // listeners (that all timestamps will be based on video clock cycles).\n        clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), // frame times are already in video clock, as is segment duration\n        frames[0].dts, frames[0].pts, frames[0].dts + segmentDuration, frames[0].pts + segmentDuration, videoClockCyclesOfSilencePrefixed || 0));\n        this.trigger('timingInfo', {\n          start: frames[0].pts,\n          end: frames[0].pts + segmentDuration\n        });\n      }\n\n      this.trigger('data', {\n        track: track,\n        boxes: boxes\n      });\n      this.trigger('done', 'AudioSegmentStream');\n    };\n\n    this.reset = function () {\n      trackDecodeInfo.clearDtsInfo(track);\n      adtsFrames = [];\n      this.trigger('reset');\n    };\n  };\n\n  _AudioSegmentStream.prototype = new stream();\n  /**\n   * Constructs a single-track, ISO BMFF media segment from H264 data\n   * events. The output of this stream can be fed to a SourceBuffer\n   * configured with a suitable initialization segment.\n   * @param track {object} track metadata configuration\n   * @param options {object} transmuxer options object\n   * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n   *        gopsToAlignWith list when attempting to align gop pts\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n  _VideoSegmentStream = function VideoSegmentStream(track, options) {\n    var sequenceNumber,\n        nalUnits = [],\n        gopsToAlignWith = [],\n        config,\n        pps;\n    options = options || {};\n    sequenceNumber = options.firstSequenceNumber || 0;\n\n    _VideoSegmentStream.prototype.init.call(this);\n\n    delete track.minPTS;\n    this.gopCache_ = [];\n    /**\n      * Constructs a ISO BMFF segment given H264 nalUnits\n      * @param {Object} nalUnit A data event representing a nalUnit\n      * @param {String} nalUnit.nalUnitType\n      * @param {Object} nalUnit.config Properties for a mp4 track\n      * @param {Uint8Array} nalUnit.data The nalUnit bytes\n      * @see lib/codecs/h264.js\n     **/\n\n    this.push = function (nalUnit) {\n      trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n      if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n        config = nalUnit.config;\n        track.sps = [nalUnit.data];\n        videoProperties.forEach(function (prop) {\n          track[prop] = config[prop];\n        }, this);\n      }\n\n      if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n        pps = nalUnit.data;\n        track.pps = [nalUnit.data];\n      } // buffer video until flush() is called\n\n\n      nalUnits.push(nalUnit);\n    };\n    /**\n      * Pass constructed ISO BMFF track and boxes on to the\n      * next stream in the pipeline\n     **/\n\n\n    this.flush = function () {\n      var frames,\n          gopForFusion,\n          gops,\n          moof,\n          mdat,\n          boxes,\n          prependedContentDuration = 0,\n          firstGop,\n          lastGop; // Throw away nalUnits at the start of the byte stream until\n      // we find the first AUD\n\n      while (nalUnits.length) {\n        if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n          break;\n        }\n\n        nalUnits.shift();\n      } // Return early if no video data has been observed\n\n\n      if (nalUnits.length === 0) {\n        this.resetStream_();\n        this.trigger('done', 'VideoSegmentStream');\n        return;\n      } // Organize the raw nal-units into arrays that represent\n      // higher-level constructs such as frames and gops\n      // (group-of-pictures)\n\n\n      frames = frameUtils.groupNalsIntoFrames(nalUnits);\n      gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n      // a problem since MSE (on Chrome) requires a leading keyframe.\n      //\n      // We have two approaches to repairing this situation:\n      // 1) GOP-FUSION:\n      //    This is where we keep track of the GOPS (group-of-pictures)\n      //    from previous fragments and attempt to find one that we can\n      //    prepend to the current fragment in order to create a valid\n      //    fragment.\n      // 2) KEYFRAME-PULLING:\n      //    Here we search for the first keyframe in the fragment and\n      //    throw away all the frames between the start of the fragment\n      //    and that keyframe. We then extend the duration and pull the\n      //    PTS of the keyframe forward so that it covers the time range\n      //    of the frames that were disposed of.\n      //\n      // #1 is far prefereable over #2 which can cause \"stuttering\" but\n      // requires more things to be just right.\n\n      if (!gops[0][0].keyFrame) {\n        // Search for a gop for fusion from our gopCache\n        gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n        if (gopForFusion) {\n          // in order to provide more accurate timing information about the segment, save\n          // the number of seconds prepended to the original segment due to GOP fusion\n          prependedContentDuration = gopForFusion.duration;\n          gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n          // new gop at the beginning\n\n          gops.byteLength += gopForFusion.byteLength;\n          gops.nalCount += gopForFusion.nalCount;\n          gops.pts = gopForFusion.pts;\n          gops.dts = gopForFusion.dts;\n          gops.duration += gopForFusion.duration;\n        } else {\n          // If we didn't find a candidate gop fall back to keyframe-pulling\n          gops = frameUtils.extendFirstKeyFrame(gops);\n        }\n      } // Trim gops to align with gopsToAlignWith\n\n\n      if (gopsToAlignWith.length) {\n        var alignedGops;\n\n        if (options.alignGopsAtEnd) {\n          alignedGops = this.alignGopsAtEnd_(gops);\n        } else {\n          alignedGops = this.alignGopsAtStart_(gops);\n        }\n\n        if (!alignedGops) {\n          // save all the nals in the last GOP into the gop cache\n          this.gopCache_.unshift({\n            gop: gops.pop(),\n            pps: track.pps,\n            sps: track.sps\n          }); // Keep a maximum of 6 GOPs in the cache\n\n          this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n          nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n          this.resetStream_();\n          this.trigger('done', 'VideoSegmentStream');\n          return;\n        } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n        // when recalculated before sending off to CoalesceStream\n\n\n        trackDecodeInfo.clearDtsInfo(track);\n        gops = alignedGops;\n      }\n\n      trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n      // samples (that is, frames) in the video data\n\n      track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n      mdat = mp4Generator.mdat(frameUtils.concatenateNalData(gops));\n      track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n      this.trigger('processedGopsInfo', gops.map(function (gop) {\n        return {\n          pts: gop.pts,\n          dts: gop.dts,\n          byteLength: gop.byteLength\n        };\n      }));\n      firstGop = gops[0];\n      lastGop = gops[gops.length - 1];\n      this.trigger('segmentTimingInfo', generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));\n      this.trigger('timingInfo', {\n        start: gops[0].pts,\n        end: gops[gops.length - 1].pts + gops[gops.length - 1].duration\n      }); // save all the nals in the last GOP into the gop cache\n\n      this.gopCache_.unshift({\n        gop: gops.pop(),\n        pps: track.pps,\n        sps: track.sps\n      }); // Keep a maximum of 6 GOPs in the cache\n\n      this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n      nalUnits = [];\n      this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n      this.trigger('timelineStartInfo', track.timelineStartInfo);\n      moof = mp4Generator.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n      // throwing away hundreds of media segment fragments\n\n      boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n      sequenceNumber++;\n      boxes.set(moof);\n      boxes.set(mdat, moof.byteLength);\n      this.trigger('data', {\n        track: track,\n        boxes: boxes\n      });\n      this.resetStream_(); // Continue with the flush process now\n\n      this.trigger('done', 'VideoSegmentStream');\n    };\n\n    this.reset = function () {\n      this.resetStream_();\n      nalUnits = [];\n      this.gopCache_.length = 0;\n      gopsToAlignWith.length = 0;\n      this.trigger('reset');\n    };\n\n    this.resetStream_ = function () {\n      trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n      // for instance, when we are rendition switching\n\n      config = undefined;\n      pps = undefined;\n    }; // Search for a candidate Gop for gop-fusion from the gop cache and\n    // return it or return null if no good candidate was found\n\n\n    this.getGopForFusion_ = function (nalUnit) {\n      var halfSecond = 45000,\n          // Half-a-second in a 90khz clock\n      allowableOverlap = 10000,\n          // About 3 frames @ 30fps\n      nearestDistance = Infinity,\n          dtsDistance,\n          nearestGopObj,\n          currentGop,\n          currentGopObj,\n          i; // Search for the GOP nearest to the beginning of this nal unit\n\n      for (i = 0; i < this.gopCache_.length; i++) {\n        currentGopObj = this.gopCache_[i];\n        currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n        if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n          continue;\n        } // Reject Gops that would require a negative baseMediaDecodeTime\n\n\n        if (currentGop.dts < track.timelineStartInfo.dts) {\n          continue;\n        } // The distance between the end of the gop and the start of the nalUnit\n\n\n        dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n        // a half-second of the nal unit\n\n        if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n          // Always use the closest GOP we found if there is more than\n          // one candidate\n          if (!nearestGopObj || nearestDistance > dtsDistance) {\n            nearestGopObj = currentGopObj;\n            nearestDistance = dtsDistance;\n          }\n        }\n      }\n\n      if (nearestGopObj) {\n        return nearestGopObj.gop;\n      }\n\n      return null;\n    }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n    // of gopsToAlignWith starting from the START of the list\n\n\n    this.alignGopsAtStart_ = function (gops) {\n      var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n      byteLength = gops.byteLength;\n      nalCount = gops.nalCount;\n      duration = gops.duration;\n      alignIndex = gopIndex = 0;\n\n      while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n        align = gopsToAlignWith[alignIndex];\n        gop = gops[gopIndex];\n\n        if (align.pts === gop.pts) {\n          break;\n        }\n\n        if (gop.pts > align.pts) {\n          // this current gop starts after the current gop we want to align on, so increment\n          // align index\n          alignIndex++;\n          continue;\n        } // current gop starts before the current gop we want to align on. so increment gop\n        // index\n\n\n        gopIndex++;\n        byteLength -= gop.byteLength;\n        nalCount -= gop.nalCount;\n        duration -= gop.duration;\n      }\n\n      if (gopIndex === 0) {\n        // no gops to trim\n        return gops;\n      }\n\n      if (gopIndex === gops.length) {\n        // all gops trimmed, skip appending all gops\n        return null;\n      }\n\n      alignedGops = gops.slice(gopIndex);\n      alignedGops.byteLength = byteLength;\n      alignedGops.duration = duration;\n      alignedGops.nalCount = nalCount;\n      alignedGops.pts = alignedGops[0].pts;\n      alignedGops.dts = alignedGops[0].dts;\n      return alignedGops;\n    }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n    // of gopsToAlignWith starting from the END of the list\n\n\n    this.alignGopsAtEnd_ = function (gops) {\n      var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n      alignIndex = gopsToAlignWith.length - 1;\n      gopIndex = gops.length - 1;\n      alignEndIndex = null;\n      matchFound = false;\n\n      while (alignIndex >= 0 && gopIndex >= 0) {\n        align = gopsToAlignWith[alignIndex];\n        gop = gops[gopIndex];\n\n        if (align.pts === gop.pts) {\n          matchFound = true;\n          break;\n        }\n\n        if (align.pts > gop.pts) {\n          alignIndex--;\n          continue;\n        }\n\n        if (alignIndex === gopsToAlignWith.length - 1) {\n          // gop.pts is greater than the last alignment candidate. If no match is found\n          // by the end of this loop, we still want to append gops that come after this\n          // point\n          alignEndIndex = gopIndex;\n        }\n\n        gopIndex--;\n      }\n\n      if (!matchFound && alignEndIndex === null) {\n        return null;\n      }\n\n      var trimIndex;\n\n      if (matchFound) {\n        trimIndex = gopIndex;\n      } else {\n        trimIndex = alignEndIndex;\n      }\n\n      if (trimIndex === 0) {\n        return gops;\n      }\n\n      var alignedGops = gops.slice(trimIndex);\n      var metadata = alignedGops.reduce(function (total, gop) {\n        total.byteLength += gop.byteLength;\n        total.duration += gop.duration;\n        total.nalCount += gop.nalCount;\n        return total;\n      }, {\n        byteLength: 0,\n        duration: 0,\n        nalCount: 0\n      });\n      alignedGops.byteLength = metadata.byteLength;\n      alignedGops.duration = metadata.duration;\n      alignedGops.nalCount = metadata.nalCount;\n      alignedGops.pts = alignedGops[0].pts;\n      alignedGops.dts = alignedGops[0].dts;\n      return alignedGops;\n    };\n\n    this.alignGopsWith = function (newGopsToAlignWith) {\n      gopsToAlignWith = newGopsToAlignWith;\n    };\n  };\n\n  _VideoSegmentStream.prototype = new stream();\n  /**\n   * A Stream that can combine multiple streams (ie. audio & video)\n   * into a single output segment for MSE. Also supports audio-only\n   * and video-only streams.\n   * @param options {object} transmuxer options object\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at media timeline start.\n   */\n\n  _CoalesceStream = function CoalesceStream(options, metadataStream) {\n    // Number of Tracks per output segment\n    // If greater than 1, we combine multiple\n    // tracks into a single segment\n    this.numberOfTracks = 0;\n    this.metadataStream = metadataStream;\n    options = options || {};\n\n    if (typeof options.remux !== 'undefined') {\n      this.remuxTracks = !!options.remux;\n    } else {\n      this.remuxTracks = true;\n    }\n\n    if (typeof options.keepOriginalTimestamps === 'boolean') {\n      this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n    } else {\n      this.keepOriginalTimestamps = false;\n    }\n\n    this.pendingTracks = [];\n    this.videoTrack = null;\n    this.pendingBoxes = [];\n    this.pendingCaptions = [];\n    this.pendingMetadata = [];\n    this.pendingBytes = 0;\n    this.emittedTracks = 0;\n\n    _CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n\n    this.push = function (output) {\n      // buffer incoming captions until the associated video segment\n      // finishes\n      if (output.text) {\n        return this.pendingCaptions.push(output);\n      } // buffer incoming id3 tags until the final flush\n\n\n      if (output.frames) {\n        return this.pendingMetadata.push(output);\n      } // Add this track to the list of pending tracks and store\n      // important information required for the construction of\n      // the final segment\n\n\n      this.pendingTracks.push(output.track);\n      this.pendingBytes += output.boxes.byteLength; // TODO: is there an issue for this against chrome?\n      // We unshift audio and push video because\n      // as of Chrome 75 when switching from\n      // one init segment to another if the video\n      // mdat does not appear after the audio mdat\n      // only audio will play for the duration of our transmux.\n\n      if (output.track.type === 'video') {\n        this.videoTrack = output.track;\n        this.pendingBoxes.push(output.boxes);\n      }\n\n      if (output.track.type === 'audio') {\n        this.audioTrack = output.track;\n        this.pendingBoxes.unshift(output.boxes);\n      }\n    };\n  };\n\n  _CoalesceStream.prototype = new stream();\n\n  _CoalesceStream.prototype.flush = function (flushSource) {\n    var offset = 0,\n        event = {\n      captions: [],\n      captionStreams: {},\n      metadata: [],\n      info: {}\n    },\n        caption,\n        id3,\n        initSegment,\n        timelineStartPts = 0,\n        i;\n\n    if (this.pendingTracks.length < this.numberOfTracks) {\n      if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n        // Return because we haven't received a flush from a data-generating\n        // portion of the segment (meaning that we have only recieved meta-data\n        // or captions.)\n        return;\n      } else if (this.remuxTracks) {\n        // Return until we have enough tracks from the pipeline to remux (if we\n        // are remuxing audio and video into a single MP4)\n        return;\n      } else if (this.pendingTracks.length === 0) {\n        // In the case where we receive a flush without any data having been\n        // received we consider it an emitted track for the purposes of coalescing\n        // `done` events.\n        // We do this for the case where there is an audio and video track in the\n        // segment but no audio data. (seen in several playlists with alternate\n        // audio tracks and no audio present in the main TS segments.)\n        this.emittedTracks++;\n\n        if (this.emittedTracks >= this.numberOfTracks) {\n          this.trigger('done');\n          this.emittedTracks = 0;\n        }\n\n        return;\n      }\n    }\n\n    if (this.videoTrack) {\n      timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n      videoProperties.forEach(function (prop) {\n        event.info[prop] = this.videoTrack[prop];\n      }, this);\n    } else if (this.audioTrack) {\n      timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n      audioProperties.forEach(function (prop) {\n        event.info[prop] = this.audioTrack[prop];\n      }, this);\n    }\n\n    if (this.videoTrack || this.audioTrack) {\n      if (this.pendingTracks.length === 1) {\n        event.type = this.pendingTracks[0].type;\n      } else {\n        event.type = 'combined';\n      }\n\n      this.emittedTracks += this.pendingTracks.length;\n      initSegment = mp4Generator.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n      event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n      // and track definitions\n\n      event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n      event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n      for (i = 0; i < this.pendingBoxes.length; i++) {\n        event.data.set(this.pendingBoxes[i], offset);\n        offset += this.pendingBoxes[i].byteLength;\n      } // Translate caption PTS times into second offsets to match the\n      // video timeline for the segment, and add track info\n\n\n      for (i = 0; i < this.pendingCaptions.length; i++) {\n        caption = this.pendingCaptions[i];\n        caption.startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);\n        caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);\n        event.captionStreams[caption.stream] = true;\n        event.captions.push(caption);\n      } // Translate ID3 frame PTS times into second offsets to match the\n      // video timeline for the segment\n\n\n      for (i = 0; i < this.pendingMetadata.length; i++) {\n        id3 = this.pendingMetadata[i];\n        id3.cueTime = clock.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);\n        event.metadata.push(id3);\n      } // We add this to every single emitted segment even though we only need\n      // it for the first\n\n\n      event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n      this.pendingTracks.length = 0;\n      this.videoTrack = null;\n      this.pendingBoxes.length = 0;\n      this.pendingCaptions.length = 0;\n      this.pendingBytes = 0;\n      this.pendingMetadata.length = 0; // Emit the built segment\n      // We include captions and ID3 tags for backwards compatibility,\n      // ideally we should send only video and audio in the data event\n\n      this.trigger('data', event); // Emit each caption to the outside world\n      // Ideally, this would happen immediately on parsing captions,\n      // but we need to ensure that video data is sent back first\n      // so that caption timing can be adjusted to match video timing\n\n      for (i = 0; i < event.captions.length; i++) {\n        caption = event.captions[i];\n        this.trigger('caption', caption);\n      } // Emit each id3 tag to the outside world\n      // Ideally, this would happen immediately on parsing the tag,\n      // but we need to ensure that video data is sent back first\n      // so that ID3 frame timing can be adjusted to match video timing\n\n\n      for (i = 0; i < event.metadata.length; i++) {\n        id3 = event.metadata[i];\n        this.trigger('id3Frame', id3);\n      }\n    } // Only emit `done` if all tracks have been flushed and emitted\n\n\n    if (this.emittedTracks >= this.numberOfTracks) {\n      this.trigger('done');\n      this.emittedTracks = 0;\n    }\n  };\n\n  _CoalesceStream.prototype.setRemux = function (val) {\n    this.remuxTracks = val;\n  };\n  /**\n   * A Stream that expects MP2T binary data as input and produces\n   * corresponding media segments, suitable for use with Media Source\n   * Extension (MSE) implementations that support the ISO BMFF byte\n   * stream format, like Chrome.\n   */\n\n\n  _Transmuxer = function Transmuxer(options) {\n    var self = this,\n        hasFlushed = true,\n        videoTrack,\n        audioTrack;\n\n    _Transmuxer.prototype.init.call(this);\n\n    options = options || {};\n    this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n    this.transmuxPipeline_ = {};\n\n    this.setupAacPipeline = function () {\n      var pipeline = {};\n      this.transmuxPipeline_ = pipeline;\n      pipeline.type = 'aac';\n      pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n      pipeline.aacStream = new aac();\n      pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n      pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n      pipeline.adtsStream = new adts();\n      pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n      pipeline.headOfPipeline = pipeline.aacStream;\n      pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n      pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n      pipeline.metadataStream.on('timestamp', function (frame) {\n        pipeline.aacStream.setTimestamp(frame.timeStamp);\n      });\n      pipeline.aacStream.on('data', function (data) {\n        if (data.type !== 'timed-metadata' && data.type !== 'audio' || pipeline.audioSegmentStream) {\n          return;\n        }\n\n        audioTrack = audioTrack || {\n          timelineStartInfo: {\n            baseMediaDecodeTime: self.baseMediaDecodeTime\n          },\n          codec: 'adts',\n          type: 'audio'\n        }; // hook up the audio segment stream to the first track with aac data\n\n        pipeline.coalesceStream.numberOfTracks++;\n        pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options);\n        pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n        pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo')); // Set up the final part of the audio pipeline\n\n        pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream); // emit pmt info\n\n        self.trigger('trackinfo', {\n          hasAudio: !!audioTrack,\n          hasVideo: !!videoTrack\n        });\n      }); // Re-emit any data coming from the coalesce stream to the outside world\n\n      pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n      pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n      addPipelineLogRetriggers(this, pipeline);\n    };\n\n    this.setupTsPipeline = function () {\n      var pipeline = {};\n      this.transmuxPipeline_ = pipeline;\n      pipeline.type = 'ts';\n      pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n      pipeline.packetStream = new m2ts_1.TransportPacketStream();\n      pipeline.parseStream = new m2ts_1.TransportParseStream();\n      pipeline.elementaryStream = new m2ts_1.ElementaryStream();\n      pipeline.timestampRolloverStream = new m2ts_1.TimestampRolloverStream();\n      pipeline.adtsStream = new adts();\n      pipeline.h264Stream = new H264Stream();\n      pipeline.captionStream = new m2ts_1.CaptionStream(options);\n      pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n      pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n      pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream); // !!THIS ORDER IS IMPORTANT!!\n      // demux the streams\n\n      pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);\n      pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);\n      pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n      pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n      pipeline.elementaryStream.on('data', function (data) {\n        var i;\n\n        if (data.type === 'metadata') {\n          i = data.tracks.length; // scan the tracks listed in the metadata\n\n          while (i--) {\n            if (!videoTrack && data.tracks[i].type === 'video') {\n              videoTrack = data.tracks[i];\n              videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n            } else if (!audioTrack && data.tracks[i].type === 'audio') {\n              audioTrack = data.tracks[i];\n              audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n            }\n          } // hook up the video segment stream to the first track with h264 data\n\n\n          if (videoTrack && !pipeline.videoSegmentStream) {\n            pipeline.coalesceStream.numberOfTracks++;\n            pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options);\n            pipeline.videoSegmentStream.on('log', self.getLogTrigger_('videoSegmentStream'));\n            pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n              // When video emits timelineStartInfo data after a flush, we forward that\n              // info to the AudioSegmentStream, if it exists, because video timeline\n              // data takes precedence.  Do not do this if keepOriginalTimestamps is set,\n              // because this is a particularly subtle form of timestamp alteration.\n              if (audioTrack && !options.keepOriginalTimestamps) {\n                audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n                // very earliest DTS we have seen in video because Chrome will\n                // interpret any video track with a baseMediaDecodeTime that is\n                // non-zero as a gap.\n\n                pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self.baseMediaDecodeTime);\n              }\n            });\n            pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n            pipeline.videoSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'videoSegmentTimingInfo'));\n            pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n              if (audioTrack) {\n                pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n              }\n            });\n            pipeline.videoSegmentStream.on('timingInfo', self.trigger.bind(self, 'videoTimingInfo')); // Set up the final part of the video pipeline\n\n            pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n          }\n\n          if (audioTrack && !pipeline.audioSegmentStream) {\n            // hook up the audio segment stream to the first track with aac data\n            pipeline.coalesceStream.numberOfTracks++;\n            pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options);\n            pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n            pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo'));\n            pipeline.audioSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'audioSegmentTimingInfo')); // Set up the final part of the audio pipeline\n\n            pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n          } // emit pmt info\n\n\n          self.trigger('trackinfo', {\n            hasAudio: !!audioTrack,\n            hasVideo: !!videoTrack\n          });\n        }\n      }); // Re-emit any data coming from the coalesce stream to the outside world\n\n      pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n      pipeline.coalesceStream.on('id3Frame', function (id3Frame) {\n        id3Frame.dispatchType = pipeline.metadataStream.dispatchType;\n        self.trigger('id3Frame', id3Frame);\n      });\n      pipeline.coalesceStream.on('caption', this.trigger.bind(this, 'caption')); // Let the consumer know we have finished flushing the entire pipeline\n\n      pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n      addPipelineLogRetriggers(this, pipeline);\n    }; // hook up the segment streams once track metadata is delivered\n\n\n    this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n      var pipeline = this.transmuxPipeline_;\n\n      if (!options.keepOriginalTimestamps) {\n        this.baseMediaDecodeTime = baseMediaDecodeTime;\n      }\n\n      if (audioTrack) {\n        audioTrack.timelineStartInfo.dts = undefined;\n        audioTrack.timelineStartInfo.pts = undefined;\n        trackDecodeInfo.clearDtsInfo(audioTrack);\n\n        if (pipeline.audioTimestampRolloverStream) {\n          pipeline.audioTimestampRolloverStream.discontinuity();\n        }\n      }\n\n      if (videoTrack) {\n        if (pipeline.videoSegmentStream) {\n          pipeline.videoSegmentStream.gopCache_ = [];\n        }\n\n        videoTrack.timelineStartInfo.dts = undefined;\n        videoTrack.timelineStartInfo.pts = undefined;\n        trackDecodeInfo.clearDtsInfo(videoTrack);\n        pipeline.captionStream.reset();\n      }\n\n      if (pipeline.timestampRolloverStream) {\n        pipeline.timestampRolloverStream.discontinuity();\n      }\n    };\n\n    this.setAudioAppendStart = function (timestamp) {\n      if (audioTrack) {\n        this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n      }\n    };\n\n    this.setRemux = function (val) {\n      var pipeline = this.transmuxPipeline_;\n      options.remux = val;\n\n      if (pipeline && pipeline.coalesceStream) {\n        pipeline.coalesceStream.setRemux(val);\n      }\n    };\n\n    this.alignGopsWith = function (gopsToAlignWith) {\n      if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n        this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n      }\n    };\n\n    this.getLogTrigger_ = function (key) {\n      var self = this;\n      return function (event) {\n        event.stream = key;\n        self.trigger('log', event);\n      };\n    }; // feed incoming data to the front of the parsing pipeline\n\n\n    this.push = function (data) {\n      if (hasFlushed) {\n        var isAac = isLikelyAacData(data);\n\n        if (isAac && this.transmuxPipeline_.type !== 'aac') {\n          this.setupAacPipeline();\n        } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n          this.setupTsPipeline();\n        }\n\n        hasFlushed = false;\n      }\n\n      this.transmuxPipeline_.headOfPipeline.push(data);\n    }; // flush any buffered data\n\n\n    this.flush = function () {\n      hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n      this.transmuxPipeline_.headOfPipeline.flush();\n    };\n\n    this.endTimeline = function () {\n      this.transmuxPipeline_.headOfPipeline.endTimeline();\n    };\n\n    this.reset = function () {\n      if (this.transmuxPipeline_.headOfPipeline) {\n        this.transmuxPipeline_.headOfPipeline.reset();\n      }\n    }; // Caption data has to be reset when seeking outside buffered range\n\n\n    this.resetCaptions = function () {\n      if (this.transmuxPipeline_.captionStream) {\n        this.transmuxPipeline_.captionStream.reset();\n      }\n    };\n  };\n\n  _Transmuxer.prototype = new stream();\n  var transmuxer = {\n    Transmuxer: _Transmuxer,\n    VideoSegmentStream: _VideoSegmentStream,\n    AudioSegmentStream: _AudioSegmentStream,\n    AUDIO_PROPERTIES: audioProperties,\n    VIDEO_PROPERTIES: videoProperties,\n    // exported for testing\n    generateSegmentTimingInfo: generateSegmentTimingInfo\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var toUnsigned$3 = function toUnsigned(value) {\n    return value >>> 0;\n  };\n\n  var toHexString$1 = function toHexString(value) {\n    return ('00' + value.toString(16)).slice(-2);\n  };\n\n  var bin = {\n    toUnsigned: toUnsigned$3,\n    toHexString: toHexString$1\n  };\n\n  var parseType$1 = function parseType(buffer) {\n    var result = '';\n    result += String.fromCharCode(buffer[0]);\n    result += String.fromCharCode(buffer[1]);\n    result += String.fromCharCode(buffer[2]);\n    result += String.fromCharCode(buffer[3]);\n    return result;\n  };\n\n  var parseType_1 = parseType$1;\n  var toUnsigned$2 = bin.toUnsigned;\n\n  var findBox = function findBox(data, path) {\n    var results = [],\n        i,\n        size,\n        type,\n        end,\n        subresults;\n\n    if (!path.length) {\n      // short-circuit the search for empty paths\n      return null;\n    }\n\n    for (i = 0; i < data.byteLength;) {\n      size = toUnsigned$2(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n      type = parseType_1(data.subarray(i + 4, i + 8));\n      end = size > 1 ? i + size : data.byteLength;\n\n      if (type === path[0]) {\n        if (path.length === 1) {\n          // this is the end of the path and we've found the box we were\n          // looking for\n          results.push(data.subarray(i + 8, end));\n        } else {\n          // recursively search for the next box along the path\n          subresults = findBox(data.subarray(i + 8, end), path.slice(1));\n\n          if (subresults.length) {\n            results = results.concat(subresults);\n          }\n        }\n      }\n\n      i = end;\n    } // we've finished searching all of data\n\n\n    return results;\n  };\n\n  var findBox_1 = findBox;\n  var toUnsigned$1 = bin.toUnsigned;\n  var getUint64$1 = numbers.getUint64;\n\n  var tfdt = function tfdt(data) {\n    var result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4))\n    };\n\n    if (result.version === 1) {\n      result.baseMediaDecodeTime = getUint64$1(data.subarray(4));\n    } else {\n      result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);\n    }\n\n    return result;\n  };\n\n  var parseTfdt = tfdt;\n\n  var parseSampleFlags = function parseSampleFlags(flags) {\n    return {\n      isLeading: (flags[0] & 0x0c) >>> 2,\n      dependsOn: flags[0] & 0x03,\n      isDependedOn: (flags[1] & 0xc0) >>> 6,\n      hasRedundancy: (flags[1] & 0x30) >>> 4,\n      paddingValue: (flags[1] & 0x0e) >>> 1,\n      isNonSyncSample: flags[1] & 0x01,\n      degradationPriority: flags[2] << 8 | flags[3]\n    };\n  };\n\n  var parseSampleFlags_1 = parseSampleFlags;\n\n  var trun = function trun(data) {\n    var result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4)),\n      samples: []\n    },\n        view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n        // Flag interpretation\n    dataOffsetPresent = result.flags[2] & 0x01,\n        // compare with 2nd byte of 0x1\n    firstSampleFlagsPresent = result.flags[2] & 0x04,\n        // compare with 2nd byte of 0x4\n    sampleDurationPresent = result.flags[1] & 0x01,\n        // compare with 2nd byte of 0x100\n    sampleSizePresent = result.flags[1] & 0x02,\n        // compare with 2nd byte of 0x200\n    sampleFlagsPresent = result.flags[1] & 0x04,\n        // compare with 2nd byte of 0x400\n    sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n        // compare with 2nd byte of 0x800\n    sampleCount = view.getUint32(4),\n        offset = 8,\n        sample;\n\n    if (dataOffsetPresent) {\n      // 32 bit signed integer\n      result.dataOffset = view.getInt32(offset);\n      offset += 4;\n    } // Overrides the flags for the first sample only. The order of\n    // optional values will be: duration, size, compositionTimeOffset\n\n\n    if (firstSampleFlagsPresent && sampleCount) {\n      sample = {\n        flags: parseSampleFlags_1(data.subarray(offset, offset + 4))\n      };\n      offset += 4;\n\n      if (sampleDurationPresent) {\n        sample.duration = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleSizePresent) {\n        sample.size = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleCompositionTimeOffsetPresent) {\n        if (result.version === 1) {\n          sample.compositionTimeOffset = view.getInt32(offset);\n        } else {\n          sample.compositionTimeOffset = view.getUint32(offset);\n        }\n\n        offset += 4;\n      }\n\n      result.samples.push(sample);\n      sampleCount--;\n    }\n\n    while (sampleCount--) {\n      sample = {};\n\n      if (sampleDurationPresent) {\n        sample.duration = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleSizePresent) {\n        sample.size = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleFlagsPresent) {\n        sample.flags = parseSampleFlags_1(data.subarray(offset, offset + 4));\n        offset += 4;\n      }\n\n      if (sampleCompositionTimeOffsetPresent) {\n        if (result.version === 1) {\n          sample.compositionTimeOffset = view.getInt32(offset);\n        } else {\n          sample.compositionTimeOffset = view.getUint32(offset);\n        }\n\n        offset += 4;\n      }\n\n      result.samples.push(sample);\n    }\n\n    return result;\n  };\n\n  var parseTrun = trun;\n\n  var tfhd = function tfhd(data) {\n    var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n        result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4)),\n      trackId: view.getUint32(4)\n    },\n        baseDataOffsetPresent = result.flags[2] & 0x01,\n        sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n        defaultSampleDurationPresent = result.flags[2] & 0x08,\n        defaultSampleSizePresent = result.flags[2] & 0x10,\n        defaultSampleFlagsPresent = result.flags[2] & 0x20,\n        durationIsEmpty = result.flags[0] & 0x010000,\n        defaultBaseIsMoof = result.flags[0] & 0x020000,\n        i;\n    i = 8;\n\n    if (baseDataOffsetPresent) {\n      i += 4; // truncate top 4 bytes\n      // FIXME: should we read the full 64 bits?\n\n      result.baseDataOffset = view.getUint32(12);\n      i += 4;\n    }\n\n    if (sampleDescriptionIndexPresent) {\n      result.sampleDescriptionIndex = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleDurationPresent) {\n      result.defaultSampleDuration = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleSizePresent) {\n      result.defaultSampleSize = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleFlagsPresent) {\n      result.defaultSampleFlags = view.getUint32(i);\n    }\n\n    if (durationIsEmpty) {\n      result.durationIsEmpty = true;\n    }\n\n    if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n      result.baseDataOffsetIsMoof = true;\n    }\n\n    return result;\n  };\n\n  var parseTfhd = tfhd;\n  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n  var win;\n\n  if (typeof window !== \"undefined\") {\n    win = window;\n  } else if (typeof commonjsGlobal !== \"undefined\") {\n    win = commonjsGlobal;\n  } else if (typeof self !== \"undefined\") {\n    win = self;\n  } else {\n    win = {};\n  }\n\n  var window_1 = win;\n  var discardEmulationPreventionBytes = captionPacketParser.discardEmulationPreventionBytes;\n  var CaptionStream = captionStream.CaptionStream;\n  /**\n    * Maps an offset in the mdat to a sample based on the the size of the samples.\n    * Assumes that `parseSamples` has been called first.\n    *\n    * @param {Number} offset - The offset into the mdat\n    * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n    * @return {?Object} The matching sample, or null if no match was found.\n    *\n    * @see ISO-BMFF-12/2015, Section 8.8.8\n   **/\n\n  var mapToSample = function mapToSample(offset, samples) {\n    var approximateOffset = offset;\n\n    for (var i = 0; i < samples.length; i++) {\n      var sample = samples[i];\n\n      if (approximateOffset < sample.size) {\n        return sample;\n      }\n\n      approximateOffset -= sample.size;\n    }\n\n    return null;\n  };\n  /**\n    * Finds SEI nal units contained in a Media Data Box.\n    * Assumes that `parseSamples` has been called first.\n    *\n    * @param {Uint8Array} avcStream - The bytes of the mdat\n    * @param {Object[]} samples - The samples parsed out by `parseSamples`\n    * @param {Number} trackId - The trackId of this video track\n    * @return {Object[]} seiNals - the parsed SEI NALUs found.\n    *   The contents of the seiNal should match what is expected by\n    *   CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n    *\n    * @see ISO-BMFF-12/2015, Section 8.1.1\n    * @see Rec. ITU-T H.264, 7.3.2.3.1\n   **/\n\n\n  var findSeiNals = function findSeiNals(avcStream, samples, trackId) {\n    var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n        result = {\n      logs: [],\n      seiNals: []\n    },\n        seiNal,\n        i,\n        length,\n        lastMatchedSample;\n\n    for (i = 0; i + 4 < avcStream.length; i += length) {\n      length = avcView.getUint32(i);\n      i += 4; // Bail if this doesn't appear to be an H264 stream\n\n      if (length <= 0) {\n        continue;\n      }\n\n      switch (avcStream[i] & 0x1F) {\n        case 0x06:\n          var data = avcStream.subarray(i + 1, i + 1 + length);\n          var matchingSample = mapToSample(i, samples);\n          seiNal = {\n            nalUnitType: 'sei_rbsp',\n            size: length,\n            data: data,\n            escapedRBSP: discardEmulationPreventionBytes(data),\n            trackId: trackId\n          };\n\n          if (matchingSample) {\n            seiNal.pts = matchingSample.pts;\n            seiNal.dts = matchingSample.dts;\n            lastMatchedSample = matchingSample;\n          } else if (lastMatchedSample) {\n            // If a matching sample cannot be found, use the last\n            // sample's values as they should be as close as possible\n            seiNal.pts = lastMatchedSample.pts;\n            seiNal.dts = lastMatchedSample.dts;\n          } else {\n            result.logs.push({\n              level: 'warn',\n              message: 'We\\'ve encountered a nal unit without data at ' + i + ' for trackId ' + trackId + '. See mux.js#223.'\n            });\n            break;\n          }\n\n          result.seiNals.push(seiNal);\n          break;\n      }\n    }\n\n    return result;\n  };\n  /**\n    * Parses sample information out of Track Run Boxes and calculates\n    * the absolute presentation and decode timestamps of each sample.\n    *\n    * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n    * @param {Number|BigInt} baseMediaDecodeTime - base media decode time from tfdt\n        @see ISO-BMFF-12/2015, Section 8.8.12\n    * @param {Object} tfhd - The parsed Track Fragment Header\n    *   @see inspect.parseTfhd\n    * @return {Object[]} the parsed samples\n    *\n    * @see ISO-BMFF-12/2015, Section 8.8.8\n   **/\n\n\n  var parseSamples = function parseSamples(truns, baseMediaDecodeTime, tfhd) {\n    var currentDts = baseMediaDecodeTime;\n    var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n    var defaultSampleSize = tfhd.defaultSampleSize || 0;\n    var trackId = tfhd.trackId;\n    var allSamples = [];\n    truns.forEach(function (trun) {\n      // Note: We currently do not parse the sample table as well\n      // as the trun. It's possible some sources will require this.\n      // moov > trak > mdia > minf > stbl\n      var trackRun = parseTrun(trun);\n      var samples = trackRun.samples;\n      samples.forEach(function (sample) {\n        if (sample.duration === undefined) {\n          sample.duration = defaultSampleDuration;\n        }\n\n        if (sample.size === undefined) {\n          sample.size = defaultSampleSize;\n        }\n\n        sample.trackId = trackId;\n        sample.dts = currentDts;\n\n        if (sample.compositionTimeOffset === undefined) {\n          sample.compositionTimeOffset = 0;\n        }\n\n        if (typeof currentDts === 'bigint') {\n          sample.pts = currentDts + window_1.BigInt(sample.compositionTimeOffset);\n          currentDts += window_1.BigInt(sample.duration);\n        } else {\n          sample.pts = currentDts + sample.compositionTimeOffset;\n          currentDts += sample.duration;\n        }\n      });\n      allSamples = allSamples.concat(samples);\n    });\n    return allSamples;\n  };\n  /**\n    * Parses out caption nals from an FMP4 segment's video tracks.\n    *\n    * @param {Uint8Array} segment - The bytes of a single segment\n    * @param {Number} videoTrackId - The trackId of a video track in the segment\n    * @return {Object.<Number, Object[]>} A mapping of video trackId to\n    *   a list of seiNals found in that track\n   **/\n\n\n  var parseCaptionNals = function parseCaptionNals(segment, videoTrackId) {\n    // To get the samples\n    var trafs = findBox_1(segment, ['moof', 'traf']); // To get SEI NAL units\n\n    var mdats = findBox_1(segment, ['mdat']);\n    var captionNals = {};\n    var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n    mdats.forEach(function (mdat, index) {\n      var matchingTraf = trafs[index];\n      mdatTrafPairs.push({\n        mdat: mdat,\n        traf: matchingTraf\n      });\n    });\n    mdatTrafPairs.forEach(function (pair) {\n      var mdat = pair.mdat;\n      var traf = pair.traf;\n      var tfhd = findBox_1(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n      var headerInfo = parseTfhd(tfhd[0]);\n      var trackId = headerInfo.trackId;\n      var tfdt = findBox_1(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n      var baseMediaDecodeTime = tfdt.length > 0 ? parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n      var truns = findBox_1(traf, ['trun']);\n      var samples;\n      var result; // Only parse video data for the chosen video track\n\n      if (videoTrackId === trackId && truns.length > 0) {\n        samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n        result = findSeiNals(mdat, samples, trackId);\n\n        if (!captionNals[trackId]) {\n          captionNals[trackId] = {\n            seiNals: [],\n            logs: []\n          };\n        }\n\n        captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);\n        captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);\n      }\n    });\n    return captionNals;\n  };\n  /**\n    * Parses out inband captions from an MP4 container and returns\n    * caption objects that can be used by WebVTT and the TextTrack API.\n    * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n    * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n    * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n    *\n    * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n    * @param {Number} trackId - The id of the video track to parse\n    * @param {Number} timescale - The timescale for the video track from the init segment\n    *\n    * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n    * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n    * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n    * @return {String} parsedCaptions[].text - The visible content of the caption\n   **/\n\n\n  var parseEmbeddedCaptions = function parseEmbeddedCaptions(segment, trackId, timescale) {\n    var captionNals; // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n\n    if (trackId === null) {\n      return null;\n    }\n\n    captionNals = parseCaptionNals(segment, trackId);\n    var trackNals = captionNals[trackId] || {};\n    return {\n      seiNals: trackNals.seiNals,\n      logs: trackNals.logs,\n      timescale: timescale\n    };\n  };\n  /**\n    * Converts SEI NALUs into captions that can be used by video.js\n   **/\n\n\n  var CaptionParser = function CaptionParser() {\n    var isInitialized = false;\n    var captionStream; // Stores segments seen before trackId and timescale are set\n\n    var segmentCache; // Stores video track ID of the track being parsed\n\n    var trackId; // Stores the timescale of the track being parsed\n\n    var timescale; // Stores captions parsed so far\n\n    var parsedCaptions; // Stores whether we are receiving partial data or not\n\n    var parsingPartial;\n    /**\n      * A method to indicate whether a CaptionParser has been initalized\n      * @returns {Boolean}\n     **/\n\n    this.isInitialized = function () {\n      return isInitialized;\n    };\n    /**\n      * Initializes the underlying CaptionStream, SEI NAL parsing\n      * and management, and caption collection\n     **/\n\n\n    this.init = function (options) {\n      captionStream = new CaptionStream();\n      isInitialized = true;\n      parsingPartial = options ? options.isPartial : false; // Collect dispatched captions\n\n      captionStream.on('data', function (event) {\n        // Convert to seconds in the source's timescale\n        event.startTime = event.startPts / timescale;\n        event.endTime = event.endPts / timescale;\n        parsedCaptions.captions.push(event);\n        parsedCaptions.captionStreams[event.stream] = true;\n      });\n      captionStream.on('log', function (log) {\n        parsedCaptions.logs.push(log);\n      });\n    };\n    /**\n      * Determines if a new video track will be selected\n      * or if the timescale changed\n      * @return {Boolean}\n     **/\n\n\n    this.isNewInit = function (videoTrackIds, timescales) {\n      if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n        return false;\n      }\n\n      return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n    };\n    /**\n      * Parses out SEI captions and interacts with underlying\n      * CaptionStream to return dispatched captions\n      *\n      * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n      * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n      * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n      * @see parseEmbeddedCaptions\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.parse = function (segment, videoTrackIds, timescales) {\n      var parsedData;\n\n      if (!this.isInitialized()) {\n        return null; // This is not likely to be a video segment\n      } else if (!videoTrackIds || !timescales) {\n        return null;\n      } else if (this.isNewInit(videoTrackIds, timescales)) {\n        // Use the first video track only as there is no\n        // mechanism to switch to other video tracks\n        trackId = videoTrackIds[0];\n        timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n        // data until we have one.\n        // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n      } else if (trackId === null || !timescale) {\n        segmentCache.push(segment);\n        return null;\n      } // Now that a timescale and trackId is set, parse cached segments\n\n\n      while (segmentCache.length > 0) {\n        var cachedSegment = segmentCache.shift();\n        this.parse(cachedSegment, videoTrackIds, timescales);\n      }\n\n      parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n      if (parsedData && parsedData.logs) {\n        parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);\n      }\n\n      if (parsedData === null || !parsedData.seiNals) {\n        if (parsedCaptions.logs.length) {\n          return {\n            logs: parsedCaptions.logs,\n            captions: [],\n            captionStreams: []\n          };\n        }\n\n        return null;\n      }\n\n      this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n      this.flushStream();\n      return parsedCaptions;\n    };\n    /**\n      * Pushes SEI NALUs onto CaptionStream\n      * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n      * Assumes that `parseCaptionNals` has been called first\n      * @see m2ts/caption-stream.js\n      **/\n\n\n    this.pushNals = function (nals) {\n      if (!this.isInitialized() || !nals || nals.length === 0) {\n        return null;\n      }\n\n      nals.forEach(function (nal) {\n        captionStream.push(nal);\n      });\n    };\n    /**\n      * Flushes underlying CaptionStream to dispatch processed, displayable captions\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.flushStream = function () {\n      if (!this.isInitialized()) {\n        return null;\n      }\n\n      if (!parsingPartial) {\n        captionStream.flush();\n      } else {\n        captionStream.partialFlush();\n      }\n    };\n    /**\n      * Reset caption buckets for new data\n     **/\n\n\n    this.clearParsedCaptions = function () {\n      parsedCaptions.captions = [];\n      parsedCaptions.captionStreams = {};\n      parsedCaptions.logs = [];\n    };\n    /**\n      * Resets underlying CaptionStream\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.resetCaptionStream = function () {\n      if (!this.isInitialized()) {\n        return null;\n      }\n\n      captionStream.reset();\n    };\n    /**\n      * Convenience method to clear all captions flushed from the\n      * CaptionStream and still being parsed\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.clearAllCaptions = function () {\n      this.clearParsedCaptions();\n      this.resetCaptionStream();\n    };\n    /**\n      * Reset caption parser\n     **/\n\n\n    this.reset = function () {\n      segmentCache = [];\n      trackId = null;\n      timescale = null;\n\n      if (!parsedCaptions) {\n        parsedCaptions = {\n          captions: [],\n          // CC1, CC2, CC3, CC4\n          captionStreams: {},\n          logs: []\n        };\n      } else {\n        this.clearParsedCaptions();\n      }\n\n      this.resetCaptionStream();\n    };\n\n    this.reset();\n  };\n\n  var captionParser = CaptionParser;\n  var toUnsigned = bin.toUnsigned;\n  var toHexString = bin.toHexString;\n  var getUint64 = numbers.getUint64;\n  var timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader;\n  /**\n   * Parses an MP4 initialization segment and extracts the timescale\n   * values for any declared tracks. Timescale values indicate the\n   * number of clock ticks per second to assume for time-based values\n   * elsewhere in the MP4.\n   *\n   * To determine the start time of an MP4, you need two pieces of\n   * information: the timescale unit and the earliest base media decode\n   * time. Multiple timescales can be specified within an MP4 but the\n   * base media decode time is always expressed in the timescale from\n   * the media header box for the track:\n   * ```\n   * moov > trak > mdia > mdhd.timescale\n   * ```\n   * @param init {Uint8Array} the bytes of the init segment\n   * @return {object} a hash of track ids to timescale values or null if\n   * the init segment is malformed.\n   */\n\n  timescale = function timescale(init) {\n    var result = {},\n        traks = findBox_1(init, ['moov', 'trak']); // mdhd timescale\n\n    return traks.reduce(function (result, trak) {\n      var tkhd, version, index, id, mdhd;\n      tkhd = findBox_1(trak, ['tkhd'])[0];\n\n      if (!tkhd) {\n        return null;\n      }\n\n      version = tkhd[0];\n      index = version === 0 ? 12 : 20;\n      id = toUnsigned(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n      mdhd = findBox_1(trak, ['mdia', 'mdhd'])[0];\n\n      if (!mdhd) {\n        return null;\n      }\n\n      version = mdhd[0];\n      index = version === 0 ? 12 : 20;\n      result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n      return result;\n    }, result);\n  };\n  /**\n   * Determine the base media decode start time, in seconds, for an MP4\n   * fragment. If multiple fragments are specified, the earliest time is\n   * returned.\n   *\n   * The base media decode time can be parsed from track fragment\n   * metadata:\n   * ```\n   * moof > traf > tfdt.baseMediaDecodeTime\n   * ```\n   * It requires the timescale value from the mdhd to interpret.\n   *\n   * @param timescale {object} a hash of track ids to timescale values.\n   * @return {number} the earliest base media decode start time for the\n   * fragment, in seconds\n   */\n\n\n  startTime = function startTime(timescale, fragment) {\n    var trafs; // we need info from two childrend of each track fragment box\n\n    trafs = findBox_1(fragment, ['moof', 'traf']); // determine the start times for each track\n\n    var lowestTime = trafs.reduce(function (acc, traf) {\n      var tfhd = findBox_1(traf, ['tfhd'])[0]; // get the track id from the tfhd\n\n      var id = toUnsigned(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n      var scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n      var tfdt = findBox_1(traf, ['tfdt'])[0];\n      var dv = new DataView(tfdt.buffer, tfdt.byteOffset, tfdt.byteLength);\n      var baseTime; // version 1 is 64 bit\n\n      if (tfdt[0] === 1) {\n        baseTime = getUint64(tfdt.subarray(4, 12));\n      } else {\n        baseTime = dv.getUint32(4);\n      } // convert base time to seconds if it is a valid number.\n\n\n      var seconds;\n\n      if (typeof baseTime === 'bigint') {\n        seconds = baseTime / window_1.BigInt(scale);\n      } else if (typeof baseTime === 'number' && !isNaN(baseTime)) {\n        seconds = baseTime / scale;\n      }\n\n      if (seconds < Number.MAX_SAFE_INTEGER) {\n        seconds = Number(seconds);\n      }\n\n      if (seconds < acc) {\n        acc = seconds;\n      }\n\n      return acc;\n    }, Infinity);\n    return typeof lowestTime === 'bigint' || isFinite(lowestTime) ? lowestTime : 0;\n  };\n  /**\n   * Determine the composition start, in seconds, for an MP4\n   * fragment.\n   *\n   * The composition start time of a fragment can be calculated using the base\n   * media decode time, composition time offset, and timescale, as follows:\n   *\n   * compositionStartTime = (baseMediaDecodeTime + compositionTimeOffset) / timescale\n   *\n   * All of the aforementioned information is contained within a media fragment's\n   * `traf` box, except for timescale info, which comes from the initialization\n   * segment, so a track id (also contained within a `traf`) is also necessary to\n   * associate it with a timescale\n   *\n   *\n   * @param timescales {object} - a hash of track ids to timescale values.\n   * @param fragment {Unit8Array} - the bytes of a media segment\n   * @return {number} the composition start time for the fragment, in seconds\n   **/\n\n\n  compositionStartTime = function compositionStartTime(timescales, fragment) {\n    var trafBoxes = findBox_1(fragment, ['moof', 'traf']);\n    var baseMediaDecodeTime = 0;\n    var compositionTimeOffset = 0;\n    var trackId;\n\n    if (trafBoxes && trafBoxes.length) {\n      // The spec states that track run samples contained within a `traf` box are contiguous, but\n      // it does not explicitly state whether the `traf` boxes themselves are contiguous.\n      // We will assume that they are, so we only need the first to calculate start time.\n      var tfhd = findBox_1(trafBoxes[0], ['tfhd'])[0];\n      var trun = findBox_1(trafBoxes[0], ['trun'])[0];\n      var tfdt = findBox_1(trafBoxes[0], ['tfdt'])[0];\n\n      if (tfhd) {\n        var parsedTfhd = parseTfhd(tfhd);\n        trackId = parsedTfhd.trackId;\n      }\n\n      if (tfdt) {\n        var parsedTfdt = parseTfdt(tfdt);\n        baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;\n      }\n\n      if (trun) {\n        var parsedTrun = parseTrun(trun);\n\n        if (parsedTrun.samples && parsedTrun.samples.length) {\n          compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;\n        }\n      }\n    } // Get timescale for this specific track. Assume a 90kHz clock if no timescale was\n    // specified.\n\n\n    var timescale = timescales[trackId] || 90e3; // return the composition start time, in seconds\n\n    if (typeof baseMediaDecodeTime === 'bigint') {\n      compositionTimeOffset = window_1.BigInt(compositionTimeOffset);\n      timescale = window_1.BigInt(timescale);\n    }\n\n    var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale;\n\n    if (typeof result === 'bigint' && result < Number.MAX_SAFE_INTEGER) {\n      result = Number(result);\n    }\n\n    return result;\n  };\n  /**\n    * Find the trackIds of the video tracks in this source.\n    * Found by parsing the Handler Reference and Track Header Boxes:\n    *   moov > trak > mdia > hdlr\n    *   moov > trak > tkhd\n    *\n    * @param {Uint8Array} init - The bytes of the init segment for this source\n    * @return {Number[]} A list of trackIds\n    *\n    * @see ISO-BMFF-12/2015, Section 8.4.3\n   **/\n\n\n  getVideoTrackIds = function getVideoTrackIds(init) {\n    var traks = findBox_1(init, ['moov', 'trak']);\n    var videoTrackIds = [];\n    traks.forEach(function (trak) {\n      var hdlrs = findBox_1(trak, ['mdia', 'hdlr']);\n      var tkhds = findBox_1(trak, ['tkhd']);\n      hdlrs.forEach(function (hdlr, index) {\n        var handlerType = parseType_1(hdlr.subarray(8, 12));\n        var tkhd = tkhds[index];\n        var view;\n        var version;\n        var trackId;\n\n        if (handlerType === 'vide') {\n          view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n          version = view.getUint8(0);\n          trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n          videoTrackIds.push(trackId);\n        }\n      });\n    });\n    return videoTrackIds;\n  };\n\n  getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader(mdhd) {\n    // mdhd is a FullBox, meaning it will have its own version as the first byte\n    var version = mdhd[0];\n    var index = version === 0 ? 12 : 20;\n    return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n  };\n  /**\n   * Get all the video, audio, and hint tracks from a non fragmented\n   * mp4 segment\n   */\n\n\n  getTracks = function getTracks(init) {\n    var traks = findBox_1(init, ['moov', 'trak']);\n    var tracks = [];\n    traks.forEach(function (trak) {\n      var track = {};\n      var tkhd = findBox_1(trak, ['tkhd'])[0];\n      var view, tkhdVersion; // id\n\n      if (tkhd) {\n        view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n        tkhdVersion = view.getUint8(0);\n        track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n      }\n\n      var hdlr = findBox_1(trak, ['mdia', 'hdlr'])[0]; // type\n\n      if (hdlr) {\n        var type = parseType_1(hdlr.subarray(8, 12));\n\n        if (type === 'vide') {\n          track.type = 'video';\n        } else if (type === 'soun') {\n          track.type = 'audio';\n        } else {\n          track.type = type;\n        }\n      } // codec\n\n\n      var stsd = findBox_1(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n\n      if (stsd) {\n        var sampleDescriptions = stsd.subarray(8); // gives the codec type string\n\n        track.codec = parseType_1(sampleDescriptions.subarray(4, 8));\n        var codecBox = findBox_1(sampleDescriptions, [track.codec])[0];\n        var codecConfig, codecConfigType;\n\n        if (codecBox) {\n          // https://tools.ietf.org/html/rfc6381#section-3.3\n          if (/^[asm]vc[1-9]$/i.test(track.codec)) {\n            // we don't need anything but the \"config\" parameter of the\n            // avc1 codecBox\n            codecConfig = codecBox.subarray(78);\n            codecConfigType = parseType_1(codecConfig.subarray(4, 8));\n\n            if (codecConfigType === 'avcC' && codecConfig.length > 11) {\n              track.codec += '.'; // left padded with zeroes for single digit hex\n              // profile idc\n\n              track.codec += toHexString(codecConfig[9]); // the byte containing the constraint_set flags\n\n              track.codec += toHexString(codecConfig[10]); // level idc\n\n              track.codec += toHexString(codecConfig[11]);\n            } else {\n              // TODO: show a warning that we couldn't parse the codec\n              // and are using the default\n              track.codec = 'avc1.4d400d';\n            }\n          } else if (/^mp4[a,v]$/i.test(track.codec)) {\n            // we do not need anything but the streamDescriptor of the mp4a codecBox\n            codecConfig = codecBox.subarray(28);\n            codecConfigType = parseType_1(codecConfig.subarray(4, 8));\n\n            if (codecConfigType === 'esds' && codecConfig.length > 20 && codecConfig[19] !== 0) {\n              track.codec += '.' + toHexString(codecConfig[19]); // this value is only a single digit\n\n              track.codec += '.' + toHexString(codecConfig[20] >>> 2 & 0x3f).replace(/^0/, '');\n            } else {\n              // TODO: show a warning that we couldn't parse the codec\n              // and are using the default\n              track.codec = 'mp4a.40.2';\n            }\n          } else {\n            // flac, opus, etc\n            track.codec = track.codec.toLowerCase();\n          }\n        }\n      }\n\n      var mdhd = findBox_1(trak, ['mdia', 'mdhd'])[0];\n\n      if (mdhd) {\n        track.timescale = getTimescaleFromMediaHeader(mdhd);\n      }\n\n      tracks.push(track);\n    });\n    return tracks;\n  };\n\n  var probe$2 = {\n    // export mp4 inspector's findBox and parseType for backwards compatibility\n    findBox: findBox_1,\n    parseType: parseType_1,\n    timescale: timescale,\n    startTime: startTime,\n    compositionStartTime: compositionStartTime,\n    videoTrackIds: getVideoTrackIds,\n    tracks: getTracks,\n    getTimescaleFromMediaHeader: getTimescaleFromMediaHeader\n  };\n\n  var parsePid = function parsePid(packet) {\n    var pid = packet[1] & 0x1f;\n    pid <<= 8;\n    pid |= packet[2];\n    return pid;\n  };\n\n  var parsePayloadUnitStartIndicator = function parsePayloadUnitStartIndicator(packet) {\n    return !!(packet[1] & 0x40);\n  };\n\n  var parseAdaptionField = function parseAdaptionField(packet) {\n    var offset = 0; // if an adaption field is present, its length is specified by the\n    // fifth byte of the TS packet header. The adaptation field is\n    // used to add stuffing to PES packets that don't fill a complete\n    // TS packet, and to specify some forms of timing and control data\n    // that we do not currently use.\n\n    if ((packet[3] & 0x30) >>> 4 > 0x01) {\n      offset += packet[4] + 1;\n    }\n\n    return offset;\n  };\n\n  var parseType = function parseType(packet, pmtPid) {\n    var pid = parsePid(packet);\n\n    if (pid === 0) {\n      return 'pat';\n    } else if (pid === pmtPid) {\n      return 'pmt';\n    } else if (pmtPid) {\n      return 'pes';\n    }\n\n    return null;\n  };\n\n  var parsePat = function parsePat(packet) {\n    var pusi = parsePayloadUnitStartIndicator(packet);\n    var offset = 4 + parseAdaptionField(packet);\n\n    if (pusi) {\n      offset += packet[offset] + 1;\n    }\n\n    return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n  };\n\n  var parsePmt = function parsePmt(packet) {\n    var programMapTable = {};\n    var pusi = parsePayloadUnitStartIndicator(packet);\n    var payloadOffset = 4 + parseAdaptionField(packet);\n\n    if (pusi) {\n      payloadOffset += packet[payloadOffset] + 1;\n    } // PMTs can be sent ahead of the time when they should actually\n    // take effect. We don't believe this should ever be the case\n    // for HLS but we'll ignore \"forward\" PMT declarations if we see\n    // them. Future PMT declarations have the current_next_indicator\n    // set to zero.\n\n\n    if (!(packet[payloadOffset + 5] & 0x01)) {\n      return;\n    }\n\n    var sectionLength, tableEnd, programInfoLength; // the mapping table ends at the end of the current section\n\n    sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n    tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n    // long the program info descriptors are\n\n    programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11]; // advance the offset to the first entry in the mapping table\n\n    var offset = 12 + programInfoLength;\n\n    while (offset < tableEnd) {\n      var i = payloadOffset + offset; // add an entry that maps the elementary_pid to the stream_type\n\n      programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i]; // move to the next table entry\n      // skip past the elementary stream descriptors, if present\n\n      offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n    }\n\n    return programMapTable;\n  };\n\n  var parsePesType = function parsePesType(packet, programMapTable) {\n    var pid = parsePid(packet);\n    var type = programMapTable[pid];\n\n    switch (type) {\n      case streamTypes.H264_STREAM_TYPE:\n        return 'video';\n\n      case streamTypes.ADTS_STREAM_TYPE:\n        return 'audio';\n\n      case streamTypes.METADATA_STREAM_TYPE:\n        return 'timed-metadata';\n\n      default:\n        return null;\n    }\n  };\n\n  var parsePesTime = function parsePesTime(packet) {\n    var pusi = parsePayloadUnitStartIndicator(packet);\n\n    if (!pusi) {\n      return null;\n    }\n\n    var offset = 4 + parseAdaptionField(packet);\n\n    if (offset >= packet.byteLength) {\n      // From the H 222.0 MPEG-TS spec\n      // \"For transport stream packets carrying PES packets, stuffing is needed when there\n      //  is insufficient PES packet data to completely fill the transport stream packet\n      //  payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n      //  the sum of the lengths of the data elements in it, so that the payload bytes\n      //  remaining after the adaptation field exactly accommodates the available PES packet\n      //  data.\"\n      //\n      // If the offset is >= the length of the packet, then the packet contains no data\n      // and instead is just adaption field stuffing bytes\n      return null;\n    }\n\n    var pes = null;\n    var ptsDtsFlags; // PES packets may be annotated with a PTS value, or a PTS value\n    // and a DTS value. Determine what combination of values is\n    // available to work with.\n\n    ptsDtsFlags = packet[offset + 7]; // PTS and DTS are normally stored as a 33-bit number.  Javascript\n    // performs all bitwise operations on 32-bit integers but javascript\n    // supports a much greater range (52-bits) of integer using standard\n    // mathematical operations.\n    // We construct a 31-bit value using bitwise operators over the 31\n    // most significant bits and then multiply by 4 (equal to a left-shift\n    // of 2) before we add the final 2 least significant bits of the\n    // timestamp (equal to an OR.)\n\n    if (ptsDtsFlags & 0xC0) {\n      pes = {}; // the PTS and DTS are not written out directly. For information\n      // on how they are encoded, see\n      // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n\n      pes.pts = (packet[offset + 9] & 0x0E) << 27 | (packet[offset + 10] & 0xFF) << 20 | (packet[offset + 11] & 0xFE) << 12 | (packet[offset + 12] & 0xFF) << 5 | (packet[offset + 13] & 0xFE) >>> 3;\n      pes.pts *= 4; // Left shift by 2\n\n      pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n\n      pes.dts = pes.pts;\n\n      if (ptsDtsFlags & 0x40) {\n        pes.dts = (packet[offset + 14] & 0x0E) << 27 | (packet[offset + 15] & 0xFF) << 20 | (packet[offset + 16] & 0xFE) << 12 | (packet[offset + 17] & 0xFF) << 5 | (packet[offset + 18] & 0xFE) >>> 3;\n        pes.dts *= 4; // Left shift by 2\n\n        pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n      }\n    }\n\n    return pes;\n  };\n\n  var parseNalUnitType = function parseNalUnitType(type) {\n    switch (type) {\n      case 0x05:\n        return 'slice_layer_without_partitioning_rbsp_idr';\n\n      case 0x06:\n        return 'sei_rbsp';\n\n      case 0x07:\n        return 'seq_parameter_set_rbsp';\n\n      case 0x08:\n        return 'pic_parameter_set_rbsp';\n\n      case 0x09:\n        return 'access_unit_delimiter_rbsp';\n\n      default:\n        return null;\n    }\n  };\n\n  var videoPacketContainsKeyFrame = function videoPacketContainsKeyFrame(packet) {\n    var offset = 4 + parseAdaptionField(packet);\n    var frameBuffer = packet.subarray(offset);\n    var frameI = 0;\n    var frameSyncPoint = 0;\n    var foundKeyFrame = false;\n    var nalType; // advance the sync point to a NAL start, if necessary\n\n    for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n      if (frameBuffer[frameSyncPoint + 2] === 1) {\n        // the sync point is properly aligned\n        frameI = frameSyncPoint + 5;\n        break;\n      }\n    }\n\n    while (frameI < frameBuffer.byteLength) {\n      // look at the current byte to determine if we've hit the end of\n      // a NAL unit boundary\n      switch (frameBuffer[frameI]) {\n        case 0:\n          // skip past non-sync sequences\n          if (frameBuffer[frameI - 1] !== 0) {\n            frameI += 2;\n            break;\n          } else if (frameBuffer[frameI - 2] !== 0) {\n            frameI++;\n            break;\n          }\n\n          if (frameSyncPoint + 3 !== frameI - 2) {\n            nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n            if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n              foundKeyFrame = true;\n            }\n          } // drop trailing zeroes\n\n\n          do {\n            frameI++;\n          } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n\n          frameSyncPoint = frameI - 2;\n          frameI += 3;\n          break;\n\n        case 1:\n          // skip past non-sync sequences\n          if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {\n            frameI += 3;\n            break;\n          }\n\n          nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n          if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n            foundKeyFrame = true;\n          }\n\n          frameSyncPoint = frameI - 2;\n          frameI += 3;\n          break;\n\n        default:\n          // the current byte isn't a one or zero, so it cannot be part\n          // of a sync sequence\n          frameI += 3;\n          break;\n      }\n    }\n\n    frameBuffer = frameBuffer.subarray(frameSyncPoint);\n    frameI -= frameSyncPoint;\n    frameSyncPoint = 0; // parse the final nal\n\n    if (frameBuffer && frameBuffer.byteLength > 3) {\n      nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n      if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n        foundKeyFrame = true;\n      }\n    }\n\n    return foundKeyFrame;\n  };\n\n  var probe$1 = {\n    parseType: parseType,\n    parsePat: parsePat,\n    parsePmt: parsePmt,\n    parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n    parsePesType: parsePesType,\n    parsePesTime: parsePesTime,\n    videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n  };\n  var handleRollover = timestampRolloverStream.handleRollover;\n  var probe = {};\n  probe.ts = probe$1;\n  probe.aac = utils;\n  var ONE_SECOND_IN_TS = clock.ONE_SECOND_IN_TS;\n  var MP2T_PACKET_LENGTH = 188,\n      // bytes\n  SYNC_BYTE = 0x47;\n  /**\n   * walks through segment data looking for pat and pmt packets to parse out\n   * program map table information\n   */\n\n  var parsePsi_ = function parsePsi_(bytes, pmt) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type;\n\n    while (endIndex < bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pat':\n            pmt.pid = probe.ts.parsePat(packet);\n            break;\n\n          case 'pmt':\n            var table = probe.ts.parsePmt(packet);\n            pmt.table = pmt.table || {};\n            Object.keys(table).forEach(function (key) {\n              pmt.table[key] = table[key];\n            });\n            break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    }\n  };\n  /**\n   * walks through the segment data from the start and end to get timing information\n   * for the first and last audio pes packets\n   */\n\n\n  var parseAudioPes_ = function parseAudioPes_(bytes, pmt, result) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type,\n        pesType,\n        pusi,\n        parsed;\n    var endLoop = false; // Start walking from start of segment to get first audio packet\n\n    while (endIndex <= bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'audio' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'audio';\n                result.audio.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    } // Start walking from end of segment to get last audio packet\n\n\n    endIndex = bytes.byteLength;\n    startIndex = endIndex - MP2T_PACKET_LENGTH;\n    endLoop = false;\n\n    while (startIndex >= 0) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'audio' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'audio';\n                result.audio.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex -= MP2T_PACKET_LENGTH;\n        endIndex -= MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex--;\n      endIndex--;\n    }\n  };\n  /**\n   * walks through the segment data from the start and end to get timing information\n   * for the first and last video pes packets as well as timing information for the first\n   * key frame.\n   */\n\n\n  var parseVideoPes_ = function parseVideoPes_(bytes, pmt, result) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type,\n        pesType,\n        pusi,\n        parsed,\n        frame,\n        i,\n        pes;\n    var endLoop = false;\n    var currentFrame = {\n      data: [],\n      size: 0\n    }; // Start walking from start of segment to get first video packet\n\n    while (endIndex < bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'video') {\n              if (pusi && !endLoop) {\n                parsed = probe.ts.parsePesTime(packet);\n\n                if (parsed) {\n                  parsed.type = 'video';\n                  result.video.push(parsed);\n                  endLoop = true;\n                }\n              }\n\n              if (!result.firstKeyFrame) {\n                if (pusi) {\n                  if (currentFrame.size !== 0) {\n                    frame = new Uint8Array(currentFrame.size);\n                    i = 0;\n\n                    while (currentFrame.data.length) {\n                      pes = currentFrame.data.shift();\n                      frame.set(pes, i);\n                      i += pes.byteLength;\n                    }\n\n                    if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n                      var firstKeyFrame = probe.ts.parsePesTime(frame); // PTS/DTS may not be available. Simply *not* setting\n                      // the keyframe seems to work fine with HLS playback\n                      // and definitely preferable to a crash with TypeError...\n\n                      if (firstKeyFrame) {\n                        result.firstKeyFrame = firstKeyFrame;\n                        result.firstKeyFrame.type = 'video';\n                      } else {\n                        // eslint-disable-next-line\n                        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.');\n                      }\n                    }\n\n                    currentFrame.size = 0;\n                  }\n                }\n\n                currentFrame.data.push(packet);\n                currentFrame.size += packet.byteLength;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop && result.firstKeyFrame) {\n          break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    } // Start walking from end of segment to get last video packet\n\n\n    endIndex = bytes.byteLength;\n    startIndex = endIndex - MP2T_PACKET_LENGTH;\n    endLoop = false;\n\n    while (startIndex >= 0) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'video' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'video';\n                result.video.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex -= MP2T_PACKET_LENGTH;\n        endIndex -= MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex--;\n      endIndex--;\n    }\n  };\n  /**\n   * Adjusts the timestamp information for the segment to account for\n   * rollover and convert to seconds based on pes packet timescale (90khz clock)\n   */\n\n\n  var adjustTimestamp_ = function adjustTimestamp_(segmentInfo, baseTimestamp) {\n    if (segmentInfo.audio && segmentInfo.audio.length) {\n      var audioBaseTimestamp = baseTimestamp;\n\n      if (typeof audioBaseTimestamp === 'undefined' || isNaN(audioBaseTimestamp)) {\n        audioBaseTimestamp = segmentInfo.audio[0].dts;\n      }\n\n      segmentInfo.audio.forEach(function (info) {\n        info.dts = handleRollover(info.dts, audioBaseTimestamp);\n        info.pts = handleRollover(info.pts, audioBaseTimestamp); // time in seconds\n\n        info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n        info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n      });\n    }\n\n    if (segmentInfo.video && segmentInfo.video.length) {\n      var videoBaseTimestamp = baseTimestamp;\n\n      if (typeof videoBaseTimestamp === 'undefined' || isNaN(videoBaseTimestamp)) {\n        videoBaseTimestamp = segmentInfo.video[0].dts;\n      }\n\n      segmentInfo.video.forEach(function (info) {\n        info.dts = handleRollover(info.dts, videoBaseTimestamp);\n        info.pts = handleRollover(info.pts, videoBaseTimestamp); // time in seconds\n\n        info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n        info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n      });\n\n      if (segmentInfo.firstKeyFrame) {\n        var frame = segmentInfo.firstKeyFrame;\n        frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n        frame.pts = handleRollover(frame.pts, videoBaseTimestamp); // time in seconds\n\n        frame.dtsTime = frame.dts / ONE_SECOND_IN_TS;\n        frame.ptsTime = frame.pts / ONE_SECOND_IN_TS;\n      }\n    }\n  };\n  /**\n   * inspects the aac data stream for start and end time information\n   */\n\n\n  var inspectAac_ = function inspectAac_(bytes) {\n    var endLoop = false,\n        audioCount = 0,\n        sampleRate = null,\n        timestamp = null,\n        frameSize = 0,\n        byteIndex = 0,\n        packet;\n\n    while (bytes.length - byteIndex >= 3) {\n      var type = probe.aac.parseType(bytes, byteIndex);\n\n      switch (type) {\n        case 'timed-metadata':\n          // Exit early because we don't have enough to parse\n          // the ID3 tag header\n          if (bytes.length - byteIndex < 10) {\n            endLoop = true;\n            break;\n          }\n\n          frameSize = probe.aac.parseId3TagSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (frameSize > bytes.length) {\n            endLoop = true;\n            break;\n          }\n\n          if (timestamp === null) {\n            packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n            timestamp = probe.aac.parseAacTimestamp(packet);\n          }\n\n          byteIndex += frameSize;\n          break;\n\n        case 'audio':\n          // Exit early because we don't have enough to parse\n          // the ADTS frame header\n          if (bytes.length - byteIndex < 7) {\n            endLoop = true;\n            break;\n          }\n\n          frameSize = probe.aac.parseAdtsSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (frameSize > bytes.length) {\n            endLoop = true;\n            break;\n          }\n\n          if (sampleRate === null) {\n            packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n            sampleRate = probe.aac.parseSampleRate(packet);\n          }\n\n          audioCount++;\n          byteIndex += frameSize;\n          break;\n\n        default:\n          byteIndex++;\n          break;\n      }\n\n      if (endLoop) {\n        return null;\n      }\n    }\n\n    if (sampleRate === null || timestamp === null) {\n      return null;\n    }\n\n    var audioTimescale = ONE_SECOND_IN_TS / sampleRate;\n    var result = {\n      audio: [{\n        type: 'audio',\n        dts: timestamp,\n        pts: timestamp\n      }, {\n        type: 'audio',\n        dts: timestamp + audioCount * 1024 * audioTimescale,\n        pts: timestamp + audioCount * 1024 * audioTimescale\n      }]\n    };\n    return result;\n  };\n  /**\n   * inspects the transport stream segment data for start and end time information\n   * of the audio and video tracks (when present) as well as the first key frame's\n   * start time.\n   */\n\n\n  var inspectTs_ = function inspectTs_(bytes) {\n    var pmt = {\n      pid: null,\n      table: null\n    };\n    var result = {};\n    parsePsi_(bytes, pmt);\n\n    for (var pid in pmt.table) {\n      if (pmt.table.hasOwnProperty(pid)) {\n        var type = pmt.table[pid];\n\n        switch (type) {\n          case streamTypes.H264_STREAM_TYPE:\n            result.video = [];\n            parseVideoPes_(bytes, pmt, result);\n\n            if (result.video.length === 0) {\n              delete result.video;\n            }\n\n            break;\n\n          case streamTypes.ADTS_STREAM_TYPE:\n            result.audio = [];\n            parseAudioPes_(bytes, pmt, result);\n\n            if (result.audio.length === 0) {\n              delete result.audio;\n            }\n\n            break;\n        }\n      }\n    }\n\n    return result;\n  };\n  /**\n   * Inspects segment byte data and returns an object with start and end timing information\n   *\n   * @param {Uint8Array} bytes The segment byte data\n   * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n   *  timestamps for rollover. This value must be in 90khz clock.\n   * @return {Object} Object containing start and end frame timing info of segment.\n   */\n\n\n  var inspect = function inspect(bytes, baseTimestamp) {\n    var isAacData = probe.aac.isLikelyAacData(bytes);\n    var result;\n\n    if (isAacData) {\n      result = inspectAac_(bytes);\n    } else {\n      result = inspectTs_(bytes);\n    }\n\n    if (!result || !result.audio && !result.video) {\n      return null;\n    }\n\n    adjustTimestamp_(result, baseTimestamp);\n    return result;\n  };\n\n  var tsInspector = {\n    inspect: inspect,\n    parseAudioPes_: parseAudioPes_\n  };\n  /* global self */\n\n  /**\n   * Re-emits transmuxer events by converting them into messages to the\n   * world outside the worker.\n   *\n   * @param {Object} transmuxer the transmuxer to wire events on\n   * @private\n   */\n\n  var wireTransmuxerEvents = function wireTransmuxerEvents(self, transmuxer) {\n    transmuxer.on('data', function (segment) {\n      // transfer ownership of the underlying ArrayBuffer\n      // instead of doing a copy to save memory\n      // ArrayBuffers are transferable but generic TypedArrays are not\n      // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n      var initArray = segment.initSegment;\n      segment.initSegment = {\n        data: initArray.buffer,\n        byteOffset: initArray.byteOffset,\n        byteLength: initArray.byteLength\n      };\n      var typedArray = segment.data;\n      segment.data = typedArray.buffer;\n      self.postMessage({\n        action: 'data',\n        segment: segment,\n        byteOffset: typedArray.byteOffset,\n        byteLength: typedArray.byteLength\n      }, [segment.data]);\n    });\n    transmuxer.on('done', function (data) {\n      self.postMessage({\n        action: 'done'\n      });\n    });\n    transmuxer.on('gopInfo', function (gopInfo) {\n      self.postMessage({\n        action: 'gopInfo',\n        gopInfo: gopInfo\n      });\n    });\n    transmuxer.on('videoSegmentTimingInfo', function (timingInfo) {\n      var videoSegmentTimingInfo = {\n        start: {\n          decode: clock.videoTsToSeconds(timingInfo.start.dts),\n          presentation: clock.videoTsToSeconds(timingInfo.start.pts)\n        },\n        end: {\n          decode: clock.videoTsToSeconds(timingInfo.end.dts),\n          presentation: clock.videoTsToSeconds(timingInfo.end.pts)\n        },\n        baseMediaDecodeTime: clock.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n      };\n\n      if (timingInfo.prependedContentDuration) {\n        videoSegmentTimingInfo.prependedContentDuration = clock.videoTsToSeconds(timingInfo.prependedContentDuration);\n      }\n\n      self.postMessage({\n        action: 'videoSegmentTimingInfo',\n        videoSegmentTimingInfo: videoSegmentTimingInfo\n      });\n    });\n    transmuxer.on('audioSegmentTimingInfo', function (timingInfo) {\n      // Note that all times for [audio/video]SegmentTimingInfo events are in video clock\n      var audioSegmentTimingInfo = {\n        start: {\n          decode: clock.videoTsToSeconds(timingInfo.start.dts),\n          presentation: clock.videoTsToSeconds(timingInfo.start.pts)\n        },\n        end: {\n          decode: clock.videoTsToSeconds(timingInfo.end.dts),\n          presentation: clock.videoTsToSeconds(timingInfo.end.pts)\n        },\n        baseMediaDecodeTime: clock.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n      };\n\n      if (timingInfo.prependedContentDuration) {\n        audioSegmentTimingInfo.prependedContentDuration = clock.videoTsToSeconds(timingInfo.prependedContentDuration);\n      }\n\n      self.postMessage({\n        action: 'audioSegmentTimingInfo',\n        audioSegmentTimingInfo: audioSegmentTimingInfo\n      });\n    });\n    transmuxer.on('id3Frame', function (id3Frame) {\n      self.postMessage({\n        action: 'id3Frame',\n        id3Frame: id3Frame\n      });\n    });\n    transmuxer.on('caption', function (caption) {\n      self.postMessage({\n        action: 'caption',\n        caption: caption\n      });\n    });\n    transmuxer.on('trackinfo', function (trackInfo) {\n      self.postMessage({\n        action: 'trackinfo',\n        trackInfo: trackInfo\n      });\n    });\n    transmuxer.on('audioTimingInfo', function (audioTimingInfo) {\n      // convert to video TS since we prioritize video time over audio\n      self.postMessage({\n        action: 'audioTimingInfo',\n        audioTimingInfo: {\n          start: clock.videoTsToSeconds(audioTimingInfo.start),\n          end: clock.videoTsToSeconds(audioTimingInfo.end)\n        }\n      });\n    });\n    transmuxer.on('videoTimingInfo', function (videoTimingInfo) {\n      self.postMessage({\n        action: 'videoTimingInfo',\n        videoTimingInfo: {\n          start: clock.videoTsToSeconds(videoTimingInfo.start),\n          end: clock.videoTsToSeconds(videoTimingInfo.end)\n        }\n      });\n    });\n    transmuxer.on('log', function (log) {\n      self.postMessage({\n        action: 'log',\n        log: log\n      });\n    });\n  };\n  /**\n   * All incoming messages route through this hash. If no function exists\n   * to handle an incoming message, then we ignore the message.\n   *\n   * @class MessageHandlers\n   * @param {Object} options the options to initialize with\n   */\n\n\n  var MessageHandlers = /*#__PURE__*/function () {\n    function MessageHandlers(self, options) {\n      this.options = options || {};\n      this.self = self;\n      this.init();\n    }\n    /**\n     * initialize our web worker and wire all the events.\n     */\n\n\n    var _proto = MessageHandlers.prototype;\n\n    _proto.init = function init() {\n      if (this.transmuxer) {\n        this.transmuxer.dispose();\n      }\n\n      this.transmuxer = new transmuxer.Transmuxer(this.options);\n      wireTransmuxerEvents(this.self, this.transmuxer);\n    };\n\n    _proto.pushMp4Captions = function pushMp4Captions(data) {\n      if (!this.captionParser) {\n        this.captionParser = new captionParser();\n        this.captionParser.init();\n      }\n\n      var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n      var parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);\n      this.self.postMessage({\n        action: 'mp4Captions',\n        captions: parsed && parsed.captions || [],\n        logs: parsed && parsed.logs || [],\n        data: segment.buffer\n      }, [segment.buffer]);\n    };\n\n    _proto.probeMp4StartTime = function probeMp4StartTime(_ref) {\n      var timescales = _ref.timescales,\n          data = _ref.data;\n      var startTime = probe$2.startTime(timescales, data);\n      this.self.postMessage({\n        action: 'probeMp4StartTime',\n        startTime: startTime,\n        data: data\n      }, [data.buffer]);\n    };\n\n    _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) {\n      var data = _ref2.data;\n      var tracks = probe$2.tracks(data);\n      this.self.postMessage({\n        action: 'probeMp4Tracks',\n        tracks: tracks,\n        data: data\n      }, [data.buffer]);\n    }\n    /**\n     * Probe an mpeg2-ts segment to determine the start time of the segment in it's\n     * internal \"media time,\" as well as whether it contains video and/or audio.\n     *\n     * @private\n     * @param {Uint8Array} bytes - segment bytes\n     * @param {number} baseStartTime\n     *        Relative reference timestamp used when adjusting frame timestamps for rollover.\n     *        This value should be in seconds, as it's converted to a 90khz clock within the\n     *        function body.\n     * @return {Object} The start time of the current segment in \"media time\" as well as\n     *                  whether it contains video and/or audio\n     */\n    ;\n\n    _proto.probeTs = function probeTs(_ref3) {\n      var data = _ref3.data,\n          baseStartTime = _ref3.baseStartTime;\n      var tsStartTime = typeof baseStartTime === 'number' && !isNaN(baseStartTime) ? baseStartTime * clock.ONE_SECOND_IN_TS : void 0;\n      var timeInfo = tsInspector.inspect(data, tsStartTime);\n      var result = null;\n\n      if (timeInfo) {\n        result = {\n          // each type's time info comes back as an array of 2 times, start and end\n          hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,\n          hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false\n        };\n\n        if (result.hasVideo) {\n          result.videoStart = timeInfo.video[0].ptsTime;\n        }\n\n        if (result.hasAudio) {\n          result.audioStart = timeInfo.audio[0].ptsTime;\n        }\n      }\n\n      this.self.postMessage({\n        action: 'probeTs',\n        result: result,\n        data: data\n      }, [data.buffer]);\n    };\n\n    _proto.clearAllMp4Captions = function clearAllMp4Captions() {\n      if (this.captionParser) {\n        this.captionParser.clearAllCaptions();\n      }\n    };\n\n    _proto.clearParsedMp4Captions = function clearParsedMp4Captions() {\n      if (this.captionParser) {\n        this.captionParser.clearParsedCaptions();\n      }\n    }\n    /**\n     * Adds data (a ts segment) to the start of the transmuxer pipeline for\n     * processing.\n     *\n     * @param {ArrayBuffer} data data to push into the muxer\n     */\n    ;\n\n    _proto.push = function push(data) {\n      // Cast array buffer to correct type for transmuxer\n      var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n      this.transmuxer.push(segment);\n    }\n    /**\n     * Recreate the transmuxer so that the next segment added via `push`\n     * start with a fresh transmuxer.\n     */\n    ;\n\n    _proto.reset = function reset() {\n      this.transmuxer.reset();\n    }\n    /**\n     * Set the value that will be used as the `baseMediaDecodeTime` time for the\n     * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n     * set relative to the first based on the PTS values.\n     *\n     * @param {Object} data used to set the timestamp offset in the muxer\n     */\n    ;\n\n    _proto.setTimestampOffset = function setTimestampOffset(data) {\n      var timestampOffset = data.timestampOffset || 0;\n      this.transmuxer.setBaseMediaDecodeTime(Math.round(clock.secondsToVideoTs(timestampOffset)));\n    };\n\n    _proto.setAudioAppendStart = function setAudioAppendStart(data) {\n      this.transmuxer.setAudioAppendStart(Math.ceil(clock.secondsToVideoTs(data.appendStart)));\n    };\n\n    _proto.setRemux = function setRemux(data) {\n      this.transmuxer.setRemux(data.remux);\n    }\n    /**\n     * Forces the pipeline to finish processing the last segment and emit it's\n     * results.\n     *\n     * @param {Object} data event data, not really used\n     */\n    ;\n\n    _proto.flush = function flush(data) {\n      this.transmuxer.flush(); // transmuxed done action is fired after both audio/video pipelines are flushed\n\n      self.postMessage({\n        action: 'done',\n        type: 'transmuxed'\n      });\n    };\n\n    _proto.endTimeline = function endTimeline() {\n      this.transmuxer.endTimeline(); // transmuxed endedtimeline action is fired after both audio/video pipelines end their\n      // timelines\n\n      self.postMessage({\n        action: 'endedtimeline',\n        type: 'transmuxed'\n      });\n    };\n\n    _proto.alignGopsWith = function alignGopsWith(data) {\n      this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n    };\n\n    return MessageHandlers;\n  }();\n  /**\n   * Our web worker interface so that things can talk to mux.js\n   * that will be running in a web worker. the scope is passed to this by\n   * webworkify.\n   *\n   * @param {Object} self the scope for the web worker\n   */\n\n\n  self.onmessage = function (event) {\n    if (event.data.action === 'init' && event.data.options) {\n      this.messageHandlers = new MessageHandlers(self, event.data.options);\n      return;\n    }\n\n    if (!this.messageHandlers) {\n      this.messageHandlers = new MessageHandlers(self);\n    }\n\n    if (event.data && event.data.action && event.data.action !== 'init') {\n      if (this.messageHandlers[event.data.action]) {\n        this.messageHandlers[event.data.action](event.data);\n      }\n    }\n  };\n}));\nvar TransmuxWorker = factory(workerCode$1);\n/* rollup-plugin-worker-factory end for worker!/Users/abarstow/videojs/http-streaming/src/transmuxer-worker.js */\n\nvar handleData_ = function handleData_(event, transmuxedData, callback) {\n  var _event$data$segment = event.data.segment,\n      type = _event$data$segment.type,\n      initSegment = _event$data$segment.initSegment,\n      captions = _event$data$segment.captions,\n      captionStreams = _event$data$segment.captionStreams,\n      metadata = _event$data$segment.metadata,\n      videoFrameDtsTime = _event$data$segment.videoFrameDtsTime,\n      videoFramePtsTime = _event$data$segment.videoFramePtsTime;\n  transmuxedData.buffer.push({\n    captions: captions,\n    captionStreams: captionStreams,\n    metadata: metadata\n  });\n  var boxes = event.data.segment.boxes || {\n    data: event.data.segment.data\n  };\n  var result = {\n    type: type,\n    // cast ArrayBuffer to TypedArray\n    data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),\n    initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)\n  };\n\n  if (typeof videoFrameDtsTime !== 'undefined') {\n    result.videoFrameDtsTime = videoFrameDtsTime;\n  }\n\n  if (typeof videoFramePtsTime !== 'undefined') {\n    result.videoFramePtsTime = videoFramePtsTime;\n  }\n\n  callback(result);\n};\n\nvar handleDone_ = function handleDone_(_ref) {\n  var transmuxedData = _ref.transmuxedData,\n      callback = _ref.callback; // Previously we only returned data on data events,\n  // not on done events. Clear out the buffer to keep that consistent.\n\n  transmuxedData.buffer = []; // all buffers should have been flushed from the muxer, so start processing anything we\n  // have received\n\n  callback(transmuxedData);\n};\n\nvar handleGopInfo_ = function handleGopInfo_(event, transmuxedData) {\n  transmuxedData.gopInfo = event.data.gopInfo;\n};\n\nvar processTransmux = function processTransmux(options) {\n  var transmuxer = options.transmuxer,\n      bytes = options.bytes,\n      audioAppendStart = options.audioAppendStart,\n      gopsToAlignWith = options.gopsToAlignWith,\n      remux = options.remux,\n      onData = options.onData,\n      onTrackInfo = options.onTrackInfo,\n      onAudioTimingInfo = options.onAudioTimingInfo,\n      onVideoTimingInfo = options.onVideoTimingInfo,\n      onVideoSegmentTimingInfo = options.onVideoSegmentTimingInfo,\n      onAudioSegmentTimingInfo = options.onAudioSegmentTimingInfo,\n      onId3 = options.onId3,\n      onCaptions = options.onCaptions,\n      onDone = options.onDone,\n      onEndedTimeline = options.onEndedTimeline,\n      onTransmuxerLog = options.onTransmuxerLog,\n      isEndOfTimeline = options.isEndOfTimeline;\n  var transmuxedData = {\n    buffer: []\n  };\n  var waitForEndedTimelineEvent = isEndOfTimeline;\n\n  var handleMessage = function handleMessage(event) {\n    if (transmuxer.currentTransmux !== options) {\n      // disposed\n      return;\n    }\n\n    if (event.data.action === 'data') {\n      handleData_(event, transmuxedData, onData);\n    }\n\n    if (event.data.action === 'trackinfo') {\n      onTrackInfo(event.data.trackInfo);\n    }\n\n    if (event.data.action === 'gopInfo') {\n      handleGopInfo_(event, transmuxedData);\n    }\n\n    if (event.data.action === 'audioTimingInfo') {\n      onAudioTimingInfo(event.data.audioTimingInfo);\n    }\n\n    if (event.data.action === 'videoTimingInfo') {\n      onVideoTimingInfo(event.data.videoTimingInfo);\n    }\n\n    if (event.data.action === 'videoSegmentTimingInfo') {\n      onVideoSegmentTimingInfo(event.data.videoSegmentTimingInfo);\n    }\n\n    if (event.data.action === 'audioSegmentTimingInfo') {\n      onAudioSegmentTimingInfo(event.data.audioSegmentTimingInfo);\n    }\n\n    if (event.data.action === 'id3Frame') {\n      onId3([event.data.id3Frame], event.data.id3Frame.dispatchType);\n    }\n\n    if (event.data.action === 'caption') {\n      onCaptions(event.data.caption);\n    }\n\n    if (event.data.action === 'endedtimeline') {\n      waitForEndedTimelineEvent = false;\n      onEndedTimeline();\n    }\n\n    if (event.data.action === 'log') {\n      onTransmuxerLog(event.data.log);\n    } // wait for the transmuxed event since we may have audio and video\n\n\n    if (event.data.type !== 'transmuxed') {\n      return;\n    } // If the \"endedtimeline\" event has not yet fired, and this segment represents the end\n    // of a timeline, that means there may still be data events before the segment\n    // processing can be considerred complete. In that case, the final event should be\n    // an \"endedtimeline\" event with the type \"transmuxed.\"\n\n\n    if (waitForEndedTimelineEvent) {\n      return;\n    }\n\n    transmuxer.onmessage = null;\n    handleDone_({\n      transmuxedData: transmuxedData,\n      callback: onDone\n    });\n    /* eslint-disable no-use-before-define */\n\n    dequeue(transmuxer);\n    /* eslint-enable */\n  };\n\n  transmuxer.onmessage = handleMessage;\n\n  if (audioAppendStart) {\n    transmuxer.postMessage({\n      action: 'setAudioAppendStart',\n      appendStart: audioAppendStart\n    });\n  } // allow empty arrays to be passed to clear out GOPs\n\n\n  if (Array.isArray(gopsToAlignWith)) {\n    transmuxer.postMessage({\n      action: 'alignGopsWith',\n      gopsToAlignWith: gopsToAlignWith\n    });\n  }\n\n  if (typeof remux !== 'undefined') {\n    transmuxer.postMessage({\n      action: 'setRemux',\n      remux: remux\n    });\n  }\n\n  if (bytes.byteLength) {\n    var buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;\n    var byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;\n    transmuxer.postMessage({\n      action: 'push',\n      // Send the typed-array of data as an ArrayBuffer so that\n      // it can be sent as a \"Transferable\" and avoid the costly\n      // memory copy\n      data: buffer,\n      // To recreate the original typed-array, we need information\n      // about what portion of the ArrayBuffer it was a view into\n      byteOffset: byteOffset,\n      byteLength: bytes.byteLength\n    }, [buffer]);\n  }\n\n  if (isEndOfTimeline) {\n    transmuxer.postMessage({\n      action: 'endTimeline'\n    });\n  } // even if we didn't push any bytes, we have to make sure we flush in case we reached\n  // the end of the segment\n\n\n  transmuxer.postMessage({\n    action: 'flush'\n  });\n};\n\nvar dequeue = function dequeue(transmuxer) {\n  transmuxer.currentTransmux = null;\n\n  if (transmuxer.transmuxQueue.length) {\n    transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();\n\n    if (typeof transmuxer.currentTransmux === 'function') {\n      transmuxer.currentTransmux();\n    } else {\n      processTransmux(transmuxer.currentTransmux);\n    }\n  }\n};\n\nvar processAction = function processAction(transmuxer, action) {\n  transmuxer.postMessage({\n    action: action\n  });\n  dequeue(transmuxer);\n};\n\nvar enqueueAction = function enqueueAction(action, transmuxer) {\n  if (!transmuxer.currentTransmux) {\n    transmuxer.currentTransmux = action;\n    processAction(transmuxer, action);\n    return;\n  }\n\n  transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));\n};\n\nvar reset = function reset(transmuxer) {\n  enqueueAction('reset', transmuxer);\n};\n\nvar endTimeline = function endTimeline(transmuxer) {\n  enqueueAction('endTimeline', transmuxer);\n};\n\nvar transmux = function transmux(options) {\n  if (!options.transmuxer.currentTransmux) {\n    options.transmuxer.currentTransmux = options;\n    processTransmux(options);\n    return;\n  }\n\n  options.transmuxer.transmuxQueue.push(options);\n};\n\nvar createTransmuxer = function createTransmuxer(options) {\n  var transmuxer = new TransmuxWorker();\n  transmuxer.currentTransmux = null;\n  transmuxer.transmuxQueue = [];\n  var term = transmuxer.terminate;\n\n  transmuxer.terminate = function () {\n    transmuxer.currentTransmux = null;\n    transmuxer.transmuxQueue.length = 0;\n    return term.call(transmuxer);\n  };\n\n  transmuxer.postMessage({\n    action: 'init',\n    options: options\n  });\n  return transmuxer;\n};\n\nvar segmentTransmuxer = {\n  reset: reset,\n  endTimeline: endTimeline,\n  transmux: transmux,\n  createTransmuxer: createTransmuxer\n};\n\nvar workerCallback = function workerCallback(options) {\n  var transmuxer = options.transmuxer;\n  var endAction = options.endAction || options.action;\n  var callback = options.callback;\n\n  var message = _extends({}, options, {\n    endAction: null,\n    transmuxer: null,\n    callback: null\n  });\n\n  var listenForEndEvent = function listenForEndEvent(event) {\n    if (event.data.action !== endAction) {\n      return;\n    }\n\n    transmuxer.removeEventListener('message', listenForEndEvent); // transfer ownership of bytes back to us.\n\n    if (event.data.data) {\n      event.data.data = new Uint8Array(event.data.data, options.byteOffset || 0, options.byteLength || event.data.data.byteLength);\n\n      if (options.data) {\n        options.data = event.data.data;\n      }\n    }\n\n    callback(event.data);\n  };\n\n  transmuxer.addEventListener('message', listenForEndEvent);\n\n  if (options.data) {\n    var isArrayBuffer = options.data instanceof ArrayBuffer;\n    message.byteOffset = isArrayBuffer ? 0 : options.data.byteOffset;\n    message.byteLength = options.data.byteLength;\n    var transfers = [isArrayBuffer ? options.data : options.data.buffer];\n    transmuxer.postMessage(message, transfers);\n  } else {\n    transmuxer.postMessage(message);\n  }\n};\n\nvar REQUEST_ERRORS = {\n  FAILURE: 2,\n  TIMEOUT: -101,\n  ABORTED: -102\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\nvar abortAll = function abortAll(activeXhrs) {\n  activeXhrs.forEach(function (xhr) {\n    xhr.abort();\n  });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\n\nvar getRequestStats = function getRequestStats(request) {\n  return {\n    bandwidth: request.bandwidth,\n    bytesReceived: request.bytesReceived || 0,\n    roundTripTime: request.roundTripTime || 0\n  };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\n\nvar getProgressStats = function getProgressStats(progressEvent) {\n  var request = progressEvent.target;\n  var roundTripTime = Date.now() - request.requestTime;\n  var stats = {\n    bandwidth: Infinity,\n    bytesReceived: 0,\n    roundTripTime: roundTripTime || 0\n  };\n  stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n  // because we should only use bandwidth stats on progress to determine when\n  // abort a request early due to insufficient bandwidth\n\n  stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n  return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request -  the XHR request that possibly generated the error\n */\n\n\nvar handleErrors = function handleErrors(error, request) {\n  if (request.timedout) {\n    return {\n      status: request.status,\n      message: 'HLS request timed-out at URL: ' + request.uri,\n      code: REQUEST_ERRORS.TIMEOUT,\n      xhr: request\n    };\n  }\n\n  if (request.aborted) {\n    return {\n      status: request.status,\n      message: 'HLS request aborted at URL: ' + request.uri,\n      code: REQUEST_ERRORS.ABORTED,\n      xhr: request\n    };\n  }\n\n  if (error) {\n    return {\n      status: request.status,\n      message: 'HLS request errored at URL: ' + request.uri,\n      code: REQUEST_ERRORS.FAILURE,\n      xhr: request\n    };\n  }\n\n  if (request.responseType === 'arraybuffer' && request.response.byteLength === 0) {\n    return {\n      status: request.status,\n      message: 'Empty HLS response at URL: ' + request.uri,\n      code: REQUEST_ERRORS.FAILURE,\n      xhr: request\n    };\n  }\n\n  return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Array} objects - objects to add the key bytes to.\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nvar handleKeyResponse = function handleKeyResponse(segment, objects, finishProcessingFn) {\n  return function (error, request) {\n    var response = request.response;\n    var errorObj = handleErrors(error, request);\n\n    if (errorObj) {\n      return finishProcessingFn(errorObj, segment);\n    }\n\n    if (response.byteLength !== 16) {\n      return finishProcessingFn({\n        status: request.status,\n        message: 'Invalid HLS key at URL: ' + request.uri,\n        code: REQUEST_ERRORS.FAILURE,\n        xhr: request\n      }, segment);\n    }\n\n    var view = new DataView(response);\n    var bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\n    for (var i = 0; i < objects.length; i++) {\n      objects[i].bytes = bytes;\n    }\n\n    return finishProcessingFn(null, segment);\n  };\n};\n\nvar parseInitSegment = function parseInitSegment(segment, _callback) {\n  var type = detectContainerForBytes(segment.map.bytes); // TODO: We should also handle ts init segments here, but we\n  // only know how to parse mp4 init segments at the moment\n\n  if (type !== 'mp4') {\n    var uri = segment.map.resolvedUri || segment.map.uri;\n    return _callback({\n      internal: true,\n      message: \"Found unsupported \" + (type || 'unknown') + \" container for initialization segment at URL: \" + uri,\n      code: REQUEST_ERRORS.FAILURE\n    });\n  }\n\n  workerCallback({\n    action: 'probeMp4Tracks',\n    data: segment.map.bytes,\n    transmuxer: segment.transmuxer,\n    callback: function callback(_ref) {\n      var tracks = _ref.tracks,\n          data = _ref.data; // transfer bytes back to us\n\n      segment.map.bytes = data;\n      tracks.forEach(function (track) {\n        segment.map.tracks = segment.map.tracks || {}; // only support one track of each type for now\n\n        if (segment.map.tracks[track.type]) {\n          return;\n        }\n\n        segment.map.tracks[track.type] = track;\n\n        if (typeof track.id === 'number' && track.timescale) {\n          segment.map.timescales = segment.map.timescales || {};\n          segment.map.timescales[track.id] = track.timescale;\n        }\n      });\n      return _callback(null);\n    }\n  });\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nvar handleInitSegmentResponse = function handleInitSegmentResponse(_ref2) {\n  var segment = _ref2.segment,\n      finishProcessingFn = _ref2.finishProcessingFn;\n  return function (error, request) {\n    var errorObj = handleErrors(error, request);\n\n    if (errorObj) {\n      return finishProcessingFn(errorObj, segment);\n    }\n\n    var bytes = new Uint8Array(request.response); // init segment is encypted, we will have to wait\n    // until the key request is done to decrypt.\n\n    if (segment.map.key) {\n      segment.map.encryptedBytes = bytes;\n      return finishProcessingFn(null, segment);\n    }\n\n    segment.map.bytes = bytes;\n    parseInitSegment(segment, function (parseError) {\n      if (parseError) {\n        parseError.xhr = request;\n        parseError.status = request.status;\n        return finishProcessingFn(parseError, segment);\n      }\n\n      finishProcessingFn(null, segment);\n    });\n  };\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nvar handleSegmentResponse = function handleSegmentResponse(_ref3) {\n  var segment = _ref3.segment,\n      finishProcessingFn = _ref3.finishProcessingFn,\n      responseType = _ref3.responseType;\n  return function (error, request) {\n    var errorObj = handleErrors(error, request);\n\n    if (errorObj) {\n      return finishProcessingFn(errorObj, segment);\n    }\n\n    var newBytes = // although responseText \"should\" exist, this guard serves to prevent an error being\n    // thrown for two primary cases:\n    // 1. the mime type override stops working, or is not implemented for a specific\n    //    browser\n    // 2. when using mock XHR libraries like sinon that do not allow the override behavior\n    responseType === 'arraybuffer' || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));\n    segment.stats = getRequestStats(request);\n\n    if (segment.key) {\n      segment.encryptedBytes = new Uint8Array(newBytes);\n    } else {\n      segment.bytes = new Uint8Array(newBytes);\n    }\n\n    return finishProcessingFn(null, segment);\n  };\n};\n\nvar transmuxAndNotify = function transmuxAndNotify(_ref4) {\n  var segment = _ref4.segment,\n      bytes = _ref4.bytes,\n      trackInfoFn = _ref4.trackInfoFn,\n      timingInfoFn = _ref4.timingInfoFn,\n      videoSegmentTimingInfoFn = _ref4.videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn = _ref4.audioSegmentTimingInfoFn,\n      id3Fn = _ref4.id3Fn,\n      captionsFn = _ref4.captionsFn,\n      isEndOfTimeline = _ref4.isEndOfTimeline,\n      endedTimelineFn = _ref4.endedTimelineFn,\n      dataFn = _ref4.dataFn,\n      doneFn = _ref4.doneFn,\n      onTransmuxerLog = _ref4.onTransmuxerLog;\n  var fmp4Tracks = segment.map && segment.map.tracks || {};\n  var isMuxed = Boolean(fmp4Tracks.audio && fmp4Tracks.video); // Keep references to each function so we can null them out after we're done with them.\n  // One reason for this is that in the case of full segments, we want to trust start\n  // times from the probe, rather than the transmuxer.\n\n  var audioStartFn = timingInfoFn.bind(null, segment, 'audio', 'start');\n  var audioEndFn = timingInfoFn.bind(null, segment, 'audio', 'end');\n  var videoStartFn = timingInfoFn.bind(null, segment, 'video', 'start');\n  var videoEndFn = timingInfoFn.bind(null, segment, 'video', 'end');\n\n  var finish = function finish() {\n    return transmux({\n      bytes: bytes,\n      transmuxer: segment.transmuxer,\n      audioAppendStart: segment.audioAppendStart,\n      gopsToAlignWith: segment.gopsToAlignWith,\n      remux: isMuxed,\n      onData: function onData(result) {\n        result.type = result.type === 'combined' ? 'video' : result.type;\n        dataFn(segment, result);\n      },\n      onTrackInfo: function onTrackInfo(trackInfo) {\n        if (trackInfoFn) {\n          if (isMuxed) {\n            trackInfo.isMuxed = true;\n          }\n\n          trackInfoFn(segment, trackInfo);\n        }\n      },\n      onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) {\n        // we only want the first start value we encounter\n        if (audioStartFn && typeof audioTimingInfo.start !== 'undefined') {\n          audioStartFn(audioTimingInfo.start);\n          audioStartFn = null;\n        } // we want to continually update the end time\n\n\n        if (audioEndFn && typeof audioTimingInfo.end !== 'undefined') {\n          audioEndFn(audioTimingInfo.end);\n        }\n      },\n      onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) {\n        // we only want the first start value we encounter\n        if (videoStartFn && typeof videoTimingInfo.start !== 'undefined') {\n          videoStartFn(videoTimingInfo.start);\n          videoStartFn = null;\n        } // we want to continually update the end time\n\n\n        if (videoEndFn && typeof videoTimingInfo.end !== 'undefined') {\n          videoEndFn(videoTimingInfo.end);\n        }\n      },\n      onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) {\n        videoSegmentTimingInfoFn(videoSegmentTimingInfo);\n      },\n      onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) {\n        audioSegmentTimingInfoFn(audioSegmentTimingInfo);\n      },\n      onId3: function onId3(id3Frames, dispatchType) {\n        id3Fn(segment, id3Frames, dispatchType);\n      },\n      onCaptions: function onCaptions(captions) {\n        captionsFn(segment, [captions]);\n      },\n      isEndOfTimeline: isEndOfTimeline,\n      onEndedTimeline: function onEndedTimeline() {\n        endedTimelineFn();\n      },\n      onTransmuxerLog: onTransmuxerLog,\n      onDone: function onDone(result) {\n        if (!doneFn) {\n          return;\n        }\n\n        result.type = result.type === 'combined' ? 'video' : result.type;\n        doneFn(null, segment, result);\n      }\n    });\n  }; // In the transmuxer, we don't yet have the ability to extract a \"proper\" start time.\n  // Meaning cached frame data may corrupt our notion of where this segment\n  // really starts. To get around this, probe for the info needed.\n\n\n  workerCallback({\n    action: 'probeTs',\n    transmuxer: segment.transmuxer,\n    data: bytes,\n    baseStartTime: segment.baseStartTime,\n    callback: function callback(data) {\n      segment.bytes = bytes = data.data;\n      var probeResult = data.result;\n\n      if (probeResult) {\n        trackInfoFn(segment, {\n          hasAudio: probeResult.hasAudio,\n          hasVideo: probeResult.hasVideo,\n          isMuxed: isMuxed\n        });\n        trackInfoFn = null;\n\n        if (probeResult.hasAudio && !isMuxed) {\n          audioStartFn(probeResult.audioStart);\n        }\n\n        if (probeResult.hasVideo) {\n          videoStartFn(probeResult.videoStart);\n        }\n\n        audioStartFn = null;\n        videoStartFn = null;\n      }\n\n      finish();\n    }\n  });\n};\n\nvar handleSegmentBytes = function handleSegmentBytes(_ref5) {\n  var segment = _ref5.segment,\n      bytes = _ref5.bytes,\n      trackInfoFn = _ref5.trackInfoFn,\n      timingInfoFn = _ref5.timingInfoFn,\n      videoSegmentTimingInfoFn = _ref5.videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn = _ref5.audioSegmentTimingInfoFn,\n      id3Fn = _ref5.id3Fn,\n      captionsFn = _ref5.captionsFn,\n      isEndOfTimeline = _ref5.isEndOfTimeline,\n      endedTimelineFn = _ref5.endedTimelineFn,\n      dataFn = _ref5.dataFn,\n      doneFn = _ref5.doneFn,\n      onTransmuxerLog = _ref5.onTransmuxerLog;\n  var bytesAsUint8Array = new Uint8Array(bytes); // TODO:\n  // We should have a handler that fetches the number of bytes required\n  // to check if something is fmp4. This will allow us to save bandwidth\n  // because we can only blacklist a playlist and abort requests\n  // by codec after trackinfo triggers.\n\n  if (isLikelyFmp4MediaSegment(bytesAsUint8Array)) {\n    segment.isFmp4 = true;\n    var tracks = segment.map.tracks;\n    var trackInfo = {\n      isFmp4: true,\n      hasVideo: !!tracks.video,\n      hasAudio: !!tracks.audio\n    }; // if we have a audio track, with a codec that is not set to\n    // encrypted audio\n\n    if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== 'enca') {\n      trackInfo.audioCodec = tracks.audio.codec;\n    } // if we have a video track, with a codec that is not set to\n    // encrypted video\n\n\n    if (tracks.video && tracks.video.codec && tracks.video.codec !== 'encv') {\n      trackInfo.videoCodec = tracks.video.codec;\n    }\n\n    if (tracks.video && tracks.audio) {\n      trackInfo.isMuxed = true;\n    } // since we don't support appending fmp4 data on progress, we know we have the full\n    // segment here\n\n\n    trackInfoFn(segment, trackInfo); // The probe doesn't provide the segment end time, so only callback with the start\n    // time. The end time can be roughly calculated by the receiver using the duration.\n    //\n    // Note that the start time returned by the probe reflects the baseMediaDecodeTime, as\n    // that is the true start of the segment (where the playback engine should begin\n    // decoding).\n\n    var finishLoading = function finishLoading(captions) {\n      // if the track still has audio at this point it is only possible\n      // for it to be audio only. See `tracks.video && tracks.audio` if statement\n      // above.\n      // we make sure to use segment.bytes here as that\n      dataFn(segment, {\n        data: bytesAsUint8Array,\n        type: trackInfo.hasAudio && !trackInfo.isMuxed ? 'audio' : 'video'\n      });\n\n      if (captions && captions.length) {\n        captionsFn(segment, captions);\n      }\n\n      doneFn(null, segment, {});\n    };\n\n    workerCallback({\n      action: 'probeMp4StartTime',\n      timescales: segment.map.timescales,\n      data: bytesAsUint8Array,\n      transmuxer: segment.transmuxer,\n      callback: function callback(_ref6) {\n        var data = _ref6.data,\n            startTime = _ref6.startTime; // transfer bytes back to us\n\n        bytes = data.buffer;\n        segment.bytes = bytesAsUint8Array = data;\n\n        if (trackInfo.hasAudio && !trackInfo.isMuxed) {\n          timingInfoFn(segment, 'audio', 'start', startTime);\n        }\n\n        if (trackInfo.hasVideo) {\n          timingInfoFn(segment, 'video', 'start', startTime);\n        } // Run through the CaptionParser in case there are captions.\n        // Initialize CaptionParser if it hasn't been yet\n\n\n        if (!tracks.video || !data.byteLength || !segment.transmuxer) {\n          finishLoading();\n          return;\n        }\n\n        workerCallback({\n          action: 'pushMp4Captions',\n          endAction: 'mp4Captions',\n          transmuxer: segment.transmuxer,\n          data: bytesAsUint8Array,\n          timescales: segment.map.timescales,\n          trackIds: [tracks.video.id],\n          callback: function callback(message) {\n            // transfer bytes back to us\n            bytes = message.data.buffer;\n            segment.bytes = bytesAsUint8Array = message.data;\n            message.logs.forEach(function (log) {\n              onTransmuxerLog(videojs.mergeOptions(log, {\n                stream: 'mp4CaptionParser'\n              }));\n            });\n            finishLoading(message.captions);\n          }\n        });\n      }\n    });\n    return;\n  } // VTT or other segments that don't need processing\n\n\n  if (!segment.transmuxer) {\n    doneFn(null, segment, {});\n    return;\n  }\n\n  if (typeof segment.container === 'undefined') {\n    segment.container = detectContainerForBytes(bytesAsUint8Array);\n  }\n\n  if (segment.container !== 'ts' && segment.container !== 'aac') {\n    trackInfoFn(segment, {\n      hasAudio: false,\n      hasVideo: false\n    });\n    doneFn(null, segment, {});\n    return;\n  } // ts or aac\n\n\n  transmuxAndNotify({\n    segment: segment,\n    bytes: bytes,\n    trackInfoFn: trackInfoFn,\n    timingInfoFn: timingInfoFn,\n    videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n    id3Fn: id3Fn,\n    captionsFn: captionsFn,\n    isEndOfTimeline: isEndOfTimeline,\n    endedTimelineFn: endedTimelineFn,\n    dataFn: dataFn,\n    doneFn: doneFn,\n    onTransmuxerLog: onTransmuxerLog\n  });\n};\n\nvar decrypt = function decrypt(_ref7, callback) {\n  var id = _ref7.id,\n      key = _ref7.key,\n      encryptedBytes = _ref7.encryptedBytes,\n      decryptionWorker = _ref7.decryptionWorker;\n\n  var decryptionHandler = function decryptionHandler(event) {\n    if (event.data.source === id) {\n      decryptionWorker.removeEventListener('message', decryptionHandler);\n      var decrypted = event.data.decrypted;\n      callback(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));\n    }\n  };\n\n  decryptionWorker.addEventListener('message', decryptionHandler);\n  var keyBytes;\n\n  if (key.bytes.slice) {\n    keyBytes = key.bytes.slice();\n  } else {\n    keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));\n  } // incrementally decrypt the bytes\n\n\n  decryptionWorker.postMessage(createTransferableMessage({\n    source: id,\n    encrypted: encryptedBytes,\n    key: keyBytes,\n    iv: key.iv\n  }), [encryptedBytes.buffer, keyBytes.buffer]);\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n *                                       routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\n\nvar decryptSegment = function decryptSegment(_ref8) {\n  var decryptionWorker = _ref8.decryptionWorker,\n      segment = _ref8.segment,\n      trackInfoFn = _ref8.trackInfoFn,\n      timingInfoFn = _ref8.timingInfoFn,\n      videoSegmentTimingInfoFn = _ref8.videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn = _ref8.audioSegmentTimingInfoFn,\n      id3Fn = _ref8.id3Fn,\n      captionsFn = _ref8.captionsFn,\n      isEndOfTimeline = _ref8.isEndOfTimeline,\n      endedTimelineFn = _ref8.endedTimelineFn,\n      dataFn = _ref8.dataFn,\n      doneFn = _ref8.doneFn,\n      onTransmuxerLog = _ref8.onTransmuxerLog;\n  decrypt({\n    id: segment.requestId,\n    key: segment.key,\n    encryptedBytes: segment.encryptedBytes,\n    decryptionWorker: decryptionWorker\n  }, function (decryptedBytes) {\n    segment.bytes = decryptedBytes;\n    handleSegmentBytes({\n      segment: segment,\n      bytes: segment.bytes,\n      trackInfoFn: trackInfoFn,\n      timingInfoFn: timingInfoFn,\n      videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n      id3Fn: id3Fn,\n      captionsFn: captionsFn,\n      isEndOfTimeline: isEndOfTimeline,\n      endedTimelineFn: endedTimelineFn,\n      dataFn: dataFn,\n      doneFn: doneFn,\n      onTransmuxerLog: onTransmuxerLog\n    });\n  });\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n *                                       routines\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Function} doneFn - a callback that is executed after all resources have been\n *                            downloaded and any decryption completed\n */\n\n\nvar waitForCompletion = function waitForCompletion(_ref9) {\n  var activeXhrs = _ref9.activeXhrs,\n      decryptionWorker = _ref9.decryptionWorker,\n      trackInfoFn = _ref9.trackInfoFn,\n      timingInfoFn = _ref9.timingInfoFn,\n      videoSegmentTimingInfoFn = _ref9.videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn = _ref9.audioSegmentTimingInfoFn,\n      id3Fn = _ref9.id3Fn,\n      captionsFn = _ref9.captionsFn,\n      isEndOfTimeline = _ref9.isEndOfTimeline,\n      endedTimelineFn = _ref9.endedTimelineFn,\n      dataFn = _ref9.dataFn,\n      doneFn = _ref9.doneFn,\n      onTransmuxerLog = _ref9.onTransmuxerLog;\n  var count = 0;\n  var didError = false;\n  return function (error, segment) {\n    if (didError) {\n      return;\n    }\n\n    if (error) {\n      didError = true; // If there are errors, we have to abort any outstanding requests\n\n      abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n      // handle the aborted events from those requests, there are some cases where we may\n      // never get an aborted event. For instance, if the network connection is lost and\n      // there were two requests, the first may have triggered an error immediately, while\n      // the second request remains unsent. In that case, the aborted algorithm will not\n      // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n      //\n      // We also can't rely on the ready state of the XHR, since the request that\n      // triggered the connection error may also show as a ready state of 0 (unsent).\n      // Therefore, we have to finish this group of requests immediately after the first\n      // seen error.\n\n      return doneFn(error, segment);\n    }\n\n    count += 1;\n\n    if (count === activeXhrs.length) {\n      var segmentFinish = function segmentFinish() {\n        if (segment.encryptedBytes) {\n          return decryptSegment({\n            decryptionWorker: decryptionWorker,\n            segment: segment,\n            trackInfoFn: trackInfoFn,\n            timingInfoFn: timingInfoFn,\n            videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n            audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n            id3Fn: id3Fn,\n            captionsFn: captionsFn,\n            isEndOfTimeline: isEndOfTimeline,\n            endedTimelineFn: endedTimelineFn,\n            dataFn: dataFn,\n            doneFn: doneFn,\n            onTransmuxerLog: onTransmuxerLog\n          });\n        } // Otherwise, everything is ready just continue\n\n\n        handleSegmentBytes({\n          segment: segment,\n          bytes: segment.bytes,\n          trackInfoFn: trackInfoFn,\n          timingInfoFn: timingInfoFn,\n          videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n          audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n          id3Fn: id3Fn,\n          captionsFn: captionsFn,\n          isEndOfTimeline: isEndOfTimeline,\n          endedTimelineFn: endedTimelineFn,\n          dataFn: dataFn,\n          doneFn: doneFn,\n          onTransmuxerLog: onTransmuxerLog\n        });\n      }; // Keep track of when *all* of the requests have completed\n\n\n      segment.endOfAllRequests = Date.now();\n\n      if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {\n        return decrypt({\n          decryptionWorker: decryptionWorker,\n          // add -init to the \"id\" to differentiate between segment\n          // and init segment decryption, just in case they happen\n          // at the same time at some point in the future.\n          id: segment.requestId + '-init',\n          encryptedBytes: segment.map.encryptedBytes,\n          key: segment.map.key\n        }, function (decryptedBytes) {\n          segment.map.bytes = decryptedBytes;\n          parseInitSegment(segment, function (parseError) {\n            if (parseError) {\n              abortAll(activeXhrs);\n              return doneFn(parseError, segment);\n            }\n\n            segmentFinish();\n          });\n        });\n      }\n\n      segmentFinish();\n    }\n  };\n};\n/**\n * Calls the abort callback if any request within the batch was aborted. Will only call\n * the callback once per batch of requests, even if multiple were aborted.\n *\n * @param {Object} loadendState - state to check to see if the abort function was called\n * @param {Function} abortFn - callback to call for abort\n */\n\n\nvar handleLoadEnd = function handleLoadEnd(_ref10) {\n  var loadendState = _ref10.loadendState,\n      abortFn = _ref10.abortFn;\n  return function (event) {\n    var request = event.target;\n\n    if (request.aborted && abortFn && !loadendState.calledAbortFn) {\n      abortFn();\n      loadendState.calledAbortFn = true;\n    }\n  };\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n *                                is received\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\n\nvar handleProgress = function handleProgress(_ref11) {\n  var segment = _ref11.segment,\n      progressFn = _ref11.progressFn;\n  _ref11.trackInfoFn;\n  _ref11.timingInfoFn;\n  _ref11.videoSegmentTimingInfoFn;\n  _ref11.audioSegmentTimingInfoFn;\n  _ref11.id3Fn;\n  _ref11.captionsFn;\n  _ref11.isEndOfTimeline;\n  _ref11.endedTimelineFn;\n  _ref11.dataFn;\n  return function (event) {\n    var request = event.target;\n\n    if (request.aborted) {\n      return;\n    }\n\n    segment.stats = videojs.mergeOptions(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n    if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n      segment.stats.firstBytesReceivedAt = Date.now();\n    }\n\n    return progressFn(event, segment);\n  };\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n *   decrypts the media-segment if it has a key uri and an iv\n *   aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n *   resolvedUri: String,\n *   [transmuxer]: Object,\n *   [byterange]: {\n *     offset: Number,\n *     length: Number\n *   },\n *   [key]: {\n *     resolvedUri: String\n *     [byterange]: {\n *       offset: Number,\n *       length: Number\n *     },\n *     iv: {\n *       bytes: Uint32Array\n *     }\n *   },\n *   [map]: {\n *     resolvedUri: String,\n *     [byterange]: {\n *       offset: Number,\n *       length: Number\n *     },\n *     [bytes]: Uint8Array\n *   }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n *                                       decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} abortFn - a callback called (only once) if any piece of a request was\n *                             aborted\n * @param {Function} progressFn - a callback that receives progress events from the main\n *                                segment's xhr request\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that receives data from the main segment's xhr\n *                            request, transmuxed if needed\n * @param {Function} doneFn - a callback that is executed only once all requests have\n *                            succeeded or failed\n * @return {Function} a function that, when invoked, immediately aborts all\n *                     outstanding requests\n */\n\n\nvar mediaSegmentRequest = function mediaSegmentRequest(_ref12) {\n  var xhr = _ref12.xhr,\n      xhrOptions = _ref12.xhrOptions,\n      decryptionWorker = _ref12.decryptionWorker,\n      segment = _ref12.segment,\n      abortFn = _ref12.abortFn,\n      progressFn = _ref12.progressFn,\n      trackInfoFn = _ref12.trackInfoFn,\n      timingInfoFn = _ref12.timingInfoFn,\n      videoSegmentTimingInfoFn = _ref12.videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn = _ref12.audioSegmentTimingInfoFn,\n      id3Fn = _ref12.id3Fn,\n      captionsFn = _ref12.captionsFn,\n      isEndOfTimeline = _ref12.isEndOfTimeline,\n      endedTimelineFn = _ref12.endedTimelineFn,\n      dataFn = _ref12.dataFn,\n      doneFn = _ref12.doneFn,\n      onTransmuxerLog = _ref12.onTransmuxerLog;\n  var activeXhrs = [];\n  var finishProcessingFn = waitForCompletion({\n    activeXhrs: activeXhrs,\n    decryptionWorker: decryptionWorker,\n    trackInfoFn: trackInfoFn,\n    timingInfoFn: timingInfoFn,\n    videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n    id3Fn: id3Fn,\n    captionsFn: captionsFn,\n    isEndOfTimeline: isEndOfTimeline,\n    endedTimelineFn: endedTimelineFn,\n    dataFn: dataFn,\n    doneFn: doneFn,\n    onTransmuxerLog: onTransmuxerLog\n  }); // optionally, request the decryption key\n\n  if (segment.key && !segment.key.bytes) {\n    var objects = [segment.key];\n\n    if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {\n      objects.push(segment.map.key);\n    }\n\n    var keyRequestOptions = videojs.mergeOptions(xhrOptions, {\n      uri: segment.key.resolvedUri,\n      responseType: 'arraybuffer'\n    });\n    var keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);\n    var keyXhr = xhr(keyRequestOptions, keyRequestCallback);\n    activeXhrs.push(keyXhr);\n  } // optionally, request the associated media init segment\n\n\n  if (segment.map && !segment.map.bytes) {\n    var differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);\n\n    if (differentMapKey) {\n      var mapKeyRequestOptions = videojs.mergeOptions(xhrOptions, {\n        uri: segment.map.key.resolvedUri,\n        responseType: 'arraybuffer'\n      });\n      var mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);\n      var mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);\n      activeXhrs.push(mapKeyXhr);\n    }\n\n    var initSegmentOptions = videojs.mergeOptions(xhrOptions, {\n      uri: segment.map.resolvedUri,\n      responseType: 'arraybuffer',\n      headers: segmentXhrHeaders(segment.map)\n    });\n    var initSegmentRequestCallback = handleInitSegmentResponse({\n      segment: segment,\n      finishProcessingFn: finishProcessingFn\n    });\n    var initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);\n    activeXhrs.push(initSegmentXhr);\n  }\n\n  var segmentRequestOptions = videojs.mergeOptions(xhrOptions, {\n    uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,\n    responseType: 'arraybuffer',\n    headers: segmentXhrHeaders(segment)\n  });\n  var segmentRequestCallback = handleSegmentResponse({\n    segment: segment,\n    finishProcessingFn: finishProcessingFn,\n    responseType: segmentRequestOptions.responseType\n  });\n  var segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);\n  segmentXhr.addEventListener('progress', handleProgress({\n    segment: segment,\n    progressFn: progressFn,\n    trackInfoFn: trackInfoFn,\n    timingInfoFn: timingInfoFn,\n    videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n    id3Fn: id3Fn,\n    captionsFn: captionsFn,\n    isEndOfTimeline: isEndOfTimeline,\n    endedTimelineFn: endedTimelineFn,\n    dataFn: dataFn\n  }));\n  activeXhrs.push(segmentXhr); // since all parts of the request must be considered, but should not make callbacks\n  // multiple times, provide a shared state object\n\n  var loadendState = {};\n  activeXhrs.forEach(function (activeXhr) {\n    activeXhr.addEventListener('loadend', handleLoadEnd({\n      loadendState: loadendState,\n      abortFn: abortFn\n    }));\n  });\n  return function () {\n    return abortAll(activeXhrs);\n  };\n};\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\n\n\nvar logFn$1 = logger('CodecUtils');\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n *\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\nvar getCodecs = function getCodecs(media) {\n  // if the codecs were explicitly specified, use them instead of the\n  // defaults\n  var mediaAttributes = media.attributes || {};\n\n  if (mediaAttributes.CODECS) {\n    return parseCodecs(mediaAttributes.CODECS);\n  }\n};\n\nvar isMaat = function isMaat(master, media) {\n  var mediaAttributes = media.attributes || {};\n  return master && master.mediaGroups && master.mediaGroups.AUDIO && mediaAttributes.AUDIO && master.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n};\n\nvar isMuxed = function isMuxed(master, media) {\n  if (!isMaat(master, media)) {\n    return true;\n  }\n\n  var mediaAttributes = media.attributes || {};\n  var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n\n  for (var groupId in audioGroup) {\n    // If an audio group has a URI (the case for HLS, as HLS will use external playlists),\n    // or there are listed playlists (the case for DASH, as the manifest will have already\n    // provided all of the details necessary to generate the audio playlist, as opposed to\n    // HLS' externally requested playlists), then the content is demuxed.\n    if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n      return true;\n    }\n  }\n\n  return false;\n};\n\nvar unwrapCodecList = function unwrapCodecList(codecList) {\n  var codecs = {};\n  codecList.forEach(function (_ref) {\n    var mediaType = _ref.mediaType,\n        type = _ref.type,\n        details = _ref.details;\n    codecs[mediaType] = codecs[mediaType] || [];\n    codecs[mediaType].push(translateLegacyCodec(\"\" + type + details));\n  });\n  Object.keys(codecs).forEach(function (mediaType) {\n    if (codecs[mediaType].length > 1) {\n      logFn$1(\"multiple \" + mediaType + \" codecs found as attributes: \" + codecs[mediaType].join(', ') + \". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.\");\n      codecs[mediaType] = null;\n      return;\n    }\n\n    codecs[mediaType] = codecs[mediaType][0];\n  });\n  return codecs;\n};\n\nvar codecCount = function codecCount(codecObj) {\n  var count = 0;\n\n  if (codecObj.audio) {\n    count++;\n  }\n\n  if (codecObj.video) {\n    count++;\n  }\n\n  return count;\n};\n/**\n * Calculates the codec strings for a working configuration of\n * SourceBuffers to play variant streams in a master playlist. If\n * there is no possible working configuration, an empty object will be\n * returned.\n *\n * @param master {Object} the m3u8 object for the master playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Object} the codec strings.\n *\n * @private\n */\n\n\nvar codecsForPlaylist = function codecsForPlaylist(master, media) {\n  var mediaAttributes = media.attributes || {};\n  var codecInfo = unwrapCodecList(getCodecs(media) || []); // HLS with multiple-audio tracks must always get an audio codec.\n  // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n  if (isMaat(master, media) && !codecInfo.audio) {\n    if (!isMuxed(master, media)) {\n      // It is possible for codecs to be specified on the audio media group playlist but\n      // not on the rendition playlist. This is mostly the case for DASH, where audio and\n      // video are always separate (and separately specified).\n      var defaultCodecs = unwrapCodecList(codecsFromDefault(master, mediaAttributes.AUDIO) || []);\n\n      if (defaultCodecs.audio) {\n        codecInfo.audio = defaultCodecs.audio;\n      }\n    }\n  }\n\n  return codecInfo;\n};\n\nvar logFn = logger('PlaylistSelector');\n\nvar representationToString = function representationToString(representation) {\n  if (!representation || !representation.playlist) {\n    return;\n  }\n\n  var playlist = representation.playlist;\n  return JSON.stringify({\n    id: playlist.id,\n    bandwidth: representation.bandwidth,\n    width: representation.width,\n    height: representation.height,\n    codecs: playlist.attributes && playlist.attributes.CODECS || ''\n  });\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\n\nvar safeGetComputedStyle = function safeGetComputedStyle(el, property) {\n  if (!el) {\n    return '';\n  }\n\n  var result = window$1.getComputedStyle(el);\n\n  if (!result) {\n    return '';\n  }\n\n  return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\n\nvar stableSort = function stableSort(array, sortFn) {\n  var newArray = array.slice();\n  array.sort(function (left, right) {\n    var cmp = sortFn(left, right);\n\n    if (cmp === 0) {\n      return newArray.indexOf(left) - newArray.indexOf(right);\n    }\n\n    return cmp;\n  });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistBandwidth = function comparePlaylistBandwidth(left, right) {\n  var leftBandwidth;\n  var rightBandwidth;\n\n  if (left.attributes.BANDWIDTH) {\n    leftBandwidth = left.attributes.BANDWIDTH;\n  }\n\n  leftBandwidth = leftBandwidth || window$1.Number.MAX_VALUE;\n\n  if (right.attributes.BANDWIDTH) {\n    rightBandwidth = right.attributes.BANDWIDTH;\n  }\n\n  rightBandwidth = rightBandwidth || window$1.Number.MAX_VALUE;\n  return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistResolution = function comparePlaylistResolution(left, right) {\n  var leftWidth;\n  var rightWidth;\n\n  if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n    leftWidth = left.attributes.RESOLUTION.width;\n  }\n\n  leftWidth = leftWidth || window$1.Number.MAX_VALUE;\n\n  if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n    rightWidth = right.attributes.RESOLUTION.width;\n  }\n\n  rightWidth = rightWidth || window$1.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n  // have the same media dimensions/ resolution\n\n  if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n    return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n  }\n\n  return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} master\n *        Object representation of the master manifest\n * @param {number} playerBandwidth\n *        Current calculated bandwidth of the player\n * @param {number} playerWidth\n *        Current width of the player element (should account for the device pixel ratio)\n * @param {number} playerHeight\n *        Current height of the player element (should account for the device pixel ratio)\n * @param {boolean} limitRenditionByPlayerDimensions\n *        True if the player width and height should be used during the selection, false otherwise\n * @param {Object} masterPlaylistController\n *        the current masterPlaylistController object\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, masterPlaylistController) {\n  // If we end up getting called before `master` is available, exit early\n  if (!master) {\n    return;\n  }\n\n  var options = {\n    bandwidth: playerBandwidth,\n    width: playerWidth,\n    height: playerHeight,\n    limitRenditionByPlayerDimensions: limitRenditionByPlayerDimensions\n  };\n  var playlists = master.playlists; // if playlist is audio only, select between currently active audio group playlists.\n\n  if (Playlist.isAudioOnly(master)) {\n    playlists = masterPlaylistController.getAudioTrackPlaylists_(); // add audioOnly to options so that we log audioOnly: true\n    // at the buttom of this function for debugging.\n\n    options.audioOnly = true;\n  } // convert the playlists to an intermediary representation to make comparisons easier\n\n\n  var sortedPlaylistReps = playlists.map(function (playlist) {\n    var bandwidth;\n    var width = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n    var height = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n    bandwidth = playlist.attributes && playlist.attributes.BANDWIDTH;\n    bandwidth = bandwidth || window$1.Number.MAX_VALUE;\n    return {\n      bandwidth: bandwidth,\n      width: width,\n      height: height,\n      playlist: playlist\n    };\n  });\n  stableSort(sortedPlaylistReps, function (left, right) {\n    return left.bandwidth - right.bandwidth;\n  }); // filter out any playlists that have been excluded due to\n  // incompatible configurations\n\n  sortedPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n    return !Playlist.isIncompatible(rep.playlist);\n  }); // filter out any playlists that have been disabled manually through the representations\n  // api or blacklisted temporarily due to playback errors.\n\n  var enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n    return Playlist.isEnabled(rep.playlist);\n  });\n\n  if (!enabledPlaylistReps.length) {\n    // if there are no enabled playlists, then they have all been blacklisted or disabled\n    // by the user through the representations api. In this case, ignore blacklisting and\n    // fallback to what the user wants by using playlists the user has not disabled.\n    enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n      return !Playlist.isDisabled(rep.playlist);\n    });\n  } // filter out any variant that has greater effective bitrate\n  // than the current estimated bandwidth\n\n\n  var bandwidthPlaylistReps = enabledPlaylistReps.filter(function (rep) {\n    return rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;\n  });\n  var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n  // and then taking the very first element\n\n  var bandwidthBestRep = bandwidthPlaylistReps.filter(function (rep) {\n    return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n  })[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n  if (limitRenditionByPlayerDimensions === false) {\n    var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n    if (_chosenRep && _chosenRep.playlist) {\n      var type = 'sortedPlaylistReps';\n\n      if (bandwidthBestRep) {\n        type = 'bandwidthBestRep';\n      }\n\n      if (enabledPlaylistReps[0]) {\n        type = 'enabledPlaylistReps';\n      }\n\n      logFn(\"choosing \" + representationToString(_chosenRep) + \" using \" + type + \" with options\", options);\n      return _chosenRep.playlist;\n    }\n\n    logFn('could not choose a playlist with options', options);\n    return null;\n  } // filter out playlists without resolution information\n\n\n  var haveResolution = bandwidthPlaylistReps.filter(function (rep) {\n    return rep.width && rep.height;\n  }); // sort variants by resolution\n\n  stableSort(haveResolution, function (left, right) {\n    return left.width - right.width;\n  }); // if we have the exact resolution as the player use it\n\n  var resolutionBestRepList = haveResolution.filter(function (rep) {\n    return rep.width === playerWidth && rep.height === playerHeight;\n  });\n  highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n  var resolutionBestRep = resolutionBestRepList.filter(function (rep) {\n    return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n  })[0];\n  var resolutionPlusOneList;\n  var resolutionPlusOneSmallest;\n  var resolutionPlusOneRep; // find the smallest variant that is larger than the player\n  // if there is no match of exact resolution\n\n  if (!resolutionBestRep) {\n    resolutionPlusOneList = haveResolution.filter(function (rep) {\n      return rep.width > playerWidth || rep.height > playerHeight;\n    }); // find all the variants have the same smallest resolution\n\n    resolutionPlusOneSmallest = resolutionPlusOneList.filter(function (rep) {\n      return rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height;\n    }); // ensure that we also pick the highest bandwidth variant that\n    // is just-larger-than the video player\n\n    highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n    resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function (rep) {\n      return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n    })[0];\n  }\n\n  var leastPixelDiffRep; // If this selector proves to be better than others,\n  // resolutionPlusOneRep and resolutionBestRep and all\n  // the code involving them should be removed.\n\n  if (masterPlaylistController.experimentalLeastPixelDiffSelector) {\n    // find the variant that is closest to the player's pixel size\n    var leastPixelDiffList = haveResolution.map(function (rep) {\n      rep.pixelDiff = Math.abs(rep.width - playerWidth) + Math.abs(rep.height - playerHeight);\n      return rep;\n    }); // get the highest bandwidth, closest resolution playlist\n\n    stableSort(leastPixelDiffList, function (left, right) {\n      // sort by highest bandwidth if pixelDiff is the same\n      if (left.pixelDiff === right.pixelDiff) {\n        return right.bandwidth - left.bandwidth;\n      }\n\n      return left.pixelDiff - right.pixelDiff;\n    });\n    leastPixelDiffRep = leastPixelDiffList[0];\n  } // fallback chain of variants\n\n\n  var chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n  if (chosenRep && chosenRep.playlist) {\n    var _type = 'sortedPlaylistReps';\n\n    if (leastPixelDiffRep) {\n      _type = 'leastPixelDiffRep';\n    } else if (resolutionPlusOneRep) {\n      _type = 'resolutionPlusOneRep';\n    } else if (resolutionBestRep) {\n      _type = 'resolutionBestRep';\n    } else if (bandwidthBestRep) {\n      _type = 'bandwidthBestRep';\n    } else if (enabledPlaylistReps[0]) {\n      _type = 'enabledPlaylistReps';\n    }\n\n    logFn(\"choosing \" + representationToString(chosenRep) + \" using \" + _type + \" with options\", options);\n    return chosenRep.playlist;\n  }\n\n  logFn('could not choose a playlist with options', options);\n  return null;\n};\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar lastBandwidthSelector = function lastBandwidthSelector() {\n  var pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n  return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);\n};\n/**\n * Chooses the appropriate media playlist based on an\n * exponential-weighted moving average of the bandwidth after\n * filtering for player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @param {number} decay - a number between 0 and 1. Higher values of\n * this parameter will cause previous bandwidth estimates to lose\n * significance more quickly.\n * @return {Function} a function which can be invoked to create a new\n * playlist selector function.\n * @see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n */\n\n\nvar movingAverageBandwidthSelector = function movingAverageBandwidthSelector(decay) {\n  var average = -1;\n  var lastSystemBandwidth = -1;\n\n  if (decay < 0 || decay > 1) {\n    throw new Error('Moving average bandwidth decay must be between 0 and 1.');\n  }\n\n  return function () {\n    var pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n\n    if (average < 0) {\n      average = this.systemBandwidth;\n      lastSystemBandwidth = this.systemBandwidth;\n    } // stop the average value from decaying for every 250ms\n    // when the systemBandwidth is constant\n    // and\n    // stop average from setting to a very low value when the\n    // systemBandwidth becomes 0 in case of chunk cancellation\n\n\n    if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {\n      average = decay * this.systemBandwidth + (1 - decay) * average;\n      lastSystemBandwidth = this.systemBandwidth;\n    }\n\n    return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);\n  };\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n *        Object of information required to use this selector\n * @param {Object} settings.master\n *        Object representation of the master manifest\n * @param {number} settings.currentTime\n *        The current time of the player\n * @param {number} settings.bandwidth\n *        Current measured bandwidth\n * @param {number} settings.duration\n *        Duration of the media\n * @param {number} settings.segmentDuration\n *        Segment duration to be used in round trip time calculations\n * @param {number} settings.timeUntilRebuffer\n *        Time left in seconds until the player has to rebuffer\n * @param {number} settings.currentTimeline\n *        The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n *        SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n *         {Object} return.playlist\n *         The highest bandwidth playlist with the least amount of rebuffering\n *         {Number} return.rebufferingImpact\n *         The amount of time in seconds switching to this playlist will rebuffer. A\n *         negative value means that switching will cause zero rebuffering.\n */\n\n\nvar minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector(settings) {\n  var master = settings.master,\n      currentTime = settings.currentTime,\n      bandwidth = settings.bandwidth,\n      duration = settings.duration,\n      segmentDuration = settings.segmentDuration,\n      timeUntilRebuffer = settings.timeUntilRebuffer,\n      currentTimeline = settings.currentTimeline,\n      syncController = settings.syncController; // filter out any playlists that have been excluded due to\n  // incompatible configurations\n\n  var compatiblePlaylists = master.playlists.filter(function (playlist) {\n    return !Playlist.isIncompatible(playlist);\n  }); // filter out any playlists that have been disabled manually through the representations\n  // api or blacklisted temporarily due to playback errors.\n\n  var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n\n  if (!enabledPlaylists.length) {\n    // if there are no enabled playlists, then they have all been blacklisted or disabled\n    // by the user through the representations api. In this case, ignore blacklisting and\n    // fallback to what the user wants by using playlists the user has not disabled.\n    enabledPlaylists = compatiblePlaylists.filter(function (playlist) {\n      return !Playlist.isDisabled(playlist);\n    });\n  }\n\n  var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n  var rebufferingEstimates = bandwidthPlaylists.map(function (playlist) {\n    var syncPoint = syncController.getSyncPoint(playlist, duration, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n    // sync request first. This will double the request time\n\n    var numRequests = syncPoint ? 1 : 2;\n    var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n    var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n    return {\n      playlist: playlist,\n      rebufferingImpact: rebufferingImpact\n    };\n  });\n  var noRebufferingPlaylists = rebufferingEstimates.filter(function (estimate) {\n    return estimate.rebufferingImpact <= 0;\n  }); // Sort by bandwidth DESC\n\n  stableSort(noRebufferingPlaylists, function (a, b) {\n    return comparePlaylistBandwidth(b.playlist, a.playlist);\n  });\n\n  if (noRebufferingPlaylists.length) {\n    return noRebufferingPlaylists[0];\n  }\n\n  stableSort(rebufferingEstimates, function (a, b) {\n    return a.rebufferingImpact - b.rebufferingImpact;\n  });\n  return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video.  If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Object|null}\n *         {Object} return.playlist\n *         The lowest bitrate playlist that contains a video codec.  If no such rendition\n *         exists pick the lowest audio rendition.\n */\n\n\nvar lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector() {\n  var _this = this; // filter out any playlists that have been excluded due to\n  // incompatible configurations or playback errors\n\n\n  var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n  stableSort(playlists, function (a, b) {\n    return comparePlaylistBandwidth(a, b);\n  }); // Parse and assume that playlists with no video codec have no video\n  // (this is not necessarily true, although it is generally true).\n  //\n  // If an entire manifest has no valid videos everything will get filtered\n  // out.\n\n  var playlistsWithVideo = playlists.filter(function (playlist) {\n    return !!codecsForPlaylist(_this.playlists.master, playlist).video;\n  });\n  return playlistsWithVideo[0] || null;\n};\n/**\n * Combine all segments into a single Uint8Array\n *\n * @param {Object} segmentObj\n * @return {Uint8Array} concatenated bytes\n * @private\n */\n\n\nvar concatSegments = function concatSegments(segmentObj) {\n  var offset = 0;\n  var tempBuffer;\n\n  if (segmentObj.bytes) {\n    tempBuffer = new Uint8Array(segmentObj.bytes); // combine the individual segments into one large typed-array\n\n    segmentObj.segments.forEach(function (segment) {\n      tempBuffer.set(segment, offset);\n      offset += segment.byteLength;\n    });\n  }\n\n  return tempBuffer;\n};\n/**\n * @file text-tracks.js\n */\n\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStream the caption stream to create\n * @private\n */\n\n\nvar createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists(inbandTextTracks, tech, captionStream) {\n  if (!inbandTextTracks[captionStream]) {\n    tech.trigger({\n      type: 'usage',\n      name: 'vhs-608'\n    });\n    tech.trigger({\n      type: 'usage',\n      name: 'hls-608'\n    });\n    var instreamId = captionStream; // we need to translate SERVICEn for 708 to how mux.js currently labels them\n\n    if (/^cc708_/.test(captionStream)) {\n      instreamId = 'SERVICE' + captionStream.split('_')[1];\n    }\n\n    var track = tech.textTracks().getTrackById(instreamId);\n\n    if (track) {\n      // Resuse an existing track with a CC# id because this was\n      // very likely created by videojs-contrib-hls from information\n      // in the m3u8 for us to use\n      inbandTextTracks[captionStream] = track;\n    } else {\n      // This section gets called when we have caption services that aren't specified in the manifest.\n      // Manifest level caption services are handled in media-groups.js under CLOSED-CAPTIONS.\n      var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n      var label = captionStream;\n      var language = captionStream;\n      var def = false;\n      var captionService = captionServices[instreamId];\n\n      if (captionService) {\n        label = captionService.label;\n        language = captionService.language;\n        def = captionService[\"default\"];\n      } // Otherwise, create a track with the default `CC#` label and\n      // without a language\n\n\n      inbandTextTracks[captionStream] = tech.addRemoteTextTrack({\n        kind: 'captions',\n        id: instreamId,\n        // TODO: investigate why this doesn't seem to turn the caption on by default\n        \"default\": def,\n        label: label,\n        language: language\n      }, false).track;\n    }\n  }\n};\n/**\n * Add caption text track data to a source handler given an array of captions\n *\n * @param {Object}\n *   @param {Object} inbandTextTracks the inband text tracks\n *   @param {number} timestampOffset the timestamp offset of the source buffer\n *   @param {Array} captionArray an array of caption data\n * @private\n */\n\n\nvar addCaptionData = function addCaptionData(_ref) {\n  var inbandTextTracks = _ref.inbandTextTracks,\n      captionArray = _ref.captionArray,\n      timestampOffset = _ref.timestampOffset;\n\n  if (!captionArray) {\n    return;\n  }\n\n  var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n  captionArray.forEach(function (caption) {\n    var track = caption.stream;\n    inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, caption.text));\n  });\n};\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\n\nvar deprecateOldCue = function deprecateOldCue(cue) {\n  Object.defineProperties(cue.frame, {\n    id: {\n      get: function get() {\n        videojs.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n        return cue.value.key;\n      }\n    },\n    value: {\n      get: function get() {\n        videojs.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n        return cue.value.data;\n      }\n    },\n    privateData: {\n      get: function get() {\n        videojs.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n        return cue.value.data;\n      }\n    }\n  });\n};\n/**\n * Add metadata text track data to a source handler given an array of metadata\n *\n * @param {Object}\n *   @param {Object} inbandTextTracks the inband text tracks\n *   @param {Array} metadataArray an array of meta data\n *   @param {number} timestampOffset the timestamp offset of the source buffer\n *   @param {number} videoDuration the duration of the video\n * @private\n */\n\n\nvar addMetadata = function addMetadata(_ref2) {\n  var inbandTextTracks = _ref2.inbandTextTracks,\n      metadataArray = _ref2.metadataArray,\n      timestampOffset = _ref2.timestampOffset,\n      videoDuration = _ref2.videoDuration;\n\n  if (!metadataArray) {\n    return;\n  }\n\n  var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n  var metadataTrack = inbandTextTracks.metadataTrack_;\n\n  if (!metadataTrack) {\n    return;\n  }\n\n  metadataArray.forEach(function (metadata) {\n    var time = metadata.cueTime + timestampOffset; // if time isn't a finite number between 0 and Infinity, like NaN,\n    // ignore this bit of metadata.\n    // This likely occurs when you have an non-timed ID3 tag like TIT2,\n    // which is the \"Title/Songname/Content description\" frame\n\n    if (typeof time !== 'number' || window$1.isNaN(time) || time < 0 || !(time < Infinity)) {\n      return;\n    }\n\n    metadata.frames.forEach(function (frame) {\n      var cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n      cue.frame = frame;\n      cue.value = frame;\n      deprecateOldCue(cue);\n      metadataTrack.addCue(cue);\n    });\n  });\n\n  if (!metadataTrack.cues || !metadataTrack.cues.length) {\n    return;\n  } // Updating the metadeta cues so that\n  // the endTime of each cue is the startTime of the next cue\n  // the endTime of last cue is the duration of the video\n\n\n  var cues = metadataTrack.cues;\n  var cuesArray = []; // Create a copy of the TextTrackCueList...\n  // ...disregarding cues with a falsey value\n\n  for (var i = 0; i < cues.length; i++) {\n    if (cues[i]) {\n      cuesArray.push(cues[i]);\n    }\n  } // Group cues by their startTime value\n\n\n  var cuesGroupedByStartTime = cuesArray.reduce(function (obj, cue) {\n    var timeSlot = obj[cue.startTime] || [];\n    timeSlot.push(cue);\n    obj[cue.startTime] = timeSlot;\n    return obj;\n  }, {}); // Sort startTimes by ascending order\n\n  var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function (a, b) {\n    return Number(a) - Number(b);\n  }); // Map each cue group's endTime to the next group's startTime\n\n  sortedStartTimes.forEach(function (startTime, idx) {\n    var cueGroup = cuesGroupedByStartTime[startTime];\n    var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration; // Map each cue's endTime the next group's startTime\n\n    cueGroup.forEach(function (cue) {\n      cue.endTime = nextTime;\n    });\n  });\n};\n/**\n * Create metadata text track on video.js if it does not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {string} dispatchType the inband metadata track dispatch type\n * @param {Object} tech the video.js tech\n * @private\n */\n\n\nvar createMetadataTrackIfNotExists = function createMetadataTrackIfNotExists(inbandTextTracks, dispatchType, tech) {\n  if (inbandTextTracks.metadataTrack_) {\n    return;\n  }\n\n  inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({\n    kind: 'metadata',\n    label: 'Timed Metadata'\n  }, false).track;\n  inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;\n};\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\n\nvar removeCuesFromTrack = function removeCuesFromTrack(start, end, track) {\n  var i;\n  var cue;\n\n  if (!track) {\n    return;\n  }\n\n  if (!track.cues) {\n    return;\n  }\n\n  i = track.cues.length;\n\n  while (i--) {\n    cue = track.cues[i]; // Remove any cue within the provided start and end time\n\n    if (cue.startTime >= start && cue.endTime <= end) {\n      track.removeCue(cue);\n    }\n  }\n};\n/**\n * Remove duplicate cues from a track on video.js (a cue is considered a\n * duplicate if it has the same time interval and text as another)\n *\n * @param {Object} track the text track to remove the duplicate cues from\n * @private\n */\n\n\nvar removeDuplicateCuesFromTrack = function removeDuplicateCuesFromTrack(track) {\n  var cues = track.cues;\n\n  if (!cues) {\n    return;\n  }\n\n  for (var i = 0; i < cues.length; i++) {\n    var duplicates = [];\n    var occurrences = 0;\n\n    for (var j = 0; j < cues.length; j++) {\n      if (cues[i].startTime === cues[j].startTime && cues[i].endTime === cues[j].endTime && cues[i].text === cues[j].text) {\n        occurrences++;\n\n        if (occurrences > 1) {\n          duplicates.push(cues[j]);\n        }\n      }\n    }\n\n    if (duplicates.length) {\n      duplicates.forEach(function (dupe) {\n        return track.removeCue(dupe);\n      });\n    }\n  }\n};\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {number} currentTime\n *        The current time\n * @param {Double} mapping\n *        Offset to map display time to stream presentation time\n * @return {Array}\n *         List of gops considered safe to append over\n */\n\n\nvar gopsSafeToAlignWith = function gopsSafeToAlignWith(buffer, currentTime, mapping) {\n  if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n    return [];\n  } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n\n  var currentTimePts = Math.ceil((currentTime - mapping + 3) * ONE_SECOND_IN_TS);\n  var i;\n\n  for (i = 0; i < buffer.length; i++) {\n    if (buffer[i].pts > currentTimePts) {\n      break;\n    }\n  }\n\n  return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {Array} gops\n *        List of new gop information\n * @param {boolean} replace\n *        If true, replace the buffer with the new gop information. If false, append the\n *        new gop information to the buffer in the right location of time.\n * @return {Array}\n *         Updated list of gop information\n */\n\n\nvar updateGopBuffer = function updateGopBuffer(buffer, gops, replace) {\n  if (!gops.length) {\n    return buffer;\n  }\n\n  if (replace) {\n    // If we are in safe append mode, then completely overwrite the gop buffer\n    // with the most recent appeneded data. This will make sure that when appending\n    // future segments, we only try to align with gops that are both ahead of current\n    // time and in the last segment appended.\n    return gops.slice();\n  }\n\n  var start = gops[0].pts;\n  var i = 0;\n\n  for (i; i < buffer.length; i++) {\n    if (buffer[i].pts >= start) {\n      break;\n    }\n  }\n\n  return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {Double} start\n *        position to start the remove at\n * @param {Double} end\n *        position to end the remove at\n * @param {Double} mapping\n *        Offset to map display time to stream presentation time\n */\n\n\nvar removeGopBuffer = function removeGopBuffer(buffer, start, end, mapping) {\n  var startPts = Math.ceil((start - mapping) * ONE_SECOND_IN_TS);\n  var endPts = Math.ceil((end - mapping) * ONE_SECOND_IN_TS);\n  var updatedBuffer = buffer.slice();\n  var i = buffer.length;\n\n  while (i--) {\n    if (buffer[i].pts <= endPts) {\n      break;\n    }\n  }\n\n  if (i === -1) {\n    // no removal because end of remove range is before start of buffer\n    return updatedBuffer;\n  }\n\n  var j = i + 1;\n\n  while (j--) {\n    if (buffer[j].pts <= startPts) {\n      break;\n    }\n  } // clamp remove range start to 0 index\n\n\n  j = Math.max(j, 0);\n  updatedBuffer.splice(j, i - j + 1);\n  return updatedBuffer;\n};\n\nvar shallowEqual = function shallowEqual(a, b) {\n  // if both are undefined\n  // or one or the other is undefined\n  // they are not equal\n  if (!a && !b || !a && b || a && !b) {\n    return false;\n  } // they are the same object and thus, equal\n\n\n  if (a === b) {\n    return true;\n  } // sort keys so we can make sure they have\n  // all the same keys later.\n\n\n  var akeys = Object.keys(a).sort();\n  var bkeys = Object.keys(b).sort(); // different number of keys, not equal\n\n  if (akeys.length !== bkeys.length) {\n    return false;\n  }\n\n  for (var i = 0; i < akeys.length; i++) {\n    var key = akeys[i]; // different sorted keys, not equal\n\n    if (key !== bkeys[i]) {\n      return false;\n    } // different values, not equal\n\n\n    if (a[key] !== b[key]) {\n      return false;\n    }\n  }\n\n  return true;\n}; // https://www.w3.org/TR/WebIDL-1/#quotaexceedederror\n\n\nvar QUOTA_EXCEEDED_ERR = 22;\n/**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Array} segments - the segments array from a playlist.\n * @return {number} An index of a segment from the playlist to load\n */\n\nvar getSyncSegmentCandidate = function getSyncSegmentCandidate(currentTimeline, segments, targetTime) {\n  segments = segments || [];\n  var timelineSegments = [];\n  var time = 0;\n\n  for (var i = 0; i < segments.length; i++) {\n    var segment = segments[i];\n\n    if (currentTimeline === segment.timeline) {\n      timelineSegments.push(i);\n      time += segment.duration;\n\n      if (time > targetTime) {\n        return i;\n      }\n    }\n  }\n\n  if (timelineSegments.length === 0) {\n    return 0;\n  } // default to the last timeline segment\n\n\n  return timelineSegments[timelineSegments.length - 1];\n}; // In the event of a quota exceeded error, keep at least one second of back buffer. This\n// number was arbitrarily chosen and may be updated in the future, but seemed reasonable\n// as a start to prevent any potential issues with removing content too close to the\n// playhead.\n\n\nvar MIN_BACK_BUFFER = 1; // in ms\n\nvar CHECK_BUFFER_DELAY = 500;\n\nvar finite = function finite(num) {\n  return typeof num === 'number' && isFinite(num);\n}; // With most content hovering around 30fps, if a segment has a duration less than a half\n// frame at 30fps or one frame at 60fps, the bandwidth and throughput calculations will\n// not accurately reflect the rest of the content.\n\n\nvar MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;\n\nvar illegalMediaSwitch = function illegalMediaSwitch(loaderType, startingMedia, trackInfo) {\n  // Although these checks should most likely cover non 'main' types, for now it narrows\n  // the scope of our checks.\n  if (loaderType !== 'main' || !startingMedia || !trackInfo) {\n    return null;\n  }\n\n  if (!trackInfo.hasAudio && !trackInfo.hasVideo) {\n    return 'Neither audio nor video found in segment.';\n  }\n\n  if (startingMedia.hasVideo && !trackInfo.hasVideo) {\n    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.';\n  }\n\n  if (!startingMedia.hasVideo && trackInfo.hasVideo) {\n    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.';\n  }\n\n  return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interrupting\n * playback.\n *\n * @param {TimeRange} seekable\n *        The current seekable range\n * @param {number} currentTime\n *        The current time of the player\n * @param {number} targetDuration\n *        The target duration of the current playlist\n * @return {number}\n *         Time that is safe to remove from the back buffer without interrupting playback\n */\n\n\nvar safeBackBufferTrimTime = function safeBackBufferTrimTime(seekable, currentTime, targetDuration) {\n  // 30 seconds before the playhead provides a safe default for trimming.\n  //\n  // Choosing a reasonable default is particularly important for high bitrate content and\n  // VOD videos/live streams with large windows, as the buffer may end up overfilled and\n  // throw an APPEND_BUFFER_ERR.\n  var trimTime = currentTime - Config.BACK_BUFFER_LENGTH;\n\n  if (seekable.length) {\n    // Some live playlists may have a shorter window of content than the full allowed back\n    // buffer. For these playlists, don't save content that's no longer within the window.\n    trimTime = Math.max(trimTime, seekable.start(0));\n  } // Don't remove within target duration of the current time to avoid the possibility of\n  // removing the GOP currently being played, as removing it can cause playback stalls.\n\n\n  var maxTrimTime = currentTime - targetDuration;\n  return Math.min(maxTrimTime, trimTime);\n};\n\nvar segmentInfoString = function segmentInfoString(segmentInfo) {\n  var startOfSegment = segmentInfo.startOfSegment,\n      duration = segmentInfo.duration,\n      segment = segmentInfo.segment,\n      part = segmentInfo.part,\n      _segmentInfo$playlist = segmentInfo.playlist,\n      seq = _segmentInfo$playlist.mediaSequence,\n      id = _segmentInfo$playlist.id,\n      _segmentInfo$playlist2 = _segmentInfo$playlist.segments,\n      segments = _segmentInfo$playlist2 === void 0 ? [] : _segmentInfo$playlist2,\n      index = segmentInfo.mediaIndex,\n      partIndex = segmentInfo.partIndex,\n      timeline = segmentInfo.timeline;\n  var segmentLen = segments.length - 1;\n  var selection = 'mediaIndex/partIndex increment';\n\n  if (segmentInfo.getMediaInfoForTime) {\n    selection = \"getMediaInfoForTime (\" + segmentInfo.getMediaInfoForTime + \")\";\n  } else if (segmentInfo.isSyncRequest) {\n    selection = 'getSyncSegmentCandidate (isSyncRequest)';\n  }\n\n  if (segmentInfo.independent) {\n    selection += \" with independent \" + segmentInfo.independent;\n  }\n\n  var hasPartIndex = typeof partIndex === 'number';\n  var name = segmentInfo.segment.uri ? 'segment' : 'pre-segment';\n  var zeroBasedPartCount = hasPartIndex ? getKnownPartCount({\n    preloadSegment: segment\n  }) - 1 : 0;\n  return name + \" [\" + (seq + index) + \"/\" + (seq + segmentLen) + \"]\" + (hasPartIndex ? \" part [\" + partIndex + \"/\" + zeroBasedPartCount + \"]\" : '') + (\" segment start/end [\" + segment.start + \" => \" + segment.end + \"]\") + (hasPartIndex ? \" part start/end [\" + part.start + \" => \" + part.end + \"]\" : '') + (\" startOfSegment [\" + startOfSegment + \"]\") + (\" duration [\" + duration + \"]\") + (\" timeline [\" + timeline + \"]\") + (\" selected by [\" + selection + \"]\") + (\" playlist [\" + id + \"]\");\n};\n\nvar timingInfoPropertyForMedia = function timingInfoPropertyForMedia(mediaType) {\n  return mediaType + \"TimingInfo\";\n};\n/**\n * Returns the timestamp offset to use for the segment.\n *\n * @param {number} segmentTimeline\n *        The timeline of the segment\n * @param {number} currentTimeline\n *        The timeline currently being followed by the loader\n * @param {number} startOfSegment\n *        The estimated segment start\n * @param {TimeRange[]} buffered\n *        The loader's buffer\n * @param {boolean} overrideCheck\n *        If true, no checks are made to see if the timestamp offset value should be set,\n *        but sets it directly to a value.\n *\n * @return {number|null}\n *         Either a number representing a new timestamp offset, or null if the segment is\n *         part of the same timeline\n */\n\n\nvar timestampOffsetForSegment = function timestampOffsetForSegment(_ref) {\n  var segmentTimeline = _ref.segmentTimeline,\n      currentTimeline = _ref.currentTimeline,\n      startOfSegment = _ref.startOfSegment,\n      buffered = _ref.buffered,\n      overrideCheck = _ref.overrideCheck; // Check to see if we are crossing a discontinuity to see if we need to set the\n  // timestamp offset on the transmuxer and source buffer.\n  //\n  // Previously, we changed the timestampOffset if the start of this segment was less than\n  // the currently set timestampOffset, but this isn't desirable as it can produce bad\n  // behavior, especially around long running live streams.\n\n  if (!overrideCheck && segmentTimeline === currentTimeline) {\n    return null;\n  } // When changing renditions, it's possible to request a segment on an older timeline. For\n  // instance, given two renditions with the following:\n  //\n  // #EXTINF:10\n  // segment1\n  // #EXT-X-DISCONTINUITY\n  // #EXTINF:10\n  // segment2\n  // #EXTINF:10\n  // segment3\n  //\n  // And the current player state:\n  //\n  // current time: 8\n  // buffer: 0 => 20\n  //\n  // The next segment on the current rendition would be segment3, filling the buffer from\n  // 20s onwards. However, if a rendition switch happens after segment2 was requested,\n  // then the next segment to be requested will be segment1 from the new rendition in\n  // order to fill time 8 and onwards. Using the buffered end would result in repeated\n  // content (since it would position segment1 of the new rendition starting at 20s). This\n  // case can be identified when the new segment's timeline is a prior value. Instead of\n  // using the buffered end, the startOfSegment can be used, which, hopefully, will be\n  // more accurate to the actual start time of the segment.\n\n\n  if (segmentTimeline < currentTimeline) {\n    return startOfSegment;\n  } // segmentInfo.startOfSegment used to be used as the timestamp offset, however, that\n  // value uses the end of the last segment if it is available. While this value\n  // should often be correct, it's better to rely on the buffered end, as the new\n  // content post discontinuity should line up with the buffered end as if it were\n  // time 0 for the new content.\n\n\n  return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;\n};\n/**\n * Returns whether or not the loader should wait for a timeline change from the timeline\n * change controller before processing the segment.\n *\n * Primary timing in VHS goes by video. This is different from most media players, as\n * audio is more often used as the primary timing source. For the foreseeable future, VHS\n * will continue to use video as the primary timing source, due to the current logic and\n * expectations built around it.\n\n * Since the timing follows video, in order to maintain sync, the video loader is\n * responsible for setting both audio and video source buffer timestamp offsets.\n *\n * Setting different values for audio and video source buffers could lead to\n * desyncing. The following examples demonstrate some of the situations where this\n * distinction is important. Note that all of these cases involve demuxed content. When\n * content is muxed, the audio and video are packaged together, therefore syncing\n * separate media playlists is not an issue.\n *\n * CASE 1: Audio prepares to load a new timeline before video:\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:                     ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader              ^\n *\n * In the above example, the audio loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the video loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the audio loader goes ahead and loads and appends the 6th segment before the video\n * loader crosses the discontinuity, then when appended, the 6th audio segment will use\n * the timestamp offset from timeline 0. This will likely lead to desyncing. In addition,\n * the audio loader must provide the audioAppendStart value to trim the content in the\n * transmuxer, and that value relies on the audio timestamp offset. Since the audio\n * timestamp offset is set by the video (main) loader, the audio loader shouldn't load the\n * segment until that value is provided.\n *\n * CASE 2: Video prepares to load a new timeline before audio:\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:             ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader                      ^\n *\n * In the above example, the video loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the audio loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the video loader goes ahead and loads and appends the 6th segment, then once the\n * segment is loaded and processed, both the video and audio timestamp offsets will be\n * set, since video is used as the primary timing source. This is to ensure content lines\n * up appropriately, as any modifications to the video timing are reflected by audio when\n * the video loader sets the audio and video timestamp offsets to the same value. However,\n * setting the timestamp offset for audio before audio has had a chance to change\n * timelines will likely lead to desyncing, as the audio loader will append segment 5 with\n * a timestamp intended to apply to segments from timeline 1 rather than timeline 0.\n *\n * CASE 3: When seeking, audio prepares to load a new timeline before video\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:           ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader            ^\n *\n * In the above example, both audio and video loaders are loading segments from timeline\n * 0, but imagine that the seek originated from timeline 1.\n *\n * When seeking to a new timeline, the timestamp offset will be set based on the expected\n * segment start of the loaded video segment. In order to maintain sync, the audio loader\n * must wait for the video loader to load its segment and update both the audio and video\n * timestamp offsets before it may load and append its own segment. This is the case\n * whether the seek results in a mismatched segment request (e.g., the audio loader\n * chooses to load segment 3 and the video loader chooses to load segment 4) or the\n * loaders choose to load the same segment index from each playlist, as the segments may\n * not be aligned perfectly, even for matching segment indexes.\n *\n * @param {Object} timelinechangeController\n * @param {number} currentTimeline\n *        The timeline currently being followed by the loader\n * @param {number} segmentTimeline\n *        The timeline of the segment being loaded\n * @param {('main'|'audio')} loaderType\n *        The loader type\n * @param {boolean} audioDisabled\n *        Whether the audio is disabled for the loader. This should only be true when the\n *        loader may have muxed audio in its segment, but should not append it, e.g., for\n *        the main loader when an alternate audio playlist is active.\n *\n * @return {boolean}\n *         Whether the loader should wait for a timeline change from the timeline change\n *         controller before processing the segment\n */\n\n\nvar shouldWaitForTimelineChange = function shouldWaitForTimelineChange(_ref2) {\n  var timelineChangeController = _ref2.timelineChangeController,\n      currentTimeline = _ref2.currentTimeline,\n      segmentTimeline = _ref2.segmentTimeline,\n      loaderType = _ref2.loaderType,\n      audioDisabled = _ref2.audioDisabled;\n\n  if (currentTimeline === segmentTimeline) {\n    return false;\n  }\n\n  if (loaderType === 'audio') {\n    var lastMainTimelineChange = timelineChangeController.lastTimelineChange({\n      type: 'main'\n    }); // Audio loader should wait if:\n    //\n    // * main hasn't had a timeline change yet (thus has not loaded its first segment)\n    // * main hasn't yet changed to the timeline audio is looking to load\n\n    return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;\n  } // The main loader only needs to wait for timeline changes if there's demuxed audio.\n  // Otherwise, there's nothing to wait for, since audio would be muxed into the main\n  // loader's segments (or the content is audio/video only and handled by the main\n  // loader).\n\n\n  if (loaderType === 'main' && audioDisabled) {\n    var pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({\n      type: 'audio'\n    }); // Main loader should wait for the audio loader if audio is not pending a timeline\n    // change to the current timeline.\n    //\n    // Since the main loader is responsible for setting the timestamp offset for both\n    // audio and video, the main loader must wait for audio to be about to change to its\n    // timeline before setting the offset, otherwise, if audio is behind in loading,\n    // segments from the previous timeline would be adjusted by the new timestamp offset.\n    //\n    // This requirement means that video will not cross a timeline until the audio is\n    // about to cross to it, so that way audio and video will always cross the timeline\n    // together.\n    //\n    // In addition to normal timeline changes, these rules also apply to the start of a\n    // stream (going from a non-existent timeline, -1, to timeline 0). It's important\n    // that these rules apply to the first timeline change because if they did not, it's\n    // possible that the main loader will cross two timelines before the audio loader has\n    // crossed one. Logic may be implemented to handle the startup as a special case, but\n    // it's easier to simply treat all timeline changes the same.\n\n    if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {\n      return false;\n    }\n\n    return true;\n  }\n\n  return false;\n};\n\nvar mediaDuration = function mediaDuration(timingInfos) {\n  var maxDuration = 0;\n  ['video', 'audio'].forEach(function (type) {\n    var typeTimingInfo = timingInfos[type + \"TimingInfo\"];\n\n    if (!typeTimingInfo) {\n      return;\n    }\n\n    var start = typeTimingInfo.start,\n        end = typeTimingInfo.end;\n    var duration;\n\n    if (typeof start === 'bigint' || typeof end === 'bigint') {\n      duration = window$1.BigInt(end) - window$1.BigInt(start);\n    } else if (typeof start === 'number' && typeof end === 'number') {\n      duration = end - start;\n    }\n\n    if (typeof duration !== 'undefined' && duration > maxDuration) {\n      maxDuration = duration;\n    }\n  }); // convert back to a number if it is lower than MAX_SAFE_INTEGER\n  // as we only need BigInt when we are above that.\n\n  if (typeof maxDuration === 'bigint' && maxDuration < Number.MAX_SAFE_INTEGER) {\n    maxDuration = Number(maxDuration);\n  }\n\n  return maxDuration;\n};\n\nvar segmentTooLong = function segmentTooLong(_ref3) {\n  var segmentDuration = _ref3.segmentDuration,\n      maxDuration = _ref3.maxDuration; // 0 duration segments are most likely due to metadata only segments or a lack of\n  // information.\n\n  if (!segmentDuration) {\n    return false;\n  } // For HLS:\n  //\n  // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1\n  // The EXTINF duration of each Media Segment in the Playlist\n  // file, when rounded to the nearest integer, MUST be less than or equal\n  // to the target duration; longer segments can trigger playback stalls\n  // or other errors.\n  //\n  // For DASH, the mpd-parser uses the largest reported segment duration as the target\n  // duration. Although that reported duration is occasionally approximate (i.e., not\n  // exact), a strict check may report that a segment is too long more often in DASH.\n\n\n  return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;\n};\n\nvar getTroublesomeSegmentDurationMessage = function getTroublesomeSegmentDurationMessage(segmentInfo, sourceType) {\n  // Right now we aren't following DASH's timing model exactly, so only perform\n  // this check for HLS content.\n  if (sourceType !== 'hls') {\n    return null;\n  }\n\n  var segmentDuration = mediaDuration({\n    audioTimingInfo: segmentInfo.audioTimingInfo,\n    videoTimingInfo: segmentInfo.videoTimingInfo\n  }); // Don't report if we lack information.\n  //\n  // If the segment has a duration of 0 it is either a lack of information or a\n  // metadata only segment and shouldn't be reported here.\n\n  if (!segmentDuration) {\n    return null;\n  }\n\n  var targetDuration = segmentInfo.playlist.targetDuration;\n  var isSegmentWayTooLong = segmentTooLong({\n    segmentDuration: segmentDuration,\n    maxDuration: targetDuration * 2\n  });\n  var isSegmentSlightlyTooLong = segmentTooLong({\n    segmentDuration: segmentDuration,\n    maxDuration: targetDuration\n  });\n  var segmentTooLongMessage = \"Segment with index \" + segmentInfo.mediaIndex + \" \" + (\"from playlist \" + segmentInfo.playlist.id + \" \") + (\"has a duration of \" + segmentDuration + \" \") + (\"when the reported duration is \" + segmentInfo.duration + \" \") + (\"and the target duration is \" + targetDuration + \". \") + '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';\n\n  if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {\n    return {\n      severity: isSegmentWayTooLong ? 'warn' : 'info',\n      message: segmentTooLongMessage\n    };\n  }\n\n  return null;\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\n\nvar SegmentLoader = /*#__PURE__*/function (_videojs$EventTarget) {\n  _inheritsLoose(SegmentLoader, _videojs$EventTarget);\n\n  function SegmentLoader(settings, options) {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this; // check pre-conditions\n\n    if (!settings) {\n      throw new TypeError('Initialization settings are required');\n    }\n\n    if (typeof settings.currentTime !== 'function') {\n      throw new TypeError('No currentTime getter specified');\n    }\n\n    if (!settings.mediaSource) {\n      throw new TypeError('No MediaSource specified');\n    } // public properties\n\n\n    _this.bandwidth = settings.bandwidth;\n    _this.throughput = {\n      rate: 0,\n      count: 0\n    };\n    _this.roundTrip = NaN;\n\n    _this.resetStats_();\n\n    _this.mediaIndex = null;\n    _this.partIndex = null; // private settings\n\n    _this.hasPlayed_ = settings.hasPlayed;\n    _this.currentTime_ = settings.currentTime;\n    _this.seekable_ = settings.seekable;\n    _this.seeking_ = settings.seeking;\n    _this.duration_ = settings.duration;\n    _this.mediaSource_ = settings.mediaSource;\n    _this.vhs_ = settings.vhs;\n    _this.loaderType_ = settings.loaderType;\n    _this.currentMediaInfo_ = void 0;\n    _this.startingMediaInfo_ = void 0;\n    _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n    _this.goalBufferLength_ = settings.goalBufferLength;\n    _this.sourceType_ = settings.sourceType;\n    _this.sourceUpdater_ = settings.sourceUpdater;\n    _this.inbandTextTracks_ = settings.inbandTextTracks;\n    _this.state_ = 'INIT';\n    _this.timelineChangeController_ = settings.timelineChangeController;\n    _this.shouldSaveSegmentTimingInfo_ = true;\n    _this.parse708captions_ = settings.parse708captions;\n    _this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;\n    _this.captionServices_ = settings.captionServices;\n    _this.experimentalExactManifestTimings = settings.experimentalExactManifestTimings; // private instance variables\n\n    _this.checkBufferTimeout_ = null;\n    _this.error_ = void 0;\n    _this.currentTimeline_ = -1;\n    _this.pendingSegment_ = null;\n    _this.xhrOptions_ = null;\n    _this.pendingSegments_ = [];\n    _this.audioDisabled_ = false;\n    _this.isPendingTimestampOffset_ = false; // TODO possibly move gopBuffer and timeMapping info to a separate controller\n\n    _this.gopBuffer_ = [];\n    _this.timeMapping_ = 0;\n    _this.safeAppend_ = videojs.browser.IE_VERSION >= 11;\n    _this.appendInitSegment_ = {\n      audio: true,\n      video: true\n    };\n    _this.playlistOfLastInitSegment_ = {\n      audio: null,\n      video: null\n    };\n    _this.callQueue_ = []; // If the segment loader prepares to load a segment, but does not have enough\n    // information yet to start the loading process (e.g., if the audio loader wants to\n    // load a segment from the next timeline but the main loader hasn't yet crossed that\n    // timeline), then the load call will be added to the queue until it is ready to be\n    // processed.\n\n    _this.loadQueue_ = [];\n    _this.metadataQueue_ = {\n      id3: [],\n      caption: []\n    };\n    _this.waitingOnRemove_ = false;\n    _this.quotaExceededErrorRetryTimeout_ = null; // Fragmented mp4 playback\n\n    _this.activeInitSegmentId_ = null;\n    _this.initSegments_ = {}; // HLSe playback\n\n    _this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;\n    _this.keyCache_ = {};\n    _this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n    // between a time in the display time and a segment index within\n    // a playlist\n\n    _this.syncController_ = settings.syncController;\n    _this.syncPoint_ = {\n      segmentIndex: 0,\n      time: 0\n    };\n    _this.transmuxer_ = _this.createTransmuxer_();\n\n    _this.triggerSyncInfoUpdate_ = function () {\n      return _this.trigger('syncinfoupdate');\n    };\n\n    _this.syncController_.on('syncinfoupdate', _this.triggerSyncInfoUpdate_);\n\n    _this.mediaSource_.addEventListener('sourceopen', function () {\n      if (!_this.isEndOfStream_()) {\n        _this.ended_ = false;\n      }\n    }); // ...for determining the fetch location\n\n\n    _this.fetchAtBuffer_ = false;\n    _this.logger_ = logger(\"SegmentLoader[\" + _this.loaderType_ + \"]\");\n    Object.defineProperty(_assertThisInitialized(_this), 'state', {\n      get: function get() {\n        return this.state_;\n      },\n      set: function set(newState) {\n        if (newState !== this.state_) {\n          this.logger_(this.state_ + \" -> \" + newState);\n          this.state_ = newState;\n          this.trigger('statechange');\n        }\n      }\n    });\n\n    _this.sourceUpdater_.on('ready', function () {\n      if (_this.hasEnoughInfoToAppend_()) {\n        _this.processCallQueue_();\n      }\n    }); // Only the main loader needs to listen for pending timeline changes, as the main\n    // loader should wait for audio to be ready to change its timeline so that both main\n    // and audio timelines change together. For more details, see the\n    // shouldWaitForTimelineChange function.\n\n\n    if (_this.loaderType_ === 'main') {\n      _this.timelineChangeController_.on('pendingtimelinechange', function () {\n        if (_this.hasEnoughInfoToAppend_()) {\n          _this.processCallQueue_();\n        }\n      });\n    } // The main loader only listens on pending timeline changes, but the audio loader,\n    // since its loads follow main, needs to listen on timeline changes. For more details,\n    // see the shouldWaitForTimelineChange function.\n\n\n    if (_this.loaderType_ === 'audio') {\n      _this.timelineChangeController_.on('timelinechange', function () {\n        if (_this.hasEnoughInfoToLoad_()) {\n          _this.processLoadQueue_();\n        }\n\n        if (_this.hasEnoughInfoToAppend_()) {\n          _this.processCallQueue_();\n        }\n      });\n    }\n\n    return _this;\n  }\n\n  var _proto = SegmentLoader.prototype;\n\n  _proto.createTransmuxer_ = function createTransmuxer_() {\n    return segmentTransmuxer.createTransmuxer({\n      remux: false,\n      alignGopsAtEnd: this.safeAppend_,\n      keepOriginalTimestamps: true,\n      parse708captions: this.parse708captions_,\n      captionServices: this.captionServices_\n    });\n  }\n  /**\n   * reset all of our media stats\n   *\n   * @private\n   */\n  ;\n\n  _proto.resetStats_ = function resetStats_() {\n    this.mediaBytesTransferred = 0;\n    this.mediaRequests = 0;\n    this.mediaRequestsAborted = 0;\n    this.mediaRequestsTimedout = 0;\n    this.mediaRequestsErrored = 0;\n    this.mediaTransferDuration = 0;\n    this.mediaSecondsLoaded = 0;\n    this.mediaAppends = 0;\n  }\n  /**\n   * dispose of the SegmentLoader and reset to the default state\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.trigger('dispose');\n    this.state = 'DISPOSED';\n    this.pause();\n    this.abort_();\n\n    if (this.transmuxer_) {\n      this.transmuxer_.terminate();\n    }\n\n    this.resetStats_();\n\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    if (this.syncController_ && this.triggerSyncInfoUpdate_) {\n      this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_);\n    }\n\n    this.off();\n  };\n\n  _proto.setAudio = function setAudio(enable) {\n    this.audioDisabled_ = !enable;\n\n    if (enable) {\n      this.appendInitSegment_.audio = true;\n    } else {\n      // remove current track audio if it gets disabled\n      this.sourceUpdater_.removeAudio(0, this.duration_());\n    }\n  }\n  /**\n   * abort anything that is currently doing on with the SegmentLoader\n   * and reset to a default state\n   */\n  ;\n\n  _proto.abort = function abort() {\n    if (this.state !== 'WAITING') {\n      if (this.pendingSegment_) {\n        this.pendingSegment_ = null;\n      }\n\n      return;\n    }\n\n    this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n    // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n    // when the request is aborted. This will prevent the loader from being stuck in the\n    // WAITING state indefinitely.\n\n    this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n    // next segment\n\n    if (!this.paused()) {\n      this.monitorBuffer_();\n    }\n  }\n  /**\n   * abort all pending xhr requests and null any pending segements\n   *\n   * @private\n   */\n  ;\n\n  _proto.abort_ = function abort_() {\n    if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {\n      this.pendingSegment_.abortRequests();\n    } // clear out the segment being processed\n\n\n    this.pendingSegment_ = null;\n    this.callQueue_ = [];\n    this.loadQueue_ = [];\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n    this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);\n    this.waitingOnRemove_ = false;\n    window$1.clearTimeout(this.quotaExceededErrorRetryTimeout_);\n    this.quotaExceededErrorRetryTimeout_ = null;\n  };\n\n  _proto.checkForAbort_ = function checkForAbort_(requestId) {\n    // If the state is APPENDING, then aborts will not modify the state, meaning the first\n    // callback that happens should reset the state to READY so that loading can continue.\n    if (this.state === 'APPENDING' && !this.pendingSegment_) {\n      this.state = 'READY';\n      return true;\n    }\n\n    if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * set an error on the segment loader and null out any pending segements\n   *\n   * @param {Error} error the error to set on the SegmentLoader\n   * @return {Error} the error that was set or that is currently set\n   */\n  ;\n\n  _proto.error = function error(_error) {\n    if (typeof _error !== 'undefined') {\n      this.logger_('error occurred:', _error);\n      this.error_ = _error;\n    }\n\n    this.pendingSegment_ = null;\n    return this.error_;\n  };\n\n  _proto.endOfStream = function endOfStream() {\n    this.ended_ = true;\n\n    if (this.transmuxer_) {\n      // need to clear out any cached data to prepare for the new segment\n      segmentTransmuxer.reset(this.transmuxer_);\n    }\n\n    this.gopBuffer_.length = 0;\n    this.pause();\n    this.trigger('ended');\n  }\n  /**\n   * Indicates which time ranges are buffered\n   *\n   * @return {TimeRange}\n   *         TimeRange object representing the current buffered ranges\n   */\n  ;\n\n  _proto.buffered_ = function buffered_() {\n    var trackInfo = this.getMediaInfo_();\n\n    if (!this.sourceUpdater_ || !trackInfo) {\n      return videojs.createTimeRanges();\n    }\n\n    if (this.loaderType_ === 'main') {\n      var hasAudio = trackInfo.hasAudio,\n          hasVideo = trackInfo.hasVideo,\n          isMuxed = trackInfo.isMuxed;\n\n      if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed) {\n        return this.sourceUpdater_.buffered();\n      }\n\n      if (hasVideo) {\n        return this.sourceUpdater_.videoBuffered();\n      }\n    } // One case that can be ignored for now is audio only with alt audio,\n    // as we don't yet have proper support for that.\n\n\n    return this.sourceUpdater_.audioBuffered();\n  }\n  /**\n   * Gets and sets init segment for the provided map\n   *\n   * @param {Object} map\n   *        The map object representing the init segment to get or set\n   * @param {boolean=} set\n   *        If true, the init segment for the provided map should be saved\n   * @return {Object}\n   *         map object for desired init segment\n   */\n  ;\n\n  _proto.initSegmentForMap = function initSegmentForMap(map, set) {\n    if (set === void 0) {\n      set = false;\n    }\n\n    if (!map) {\n      return null;\n    }\n\n    var id = initSegmentId(map);\n    var storedMap = this.initSegments_[id];\n\n    if (set && !storedMap && map.bytes) {\n      this.initSegments_[id] = storedMap = {\n        resolvedUri: map.resolvedUri,\n        byterange: map.byterange,\n        bytes: map.bytes,\n        tracks: map.tracks,\n        timescales: map.timescales\n      };\n    }\n\n    return storedMap || map;\n  }\n  /**\n   * Gets and sets key for the provided key\n   *\n   * @param {Object} key\n   *        The key object representing the key to get or set\n   * @param {boolean=} set\n   *        If true, the key for the provided key should be saved\n   * @return {Object}\n   *         Key object for desired key\n   */\n  ;\n\n  _proto.segmentKey = function segmentKey(key, set) {\n    if (set === void 0) {\n      set = false;\n    }\n\n    if (!key) {\n      return null;\n    }\n\n    var id = segmentKeyId(key);\n    var storedKey = this.keyCache_[id]; // TODO: We should use the HTTP Expires header to invalidate our cache per\n    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-6.2.3\n\n    if (this.cacheEncryptionKeys_ && set && !storedKey && key.bytes) {\n      this.keyCache_[id] = storedKey = {\n        resolvedUri: key.resolvedUri,\n        bytes: key.bytes\n      };\n    }\n\n    var result = {\n      resolvedUri: (storedKey || key).resolvedUri\n    };\n\n    if (storedKey) {\n      result.bytes = storedKey.bytes;\n    }\n\n    return result;\n  }\n  /**\n   * Returns true if all configuration required for loading is present, otherwise false.\n   *\n   * @return {boolean} True if the all configuration is ready for loading\n   * @private\n   */\n  ;\n\n  _proto.couldBeginLoading_ = function couldBeginLoading_() {\n    return this.playlist_ && !this.paused();\n  }\n  /**\n   * load a playlist and start to fill the buffer\n   */\n  ;\n\n  _proto.load = function load() {\n    // un-pause\n    this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n    // specified\n\n    if (!this.playlist_) {\n      return;\n    } // if all the configuration is ready, initialize and begin loading\n\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      return this.init_();\n    } // if we're in the middle of processing a segment already, don't\n    // kick off an additional segment request\n\n\n    if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n      return;\n    }\n\n    this.state = 'READY';\n  }\n  /**\n   * Once all the starting parameters have been specified, begin\n   * operation. This method should only be invoked from the INIT\n   * state.\n   *\n   * @private\n   */\n  ;\n\n  _proto.init_ = function init_() {\n    this.state = 'READY'; // if this is the audio segment loader, and it hasn't been inited before, then any old\n    // audio data from the muxed content should be removed\n\n    this.resetEverything();\n    return this.monitorBuffer_();\n  }\n  /**\n   * set a playlist on the segment loader\n   *\n   * @param {PlaylistLoader} media the playlist to set on the segment loader\n   */\n  ;\n\n  _proto.playlist = function playlist(newPlaylist, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    if (!newPlaylist) {\n      return;\n    }\n\n    var oldPlaylist = this.playlist_;\n    var segmentInfo = this.pendingSegment_;\n    this.playlist_ = newPlaylist;\n    this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n    // is always our zero-time so force a sync update each time the playlist\n    // is refreshed from the server\n    //\n    // Use the INIT state to determine if playback has started, as the playlist sync info\n    // should be fixed once requests begin (as sync points are generated based on sync\n    // info), but not before then.\n\n    if (this.state === 'INIT') {\n      newPlaylist.syncInfo = {\n        mediaSequence: newPlaylist.mediaSequence,\n        time: 0\n      }; // Setting the date time mapping means mapping the program date time (if available)\n      // to time 0 on the player's timeline. The playlist's syncInfo serves a similar\n      // purpose, mapping the initial mediaSequence to time zero. Since the syncInfo can\n      // be updated as the playlist is refreshed before the loader starts loading, the\n      // program date time mapping needs to be updated as well.\n      //\n      // This mapping is only done for the main loader because a program date time should\n      // map equivalently between playlists.\n\n      if (this.loaderType_ === 'main') {\n        this.syncController_.setDateTimeMappingForStart(newPlaylist);\n      }\n    }\n\n    var oldId = null;\n\n    if (oldPlaylist) {\n      if (oldPlaylist.id) {\n        oldId = oldPlaylist.id;\n      } else if (oldPlaylist.uri) {\n        oldId = oldPlaylist.uri;\n      }\n    }\n\n    this.logger_(\"playlist update [\" + oldId + \" => \" + (newPlaylist.id || newPlaylist.uri) + \"]\"); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n    // in LIVE, we always want to update with new playlists (including refreshes)\n\n    this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n    // buffering now\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      return this.init_();\n    }\n\n    if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n      if (this.mediaIndex !== null) {\n        // we must reset/resync the segment loader when we switch renditions and\n        // the segment loader is already synced to the previous rendition\n        // on playlist changes we want it to be possible to fetch\n        // at the buffer for vod but not for live. So we use resetLoader\n        // for live and resyncLoader for vod. We want this because\n        // if a playlist uses independent and non-independent segments/parts the\n        // buffer may not accurately reflect the next segment that we should try\n        // downloading.\n        if (!newPlaylist.endList) {\n          this.resetLoader();\n        } else {\n          this.resyncLoader();\n        }\n      }\n\n      this.currentMediaInfo_ = void 0;\n      this.trigger('playlistupdate'); // the rest of this function depends on `oldPlaylist` being defined\n\n      return;\n    } // we reloaded the same playlist so we are in a live scenario\n    // and we will likely need to adjust the mediaIndex\n\n\n    var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n    this.logger_(\"live window shift [\" + mediaSequenceDiff + \"]\"); // update the mediaIndex on the SegmentLoader\n    // this is important because we can abort a request and this value must be\n    // equal to the last appended mediaIndex\n\n    if (this.mediaIndex !== null) {\n      this.mediaIndex -= mediaSequenceDiff; // this can happen if we are going to load the first segment, but get a playlist\n      // update during that. mediaIndex would go from 0 to -1 if mediaSequence in the\n      // new playlist was incremented by 1.\n\n      if (this.mediaIndex < 0) {\n        this.mediaIndex = null;\n        this.partIndex = null;\n      } else {\n        var segment = this.playlist_.segments[this.mediaIndex]; // partIndex should remain the same for the same segment\n        // unless parts fell off of the playlist for this segment.\n        // In that case we need to reset partIndex and resync\n\n        if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {\n          var mediaIndex = this.mediaIndex;\n          this.logger_(\"currently processing part (index \" + this.partIndex + \") no longer exists.\");\n          this.resetLoader(); // We want to throw away the partIndex and the data associated with it,\n          // as the part was dropped from our current playlists segment.\n          // The mediaIndex will still be valid so keep that around.\n\n          this.mediaIndex = mediaIndex;\n        }\n      }\n    } // update the mediaIndex on the SegmentInfo object\n    // this is important because we will update this.mediaIndex with this value\n    // in `handleAppendsDone_` after the segment has been successfully appended\n\n\n    if (segmentInfo) {\n      segmentInfo.mediaIndex -= mediaSequenceDiff;\n\n      if (segmentInfo.mediaIndex < 0) {\n        segmentInfo.mediaIndex = null;\n        segmentInfo.partIndex = null;\n      } else {\n        // we need to update the referenced segment so that timing information is\n        // saved for the new playlist's segment, however, if the segment fell off the\n        // playlist, we can leave the old reference and just lose the timing info\n        if (segmentInfo.mediaIndex >= 0) {\n          segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n        }\n\n        if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {\n          segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];\n        }\n      }\n    }\n\n    this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n  }\n  /**\n   * Prevent the loader from fetching additional segments. If there\n   * is a segment request outstanding, it will finish processing\n   * before the loader halts. A segment loader can be unpaused by\n   * calling load().\n   */\n  ;\n\n  _proto.pause = function pause() {\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n      this.checkBufferTimeout_ = null;\n    }\n  }\n  /**\n   * Returns whether the segment loader is fetching additional\n   * segments when given the opportunity. This property can be\n   * modified through calls to pause() and load().\n   */\n  ;\n\n  _proto.paused = function paused() {\n    return this.checkBufferTimeout_ === null;\n  }\n  /**\n   * Delete all the buffered data and reset the SegmentLoader\n   *\n   * @param {Function} [done] an optional callback to be executed when the remove\n   * operation is complete\n   */\n  ;\n\n  _proto.resetEverything = function resetEverything(done) {\n    this.ended_ = false;\n    this.appendInitSegment_ = {\n      audio: true,\n      video: true\n    };\n    this.resetLoader(); // remove from 0, the earliest point, to Infinity, to signify removal of everything.\n    // VTT Segment Loader doesn't need to do anything but in the regular SegmentLoader,\n    // we then clamp the value to duration if necessary.\n\n    this.remove(0, Infinity, done); // clears fmp4 captions\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearAllMp4Captions'\n      }); // reset the cache in the transmuxer\n\n      this.transmuxer_.postMessage({\n        action: 'reset'\n      });\n    }\n  }\n  /**\n   * Force the SegmentLoader to resync and start loading around the currentTime instead\n   * of starting at the end of the buffer\n   *\n   * Useful for fast quality changes\n   */\n  ;\n\n  _proto.resetLoader = function resetLoader() {\n    this.fetchAtBuffer_ = false;\n    this.resyncLoader();\n  }\n  /**\n   * Force the SegmentLoader to restart synchronization and make a conservative guess\n   * before returning to the simple walk-forward method\n   */\n  ;\n\n  _proto.resyncLoader = function resyncLoader() {\n    if (this.transmuxer_) {\n      // need to clear out any cached data to prepare for the new segment\n      segmentTransmuxer.reset(this.transmuxer_);\n    }\n\n    this.mediaIndex = null;\n    this.partIndex = null;\n    this.syncPoint_ = null;\n    this.isPendingTimestampOffset_ = false;\n    this.callQueue_ = [];\n    this.loadQueue_ = [];\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n    this.abort();\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearParsedMp4Captions'\n      });\n    }\n  }\n  /**\n   * Remove any data in the source buffer between start and end times\n   *\n   * @param {number} start - the start time of the region to remove from the buffer\n   * @param {number} end - the end time of the region to remove from the buffer\n   * @param {Function} [done] - an optional callback to be executed when the remove\n   * @param {boolean} force - force all remove operations to happen\n   * operation is complete\n   */\n  ;\n\n  _proto.remove = function remove(start, end, done, force) {\n    if (done === void 0) {\n      done = function done() {};\n    }\n\n    if (force === void 0) {\n      force = false;\n    } // clamp end to duration if we need to remove everything.\n    // This is due to a browser bug that causes issues if we remove to Infinity.\n    // videojs/videojs-contrib-hls#1225\n\n\n    if (end === Infinity) {\n      end = this.duration_();\n    } // skip removes that would throw an error\n    // commonly happens during a rendition switch at the start of a video\n    // from start 0 to end 0\n\n\n    if (end <= start) {\n      this.logger_('skipping remove because end ${end} is <= start ${start}');\n      return;\n    }\n\n    if (!this.sourceUpdater_ || !this.getMediaInfo_()) {\n      this.logger_('skipping remove because no source updater or starting media info'); // nothing to remove if we haven't processed any media\n\n      return;\n    } // set it to one to complete this function's removes\n\n\n    var removesRemaining = 1;\n\n    var removeFinished = function removeFinished() {\n      removesRemaining--;\n\n      if (removesRemaining === 0) {\n        done();\n      }\n    };\n\n    if (force || !this.audioDisabled_) {\n      removesRemaining++;\n      this.sourceUpdater_.removeAudio(start, end, removeFinished);\n    } // While it would be better to only remove video if the main loader has video, this\n    // should be safe with audio only as removeVideo will call back even if there's no\n    // video buffer.\n    //\n    // In theory we can check to see if there's video before calling the remove, but in\n    // the event that we're switching between renditions and from video to audio only\n    // (when we add support for that), we may need to clear the video contents despite\n    // what the new media will contain.\n\n\n    if (force || this.loaderType_ === 'main') {\n      this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n      removesRemaining++;\n      this.sourceUpdater_.removeVideo(start, end, removeFinished);\n    } // remove any captions and ID3 tags\n\n\n    for (var track in this.inbandTextTracks_) {\n      removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n    }\n\n    removeCuesFromTrack(start, end, this.segmentMetadataTrack_); // finished this function's removes\n\n    removeFinished();\n  }\n  /**\n   * (re-)schedule monitorBufferTick_ to run as soon as possible\n   *\n   * @private\n   */\n  ;\n\n  _proto.monitorBuffer_ = function monitorBuffer_() {\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), 1);\n  }\n  /**\n   * As long as the SegmentLoader is in the READY state, periodically\n   * invoke fillBuffer_().\n   *\n   * @private\n   */\n  ;\n\n  _proto.monitorBufferTick_ = function monitorBufferTick_() {\n    if (this.state === 'READY') {\n      this.fillBuffer_();\n    }\n\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n  }\n  /**\n   * fill the buffer with segements unless the sourceBuffers are\n   * currently updating\n   *\n   * Note: this function should only ever be called by monitorBuffer_\n   * and never directly\n   *\n   * @private\n   */\n  ;\n\n  _proto.fillBuffer_ = function fillBuffer_() {\n    // TODO since the source buffer maintains a queue, and we shouldn't call this function\n    // except when we're ready for the next segment, this check can most likely be removed\n    if (this.sourceUpdater_.updating()) {\n      return;\n    } // see if we need to begin loading immediately\n\n\n    var segmentInfo = this.chooseNextRequest_();\n\n    if (!segmentInfo) {\n      return;\n    }\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      this.isPendingTimestampOffset_ = false;\n      this.timelineChangeController_.pendingTimelineChange({\n        type: this.loaderType_,\n        from: this.currentTimeline_,\n        to: segmentInfo.timeline\n      });\n    }\n\n    this.loadSegment_(segmentInfo);\n  }\n  /**\n   * Determines if we should call endOfStream on the media source based\n   * on the state of the buffer or if appened segment was the final\n   * segment in the playlist.\n   *\n   * @param {number} [mediaIndex] the media index of segment we last appended\n   * @param {Object} [playlist] a media playlist object\n   * @return {boolean} do we need to call endOfStream on the MediaSource\n   */\n  ;\n\n  _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) {\n    if (mediaIndex === void 0) {\n      mediaIndex = this.mediaIndex;\n    }\n\n    if (playlist === void 0) {\n      playlist = this.playlist_;\n    }\n\n    if (partIndex === void 0) {\n      partIndex = this.partIndex;\n    }\n\n    if (!playlist || !this.mediaSource_) {\n      return false;\n    }\n\n    var segment = typeof mediaIndex === 'number' && playlist.segments[mediaIndex]; // mediaIndex is zero based but length is 1 based\n\n    var appendedLastSegment = mediaIndex + 1 === playlist.segments.length; // true if there are no parts, or this is the last part.\n\n    var appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length; // if we've buffered to the end of the video, we need to call endOfStream\n    // so that MediaSources can trigger the `ended` event when it runs out of\n    // buffered data instead of waiting for me\n\n    return playlist.endList && this.mediaSource_.readyState === 'open' && appendedLastSegment && appendedLastPart;\n  }\n  /**\n   * Determines what request should be made given current segment loader state.\n   *\n   * @return {Object} a request object that describes the segment/part to load\n   */\n  ;\n\n  _proto.chooseNextRequest_ = function chooseNextRequest_() {\n    var buffered = this.buffered_();\n    var bufferedEnd = lastBufferedEnd(buffered) || 0;\n    var bufferedTime = timeAheadOf(buffered, this.currentTime_());\n    var preloaded = !this.hasPlayed_() && bufferedTime >= 1;\n    var haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();\n    var segments = this.playlist_.segments; // return no segment if:\n    // 1. we don't have segments\n    // 2. The video has not yet played and we already downloaded a segment\n    // 3. we already have enough buffered time\n\n    if (!segments.length || preloaded || haveEnoughBuffer) {\n      return null;\n    }\n\n    this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n    var next = {\n      partIndex: null,\n      mediaIndex: null,\n      startOfSegment: null,\n      playlist: this.playlist_,\n      isSyncRequest: Boolean(!this.syncPoint_)\n    };\n\n    if (next.isSyncRequest) {\n      next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);\n    } else if (this.mediaIndex !== null) {\n      var segment = segments[this.mediaIndex];\n      var partIndex = typeof this.partIndex === 'number' ? this.partIndex : -1;\n      next.startOfSegment = segment.end ? segment.end : bufferedEnd;\n\n      if (segment.parts && segment.parts[partIndex + 1]) {\n        next.mediaIndex = this.mediaIndex;\n        next.partIndex = partIndex + 1;\n      } else {\n        next.mediaIndex = this.mediaIndex + 1;\n      }\n    } else {\n      // Find the segment containing the end of the buffer or current time.\n      var _Playlist$getMediaInf = Playlist.getMediaInfoForTime({\n        experimentalExactManifestTimings: this.experimentalExactManifestTimings,\n        playlist: this.playlist_,\n        currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),\n        startingPartIndex: this.syncPoint_.partIndex,\n        startingSegmentIndex: this.syncPoint_.segmentIndex,\n        startTime: this.syncPoint_.time\n      }),\n          segmentIndex = _Playlist$getMediaInf.segmentIndex,\n          startTime = _Playlist$getMediaInf.startTime,\n          _partIndex = _Playlist$getMediaInf.partIndex;\n\n      next.getMediaInfoForTime = this.fetchAtBuffer_ ? \"bufferedEnd \" + bufferedEnd : \"currentTime \" + this.currentTime_();\n      next.mediaIndex = segmentIndex;\n      next.startOfSegment = startTime;\n      next.partIndex = _partIndex;\n    }\n\n    var nextSegment = segments[next.mediaIndex];\n    var nextPart = nextSegment && typeof next.partIndex === 'number' && nextSegment.parts && nextSegment.parts[next.partIndex]; // if the next segment index is invalid or\n    // the next partIndex is invalid do not choose a next segment.\n\n    if (!nextSegment || typeof next.partIndex === 'number' && !nextPart) {\n      return null;\n    } // if the next segment has parts, and we don't have a partIndex.\n    // Set partIndex to 0\n\n\n    if (typeof next.partIndex !== 'number' && nextSegment.parts) {\n      next.partIndex = 0;\n      nextPart = nextSegment.parts[0];\n    } // if we have no buffered data then we need to make sure\n    // that the next part we append is \"independent\" if possible.\n    // So we check if the previous part is independent, and request\n    // it if it is.\n\n\n    if (!bufferedTime && nextPart && !nextPart.independent) {\n      if (next.partIndex === 0) {\n        var lastSegment = segments[next.mediaIndex - 1];\n        var lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];\n\n        if (lastSegmentLastPart && lastSegmentLastPart.independent) {\n          next.mediaIndex -= 1;\n          next.partIndex = lastSegment.parts.length - 1;\n          next.independent = 'previous segment';\n        }\n      } else if (nextSegment.parts[next.partIndex - 1].independent) {\n        next.partIndex -= 1;\n        next.independent = 'previous part';\n      }\n    }\n\n    var ended = this.mediaSource_ && this.mediaSource_.readyState === 'ended'; // do not choose a next segment if all of the following:\n    // 1. this is the last segment in the playlist\n    // 2. end of stream has been called on the media source already\n    // 3. the player is not seeking\n\n    if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {\n      return null;\n    }\n\n    return this.generateSegmentInfo_(next);\n  };\n\n  _proto.generateSegmentInfo_ = function generateSegmentInfo_(options) {\n    var independent = options.independent,\n        playlist = options.playlist,\n        mediaIndex = options.mediaIndex,\n        startOfSegment = options.startOfSegment,\n        isSyncRequest = options.isSyncRequest,\n        partIndex = options.partIndex,\n        forceTimestampOffset = options.forceTimestampOffset,\n        getMediaInfoForTime = options.getMediaInfoForTime;\n    var segment = playlist.segments[mediaIndex];\n    var part = typeof partIndex === 'number' && segment.parts[partIndex];\n    var segmentInfo = {\n      requestId: 'segment-loader-' + Math.random(),\n      // resolve the segment URL relative to the playlist\n      uri: part && part.resolvedUri || segment.resolvedUri,\n      // the segment's mediaIndex at the time it was requested\n      mediaIndex: mediaIndex,\n      partIndex: part ? partIndex : null,\n      // whether or not to update the SegmentLoader's state with this\n      // segment's mediaIndex\n      isSyncRequest: isSyncRequest,\n      startOfSegment: startOfSegment,\n      // the segment's playlist\n      playlist: playlist,\n      // unencrypted bytes of the segment\n      bytes: null,\n      // when a key is defined for this segment, the encrypted bytes\n      encryptedBytes: null,\n      // The target timestampOffset for this segment when we append it\n      // to the source buffer\n      timestampOffset: null,\n      // The timeline that the segment is in\n      timeline: segment.timeline,\n      // The expected duration of the segment in seconds\n      duration: part && part.duration || segment.duration,\n      // retain the segment in case the playlist updates while doing an async process\n      segment: segment,\n      part: part,\n      byteLength: 0,\n      transmuxer: this.transmuxer_,\n      // type of getMediaInfoForTime that was used to get this segment\n      getMediaInfoForTime: getMediaInfoForTime,\n      independent: independent\n    };\n    var overrideCheck = typeof forceTimestampOffset !== 'undefined' ? forceTimestampOffset : this.isPendingTimestampOffset_;\n    segmentInfo.timestampOffset = this.timestampOffsetForSegment_({\n      segmentTimeline: segment.timeline,\n      currentTimeline: this.currentTimeline_,\n      startOfSegment: startOfSegment,\n      buffered: this.buffered_(),\n      overrideCheck: overrideCheck\n    });\n    var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());\n\n    if (typeof audioBufferedEnd === 'number') {\n      // since the transmuxer is using the actual timing values, but the buffer is\n      // adjusted by the timestamp offset, we must adjust the value here\n      segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();\n    }\n\n    if (this.sourceUpdater_.videoBuffered().length) {\n      segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(this.gopBuffer_, // since the transmuxer is using the actual timing values, but the time is\n      // adjusted by the timestmap offset, we must adjust the value here\n      this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_);\n    }\n\n    return segmentInfo;\n  } // get the timestampoffset for a segment,\n  // added so that vtt segment loader can override and prevent\n  // adding timestamp offsets.\n  ;\n\n  _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options) {\n    return timestampOffsetForSegment(options);\n  }\n  /**\n   * Determines if the network has enough bandwidth to complete the current segment\n   * request in a timely manner. If not, the request will be aborted early and bandwidth\n   * updated to trigger a playlist switch.\n   *\n   * @param {Object} stats\n   *        Object containing stats about the request timing and size\n   * @private\n   */\n  ;\n\n  _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) {\n    if (this.vhs_.tech_.paused() || // Don't abort if the current playlist is on the lowestEnabledRendition\n    // TODO: Replace using timeout with a boolean indicating whether this playlist is\n    //       the lowestEnabledRendition.\n    !this.xhrOptions_.timeout || // Don't abort if we have no bandwidth information to estimate segment sizes\n    !this.playlist_.attributes.BANDWIDTH) {\n      return;\n    } // Wait at least 1 second since the first byte of data has been received before\n    // using the calculated bandwidth from the progress event to allow the bitrate\n    // to stabilize\n\n\n    if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n      return;\n    }\n\n    var currentTime = this.currentTime_();\n    var measuredBandwidth = stats.bandwidth;\n    var segmentDuration = this.pendingSegment_.duration;\n    var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n    // if we are only left with less than 1 second when the request completes.\n    // A negative timeUntilRebuffering indicates we are already rebuffering\n\n    var timeUntilRebuffer$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n    // is larger than the estimated time until the player runs out of forward buffer\n\n    if (requestTimeRemaining <= timeUntilRebuffer$1) {\n      return;\n    }\n\n    var switchCandidate = minRebufferMaxBandwidthSelector({\n      master: this.vhs_.playlists.master,\n      currentTime: currentTime,\n      bandwidth: measuredBandwidth,\n      duration: this.duration_(),\n      segmentDuration: segmentDuration,\n      timeUntilRebuffer: timeUntilRebuffer$1,\n      currentTimeline: this.currentTimeline_,\n      syncController: this.syncController_\n    });\n\n    if (!switchCandidate) {\n      return;\n    }\n\n    var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1;\n    var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n    var minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n    // potential round trip time of the new request so that we are not too aggressive\n    // with switching to a playlist that might save us a fraction of a second.\n\n    if (timeUntilRebuffer$1 <= TIME_FUDGE_FACTOR) {\n      minimumTimeSaving = 1;\n    }\n\n    if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n      return;\n    } // set the bandwidth to that of the desired playlist being sure to scale by\n    // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n    // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n\n    this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n    this.trigger('earlyabort');\n  };\n\n  _proto.handleAbort_ = function handleAbort_(segmentInfo) {\n    this.logger_(\"Aborting \" + segmentInfoString(segmentInfo));\n    this.mediaRequestsAborted += 1;\n  }\n  /**\n   * XHR `progress` event handler\n   *\n   * @param {Event}\n   *        The XHR `progress` event\n   * @param {Object} simpleSegment\n   *        A simplified segment object copy\n   * @private\n   */\n  ;\n\n  _proto.handleProgress_ = function handleProgress_(event, simpleSegment) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    this.trigger('progress');\n  };\n\n  _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    if (this.checkForIllegalMediaSwitch(trackInfo)) {\n      return;\n    }\n\n    trackInfo = trackInfo || {}; // When we have track info, determine what media types this loader is dealing with.\n    // Guard against cases where we're not getting track info at all until we are\n    // certain that all streams will provide it.\n\n    if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {\n      this.appendInitSegment_ = {\n        audio: true,\n        video: true\n      };\n      this.startingMediaInfo_ = trackInfo;\n      this.currentMediaInfo_ = trackInfo;\n      this.logger_('trackinfo update', trackInfo);\n      this.trigger('trackinfo');\n    } // trackinfo may cause an abort if the trackinfo\n    // causes a codec change to an unsupported codec.\n\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // set trackinfo on the pending segment so that\n    // it can append.\n\n\n    this.pendingSegment_.trackInfo = trackInfo; // check if any calls were waiting on the track info\n\n    if (this.hasEnoughInfoToAppend_()) {\n      this.processCallQueue_();\n    }\n  };\n\n  _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_;\n    var timingInfoProperty = timingInfoPropertyForMedia(mediaType);\n    segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};\n    segmentInfo[timingInfoProperty][timeType] = time;\n    this.logger_(\"timinginfo: \" + mediaType + \" - \" + timeType + \" - \" + time); // check if any calls were waiting on the timing info\n\n    if (this.hasEnoughInfoToAppend_()) {\n      this.processCallQueue_();\n    }\n  };\n\n  _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) {\n    var _this2 = this;\n\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // This could only happen with fmp4 segments, but\n    // should still not happen in general\n\n\n    if (captionData.length === 0) {\n      this.logger_('SegmentLoader received no captions from a caption event');\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // Wait until we have some video data so that caption timing\n    // can be adjusted by the timestamp offset\n\n    if (!segmentInfo.hasAppendedData_) {\n      this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));\n      return;\n    }\n\n    var timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();\n    var captionTracks = {}; // get total start/end and captions for each track/stream\n\n    captionData.forEach(function (caption) {\n      // caption.stream is actually a track name...\n      // set to the existing values in tracks or default values\n      captionTracks[caption.stream] = captionTracks[caption.stream] || {\n        // Infinity, as any other value will be less than this\n        startTime: Infinity,\n        captions: [],\n        // 0 as an other value will be more than this\n        endTime: 0\n      };\n      var captionTrack = captionTracks[caption.stream];\n      captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset);\n      captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset);\n      captionTrack.captions.push(caption);\n    });\n    Object.keys(captionTracks).forEach(function (trackName) {\n      var _captionTracks$trackN = captionTracks[trackName],\n          startTime = _captionTracks$trackN.startTime,\n          endTime = _captionTracks$trackN.endTime,\n          captions = _captionTracks$trackN.captions;\n      var inbandTextTracks = _this2.inbandTextTracks_;\n\n      _this2.logger_(\"adding cues from \" + startTime + \" -> \" + endTime + \" for \" + trackName);\n\n      createCaptionsTrackIfNotExists(inbandTextTracks, _this2.vhs_.tech_, trackName); // clear out any cues that start and end at the same time period for the same track.\n      // We do this because a rendition change that also changes the timescale for captions\n      // will result in captions being re-parsed for certain segments. If we add them again\n      // without clearing we will have two of the same captions visible.\n\n      removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);\n      addCaptionData({\n        captionArray: captions,\n        inbandTextTracks: inbandTextTracks,\n        timestampOffset: timestampOffset\n      });\n    }); // Reset stored captions since we added parsed\n    // captions to a text track at this point\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearParsedMp4Captions'\n      });\n    }\n  };\n\n  _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // we need to have appended data in order for the timestamp offset to be set\n\n    if (!segmentInfo.hasAppendedData_) {\n      this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));\n      return;\n    }\n\n    var timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset(); // There's potentially an issue where we could double add metadata if there's a muxed\n    // audio/video source with a metadata track, and an alt audio with a metadata track.\n    // However, this probably won't happen, and if it does it can be handled then.\n\n    createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);\n    addMetadata({\n      inbandTextTracks: this.inbandTextTracks_,\n      metadataArray: id3Frames,\n      timestampOffset: timestampOffset,\n      videoDuration: this.duration_()\n    });\n  };\n\n  _proto.processMetadataQueue_ = function processMetadataQueue_() {\n    this.metadataQueue_.id3.forEach(function (fn) {\n      return fn();\n    });\n    this.metadataQueue_.caption.forEach(function (fn) {\n      return fn();\n    });\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n  };\n\n  _proto.processCallQueue_ = function processCallQueue_() {\n    var callQueue = this.callQueue_; // Clear out the queue before the queued functions are run, since some of the\n    // functions may check the length of the load queue and default to pushing themselves\n    // back onto the queue.\n\n    this.callQueue_ = [];\n    callQueue.forEach(function (fun) {\n      return fun();\n    });\n  };\n\n  _proto.processLoadQueue_ = function processLoadQueue_() {\n    var loadQueue = this.loadQueue_; // Clear out the queue before the queued functions are run, since some of the\n    // functions may check the length of the load queue and default to pushing themselves\n    // back onto the queue.\n\n    this.loadQueue_ = [];\n    loadQueue.forEach(function (fun) {\n      return fun();\n    });\n  }\n  /**\n   * Determines whether the loader has enough info to load the next segment.\n   *\n   * @return {boolean}\n   *         Whether or not the loader has enough info to load the next segment\n   */\n  ;\n\n  _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() {\n    // Since primary timing goes by video, only the audio loader potentially needs to wait\n    // to load.\n    if (this.loaderType_ !== 'audio') {\n      return true;\n    }\n\n    var segmentInfo = this.pendingSegment_; // A fill buffer must have already run to establish a pending segment before there's\n    // enough info to load.\n\n    if (!segmentInfo) {\n      return false;\n    } // The first segment can and should be loaded immediately so that source buffers are\n    // created together (before appending). Source buffer creation uses the presence of\n    // audio and video data to determine whether to create audio/video source buffers, and\n    // uses processed (transmuxed or parsed) media to determine the types required.\n\n\n    if (!this.getCurrentMediaInfo_()) {\n      return true;\n    }\n\n    if ( // Technically, instead of waiting to load a segment on timeline changes, a segment\n    // can be requested and downloaded and only wait before it is transmuxed or parsed.\n    // But in practice, there are a few reasons why it is better to wait until a loader\n    // is ready to append that segment before requesting and downloading:\n    //\n    // 1. Because audio and main loaders cross discontinuities together, if this loader\n    //    is waiting for the other to catch up, then instead of requesting another\n    //    segment and using up more bandwidth, by not yet loading, more bandwidth is\n    //    allotted to the loader currently behind.\n    // 2. media-segment-request doesn't have to have logic to consider whether a segment\n    // is ready to be processed or not, isolating the queueing behavior to the loader.\n    // 3. The audio loader bases some of its segment properties on timing information\n    //    provided by the main loader, meaning that, if the logic for waiting on\n    //    processing was in media-segment-request, then it would also need to know how\n    //    to re-generate the segment information after the main loader caught up.\n    shouldWaitForTimelineChange({\n      timelineChangeController: this.timelineChangeController_,\n      currentTimeline: this.currentTimeline_,\n      segmentTimeline: segmentInfo.timeline,\n      loaderType: this.loaderType_,\n      audioDisabled: this.audioDisabled_\n    })) {\n      return false;\n    }\n\n    return true;\n  };\n\n  _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) {\n    if (segmentInfo === void 0) {\n      segmentInfo = this.pendingSegment_;\n    }\n\n    return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;\n  };\n\n  _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) {\n    if (segmentInfo === void 0) {\n      segmentInfo = this.pendingSegment_;\n    }\n\n    return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;\n  };\n\n  _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() {\n    if (!this.sourceUpdater_.ready()) {\n      return false;\n    } // If content needs to be removed or the loader is waiting on an append reattempt,\n    // then no additional content should be appended until the prior append is resolved.\n\n\n    if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {\n      return false;\n    }\n\n    var segmentInfo = this.pendingSegment_;\n    var trackInfo = this.getCurrentMediaInfo_(); // no segment to append any data for or\n    // we do not have information on this specific\n    // segment yet\n\n    if (!segmentInfo || !trackInfo) {\n      return false;\n    }\n\n    var hasAudio = trackInfo.hasAudio,\n        hasVideo = trackInfo.hasVideo,\n        isMuxed = trackInfo.isMuxed;\n\n    if (hasVideo && !segmentInfo.videoTimingInfo) {\n      return false;\n    } // muxed content only relies on video timing information for now.\n\n\n    if (hasAudio && !this.audioDisabled_ && !isMuxed && !segmentInfo.audioTimingInfo) {\n      return false;\n    }\n\n    if (shouldWaitForTimelineChange({\n      timelineChangeController: this.timelineChangeController_,\n      currentTimeline: this.currentTimeline_,\n      segmentTimeline: segmentInfo.timeline,\n      loaderType: this.loaderType_,\n      audioDisabled: this.audioDisabled_\n    })) {\n      return false;\n    }\n\n    return true;\n  };\n\n  _proto.handleData_ = function handleData_(simpleSegment, result) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // If there's anything in the call queue, then this data came later and should be\n    // executed after the calls currently queued.\n\n\n    if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {\n      this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // update the time mapping so we can translate from display time to media time\n\n    this.setTimeMapping_(segmentInfo.timeline); // for tracking overall stats\n\n    this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment); // Note that the state isn't changed from loading to appending. This is because abort\n    // logic may change behavior depending on the state, and changing state too early may\n    // inflate our estimates of bandwidth. In the future this should be re-examined to\n    // note more granular states.\n    // don't process and append data if the mediaSource is closed\n\n    if (this.mediaSource_.readyState === 'closed') {\n      return;\n    } // if this request included an initialization segment, save that data\n    // to the initSegment cache\n\n\n    if (simpleSegment.map) {\n      simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true); // move over init segment properties to media request\n\n      segmentInfo.segment.map = simpleSegment.map;\n    } // if this request included a segment key, save that data in the cache\n\n\n    if (simpleSegment.key) {\n      this.segmentKey(simpleSegment.key, true);\n    }\n\n    segmentInfo.isFmp4 = simpleSegment.isFmp4;\n    segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n\n    if (segmentInfo.isFmp4) {\n      this.trigger('fmp4');\n      segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;\n    } else {\n      var trackInfo = this.getCurrentMediaInfo_();\n      var useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n      var firstVideoFrameTimeForData;\n\n      if (useVideoTimingInfo) {\n        firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;\n      } // Segment loader knows more about segment timing than the transmuxer (in certain\n      // aspects), so make any changes required for a more accurate start time.\n      // Don't set the end time yet, as the segment may not be finished processing.\n\n\n      segmentInfo.timingInfo.start = this.trueSegmentStart_({\n        currentStart: segmentInfo.timingInfo.start,\n        playlist: segmentInfo.playlist,\n        mediaIndex: segmentInfo.mediaIndex,\n        currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),\n        useVideoTimingInfo: useVideoTimingInfo,\n        firstVideoFrameTimeForData: firstVideoFrameTimeForData,\n        videoTimingInfo: segmentInfo.videoTimingInfo,\n        audioTimingInfo: segmentInfo.audioTimingInfo\n      });\n    } // Init segments for audio and video only need to be appended in certain cases. Now\n    // that data is about to be appended, we can check the final cases to determine\n    // whether we should append an init segment.\n\n\n    this.updateAppendInitSegmentStatus(segmentInfo, result.type); // Timestamp offset should be updated once we get new data and have its timing info,\n    // as we use the start of the segment to offset the best guess (playlist provided)\n    // timestamp offset.\n\n    this.updateSourceBufferTimestampOffset_(segmentInfo); // if this is a sync request we need to determine whether it should\n    // be appended or not.\n\n    if (segmentInfo.isSyncRequest) {\n      // first save/update our timing info for this segment.\n      // this is what allows us to choose an accurate segment\n      // and the main reason we make a sync request.\n      this.updateTimingInfoEnd_(segmentInfo);\n      this.syncController_.saveSegmentTimingInfo({\n        segmentInfo: segmentInfo,\n        shouldSaveTimelineMapping: this.loaderType_ === 'main'\n      });\n      var next = this.chooseNextRequest_(); // If the sync request isn't the segment that would be requested next\n      // after taking into account its timing info, do not append it.\n\n      if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {\n        this.logger_('sync segment was incorrect, not appending');\n        return;\n      } // otherwise append it like any other segment as our guess was correct.\n\n\n      this.logger_('sync segment was correct, appending');\n    } // Save some state so that in the future anything waiting on first append (and/or\n    // timestamp offset(s)) can process immediately. While the extra state isn't optimal,\n    // we need some notion of whether the timestamp offset or other relevant information\n    // has had a chance to be set.\n\n\n    segmentInfo.hasAppendedData_ = true; // Now that the timestamp offset should be set, we can append any waiting ID3 tags.\n\n    this.processMetadataQueue_();\n    this.appendData_(segmentInfo, result);\n  };\n\n  _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type) {\n    // alt audio doesn't manage timestamp offset\n    if (this.loaderType_ === 'main' && typeof segmentInfo.timestampOffset === 'number' && // in the case that we're handling partial data, we don't want to append an init\n    // segment for each chunk\n    !segmentInfo.changedTimestampOffset) {\n      // if the timestamp offset changed, the timeline may have changed, so we have to re-\n      // append init segments\n      this.appendInitSegment_ = {\n        audio: true,\n        video: true\n      };\n    }\n\n    if (this.playlistOfLastInitSegment_[type] !== segmentInfo.playlist) {\n      // make sure we append init segment on playlist changes, in case the media config\n      // changed\n      this.appendInitSegment_[type] = true;\n    }\n  };\n\n  _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) {\n    var type = _ref4.type,\n        initSegment = _ref4.initSegment,\n        map = _ref4.map,\n        playlist = _ref4.playlist; // \"The EXT-X-MAP tag specifies how to obtain the Media Initialization Section\n    // (Section 3) required to parse the applicable Media Segments.  It applies to every\n    // Media Segment that appears after it in the Playlist until the next EXT-X-MAP tag\n    // or until the end of the playlist.\"\n    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.5\n\n    if (map) {\n      var id = initSegmentId(map);\n\n      if (this.activeInitSegmentId_ === id) {\n        // don't need to re-append the init segment if the ID matches\n        return null;\n      } // a map-specified init segment takes priority over any transmuxed (or otherwise\n      // obtained) init segment\n      //\n      // this also caches the init segment for later use\n\n\n      initSegment = this.initSegmentForMap(map, true).bytes;\n      this.activeInitSegmentId_ = id;\n    } // We used to always prepend init segments for video, however, that shouldn't be\n    // necessary. Instead, we should only append on changes, similar to what we've always\n    // done for audio. This is more important (though may not be that important) for\n    // frame-by-frame appending for LHLS, simply because of the increased quantity of\n    // appends.\n\n\n    if (initSegment && this.appendInitSegment_[type]) {\n      // Make sure we track the playlist that we last used for the init segment, so that\n      // we can re-append the init segment in the event that we get data from a new\n      // playlist. Discontinuities and track changes are handled in other sections.\n      this.playlistOfLastInitSegment_[type] = playlist; // Disable future init segment appends for this type. Until a change is necessary.\n\n      this.appendInitSegment_[type] = false; // we need to clear out the fmp4 active init segment id, since\n      // we are appending the muxer init segment\n\n      this.activeInitSegmentId_ = null;\n      return initSegment;\n    }\n\n    return null;\n  };\n\n  _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) {\n    var _this3 = this;\n\n    var segmentInfo = _ref5.segmentInfo,\n        type = _ref5.type,\n        bytes = _ref5.bytes;\n    var audioBuffered = this.sourceUpdater_.audioBuffered();\n    var videoBuffered = this.sourceUpdater_.videoBuffered(); // For now we're ignoring any notion of gaps in the buffer, but they, in theory,\n    // should be cleared out during the buffer removals. However, log in case it helps\n    // debug.\n\n    if (audioBuffered.length > 1) {\n      this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + timeRangesToArray(audioBuffered).join(', '));\n    }\n\n    if (videoBuffered.length > 1) {\n      this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + timeRangesToArray(videoBuffered).join(', '));\n    }\n\n    var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;\n    var audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;\n    var videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;\n    var videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;\n\n    if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {\n      // Can't remove enough buffer to make room for new segment (or the browser doesn't\n      // allow for appends of segments this size). In the future, it may be possible to\n      // split up the segment and append in pieces, but for now, error out this playlist\n      // in an attempt to switch to a more manageable rendition.\n      this.logger_('On QUOTA_EXCEEDED_ERR, single segment too large to append to ' + 'buffer, triggering an error. ' + (\"Appended byte length: \" + bytes.byteLength + \", \") + (\"audio buffer: \" + timeRangesToArray(audioBuffered).join(', ') + \", \") + (\"video buffer: \" + timeRangesToArray(videoBuffered).join(', ') + \", \"));\n      this.error({\n        message: 'Quota exceeded error with append of a single segment of content',\n        excludeUntil: Infinity\n      });\n      this.trigger('error');\n      return;\n    } // To try to resolve the quota exceeded error, clear back buffer and retry. This means\n    // that the segment-loader should block on future events until this one is handled, so\n    // that it doesn't keep moving onto further segments. Adding the call to the call\n    // queue will prevent further appends until waitingOnRemove_ and\n    // quotaExceededErrorRetryTimeout_ are cleared.\n    //\n    // Note that this will only block the current loader. In the case of demuxed content,\n    // the other load may keep filling as fast as possible. In practice, this should be\n    // OK, as it is a rare case when either audio has a high enough bitrate to fill up a\n    // source buffer, or video fills without enough room for audio to append (and without\n    // the availability of clearing out seconds of back buffer to make room for audio).\n    // But it might still be good to handle this case in the future as a TODO.\n\n\n    this.waitingOnRemove_ = true;\n    this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {\n      segmentInfo: segmentInfo,\n      type: type,\n      bytes: bytes\n    }));\n    var currentTime = this.currentTime_(); // Try to remove as much audio and video as possible to make room for new content\n    // before retrying.\n\n    var timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;\n    this.logger_(\"On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to \" + timeToRemoveUntil);\n    this.remove(0, timeToRemoveUntil, function () {\n      _this3.logger_(\"On QUOTA_EXCEEDED_ERR, retrying append in \" + MIN_BACK_BUFFER + \"s\");\n\n      _this3.waitingOnRemove_ = false; // wait the length of time alotted in the back buffer to prevent wasted\n      // attempts (since we can't clear less than the minimum)\n\n      _this3.quotaExceededErrorRetryTimeout_ = window$1.setTimeout(function () {\n        _this3.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue');\n\n        _this3.quotaExceededErrorRetryTimeout_ = null;\n\n        _this3.processCallQueue_();\n      }, MIN_BACK_BUFFER * 1000);\n    }, true);\n  };\n\n  _proto.handleAppendError_ = function handleAppendError_(_ref6, error) {\n    var segmentInfo = _ref6.segmentInfo,\n        type = _ref6.type,\n        bytes = _ref6.bytes; // if there's no error, nothing to do\n\n    if (!error) {\n      return;\n    }\n\n    if (error.code === QUOTA_EXCEEDED_ERR) {\n      this.handleQuotaExceededError_({\n        segmentInfo: segmentInfo,\n        type: type,\n        bytes: bytes\n      }); // A quota exceeded error should be recoverable with a future re-append, so no need\n      // to trigger an append error.\n\n      return;\n    }\n\n    this.logger_('Received non QUOTA_EXCEEDED_ERR on append', error);\n    this.error(type + \" append of \" + bytes.length + \"b failed for segment \" + (\"#\" + segmentInfo.mediaIndex + \" in playlist \" + segmentInfo.playlist.id)); // If an append errors, we often can't recover.\n    // (see https://w3c.github.io/media-source/#sourcebuffer-append-error).\n    //\n    // Trigger a special error so that it can be handled separately from normal,\n    // recoverable errors.\n\n    this.trigger('appenderror');\n  };\n\n  _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) {\n    var segmentInfo = _ref7.segmentInfo,\n        type = _ref7.type,\n        initSegment = _ref7.initSegment,\n        data = _ref7.data,\n        bytes = _ref7.bytes; // If this is a re-append, bytes were already created and don't need to be recreated\n\n    if (!bytes) {\n      var segments = [data];\n      var byteLength = data.byteLength;\n\n      if (initSegment) {\n        // if the media initialization segment is changing, append it before the content\n        // segment\n        segments.unshift(initSegment);\n        byteLength += initSegment.byteLength;\n      } // Technically we should be OK appending the init segment separately, however, we\n      // haven't yet tested that, and prepending is how we have always done things.\n\n\n      bytes = concatSegments({\n        bytes: byteLength,\n        segments: segments\n      });\n    }\n\n    this.sourceUpdater_.appendBuffer({\n      segmentInfo: segmentInfo,\n      type: type,\n      bytes: bytes\n    }, this.handleAppendError_.bind(this, {\n      segmentInfo: segmentInfo,\n      type: type,\n      bytes: bytes\n    }));\n  };\n\n  _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type, requestId, segmentTimingInfo) {\n    if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {\n      return;\n    }\n\n    var segment = this.pendingSegment_.segment;\n    var timingInfoProperty = type + \"TimingInfo\";\n\n    if (!segment[timingInfoProperty]) {\n      segment[timingInfoProperty] = {};\n    }\n\n    segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;\n    segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;\n    segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;\n    segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;\n    segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode; // mainly used as a reference for debugging\n\n    segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;\n  };\n\n  _proto.appendData_ = function appendData_(segmentInfo, result) {\n    var type = result.type,\n        data = result.data;\n\n    if (!data || !data.byteLength) {\n      return;\n    }\n\n    if (type === 'audio' && this.audioDisabled_) {\n      return;\n    }\n\n    var initSegment = this.getInitSegmentAndUpdateState_({\n      type: type,\n      initSegment: result.initSegment,\n      playlist: segmentInfo.playlist,\n      map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null\n    });\n    this.appendToSourceBuffer_({\n      segmentInfo: segmentInfo,\n      type: type,\n      initSegment: initSegment,\n      data: data\n    });\n  }\n  /**\n   * load a specific segment from a request into the buffer\n   *\n   * @private\n   */\n  ;\n\n  _proto.loadSegment_ = function loadSegment_(segmentInfo) {\n    var _this4 = this;\n\n    this.state = 'WAITING';\n    this.pendingSegment_ = segmentInfo;\n    this.trimBackBuffer_(segmentInfo);\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      if (this.transmuxer_) {\n        this.transmuxer_.postMessage({\n          action: 'clearAllMp4Captions'\n        });\n      }\n    }\n\n    if (!this.hasEnoughInfoToLoad_()) {\n      this.loadQueue_.push(function () {\n        // regenerate the audioAppendStart, timestampOffset, etc as they\n        // may have changed since this function was added to the queue.\n        var options = _extends({}, segmentInfo, {\n          forceTimestampOffset: true\n        });\n\n        _extends(segmentInfo, _this4.generateSegmentInfo_(options));\n\n        _this4.isPendingTimestampOffset_ = false;\n\n        _this4.updateTransmuxerAndRequestSegment_(segmentInfo);\n      });\n      return;\n    }\n\n    this.updateTransmuxerAndRequestSegment_(segmentInfo);\n  };\n\n  _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) {\n    var _this5 = this; // We'll update the source buffer's timestamp offset once we have transmuxed data, but\n    // the transmuxer still needs to be updated before then.\n    //\n    // Even though keepOriginalTimestamps is set to true for the transmuxer, timestamp\n    // offset must be passed to the transmuxer for stream correcting adjustments.\n\n\n    if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {\n      this.gopBuffer_.length = 0; // gopsToAlignWith was set before the GOP buffer was cleared\n\n      segmentInfo.gopsToAlignWith = [];\n      this.timeMapping_ = 0; // reset values in the transmuxer since a discontinuity should start fresh\n\n      this.transmuxer_.postMessage({\n        action: 'reset'\n      });\n      this.transmuxer_.postMessage({\n        action: 'setTimestampOffset',\n        timestampOffset: segmentInfo.timestampOffset\n      });\n    }\n\n    var simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);\n    var isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);\n    var isWalkingForward = this.mediaIndex !== null;\n    var isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && // currentTimeline starts at -1, so we shouldn't end the timeline switching to 0,\n    // the first timeline\n    segmentInfo.timeline > 0;\n    var isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;\n    this.logger_(\"Requesting \" + segmentInfoString(segmentInfo)); // If there's an init segment associated with this segment, but it is not cached (identified by a lack of bytes),\n    // then this init segment has never been seen before and should be appended.\n    //\n    // At this point the content type (audio/video or both) is not yet known, but it should be safe to set\n    // both to true and leave the decision of whether to append the init segment to append time.\n\n    if (simpleSegment.map && !simpleSegment.map.bytes) {\n      this.logger_('going to request init segment.');\n      this.appendInitSegment_ = {\n        video: true,\n        audio: true\n      };\n    }\n\n    segmentInfo.abortRequests = mediaSegmentRequest({\n      xhr: this.vhs_.xhr,\n      xhrOptions: this.xhrOptions_,\n      decryptionWorker: this.decrypter_,\n      segment: simpleSegment,\n      abortFn: this.handleAbort_.bind(this, segmentInfo),\n      progressFn: this.handleProgress_.bind(this),\n      trackInfoFn: this.handleTrackInfo_.bind(this),\n      timingInfoFn: this.handleTimingInfo_.bind(this),\n      videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', segmentInfo.requestId),\n      audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', segmentInfo.requestId),\n      captionsFn: this.handleCaptions_.bind(this),\n      isEndOfTimeline: isEndOfTimeline,\n      endedTimelineFn: function endedTimelineFn() {\n        _this5.logger_('received endedtimeline callback');\n      },\n      id3Fn: this.handleId3_.bind(this),\n      dataFn: this.handleData_.bind(this),\n      doneFn: this.segmentRequestFinished_.bind(this),\n      onTransmuxerLog: function onTransmuxerLog(_ref8) {\n        var message = _ref8.message,\n            level = _ref8.level,\n            stream = _ref8.stream;\n\n        _this5.logger_(segmentInfoString(segmentInfo) + \" logged from transmuxer stream \" + stream + \" as a \" + level + \": \" + message);\n      }\n    });\n  }\n  /**\n   * trim the back buffer so that we don't have too much data\n   * in the source buffer\n   *\n   * @private\n   *\n   * @param {Object} segmentInfo - the current segment\n   */\n  ;\n\n  _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) {\n    var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n    // buffer and a very conservative \"garbage collector\"\n    // We manually clear out the old buffer to ensure\n    // we don't trigger the QuotaExceeded error\n    // on the source buffer during subsequent appends\n\n    if (removeToTime > 0) {\n      this.remove(0, removeToTime);\n    }\n  }\n  /**\n   * created a simplified copy of the segment object with just the\n   * information necessary to perform the XHR and decryption\n   *\n   * @private\n   *\n   * @param {Object} segmentInfo - the current segment\n   * @return {Object} a simplified segment object copy\n   */\n  ;\n\n  _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) {\n    var segment = segmentInfo.segment;\n    var part = segmentInfo.part;\n    var simpleSegment = {\n      resolvedUri: part ? part.resolvedUri : segment.resolvedUri,\n      byterange: part ? part.byterange : segment.byterange,\n      requestId: segmentInfo.requestId,\n      transmuxer: segmentInfo.transmuxer,\n      audioAppendStart: segmentInfo.audioAppendStart,\n      gopsToAlignWith: segmentInfo.gopsToAlignWith,\n      part: segmentInfo.part\n    };\n    var previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];\n\n    if (previousSegment && previousSegment.timeline === segment.timeline) {\n      // The baseStartTime of a segment is used to handle rollover when probing the TS\n      // segment to retrieve timing information. Since the probe only looks at the media's\n      // times (e.g., PTS and DTS values of the segment), and doesn't consider the\n      // player's time (e.g., player.currentTime()), baseStartTime should reflect the\n      // media time as well. transmuxedDecodeEnd represents the end time of a segment, in\n      // seconds of media time, so should be used here. The previous segment is used since\n      // the end of the previous segment should represent the beginning of the current\n      // segment, so long as they are on the same timeline.\n      if (previousSegment.videoTimingInfo) {\n        simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;\n      } else if (previousSegment.audioTimingInfo) {\n        simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;\n      }\n    }\n\n    if (segment.key) {\n      // if the media sequence is greater than 2^32, the IV will be incorrect\n      // assuming 10s segments, that would be about 1300 years\n      var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n      simpleSegment.key = this.segmentKey(segment.key);\n      simpleSegment.key.iv = iv;\n    }\n\n    if (segment.map) {\n      simpleSegment.map = this.initSegmentForMap(segment.map);\n    }\n\n    return simpleSegment;\n  };\n\n  _proto.saveTransferStats_ = function saveTransferStats_(stats) {\n    // every request counts as a media request even if it has been aborted\n    // or canceled due to a timeout\n    this.mediaRequests += 1;\n\n    if (stats) {\n      this.mediaBytesTransferred += stats.bytesReceived;\n      this.mediaTransferDuration += stats.roundTripTime;\n    }\n  };\n\n  _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration, stats) {\n    // byteLength will be used for throughput, and should be based on bytes receieved,\n    // which we only know at the end of the request and should reflect total bytes\n    // downloaded rather than just bytes processed from components of the segment\n    this.pendingSegment_.byteLength = stats.bytesReceived;\n\n    if (duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n      this.logger_(\"Ignoring segment's bandwidth because its duration of \" + duration + (\" is less than the min to record \" + MIN_SEGMENT_DURATION_TO_SAVE_STATS));\n      return;\n    }\n\n    this.bandwidth = stats.bandwidth;\n    this.roundTrip = stats.roundTripTime;\n  };\n\n  _proto.handleTimeout_ = function handleTimeout_() {\n    // although the VTT segment loader bandwidth isn't really used, it's good to\n    // maintain functinality between segment loaders\n    this.mediaRequestsTimedout += 1;\n    this.bandwidth = 1;\n    this.roundTrip = NaN;\n    this.trigger('bandwidthupdate');\n  }\n  /**\n   * Handle the callback from the segmentRequest function and set the\n   * associated SegmentLoader state and errors if necessary\n   *\n   * @private\n   */\n  ;\n\n  _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {\n    // TODO handle special cases, e.g., muxed audio/video but only audio in the segment\n    // check the call queue directly since this function doesn't need to deal with any\n    // data, and can continue even if the source buffers are not set up and we didn't get\n    // any data from the segment\n    if (this.callQueue_.length) {\n      this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));\n      return;\n    }\n\n    this.saveTransferStats_(simpleSegment.stats); // The request was aborted and the SegmentLoader has already been reset\n\n    if (!this.pendingSegment_) {\n      return;\n    } // the request was aborted and the SegmentLoader has already started\n    // another request. this can happen when the timeout for an aborted\n    // request triggers due to a limitation in the XHR library\n    // do not count this as any sort of request or we risk double-counting\n\n\n    if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n      return;\n    } // an error occurred from the active pendingSegment_ so reset everything\n\n\n    if (error) {\n      this.pendingSegment_ = null;\n      this.state = 'READY'; // aborts are not a true error condition and nothing corrective needs to be done\n\n      if (error.code === REQUEST_ERRORS.ABORTED) {\n        return;\n      }\n\n      this.pause(); // the error is really just that at least one of the requests timed-out\n      // set the bandwidth to a very low value and trigger an ABR switch to\n      // take emergency action\n\n      if (error.code === REQUEST_ERRORS.TIMEOUT) {\n        this.handleTimeout_();\n        return;\n      } // if control-flow has arrived here, then the error is real\n      // emit an error event to blacklist the current playlist\n\n\n      this.mediaRequestsErrored += 1;\n      this.error(error);\n      this.trigger('error');\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // the response was a success so set any bandwidth stats the request\n    // generated for ABR purposes\n\n    this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);\n    segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;\n\n    if (result.gopInfo) {\n      this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);\n    } // Although we may have already started appending on progress, we shouldn't switch the\n    // state away from loading until we are officially done loading the segment data.\n\n\n    this.state = 'APPENDING'; // used for testing\n\n    this.trigger('appending');\n    this.waitForAppendsToComplete_(segmentInfo);\n  };\n\n  _proto.setTimeMapping_ = function setTimeMapping_(timeline) {\n    var timelineMapping = this.syncController_.mappingForTimeline(timeline);\n\n    if (timelineMapping !== null) {\n      this.timeMapping_ = timelineMapping;\n    }\n  };\n\n  _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) {\n    if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n      this.mediaSecondsLoaded += segment.end - segment.start;\n    } else {\n      this.mediaSecondsLoaded += segment.duration;\n    }\n  };\n\n  _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset) {\n    if (timestampOffset === null) {\n      return false;\n    } // note that we're potentially using the same timestamp offset for both video and\n    // audio\n\n\n    if (this.loaderType_ === 'main' && timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n      return true;\n    }\n\n    if (!this.audioDisabled_ && timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n      return true;\n    }\n\n    return false;\n  };\n\n  _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) {\n    var currentStart = _ref9.currentStart,\n        playlist = _ref9.playlist,\n        mediaIndex = _ref9.mediaIndex,\n        firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData,\n        currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset,\n        useVideoTimingInfo = _ref9.useVideoTimingInfo,\n        videoTimingInfo = _ref9.videoTimingInfo,\n        audioTimingInfo = _ref9.audioTimingInfo;\n\n    if (typeof currentStart !== 'undefined') {\n      // if start was set once, keep using it\n      return currentStart;\n    }\n\n    if (!useVideoTimingInfo) {\n      return audioTimingInfo.start;\n    }\n\n    var previousSegment = playlist.segments[mediaIndex - 1]; // The start of a segment should be the start of the first full frame contained\n    // within that segment. Since the transmuxer maintains a cache of incomplete data\n    // from and/or the last frame seen, the start time may reflect a frame that starts\n    // in the previous segment. Check for that case and ensure the start time is\n    // accurate for the segment.\n\n    if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === 'undefined' || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {\n      return firstVideoFrameTimeForData;\n    }\n\n    return videoTimingInfo.start;\n  };\n\n  _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) {\n    var trackInfo = this.getCurrentMediaInfo_(segmentInfo);\n\n    if (!trackInfo) {\n      this.error({\n        message: 'No starting media returned, likely due to an unsupported media format.',\n        blacklistDuration: Infinity\n      });\n      this.trigger('error');\n      return;\n    } // Although transmuxing is done, appends may not yet be finished. Throw a marker\n    // on each queue this loader is responsible for to ensure that the appends are\n    // complete.\n\n\n    var hasAudio = trackInfo.hasAudio,\n        hasVideo = trackInfo.hasVideo,\n        isMuxed = trackInfo.isMuxed;\n    var waitForVideo = this.loaderType_ === 'main' && hasVideo;\n    var waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed;\n    segmentInfo.waitingOnAppends = 0; // segments with no data\n\n    if (!segmentInfo.hasAppendedData_) {\n      if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === 'number') {\n        // When there's no audio or video data in the segment, there's no audio or video\n        // timing information.\n        //\n        // If there's no audio or video timing information, then the timestamp offset\n        // can't be adjusted to the appropriate value for the transmuxer and source\n        // buffers.\n        //\n        // Therefore, the next segment should be used to set the timestamp offset.\n        this.isPendingTimestampOffset_ = true;\n      } // override settings for metadata only segments\n\n\n      segmentInfo.timingInfo = {\n        start: 0\n      };\n      segmentInfo.waitingOnAppends++;\n\n      if (!this.isPendingTimestampOffset_) {\n        // update the timestampoffset\n        this.updateSourceBufferTimestampOffset_(segmentInfo); // make sure the metadata queue is processed even though we have\n        // no video/audio data.\n\n        this.processMetadataQueue_();\n      } // append is \"done\" instantly with no data.\n\n\n      this.checkAppendsDone_(segmentInfo);\n      return;\n    } // Since source updater could call back synchronously, do the increments first.\n\n\n    if (waitForVideo) {\n      segmentInfo.waitingOnAppends++;\n    }\n\n    if (waitForAudio) {\n      segmentInfo.waitingOnAppends++;\n    }\n\n    if (waitForVideo) {\n      this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n    }\n\n    if (waitForAudio) {\n      this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n    }\n  };\n\n  _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) {\n    if (this.checkForAbort_(segmentInfo.requestId)) {\n      return;\n    }\n\n    segmentInfo.waitingOnAppends--;\n\n    if (segmentInfo.waitingOnAppends === 0) {\n      this.handleAppendsDone_();\n    }\n  };\n\n  _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) {\n    var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);\n\n    if (illegalMediaSwitchError) {\n      this.error({\n        message: illegalMediaSwitchError,\n        blacklistDuration: Infinity\n      });\n      this.trigger('error');\n      return true;\n    }\n\n    return false;\n  };\n\n  _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) {\n    if (segmentInfo.timestampOffset === null || // we don't yet have the start for whatever media type (video or audio) has\n    // priority, timing-wise, so we must wait\n    typeof segmentInfo.timingInfo.start !== 'number' || // already updated the timestamp offset for this segment\n    segmentInfo.changedTimestampOffset || // the alt audio loader should not be responsible for setting the timestamp offset\n    this.loaderType_ !== 'main') {\n      return;\n    }\n\n    var didChange = false; // Primary timing goes by video, and audio is trimmed in the transmuxer, meaning that\n    // the timing info here comes from video. In the event that the audio is longer than\n    // the video, this will trim the start of the audio.\n    // This also trims any offset from 0 at the beginning of the media\n\n    segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({\n      videoTimingInfo: segmentInfo.segment.videoTimingInfo,\n      audioTimingInfo: segmentInfo.segment.audioTimingInfo,\n      timingInfo: segmentInfo.timingInfo\n    }); // In the event that there are part segment downloads, each will try to update the\n    // timestamp offset. Retaining this bit of state prevents us from updating in the\n    // future (within the same segment), however, there may be a better way to handle it.\n\n    segmentInfo.changedTimestampOffset = true;\n\n    if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n      this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);\n      didChange = true;\n    }\n\n    if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n      this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);\n      didChange = true;\n    }\n\n    if (didChange) {\n      this.trigger('timestampoffset');\n    }\n  };\n\n  _proto.getSegmentStartTimeForTimestampOffsetCalculation_ = function getSegmentStartTimeForTimestampOffsetCalculation_(_ref10) {\n    var videoTimingInfo = _ref10.videoTimingInfo,\n        audioTimingInfo = _ref10.audioTimingInfo,\n        timingInfo = _ref10.timingInfo;\n\n    if (!this.useDtsForTimestampOffset_) {\n      return timingInfo.start;\n    }\n\n    if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === 'number') {\n      return videoTimingInfo.transmuxedDecodeStart;\n    } // handle audio only\n\n\n    if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === 'number') {\n      return audioTimingInfo.transmuxedDecodeStart;\n    } // handle content not transmuxed (e.g., MP4)\n\n\n    return timingInfo.start;\n  };\n\n  _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) {\n    segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n    var trackInfo = this.getMediaInfo_();\n    var useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n    var prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;\n\n    if (!prioritizedTimingInfo) {\n      return;\n    }\n\n    segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === 'number' ? // End time may not exist in a case where we aren't parsing the full segment (one\n    // current example is the case of fmp4), so use the rough duration to calculate an\n    // end time.\n    prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;\n  }\n  /**\n   * callback to run when appendBuffer is finished. detects if we are\n   * in a good state to do things with the data we got, or if we need\n   * to wait for more\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleAppendsDone_ = function handleAppendsDone_() {\n    // appendsdone can cause an abort\n    if (this.pendingSegment_) {\n      this.trigger('appendsdone');\n    }\n\n    if (!this.pendingSegment_) {\n      this.state = 'READY'; // TODO should this move into this.checkForAbort to speed up requests post abort in\n      // all appending cases?\n\n      if (!this.paused()) {\n        this.monitorBuffer_();\n      }\n\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // Now that the end of the segment has been reached, we can set the end time. It's\n    // best to wait until all appends are done so we're sure that the primary media is\n    // finished (and we have its end time).\n\n    this.updateTimingInfoEnd_(segmentInfo);\n\n    if (this.shouldSaveSegmentTimingInfo_) {\n      // Timeline mappings should only be saved for the main loader. This is for multiple\n      // reasons:\n      //\n      // 1) Only one mapping is saved per timeline, meaning that if both the audio loader\n      //    and the main loader try to save the timeline mapping, whichever comes later\n      //    will overwrite the first. In theory this is OK, as the mappings should be the\n      //    same, however, it breaks for (2)\n      // 2) In the event of a live stream, the initial live point will make for a somewhat\n      //    arbitrary mapping. If audio and video streams are not perfectly in-sync, then\n      //    the mapping will be off for one of the streams, dependent on which one was\n      //    first saved (see (1)).\n      // 3) Primary timing goes by video in VHS, so the mapping should be video.\n      //\n      // Since the audio loader will wait for the main loader to load the first segment,\n      // the main loader will save the first timeline mapping, and ensure that there won't\n      // be a case where audio loads two segments without saving a mapping (thus leading\n      // to missing segment timing info).\n      this.syncController_.saveSegmentTimingInfo({\n        segmentInfo: segmentInfo,\n        shouldSaveTimelineMapping: this.loaderType_ === 'main'\n      });\n    }\n\n    var segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);\n\n    if (segmentDurationMessage) {\n      if (segmentDurationMessage.severity === 'warn') {\n        videojs.log.warn(segmentDurationMessage.message);\n      } else {\n        this.logger_(segmentDurationMessage.message);\n      }\n    }\n\n    this.recordThroughput_(segmentInfo);\n    this.pendingSegment_ = null;\n    this.state = 'READY';\n\n    if (segmentInfo.isSyncRequest) {\n      this.trigger('syncinfoupdate'); // if the sync request was not appended\n      // then it was not the correct segment.\n      // throw it away and use the data it gave us\n      // to get the correct one.\n\n      if (!segmentInfo.hasAppendedData_) {\n        this.logger_(\"Throwing away un-appended sync request \" + segmentInfoString(segmentInfo));\n        return;\n      }\n    }\n\n    this.logger_(\"Appended \" + segmentInfoString(segmentInfo));\n    this.addSegmentMetadataCue_(segmentInfo);\n    this.fetchAtBuffer_ = true;\n\n    if (this.currentTimeline_ !== segmentInfo.timeline) {\n      this.timelineChangeController_.lastTimelineChange({\n        type: this.loaderType_,\n        from: this.currentTimeline_,\n        to: segmentInfo.timeline\n      }); // If audio is not disabled, the main segment loader is responsible for updating\n      // the audio timeline as well. If the content is video only, this won't have any\n      // impact.\n\n      if (this.loaderType_ === 'main' && !this.audioDisabled_) {\n        this.timelineChangeController_.lastTimelineChange({\n          type: 'audio',\n          from: this.currentTimeline_,\n          to: segmentInfo.timeline\n        });\n      }\n    }\n\n    this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n    // the following conditional otherwise it may consider this a bad \"guess\"\n    // and attempt to resync when the post-update seekable window and live\n    // point would mean that this was the perfect segment to fetch\n\n    this.trigger('syncinfoupdate');\n    var segment = segmentInfo.segment;\n    var part = segmentInfo.part;\n    var badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;\n    var badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3; // If we previously appended a segment/part that ends more than 3 part/targetDurations before\n    // the currentTime_ that means that our conservative guess was too conservative.\n    // In that case, reset the loader state so that we try to use any information gained\n    // from the previous request to create a new, more accurate, sync-point.\n\n    if (badSegmentGuess || badPartGuess) {\n      this.logger_(\"bad \" + (badSegmentGuess ? 'segment' : 'part') + \" \" + segmentInfoString(segmentInfo));\n      this.resetEverything();\n      return;\n    }\n\n    var isWalkingForward = this.mediaIndex !== null; // Don't do a rendition switch unless we have enough time to get a sync segment\n    // and conservatively guess\n\n    if (isWalkingForward) {\n      this.trigger('bandwidthupdate');\n    }\n\n    this.trigger('progress');\n    this.mediaIndex = segmentInfo.mediaIndex;\n    this.partIndex = segmentInfo.partIndex; // any time an update finishes and the last segment is in the\n    // buffer, end the stream. this ensures the \"ended\" event will\n    // fire if playback reaches that point.\n\n    if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {\n      this.endOfStream();\n    } // used for testing\n\n\n    this.trigger('appended');\n\n    if (segmentInfo.hasAppendedData_) {\n      this.mediaAppends++;\n    }\n\n    if (!this.paused()) {\n      this.monitorBuffer_();\n    }\n  }\n  /**\n   * Records the current throughput of the decrypt, transmux, and append\n   * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n   * moving average of the throughput. `throughput.count` is the number of\n   * data points in the average.\n   *\n   * @private\n   * @param {Object} segmentInfo the object returned by loadSegment\n   */\n  ;\n\n  _proto.recordThroughput_ = function recordThroughput_(segmentInfo) {\n    if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n      this.logger_(\"Ignoring segment's throughput because its duration of \" + segmentInfo.duration + (\" is less than the min to record \" + MIN_SEGMENT_DURATION_TO_SAVE_STATS));\n      return;\n    }\n\n    var rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n    // by zero in the case where the throughput is ridiculously high\n\n    var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n    var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n    //   newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n    this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n  }\n  /**\n   * Adds a cue to the segment-metadata track with some metadata information about the\n   * segment\n   *\n   * @private\n   * @param {Object} segmentInfo\n   *        the object returned by loadSegment\n   * @method addSegmentMetadataCue_\n   */\n  ;\n\n  _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) {\n    if (!this.segmentMetadataTrack_) {\n      return;\n    }\n\n    var segment = segmentInfo.segment;\n    var start = segment.start;\n    var end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n    if (!finite(start) || !finite(end)) {\n      return;\n    }\n\n    removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n    var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n    var value = {\n      custom: segment.custom,\n      dateTimeObject: segment.dateTimeObject,\n      dateTimeString: segment.dateTimeString,\n      bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n      resolution: segmentInfo.playlist.attributes.RESOLUTION,\n      codecs: segmentInfo.playlist.attributes.CODECS,\n      byteLength: segmentInfo.byteLength,\n      uri: segmentInfo.uri,\n      timeline: segmentInfo.timeline,\n      playlist: segmentInfo.playlist.id,\n      start: start,\n      end: end\n    };\n    var data = JSON.stringify(value);\n    var cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n    // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n    cue.value = value;\n    this.segmentMetadataTrack_.addCue(cue);\n  };\n\n  return SegmentLoader;\n}(videojs.EventTarget);\n\nfunction noop() {}\n\nvar toTitleCase = function toTitleCase(string) {\n  if (typeof string !== 'string') {\n    return string;\n  }\n\n  return string.replace(/./, function (w) {\n    return w.toUpperCase();\n  });\n};\n\nvar bufferTypes = ['video', 'audio'];\n\nvar _updating = function updating(type, sourceUpdater) {\n  var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n  return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type];\n};\n\nvar nextQueueIndexOfType = function nextQueueIndexOfType(type, queue) {\n  for (var i = 0; i < queue.length; i++) {\n    var queueEntry = queue[i];\n\n    if (queueEntry.type === 'mediaSource') {\n      // If the next entry is a media source entry (uses multiple source buffers), block\n      // processing to allow it to go through first.\n      return null;\n    }\n\n    if (queueEntry.type === type) {\n      return i;\n    }\n  }\n\n  return null;\n};\n\nvar shiftQueue = function shiftQueue(type, sourceUpdater) {\n  if (sourceUpdater.queue.length === 0) {\n    return;\n  }\n\n  var queueIndex = 0;\n  var queueEntry = sourceUpdater.queue[queueIndex];\n\n  if (queueEntry.type === 'mediaSource') {\n    if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== 'closed') {\n      sourceUpdater.queue.shift();\n      queueEntry.action(sourceUpdater);\n\n      if (queueEntry.doneFn) {\n        queueEntry.doneFn();\n      } // Only specific source buffer actions must wait for async updateend events. Media\n      // Source actions process synchronously. Therefore, both audio and video source\n      // buffers are now clear to process the next queue entries.\n\n\n      shiftQueue('audio', sourceUpdater);\n      shiftQueue('video', sourceUpdater);\n    } // Media Source actions require both source buffers, so if the media source action\n    // couldn't process yet (because one or both source buffers are busy), block other\n    // queue actions until both are available and the media source action can process.\n\n\n    return;\n  }\n\n  if (type === 'mediaSource') {\n    // If the queue was shifted by a media source action (this happens when pushing a\n    // media source action onto the queue), then it wasn't from an updateend event from an\n    // audio or video source buffer, so there's no change from previous state, and no\n    // processing should be done.\n    return;\n  } // Media source queue entries don't need to consider whether the source updater is\n  // started (i.e., source buffers are created) as they don't need the source buffers, but\n  // source buffer queue entries do.\n\n\n  if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === 'closed' || _updating(type, sourceUpdater)) {\n    return;\n  }\n\n  if (queueEntry.type !== type) {\n    queueIndex = nextQueueIndexOfType(type, sourceUpdater.queue);\n\n    if (queueIndex === null) {\n      // Either there's no queue entry that uses this source buffer type in the queue, or\n      // there's a media source queue entry before the next entry of this type, in which\n      // case wait for that action to process first.\n      return;\n    }\n\n    queueEntry = sourceUpdater.queue[queueIndex];\n  }\n\n  sourceUpdater.queue.splice(queueIndex, 1); // Keep a record that this source buffer type is in use.\n  //\n  // The queue pending operation must be set before the action is performed in the event\n  // that the action results in a synchronous event that is acted upon. For instance, if\n  // an exception is thrown that can be handled, it's possible that new actions will be\n  // appended to an empty queue and immediately executed, but would not have the correct\n  // pending information if this property was set after the action was performed.\n\n  sourceUpdater.queuePending[type] = queueEntry;\n  queueEntry.action(type, sourceUpdater);\n\n  if (!queueEntry.doneFn) {\n    // synchronous operation, process next entry\n    sourceUpdater.queuePending[type] = null;\n    shiftQueue(type, sourceUpdater);\n    return;\n  }\n};\n\nvar cleanupBuffer = function cleanupBuffer(type, sourceUpdater) {\n  var buffer = sourceUpdater[type + \"Buffer\"];\n  var titleType = toTitleCase(type);\n\n  if (!buffer) {\n    return;\n  }\n\n  buffer.removeEventListener('updateend', sourceUpdater[\"on\" + titleType + \"UpdateEnd_\"]);\n  buffer.removeEventListener('error', sourceUpdater[\"on\" + titleType + \"Error_\"]);\n  sourceUpdater.codecs[type] = null;\n  sourceUpdater[type + \"Buffer\"] = null;\n};\n\nvar inSourceBuffers = function inSourceBuffers(mediaSource, sourceBuffer) {\n  return mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;\n};\n\nvar actions = {\n  appendBuffer: function appendBuffer(bytes, segmentInfo, onError) {\n    return function (type, sourceUpdater) {\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"Appending segment \" + segmentInfo.mediaIndex + \"'s \" + bytes.length + \" bytes to \" + type + \"Buffer\");\n\n      try {\n        sourceBuffer.appendBuffer(bytes);\n      } catch (e) {\n        sourceUpdater.logger_(\"Error with code \" + e.code + \" \" + (e.code === QUOTA_EXCEEDED_ERR ? '(QUOTA_EXCEEDED_ERR) ' : '') + (\"when appending segment \" + segmentInfo.mediaIndex + \" to \" + type + \"Buffer\"));\n        sourceUpdater.queuePending[type] = null;\n        onError(e);\n      }\n    };\n  },\n  remove: function remove(start, end) {\n    return function (type, sourceUpdater) {\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"Removing \" + start + \" to \" + end + \" from \" + type + \"Buffer\");\n\n      try {\n        sourceBuffer.remove(start, end);\n      } catch (e) {\n        sourceUpdater.logger_(\"Remove \" + start + \" to \" + end + \" from \" + type + \"Buffer failed\");\n      }\n    };\n  },\n  timestampOffset: function timestampOffset(offset) {\n    return function (type, sourceUpdater) {\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"Setting \" + type + \"timestampOffset to \" + offset);\n      sourceBuffer.timestampOffset = offset;\n    };\n  },\n  callback: function callback(_callback) {\n    return function (type, sourceUpdater) {\n      _callback();\n    };\n  },\n  endOfStream: function endOfStream(error) {\n    return function (sourceUpdater) {\n      if (sourceUpdater.mediaSource.readyState !== 'open') {\n        return;\n      }\n\n      sourceUpdater.logger_(\"Calling mediaSource endOfStream(\" + (error || '') + \")\");\n\n      try {\n        sourceUpdater.mediaSource.endOfStream(error);\n      } catch (e) {\n        videojs.log.warn('Failed to call media source endOfStream', e);\n      }\n    };\n  },\n  duration: function duration(_duration) {\n    return function (sourceUpdater) {\n      sourceUpdater.logger_(\"Setting mediaSource duration to \" + _duration);\n\n      try {\n        sourceUpdater.mediaSource.duration = _duration;\n      } catch (e) {\n        videojs.log.warn('Failed to set media source duration', e);\n      }\n    };\n  },\n  abort: function abort() {\n    return function (type, sourceUpdater) {\n      if (sourceUpdater.mediaSource.readyState !== 'open') {\n        return;\n      }\n\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"calling abort on \" + type + \"Buffer\");\n\n      try {\n        sourceBuffer.abort();\n      } catch (e) {\n        videojs.log.warn(\"Failed to abort on \" + type + \"Buffer\", e);\n      }\n    };\n  },\n  addSourceBuffer: function addSourceBuffer(type, codec) {\n    return function (sourceUpdater) {\n      var titleType = toTitleCase(type);\n      var mime = getMimeForCodec(codec);\n      sourceUpdater.logger_(\"Adding \" + type + \"Buffer with codec \" + codec + \" to mediaSource\");\n      var sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);\n      sourceBuffer.addEventListener('updateend', sourceUpdater[\"on\" + titleType + \"UpdateEnd_\"]);\n      sourceBuffer.addEventListener('error', sourceUpdater[\"on\" + titleType + \"Error_\"]);\n      sourceUpdater.codecs[type] = codec;\n      sourceUpdater[type + \"Buffer\"] = sourceBuffer;\n    };\n  },\n  removeSourceBuffer: function removeSourceBuffer(type) {\n    return function (sourceUpdater) {\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n      cleanupBuffer(type, sourceUpdater); // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"Removing \" + type + \"Buffer with codec \" + sourceUpdater.codecs[type] + \" from mediaSource\");\n\n      try {\n        sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);\n      } catch (e) {\n        videojs.log.warn(\"Failed to removeSourceBuffer \" + type + \"Buffer\", e);\n      }\n    };\n  },\n  changeType: function changeType(codec) {\n    return function (type, sourceUpdater) {\n      var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n      var mime = getMimeForCodec(codec); // can't do anything if the media source / source buffer is null\n      // or the media source does not contain this source buffer.\n\n      if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n        return;\n      } // do not update codec if we don't need to.\n\n\n      if (sourceUpdater.codecs[type] === codec) {\n        return;\n      }\n\n      sourceUpdater.logger_(\"changing \" + type + \"Buffer codec from \" + sourceUpdater.codecs[type] + \" to \" + codec);\n      sourceBuffer.changeType(mime);\n      sourceUpdater.codecs[type] = codec;\n    };\n  }\n};\n\nvar pushQueue = function pushQueue(_ref) {\n  var type = _ref.type,\n      sourceUpdater = _ref.sourceUpdater,\n      action = _ref.action,\n      doneFn = _ref.doneFn,\n      name = _ref.name;\n  sourceUpdater.queue.push({\n    type: type,\n    action: action,\n    doneFn: doneFn,\n    name: name\n  });\n  shiftQueue(type, sourceUpdater);\n};\n\nvar onUpdateend = function onUpdateend(type, sourceUpdater) {\n  return function (e) {\n    // Although there should, in theory, be a pending action for any updateend receieved,\n    // there are some actions that may trigger updateend events without set definitions in\n    // the w3c spec. For instance, setting the duration on the media source may trigger\n    // updateend events on source buffers. This does not appear to be in the spec. As such,\n    // if we encounter an updateend without a corresponding pending action from our queue\n    // for that source buffer type, process the next action.\n    if (sourceUpdater.queuePending[type]) {\n      var doneFn = sourceUpdater.queuePending[type].doneFn;\n      sourceUpdater.queuePending[type] = null;\n\n      if (doneFn) {\n        // if there's an error, report it\n        doneFn(sourceUpdater[type + \"Error_\"]);\n      }\n    }\n\n    shiftQueue(type, sourceUpdater);\n  };\n};\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the SourceBuffer from\n * @param {string} mimeType the desired MIME type of the underlying SourceBuffer\n */\n\n\nvar SourceUpdater = /*#__PURE__*/function (_videojs$EventTarget) {\n  _inheritsLoose(SourceUpdater, _videojs$EventTarget);\n\n  function SourceUpdater(mediaSource) {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this;\n    _this.mediaSource = mediaSource;\n\n    _this.sourceopenListener_ = function () {\n      return shiftQueue('mediaSource', _assertThisInitialized(_this));\n    };\n\n    _this.mediaSource.addEventListener('sourceopen', _this.sourceopenListener_);\n\n    _this.logger_ = logger('SourceUpdater'); // initial timestamp offset is 0\n\n    _this.audioTimestampOffset_ = 0;\n    _this.videoTimestampOffset_ = 0;\n    _this.queue = [];\n    _this.queuePending = {\n      audio: null,\n      video: null\n    };\n    _this.delayedAudioAppendQueue_ = [];\n    _this.videoAppendQueued_ = false;\n    _this.codecs = {};\n    _this.onVideoUpdateEnd_ = onUpdateend('video', _assertThisInitialized(_this));\n    _this.onAudioUpdateEnd_ = onUpdateend('audio', _assertThisInitialized(_this));\n\n    _this.onVideoError_ = function (e) {\n      // used for debugging\n      _this.videoError_ = e;\n    };\n\n    _this.onAudioError_ = function (e) {\n      // used for debugging\n      _this.audioError_ = e;\n    };\n\n    _this.createdSourceBuffers_ = false;\n    _this.initializedEme_ = false;\n    _this.triggeredReady_ = false;\n    return _this;\n  }\n\n  var _proto = SourceUpdater.prototype;\n\n  _proto.initializedEme = function initializedEme() {\n    this.initializedEme_ = true;\n    this.triggerReady();\n  };\n\n  _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() {\n    // if false, likely waiting on one of the segment loaders to get enough data to create\n    // source buffers\n    return this.createdSourceBuffers_;\n  };\n\n  _proto.hasInitializedAnyEme = function hasInitializedAnyEme() {\n    return this.initializedEme_;\n  };\n\n  _proto.ready = function ready() {\n    return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();\n  };\n\n  _proto.createSourceBuffers = function createSourceBuffers(codecs) {\n    if (this.hasCreatedSourceBuffers()) {\n      // already created them before\n      return;\n    } // the intial addOrChangeSourceBuffers will always be\n    // two add buffers.\n\n\n    this.addOrChangeSourceBuffers(codecs);\n    this.createdSourceBuffers_ = true;\n    this.trigger('createdsourcebuffers');\n    this.triggerReady();\n  };\n\n  _proto.triggerReady = function triggerReady() {\n    // only allow ready to be triggered once, this prevents the case\n    // where:\n    // 1. we trigger createdsourcebuffers\n    // 2. ie 11 synchronously initializates eme\n    // 3. the synchronous initialization causes us to trigger ready\n    // 4. We go back to the ready check in createSourceBuffers and ready is triggered again.\n    if (this.ready() && !this.triggeredReady_) {\n      this.triggeredReady_ = true;\n      this.trigger('ready');\n    }\n  }\n  /**\n   * Add a type of source buffer to the media source.\n   *\n   * @param {string} type\n   *        The type of source buffer to add.\n   *\n   * @param {string} codec\n   *        The codec to add the source buffer with.\n   */\n  ;\n\n  _proto.addSourceBuffer = function addSourceBuffer(type, codec) {\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.addSourceBuffer(type, codec),\n      name: 'addSourceBuffer'\n    });\n  }\n  /**\n   * call abort on a source buffer.\n   *\n   * @param {string} type\n   *        The type of source buffer to call abort on.\n   */\n  ;\n\n  _proto.abort = function abort(type) {\n    pushQueue({\n      type: type,\n      sourceUpdater: this,\n      action: actions.abort(type),\n      name: 'abort'\n    });\n  }\n  /**\n   * Call removeSourceBuffer and remove a specific type\n   * of source buffer on the mediaSource.\n   *\n   * @param {string} type\n   *        The type of source buffer to remove.\n   */\n  ;\n\n  _proto.removeSourceBuffer = function removeSourceBuffer(type) {\n    if (!this.canRemoveSourceBuffer()) {\n      videojs.log.error('removeSourceBuffer is not supported!');\n      return;\n    }\n\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.removeSourceBuffer(type),\n      name: 'removeSourceBuffer'\n    });\n  }\n  /**\n   * Whether or not the removeSourceBuffer function is supported\n   * on the mediaSource.\n   *\n   * @return {boolean}\n   *          if removeSourceBuffer can be called.\n   */\n  ;\n\n  _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() {\n    // IE reports that it supports removeSourceBuffer, but often throws\n    // errors when attempting to use the function. So we report that it\n    // does not support removeSourceBuffer. As of Firefox 83 removeSourceBuffer\n    // throws errors, so we report that it does not support this as well.\n    return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && window$1.MediaSource && window$1.MediaSource.prototype && typeof window$1.MediaSource.prototype.removeSourceBuffer === 'function';\n  }\n  /**\n   * Whether or not the changeType function is supported\n   * on our SourceBuffers.\n   *\n   * @return {boolean}\n   *         if changeType can be called.\n   */\n  ;\n\n  SourceUpdater.canChangeType = function canChangeType() {\n    return window$1.SourceBuffer && window$1.SourceBuffer.prototype && typeof window$1.SourceBuffer.prototype.changeType === 'function';\n  }\n  /**\n   * Whether or not the changeType function is supported\n   * on our SourceBuffers.\n   *\n   * @return {boolean}\n   *         if changeType can be called.\n   */\n  ;\n\n  _proto.canChangeType = function canChangeType() {\n    return this.constructor.canChangeType();\n  }\n  /**\n   * Call the changeType function on a source buffer, given the code and type.\n   *\n   * @param {string} type\n   *        The type of source buffer to call changeType on.\n   *\n   * @param {string} codec\n   *        The codec string to change type with on the source buffer.\n   */\n  ;\n\n  _proto.changeType = function changeType(type, codec) {\n    if (!this.canChangeType()) {\n      videojs.log.error('changeType is not supported!');\n      return;\n    }\n\n    pushQueue({\n      type: type,\n      sourceUpdater: this,\n      action: actions.changeType(codec),\n      name: 'changeType'\n    });\n  }\n  /**\n   * Add source buffers with a codec or, if they are already created,\n   * call changeType on source buffers using changeType.\n   *\n   * @param {Object} codecs\n   *        Codecs to switch to\n   */\n  ;\n\n  _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) {\n    var _this2 = this;\n\n    if (!codecs || typeof codecs !== 'object' || Object.keys(codecs).length === 0) {\n      throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs');\n    }\n\n    Object.keys(codecs).forEach(function (type) {\n      var codec = codecs[type];\n\n      if (!_this2.hasCreatedSourceBuffers()) {\n        return _this2.addSourceBuffer(type, codec);\n      }\n\n      if (_this2.canChangeType()) {\n        _this2.changeType(type, codec);\n      }\n    });\n  }\n  /**\n   * Queue an update to append an ArrayBuffer.\n   *\n   * @param {MediaObject} object containing audioBytes and/or videoBytes\n   * @param {Function} done the function to call when done\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n   */\n  ;\n\n  _proto.appendBuffer = function appendBuffer(options, doneFn) {\n    var _this3 = this;\n\n    var segmentInfo = options.segmentInfo,\n        type = options.type,\n        bytes = options.bytes;\n    this.processedAppend_ = true;\n\n    if (type === 'audio' && this.videoBuffer && !this.videoAppendQueued_) {\n      this.delayedAudioAppendQueue_.push([options, doneFn]);\n      this.logger_(\"delayed audio append of \" + bytes.length + \" until video append\");\n      return;\n    } // In the case of certain errors, for instance, QUOTA_EXCEEDED_ERR, updateend will\n    // not be fired. This means that the queue will be blocked until the next action\n    // taken by the segment-loader. Provide a mechanism for segment-loader to handle\n    // these errors by calling the doneFn with the specific error.\n\n\n    var onError = doneFn;\n    pushQueue({\n      type: type,\n      sourceUpdater: this,\n      action: actions.appendBuffer(bytes, segmentInfo || {\n        mediaIndex: -1\n      }, onError),\n      doneFn: doneFn,\n      name: 'appendBuffer'\n    });\n\n    if (type === 'video') {\n      this.videoAppendQueued_ = true;\n\n      if (!this.delayedAudioAppendQueue_.length) {\n        return;\n      }\n\n      var queue = this.delayedAudioAppendQueue_.slice();\n      this.logger_(\"queuing delayed audio \" + queue.length + \" appendBuffers\");\n      this.delayedAudioAppendQueue_.length = 0;\n      queue.forEach(function (que) {\n        _this3.appendBuffer.apply(_this3, que);\n      });\n    }\n  }\n  /**\n   * Get the audio buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         The audio buffer's buffered time range\n   */\n  ;\n\n  _proto.audioBuffered = function audioBuffered() {\n    // no media source/source buffer or it isn't in the media sources\n    // source buffer list\n    if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {\n      return videojs.createTimeRange();\n    }\n\n    return this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange();\n  }\n  /**\n   * Get the video buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         The video buffer's buffered time range\n   */\n  ;\n\n  _proto.videoBuffered = function videoBuffered() {\n    // no media source/source buffer or it isn't in the media sources\n    // source buffer list\n    if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {\n      return videojs.createTimeRange();\n    }\n\n    return this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange();\n  }\n  /**\n   * Get a combined video/audio buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         the combined time range\n   */\n  ;\n\n  _proto.buffered = function buffered() {\n    var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;\n    var audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;\n\n    if (audio && !video) {\n      return this.audioBuffered();\n    }\n\n    if (video && !audio) {\n      return this.videoBuffered();\n    }\n\n    return bufferIntersection(this.audioBuffered(), this.videoBuffered());\n  }\n  /**\n   * Add a callback to the queue that will set duration on the mediaSource.\n   *\n   * @param {number} duration\n   *        The duration to set\n   *\n   * @param {Function} [doneFn]\n   *        function to run after duration has been set.\n   */\n  ;\n\n  _proto.setDuration = function setDuration(duration, doneFn) {\n    if (doneFn === void 0) {\n      doneFn = noop;\n    } // In order to set the duration on the media source, it's necessary to wait for all\n    // source buffers to no longer be updating. \"If the updating attribute equals true on\n    // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n    // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.duration(duration),\n      name: 'duration',\n      doneFn: doneFn\n    });\n  }\n  /**\n   * Add a mediaSource endOfStream call to the queue\n   *\n   * @param {Error} [error]\n   *        Call endOfStream with an error\n   *\n   * @param {Function} [doneFn]\n   *        A function that should be called when the\n   *        endOfStream call has finished.\n   */\n  ;\n\n  _proto.endOfStream = function endOfStream(error, doneFn) {\n    if (error === void 0) {\n      error = null;\n    }\n\n    if (doneFn === void 0) {\n      doneFn = noop;\n    }\n\n    if (typeof error !== 'string') {\n      error = undefined;\n    } // In order to set the duration on the media source, it's necessary to wait for all\n    // source buffers to no longer be updating. \"If the updating attribute equals true on\n    // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n    // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.endOfStream(error),\n      name: 'endOfStream',\n      doneFn: doneFn\n    });\n  }\n  /**\n   * Queue an update to remove a time range from the buffer.\n   *\n   * @param {number} start where to start the removal\n   * @param {number} end where to end the removal\n   * @param {Function} [done=noop] optional callback to be executed when the remove\n   * operation is complete\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n   */\n  ;\n\n  _proto.removeAudio = function removeAudio(start, end, done) {\n    if (done === void 0) {\n      done = noop;\n    }\n\n    if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {\n      done();\n      return;\n    }\n\n    pushQueue({\n      type: 'audio',\n      sourceUpdater: this,\n      action: actions.remove(start, end),\n      doneFn: done,\n      name: 'remove'\n    });\n  }\n  /**\n   * Queue an update to remove a time range from the buffer.\n   *\n   * @param {number} start where to start the removal\n   * @param {number} end where to end the removal\n   * @param {Function} [done=noop] optional callback to be executed when the remove\n   * operation is complete\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n   */\n  ;\n\n  _proto.removeVideo = function removeVideo(start, end, done) {\n    if (done === void 0) {\n      done = noop;\n    }\n\n    if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {\n      done();\n      return;\n    }\n\n    pushQueue({\n      type: 'video',\n      sourceUpdater: this,\n      action: actions.remove(start, end),\n      doneFn: done,\n      name: 'remove'\n    });\n  }\n  /**\n   * Whether the underlying sourceBuffer is updating or not\n   *\n   * @return {boolean} the updating status of the SourceBuffer\n   */\n  ;\n\n  _proto.updating = function updating() {\n    // the audio/video source buffer is updating\n    if (_updating('audio', this) || _updating('video', this)) {\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * Set/get the timestampoffset on the audio SourceBuffer\n   *\n   * @return {number} the timestamp offset\n   */\n  ;\n\n  _proto.audioTimestampOffset = function audioTimestampOffset(offset) {\n    if (typeof offset !== 'undefined' && this.audioBuffer && // no point in updating if it's the same\n    this.audioTimestampOffset_ !== offset) {\n      pushQueue({\n        type: 'audio',\n        sourceUpdater: this,\n        action: actions.timestampOffset(offset),\n        name: 'timestampOffset'\n      });\n      this.audioTimestampOffset_ = offset;\n    }\n\n    return this.audioTimestampOffset_;\n  }\n  /**\n   * Set/get the timestampoffset on the video SourceBuffer\n   *\n   * @return {number} the timestamp offset\n   */\n  ;\n\n  _proto.videoTimestampOffset = function videoTimestampOffset(offset) {\n    if (typeof offset !== 'undefined' && this.videoBuffer && // no point in updating if it's the same\n    this.videoTimestampOffset !== offset) {\n      pushQueue({\n        type: 'video',\n        sourceUpdater: this,\n        action: actions.timestampOffset(offset),\n        name: 'timestampOffset'\n      });\n      this.videoTimestampOffset_ = offset;\n    }\n\n    return this.videoTimestampOffset_;\n  }\n  /**\n   * Add a function to the queue that will be called\n   * when it is its turn to run in the audio queue.\n   *\n   * @param {Function} callback\n   *        The callback to queue.\n   */\n  ;\n\n  _proto.audioQueueCallback = function audioQueueCallback(callback) {\n    if (!this.audioBuffer) {\n      return;\n    }\n\n    pushQueue({\n      type: 'audio',\n      sourceUpdater: this,\n      action: actions.callback(callback),\n      name: 'callback'\n    });\n  }\n  /**\n   * Add a function to the queue that will be called\n   * when it is its turn to run in the video queue.\n   *\n   * @param {Function} callback\n   *        The callback to queue.\n   */\n  ;\n\n  _proto.videoQueueCallback = function videoQueueCallback(callback) {\n    if (!this.videoBuffer) {\n      return;\n    }\n\n    pushQueue({\n      type: 'video',\n      sourceUpdater: this,\n      action: actions.callback(callback),\n      name: 'callback'\n    });\n  }\n  /**\n   * dispose of the source updater and the underlying sourceBuffer\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    var _this4 = this;\n\n    this.trigger('dispose');\n    bufferTypes.forEach(function (type) {\n      _this4.abort(type);\n\n      if (_this4.canRemoveSourceBuffer()) {\n        _this4.removeSourceBuffer(type);\n      } else {\n        _this4[type + \"QueueCallback\"](function () {\n          return cleanupBuffer(type, _this4);\n        });\n      }\n    });\n    this.videoAppendQueued_ = false;\n    this.delayedAudioAppendQueue_.length = 0;\n\n    if (this.sourceopenListener_) {\n      this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_);\n    }\n\n    this.off();\n  };\n\n  return SourceUpdater;\n}(videojs.EventTarget);\n\nvar uint8ToUtf8 = function uint8ToUtf8(uintArray) {\n  return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\n};\n\nvar VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(function (_char3) {\n  return _char3.charCodeAt(0);\n}));\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nvar VTTSegmentLoader = /*#__PURE__*/function (_SegmentLoader) {\n  _inheritsLoose(VTTSegmentLoader, _SegmentLoader);\n\n  function VTTSegmentLoader(settings, options) {\n    var _this;\n\n    if (options === void 0) {\n      options = {};\n    }\n\n    _this = _SegmentLoader.call(this, settings, options) || this; // SegmentLoader requires a MediaSource be specified or it will throw an error;\n    // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n    _this.mediaSource_ = null;\n    _this.subtitlesTrack_ = null;\n    _this.loaderType_ = 'subtitle';\n    _this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks; // The VTT segment will have its own time mappings. Saving VTT segment timing info in\n    // the sync controller leads to improper behavior.\n\n    _this.shouldSaveSegmentTimingInfo_ = false;\n    return _this;\n  }\n\n  var _proto = VTTSegmentLoader.prototype;\n\n  _proto.createTransmuxer_ = function createTransmuxer_() {\n    // don't need to transmux any subtitles\n    return null;\n  }\n  /**\n   * Indicates which time ranges are buffered\n   *\n   * @return {TimeRange}\n   *         TimeRange object representing the current buffered ranges\n   */\n  ;\n\n  _proto.buffered_ = function buffered_() {\n    if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {\n      return videojs.createTimeRanges();\n    }\n\n    var cues = this.subtitlesTrack_.cues;\n    var start = cues[0].startTime;\n    var end = cues[cues.length - 1].startTime;\n    return videojs.createTimeRanges([[start, end]]);\n  }\n  /**\n   * Gets and sets init segment for the provided map\n   *\n   * @param {Object} map\n   *        The map object representing the init segment to get or set\n   * @param {boolean=} set\n   *        If true, the init segment for the provided map should be saved\n   * @return {Object}\n   *         map object for desired init segment\n   */\n  ;\n\n  _proto.initSegmentForMap = function initSegmentForMap(map, set) {\n    if (set === void 0) {\n      set = false;\n    }\n\n    if (!map) {\n      return null;\n    }\n\n    var id = initSegmentId(map);\n    var storedMap = this.initSegments_[id];\n\n    if (set && !storedMap && map.bytes) {\n      // append WebVTT line terminators to the media initialization segment if it exists\n      // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n      // requires two or more WebVTT line terminators between the WebVTT header and the\n      // rest of the file\n      var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n      var combinedSegment = new Uint8Array(combinedByteLength);\n      combinedSegment.set(map.bytes);\n      combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n      this.initSegments_[id] = storedMap = {\n        resolvedUri: map.resolvedUri,\n        byterange: map.byterange,\n        bytes: combinedSegment\n      };\n    }\n\n    return storedMap || map;\n  }\n  /**\n   * Returns true if all configuration required for loading is present, otherwise false.\n   *\n   * @return {boolean} True if the all configuration is ready for loading\n   * @private\n   */\n  ;\n\n  _proto.couldBeginLoading_ = function couldBeginLoading_() {\n    return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n  }\n  /**\n   * Once all the starting parameters have been specified, begin\n   * operation. This method should only be invoked from the INIT\n   * state.\n   *\n   * @private\n   */\n  ;\n\n  _proto.init_ = function init_() {\n    this.state = 'READY';\n    this.resetEverything();\n    return this.monitorBuffer_();\n  }\n  /**\n   * Set a subtitle track on the segment loader to add subtitles to\n   *\n   * @param {TextTrack=} track\n   *        The text track to add loaded subtitles to\n   * @return {TextTrack}\n   *        Returns the subtitles track\n   */\n  ;\n\n  _proto.track = function track(_track) {\n    if (typeof _track === 'undefined') {\n      return this.subtitlesTrack_;\n    }\n\n    this.subtitlesTrack_ = _track; // if we were unpaused but waiting for a sourceUpdater, start\n    // buffering now\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      this.init_();\n    }\n\n    return this.subtitlesTrack_;\n  }\n  /**\n   * Remove any data in the source buffer between start and end times\n   *\n   * @param {number} start - the start time of the region to remove from the buffer\n   * @param {number} end - the end time of the region to remove from the buffer\n   */\n  ;\n\n  _proto.remove = function remove(start, end) {\n    removeCuesFromTrack(start, end, this.subtitlesTrack_);\n  }\n  /**\n   * fill the buffer with segements unless the sourceBuffers are\n   * currently updating\n   *\n   * Note: this function should only ever be called by monitorBuffer_\n   * and never directly\n   *\n   * @private\n   */\n  ;\n\n  _proto.fillBuffer_ = function fillBuffer_() {\n    var _this2 = this; // see if we need to begin loading immediately\n\n\n    var segmentInfo = this.chooseNextRequest_();\n\n    if (!segmentInfo) {\n      return;\n    }\n\n    if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n      // We don't have the timestamp offset that we need to sync subtitles.\n      // Rerun on a timestamp offset or user interaction.\n      var checkTimestampOffset = function checkTimestampOffset() {\n        _this2.state = 'READY';\n\n        if (!_this2.paused()) {\n          // if not paused, queue a buffer check as soon as possible\n          _this2.monitorBuffer_();\n        }\n      };\n\n      this.syncController_.one('timestampoffset', checkTimestampOffset);\n      this.state = 'WAITING_ON_TIMELINE';\n      return;\n    }\n\n    this.loadSegment_(segmentInfo);\n  } // never set a timestamp offset for vtt segments.\n  ;\n\n  _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() {\n    return null;\n  };\n\n  _proto.chooseNextRequest_ = function chooseNextRequest_() {\n    return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this));\n  }\n  /**\n   * Prevents the segment loader from requesting segments we know contain no subtitles\n   * by walking forward until we find the next segment that we don't know whether it is\n   * empty or not.\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @return {Object}\n   *         a segment info object that describes the current segment\n   */\n  ;\n\n  _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) {\n    while (segmentInfo && segmentInfo.segment.empty) {\n      // stop at the last possible segmentInfo\n      if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {\n        segmentInfo = null;\n        break;\n      }\n\n      segmentInfo = this.generateSegmentInfo_({\n        playlist: segmentInfo.playlist,\n        mediaIndex: segmentInfo.mediaIndex + 1,\n        startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,\n        isSyncRequest: segmentInfo.isSyncRequest\n      });\n    }\n\n    return segmentInfo;\n  };\n\n  _proto.stopForError = function stopForError(error) {\n    this.error(error);\n    this.state = 'READY';\n    this.pause();\n    this.trigger('error');\n  }\n  /**\n   * append a decrypted segement to the SourceBuffer through a SourceUpdater\n   *\n   * @private\n   */\n  ;\n\n  _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {\n    var _this3 = this;\n\n    if (!this.subtitlesTrack_) {\n      this.state = 'READY';\n      return;\n    }\n\n    this.saveTransferStats_(simpleSegment.stats); // the request was aborted\n\n    if (!this.pendingSegment_) {\n      this.state = 'READY';\n      this.mediaRequestsAborted += 1;\n      return;\n    }\n\n    if (error) {\n      if (error.code === REQUEST_ERRORS.TIMEOUT) {\n        this.handleTimeout_();\n      }\n\n      if (error.code === REQUEST_ERRORS.ABORTED) {\n        this.mediaRequestsAborted += 1;\n      } else {\n        this.mediaRequestsErrored += 1;\n      }\n\n      this.stopForError(error);\n      return;\n    }\n\n    var segmentInfo = this.pendingSegment_; // although the VTT segment loader bandwidth isn't really used, it's good to\n    // maintain functionality between segment loaders\n\n    this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats); // if this request included a segment key, save that data in the cache\n\n    if (simpleSegment.key) {\n      this.segmentKey(simpleSegment.key, true);\n    }\n\n    this.state = 'APPENDING'; // used for tests\n\n    this.trigger('appending');\n    var segment = segmentInfo.segment;\n\n    if (segment.map) {\n      segment.map.bytes = simpleSegment.map.bytes;\n    }\n\n    segmentInfo.bytes = simpleSegment.bytes; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n\n    if (typeof window$1.WebVTT !== 'function' && this.subtitlesTrack_ && this.subtitlesTrack_.tech_) {\n      var loadHandler;\n\n      var errorHandler = function errorHandler() {\n        _this3.subtitlesTrack_.tech_.off('vttjsloaded', loadHandler);\n\n        _this3.stopForError({\n          message: 'Error loading vtt.js'\n        });\n\n        return;\n      };\n\n      loadHandler = function loadHandler() {\n        _this3.subtitlesTrack_.tech_.off('vttjserror', errorHandler);\n\n        _this3.segmentRequestFinished_(error, simpleSegment, result);\n      };\n\n      this.state = 'WAITING_ON_VTTJS';\n      this.subtitlesTrack_.tech_.one('vttjsloaded', loadHandler);\n      this.subtitlesTrack_.tech_.one('vttjserror', errorHandler);\n      return;\n    }\n\n    segment.requested = true;\n\n    try {\n      this.parseVTTCues_(segmentInfo);\n    } catch (e) {\n      this.stopForError({\n        message: e.message\n      });\n      return;\n    }\n\n    this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n\n    if (segmentInfo.cues.length) {\n      segmentInfo.timingInfo = {\n        start: segmentInfo.cues[0].startTime,\n        end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime\n      };\n    } else {\n      segmentInfo.timingInfo = {\n        start: segmentInfo.startOfSegment,\n        end: segmentInfo.startOfSegment + segmentInfo.duration\n      };\n    }\n\n    if (segmentInfo.isSyncRequest) {\n      this.trigger('syncinfoupdate');\n      this.pendingSegment_ = null;\n      this.state = 'READY';\n      return;\n    }\n\n    segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n    this.mediaSecondsLoaded += segment.duration; // Create VTTCue instances for each cue in the new segment and add them to\n    // the subtitle track\n\n    segmentInfo.cues.forEach(function (cue) {\n      _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new window$1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);\n    }); // Remove any duplicate cues from the subtitle track. The WebVTT spec allows\n    // cues to have identical time-intervals, but if the text is also identical\n    // we can safely assume it is a duplicate that can be removed (ex. when a cue\n    // \"overlaps\" VTT segments)\n\n    removeDuplicateCuesFromTrack(this.subtitlesTrack_);\n    this.handleAppendsDone_();\n  };\n\n  _proto.handleData_ = function handleData_() {// noop as we shouldn't be getting video/audio data captions\n    // that we do not support here.\n  };\n\n  _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {// noop\n  }\n  /**\n   * Uses the WebVTT parser to parse the segment response\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @private\n   */\n  ;\n\n  _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) {\n    var decoder;\n    var decodeBytesToString = false;\n\n    if (typeof window$1.TextDecoder === 'function') {\n      decoder = new window$1.TextDecoder('utf8');\n    } else {\n      decoder = window$1.WebVTT.StringDecoder();\n      decodeBytesToString = true;\n    }\n\n    var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, decoder);\n    segmentInfo.cues = [];\n    segmentInfo.timestampmap = {\n      MPEGTS: 0,\n      LOCAL: 0\n    };\n    parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n\n    parser.ontimestampmap = function (map) {\n      segmentInfo.timestampmap = map;\n    };\n\n    parser.onparsingerror = function (error) {\n      videojs.log.warn('Error encountered when parsing cues: ' + error.message);\n    };\n\n    if (segmentInfo.segment.map) {\n      var mapData = segmentInfo.segment.map.bytes;\n\n      if (decodeBytesToString) {\n        mapData = uint8ToUtf8(mapData);\n      }\n\n      parser.parse(mapData);\n    }\n\n    var segmentData = segmentInfo.bytes;\n\n    if (decodeBytesToString) {\n      segmentData = uint8ToUtf8(segmentData);\n    }\n\n    parser.parse(segmentData);\n    parser.flush();\n  }\n  /**\n   * Updates the start and end times of any cues parsed by the WebVTT parser using\n   * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n   * from the SyncController\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @param {Object} mappingObj\n   *        object containing a mapping from TS to media time\n   * @param {Object} playlist\n   *        the playlist object containing the segment\n   * @private\n   */\n  ;\n\n  _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n    var segment = segmentInfo.segment;\n\n    if (!mappingObj) {\n      // If the sync controller does not have a mapping of TS to Media Time for the\n      // timeline, then we don't have enough information to update the cue\n      // start/end times\n      return;\n    }\n\n    if (!segmentInfo.cues.length) {\n      // If there are no cues, we also do not have enough information to figure out\n      // segment timing. Mark that the segment contains no cues so we don't re-request\n      // an empty segment.\n      segment.empty = true;\n      return;\n    }\n\n    var timestampmap = segmentInfo.timestampmap;\n    var diff = timestampmap.MPEGTS / ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;\n    segmentInfo.cues.forEach(function (cue) {\n      // First convert cue time to TS time using the timestamp-map provided within the vtt\n      cue.startTime += diff;\n      cue.endTime += diff;\n    });\n\n    if (!playlist.syncInfo) {\n      var firstStart = segmentInfo.cues[0].startTime;\n      var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n      playlist.syncInfo = {\n        mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n        time: Math.min(firstStart, lastStart - segment.duration)\n      };\n    }\n  };\n\n  return VTTSegmentLoader;\n}(SegmentLoader);\n/**\n * @file ad-cue-tags.js\n */\n\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n *\n * @param {Object} track\n *        the track to find the cue for\n *\n * @param {number} mediaTime\n *        the time to find the cue at\n *\n * @return {Object|null}\n *         the found cue or null\n */\n\n\nvar findAdCue = function findAdCue(track, mediaTime) {\n  var cues = track.cues;\n\n  for (var i = 0; i < cues.length; i++) {\n    var cue = cues[i];\n\n    if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n      return cue;\n    }\n  }\n\n  return null;\n};\n\nvar updateAdCues = function updateAdCues(media, track, offset) {\n  if (offset === void 0) {\n    offset = 0;\n  }\n\n  if (!media.segments) {\n    return;\n  }\n\n  var mediaTime = offset;\n  var cue;\n\n  for (var i = 0; i < media.segments.length; i++) {\n    var segment = media.segments[i];\n\n    if (!cue) {\n      // Since the cues will span for at least the segment duration, adding a fudge\n      // factor of half segment duration will prevent duplicate cues from being\n      // created when timing info is not exact (e.g. cue start time initialized\n      // at 10.006677, but next call mediaTime is 10.003332 )\n      cue = findAdCue(track, mediaTime + segment.duration / 2);\n    }\n\n    if (cue) {\n      if ('cueIn' in segment) {\n        // Found a CUE-IN so end the cue\n        cue.endTime = mediaTime;\n        cue.adEndTime = mediaTime;\n        mediaTime += segment.duration;\n        cue = null;\n        continue;\n      }\n\n      if (mediaTime < cue.endTime) {\n        // Already processed this mediaTime for this cue\n        mediaTime += segment.duration;\n        continue;\n      } // otherwise extend cue until a CUE-IN is found\n\n\n      cue.endTime += segment.duration;\n    } else {\n      if ('cueOut' in segment) {\n        cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n        cue.adStartTime = mediaTime; // Assumes tag format to be\n        // #EXT-X-CUE-OUT:30\n\n        cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n        track.addCue(cue);\n      }\n\n      if ('cueOutCont' in segment) {\n        // Entered into the middle of an ad cue\n        // Assumes tag formate to be\n        // #EXT-X-CUE-OUT-CONT:10/30\n        var _segment$cueOutCont$s = segment.cueOutCont.split('/').map(parseFloat),\n            adOffset = _segment$cueOutCont$s[0],\n            adTotal = _segment$cueOutCont$s[1];\n\n        cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, '');\n        cue.adStartTime = mediaTime - adOffset;\n        cue.adEndTime = cue.adStartTime + adTotal;\n        track.addCue(cue);\n      }\n    }\n\n    mediaTime += segment.duration;\n  }\n}; // synchronize expired playlist segments.\n// the max media sequence diff is 48 hours of live stream\n// content with two second segments. Anything larger than that\n// will likely be invalid.\n\n\nvar MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;\nvar syncPointStrategies = [// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n//                the equivalence display-time 0 === segment-index 0\n{\n  name: 'VOD',\n  run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n    if (duration !== Infinity) {\n      var syncPoint = {\n        time: 0,\n        segmentIndex: 0,\n        partIndex: null\n      };\n      return syncPoint;\n    }\n\n    return null;\n  }\n}, // Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n  name: 'ProgramDateTime',\n  run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n    if (!Object.keys(syncController.timelineToDatetimeMappings).length) {\n      return null;\n    }\n\n    var syncPoint = null;\n    var lastDistance = null;\n    var partsAndSegments = getPartsAndSegments(playlist);\n    currentTime = currentTime || 0;\n\n    for (var i = 0; i < partsAndSegments.length; i++) {\n      // start from the end and loop backwards for live\n      // or start from the front and loop forwards for non-live\n      var index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n      var partAndSegment = partsAndSegments[index];\n      var segment = partAndSegment.segment;\n      var datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];\n\n      if (!datetimeMapping || !segment.dateTimeObject) {\n        continue;\n      }\n\n      var segmentTime = segment.dateTimeObject.getTime() / 1000;\n      var start = segmentTime + datetimeMapping; // take part duration into account.\n\n      if (segment.parts && typeof partAndSegment.partIndex === 'number') {\n        for (var z = 0; z < partAndSegment.partIndex; z++) {\n          start += segment.parts[z].duration;\n        }\n      }\n\n      var distance = Math.abs(currentTime - start); // Once the distance begins to increase, or if distance is 0, we have passed\n      // currentTime and can stop looking for better candidates\n\n      if (lastDistance !== null && (distance === 0 || lastDistance < distance)) {\n        break;\n      }\n\n      lastDistance = distance;\n      syncPoint = {\n        time: start,\n        segmentIndex: partAndSegment.segmentIndex,\n        partIndex: partAndSegment.partIndex\n      };\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Segment\": We have a known time mapping for a timeline and a\n//                    segment in the current timeline with timing data\n{\n  name: 'Segment',\n  run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n    var syncPoint = null;\n    var lastDistance = null;\n    currentTime = currentTime || 0;\n    var partsAndSegments = getPartsAndSegments(playlist);\n\n    for (var i = 0; i < partsAndSegments.length; i++) {\n      // start from the end and loop backwards for live\n      // or start from the front and loop forwards for non-live\n      var index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n      var partAndSegment = partsAndSegments[index];\n      var segment = partAndSegment.segment;\n      var start = partAndSegment.part && partAndSegment.part.start || segment && segment.start;\n\n      if (segment.timeline === currentTimeline && typeof start !== 'undefined') {\n        var distance = Math.abs(currentTime - start); // Once the distance begins to increase, we have passed\n        // currentTime and can stop looking for better candidates\n\n        if (lastDistance !== null && lastDistance < distance) {\n          break;\n        }\n\n        if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n          lastDistance = distance;\n          syncPoint = {\n            time: start,\n            segmentIndex: partAndSegment.segmentIndex,\n            partIndex: partAndSegment.partIndex\n          };\n        }\n      }\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Discontinuity\": We have a discontinuity with a known\n//                          display-time\n{\n  name: 'Discontinuity',\n  run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n    var syncPoint = null;\n    currentTime = currentTime || 0;\n\n    if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n      var lastDistance = null;\n\n      for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n        var segmentIndex = playlist.discontinuityStarts[i];\n        var discontinuity = playlist.discontinuitySequence + i + 1;\n        var discontinuitySync = syncController.discontinuities[discontinuity];\n\n        if (discontinuitySync) {\n          var distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n          // currentTime and can stop looking for better candidates\n\n          if (lastDistance !== null && lastDistance < distance) {\n            break;\n          }\n\n          if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n            lastDistance = distance;\n            syncPoint = {\n              time: discontinuitySync.time,\n              segmentIndex: segmentIndex,\n              partIndex: null\n            };\n          }\n        }\n      }\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Playlist\": We have a playlist with a known mapping of\n//                     segment index to display time\n{\n  name: 'Playlist',\n  run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n    if (playlist.syncInfo) {\n      var syncPoint = {\n        time: playlist.syncInfo.time,\n        segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,\n        partIndex: null\n      };\n      return syncPoint;\n    }\n\n    return null;\n  }\n}];\n\nvar SyncController = /*#__PURE__*/function (_videojs$EventTarget) {\n  _inheritsLoose(SyncController, _videojs$EventTarget);\n\n  function SyncController(options) {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this; // ...for synching across variants\n\n    _this.timelines = [];\n    _this.discontinuities = [];\n    _this.timelineToDatetimeMappings = {};\n    _this.logger_ = logger('SyncController');\n    return _this;\n  }\n  /**\n   * Find a sync-point for the playlist specified\n   *\n   * A sync-point is defined as a known mapping from display-time to\n   * a segment-index in the current playlist.\n   *\n   * @param {Playlist} playlist\n   *        The playlist that needs a sync-point\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinite if playing a live source)\n   * @param {number} currentTimeline\n   *        The last timeline from which a segment was loaded\n   * @return {Object}\n   *          A sync-point object\n   */\n\n\n  var _proto = SyncController.prototype;\n\n  _proto.getSyncPoint = function getSyncPoint(playlist, duration, currentTimeline, currentTime) {\n    var syncPoints = this.runStrategies_(playlist, duration, currentTimeline, currentTime);\n\n    if (!syncPoints.length) {\n      // Signal that we need to attempt to get a sync-point manually\n      // by fetching a segment in the playlist and constructing\n      // a sync-point from that information\n      return null;\n    } // Now find the sync-point that is closest to the currentTime because\n    // that should result in the most accurate guess about which segment\n    // to fetch\n\n\n    return this.selectSyncPoint_(syncPoints, {\n      key: 'time',\n      value: currentTime\n    });\n  }\n  /**\n   * Calculate the amount of time that has expired off the playlist during playback\n   *\n   * @param {Playlist} playlist\n   *        Playlist object to calculate expired from\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinity if playling a live source)\n   * @return {number|null}\n   *          The amount of time that has expired off the playlist during playback. Null\n   *          if no sync-points for the playlist can be found.\n   */\n  ;\n\n  _proto.getExpiredTime = function getExpiredTime(playlist, duration) {\n    if (!playlist || !playlist.segments) {\n      return null;\n    }\n\n    var syncPoints = this.runStrategies_(playlist, duration, playlist.discontinuitySequence, 0); // Without sync-points, there is not enough information to determine the expired time\n\n    if (!syncPoints.length) {\n      return null;\n    }\n\n    var syncPoint = this.selectSyncPoint_(syncPoints, {\n      key: 'segmentIndex',\n      value: 0\n    }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n    // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n    if (syncPoint.segmentIndex > 0) {\n      syncPoint.time *= -1;\n    }\n\n    return Math.abs(syncPoint.time + sumDurations({\n      defaultDuration: playlist.targetDuration,\n      durationList: playlist.segments,\n      startIndex: syncPoint.segmentIndex,\n      endIndex: 0\n    }));\n  }\n  /**\n   * Runs each sync-point strategy and returns a list of sync-points returned by the\n   * strategies\n   *\n   * @private\n   * @param {Playlist} playlist\n   *        The playlist that needs a sync-point\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinity if playing a live source)\n   * @param {number} currentTimeline\n   *        The last timeline from which a segment was loaded\n   * @return {Array}\n   *          A list of sync-point objects\n   */\n  ;\n\n  _proto.runStrategies_ = function runStrategies_(playlist, duration, currentTimeline, currentTime) {\n    var syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n    for (var i = 0; i < syncPointStrategies.length; i++) {\n      var strategy = syncPointStrategies[i];\n      var syncPoint = strategy.run(this, playlist, duration, currentTimeline, currentTime);\n\n      if (syncPoint) {\n        syncPoint.strategy = strategy.name;\n        syncPoints.push({\n          strategy: strategy.name,\n          syncPoint: syncPoint\n        });\n      }\n    }\n\n    return syncPoints;\n  }\n  /**\n   * Selects the sync-point nearest the specified target\n   *\n   * @private\n   * @param {Array} syncPoints\n   *        List of sync-points to select from\n   * @param {Object} target\n   *        Object specifying the property and value we are targeting\n   * @param {string} target.key\n   *        Specifies the property to target. Must be either 'time' or 'segmentIndex'\n   * @param {number} target.value\n   *        The value to target for the specified key.\n   * @return {Object}\n   *          The sync-point nearest the target\n   */\n  ;\n\n  _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) {\n    var bestSyncPoint = syncPoints[0].syncPoint;\n    var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n    var bestStrategy = syncPoints[0].strategy;\n\n    for (var i = 1; i < syncPoints.length; i++) {\n      var newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n\n      if (newDistance < bestDistance) {\n        bestDistance = newDistance;\n        bestSyncPoint = syncPoints[i].syncPoint;\n        bestStrategy = syncPoints[i].strategy;\n      }\n    }\n\n    this.logger_(\"syncPoint for [\" + target.key + \": \" + target.value + \"] chosen with strategy\" + (\" [\" + bestStrategy + \"]: [time:\" + bestSyncPoint.time + \",\") + (\" segmentIndex:\" + bestSyncPoint.segmentIndex) + (typeof bestSyncPoint.partIndex === 'number' ? \",partIndex:\" + bestSyncPoint.partIndex : '') + ']');\n    return bestSyncPoint;\n  }\n  /**\n   * Save any meta-data present on the segments when segments leave\n   * the live window to the playlist to allow for synchronization at the\n   * playlist level later.\n   *\n   * @param {Playlist} oldPlaylist - The previous active playlist\n   * @param {Playlist} newPlaylist - The updated and most current playlist\n   */\n  ;\n\n  _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n    var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // Ignore large media sequence gaps\n\n    if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {\n      videojs.log.warn(\"Not saving expired segment info. Media sequence gap \" + mediaSequenceDiff + \" is too large.\");\n      return;\n    } // When a segment expires from the playlist and it has a start time\n    // save that information as a possible sync-point reference in future\n\n\n    for (var i = mediaSequenceDiff - 1; i >= 0; i--) {\n      var lastRemovedSegment = oldPlaylist.segments[i];\n\n      if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n        newPlaylist.syncInfo = {\n          mediaSequence: oldPlaylist.mediaSequence + i,\n          time: lastRemovedSegment.start\n        };\n        this.logger_(\"playlist refresh sync: [time:\" + newPlaylist.syncInfo.time + \",\" + (\" mediaSequence: \" + newPlaylist.syncInfo.mediaSequence + \"]\"));\n        this.trigger('syncinfoupdate');\n        break;\n      }\n    }\n  }\n  /**\n   * Save the mapping from playlist's ProgramDateTime to display. This should only happen\n   * before segments start to load.\n   *\n   * @param {Playlist} playlist - The currently active playlist\n   */\n  ;\n\n  _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) {\n    // It's possible for the playlist to be updated before playback starts, meaning time\n    // zero is not yet set. If, during these playlist refreshes, a discontinuity is\n    // crossed, then the old time zero mapping (for the prior timeline) would be retained\n    // unless the mappings are cleared.\n    this.timelineToDatetimeMappings = {};\n\n    if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n      var firstSegment = playlist.segments[0];\n      var playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000;\n      this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;\n    }\n  }\n  /**\n   * Calculates and saves timeline mappings, playlist sync info, and segment timing values\n   * based on the latest timing information.\n   *\n   * @param {Object} options\n   *        Options object\n   * @param {SegmentInfo} options.segmentInfo\n   *        The current active request information\n   * @param {boolean} options.shouldSaveTimelineMapping\n   *        If there's a timeline change, determines if the timeline mapping should be\n   *        saved for timeline mapping and program date time mappings.\n   */\n  ;\n\n  _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) {\n    var segmentInfo = _ref.segmentInfo,\n        shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping;\n    var didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);\n    var segment = segmentInfo.segment;\n\n    if (didCalculateSegmentTimeMapping) {\n      this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n      // now with segment timing information\n\n      if (!segmentInfo.playlist.syncInfo) {\n        segmentInfo.playlist.syncInfo = {\n          mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,\n          time: segment.start\n        };\n      }\n    }\n\n    var dateTime = segment.dateTimeObject;\n\n    if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {\n      this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1000);\n    }\n  };\n\n  _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) {\n    if (typeof this.timelines[timeline] === 'undefined') {\n      return null;\n    }\n\n    return this.timelines[timeline].time;\n  };\n\n  _proto.mappingForTimeline = function mappingForTimeline(timeline) {\n    if (typeof this.timelines[timeline] === 'undefined') {\n      return null;\n    }\n\n    return this.timelines[timeline].mapping;\n  }\n  /**\n   * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n   * save that display time to the segment.\n   *\n   * @private\n   * @param {SegmentInfo} segmentInfo\n   *        The current active request information\n   * @param {Object} timingInfo\n   *        The start and end time of the current segment in \"media time\"\n   * @param {boolean} shouldSaveTimelineMapping\n   *        If there's a timeline change, determines if the timeline mapping should be\n   *        saved in timelines.\n   * @return {boolean}\n   *          Returns false if segment time mapping could not be calculated\n   */\n  ;\n\n  _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {\n    // TODO: remove side effects\n    var segment = segmentInfo.segment;\n    var part = segmentInfo.part;\n    var mappingObj = this.timelines[segmentInfo.timeline];\n    var start;\n    var end;\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      mappingObj = {\n        time: segmentInfo.startOfSegment,\n        mapping: segmentInfo.startOfSegment - timingInfo.start\n      };\n\n      if (shouldSaveTimelineMapping) {\n        this.timelines[segmentInfo.timeline] = mappingObj;\n        this.trigger('timestampoffset');\n        this.logger_(\"time mapping for timeline \" + segmentInfo.timeline + \": \" + (\"[time: \" + mappingObj.time + \"] [mapping: \" + mappingObj.mapping + \"]\"));\n      }\n\n      start = segmentInfo.startOfSegment;\n      end = timingInfo.end + mappingObj.mapping;\n    } else if (mappingObj) {\n      start = timingInfo.start + mappingObj.mapping;\n      end = timingInfo.end + mappingObj.mapping;\n    } else {\n      return false;\n    }\n\n    if (part) {\n      part.start = start;\n      part.end = end;\n    } // If we don't have a segment start yet or the start value we got\n    // is less than our current segment.start value, save a new start value.\n    // We have to do this because parts will have segment timing info saved\n    // multiple times and we want segment start to be the earliest part start\n    // value for that segment.\n\n\n    if (!segment.start || start < segment.start) {\n      segment.start = start;\n    }\n\n    segment.end = end;\n    return true;\n  }\n  /**\n   * Each time we have discontinuity in the playlist, attempt to calculate the location\n   * in display of the start of the discontinuity and save that. We also save an accuracy\n   * value so that we save values with the most accuracy (closest to 0.)\n   *\n   * @private\n   * @param {SegmentInfo} segmentInfo - The current active request information\n   */\n  ;\n\n  _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) {\n    var playlist = segmentInfo.playlist;\n    var segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n    // the start of the range and it's accuracy is 0 (greater accuracy values\n    // mean more approximation)\n\n    if (segment.discontinuity) {\n      this.discontinuities[segment.timeline] = {\n        time: segment.start,\n        accuracy: 0\n      };\n    } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n      // Search for future discontinuities that we can provide better timing\n      // information for and save that information for sync purposes\n      for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n        var segmentIndex = playlist.discontinuityStarts[i];\n        var discontinuity = playlist.discontinuitySequence + i + 1;\n        var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n        var accuracy = Math.abs(mediaIndexDiff);\n\n        if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n          var time = void 0;\n\n          if (mediaIndexDiff < 0) {\n            time = segment.start - sumDurations({\n              defaultDuration: playlist.targetDuration,\n              durationList: playlist.segments,\n              startIndex: segmentInfo.mediaIndex,\n              endIndex: segmentIndex\n            });\n          } else {\n            time = segment.end + sumDurations({\n              defaultDuration: playlist.targetDuration,\n              durationList: playlist.segments,\n              startIndex: segmentInfo.mediaIndex + 1,\n              endIndex: segmentIndex\n            });\n          }\n\n          this.discontinuities[discontinuity] = {\n            time: time,\n            accuracy: accuracy\n          };\n        }\n      }\n    }\n  };\n\n  _proto.dispose = function dispose() {\n    this.trigger('dispose');\n    this.off();\n  };\n\n  return SyncController;\n}(videojs.EventTarget);\n/**\n * The TimelineChangeController acts as a source for segment loaders to listen for and\n * keep track of latest and pending timeline changes. This is useful to ensure proper\n * sync, as each loader may need to make a consideration for what timeline the other\n * loader is on before making changes which could impact the other loader's media.\n *\n * @class TimelineChangeController\n * @extends videojs.EventTarget\n */\n\n\nvar TimelineChangeController = /*#__PURE__*/function (_videojs$EventTarget) {\n  _inheritsLoose(TimelineChangeController, _videojs$EventTarget);\n\n  function TimelineChangeController() {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this;\n    _this.pendingTimelineChanges_ = {};\n    _this.lastTimelineChanges_ = {};\n    return _this;\n  }\n\n  var _proto = TimelineChangeController.prototype;\n\n  _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type) {\n    this.pendingTimelineChanges_[type] = null;\n    this.trigger('pendingtimelinechange');\n  };\n\n  _proto.pendingTimelineChange = function pendingTimelineChange(_ref) {\n    var type = _ref.type,\n        from = _ref.from,\n        to = _ref.to;\n\n    if (typeof from === 'number' && typeof to === 'number') {\n      this.pendingTimelineChanges_[type] = {\n        type: type,\n        from: from,\n        to: to\n      };\n      this.trigger('pendingtimelinechange');\n    }\n\n    return this.pendingTimelineChanges_[type];\n  };\n\n  _proto.lastTimelineChange = function lastTimelineChange(_ref2) {\n    var type = _ref2.type,\n        from = _ref2.from,\n        to = _ref2.to;\n\n    if (typeof from === 'number' && typeof to === 'number') {\n      this.lastTimelineChanges_[type] = {\n        type: type,\n        from: from,\n        to: to\n      };\n      delete this.pendingTimelineChanges_[type];\n      this.trigger('timelinechange');\n    }\n\n    return this.lastTimelineChanges_[type];\n  };\n\n  _proto.dispose = function dispose() {\n    this.trigger('dispose');\n    this.pendingTimelineChanges_ = {};\n    this.lastTimelineChanges_ = {};\n    this.off();\n  };\n\n  return TimelineChangeController;\n}(videojs.EventTarget);\n/* rollup-plugin-worker-factory start for worker!/Users/abarstow/videojs/http-streaming/src/decrypter-worker.js */\n\n\nvar workerCode = transform(getWorkerString(function () {\n  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n  function createCommonjsModule(fn, basedir, module) {\n    return module = {\n      path: basedir,\n      exports: {},\n      require: function require(path, base) {\n        return commonjsRequire(path, base === undefined || base === null ? module.path : base);\n      }\n    }, fn(module, module.exports), module.exports;\n  }\n\n  function commonjsRequire() {\n    throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n  }\n\n  var createClass = createCommonjsModule(function (module) {\n    function _defineProperties(target, props) {\n      for (var i = 0; i < props.length; i++) {\n        var descriptor = props[i];\n        descriptor.enumerable = descriptor.enumerable || false;\n        descriptor.configurable = true;\n        if (\"value\" in descriptor) descriptor.writable = true;\n        Object.defineProperty(target, descriptor.key, descriptor);\n      }\n    }\n\n    function _createClass(Constructor, protoProps, staticProps) {\n      if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n      if (staticProps) _defineProperties(Constructor, staticProps);\n      return Constructor;\n    }\n\n    module.exports = _createClass;\n    module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n  });\n  var setPrototypeOf = createCommonjsModule(function (module) {\n    function _setPrototypeOf(o, p) {\n      module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n        o.__proto__ = p;\n        return o;\n      };\n\n      module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n      return _setPrototypeOf(o, p);\n    }\n\n    module.exports = _setPrototypeOf;\n    module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n  });\n  var inheritsLoose = createCommonjsModule(function (module) {\n    function _inheritsLoose(subClass, superClass) {\n      subClass.prototype = Object.create(superClass.prototype);\n      subClass.prototype.constructor = subClass;\n      setPrototypeOf(subClass, superClass);\n    }\n\n    module.exports = _inheritsLoose;\n    module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n  });\n  /**\n   * @file stream.js\n   */\n\n  /**\n   * A lightweight readable stream implemention that handles event dispatching.\n   *\n   * @class Stream\n   */\n\n  var Stream = /*#__PURE__*/function () {\n    function Stream() {\n      this.listeners = {};\n    }\n    /**\n     * Add a listener for a specified event type.\n     *\n     * @param {string} type the event name\n     * @param {Function} listener the callback to be invoked when an event of\n     * the specified type occurs\n     */\n\n\n    var _proto = Stream.prototype;\n\n    _proto.on = function on(type, listener) {\n      if (!this.listeners[type]) {\n        this.listeners[type] = [];\n      }\n\n      this.listeners[type].push(listener);\n    }\n    /**\n     * Remove a listener for a specified event type.\n     *\n     * @param {string} type the event name\n     * @param {Function} listener  a function previously registered for this\n     * type of event through `on`\n     * @return {boolean} if we could turn it off or not\n     */\n    ;\n\n    _proto.off = function off(type, listener) {\n      if (!this.listeners[type]) {\n        return false;\n      }\n\n      var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n      // In Video.js we slice listener functions\n      // on trigger so that it does not mess up the order\n      // while we loop through.\n      //\n      // Here we slice on off so that the loop in trigger\n      // can continue using it's old reference to loop without\n      // messing up the order.\n\n      this.listeners[type] = this.listeners[type].slice(0);\n      this.listeners[type].splice(index, 1);\n      return index > -1;\n    }\n    /**\n     * Trigger an event of the specified type on this stream. Any additional\n     * arguments to this function are passed as parameters to event listeners.\n     *\n     * @param {string} type the event name\n     */\n    ;\n\n    _proto.trigger = function trigger(type) {\n      var callbacks = this.listeners[type];\n\n      if (!callbacks) {\n        return;\n      } // Slicing the arguments on every invocation of this method\n      // can add a significant amount of overhead. Avoid the\n      // intermediate object creation for the common case of a\n      // single callback argument\n\n\n      if (arguments.length === 2) {\n        var length = callbacks.length;\n\n        for (var i = 0; i < length; ++i) {\n          callbacks[i].call(this, arguments[1]);\n        }\n      } else {\n        var args = Array.prototype.slice.call(arguments, 1);\n        var _length = callbacks.length;\n\n        for (var _i = 0; _i < _length; ++_i) {\n          callbacks[_i].apply(this, args);\n        }\n      }\n    }\n    /**\n     * Destroys the stream and cleans up.\n     */\n    ;\n\n    _proto.dispose = function dispose() {\n      this.listeners = {};\n    }\n    /**\n     * Forwards all `data` events on this stream to the destination stream. The\n     * destination stream should provide a method `push` to receive the data\n     * events as they arrive.\n     *\n     * @param {Stream} destination the stream that will receive all `data` events\n     * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n     */\n    ;\n\n    _proto.pipe = function pipe(destination) {\n      this.on('data', function (data) {\n        destination.push(data);\n      });\n    };\n\n    return Stream;\n  }();\n  /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */\n\n  /**\n   * Returns the subarray of a Uint8Array without PKCS#7 padding.\n   *\n   * @param padded {Uint8Array} unencrypted bytes that have been padded\n   * @return {Uint8Array} the unpadded bytes\n   * @see http://tools.ietf.org/html/rfc5652\n   */\n\n\n  function unpad(padded) {\n    return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n  }\n  /*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */\n\n  /**\n   * @file aes.js\n   *\n   * This file contains an adaptation of the AES decryption algorithm\n   * from the Standford Javascript Cryptography Library. That work is\n   * covered by the following copyright and permissions notice:\n   *\n   * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n   * All rights reserved.\n   *\n   * Redistribution and use in source and binary forms, with or without\n   * modification, are permitted provided that the following conditions are\n   * met:\n   *\n   * 1. Redistributions of source code must retain the above copyright\n   *    notice, this list of conditions and the following disclaimer.\n   *\n   * 2. Redistributions in binary form must reproduce the above\n   *    copyright notice, this list of conditions and the following\n   *    disclaimer in the documentation and/or other materials provided\n   *    with the distribution.\n   *\n   * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n   * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n   * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n   * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n   *\n   * The views and conclusions contained in the software and documentation\n   * are those of the authors and should not be interpreted as representing\n   * official policies, either expressed or implied, of the authors.\n   */\n\n  /**\n   * Expand the S-box tables.\n   *\n   * @private\n   */\n\n\n  var precompute = function precompute() {\n    var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n    var encTable = tables[0];\n    var decTable = tables[1];\n    var sbox = encTable[4];\n    var sboxInv = decTable[4];\n    var i;\n    var x;\n    var xInv;\n    var d = [];\n    var th = [];\n    var x2;\n    var x4;\n    var x8;\n    var s;\n    var tEnc;\n    var tDec; // Compute double and third tables\n\n    for (i = 0; i < 256; i++) {\n      th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n    }\n\n    for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n      // Compute sbox\n      s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n      s = s >> 8 ^ s & 255 ^ 99;\n      sbox[x] = s;\n      sboxInv[s] = x; // Compute MixColumns\n\n      x8 = d[x4 = d[x2 = d[x]]];\n      tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n      tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n      for (i = 0; i < 4; i++) {\n        encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n        decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n      }\n    } // Compactify. Considerable speedup on Firefox.\n\n\n    for (i = 0; i < 5; i++) {\n      encTable[i] = encTable[i].slice(0);\n      decTable[i] = decTable[i].slice(0);\n    }\n\n    return tables;\n  };\n\n  var aesTables = null;\n  /**\n   * Schedule out an AES key for both encryption and decryption. This\n   * is a low-level class. Use a cipher mode to do bulk encryption.\n   *\n   * @class AES\n   * @param key {Array} The key as an array of 4, 6 or 8 words.\n   */\n\n  var AES = /*#__PURE__*/function () {\n    function AES(key) {\n      /**\n      * The expanded S-box and inverse S-box tables. These will be computed\n      * on the client so that we don't have to send them down the wire.\n      *\n      * There are two tables, _tables[0] is for encryption and\n      * _tables[1] is for decryption.\n      *\n      * The first 4 sub-tables are the expanded S-box with MixColumns. The\n      * last (_tables[01][4]) is the S-box itself.\n      *\n      * @private\n      */\n      // if we have yet to precompute the S-box tables\n      // do so now\n      if (!aesTables) {\n        aesTables = precompute();\n      } // then make a copy of that object for use\n\n\n      this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n      var i;\n      var j;\n      var tmp;\n      var sbox = this._tables[0][4];\n      var decTable = this._tables[1];\n      var keyLen = key.length;\n      var rcon = 1;\n\n      if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n        throw new Error('Invalid aes key size');\n      }\n\n      var encKey = key.slice(0);\n      var decKey = [];\n      this._key = [encKey, decKey]; // schedule encryption keys\n\n      for (i = keyLen; i < 4 * keyLen + 28; i++) {\n        tmp = encKey[i - 1]; // apply sbox\n\n        if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n          tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n          if (i % keyLen === 0) {\n            tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n            rcon = rcon << 1 ^ (rcon >> 7) * 283;\n          }\n        }\n\n        encKey[i] = encKey[i - keyLen] ^ tmp;\n      } // schedule decryption keys\n\n\n      for (j = 0; i; j++, i--) {\n        tmp = encKey[j & 3 ? i : i - 4];\n\n        if (i <= 4 || j < 4) {\n          decKey[j] = tmp;\n        } else {\n          decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n        }\n      }\n    }\n    /**\n     * Decrypt 16 bytes, specified as four 32-bit words.\n     *\n     * @param {number} encrypted0 the first word to decrypt\n     * @param {number} encrypted1 the second word to decrypt\n     * @param {number} encrypted2 the third word to decrypt\n     * @param {number} encrypted3 the fourth word to decrypt\n     * @param {Int32Array} out the array to write the decrypted words\n     * into\n     * @param {number} offset the offset into the output array to start\n     * writing results\n     * @return {Array} The plaintext.\n     */\n\n\n    var _proto = AES.prototype;\n\n    _proto.decrypt = function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n      var key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n      var a = encrypted0 ^ key[0];\n      var b = encrypted3 ^ key[1];\n      var c = encrypted2 ^ key[2];\n      var d = encrypted1 ^ key[3];\n      var a2;\n      var b2;\n      var c2; // key.length === 2 ?\n\n      var nInnerRounds = key.length / 4 - 2;\n      var i;\n      var kIndex = 4;\n      var table = this._tables[1]; // load up the tables\n\n      var table0 = table[0];\n      var table1 = table[1];\n      var table2 = table[2];\n      var table3 = table[3];\n      var sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n      for (i = 0; i < nInnerRounds; i++) {\n        a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n        b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n        c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n        d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n        kIndex += 4;\n        a = a2;\n        b = b2;\n        c = c2;\n      } // Last round.\n\n\n      for (i = 0; i < 4; i++) {\n        out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n        a2 = a;\n        a = b;\n        b = c;\n        c = d;\n        d = a2;\n      }\n    };\n\n    return AES;\n  }();\n  /**\n   * A wrapper around the Stream class to use setTimeout\n   * and run stream \"jobs\" Asynchronously\n   *\n   * @class AsyncStream\n   * @extends Stream\n   */\n\n\n  var AsyncStream = /*#__PURE__*/function (_Stream) {\n    inheritsLoose(AsyncStream, _Stream);\n\n    function AsyncStream() {\n      var _this;\n\n      _this = _Stream.call(this, Stream) || this;\n      _this.jobs = [];\n      _this.delay = 1;\n      _this.timeout_ = null;\n      return _this;\n    }\n    /**\n     * process an async job\n     *\n     * @private\n     */\n\n\n    var _proto = AsyncStream.prototype;\n\n    _proto.processJob_ = function processJob_() {\n      this.jobs.shift()();\n\n      if (this.jobs.length) {\n        this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n      } else {\n        this.timeout_ = null;\n      }\n    }\n    /**\n     * push a job into the stream\n     *\n     * @param {Function} job the job to push into the stream\n     */\n    ;\n\n    _proto.push = function push(job) {\n      this.jobs.push(job);\n\n      if (!this.timeout_) {\n        this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n      }\n    };\n\n    return AsyncStream;\n  }(Stream);\n  /**\n   * Convert network-order (big-endian) bytes into their little-endian\n   * representation.\n   */\n\n\n  var ntoh = function ntoh(word) {\n    return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n  };\n  /**\n   * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n   *\n   * @param {Uint8Array} encrypted the encrypted bytes\n   * @param {Uint32Array} key the bytes of the decryption key\n   * @param {Uint32Array} initVector the initialization vector (IV) to\n   * use for the first round of CBC.\n   * @return {Uint8Array} the decrypted bytes\n   *\n   * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n   * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n   * @see https://tools.ietf.org/html/rfc2315\n   */\n\n\n  var decrypt = function decrypt(encrypted, key, initVector) {\n    // word-level access to the encrypted bytes\n    var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n    var decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n    var decrypted = new Uint8Array(encrypted.byteLength);\n    var decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n    // decrypted data\n\n    var init0;\n    var init1;\n    var init2;\n    var init3;\n    var encrypted0;\n    var encrypted1;\n    var encrypted2;\n    var encrypted3; // iteration variable\n\n    var wordIx; // pull out the words of the IV to ensure we don't modify the\n    // passed-in reference and easier access\n\n    init0 = initVector[0];\n    init1 = initVector[1];\n    init2 = initVector[2];\n    init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n    // to each decrypted block\n\n    for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n      // convert big-endian (network order) words into little-endian\n      // (javascript order)\n      encrypted0 = ntoh(encrypted32[wordIx]);\n      encrypted1 = ntoh(encrypted32[wordIx + 1]);\n      encrypted2 = ntoh(encrypted32[wordIx + 2]);\n      encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n      decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n      // plaintext\n\n      decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n      decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n      decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n      decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n      init0 = encrypted0;\n      init1 = encrypted1;\n      init2 = encrypted2;\n      init3 = encrypted3;\n    }\n\n    return decrypted;\n  };\n  /**\n   * The `Decrypter` class that manages decryption of AES\n   * data through `AsyncStream` objects and the `decrypt`\n   * function\n   *\n   * @param {Uint8Array} encrypted the encrypted bytes\n   * @param {Uint32Array} key the bytes of the decryption key\n   * @param {Uint32Array} initVector the initialization vector (IV) to\n   * @param {Function} done the function to run when done\n   * @class Decrypter\n   */\n\n\n  var Decrypter = /*#__PURE__*/function () {\n    function Decrypter(encrypted, key, initVector, done) {\n      var step = Decrypter.STEP;\n      var encrypted32 = new Int32Array(encrypted.buffer);\n      var decrypted = new Uint8Array(encrypted.byteLength);\n      var i = 0;\n      this.asyncStream_ = new AsyncStream(); // split up the encryption job and do the individual chunks asynchronously\n\n      this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n\n      for (i = step; i < encrypted32.length; i += step) {\n        initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n        this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n      } // invoke the done() callback when everything is finished\n\n\n      this.asyncStream_.push(function () {\n        // remove pkcs#7 padding from the decrypted bytes\n        done(null, unpad(decrypted));\n      });\n    }\n    /**\n     * a getter for step the maximum number of bytes to process at one time\n     *\n     * @return {number} the value of step 32000\n     */\n\n\n    var _proto = Decrypter.prototype;\n    /**\n     * @private\n     */\n\n    _proto.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n      return function () {\n        var bytes = decrypt(encrypted, key, initVector);\n        decrypted.set(bytes, encrypted.byteOffset);\n      };\n    };\n\n    createClass(Decrypter, null, [{\n      key: \"STEP\",\n      get: function get() {\n        // 4 * 8000;\n        return 32000;\n      }\n    }]);\n    return Decrypter;\n  }();\n\n  var win;\n\n  if (typeof window !== \"undefined\") {\n    win = window;\n  } else if (typeof commonjsGlobal !== \"undefined\") {\n    win = commonjsGlobal;\n  } else if (typeof self !== \"undefined\") {\n    win = self;\n  } else {\n    win = {};\n  }\n\n  var window_1 = win;\n\n  var isArrayBufferView = function isArrayBufferView(obj) {\n    if (ArrayBuffer.isView === 'function') {\n      return ArrayBuffer.isView(obj);\n    }\n\n    return obj && obj.buffer instanceof ArrayBuffer;\n  };\n\n  var BigInt = window_1.BigInt || Number;\n  [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\n  /**\n   * Creates an object for sending to a web worker modifying properties that are TypedArrays\n   * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n   *\n   * @param {Object} message\n   *        Object of properties and values to send to the web worker\n   * @return {Object}\n   *         Modified message with TypedArray values expanded\n   * @function createTransferableMessage\n   */\n\n\n  var createTransferableMessage = function createTransferableMessage(message) {\n    var transferable = {};\n    Object.keys(message).forEach(function (key) {\n      var value = message[key];\n\n      if (isArrayBufferView(value)) {\n        transferable[key] = {\n          bytes: value.buffer,\n          byteOffset: value.byteOffset,\n          byteLength: value.byteLength\n        };\n      } else {\n        transferable[key] = value;\n      }\n    });\n    return transferable;\n  };\n  /* global self */\n\n  /**\n   * Our web worker interface so that things can talk to aes-decrypter\n   * that will be running in a web worker. the scope is passed to this by\n   * webworkify.\n   */\n\n\n  self.onmessage = function (event) {\n    var data = event.data;\n    var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n    var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n    var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n    /* eslint-disable no-new, handle-callback-err */\n\n    new Decrypter(encrypted, key, iv, function (err, bytes) {\n      self.postMessage(createTransferableMessage({\n        source: data.source,\n        decrypted: bytes\n      }), [bytes.buffer]);\n    });\n    /* eslint-enable */\n  };\n}));\nvar Decrypter = factory(workerCode);\n/* rollup-plugin-worker-factory end for worker!/Users/abarstow/videojs/http-streaming/src/decrypter-worker.js */\n\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nvar audioTrackKind_ = function audioTrackKind_(properties) {\n  var kind = properties[\"default\"] ? 'main' : 'alternative';\n\n  if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n    kind = 'main-desc';\n  }\n\n  return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n *        SegmentLoader to pause\n * @param {Object} mediaType\n *        Active media type\n * @function stopLoaders\n */\n\n\nvar stopLoaders = function stopLoaders(segmentLoader, mediaType) {\n  segmentLoader.abort();\n  segmentLoader.pause();\n\n  if (mediaType && mediaType.activePlaylistLoader) {\n    mediaType.activePlaylistLoader.pause();\n    mediaType.activePlaylistLoader = null;\n  }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n *        PlaylistLoader to start loading\n * @param {Object} mediaType\n *        Active media type\n * @function startLoaders\n */\n\n\nvar startLoaders = function startLoaders(playlistLoader, mediaType) {\n  // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n  // playlist loader\n  mediaType.activePlaylistLoader = playlistLoader;\n  playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Handler for a non-destructive resync of SegmentLoader when the active media\n *         group changes.\n * @function onGroupChanged\n */\n\n\nvar onGroupChanged = function onGroupChanged(type, settings) {\n  return function () {\n    var _settings$segmentLoad = settings.segmentLoaders,\n        segmentLoader = _settings$segmentLoad[type],\n        mainSegmentLoader = _settings$segmentLoad.main,\n        mediaType = settings.mediaTypes[type];\n    var activeTrack = mediaType.activeTrack();\n    var activeGroup = mediaType.getActiveGroup();\n    var previousActiveLoader = mediaType.activePlaylistLoader;\n    var lastGroup = mediaType.lastGroup_; // the group did not change do nothing\n\n    if (activeGroup && lastGroup && activeGroup.id === lastGroup.id) {\n      return;\n    }\n\n    mediaType.lastGroup_ = activeGroup;\n    mediaType.lastTrack_ = activeTrack;\n    stopLoaders(segmentLoader, mediaType);\n\n    if (!activeGroup || activeGroup.isMasterPlaylist) {\n      // there is no group active or active group is a main playlist and won't change\n      return;\n    }\n\n    if (!activeGroup.playlistLoader) {\n      if (previousActiveLoader) {\n        // The previous group had a playlist loader but the new active group does not\n        // this means we are switching from demuxed to muxed audio. In this case we want to\n        // do a destructive reset of the main segment loader and not restart the audio\n        // loaders.\n        mainSegmentLoader.resetEverything();\n      }\n\n      return;\n    } // Non-destructive resync\n\n\n    segmentLoader.resyncLoader();\n    startLoaders(activeGroup.playlistLoader, mediaType);\n  };\n};\n\nvar onGroupChanging = function onGroupChanging(type, settings) {\n  return function () {\n    var segmentLoader = settings.segmentLoaders[type],\n        mediaType = settings.mediaTypes[type];\n    mediaType.lastGroup_ = null;\n    segmentLoader.abort();\n    segmentLoader.pause();\n  };\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Handler for a destructive reset of SegmentLoader when the active media\n *         track changes.\n * @function onTrackChanged\n */\n\n\nvar onTrackChanged = function onTrackChanged(type, settings) {\n  return function () {\n    var masterPlaylistLoader = settings.masterPlaylistLoader,\n        _settings$segmentLoad2 = settings.segmentLoaders,\n        segmentLoader = _settings$segmentLoad2[type],\n        mainSegmentLoader = _settings$segmentLoad2.main,\n        mediaType = settings.mediaTypes[type];\n    var activeTrack = mediaType.activeTrack();\n    var activeGroup = mediaType.getActiveGroup();\n    var previousActiveLoader = mediaType.activePlaylistLoader;\n    var lastTrack = mediaType.lastTrack_; // track did not change, do nothing\n\n    if (lastTrack && activeTrack && lastTrack.id === activeTrack.id) {\n      return;\n    }\n\n    mediaType.lastGroup_ = activeGroup;\n    mediaType.lastTrack_ = activeTrack;\n    stopLoaders(segmentLoader, mediaType);\n\n    if (!activeGroup) {\n      // there is no group active so we do not want to restart loaders\n      return;\n    }\n\n    if (activeGroup.isMasterPlaylist) {\n      // track did not change, do nothing\n      if (!activeTrack || !lastTrack || activeTrack.id === lastTrack.id) {\n        return;\n      }\n\n      var mpc = settings.vhs.masterPlaylistController_;\n      var newPlaylist = mpc.selectPlaylist(); // media will not change do nothing\n\n      if (mpc.media() === newPlaylist) {\n        return;\n      }\n\n      mediaType.logger_(\"track change. Switching master audio from \" + lastTrack.id + \" to \" + activeTrack.id);\n      masterPlaylistLoader.pause();\n      mainSegmentLoader.resetEverything();\n      mpc.fastQualityChange_(newPlaylist);\n      return;\n    }\n\n    if (type === 'AUDIO') {\n      if (!activeGroup.playlistLoader) {\n        // when switching from demuxed audio/video to muxed audio/video (noted by no\n        // playlist loader for the audio group), we want to do a destructive reset of the\n        // main segment loader and not restart the audio loaders\n        mainSegmentLoader.setAudio(true); // don't have to worry about disabling the audio of the audio segment loader since\n        // it should be stopped\n\n        mainSegmentLoader.resetEverything();\n        return;\n      } // although the segment loader is an audio segment loader, call the setAudio\n      // function to ensure it is prepared to re-append the init segment (or handle other\n      // config changes)\n\n\n      segmentLoader.setAudio(true);\n      mainSegmentLoader.setAudio(false);\n    }\n\n    if (previousActiveLoader === activeGroup.playlistLoader) {\n      // Nothing has actually changed. This can happen because track change events can fire\n      // multiple times for a \"single\" change. One for enabling the new active track, and\n      // one for disabling the track that was active\n      startLoaders(activeGroup.playlistLoader, mediaType);\n      return;\n    }\n\n    if (segmentLoader.track) {\n      // For WebVTT, set the new text track in the segmentloader\n      segmentLoader.track(activeTrack);\n    } // destructive reset\n\n\n    segmentLoader.resetEverything();\n    startLoaders(activeGroup.playlistLoader, mediaType);\n  };\n};\n\nvar onError = {\n  /**\n   * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n   * an error.\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Error handler. Logs warning (or error if the playlist is blacklisted) to\n   *         console and switches back to default audio track.\n   * @function onError.AUDIO\n   */\n  AUDIO: function AUDIO(type, settings) {\n    return function () {\n      var segmentLoader = settings.segmentLoaders[type],\n          mediaType = settings.mediaTypes[type],\n          blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;\n      stopLoaders(segmentLoader, mediaType); // switch back to default audio track\n\n      var activeTrack = mediaType.activeTrack();\n      var activeGroup = mediaType.activeGroup();\n      var id = (activeGroup.filter(function (group) {\n        return group[\"default\"];\n      })[0] || activeGroup[0]).id;\n      var defaultTrack = mediaType.tracks[id];\n\n      if (activeTrack === defaultTrack) {\n        // Default track encountered an error. All we can do now is blacklist the current\n        // rendition and hope another will switch audio groups\n        blacklistCurrentPlaylist({\n          message: 'Problem encountered loading the default audio track.'\n        });\n        return;\n      }\n\n      videojs.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n\n      for (var trackId in mediaType.tracks) {\n        mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n      }\n\n      mediaType.onTrackChanged();\n    };\n  },\n\n  /**\n   * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n   * an error.\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Error handler. Logs warning to console and disables the active subtitle track\n   * @function onError.SUBTITLES\n   */\n  SUBTITLES: function SUBTITLES(type, settings) {\n    return function () {\n      var segmentLoader = settings.segmentLoaders[type],\n          mediaType = settings.mediaTypes[type];\n      videojs.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n      stopLoaders(segmentLoader, mediaType);\n      var track = mediaType.activeTrack();\n\n      if (track) {\n        track.mode = 'disabled';\n      }\n\n      mediaType.onTrackChanged();\n    };\n  }\n};\nvar setupListeners = {\n  /**\n   * Setup event listeners for audio playlist loader\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {PlaylistLoader|null} playlistLoader\n   *        PlaylistLoader to register listeners on\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function setupListeners.AUDIO\n   */\n  AUDIO: function AUDIO(type, playlistLoader, settings) {\n    if (!playlistLoader) {\n      // no playlist loader means audio will be muxed with the video\n      return;\n    }\n\n    var tech = settings.tech,\n        requestOptions = settings.requestOptions,\n        segmentLoader = settings.segmentLoaders[type];\n    playlistLoader.on('loadedmetadata', function () {\n      var media = playlistLoader.media();\n      segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n      // permits, start downloading segments\n\n      if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('loadedplaylist', function () {\n      segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n      if (!tech.paused()) {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup event listeners for subtitle playlist loader\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {PlaylistLoader|null} playlistLoader\n   *        PlaylistLoader to register listeners on\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function setupListeners.SUBTITLES\n   */\n  SUBTITLES: function SUBTITLES(type, playlistLoader, settings) {\n    var tech = settings.tech,\n        requestOptions = settings.requestOptions,\n        segmentLoader = settings.segmentLoaders[type],\n        mediaType = settings.mediaTypes[type];\n    playlistLoader.on('loadedmetadata', function () {\n      var media = playlistLoader.media();\n      segmentLoader.playlist(media, requestOptions);\n      segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n      // permits, start downloading segments\n\n      if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('loadedplaylist', function () {\n      segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n      if (!tech.paused()) {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('error', onError[type](type, settings));\n  }\n};\nvar initialize = {\n  /**\n   * Setup PlaylistLoaders and AudioTracks for the audio groups\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize.AUDIO\n   */\n  'AUDIO': function AUDIO(type, settings) {\n    var vhs = settings.vhs,\n        sourceType = settings.sourceType,\n        segmentLoader = settings.segmentLoaders[type],\n        requestOptions = settings.requestOptions,\n        mediaGroups = settings.master.mediaGroups,\n        _settings$mediaTypes$ = settings.mediaTypes[type],\n        groups = _settings$mediaTypes$.groups,\n        tracks = _settings$mediaTypes$.tracks,\n        logger_ = _settings$mediaTypes$.logger_,\n        masterPlaylistLoader = settings.masterPlaylistLoader;\n    var audioOnlyMaster = isAudioOnly(masterPlaylistLoader.master); // force a default if we have none\n\n    if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n      mediaGroups[type] = {\n        main: {\n          \"default\": {\n            \"default\": true\n          }\n        }\n      };\n\n      if (audioOnlyMaster) {\n        mediaGroups[type].main[\"default\"].playlists = masterPlaylistLoader.master.playlists;\n      }\n    }\n\n    for (var groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (var variantLabel in mediaGroups[type][groupId]) {\n        var properties = mediaGroups[type][groupId][variantLabel];\n        var playlistLoader = void 0;\n\n        if (audioOnlyMaster) {\n          logger_(\"AUDIO group '\" + groupId + \"' label '\" + variantLabel + \"' is a master playlist\");\n          properties.isMasterPlaylist = true;\n          playlistLoader = null; // if vhs-json was provided as the source, and the media playlist was resolved,\n          // use the resolved media playlist object\n        } else if (sourceType === 'vhs-json' && properties.playlists) {\n          playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);\n        } else if (properties.resolvedUri) {\n          playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions); // TODO: dash isn't the only type with properties.playlists\n          // should we even have properties.playlists in this check.\n        } else if (properties.playlists && sourceType === 'dash') {\n          playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);\n        } else {\n          // no resolvedUri means the audio is muxed with the video when using this\n          // audio track\n          playlistLoader = null;\n        }\n\n        properties = videojs.mergeOptions({\n          id: variantLabel,\n          playlistLoader: playlistLoader\n        }, properties);\n        setupListeners[type](type, properties.playlistLoader, settings);\n        groups[groupId].push(properties);\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          var track = new videojs.AudioTrack({\n            id: variantLabel,\n            kind: audioTrackKind_(properties),\n            enabled: false,\n            language: properties.language,\n            \"default\": properties[\"default\"],\n            label: variantLabel\n          });\n          tracks[variantLabel] = track;\n        }\n      }\n    } // setup single error event handler for the segment loader\n\n\n    segmentLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup PlaylistLoaders and TextTracks for the subtitle groups\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize.SUBTITLES\n   */\n  'SUBTITLES': function SUBTITLES(type, settings) {\n    var tech = settings.tech,\n        vhs = settings.vhs,\n        sourceType = settings.sourceType,\n        segmentLoader = settings.segmentLoaders[type],\n        requestOptions = settings.requestOptions,\n        mediaGroups = settings.master.mediaGroups,\n        _settings$mediaTypes$2 = settings.mediaTypes[type],\n        groups = _settings$mediaTypes$2.groups,\n        tracks = _settings$mediaTypes$2.tracks,\n        masterPlaylistLoader = settings.masterPlaylistLoader;\n\n    for (var groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (var variantLabel in mediaGroups[type][groupId]) {\n        if (mediaGroups[type][groupId][variantLabel].forced) {\n          // Subtitle playlists with the forced attribute are not selectable in Safari.\n          // According to Apple's HLS Authoring Specification:\n          //   If content has forced subtitles and regular subtitles in a given language,\n          //   the regular subtitles track in that language MUST contain both the forced\n          //   subtitles and the regular subtitles for that language.\n          // Because of this requirement and that Safari does not add forced subtitles,\n          // forced subtitles are skipped here to maintain consistent experience across\n          // all platforms\n          continue;\n        }\n\n        var properties = mediaGroups[type][groupId][variantLabel];\n        var playlistLoader = void 0;\n\n        if (sourceType === 'hls') {\n          playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);\n        } else if (sourceType === 'dash') {\n          var playlists = properties.playlists.filter(function (p) {\n            return p.excludeUntil !== Infinity;\n          });\n\n          if (!playlists.length) {\n            return;\n          }\n\n          playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);\n        } else if (sourceType === 'vhs-json') {\n          playlistLoader = new PlaylistLoader( // if the vhs-json object included the media playlist, use the media playlist\n          // as provided, otherwise use the resolved URI to load the playlist\n          properties.playlists ? properties.playlists[0] : properties.resolvedUri, vhs, requestOptions);\n        }\n\n        properties = videojs.mergeOptions({\n          id: variantLabel,\n          playlistLoader: playlistLoader\n        }, properties);\n        setupListeners[type](type, properties.playlistLoader, settings);\n        groups[groupId].push(properties);\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          var track = tech.addRemoteTextTrack({\n            id: variantLabel,\n            kind: 'subtitles',\n            \"default\": properties[\"default\"] && properties.autoselect,\n            language: properties.language,\n            label: variantLabel\n          }, false).track;\n          tracks[variantLabel] = track;\n        }\n      }\n    } // setup single error event handler for the segment loader\n\n\n    segmentLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup TextTracks for the closed-caption groups\n   *\n   * @param {String} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize['CLOSED-CAPTIONS']\n   */\n  'CLOSED-CAPTIONS': function CLOSEDCAPTIONS(type, settings) {\n    var tech = settings.tech,\n        mediaGroups = settings.master.mediaGroups,\n        _settings$mediaTypes$3 = settings.mediaTypes[type],\n        groups = _settings$mediaTypes$3.groups,\n        tracks = _settings$mediaTypes$3.tracks;\n\n    for (var groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (var variantLabel in mediaGroups[type][groupId]) {\n        var properties = mediaGroups[type][groupId][variantLabel]; // Look for either 608 (CCn) or 708 (SERVICEn) caption services\n\n        if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {\n          continue;\n        }\n\n        var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n        var newProps = {\n          label: variantLabel,\n          language: properties.language,\n          instreamId: properties.instreamId,\n          \"default\": properties[\"default\"] && properties.autoselect\n        };\n\n        if (captionServices[newProps.instreamId]) {\n          newProps = videojs.mergeOptions(newProps, captionServices[newProps.instreamId]);\n        }\n\n        if (newProps[\"default\"] === undefined) {\n          delete newProps[\"default\"];\n        } // No PlaylistLoader is required for Closed-Captions because the captions are\n        // embedded within the video stream\n\n\n        groups[groupId].push(videojs.mergeOptions({\n          id: variantLabel\n        }, properties));\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          var track = tech.addRemoteTextTrack({\n            id: newProps.instreamId,\n            kind: 'captions',\n            \"default\": newProps[\"default\"],\n            language: newProps.language,\n            label: newProps.label\n          }, false).track;\n          tracks[variantLabel] = track;\n        }\n      }\n    }\n  }\n};\n\nvar groupMatch = function groupMatch(list, media) {\n  for (var i = 0; i < list.length; i++) {\n    if (playlistMatch(media, list[i])) {\n      return true;\n    }\n\n    if (list[i].playlists && groupMatch(list[i].playlists, media)) {\n      return true;\n    }\n  }\n\n  return false;\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Function that returns the active media group for the provided type. Takes an\n *         optional parameter {TextTrack} track. If no track is provided, a list of all\n *         variants in the group, otherwise the variant corresponding to the provided\n *         track is returned.\n * @function activeGroup\n */\n\n\nvar activeGroup = function activeGroup(type, settings) {\n  return function (track) {\n    var masterPlaylistLoader = settings.masterPlaylistLoader,\n        groups = settings.mediaTypes[type].groups;\n    var media = masterPlaylistLoader.media();\n\n    if (!media) {\n      return null;\n    }\n\n    var variants = null; // set to variants to main media active group\n\n    if (media.attributes[type]) {\n      variants = groups[media.attributes[type]];\n    }\n\n    var groupKeys = Object.keys(groups);\n\n    if (!variants) {\n      // find the masterPlaylistLoader media\n      // that is in a media group if we are dealing\n      // with audio only\n      if (type === 'AUDIO' && groupKeys.length > 1 && isAudioOnly(settings.master)) {\n        for (var i = 0; i < groupKeys.length; i++) {\n          var groupPropertyList = groups[groupKeys[i]];\n\n          if (groupMatch(groupPropertyList, media)) {\n            variants = groupPropertyList;\n            break;\n          }\n        } // use the main group if it exists\n\n      } else if (groups.main) {\n        variants = groups.main; // only one group, use that one\n      } else if (groupKeys.length === 1) {\n        variants = groups[groupKeys[0]];\n      }\n    }\n\n    if (typeof track === 'undefined') {\n      return variants;\n    }\n\n    if (track === null || !variants) {\n      // An active track was specified so a corresponding group is expected. track === null\n      // means no track is currently active so there is no corresponding group\n      return null;\n    }\n\n    return variants.filter(function (props) {\n      return props.id === track.id;\n    })[0] || null;\n  };\n};\n\nvar activeTrack = {\n  /**\n   * Returns a function used to get the active track of type provided\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Function that returns the active media track for the provided type. Returns\n   *         null if no track is active\n   * @function activeTrack.AUDIO\n   */\n  AUDIO: function AUDIO(type, settings) {\n    return function () {\n      var tracks = settings.mediaTypes[type].tracks;\n\n      for (var id in tracks) {\n        if (tracks[id].enabled) {\n          return tracks[id];\n        }\n      }\n\n      return null;\n    };\n  },\n\n  /**\n   * Returns a function used to get the active track of type provided\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Function that returns the active media track for the provided type. Returns\n   *         null if no track is active\n   * @function activeTrack.SUBTITLES\n   */\n  SUBTITLES: function SUBTITLES(type, settings) {\n    return function () {\n      var tracks = settings.mediaTypes[type].tracks;\n\n      for (var id in tracks) {\n        if (tracks[id].mode === 'showing' || tracks[id].mode === 'hidden') {\n          return tracks[id];\n        }\n      }\n\n      return null;\n    };\n  }\n};\n\nvar getActiveGroup = function getActiveGroup(type, _ref) {\n  var mediaTypes = _ref.mediaTypes;\n  return function () {\n    var activeTrack_ = mediaTypes[type].activeTrack();\n\n    if (!activeTrack_) {\n      return null;\n    }\n\n    return mediaTypes[type].activeGroup(activeTrack_);\n  };\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the master manifest.\n *\n * @param {Object} settings\n *        Object containing required information for setting up the media groups\n * @param {Tech} settings.tech\n *        The tech of the player\n * @param {Object} settings.requestOptions\n *        XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.masterPlaylistLoader\n *        PlaylistLoader for the master source\n * @param {VhsHandler} settings.vhs\n *        VHS SourceHandler\n * @param {Object} settings.master\n *        The parsed master manifest\n * @param {Object} settings.mediaTypes\n *        Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.blacklistCurrentPlaylist\n *        Blacklists the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\n\nvar setupMediaGroups = function setupMediaGroups(settings) {\n  ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n    initialize[type](type, settings);\n  });\n  var mediaTypes = settings.mediaTypes,\n      masterPlaylistLoader = settings.masterPlaylistLoader,\n      tech = settings.tech,\n      vhs = settings.vhs,\n      _settings$segmentLoad3 = settings.segmentLoaders,\n      audioSegmentLoader = _settings$segmentLoad3['AUDIO'],\n      mainSegmentLoader = _settings$segmentLoad3.main; // setup active group and track getters and change event handlers\n\n  ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n    mediaTypes[type].activeGroup = activeGroup(type, settings);\n    mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n    mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n    mediaTypes[type].onGroupChanging = onGroupChanging(type, settings);\n    mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n    mediaTypes[type].getActiveGroup = getActiveGroup(type, settings);\n  }); // DO NOT enable the default subtitle or caption track.\n  // DO enable the default audio track\n\n  var audioGroup = mediaTypes.AUDIO.activeGroup();\n\n  if (audioGroup) {\n    var groupId = (audioGroup.filter(function (group) {\n      return group[\"default\"];\n    })[0] || audioGroup[0]).id;\n    mediaTypes.AUDIO.tracks[groupId].enabled = true;\n    mediaTypes.AUDIO.onGroupChanged();\n    mediaTypes.AUDIO.onTrackChanged();\n    var activeAudioGroup = mediaTypes.AUDIO.getActiveGroup(); // a similar check for handling setAudio on each loader is run again each time the\n    // track is changed, but needs to be handled here since the track may not be considered\n    // changed on the first call to onTrackChanged\n\n    if (!activeAudioGroup.playlistLoader) {\n      // either audio is muxed with video or the stream is audio only\n      mainSegmentLoader.setAudio(true);\n    } else {\n      // audio is demuxed\n      mainSegmentLoader.setAudio(false);\n      audioSegmentLoader.setAudio(true);\n    }\n  }\n\n  masterPlaylistLoader.on('mediachange', function () {\n    ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n      return mediaTypes[type].onGroupChanged();\n    });\n  });\n  masterPlaylistLoader.on('mediachanging', function () {\n    ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n      return mediaTypes[type].onGroupChanging();\n    });\n  }); // custom audio track change event handler for usage event\n\n  var onAudioTrackChanged = function onAudioTrackChanged() {\n    mediaTypes.AUDIO.onTrackChanged();\n    tech.trigger({\n      type: 'usage',\n      name: 'vhs-audio-change'\n    });\n    tech.trigger({\n      type: 'usage',\n      name: 'hls-audio-change'\n    });\n  };\n\n  tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n  tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n  vhs.on('dispose', function () {\n    tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n    tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n  }); // clear existing audio tracks and add the ones we just created\n\n  tech.clearTracks('audio');\n\n  for (var id in mediaTypes.AUDIO.tracks) {\n    tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n  }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n *         Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\n\nvar createMediaTypes = function createMediaTypes() {\n  var mediaTypes = {};\n  ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n    mediaTypes[type] = {\n      groups: {},\n      tracks: {},\n      activePlaylistLoader: null,\n      activeGroup: noop,\n      activeTrack: noop,\n      getActiveGroup: noop,\n      onGroupChanged: noop,\n      onTrackChanged: noop,\n      lastTrack_: null,\n      logger_: logger(\"MediaGroups[\" + type + \"]\")\n    };\n  });\n  return mediaTypes;\n};\n\nvar ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;\nvar Vhs$1; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nvar loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred', 'mediaAppends'];\n\nvar sumLoaderStat = function sumLoaderStat(stat) {\n  return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\n\nvar shouldSwitchToMedia = function shouldSwitchToMedia(_ref) {\n  var currentPlaylist = _ref.currentPlaylist,\n      buffered = _ref.buffered,\n      currentTime = _ref.currentTime,\n      nextPlaylist = _ref.nextPlaylist,\n      bufferLowWaterLine = _ref.bufferLowWaterLine,\n      bufferHighWaterLine = _ref.bufferHighWaterLine,\n      duration = _ref.duration,\n      experimentalBufferBasedABR = _ref.experimentalBufferBasedABR,\n      log = _ref.log; // we have no other playlist to switch to\n\n  if (!nextPlaylist) {\n    videojs.log.warn('We received no playlist to switch to. Please check your stream.');\n    return false;\n  }\n\n  var sharedLogLine = \"allowing switch \" + (currentPlaylist && currentPlaylist.id || 'null') + \" -> \" + nextPlaylist.id;\n\n  if (!currentPlaylist) {\n    log(sharedLogLine + \" as current playlist is not set\");\n    return true;\n  } // no need to switch if playlist is the same\n\n\n  if (nextPlaylist.id === currentPlaylist.id) {\n    return false;\n  } // determine if current time is in a buffered range.\n\n\n  var isBuffered = Boolean(findRange(buffered, currentTime).length); // If the playlist is live, then we want to not take low water line into account.\n  // This is because in LIVE, the player plays 3 segments from the end of the\n  // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n  // in those segments, a viewer will never experience a rendition upswitch.\n\n  if (!currentPlaylist.endList) {\n    // For LLHLS live streams, don't switch renditions before playback has started, as it almost\n    // doubles the time to first playback.\n    if (!isBuffered && typeof currentPlaylist.partTargetDuration === 'number') {\n      log(\"not \" + sharedLogLine + \" as current playlist is live llhls, but currentTime isn't in buffered.\");\n      return false;\n    }\n\n    log(sharedLogLine + \" as current playlist is live\");\n    return true;\n  }\n\n  var forwardBuffer = timeAheadOf(buffered, currentTime);\n  var maxBufferLowWaterLine = experimentalBufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE; // For the same reason as LIVE, we ignore the low water line when the VOD\n  // duration is below the max potential low water line\n\n  if (duration < maxBufferLowWaterLine) {\n    log(sharedLogLine + \" as duration < max low water line (\" + duration + \" < \" + maxBufferLowWaterLine + \")\");\n    return true;\n  }\n\n  var nextBandwidth = nextPlaylist.attributes.BANDWIDTH;\n  var currBandwidth = currentPlaylist.attributes.BANDWIDTH; // when switching down, if our buffer is lower than the high water line,\n  // we can switch down\n\n  if (nextBandwidth < currBandwidth && (!experimentalBufferBasedABR || forwardBuffer < bufferHighWaterLine)) {\n    var logLine = sharedLogLine + \" as next bandwidth < current bandwidth (\" + nextBandwidth + \" < \" + currBandwidth + \")\";\n\n    if (experimentalBufferBasedABR) {\n      logLine += \" and forwardBuffer < bufferHighWaterLine (\" + forwardBuffer + \" < \" + bufferHighWaterLine + \")\";\n    }\n\n    log(logLine);\n    return true;\n  } // and if our buffer is higher than the low water line,\n  // we can switch up\n\n\n  if ((!experimentalBufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {\n    var _logLine = sharedLogLine + \" as forwardBuffer >= bufferLowWaterLine (\" + forwardBuffer + \" >= \" + bufferLowWaterLine + \")\";\n\n    if (experimentalBufferBasedABR) {\n      _logLine += \" and next bandwidth > current bandwidth (\" + nextBandwidth + \" > \" + currBandwidth + \")\";\n    }\n\n    log(_logLine);\n    return true;\n  }\n\n  log(\"not \" + sharedLogLine + \" as no switching criteria met\");\n  return false;\n};\n/**\n * the master playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a master playlist and a series of audio playlists\n * if they are available\n *\n * @class MasterPlaylistController\n * @extends videojs.EventTarget\n */\n\n\nvar MasterPlaylistController = /*#__PURE__*/function (_videojs$EventTarget) {\n  _inheritsLoose(MasterPlaylistController, _videojs$EventTarget);\n\n  function MasterPlaylistController(options) {\n    var _this;\n\n    _this = _videojs$EventTarget.call(this) || this;\n    var src = options.src,\n        handleManifestRedirects = options.handleManifestRedirects,\n        withCredentials = options.withCredentials,\n        tech = options.tech,\n        bandwidth = options.bandwidth,\n        externVhs = options.externVhs,\n        useCueTags = options.useCueTags,\n        blacklistDuration = options.blacklistDuration,\n        enableLowInitialPlaylist = options.enableLowInitialPlaylist,\n        sourceType = options.sourceType,\n        cacheEncryptionKeys = options.cacheEncryptionKeys,\n        experimentalBufferBasedABR = options.experimentalBufferBasedABR,\n        experimentalLeastPixelDiffSelector = options.experimentalLeastPixelDiffSelector,\n        captionServices = options.captionServices;\n\n    if (!src) {\n      throw new Error('A non-empty playlist URL or JSON manifest string is required');\n    }\n\n    var maxPlaylistRetries = options.maxPlaylistRetries;\n\n    if (maxPlaylistRetries === null || typeof maxPlaylistRetries === 'undefined') {\n      maxPlaylistRetries = Infinity;\n    }\n\n    Vhs$1 = externVhs;\n    _this.experimentalBufferBasedABR = Boolean(experimentalBufferBasedABR);\n    _this.experimentalLeastPixelDiffSelector = Boolean(experimentalLeastPixelDiffSelector);\n    _this.withCredentials = withCredentials;\n    _this.tech_ = tech;\n    _this.vhs_ = tech.vhs;\n    _this.sourceType_ = sourceType;\n    _this.useCueTags_ = useCueTags;\n    _this.blacklistDuration = blacklistDuration;\n    _this.maxPlaylistRetries = maxPlaylistRetries;\n    _this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n\n    if (_this.useCueTags_) {\n      _this.cueTagsTrack_ = _this.tech_.addTextTrack('metadata', 'ad-cues');\n      _this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n    }\n\n    _this.requestOptions_ = {\n      withCredentials: withCredentials,\n      handleManifestRedirects: handleManifestRedirects,\n      maxPlaylistRetries: maxPlaylistRetries,\n      timeout: null\n    };\n\n    _this.on('error', _this.pauseLoading);\n\n    _this.mediaTypes_ = createMediaTypes();\n    _this.mediaSource = new window$1.MediaSource();\n    _this.handleDurationChange_ = _this.handleDurationChange_.bind(_assertThisInitialized(_this));\n    _this.handleSourceOpen_ = _this.handleSourceOpen_.bind(_assertThisInitialized(_this));\n    _this.handleSourceEnded_ = _this.handleSourceEnded_.bind(_assertThisInitialized(_this));\n\n    _this.mediaSource.addEventListener('durationchange', _this.handleDurationChange_); // load the media source into the player\n\n\n    _this.mediaSource.addEventListener('sourceopen', _this.handleSourceOpen_);\n\n    _this.mediaSource.addEventListener('sourceended', _this.handleSourceEnded_); // we don't have to handle sourceclose since dispose will handle termination of\n    // everything, and the MediaSource should not be detached without a proper disposal\n\n\n    _this.seekable_ = videojs.createTimeRanges();\n    _this.hasPlayed_ = false;\n    _this.syncController_ = new SyncController(options);\n    _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n      kind: 'metadata',\n      label: 'segment-metadata'\n    }, false).track;\n    _this.decrypter_ = new Decrypter();\n    _this.sourceUpdater_ = new SourceUpdater(_this.mediaSource);\n    _this.inbandTextTracks_ = {};\n    _this.timelineChangeController_ = new TimelineChangeController();\n    var segmentLoaderSettings = {\n      vhs: _this.vhs_,\n      parse708captions: options.parse708captions,\n      useDtsForTimestampOffset: options.useDtsForTimestampOffset,\n      captionServices: captionServices,\n      mediaSource: _this.mediaSource,\n      currentTime: _this.tech_.currentTime.bind(_this.tech_),\n      seekable: function seekable() {\n        return _this.seekable();\n      },\n      seeking: function seeking() {\n        return _this.tech_.seeking();\n      },\n      duration: function duration() {\n        return _this.duration();\n      },\n      hasPlayed: function hasPlayed() {\n        return _this.hasPlayed_;\n      },\n      goalBufferLength: function goalBufferLength() {\n        return _this.goalBufferLength();\n      },\n      bandwidth: bandwidth,\n      syncController: _this.syncController_,\n      decrypter: _this.decrypter_,\n      sourceType: _this.sourceType_,\n      inbandTextTracks: _this.inbandTextTracks_,\n      cacheEncryptionKeys: cacheEncryptionKeys,\n      sourceUpdater: _this.sourceUpdater_,\n      timelineChangeController: _this.timelineChangeController_,\n      experimentalExactManifestTimings: options.experimentalExactManifestTimings\n    }; // The source type check not only determines whether a special DASH playlist loader\n    // should be used, but also covers the case where the provided src is a vhs-json\n    // manifest object (instead of a URL). In the case of vhs-json, the default\n    // PlaylistLoader should be used.\n\n    _this.masterPlaylistLoader_ = _this.sourceType_ === 'dash' ? new DashPlaylistLoader(src, _this.vhs_, _this.requestOptions_) : new PlaylistLoader(src, _this.vhs_, _this.requestOptions_);\n\n    _this.setupMasterPlaylistLoaderListeners_(); // setup segment loaders\n    // combined audio/video or just video when alternate audio track is selected\n\n\n    _this.mainSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n      segmentMetadataTrack: _this.segmentMetadataTrack_,\n      loaderType: 'main'\n    }), options); // alternate audio track\n\n    _this.audioSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n      loaderType: 'audio'\n    }), options);\n    _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n      loaderType: 'vtt',\n      featuresNativeTextTracks: _this.tech_.featuresNativeTextTracks\n    }), options);\n\n    _this.setupSegmentLoaderListeners_();\n\n    if (_this.experimentalBufferBasedABR) {\n      _this.masterPlaylistLoader_.one('loadedplaylist', function () {\n        return _this.startABRTimer_();\n      });\n\n      _this.tech_.on('pause', function () {\n        return _this.stopABRTimer_();\n      });\n\n      _this.tech_.on('play', function () {\n        return _this.startABRTimer_();\n      });\n    } // Create SegmentLoader stat-getters\n    // mediaRequests_\n    // mediaRequestsAborted_\n    // mediaRequestsTimedout_\n    // mediaRequestsErrored_\n    // mediaTransferDuration_\n    // mediaBytesTransferred_\n    // mediaAppends_\n\n\n    loaderStats.forEach(function (stat) {\n      _this[stat + '_'] = sumLoaderStat.bind(_assertThisInitialized(_this), stat);\n    });\n    _this.logger_ = logger('MPC');\n    _this.triggeredFmp4Usage = false;\n\n    if (_this.tech_.preload() === 'none') {\n      _this.loadOnPlay_ = function () {\n        _this.loadOnPlay_ = null;\n\n        _this.masterPlaylistLoader_.load();\n      };\n\n      _this.tech_.one('play', _this.loadOnPlay_);\n    } else {\n      _this.masterPlaylistLoader_.load();\n    }\n\n    _this.timeToLoadedData__ = -1;\n    _this.mainAppendsToLoadedData__ = -1;\n    _this.audioAppendsToLoadedData__ = -1;\n    var event = _this.tech_.preload() === 'none' ? 'play' : 'loadstart'; // start the first frame timer on loadstart or play (for preload none)\n\n    _this.tech_.one(event, function () {\n      var timeToLoadedDataStart = Date.now();\n\n      _this.tech_.one('loadeddata', function () {\n        _this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;\n        _this.mainAppendsToLoadedData__ = _this.mainSegmentLoader_.mediaAppends;\n        _this.audioAppendsToLoadedData__ = _this.audioSegmentLoader_.mediaAppends;\n      });\n    });\n\n    return _this;\n  }\n\n  var _proto = MasterPlaylistController.prototype;\n\n  _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() {\n    return this.mainAppendsToLoadedData__;\n  };\n\n  _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() {\n    return this.audioAppendsToLoadedData__;\n  };\n\n  _proto.appendsToLoadedData_ = function appendsToLoadedData_() {\n    var main = this.mainAppendsToLoadedData_();\n    var audio = this.audioAppendsToLoadedData_();\n\n    if (main === -1 || audio === -1) {\n      return -1;\n    }\n\n    return main + audio;\n  };\n\n  _proto.timeToLoadedData_ = function timeToLoadedData_() {\n    return this.timeToLoadedData__;\n  }\n  /**\n   * Run selectPlaylist and switch to the new playlist if we should\n   *\n   * @private\n   *\n   */\n  ;\n\n  _proto.checkABR_ = function checkABR_() {\n    var nextPlaylist = this.selectPlaylist();\n\n    if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {\n      this.switchMedia_(nextPlaylist, 'abr');\n    }\n  };\n\n  _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) {\n    var oldMedia = this.media();\n    var oldId = oldMedia && (oldMedia.id || oldMedia.uri);\n    var newId = playlist.id || playlist.uri;\n\n    if (oldId && oldId !== newId) {\n      this.logger_(\"switch media \" + oldId + \" -> \" + newId + \" from \" + cause);\n      this.tech_.trigger({\n        type: 'usage',\n        name: \"vhs-rendition-change-\" + cause\n      });\n    }\n\n    this.masterPlaylistLoader_.media(playlist, delay);\n  }\n  /**\n   * Start a timer that periodically calls checkABR_\n   *\n   * @private\n   */\n  ;\n\n  _proto.startABRTimer_ = function startABRTimer_() {\n    var _this2 = this;\n\n    this.stopABRTimer_();\n    this.abrTimer_ = window$1.setInterval(function () {\n      return _this2.checkABR_();\n    }, 250);\n  }\n  /**\n   * Stop the timer that periodically calls checkABR_\n   *\n   * @private\n   */\n  ;\n\n  _proto.stopABRTimer_ = function stopABRTimer_() {\n    // if we're scrubbing, we don't need to pause.\n    // This getter will be added to Video.js in version 7.11.\n    if (this.tech_.scrubbing && this.tech_.scrubbing()) {\n      return;\n    }\n\n    window$1.clearInterval(this.abrTimer_);\n    this.abrTimer_ = null;\n  }\n  /**\n   * Get a list of playlists for the currently selected audio playlist\n   *\n   * @return {Array} the array of audio playlists\n   */\n  ;\n\n  _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() {\n    var master = this.master();\n    var defaultPlaylists = master && master.playlists || []; // if we don't have any audio groups then we can only\n    // assume that the audio tracks are contained in masters\n    // playlist array, use that or an empty array.\n\n    if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) {\n      return defaultPlaylists;\n    }\n\n    var AUDIO = master.mediaGroups.AUDIO;\n    var groupKeys = Object.keys(AUDIO);\n    var track; // get the current active track\n\n    if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {\n      track = this.mediaTypes_.AUDIO.activeTrack(); // or get the default track from master if mediaTypes_ isn't setup yet\n    } else {\n      // default group is `main` or just the first group.\n      var defaultGroup = AUDIO.main || groupKeys.length && AUDIO[groupKeys[0]];\n\n      for (var label in defaultGroup) {\n        if (defaultGroup[label][\"default\"]) {\n          track = {\n            label: label\n          };\n          break;\n        }\n      }\n    } // no active track no playlists.\n\n\n    if (!track) {\n      return defaultPlaylists;\n    }\n\n    var playlists = []; // get all of the playlists that are possible for the\n    // active track.\n\n    for (var group in AUDIO) {\n      if (AUDIO[group][track.label]) {\n        var properties = AUDIO[group][track.label];\n\n        if (properties.playlists && properties.playlists.length) {\n          playlists.push.apply(playlists, properties.playlists);\n        } else if (properties.uri) {\n          playlists.push(properties);\n        } else if (master.playlists.length) {\n          // if an audio group does not have a uri\n          // see if we have main playlists that use it as a group.\n          // if we do then add those to the playlists list.\n          for (var i = 0; i < master.playlists.length; i++) {\n            var playlist = master.playlists[i];\n\n            if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {\n              playlists.push(playlist);\n            }\n          }\n        }\n      }\n    }\n\n    if (!playlists.length) {\n      return defaultPlaylists;\n    }\n\n    return playlists;\n  }\n  /**\n   * Register event handlers on the master playlist loader. A helper\n   * function for construction time.\n   *\n   * @private\n   */\n  ;\n\n  _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() {\n    var _this3 = this;\n\n    this.masterPlaylistLoader_.on('loadedmetadata', function () {\n      var media = _this3.masterPlaylistLoader_.media();\n\n      var requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n      // timeout the request.\n\n      if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {\n        _this3.requestOptions_.timeout = 0;\n      } else {\n        _this3.requestOptions_.timeout = requestTimeout;\n      } // if this isn't a live video and preload permits, start\n      // downloading segments\n\n\n      if (media.endList && _this3.tech_.preload() !== 'none') {\n        _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);\n\n        _this3.mainSegmentLoader_.load();\n      }\n\n      setupMediaGroups({\n        sourceType: _this3.sourceType_,\n        segmentLoaders: {\n          AUDIO: _this3.audioSegmentLoader_,\n          SUBTITLES: _this3.subtitleSegmentLoader_,\n          main: _this3.mainSegmentLoader_\n        },\n        tech: _this3.tech_,\n        requestOptions: _this3.requestOptions_,\n        masterPlaylistLoader: _this3.masterPlaylistLoader_,\n        vhs: _this3.vhs_,\n        master: _this3.master(),\n        mediaTypes: _this3.mediaTypes_,\n        blacklistCurrentPlaylist: _this3.blacklistCurrentPlaylist.bind(_this3)\n      });\n\n      _this3.triggerPresenceUsage_(_this3.master(), media);\n\n      _this3.setupFirstPlay();\n\n      if (!_this3.mediaTypes_.AUDIO.activePlaylistLoader || _this3.mediaTypes_.AUDIO.activePlaylistLoader.media()) {\n        _this3.trigger('selectedinitialmedia');\n      } else {\n        // We must wait for the active audio playlist loader to\n        // finish setting up before triggering this event so the\n        // representations API and EME setup is correct\n        _this3.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', function () {\n          _this3.trigger('selectedinitialmedia');\n        });\n      }\n    });\n    this.masterPlaylistLoader_.on('loadedplaylist', function () {\n      if (_this3.loadOnPlay_) {\n        _this3.tech_.off('play', _this3.loadOnPlay_);\n      }\n\n      var updatedPlaylist = _this3.masterPlaylistLoader_.media();\n\n      if (!updatedPlaylist) {\n        // exclude any variants that are not supported by the browser before selecting\n        // an initial media as the playlist selectors do not consider browser support\n        _this3.excludeUnsupportedVariants_();\n\n        var selectedMedia;\n\n        if (_this3.enableLowInitialPlaylist) {\n          selectedMedia = _this3.selectInitialPlaylist();\n        }\n\n        if (!selectedMedia) {\n          selectedMedia = _this3.selectPlaylist();\n        }\n\n        if (!selectedMedia || !_this3.shouldSwitchToMedia_(selectedMedia)) {\n          return;\n        }\n\n        _this3.initialMedia_ = selectedMedia;\n\n        _this3.switchMedia_(_this3.initialMedia_, 'initial'); // Under the standard case where a source URL is provided, loadedplaylist will\n        // fire again since the playlist will be requested. In the case of vhs-json\n        // (where the manifest object is provided as the source), when the media\n        // playlist's `segments` list is already available, a media playlist won't be\n        // requested, and loadedplaylist won't fire again, so the playlist handler must be\n        // called on its own here.\n\n\n        var haveJsonSource = _this3.sourceType_ === 'vhs-json' && _this3.initialMedia_.segments;\n\n        if (!haveJsonSource) {\n          return;\n        }\n\n        updatedPlaylist = _this3.initialMedia_;\n      }\n\n      _this3.handleUpdatedMediaPlaylist(updatedPlaylist);\n    });\n    this.masterPlaylistLoader_.on('error', function () {\n      _this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error);\n    });\n    this.masterPlaylistLoader_.on('mediachanging', function () {\n      _this3.mainSegmentLoader_.abort();\n\n      _this3.mainSegmentLoader_.pause();\n    });\n    this.masterPlaylistLoader_.on('mediachange', function () {\n      var media = _this3.masterPlaylistLoader_.media();\n\n      var requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n      // timeout the request.\n\n      if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {\n        _this3.requestOptions_.timeout = 0;\n      } else {\n        _this3.requestOptions_.timeout = requestTimeout;\n      } // TODO: Create a new event on the PlaylistLoader that signals\n      // that the segments have changed in some way and use that to\n      // update the SegmentLoader instead of doing it twice here and\n      // on `loadedplaylist`\n\n\n      _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);\n\n      _this3.mainSegmentLoader_.load();\n\n      _this3.tech_.trigger({\n        type: 'mediachange',\n        bubbles: true\n      });\n    });\n    this.masterPlaylistLoader_.on('playlistunchanged', function () {\n      var updatedPlaylist = _this3.masterPlaylistLoader_.media(); // ignore unchanged playlists that have already been\n      // excluded for not-changing. We likely just have a really slowly updating\n      // playlist.\n\n\n      if (updatedPlaylist.lastExcludeReason_ === 'playlist-unchanged') {\n        return;\n      }\n\n      var playlistOutdated = _this3.stuckAtPlaylistEnd_(updatedPlaylist);\n\n      if (playlistOutdated) {\n        // Playlist has stopped updating and we're stuck at its end. Try to\n        // blacklist it and switch to another playlist in the hope that that\n        // one is updating (and give the player a chance to re-adjust to the\n        // safe live point).\n        _this3.blacklistCurrentPlaylist({\n          message: 'Playlist no longer updating.',\n          reason: 'playlist-unchanged'\n        }); // useful for monitoring QoS\n\n\n        _this3.tech_.trigger('playliststuck');\n      }\n    });\n    this.masterPlaylistLoader_.on('renditiondisabled', function () {\n      _this3.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-rendition-disabled'\n      });\n\n      _this3.tech_.trigger({\n        type: 'usage',\n        name: 'hls-rendition-disabled'\n      });\n    });\n    this.masterPlaylistLoader_.on('renditionenabled', function () {\n      _this3.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-rendition-enabled'\n      });\n\n      _this3.tech_.trigger({\n        type: 'usage',\n        name: 'hls-rendition-enabled'\n      });\n    });\n  }\n  /**\n   * Given an updated media playlist (whether it was loaded for the first time, or\n   * refreshed for live playlists), update any relevant properties and state to reflect\n   * changes in the media that should be accounted for (e.g., cues and duration).\n   *\n   * @param {Object} updatedPlaylist the updated media playlist object\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) {\n    if (this.useCueTags_) {\n      this.updateAdCues_(updatedPlaylist);\n    } // TODO: Create a new event on the PlaylistLoader that signals\n    // that the segments have changed in some way and use that to\n    // update the SegmentLoader instead of doing it twice here and\n    // on `mediachange`\n\n\n    this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);\n    this.updateDuration(!updatedPlaylist.endList); // If the player isn't paused, ensure that the segment loader is running,\n    // as it is possible that it was temporarily stopped while waiting for\n    // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n    if (!this.tech_.paused()) {\n      this.mainSegmentLoader_.load();\n\n      if (this.audioSegmentLoader_) {\n        this.audioSegmentLoader_.load();\n      }\n    }\n  }\n  /**\n   * A helper function for triggerring presence usage events once per source\n   *\n   * @private\n   */\n  ;\n\n  _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) {\n    var mediaGroups = master.mediaGroups || {};\n    var defaultDemuxed = true;\n    var audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n\n    for (var mediaGroup in mediaGroups.AUDIO) {\n      for (var label in mediaGroups.AUDIO[mediaGroup]) {\n        var properties = mediaGroups.AUDIO[mediaGroup][label];\n\n        if (!properties.uri) {\n          defaultDemuxed = false;\n        }\n      }\n    }\n\n    if (defaultDemuxed) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-demuxed'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-demuxed'\n      });\n    }\n\n    if (Object.keys(mediaGroups.SUBTITLES).length) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-webvtt'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-webvtt'\n      });\n    }\n\n    if (Vhs$1.Playlist.isAes(media)) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-aes'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-aes'\n      });\n    }\n\n    if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-alternate-audio'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-alternate-audio'\n      });\n    }\n\n    if (this.useCueTags_) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-playlist-cue-tags'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-playlist-cue-tags'\n      });\n    }\n  };\n\n  _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) {\n    var currentPlaylist = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_;\n    var currentTime = this.tech_.currentTime();\n    var bufferLowWaterLine = this.bufferLowWaterLine();\n    var bufferHighWaterLine = this.bufferHighWaterLine();\n    var buffered = this.tech_.buffered();\n    return shouldSwitchToMedia({\n      buffered: buffered,\n      currentTime: currentTime,\n      currentPlaylist: currentPlaylist,\n      nextPlaylist: nextPlaylist,\n      bufferLowWaterLine: bufferLowWaterLine,\n      bufferHighWaterLine: bufferHighWaterLine,\n      duration: this.duration(),\n      experimentalBufferBasedABR: this.experimentalBufferBasedABR,\n      log: this.logger_\n    });\n  }\n  /**\n   * Register event handlers on the segment loaders. A helper function\n   * for construction time.\n   *\n   * @private\n   */\n  ;\n\n  _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() {\n    var _this4 = this;\n\n    if (!this.experimentalBufferBasedABR) {\n      this.mainSegmentLoader_.on('bandwidthupdate', function () {\n        var nextPlaylist = _this4.selectPlaylist();\n\n        if (_this4.shouldSwitchToMedia_(nextPlaylist)) {\n          _this4.switchMedia_(nextPlaylist, 'bandwidthupdate');\n        }\n\n        _this4.tech_.trigger('bandwidthupdate');\n      });\n      this.mainSegmentLoader_.on('progress', function () {\n        _this4.trigger('progress');\n      });\n    }\n\n    this.mainSegmentLoader_.on('error', function () {\n      _this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error());\n    });\n    this.mainSegmentLoader_.on('appenderror', function () {\n      _this4.error = _this4.mainSegmentLoader_.error_;\n\n      _this4.trigger('error');\n    });\n    this.mainSegmentLoader_.on('syncinfoupdate', function () {\n      _this4.onSyncInfoUpdate_();\n    });\n    this.mainSegmentLoader_.on('timestampoffset', function () {\n      _this4.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-timestamp-offset'\n      });\n\n      _this4.tech_.trigger({\n        type: 'usage',\n        name: 'hls-timestamp-offset'\n      });\n    });\n    this.audioSegmentLoader_.on('syncinfoupdate', function () {\n      _this4.onSyncInfoUpdate_();\n    });\n    this.audioSegmentLoader_.on('appenderror', function () {\n      _this4.error = _this4.audioSegmentLoader_.error_;\n\n      _this4.trigger('error');\n    });\n    this.mainSegmentLoader_.on('ended', function () {\n      _this4.logger_('main segment loader ended');\n\n      _this4.onEndOfStream();\n    });\n    this.mainSegmentLoader_.on('earlyabort', function (event) {\n      // never try to early abort with the new ABR algorithm\n      if (_this4.experimentalBufferBasedABR) {\n        return;\n      }\n\n      _this4.delegateLoaders_('all', ['abort']);\n\n      _this4.blacklistCurrentPlaylist({\n        message: 'Aborted early because there isn\\'t enough bandwidth to complete the ' + 'request without rebuffering.'\n      }, ABORT_EARLY_BLACKLIST_SECONDS);\n    });\n\n    var updateCodecs = function updateCodecs() {\n      if (!_this4.sourceUpdater_.hasCreatedSourceBuffers()) {\n        return _this4.tryToCreateSourceBuffers_();\n      }\n\n      var codecs = _this4.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n\n      if (!codecs) {\n        return;\n      }\n\n      _this4.sourceUpdater_.addOrChangeSourceBuffers(codecs);\n    };\n\n    this.mainSegmentLoader_.on('trackinfo', updateCodecs);\n    this.audioSegmentLoader_.on('trackinfo', updateCodecs);\n    this.mainSegmentLoader_.on('fmp4', function () {\n      if (!_this4.triggeredFmp4Usage) {\n        _this4.tech_.trigger({\n          type: 'usage',\n          name: 'vhs-fmp4'\n        });\n\n        _this4.tech_.trigger({\n          type: 'usage',\n          name: 'hls-fmp4'\n        });\n\n        _this4.triggeredFmp4Usage = true;\n      }\n    });\n    this.audioSegmentLoader_.on('fmp4', function () {\n      if (!_this4.triggeredFmp4Usage) {\n        _this4.tech_.trigger({\n          type: 'usage',\n          name: 'vhs-fmp4'\n        });\n\n        _this4.tech_.trigger({\n          type: 'usage',\n          name: 'hls-fmp4'\n        });\n\n        _this4.triggeredFmp4Usage = true;\n      }\n    });\n    this.audioSegmentLoader_.on('ended', function () {\n      _this4.logger_('audioSegmentLoader ended');\n\n      _this4.onEndOfStream();\n    });\n  };\n\n  _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() {\n    return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n  }\n  /**\n   * Call load on our SegmentLoaders\n   */\n  ;\n\n  _proto.load = function load() {\n    this.mainSegmentLoader_.load();\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      this.audioSegmentLoader_.load();\n    }\n\n    if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n      this.subtitleSegmentLoader_.load();\n    }\n  }\n  /**\n   * Re-tune playback quality level for the current player\n   * conditions without performing destructive actions, like\n   * removing already buffered content\n   *\n   * @private\n   * @deprecated\n   */\n  ;\n\n  _proto.smoothQualityChange_ = function smoothQualityChange_(media) {\n    if (media === void 0) {\n      media = this.selectPlaylist();\n    }\n\n    this.fastQualityChange_(media);\n  }\n  /**\n   * Re-tune playback quality level for the current player\n   * conditions. This method will perform destructive actions like removing\n   * already buffered content in order to readjust the currently active\n   * playlist quickly. This is good for manual quality changes\n   *\n   * @private\n   */\n  ;\n\n  _proto.fastQualityChange_ = function fastQualityChange_(media) {\n    var _this5 = this;\n\n    if (media === void 0) {\n      media = this.selectPlaylist();\n    }\n\n    if (media === this.masterPlaylistLoader_.media()) {\n      this.logger_('skipping fastQualityChange because new media is same as old');\n      return;\n    }\n\n    this.switchMedia_(media, 'fast-quality'); // Delete all buffered data to allow an immediate quality switch, then seek to give\n    // the browser a kick to remove any cached frames from the previous rendtion (.04 seconds\n    // ahead is roughly the minimum that will accomplish this across a variety of content\n    // in IE and Edge, but seeking in place is sufficient on all other browsers)\n    // Edge/IE bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14600375/\n    // Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=651904\n\n    this.mainSegmentLoader_.resetEverything(function () {\n      // Since this is not a typical seek, we avoid the seekTo method which can cause segments\n      // from the previously enabled rendition to load before the new playlist has finished loading\n      if (videojs.browser.IE_VERSION || videojs.browser.IS_EDGE) {\n        _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04);\n      } else {\n        _this5.tech_.setCurrentTime(_this5.tech_.currentTime());\n      }\n    }); // don't need to reset audio as it is reset when media changes\n  }\n  /**\n   * Begin playback.\n   */\n  ;\n\n  _proto.play = function play() {\n    if (this.setupFirstPlay()) {\n      return;\n    }\n\n    if (this.tech_.ended()) {\n      this.tech_.setCurrentTime(0);\n    }\n\n    if (this.hasPlayed_) {\n      this.load();\n    }\n\n    var seekable = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n    // seek forward to the live point\n\n    if (this.tech_.duration() === Infinity) {\n      if (this.tech_.currentTime() < seekable.start(0)) {\n        return this.tech_.setCurrentTime(seekable.end(seekable.length - 1));\n      }\n    }\n  }\n  /**\n   * Seek to the latest media position if this is a live video and the\n   * player and video are loaded and initialized.\n   */\n  ;\n\n  _proto.setupFirstPlay = function setupFirstPlay() {\n    var _this6 = this;\n\n    var media = this.masterPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n    //  If 1) there is no active media\n    //     2) the player is paused\n    //     3) the first play has already been setup\n    // then exit early\n\n    if (!media || this.tech_.paused() || this.hasPlayed_) {\n      return false;\n    } // when the video is a live stream\n\n\n    if (!media.endList) {\n      var seekable = this.seekable();\n\n      if (!seekable.length) {\n        // without a seekable range, the player cannot seek to begin buffering at the live\n        // point\n        return false;\n      }\n\n      if (videojs.browser.IE_VERSION && this.tech_.readyState() === 0) {\n        // IE11 throws an InvalidStateError if you try to set currentTime while the\n        // readyState is 0, so it must be delayed until the tech fires loadedmetadata.\n        this.tech_.one('loadedmetadata', function () {\n          _this6.trigger('firstplay');\n\n          _this6.tech_.setCurrentTime(seekable.end(0));\n\n          _this6.hasPlayed_ = true;\n        });\n        return false;\n      } // trigger firstplay to inform the source handler to ignore the next seek event\n\n\n      this.trigger('firstplay'); // seek to the live point\n\n      this.tech_.setCurrentTime(seekable.end(0));\n    }\n\n    this.hasPlayed_ = true; // we can begin loading now that everything is ready\n\n    this.load();\n    return true;\n  }\n  /**\n   * handle the sourceopen event on the MediaSource\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleSourceOpen_ = function handleSourceOpen_() {\n    // Only attempt to create the source buffer if none already exist.\n    // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n    // after `endOfStream` has been called (in response to a seek for instance)\n    this.tryToCreateSourceBuffers_(); // if autoplay is enabled, begin playback. This is duplicative of\n    // code in video.js but is required because play() must be invoked\n    // *after* the media source has opened.\n\n    if (this.tech_.autoplay()) {\n      var playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n      // on browsers which return a promise\n\n      if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n        playPromise.then(null, function (e) {});\n      }\n    }\n\n    this.trigger('sourceopen');\n  }\n  /**\n   * handle the sourceended event on the MediaSource\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleSourceEnded_ = function handleSourceEnded_() {\n    if (!this.inbandTextTracks_.metadataTrack_) {\n      return;\n    }\n\n    var cues = this.inbandTextTracks_.metadataTrack_.cues;\n\n    if (!cues || !cues.length) {\n      return;\n    }\n\n    var duration = this.duration();\n    cues[cues.length - 1].endTime = isNaN(duration) || Math.abs(duration) === Infinity ? Number.MAX_VALUE : duration;\n  }\n  /**\n   * handle the durationchange event on the MediaSource\n   *\n   * @private\n   */\n  ;\n\n  _proto.handleDurationChange_ = function handleDurationChange_() {\n    this.tech_.trigger('durationchange');\n  }\n  /**\n   * Calls endOfStream on the media source when all active stream types have called\n   * endOfStream\n   *\n   * @param {string} streamType\n   *        Stream type of the segment loader that called endOfStream\n   * @private\n   */\n  ;\n\n  _proto.onEndOfStream = function onEndOfStream() {\n    var isEndOfStream = this.mainSegmentLoader_.ended_;\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_(); // if the audio playlist loader exists, then alternate audio is active\n\n      if (!mainMediaInfo || mainMediaInfo.hasVideo) {\n        // if we do not know if the main segment loader contains video yet or if we\n        // definitively know the main segment loader contains video, then we need to wait\n        // for both main and audio segment loaders to call endOfStream\n        isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n      } else {\n        // otherwise just rely on the audio loader\n        isEndOfStream = this.audioSegmentLoader_.ended_;\n      }\n    }\n\n    if (!isEndOfStream) {\n      return;\n    }\n\n    this.stopABRTimer_();\n    this.sourceUpdater_.endOfStream();\n  }\n  /**\n   * Check if a playlist has stopped being updated\n   *\n   * @param {Object} playlist the media playlist object\n   * @return {boolean} whether the playlist has stopped being updated or not\n   */\n  ;\n\n  _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) {\n    var seekable = this.seekable();\n\n    if (!seekable.length) {\n      // playlist doesn't have enough information to determine whether we are stuck\n      return false;\n    }\n\n    var expired = this.syncController_.getExpiredTime(playlist, this.duration());\n\n    if (expired === null) {\n      return false;\n    } // does not use the safe live end to calculate playlist end, since we\n    // don't want to say we are stuck while there is still content\n\n\n    var absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);\n    var currentTime = this.tech_.currentTime();\n    var buffered = this.tech_.buffered();\n\n    if (!buffered.length) {\n      // return true if the playhead reached the absolute end of the playlist\n      return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n    }\n\n    var bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n    // end of playlist\n\n    return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n  }\n  /**\n   * Blacklists a playlist when an error occurs for a set amount of time\n   * making it unavailable for selection by the rendition selection algorithm\n   * and then forces a new playlist (rendition) selection.\n   *\n   * @param {Object=} error an optional error that may include the playlist\n   * to blacklist\n   * @param {number=} blacklistDuration an optional number of seconds to blacklist the\n   * playlist\n   */\n  ;\n\n  _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) {\n    if (error === void 0) {\n      error = {};\n    } // If the `error` was generated by the playlist loader, it will contain\n    // the playlist we were trying to load (but failed) and that should be\n    // blacklisted instead of the currently selected playlist which is likely\n    // out-of-date in this scenario\n\n\n    var currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();\n    blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration; // If there is no current playlist, then an error occurred while we were\n    // trying to load the master OR while we were disposing of the tech\n\n    if (!currentPlaylist) {\n      this.error = error;\n\n      if (this.mediaSource.readyState !== 'open') {\n        this.trigger('error');\n      } else {\n        this.sourceUpdater_.endOfStream('network');\n      }\n\n      return;\n    }\n\n    currentPlaylist.playlistErrors_++;\n    var playlists = this.masterPlaylistLoader_.master.playlists;\n    var enabledPlaylists = playlists.filter(isEnabled);\n    var isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist; // Don't blacklist the only playlist unless it was blacklisted\n    // forever\n\n    if (playlists.length === 1 && blacklistDuration !== Infinity) {\n      videojs.log.warn(\"Problem encountered with playlist \" + currentPlaylist.id + \". \" + 'Trying again since it is the only playlist.');\n      this.tech_.trigger('retryplaylist'); // if this is a final rendition, we should delay\n\n      return this.masterPlaylistLoader_.load(isFinalRendition);\n    }\n\n    if (isFinalRendition) {\n      // Since we're on the final non-blacklisted playlist, and we're about to blacklist\n      // it, instead of erring the player or retrying this playlist, clear out the current\n      // blacklist. This allows other playlists to be attempted in case any have been\n      // fixed.\n      var reincluded = false;\n      playlists.forEach(function (playlist) {\n        // skip current playlist which is about to be blacklisted\n        if (playlist === currentPlaylist) {\n          return;\n        }\n\n        var excludeUntil = playlist.excludeUntil; // a playlist cannot be reincluded if it wasn't excluded to begin with.\n\n        if (typeof excludeUntil !== 'undefined' && excludeUntil !== Infinity) {\n          reincluded = true;\n          delete playlist.excludeUntil;\n        }\n      });\n\n      if (reincluded) {\n        videojs.log.warn('Removing other playlists from the exclusion list because the last ' + 'rendition is about to be excluded.'); // Technically we are retrying a playlist, in that we are simply retrying a previous\n        // playlist. This is needed for users relying on the retryplaylist event to catch a\n        // case where the player might be stuck and looping through \"dead\" playlists.\n\n        this.tech_.trigger('retryplaylist');\n      }\n    } // Blacklist this playlist\n\n\n    var excludeUntil;\n\n    if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) {\n      excludeUntil = Infinity;\n    } else {\n      excludeUntil = Date.now() + blacklistDuration * 1000;\n    }\n\n    currentPlaylist.excludeUntil = excludeUntil;\n\n    if (error.reason) {\n      currentPlaylist.lastExcludeReason_ = error.reason;\n    }\n\n    this.tech_.trigger('blacklistplaylist');\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'vhs-rendition-blacklisted'\n    });\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'hls-rendition-blacklisted'\n    }); // TODO: should we select a new playlist if this blacklist wasn't for the currentPlaylist?\n    // Would be something like media().id !=== currentPlaylist.id and we  would need something\n    // like `pendingMedia` in playlist loaders to check against that too. This will prevent us\n    // from loading a new playlist on any blacklist.\n    // Select a new playlist\n\n    var nextPlaylist = this.selectPlaylist();\n\n    if (!nextPlaylist) {\n      this.error = 'Playback cannot continue. No available working or supported playlists.';\n      this.trigger('error');\n      return;\n    }\n\n    var logFn = error.internal ? this.logger_ : videojs.log.warn;\n    var errorMessage = error.message ? ' ' + error.message : '';\n    logFn((error.internal ? 'Internal problem' : 'Problem') + \" encountered with playlist \" + currentPlaylist.id + \".\" + (errorMessage + \" Switching to playlist \" + nextPlaylist.id + \".\")); // if audio group changed reset audio loaders\n\n    if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) {\n      this.delegateLoaders_('audio', ['abort', 'pause']);\n    } // if subtitle group changed reset subtitle loaders\n\n\n    if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) {\n      this.delegateLoaders_('subtitle', ['abort', 'pause']);\n    }\n\n    this.delegateLoaders_('main', ['abort', 'pause']);\n    var delayDuration = nextPlaylist.targetDuration / 2 * 1000 || 5 * 1000;\n    var shouldDelay = typeof nextPlaylist.lastRequest === 'number' && Date.now() - nextPlaylist.lastRequest <= delayDuration; // delay if it's a final rendition or if the last refresh is sooner than half targetDuration\n\n    return this.switchMedia_(nextPlaylist, 'exclude', isFinalRendition || shouldDelay);\n  }\n  /**\n   * Pause all segment/playlist loaders\n   */\n  ;\n\n  _proto.pauseLoading = function pauseLoading() {\n    this.delegateLoaders_('all', ['abort', 'pause']);\n    this.stopABRTimer_();\n  }\n  /**\n   * Call a set of functions in order on playlist loaders, segment loaders,\n   * or both types of loaders.\n   *\n   * @param {string} filter\n   *        Filter loaders that should call fnNames using a string. Can be:\n   *        * all - run on all loaders\n   *        * audio - run on all audio loaders\n   *        * subtitle - run on all subtitle loaders\n   *        * main - run on the main/master loaders\n   *\n   * @param {Array|string} fnNames\n   *        A string or array of function names to call.\n   */\n  ;\n\n  _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) {\n    var _this7 = this;\n\n    var loaders = [];\n    var dontFilterPlaylist = filter === 'all';\n\n    if (dontFilterPlaylist || filter === 'main') {\n      loaders.push(this.masterPlaylistLoader_);\n    }\n\n    var mediaTypes = [];\n\n    if (dontFilterPlaylist || filter === 'audio') {\n      mediaTypes.push('AUDIO');\n    }\n\n    if (dontFilterPlaylist || filter === 'subtitle') {\n      mediaTypes.push('CLOSED-CAPTIONS');\n      mediaTypes.push('SUBTITLES');\n    }\n\n    mediaTypes.forEach(function (mediaType) {\n      var loader = _this7.mediaTypes_[mediaType] && _this7.mediaTypes_[mediaType].activePlaylistLoader;\n\n      if (loader) {\n        loaders.push(loader);\n      }\n    });\n    ['main', 'audio', 'subtitle'].forEach(function (name) {\n      var loader = _this7[name + \"SegmentLoader_\"];\n\n      if (loader && (filter === name || filter === 'all')) {\n        loaders.push(loader);\n      }\n    });\n    loaders.forEach(function (loader) {\n      return fnNames.forEach(function (fnName) {\n        if (typeof loader[fnName] === 'function') {\n          loader[fnName]();\n        }\n      });\n    });\n  }\n  /**\n   * set the current time on all segment loaders\n   *\n   * @param {TimeRange} currentTime the current time to set\n   * @return {TimeRange} the current time\n   */\n  ;\n\n  _proto.setCurrentTime = function setCurrentTime(currentTime) {\n    var buffered = findRange(this.tech_.buffered(), currentTime);\n\n    if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {\n      // return immediately if the metadata is not ready yet\n      return 0;\n    } // it's clearly an edge-case but don't thrown an error if asked to\n    // seek within an empty playlist\n\n\n    if (!this.masterPlaylistLoader_.media().segments) {\n      return 0;\n    } // if the seek location is already buffered, continue buffering as usual\n\n\n    if (buffered && buffered.length) {\n      return currentTime;\n    } // cancel outstanding requests so we begin buffering at the new\n    // location\n\n\n    this.mainSegmentLoader_.resetEverything();\n    this.mainSegmentLoader_.abort();\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      this.audioSegmentLoader_.resetEverything();\n      this.audioSegmentLoader_.abort();\n    }\n\n    if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n      this.subtitleSegmentLoader_.resetEverything();\n      this.subtitleSegmentLoader_.abort();\n    } // start segment loader loading in case they are paused\n\n\n    this.load();\n  }\n  /**\n   * get the current duration\n   *\n   * @return {TimeRange} the duration\n   */\n  ;\n\n  _proto.duration = function duration() {\n    if (!this.masterPlaylistLoader_) {\n      return 0;\n    }\n\n    var media = this.masterPlaylistLoader_.media();\n\n    if (!media) {\n      // no playlists loaded yet, so can't determine a duration\n      return 0;\n    } // Don't rely on the media source for duration in the case of a live playlist since\n    // setting the native MediaSource's duration to infinity ends up with consequences to\n    // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n    //\n    // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n    // however, few browsers have support for setLiveSeekableRange()\n    // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n    //\n    // Until a time when the duration of the media source can be set to infinity, and a\n    // seekable range specified across browsers, just return Infinity.\n\n\n    if (!media.endList) {\n      return Infinity;\n    } // Since this is a VOD video, it is safe to rely on the media source's duration (if\n    // available). If it's not available, fall back to a playlist-calculated estimate.\n\n\n    if (this.mediaSource) {\n      return this.mediaSource.duration;\n    }\n\n    return Vhs$1.Playlist.duration(media);\n  }\n  /**\n   * check the seekable range\n   *\n   * @return {TimeRange} the seekable range\n   */\n  ;\n\n  _proto.seekable = function seekable() {\n    return this.seekable_;\n  };\n\n  _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() {\n    var audioSeekable; // TODO check for creation of both source buffers before updating seekable\n    //\n    // A fix was made to this function where a check for\n    // this.sourceUpdater_.hasCreatedSourceBuffers\n    // was added to ensure that both source buffers were created before seekable was\n    // updated. However, it originally had a bug where it was checking for a true and\n    // returning early instead of checking for false. Setting it to check for false to\n    // return early though created other issues. A call to play() would check for seekable\n    // end without verifying that a seekable range was present. In addition, even checking\n    // for that didn't solve some issues, as handleFirstPlay is sometimes worked around\n    // due to a media update calling load on the segment loaders, skipping a seek to live,\n    // thereby starting live streams at the beginning of the stream rather than at the end.\n    //\n    // This conditional should be fixed to wait for the creation of two source buffers at\n    // the same time as the other sections of code are fixed to properly seek to live and\n    // not throw an error due to checking for a seekable end when no seekable range exists.\n    //\n    // For now, fall back to the older behavior, with the understanding that the seekable\n    // range may not be completely correct, leading to a suboptimal initial live point.\n\n    if (!this.masterPlaylistLoader_) {\n      return;\n    }\n\n    var media = this.masterPlaylistLoader_.media();\n\n    if (!media) {\n      return;\n    }\n\n    var expired = this.syncController_.getExpiredTime(media, this.duration());\n\n    if (expired === null) {\n      // not enough information to update seekable\n      return;\n    }\n\n    var master = this.masterPlaylistLoader_.master;\n    var mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));\n\n    if (mainSeekable.length === 0) {\n      return;\n    }\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n      expired = this.syncController_.getExpiredTime(media, this.duration());\n\n      if (expired === null) {\n        return;\n      }\n\n      audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));\n\n      if (audioSeekable.length === 0) {\n        return;\n      }\n    }\n\n    var oldEnd;\n    var oldStart;\n\n    if (this.seekable_ && this.seekable_.length) {\n      oldEnd = this.seekable_.end(0);\n      oldStart = this.seekable_.start(0);\n    }\n\n    if (!audioSeekable) {\n      // seekable has been calculated based on buffering video data so it\n      // can be returned directly\n      this.seekable_ = mainSeekable;\n    } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n      // seekables are pretty far off, rely on main\n      this.seekable_ = mainSeekable;\n    } else {\n      this.seekable_ = videojs.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n    } // seekable is the same as last time\n\n\n    if (this.seekable_ && this.seekable_.length) {\n      if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {\n        return;\n      }\n    }\n\n    this.logger_(\"seekable updated [\" + printableRange(this.seekable_) + \"]\");\n    this.tech_.trigger('seekablechanged');\n  }\n  /**\n   * Update the player duration\n   */\n  ;\n\n  _proto.updateDuration = function updateDuration(isLive) {\n    if (this.updateDuration_) {\n      this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n      this.updateDuration_ = null;\n    }\n\n    if (this.mediaSource.readyState !== 'open') {\n      this.updateDuration_ = this.updateDuration.bind(this, isLive);\n      this.mediaSource.addEventListener('sourceopen', this.updateDuration_);\n      return;\n    }\n\n    if (isLive) {\n      var seekable = this.seekable();\n\n      if (!seekable.length) {\n        return;\n      } // Even in the case of a live playlist, the native MediaSource's duration should not\n      // be set to Infinity (even though this would be expected for a live playlist), since\n      // setting the native MediaSource's duration to infinity ends up with consequences to\n      // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n      //\n      // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n      // however, few browsers have support for setLiveSeekableRange()\n      // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n      //\n      // Until a time when the duration of the media source can be set to infinity, and a\n      // seekable range specified across browsers, the duration should be greater than or\n      // equal to the last possible seekable value.\n      // MediaSource duration starts as NaN\n      // It is possible (and probable) that this case will never be reached for many\n      // sources, since the MediaSource reports duration as the highest value without\n      // accounting for timestamp offset. For example, if the timestamp offset is -100 and\n      // we buffered times 0 to 100 with real times of 100 to 200, even though current\n      // time will be between 0 and 100, the native media source may report the duration\n      // as 200. However, since we report duration separate from the media source (as\n      // Infinity), and as long as the native media source duration value is greater than\n      // our reported seekable range, seeks will work as expected. The large number as\n      // duration for live is actually a strategy used by some players to work around the\n      // issue of live seekable ranges cited above.\n\n\n      if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable.end(seekable.length - 1)) {\n        this.sourceUpdater_.setDuration(seekable.end(seekable.length - 1));\n      }\n\n      return;\n    }\n\n    var buffered = this.tech_.buffered();\n    var duration = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());\n\n    if (buffered.length > 0) {\n      duration = Math.max(duration, buffered.end(buffered.length - 1));\n    }\n\n    if (this.mediaSource.duration !== duration) {\n      this.sourceUpdater_.setDuration(duration);\n    }\n  }\n  /**\n   * dispose of the MasterPlaylistController and everything\n   * that it controls\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    var _this8 = this;\n\n    this.trigger('dispose');\n    this.decrypter_.terminate();\n    this.masterPlaylistLoader_.dispose();\n    this.mainSegmentLoader_.dispose();\n\n    if (this.loadOnPlay_) {\n      this.tech_.off('play', this.loadOnPlay_);\n    }\n\n    ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n      var groups = _this8.mediaTypes_[type].groups;\n\n      for (var id in groups) {\n        groups[id].forEach(function (group) {\n          if (group.playlistLoader) {\n            group.playlistLoader.dispose();\n          }\n        });\n      }\n    });\n    this.audioSegmentLoader_.dispose();\n    this.subtitleSegmentLoader_.dispose();\n    this.sourceUpdater_.dispose();\n    this.timelineChangeController_.dispose();\n    this.stopABRTimer_();\n\n    if (this.updateDuration_) {\n      this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n    }\n\n    this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n    this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_);\n    this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_);\n    this.off();\n  }\n  /**\n   * return the master playlist object if we have one\n   *\n   * @return {Object} the master playlist object that we parsed\n   */\n  ;\n\n  _proto.master = function master() {\n    return this.masterPlaylistLoader_.master;\n  }\n  /**\n   * return the currently selected playlist\n   *\n   * @return {Object} the currently selected playlist object that we parsed\n   */\n  ;\n\n  _proto.media = function media() {\n    // playlist loader will not return media if it has not been fully loaded\n    return this.masterPlaylistLoader_.media() || this.initialMedia_;\n  };\n\n  _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() {\n    var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n    var hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_(); // if we are not using an audio loader, then we have audio media info\n    // otherwise check on the segment loader.\n\n    var hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_(); // one or both loaders has not loaded sufficently to get codecs\n\n    if (!hasMainMediaInfo || !hasAudioMediaInfo) {\n      return false;\n    }\n\n    return true;\n  };\n\n  _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() {\n    var _this9 = this;\n\n    var media = {\n      main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},\n      audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}\n    }; // set \"main\" media equal to video\n\n    media.video = media.main;\n    var playlistCodecs = codecsForPlaylist(this.master(), this.media());\n    var codecs = {};\n    var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n\n    if (media.main.hasVideo) {\n      codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;\n    }\n\n    if (media.main.isMuxed) {\n      codecs.video += \",\" + (playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC);\n    }\n\n    if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {\n      codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC; // set audio isFmp4 so we use the correct \"supports\" function below\n\n      media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;\n    } // no codecs, no playback.\n\n\n    if (!codecs.audio && !codecs.video) {\n      this.blacklistCurrentPlaylist({\n        playlist: this.media(),\n        message: 'Could not determine codecs for playlist.',\n        blacklistDuration: Infinity\n      });\n      return;\n    } // fmp4 relies on browser support, while ts relies on muxer support\n\n\n    var supportFunction = function supportFunction(isFmp4, codec) {\n      return isFmp4 ? browserSupportsCodec(codec) : muxerSupportsCodec(codec);\n    };\n\n    var unsupportedCodecs = {};\n    var unsupportedAudio;\n    ['video', 'audio'].forEach(function (type) {\n      if (codecs.hasOwnProperty(type) && !supportFunction(media[type].isFmp4, codecs[type])) {\n        var supporter = media[type].isFmp4 ? 'browser' : 'muxer';\n        unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];\n        unsupportedCodecs[supporter].push(codecs[type]);\n\n        if (type === 'audio') {\n          unsupportedAudio = supporter;\n        }\n      }\n    });\n\n    if (usingAudioLoader && unsupportedAudio && this.media().attributes.AUDIO) {\n      var audioGroup = this.media().attributes.AUDIO;\n      this.master().playlists.forEach(function (variant) {\n        var variantAudioGroup = variant.attributes && variant.attributes.AUDIO;\n\n        if (variantAudioGroup === audioGroup && variant !== _this9.media()) {\n          variant.excludeUntil = Infinity;\n        }\n      });\n      this.logger_(\"excluding audio group \" + audioGroup + \" as \" + unsupportedAudio + \" does not support codec(s): \\\"\" + codecs.audio + \"\\\"\");\n    } // if we have any unsupported codecs blacklist this playlist.\n\n\n    if (Object.keys(unsupportedCodecs).length) {\n      var message = Object.keys(unsupportedCodecs).reduce(function (acc, supporter) {\n        if (acc) {\n          acc += ', ';\n        }\n\n        acc += supporter + \" does not support codec(s): \\\"\" + unsupportedCodecs[supporter].join(',') + \"\\\"\";\n        return acc;\n      }, '') + '.';\n      this.blacklistCurrentPlaylist({\n        playlist: this.media(),\n        internal: true,\n        message: message,\n        blacklistDuration: Infinity\n      });\n      return;\n    } // check if codec switching is happening\n\n\n    if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {\n      var switchMessages = [];\n      ['video', 'audio'].forEach(function (type) {\n        var newCodec = (parseCodecs(_this9.sourceUpdater_.codecs[type] || '')[0] || {}).type;\n        var oldCodec = (parseCodecs(codecs[type] || '')[0] || {}).type;\n\n        if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {\n          switchMessages.push(\"\\\"\" + _this9.sourceUpdater_.codecs[type] + \"\\\" -> \\\"\" + codecs[type] + \"\\\"\");\n        }\n      });\n\n      if (switchMessages.length) {\n        this.blacklistCurrentPlaylist({\n          playlist: this.media(),\n          message: \"Codec switching not supported: \" + switchMessages.join(', ') + \".\",\n          blacklistDuration: Infinity,\n          internal: true\n        });\n        return;\n      }\n    } // TODO: when using the muxer shouldn't we just return\n    // the codecs that the muxer outputs?\n\n\n    return codecs;\n  }\n  /**\n   * Create source buffers and exlude any incompatible renditions.\n   *\n   * @private\n   */\n  ;\n\n  _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() {\n    // media source is not ready yet or sourceBuffers are already\n    // created.\n    if (this.mediaSource.readyState !== 'open' || this.sourceUpdater_.hasCreatedSourceBuffers()) {\n      return;\n    }\n\n    if (!this.areMediaTypesKnown_()) {\n      return;\n    }\n\n    var codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n    if (!codecs) {\n      return;\n    }\n\n    this.sourceUpdater_.createSourceBuffers(codecs);\n    var codecString = [codecs.video, codecs.audio].filter(Boolean).join(',');\n    this.excludeIncompatibleVariants_(codecString);\n  }\n  /**\n   * Excludes playlists with codecs that are unsupported by the muxer and browser.\n   */\n  ;\n\n  _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() {\n    var _this10 = this;\n\n    var playlists = this.master().playlists;\n    var ids = []; // TODO: why don't we have a property to loop through all\n    // playlist? Why did we ever mix indexes and keys?\n\n    Object.keys(playlists).forEach(function (key) {\n      var variant = playlists[key]; // check if we already processed this playlist.\n\n      if (ids.indexOf(variant.id) !== -1) {\n        return;\n      }\n\n      ids.push(variant.id);\n      var codecs = codecsForPlaylist(_this10.master, variant);\n      var unsupported = [];\n\n      if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio)) {\n        unsupported.push(\"audio codec \" + codecs.audio);\n      }\n\n      if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video)) {\n        unsupported.push(\"video codec \" + codecs.video);\n      }\n\n      if (codecs.text && codecs.text === 'stpp.ttml.im1t') {\n        unsupported.push(\"text codec \" + codecs.text);\n      }\n\n      if (unsupported.length) {\n        variant.excludeUntil = Infinity;\n\n        _this10.logger_(\"excluding \" + variant.id + \" for unsupported: \" + unsupported.join(', '));\n      }\n    });\n  }\n  /**\n   * Blacklist playlists that are known to be codec or\n   * stream-incompatible with the SourceBuffer configuration. For\n   * instance, Media Source Extensions would cause the video element to\n   * stall waiting for video data if you switched from a variant with\n   * video and audio to an audio-only one.\n   *\n   * @param {Object} media a media playlist compatible with the current\n   * set of SourceBuffers. Variants in the current master playlist that\n   * do not appear to have compatible codec or stream configurations\n   * will be excluded from the default playlist selection algorithm\n   * indefinitely.\n   * @private\n   */\n  ;\n\n  _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) {\n    var _this11 = this;\n\n    var ids = [];\n    var playlists = this.master().playlists;\n    var codecs = unwrapCodecList(parseCodecs(codecString));\n    var codecCount_ = codecCount(codecs);\n    var videoDetails = codecs.video && parseCodecs(codecs.video)[0] || null;\n    var audioDetails = codecs.audio && parseCodecs(codecs.audio)[0] || null;\n    Object.keys(playlists).forEach(function (key) {\n      var variant = playlists[key]; // check if we already processed this playlist.\n      // or it if it is already excluded forever.\n\n      if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {\n        return;\n      }\n\n      ids.push(variant.id);\n      var blacklistReasons = []; // get codecs from the playlist for this variant\n\n      var variantCodecs = codecsForPlaylist(_this11.masterPlaylistLoader_.master, variant);\n      var variantCodecCount = codecCount(variantCodecs); // if no codecs are listed, we cannot determine that this\n      // variant is incompatible. Wait for mux.js to probe\n\n      if (!variantCodecs.audio && !variantCodecs.video) {\n        return;\n      } // TODO: we can support this by removing the\n      // old media source and creating a new one, but it will take some work.\n      // The number of streams cannot change\n\n\n      if (variantCodecCount !== codecCount_) {\n        blacklistReasons.push(\"codec count \\\"\" + variantCodecCount + \"\\\" !== \\\"\" + codecCount_ + \"\\\"\");\n      } // only exclude playlists by codec change, if codecs cannot switch\n      // during playback.\n\n\n      if (!_this11.sourceUpdater_.canChangeType()) {\n        var variantVideoDetails = variantCodecs.video && parseCodecs(variantCodecs.video)[0] || null;\n        var variantAudioDetails = variantCodecs.audio && parseCodecs(variantCodecs.audio)[0] || null; // the video codec cannot change\n\n        if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {\n          blacklistReasons.push(\"video codec \\\"\" + variantVideoDetails.type + \"\\\" !== \\\"\" + videoDetails.type + \"\\\"\");\n        } // the audio codec cannot change\n\n\n        if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {\n          blacklistReasons.push(\"audio codec \\\"\" + variantAudioDetails.type + \"\\\" !== \\\"\" + audioDetails.type + \"\\\"\");\n        }\n      }\n\n      if (blacklistReasons.length) {\n        variant.excludeUntil = Infinity;\n\n        _this11.logger_(\"blacklisting \" + variant.id + \": \" + blacklistReasons.join(' && '));\n      }\n    });\n  };\n\n  _proto.updateAdCues_ = function updateAdCues_(media) {\n    var offset = 0;\n    var seekable = this.seekable();\n\n    if (seekable.length) {\n      offset = seekable.start(0);\n    }\n\n    updateAdCues(media, this.cueTagsTrack_, offset);\n  }\n  /**\n   * Calculates the desired forward buffer length based on current time\n   *\n   * @return {number} Desired forward buffer length in seconds\n   */\n  ;\n\n  _proto.goalBufferLength = function goalBufferLength() {\n    var currentTime = this.tech_.currentTime();\n    var initial = Config.GOAL_BUFFER_LENGTH;\n    var rate = Config.GOAL_BUFFER_LENGTH_RATE;\n    var max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n    return Math.min(initial + currentTime * rate, max);\n  }\n  /**\n   * Calculates the desired buffer low water line based on current time\n   *\n   * @return {number} Desired buffer low water line in seconds\n   */\n  ;\n\n  _proto.bufferLowWaterLine = function bufferLowWaterLine() {\n    var currentTime = this.tech_.currentTime();\n    var initial = Config.BUFFER_LOW_WATER_LINE;\n    var rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n    var max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n    var newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);\n    return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max);\n  };\n\n  _proto.bufferHighWaterLine = function bufferHighWaterLine() {\n    return Config.BUFFER_HIGH_WATER_LINE;\n  };\n\n  return MasterPlaylistController;\n}(videojs.EventTarget);\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The master playlist loader\n * @param {string} playlistID - id of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\n\nvar enableFunction = function enableFunction(loader, playlistID, changePlaylistFn) {\n  return function (enable) {\n    var playlist = loader.master.playlists[playlistID];\n    var incompatible = isIncompatible(playlist);\n    var currentlyEnabled = isEnabled(playlist);\n\n    if (typeof enable === 'undefined') {\n      return currentlyEnabled;\n    }\n\n    if (enable) {\n      delete playlist.disabled;\n    } else {\n      playlist.disabled = true;\n    }\n\n    if (enable !== currentlyEnabled && !incompatible) {\n      // Ensure the outside world knows about our changes\n      changePlaylistFn();\n\n      if (enable) {\n        loader.trigger('renditionenabled');\n      } else {\n        loader.trigger('renditiondisabled');\n      }\n    }\n\n    return enable;\n  };\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\n\nvar Representation = function Representation(vhsHandler, playlist, id) {\n  var mpc = vhsHandler.masterPlaylistController_,\n      smoothQualityChange = vhsHandler.options_.smoothQualityChange; // Get a reference to a bound version of the quality change function\n\n  var changeType = smoothQualityChange ? 'smooth' : 'fast';\n  var qualityChangeFunction = mpc[changeType + \"QualityChange_\"].bind(mpc); // some playlist attributes are optional\n\n  if (playlist.attributes) {\n    var resolution = playlist.attributes.RESOLUTION;\n    this.width = resolution && resolution.width;\n    this.height = resolution && resolution.height;\n    this.bandwidth = playlist.attributes.BANDWIDTH;\n  }\n\n  this.codecs = codecsForPlaylist(mpc.master(), playlist);\n  this.playlist = playlist; // The id is simply the ordinality of the media playlist\n  // within the master playlist\n\n  this.id = id; // Partially-apply the enableFunction to create a playlist-\n  // specific variant\n\n  this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);\n};\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the VhsHandler class\n *\n * @param {VhsHandler} vhsHandler - An instance of VhsHandler to add the\n * representation API into\n */\n\n\nvar renditionSelectionMixin = function renditionSelectionMixin(vhsHandler) {\n  // Add a single API-specific function to the VhsHandler instance\n  vhsHandler.representations = function () {\n    var master = vhsHandler.masterPlaylistController_.master();\n    var playlists = isAudioOnly(master) ? vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_() : master.playlists;\n\n    if (!playlists) {\n      return [];\n    }\n\n    return playlists.filter(function (media) {\n      return !isIncompatible(media);\n    }).map(function (e, i) {\n      return new Representation(vhsHandler, e, e.id);\n    });\n  };\n};\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n\n\nvar timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * @class PlaybackWatcher\n */\n\nvar PlaybackWatcher = /*#__PURE__*/function () {\n  /**\n   * Represents an PlaybackWatcher object.\n   *\n   * @class\n   * @param {Object} options an object that includes the tech and settings\n   */\n  function PlaybackWatcher(options) {\n    var _this = this;\n\n    this.masterPlaylistController_ = options.masterPlaylistController;\n    this.tech_ = options.tech;\n    this.seekable = options.seekable;\n    this.allowSeeksWithinUnsafeLiveWindow = options.allowSeeksWithinUnsafeLiveWindow;\n    this.liveRangeSafeTimeDelta = options.liveRangeSafeTimeDelta;\n    this.media = options.media;\n    this.consecutiveUpdates = 0;\n    this.lastRecordedTime = null;\n    this.timer_ = null;\n    this.checkCurrentTimeTimeout_ = null;\n    this.logger_ = logger('PlaybackWatcher');\n    this.logger_('initialize');\n\n    var playHandler = function playHandler() {\n      return _this.monitorCurrentTime_();\n    };\n\n    var canPlayHandler = function canPlayHandler() {\n      return _this.monitorCurrentTime_();\n    };\n\n    var waitingHandler = function waitingHandler() {\n      return _this.techWaiting_();\n    };\n\n    var cancelTimerHandler = function cancelTimerHandler() {\n      return _this.cancelTimer_();\n    };\n\n    var mpc = this.masterPlaylistController_;\n    var loaderTypes = ['main', 'subtitle', 'audio'];\n    var loaderChecks = {};\n    loaderTypes.forEach(function (type) {\n      loaderChecks[type] = {\n        reset: function reset() {\n          return _this.resetSegmentDownloads_(type);\n        },\n        updateend: function updateend() {\n          return _this.checkSegmentDownloads_(type);\n        }\n      };\n      mpc[type + \"SegmentLoader_\"].on('appendsdone', loaderChecks[type].updateend); // If a rendition switch happens during a playback stall where the buffer\n      // isn't changing we want to reset. We cannot assume that the new rendition\n      // will also be stalled, until after new appends.\n\n      mpc[type + \"SegmentLoader_\"].on('playlistupdate', loaderChecks[type].reset); // Playback stalls should not be detected right after seeking.\n      // This prevents one segment playlists (single vtt or single segment content)\n      // from being detected as stalling. As the buffer will not change in those cases, since\n      // the buffer is the entire video duration.\n\n      _this.tech_.on(['seeked', 'seeking'], loaderChecks[type].reset);\n    });\n    /**\n     * We check if a seek was into a gap through the following steps:\n     * 1. We get a seeking event and we do not get a seeked event. This means that\n     *    a seek was attempted but not completed.\n     * 2. We run `fixesBadSeeks_` on segment loader appends. This means that we already\n     *    removed everything from our buffer and appended a segment, and should be ready\n     *    to check for gaps.\n     */\n\n    var setSeekingHandlers = function setSeekingHandlers(fn) {\n      ['main', 'audio'].forEach(function (type) {\n        mpc[type + \"SegmentLoader_\"][fn]('appended', _this.seekingAppendCheck_);\n      });\n    };\n\n    this.seekingAppendCheck_ = function () {\n      if (_this.fixesBadSeeks_()) {\n        _this.consecutiveUpdates = 0;\n        _this.lastRecordedTime = _this.tech_.currentTime();\n        setSeekingHandlers('off');\n      }\n    };\n\n    this.clearSeekingAppendCheck_ = function () {\n      return setSeekingHandlers('off');\n    };\n\n    this.watchForBadSeeking_ = function () {\n      _this.clearSeekingAppendCheck_();\n\n      setSeekingHandlers('on');\n    };\n\n    this.tech_.on('seeked', this.clearSeekingAppendCheck_);\n    this.tech_.on('seeking', this.watchForBadSeeking_);\n    this.tech_.on('waiting', waitingHandler);\n    this.tech_.on(timerCancelEvents, cancelTimerHandler);\n    this.tech_.on('canplay', canPlayHandler);\n    /*\n      An edge case exists that results in gaps not being skipped when they exist at the beginning of a stream. This case\n      is surfaced in one of two ways:\n       1)  The `waiting` event is fired before the player has buffered content, making it impossible\n          to find or skip the gap. The `waiting` event is followed by a `play` event. On first play\n          we can check if playback is stalled due to a gap, and skip the gap if necessary.\n      2)  A source with a gap at the beginning of the stream is loaded programatically while the player\n          is in a playing state. To catch this case, it's important that our one-time play listener is setup\n          even if the player is in a playing state\n    */\n\n    this.tech_.one('play', playHandler); // Define the dispose function to clean up our events\n\n    this.dispose = function () {\n      _this.clearSeekingAppendCheck_();\n\n      _this.logger_('dispose');\n\n      _this.tech_.off('waiting', waitingHandler);\n\n      _this.tech_.off(timerCancelEvents, cancelTimerHandler);\n\n      _this.tech_.off('canplay', canPlayHandler);\n\n      _this.tech_.off('play', playHandler);\n\n      _this.tech_.off('seeking', _this.watchForBadSeeking_);\n\n      _this.tech_.off('seeked', _this.clearSeekingAppendCheck_);\n\n      loaderTypes.forEach(function (type) {\n        mpc[type + \"SegmentLoader_\"].off('appendsdone', loaderChecks[type].updateend);\n        mpc[type + \"SegmentLoader_\"].off('playlistupdate', loaderChecks[type].reset);\n\n        _this.tech_.off(['seeked', 'seeking'], loaderChecks[type].reset);\n      });\n\n      if (_this.checkCurrentTimeTimeout_) {\n        window$1.clearTimeout(_this.checkCurrentTimeTimeout_);\n      }\n\n      _this.cancelTimer_();\n    };\n  }\n  /**\n   * Periodically check current time to see if playback stopped\n   *\n   * @private\n   */\n\n\n  var _proto = PlaybackWatcher.prototype;\n\n  _proto.monitorCurrentTime_ = function monitorCurrentTime_() {\n    this.checkCurrentTime_();\n\n    if (this.checkCurrentTimeTimeout_) {\n      window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n    } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n\n    this.checkCurrentTimeTimeout_ = window$1.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n  }\n  /**\n   * Reset stalled download stats for a specific type of loader\n   *\n   * @param {string} type\n   *        The segment loader type to check.\n   *\n   * @listens SegmentLoader#playlistupdate\n   * @listens Tech#seeking\n   * @listens Tech#seeked\n   */\n  ;\n\n  _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type) {\n    var loader = this.masterPlaylistController_[type + \"SegmentLoader_\"];\n\n    if (this[type + \"StalledDownloads_\"] > 0) {\n      this.logger_(\"resetting possible stalled download count for \" + type + \" loader\");\n    }\n\n    this[type + \"StalledDownloads_\"] = 0;\n    this[type + \"Buffered_\"] = loader.buffered_();\n  }\n  /**\n   * Checks on every segment `appendsdone` to see\n   * if segment appends are making progress. If they are not\n   * and we are still downloading bytes. We blacklist the playlist.\n   *\n   * @param {string} type\n   *        The segment loader type to check.\n   *\n   * @listens SegmentLoader#appendsdone\n   */\n  ;\n\n  _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type) {\n    var mpc = this.masterPlaylistController_;\n    var loader = mpc[type + \"SegmentLoader_\"];\n    var buffered = loader.buffered_();\n    var isBufferedDifferent = isRangeDifferent(this[type + \"Buffered_\"], buffered);\n    this[type + \"Buffered_\"] = buffered; // if another watcher is going to fix the issue or\n    // the buffered value for this loader changed\n    // appends are working\n\n    if (isBufferedDifferent) {\n      this.resetSegmentDownloads_(type);\n      return;\n    }\n\n    this[type + \"StalledDownloads_\"]++;\n    this.logger_(\"found #\" + this[type + \"StalledDownloads_\"] + \" \" + type + \" appends that did not increase buffer (possible stalled download)\", {\n      playlistId: loader.playlist_ && loader.playlist_.id,\n      buffered: timeRangesToArray(buffered)\n    }); // after 10 possibly stalled appends with no reset, exclude\n\n    if (this[type + \"StalledDownloads_\"] < 10) {\n      return;\n    }\n\n    this.logger_(type + \" loader stalled download exclusion\");\n    this.resetSegmentDownloads_(type);\n    this.tech_.trigger({\n      type: 'usage',\n      name: \"vhs-\" + type + \"-download-exclusion\"\n    });\n\n    if (type === 'subtitle') {\n      return;\n    } // TODO: should we exclude audio tracks rather than main tracks\n    // when type is audio?\n\n\n    mpc.blacklistCurrentPlaylist({\n      message: \"Excessive \" + type + \" segment downloading detected.\"\n    }, Infinity);\n  }\n  /**\n   * The purpose of this function is to emulate the \"waiting\" event on\n   * browsers that do not emit it when they are waiting for more\n   * data to continue playback\n   *\n   * @private\n   */\n  ;\n\n  _proto.checkCurrentTime_ = function checkCurrentTime_() {\n    if (this.tech_.paused() || this.tech_.seeking()) {\n      return;\n    }\n\n    var currentTime = this.tech_.currentTime();\n    var buffered = this.tech_.buffered();\n\n    if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n      // If current time is at the end of the final buffered region, then any playback\n      // stall is most likely caused by buffering in a low bandwidth environment. The tech\n      // should fire a `waiting` event in this scenario, but due to browser and tech\n      // inconsistencies. Calling `techWaiting_` here allows us to simulate\n      // responding to a native `waiting` event when the tech fails to emit one.\n      return this.techWaiting_();\n    }\n\n    if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n      this.consecutiveUpdates++;\n      this.waiting_();\n    } else if (currentTime === this.lastRecordedTime) {\n      this.consecutiveUpdates++;\n    } else {\n      this.consecutiveUpdates = 0;\n      this.lastRecordedTime = currentTime;\n    }\n  }\n  /**\n   * Cancels any pending timers and resets the 'timeupdate' mechanism\n   * designed to detect that we are stalled\n   *\n   * @private\n   */\n  ;\n\n  _proto.cancelTimer_ = function cancelTimer_() {\n    this.consecutiveUpdates = 0;\n\n    if (this.timer_) {\n      this.logger_('cancelTimer_');\n      clearTimeout(this.timer_);\n    }\n\n    this.timer_ = null;\n  }\n  /**\n   * Fixes situations where there's a bad seek\n   *\n   * @return {boolean} whether an action was taken to fix the seek\n   * @private\n   */\n  ;\n\n  _proto.fixesBadSeeks_ = function fixesBadSeeks_() {\n    var seeking = this.tech_.seeking();\n\n    if (!seeking) {\n      return false;\n    } // TODO: It's possible that these seekable checks should be moved out of this function\n    // and into a function that runs on seekablechange. It's also possible that we only need\n    // afterSeekableWindow as the buffered check at the bottom is good enough to handle before\n    // seekable range.\n\n\n    var seekable = this.seekable();\n    var currentTime = this.tech_.currentTime();\n    var isAfterSeekableRange = this.afterSeekableWindow_(seekable, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);\n    var seekTo;\n\n    if (isAfterSeekableRange) {\n      var seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n      seekTo = seekableEnd;\n    }\n\n    if (this.beforeSeekableWindow_(seekable, currentTime)) {\n      var seekableStart = seekable.start(0); // sync to the beginning of the live window\n      // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n      seekTo = seekableStart + ( // if the playlist is too short and the seekable range is an exact time (can\n      // happen in live with a 3 segment playlist), then don't use a time delta\n      seekableStart === seekable.end(0) ? 0 : SAFE_TIME_DELTA);\n    }\n\n    if (typeof seekTo !== 'undefined') {\n      this.logger_(\"Trying to seek outside of seekable at time \" + currentTime + \" with \" + (\"seekable range \" + printableRange(seekable) + \". Seeking to \") + (seekTo + \".\"));\n      this.tech_.setCurrentTime(seekTo);\n      return true;\n    }\n\n    var sourceUpdater = this.masterPlaylistController_.sourceUpdater_;\n    var buffered = this.tech_.buffered();\n    var audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;\n    var videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;\n    var media = this.media(); // verify that at least two segment durations or one part duration have been\n    // appended before checking for a gap.\n\n    var minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2; // verify that at least two segment durations have been\n    // appended before checking for a gap.\n\n    var bufferedToCheck = [audioBuffered, videoBuffered];\n\n    for (var i = 0; i < bufferedToCheck.length; i++) {\n      // skip null buffered\n      if (!bufferedToCheck[i]) {\n        continue;\n      }\n\n      var timeAhead = timeAheadOf(bufferedToCheck[i], currentTime); // if we are less than two video/audio segment durations or one part\n      // duration behind we haven't appended enough to call this a bad seek.\n\n      if (timeAhead < minAppendedDuration) {\n        return false;\n      }\n    }\n\n    var nextRange = findNextRange(buffered, currentTime); // we have appended enough content, but we don't have anything buffered\n    // to seek over the gap\n\n    if (nextRange.length === 0) {\n      return false;\n    }\n\n    seekTo = nextRange.start(0) + SAFE_TIME_DELTA;\n    this.logger_(\"Buffered region starts (\" + nextRange.start(0) + \") \" + (\" just beyond seek point (\" + currentTime + \"). Seeking to \" + seekTo + \".\"));\n    this.tech_.setCurrentTime(seekTo);\n    return true;\n  }\n  /**\n   * Handler for situations when we determine the player is waiting.\n   *\n   * @private\n   */\n  ;\n\n  _proto.waiting_ = function waiting_() {\n    if (this.techWaiting_()) {\n      return;\n    } // All tech waiting checks failed. Use last resort correction\n\n\n    var currentTime = this.tech_.currentTime();\n    var buffered = this.tech_.buffered();\n    var currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n    // region with no indication that anything is amiss (seen in Firefox). Seeking to\n    // currentTime is usually enough to kickstart the player. This checks that the player\n    // is currently within a buffered region before attempting a corrective seek.\n    // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n    // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n    // make sure there is ~3 seconds of forward buffer before taking any corrective action\n    // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n    if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n      this.cancelTimer_();\n      this.tech_.setCurrentTime(currentTime);\n      this.logger_(\"Stopped at \" + currentTime + \" while inside a buffered region \" + (\"[\" + currentRange.start(0) + \" -> \" + currentRange.end(0) + \"]. Attempting to resume \") + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-unknown-waiting'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-unknown-waiting'\n      });\n      return;\n    }\n  }\n  /**\n   * Handler for situations when the tech fires a `waiting` event\n   *\n   * @return {boolean}\n   *         True if an action (or none) was needed to correct the waiting. False if no\n   *         checks passed\n   * @private\n   */\n  ;\n\n  _proto.techWaiting_ = function techWaiting_() {\n    var seekable = this.seekable();\n    var currentTime = this.tech_.currentTime();\n\n    if (this.tech_.seeking() || this.timer_ !== null) {\n      // Tech is seeking or already waiting on another action, no action needed\n      return true;\n    }\n\n    if (this.beforeSeekableWindow_(seekable, currentTime)) {\n      var livePoint = seekable.end(seekable.length - 1);\n      this.logger_(\"Fell out of live window at time \" + currentTime + \". Seeking to \" + (\"live point (seekable end) \" + livePoint));\n      this.cancelTimer_();\n      this.tech_.setCurrentTime(livePoint); // live window resyncs may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-live-resync'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-live-resync'\n      });\n      return true;\n    }\n\n    var sourceUpdater = this.tech_.vhs.masterPlaylistController_.sourceUpdater_;\n    var buffered = this.tech_.buffered();\n    var videoUnderflow = this.videoUnderflow_({\n      audioBuffered: sourceUpdater.audioBuffered(),\n      videoBuffered: sourceUpdater.videoBuffered(),\n      currentTime: currentTime\n    });\n\n    if (videoUnderflow) {\n      // Even though the video underflowed and was stuck in a gap, the audio overplayed\n      // the gap, leading currentTime into a buffered range. Seeking to currentTime\n      // allows the video to catch up to the audio position without losing any audio\n      // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n      this.cancelTimer_();\n      this.tech_.setCurrentTime(currentTime); // video underflow may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-video-underflow'\n      });\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'hls-video-underflow'\n      });\n      return true;\n    }\n\n    var nextRange = findNextRange(buffered, currentTime); // check for gap\n\n    if (nextRange.length > 0) {\n      var difference = nextRange.start(0) - currentTime;\n      this.logger_(\"Stopped at \" + currentTime + \", setting timer for \" + difference + \", seeking \" + (\"to \" + nextRange.start(0)));\n      this.cancelTimer_();\n      this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1000, currentTime);\n      return true;\n    } // All checks failed. Returning false to indicate failure to correct waiting\n\n\n    return false;\n  };\n\n  _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) {\n    if (allowSeeksWithinUnsafeLiveWindow === void 0) {\n      allowSeeksWithinUnsafeLiveWindow = false;\n    }\n\n    if (!seekable.length) {\n      // we can't make a solid case if there's no seekable, default to false\n      return false;\n    }\n\n    var allowedEnd = seekable.end(seekable.length - 1) + SAFE_TIME_DELTA;\n    var isLive = !playlist.endList;\n\n    if (isLive && allowSeeksWithinUnsafeLiveWindow) {\n      allowedEnd = seekable.end(seekable.length - 1) + playlist.targetDuration * 3;\n    }\n\n    if (currentTime > allowedEnd) {\n      return true;\n    }\n\n    return false;\n  };\n\n  _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable, currentTime) {\n    if (seekable.length && // can't fall before 0 and 0 seekable start identifies VOD stream\n    seekable.start(0) > 0 && currentTime < seekable.start(0) - this.liveRangeSafeTimeDelta) {\n      return true;\n    }\n\n    return false;\n  };\n\n  _proto.videoUnderflow_ = function videoUnderflow_(_ref) {\n    var videoBuffered = _ref.videoBuffered,\n        audioBuffered = _ref.audioBuffered,\n        currentTime = _ref.currentTime; // audio only content will not have video underflow :)\n\n    if (!videoBuffered) {\n      return;\n    }\n\n    var gap; // find a gap in demuxed content.\n\n    if (videoBuffered.length && audioBuffered.length) {\n      // in Chrome audio will continue to play for ~3s when we run out of video\n      // so we have to check that the video buffer did have some buffer in the\n      // past.\n      var lastVideoRange = findRange(videoBuffered, currentTime - 3);\n      var videoRange = findRange(videoBuffered, currentTime);\n      var audioRange = findRange(audioBuffered, currentTime);\n\n      if (audioRange.length && !videoRange.length && lastVideoRange.length) {\n        gap = {\n          start: lastVideoRange.end(0),\n          end: audioRange.end(0)\n        };\n      } // find a gap in muxed content.\n\n    } else {\n      var nextRange = findNextRange(videoBuffered, currentTime); // Even if there is no available next range, there is still a possibility we are\n      // stuck in a gap due to video underflow.\n\n      if (!nextRange.length) {\n        gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);\n      }\n    }\n\n    if (gap) {\n      this.logger_(\"Encountered a gap in video from \" + gap.start + \" to \" + gap.end + \". \" + (\"Seeking to current time \" + currentTime));\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * Timer callback. If playback still has not proceeded, then we seek\n   * to the start of the next buffered region.\n   *\n   * @private\n   */\n  ;\n\n  _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) {\n    var buffered = this.tech_.buffered();\n    var currentTime = this.tech_.currentTime();\n    var nextRange = findNextRange(buffered, currentTime);\n    this.cancelTimer_();\n\n    if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n      return;\n    }\n\n    this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n    this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'vhs-gap-skip'\n    });\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'hls-gap-skip'\n    });\n  };\n\n  _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) {\n    // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n    // playing for ~3 seconds after the video gap starts. This is done to account for\n    // video buffer underflow/underrun (note that this is not done when there is audio\n    // buffer underflow/underrun -- in that case the video will stop as soon as it\n    // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n    // video stalls). The player's time will reflect the playthrough of audio, so the\n    // time will appear as if we are in a buffered region, even if we are stuck in a\n    // \"gap.\"\n    //\n    // Example:\n    // video buffer:   0 => 10.1, 10.2 => 20\n    // audio buffer:   0 => 20\n    // overall buffer: 0 => 10.1, 10.2 => 20\n    // current time: 13\n    //\n    // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n    // however, the audio continued playing until it reached ~3 seconds past the gap\n    // (13 seconds), at which point it stops as well. Since current time is past the\n    // gap, findNextRange will return no ranges.\n    //\n    // To check for this issue, we see if there is a gap that starts somewhere within\n    // a 3 second range (3 seconds +/- 1 second) back from our current time.\n    var gaps = findGaps(buffered);\n\n    for (var i = 0; i < gaps.length; i++) {\n      var start = gaps.start(i);\n      var end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n      if (currentTime - start < 4 && currentTime - start > 2) {\n        return {\n          start: start,\n          end: end\n        };\n      }\n    }\n\n    return null;\n  };\n\n  return PlaybackWatcher;\n}();\n\nvar defaultOptions = {\n  errorInterval: 30,\n  getSource: function getSource(next) {\n    var tech = this.tech({\n      IWillNotUseThisInPlugins: true\n    });\n    var sourceObj = tech.currentSource_ || this.currentSource();\n    return next(sourceObj);\n  }\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nvar initPlugin = function initPlugin(player, options) {\n  var lastCalled = 0;\n  var seekTo = 0;\n  var localOptions = videojs.mergeOptions(defaultOptions, options);\n  player.ready(function () {\n    player.trigger({\n      type: 'usage',\n      name: 'vhs-error-reload-initialized'\n    });\n    player.trigger({\n      type: 'usage',\n      name: 'hls-error-reload-initialized'\n    });\n  });\n  /**\n   * Player modifications to perform that must wait until `loadedmetadata`\n   * has been triggered\n   *\n   * @private\n   */\n\n  var loadedMetadataHandler = function loadedMetadataHandler() {\n    if (seekTo) {\n      player.currentTime(seekTo);\n    }\n  };\n  /**\n   * Set the source on the player element, play, and seek if necessary\n   *\n   * @param {Object} sourceObj An object specifying the source url and mime-type to play\n   * @private\n   */\n\n\n  var setSource = function setSource(sourceObj) {\n    if (sourceObj === null || sourceObj === undefined) {\n      return;\n    }\n\n    seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n    player.one('loadedmetadata', loadedMetadataHandler);\n    player.src(sourceObj);\n    player.trigger({\n      type: 'usage',\n      name: 'vhs-error-reload'\n    });\n    player.trigger({\n      type: 'usage',\n      name: 'hls-error-reload'\n    });\n    player.play();\n  };\n  /**\n   * Attempt to get a source from either the built-in getSource function\n   * or a custom function provided via the options\n   *\n   * @private\n   */\n\n\n  var errorHandler = function errorHandler() {\n    // Do not attempt to reload the source if a source-reload occurred before\n    // 'errorInterval' time has elapsed since the last source-reload\n    if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n      player.trigger({\n        type: 'usage',\n        name: 'vhs-error-reload-canceled'\n      });\n      player.trigger({\n        type: 'usage',\n        name: 'hls-error-reload-canceled'\n      });\n      return;\n    }\n\n    if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n      videojs.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n      return;\n    }\n\n    lastCalled = Date.now();\n    return localOptions.getSource.call(player, setSource);\n  };\n  /**\n   * Unbind any event handlers that were bound by the plugin\n   *\n   * @private\n   */\n\n\n  var cleanupEvents = function cleanupEvents() {\n    player.off('loadedmetadata', loadedMetadataHandler);\n    player.off('error', errorHandler);\n    player.off('dispose', cleanupEvents);\n  };\n  /**\n   * Cleanup before re-initializing the plugin\n   *\n   * @param {Object} [newOptions] an object with plugin options\n   * @private\n   */\n\n\n  var reinitPlugin = function reinitPlugin(newOptions) {\n    cleanupEvents();\n    initPlugin(player, newOptions);\n  };\n\n  player.on('error', errorHandler);\n  player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n  // initializing the plugin\n\n  player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\n\nvar reloadSourceOnError = function reloadSourceOnError(options) {\n  initPlugin(this, options);\n};\n\nvar version$4 = \"2.14.3\";\nvar version$3 = \"6.0.1\";\nvar version$2 = \"0.21.1\";\nvar version$1 = \"4.7.1\";\nvar version = \"3.1.3\";\nvar Vhs = {\n  PlaylistLoader: PlaylistLoader,\n  Playlist: Playlist,\n  utils: utils,\n  STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,\n  INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n  lastBandwidthSelector: lastBandwidthSelector,\n  movingAverageBandwidthSelector: movingAverageBandwidthSelector,\n  comparePlaylistBandwidth: comparePlaylistBandwidth,\n  comparePlaylistResolution: comparePlaylistResolution,\n  xhr: xhrFactory()\n}; // Define getter/setters for config properties\n\nObject.keys(Config).forEach(function (prop) {\n  Object.defineProperty(Vhs, prop, {\n    get: function get() {\n      videojs.log.warn(\"using Vhs.\" + prop + \" is UNSAFE be sure you know what you are doing\");\n      return Config[prop];\n    },\n    set: function set(value) {\n      videojs.log.warn(\"using Vhs.\" + prop + \" is UNSAFE be sure you know what you are doing\");\n\n      if (typeof value !== 'number' || value < 0) {\n        videojs.log.warn(\"value of Vhs.\" + prop + \" must be greater than or equal to 0\");\n        return;\n      }\n\n      Config[prop] = value;\n    }\n  });\n});\nvar LOCAL_STORAGE_KEY = 'videojs-vhs';\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in vhs.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleVhsMediaChange\n */\n\nvar handleVhsMediaChange = function handleVhsMediaChange(qualityLevels, playlistLoader) {\n  var newPlaylist = playlistLoader.media();\n  var selectedIndex = -1;\n\n  for (var i = 0; i < qualityLevels.length; i++) {\n    if (qualityLevels[i].id === newPlaylist.id) {\n      selectedIndex = i;\n      break;\n    }\n  }\n\n  qualityLevels.selectedIndex_ = selectedIndex;\n  qualityLevels.trigger({\n    selectedIndex: selectedIndex,\n    type: 'change'\n  });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} vhs Vhs object to listen to for media events.\n * @function handleVhsLoadedMetadata\n */\n\n\nvar handleVhsLoadedMetadata = function handleVhsLoadedMetadata(qualityLevels, vhs) {\n  vhs.representations().forEach(function (rep) {\n    qualityLevels.addQualityLevel(rep);\n  });\n  handleVhsMediaChange(qualityLevels, vhs.playlists);\n}; // HLS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\n\nVhs.canPlaySource = function () {\n  return videojs.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar emeKeySystems = function emeKeySystems(keySystemOptions, mainPlaylist, audioPlaylist) {\n  if (!keySystemOptions) {\n    return keySystemOptions;\n  }\n\n  var codecs = {};\n\n  if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {\n    codecs = unwrapCodecList(parseCodecs(mainPlaylist.attributes.CODECS));\n  }\n\n  if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {\n    codecs.audio = audioPlaylist.attributes.CODECS;\n  }\n\n  var videoContentType = getMimeForCodec(codecs.video);\n  var audioContentType = getMimeForCodec(codecs.audio); // upsert the content types based on the selected playlist\n\n  var keySystemContentTypes = {};\n\n  for (var keySystem in keySystemOptions) {\n    keySystemContentTypes[keySystem] = {};\n\n    if (audioContentType) {\n      keySystemContentTypes[keySystem].audioContentType = audioContentType;\n    }\n\n    if (videoContentType) {\n      keySystemContentTypes[keySystem].videoContentType = videoContentType;\n    } // Default to using the video playlist's PSSH even though they may be different, as\n    // videojs-contrib-eme will only accept one in the options.\n    //\n    // This shouldn't be an issue for most cases as early intialization will handle all\n    // unique PSSH values, and if they aren't, then encrypted events should have the\n    // specific information needed for the unique license.\n\n\n    if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {\n      keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;\n    } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n    // so we need to prevent overwriting the URL entirely\n\n\n    if (typeof keySystemOptions[keySystem] === 'string') {\n      keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n    }\n  }\n\n  return videojs.mergeOptions(keySystemOptions, keySystemContentTypes);\n};\n/**\n * @typedef {Object} KeySystems\n *\n * keySystems configuration for https://github.com/videojs/videojs-contrib-eme\n * Note: not all options are listed here.\n *\n * @property {Uint8Array} [pssh]\n *           Protection System Specific Header\n */\n\n/**\n * Goes through all the playlists and collects an array of KeySystems options objects\n * containing each playlist's keySystems and their pssh values, if available.\n *\n * @param {Object[]} playlists\n *        The playlists to look through\n * @param {string[]} keySystems\n *        The keySystems to collect pssh values for\n *\n * @return {KeySystems[]}\n *         An array of KeySystems objects containing available key systems and their\n *         pssh values\n */\n\n\nvar getAllPsshKeySystemsOptions = function getAllPsshKeySystemsOptions(playlists, keySystems) {\n  return playlists.reduce(function (keySystemsArr, playlist) {\n    if (!playlist.contentProtection) {\n      return keySystemsArr;\n    }\n\n    var keySystemsOptions = keySystems.reduce(function (keySystemsObj, keySystem) {\n      var keySystemOptions = playlist.contentProtection[keySystem];\n\n      if (keySystemOptions && keySystemOptions.pssh) {\n        keySystemsObj[keySystem] = {\n          pssh: keySystemOptions.pssh\n        };\n      }\n\n      return keySystemsObj;\n    }, {});\n\n    if (Object.keys(keySystemsOptions).length) {\n      keySystemsArr.push(keySystemsOptions);\n    }\n\n    return keySystemsArr;\n  }, []);\n};\n/**\n * Returns a promise that waits for the\n * [eme plugin](https://github.com/videojs/videojs-contrib-eme) to create a key session.\n *\n * Works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449 in non-IE11\n * browsers.\n *\n * As per the above ticket, this is particularly important for Chrome, where, if\n * unencrypted content is appended before encrypted content and the key session has not\n * been created, a MEDIA_ERR_DECODE will be thrown once the encrypted content is reached\n * during playback.\n *\n * @param {Object} player\n *        The player instance\n * @param {Object[]} sourceKeySystems\n *        The key systems options from the player source\n * @param {Object} [audioMedia]\n *        The active audio media playlist (optional)\n * @param {Object[]} mainPlaylists\n *        The playlists found on the master playlist object\n *\n * @return {Object}\n *         Promise that resolves when the key session has been created\n */\n\n\nvar waitForKeySessionCreation = function waitForKeySessionCreation(_ref) {\n  var player = _ref.player,\n      sourceKeySystems = _ref.sourceKeySystems,\n      audioMedia = _ref.audioMedia,\n      mainPlaylists = _ref.mainPlaylists;\n\n  if (!player.eme.initializeMediaKeys) {\n    return Promise.resolve();\n  } // TODO should all audio PSSH values be initialized for DRM?\n  //\n  // All unique video rendition pssh values are initialized for DRM, but here only\n  // the initial audio playlist license is initialized. In theory, an encrypted\n  // event should be fired if the user switches to an alternative audio playlist\n  // where a license is required, but this case hasn't yet been tested. In addition, there\n  // may be many alternate audio playlists unlikely to be used (e.g., multiple different\n  // languages).\n\n\n  var playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;\n  var keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));\n  var initializationFinishedPromises = [];\n  var keySessionCreatedPromises = []; // Since PSSH values are interpreted as initData, EME will dedupe any duplicates. The\n  // only place where it should not be deduped is for ms-prefixed APIs, but the early\n  // return for IE11 above, and the existence of modern EME APIs in addition to\n  // ms-prefixed APIs on Edge should prevent this from being a concern.\n  // initializeMediaKeys also won't use the webkit-prefixed APIs.\n\n  keySystemsOptionsArr.forEach(function (keySystemsOptions) {\n    keySessionCreatedPromises.push(new Promise(function (resolve, reject) {\n      player.tech_.one('keysessioncreated', resolve);\n    }));\n    initializationFinishedPromises.push(new Promise(function (resolve, reject) {\n      player.eme.initializeMediaKeys({\n        keySystems: keySystemsOptions\n      }, function (err) {\n        if (err) {\n          reject(err);\n          return;\n        }\n\n        resolve();\n      });\n    }));\n  }); // The reasons Promise.race is chosen over Promise.any:\n  //\n  // * Promise.any is only available in Safari 14+.\n  // * None of these promises are expected to reject. If they do reject, it might be\n  //   better here for the race to surface the rejection, rather than mask it by using\n  //   Promise.any.\n\n  return Promise.race([// If a session was previously created, these will all finish resolving without\n  // creating a new session, otherwise it will take until the end of all license\n  // requests, which is why the key session check is used (to make setup much faster).\n  Promise.all(initializationFinishedPromises), // Once a single session is created, the browser knows DRM will be used.\n  Promise.race(keySessionCreatedPromises)]);\n};\n/**\n * If the [eme](https://github.com/videojs/videojs-contrib-eme) plugin is available, and\n * there are keySystems on the source, sets up source options to prepare the source for\n * eme.\n *\n * @param {Object} player\n *        The player instance\n * @param {Object[]} sourceKeySystems\n *        The key systems options from the player source\n * @param {Object} media\n *        The active media playlist\n * @param {Object} [audioMedia]\n *        The active audio media playlist (optional)\n *\n * @return {boolean}\n *         Whether or not options were configured and EME is available\n */\n\n\nvar setupEmeOptions = function setupEmeOptions(_ref2) {\n  var player = _ref2.player,\n      sourceKeySystems = _ref2.sourceKeySystems,\n      media = _ref2.media,\n      audioMedia = _ref2.audioMedia;\n  var sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);\n\n  if (!sourceOptions) {\n    return false;\n  }\n\n  player.currentSource().keySystems = sourceOptions; // eme handles the rest of the setup, so if it is missing\n  // do nothing.\n\n  if (sourceOptions && !player.eme) {\n    videojs.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin');\n    return false;\n  }\n\n  return true;\n};\n\nvar getVhsLocalStorage = function getVhsLocalStorage() {\n  if (!window$1.localStorage) {\n    return null;\n  }\n\n  var storedObject = window$1.localStorage.getItem(LOCAL_STORAGE_KEY);\n\n  if (!storedObject) {\n    return null;\n  }\n\n  try {\n    return JSON.parse(storedObject);\n  } catch (e) {\n    // someone may have tampered with the value\n    return null;\n  }\n};\n\nvar updateVhsLocalStorage = function updateVhsLocalStorage(options) {\n  if (!window$1.localStorage) {\n    return false;\n  }\n\n  var objectToStore = getVhsLocalStorage();\n  objectToStore = objectToStore ? videojs.mergeOptions(objectToStore, options) : options;\n\n  try {\n    window$1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));\n  } catch (e) {\n    // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n    // storage is set to 0).\n    // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n    // No need to perform any operation.\n    return false;\n  }\n\n  return objectToStore;\n};\n/**\n * Parses VHS-supported media types from data URIs. See\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * for information on data URIs.\n *\n * @param {string} dataUri\n *        The data URI\n *\n * @return {string|Object}\n *         The parsed object/string, or the original string if no supported media type\n *         was found\n */\n\n\nvar expandDataUri = function expandDataUri(dataUri) {\n  if (dataUri.toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') === 0) {\n    return JSON.parse(dataUri.substring(dataUri.indexOf(',') + 1));\n  } // no known case for this data URI, return the string as-is\n\n\n  return dataUri;\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\n\nVhs.supportsNativeHls = function () {\n  if (!document || !document.createElement) {\n    return false;\n  }\n\n  var video = document.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n  if (!videojs.getTech('Html5').isSupported()) {\n    return false;\n  } // HLS manifests can go by many mime-types\n\n\n  var canPlay = [// Apple santioned\n  'application/vnd.apple.mpegurl', // Apple sanctioned for backwards compatibility\n  'audio/mpegurl', // Very common\n  'audio/x-mpegurl', // Very common\n  'application/x-mpegurl', // Included for completeness\n  'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n  return canPlay.some(function (canItPlay) {\n    return /maybe|probably/i.test(video.canPlayType(canItPlay));\n  });\n}();\n\nVhs.supportsNativeDash = function () {\n  if (!document || !document.createElement || !videojs.getTech('Html5').isSupported()) {\n    return false;\n  }\n\n  return /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'));\n}();\n\nVhs.supportsTypeNatively = function (type) {\n  if (type === 'hls') {\n    return Vhs.supportsNativeHls;\n  }\n\n  if (type === 'dash') {\n    return Vhs.supportsNativeDash;\n  }\n\n  return false;\n};\n/**\n * HLS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\n\nVhs.isSupported = function () {\n  return videojs.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar Component = videojs.getComponent('Component');\n/**\n * The Vhs Handler object, where we orchestrate all of the parts\n * of HLS to interact with video.js\n *\n * @class VhsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nvar VhsHandler = /*#__PURE__*/function (_Component) {\n  _inheritsLoose(VhsHandler, _Component);\n\n  function VhsHandler(source, tech, options) {\n    var _this;\n\n    _this = _Component.call(this, tech, videojs.mergeOptions(options.hls, options.vhs)) || this;\n\n    if (options.hls && Object.keys(options.hls).length) {\n      videojs.log.warn('Using hls options is deprecated. Please rename `hls` to `vhs` in your options object.');\n    } // if a tech level `initialBandwidth` option was passed\n    // use that over the VHS level `bandwidth` option\n\n\n    if (typeof options.initialBandwidth === 'number') {\n      _this.options_.bandwidth = options.initialBandwidth;\n    }\n\n    _this.logger_ = logger('VhsHandler'); // tech.player() is deprecated but setup a reference to HLS for\n    // backwards-compatibility\n\n    if (tech.options_ && tech.options_.playerId) {\n      var _player = videojs(tech.options_.playerId);\n\n      if (!_player.hasOwnProperty('hls')) {\n        Object.defineProperty(_player, 'hls', {\n          get: function get() {\n            videojs.log.warn('player.hls is deprecated. Use player.tech().vhs instead.');\n            tech.trigger({\n              type: 'usage',\n              name: 'hls-player-access'\n            });\n            return _assertThisInitialized(_this);\n          },\n          configurable: true\n        });\n      }\n\n      if (!_player.hasOwnProperty('vhs')) {\n        Object.defineProperty(_player, 'vhs', {\n          get: function get() {\n            videojs.log.warn('player.vhs is deprecated. Use player.tech().vhs instead.');\n            tech.trigger({\n              type: 'usage',\n              name: 'vhs-player-access'\n            });\n            return _assertThisInitialized(_this);\n          },\n          configurable: true\n        });\n      }\n\n      if (!_player.hasOwnProperty('dash')) {\n        Object.defineProperty(_player, 'dash', {\n          get: function get() {\n            videojs.log.warn('player.dash is deprecated. Use player.tech().vhs instead.');\n            return _assertThisInitialized(_this);\n          },\n          configurable: true\n        });\n      }\n\n      _this.player_ = _player;\n    }\n\n    _this.tech_ = tech;\n    _this.source_ = source;\n    _this.stats = {};\n    _this.ignoreNextSeekingEvent_ = false;\n\n    _this.setOptions_();\n\n    if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n      tech.overrideNativeAudioTracks(true);\n      tech.overrideNativeVideoTracks(true);\n    } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n      // overriding native HLS only works if audio tracks have been emulated\n      // error early if we're misconfigured\n      throw new Error('Overriding native HLS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n    } // listen for fullscreenchange events for this player so that we\n    // can adjust our quality selection quickly\n\n\n    _this.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (event) {\n      var fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n\n      if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {\n        _this.masterPlaylistController_.fastQualityChange_();\n      } else {\n        // When leaving fullscreen, since the in page pixel dimensions should be smaller\n        // than full screen, see if there should be a rendition switch down to preserve\n        // bandwidth.\n        _this.masterPlaylistController_.checkABR_();\n      }\n    });\n\n    _this.on(_this.tech_, 'seeking', function () {\n      if (this.ignoreNextSeekingEvent_) {\n        this.ignoreNextSeekingEvent_ = false;\n        return;\n      }\n\n      this.setCurrentTime(this.tech_.currentTime());\n    });\n\n    _this.on(_this.tech_, 'error', function () {\n      // verify that the error was real and we are loaded\n      // enough to have mpc loaded.\n      if (this.tech_.error() && this.masterPlaylistController_) {\n        this.masterPlaylistController_.pauseLoading();\n      }\n    });\n\n    _this.on(_this.tech_, 'play', _this.play);\n\n    return _this;\n  }\n\n  var _proto = VhsHandler.prototype;\n\n  _proto.setOptions_ = function setOptions_() {\n    var _this2 = this; // defaults\n\n\n    this.options_.withCredentials = this.options_.withCredentials || false;\n    this.options_.handleManifestRedirects = this.options_.handleManifestRedirects === false ? false : true;\n    this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n    this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;\n    this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;\n    this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n    this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;\n    this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;\n    this.options_.customTagParsers = this.options_.customTagParsers || [];\n    this.options_.customTagMappers = this.options_.customTagMappers || [];\n    this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;\n\n    if (typeof this.options_.blacklistDuration !== 'number') {\n      this.options_.blacklistDuration = 5 * 60;\n    }\n\n    if (typeof this.options_.bandwidth !== 'number') {\n      if (this.options_.useBandwidthFromLocalStorage) {\n        var storedObject = getVhsLocalStorage();\n\n        if (storedObject && storedObject.bandwidth) {\n          this.options_.bandwidth = storedObject.bandwidth;\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'vhs-bandwidth-from-local-storage'\n          });\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'hls-bandwidth-from-local-storage'\n          });\n        }\n\n        if (storedObject && storedObject.throughput) {\n          this.options_.throughput = storedObject.throughput;\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'vhs-throughput-from-local-storage'\n          });\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'hls-throughput-from-local-storage'\n          });\n        }\n      }\n    } // if bandwidth was not set by options or pulled from local storage, start playlist\n    // selection at a reasonable bandwidth\n\n\n    if (typeof this.options_.bandwidth !== 'number') {\n      this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n    } // If the bandwidth number is unchanged from the initial setting\n    // then this takes precedence over the enableLowInitialPlaylist option\n\n\n    this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n    ['withCredentials', 'useDevicePixelRatio', 'limitRenditionByPlayerDimensions', 'bandwidth', 'smoothQualityChange', 'customTagParsers', 'customTagMappers', 'handleManifestRedirects', 'cacheEncryptionKeys', 'playlistSelector', 'initialPlaylistSelector', 'experimentalBufferBasedABR', 'liveRangeSafeTimeDelta', 'experimentalLLHLS', 'useNetworkInformationApi', 'useDtsForTimestampOffset', 'experimentalExactManifestTimings', 'experimentalLeastPixelDiffSelector'].forEach(function (option) {\n      if (typeof _this2.source_[option] !== 'undefined') {\n        _this2.options_[option] = _this2.source_[option];\n      }\n    });\n    this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n    this.useDevicePixelRatio = this.options_.useDevicePixelRatio;\n  }\n  /**\n   * called when player.src gets called, handle a new source\n   *\n   * @param {Object} src the source object to handle\n   */\n  ;\n\n  _proto.src = function src(_src, type) {\n    var _this3 = this; // do nothing if the src is falsey\n\n\n    if (!_src) {\n      return;\n    }\n\n    this.setOptions_(); // add master playlist controller options\n\n    this.options_.src = expandDataUri(this.source_.src);\n    this.options_.tech = this.tech_;\n    this.options_.externVhs = Vhs;\n    this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update the tech\n\n    this.options_.seekTo = function (time) {\n      _this3.tech_.setCurrentTime(time);\n    };\n\n    if (this.options_.smoothQualityChange) {\n      videojs.log.warn('smoothQualityChange is deprecated and will be removed in the next major version');\n    }\n\n    this.masterPlaylistController_ = new MasterPlaylistController(this.options_);\n    var playbackWatcherOptions = videojs.mergeOptions({\n      liveRangeSafeTimeDelta: SAFE_TIME_DELTA\n    }, this.options_, {\n      seekable: function seekable() {\n        return _this3.seekable();\n      },\n      media: function media() {\n        return _this3.masterPlaylistController_.media();\n      },\n      masterPlaylistController: this.masterPlaylistController_\n    });\n    this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);\n    this.masterPlaylistController_.on('error', function () {\n      var player = videojs.players[_this3.tech_.options_.playerId];\n      var error = _this3.masterPlaylistController_.error;\n\n      if (typeof error === 'object' && !error.code) {\n        error.code = 3;\n      } else if (typeof error === 'string') {\n        error = {\n          message: error,\n          code: 3\n        };\n      }\n\n      player.error(error);\n    });\n    var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR; // `this` in selectPlaylist should be the VhsHandler for backwards\n    // compatibility with < v2\n\n    this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);\n    this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n    this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;\n    this.mediaSource = this.masterPlaylistController_.mediaSource; // Proxy assignment of some properties to the master playlist\n    // controller. Using a custom property for backwards compatibility\n    // with < v2\n\n    Object.defineProperties(this, {\n      selectPlaylist: {\n        get: function get() {\n          return this.masterPlaylistController_.selectPlaylist;\n        },\n        set: function set(selectPlaylist) {\n          this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);\n        }\n      },\n      throughput: {\n        get: function get() {\n          return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;\n        },\n        set: function set(throughput) {\n          this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n          // for the cumulative average\n\n          this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;\n        }\n      },\n      bandwidth: {\n        get: function get() {\n          var playerBandwidthEst = this.masterPlaylistController_.mainSegmentLoader_.bandwidth;\n          var networkInformation = window$1.navigator.connection || window$1.navigator.mozConnection || window$1.navigator.webkitConnection;\n          var tenMbpsAsBitsPerSecond = 10e6;\n\n          if (this.options_.useNetworkInformationApi && networkInformation) {\n            // downlink returns Mbps\n            // https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink\n            var networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1000 * 1000; // downlink maxes out at 10 Mbps. In the event that both networkInformationApi and the player\n            // estimate a bandwidth greater than 10 Mbps, use the larger of the two estimates to ensure that\n            // high quality streams are not filtered out.\n\n            if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {\n              playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);\n            } else {\n              playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;\n            }\n          }\n\n          return playerBandwidthEst;\n        },\n        set: function set(bandwidth) {\n          this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n          // `count` is set to zero that current value of `rate` isn't included\n          // in the cumulative average\n\n          this.masterPlaylistController_.mainSegmentLoader_.throughput = {\n            rate: 0,\n            count: 0\n          };\n        }\n      },\n\n      /**\n       * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n       * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n       * the entire process after that - decryption, transmuxing, and appending - provided\n       * by `throughput`.\n       *\n       * Since the two process are serial, the overall system bandwidth is given by:\n       *   sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n       */\n      systemBandwidth: {\n        get: function get() {\n          var invBandwidth = 1 / (this.bandwidth || 1);\n          var invThroughput;\n\n          if (this.throughput > 0) {\n            invThroughput = 1 / this.throughput;\n          } else {\n            invThroughput = 0;\n          }\n\n          var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n          return systemBitrate;\n        },\n        set: function set() {\n          videojs.log.error('The \"systemBandwidth\" property is read-only');\n        }\n      }\n    });\n\n    if (this.options_.bandwidth) {\n      this.bandwidth = this.options_.bandwidth;\n    }\n\n    if (this.options_.throughput) {\n      this.throughput = this.options_.throughput;\n    }\n\n    Object.defineProperties(this.stats, {\n      bandwidth: {\n        get: function get() {\n          return _this3.bandwidth || 0;\n        },\n        enumerable: true\n      },\n      mediaRequests: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaRequests_() || 0;\n        },\n        enumerable: true\n      },\n      mediaRequestsAborted: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;\n        },\n        enumerable: true\n      },\n      mediaRequestsTimedout: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;\n        },\n        enumerable: true\n      },\n      mediaRequestsErrored: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;\n        },\n        enumerable: true\n      },\n      mediaTransferDuration: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;\n        },\n        enumerable: true\n      },\n      mediaBytesTransferred: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;\n        },\n        enumerable: true\n      },\n      mediaSecondsLoaded: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;\n        },\n        enumerable: true\n      },\n      mediaAppends: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mediaAppends_() || 0;\n        },\n        enumerable: true\n      },\n      mainAppendsToLoadedData: {\n        get: function get() {\n          return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0;\n        },\n        enumerable: true\n      },\n      audioAppendsToLoadedData: {\n        get: function get() {\n          return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0;\n        },\n        enumerable: true\n      },\n      appendsToLoadedData: {\n        get: function get() {\n          return _this3.masterPlaylistController_.appendsToLoadedData_() || 0;\n        },\n        enumerable: true\n      },\n      timeToLoadedData: {\n        get: function get() {\n          return _this3.masterPlaylistController_.timeToLoadedData_() || 0;\n        },\n        enumerable: true\n      },\n      buffered: {\n        get: function get() {\n          return timeRangesToArray(_this3.tech_.buffered());\n        },\n        enumerable: true\n      },\n      currentTime: {\n        get: function get() {\n          return _this3.tech_.currentTime();\n        },\n        enumerable: true\n      },\n      currentSource: {\n        get: function get() {\n          return _this3.tech_.currentSource_;\n        },\n        enumerable: true\n      },\n      currentTech: {\n        get: function get() {\n          return _this3.tech_.name_;\n        },\n        enumerable: true\n      },\n      duration: {\n        get: function get() {\n          return _this3.tech_.duration();\n        },\n        enumerable: true\n      },\n      master: {\n        get: function get() {\n          return _this3.playlists.master;\n        },\n        enumerable: true\n      },\n      playerDimensions: {\n        get: function get() {\n          return _this3.tech_.currentDimensions();\n        },\n        enumerable: true\n      },\n      seekable: {\n        get: function get() {\n          return timeRangesToArray(_this3.tech_.seekable());\n        },\n        enumerable: true\n      },\n      timestamp: {\n        get: function get() {\n          return Date.now();\n        },\n        enumerable: true\n      },\n      videoPlaybackQuality: {\n        get: function get() {\n          return _this3.tech_.getVideoPlaybackQuality();\n        },\n        enumerable: true\n      }\n    });\n    this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));\n    this.tech_.on('bandwidthupdate', function () {\n      if (_this3.options_.useBandwidthFromLocalStorage) {\n        updateVhsLocalStorage({\n          bandwidth: _this3.bandwidth,\n          throughput: Math.round(_this3.throughput)\n        });\n      }\n    });\n    this.masterPlaylistController_.on('selectedinitialmedia', function () {\n      // Add the manual rendition mix-in to VhsHandler\n      renditionSelectionMixin(_this3);\n    });\n    this.masterPlaylistController_.sourceUpdater_.on('createdsourcebuffers', function () {\n      _this3.setupEme_();\n    }); // the bandwidth of the primary segment loader is our best\n    // estimate of overall bandwidth\n\n    this.on(this.masterPlaylistController_, 'progress', function () {\n      this.tech_.trigger('progress');\n    }); // In the live case, we need to ignore the very first `seeking` event since\n    // that will be the result of the seek-to-live behavior\n\n    this.on(this.masterPlaylistController_, 'firstplay', function () {\n      this.ignoreNextSeekingEvent_ = true;\n    });\n    this.setupQualityLevels_(); // do nothing if the tech has been disposed already\n    // this can occur if someone sets the src in player.ready(), for instance\n\n    if (!this.tech_.el()) {\n      return;\n    }\n\n    this.mediaSourceUrl_ = window$1.URL.createObjectURL(this.masterPlaylistController_.mediaSource);\n    this.tech_.src(this.mediaSourceUrl_);\n  };\n\n  _proto.createKeySessions_ = function createKeySessions_() {\n    var _this4 = this;\n\n    var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n    this.logger_('waiting for EME key session creation');\n    waitForKeySessionCreation({\n      player: this.player_,\n      sourceKeySystems: this.source_.keySystems,\n      audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),\n      mainPlaylists: this.playlists.master.playlists\n    }).then(function () {\n      _this4.logger_('created EME key session');\n\n      _this4.masterPlaylistController_.sourceUpdater_.initializedEme();\n    })[\"catch\"](function (err) {\n      _this4.logger_('error while creating EME key session', err);\n\n      _this4.player_.error({\n        message: 'Failed to initialize media keys for EME',\n        code: 3\n      });\n    });\n  };\n\n  _proto.handleWaitingForKey_ = function handleWaitingForKey_() {\n    // If waitingforkey is fired, it's possible that the data that's necessary to retrieve\n    // the key is in the manifest. While this should've happened on initial source load, it\n    // may happen again in live streams where the keys change, and the manifest info\n    // reflects the update.\n    //\n    // Because videojs-contrib-eme compares the PSSH data we send to that of PSSH data it's\n    // already requested keys for, we don't have to worry about this generating extraneous\n    // requests.\n    this.logger_('waitingforkey fired, attempting to create any new key sessions');\n    this.createKeySessions_();\n  }\n  /**\n   * If necessary and EME is available, sets up EME options and waits for key session\n   * creation.\n   *\n   * This function also updates the source updater so taht it can be used, as for some\n   * browsers, EME must be configured before content is appended (if appending unencrypted\n   * content before encrypted content).\n   */\n  ;\n\n  _proto.setupEme_ = function setupEme_() {\n    var _this5 = this;\n\n    var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n    var didSetupEmeOptions = setupEmeOptions({\n      player: this.player_,\n      sourceKeySystems: this.source_.keySystems,\n      media: this.playlists.media(),\n      audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()\n    });\n    this.player_.tech_.on('keystatuschange', function (e) {\n      if (e.status !== 'output-restricted') {\n        return;\n      }\n\n      var masterPlaylist = _this5.masterPlaylistController_.master();\n\n      if (!masterPlaylist || !masterPlaylist.playlists) {\n        return;\n      }\n\n      var excludedHDPlaylists = []; // Assume all HD streams are unplayable and exclude them from ABR selection\n\n      masterPlaylist.playlists.forEach(function (playlist) {\n        if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {\n          if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {\n            playlist.excludeUntil = Infinity;\n            excludedHDPlaylists.push(playlist);\n          }\n        }\n      });\n\n      if (excludedHDPlaylists.length) {\n        var _videojs$log;\n\n        (_videojs$log = videojs.log).warn.apply(_videojs$log, ['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.'].concat(excludedHDPlaylists)); // Clear the buffer before switching playlists, since it may already contain unplayable segments\n\n\n        _this5.masterPlaylistController_.fastQualityChange_();\n      }\n    });\n    this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);\n    this.player_.tech_.on('waitingforkey', this.handleWaitingForKey_); // In IE11 this is too early to initialize media keys, and IE11 does not support\n    // promises.\n\n    if (videojs.browser.IE_VERSION === 11 || !didSetupEmeOptions) {\n      // If EME options were not set up, we've done all we could to initialize EME.\n      this.masterPlaylistController_.sourceUpdater_.initializedEme();\n      return;\n    }\n\n    this.createKeySessions_();\n  }\n  /**\n   * Initializes the quality levels and sets listeners to update them.\n   *\n   * @method setupQualityLevels_\n   * @private\n   */\n  ;\n\n  _proto.setupQualityLevels_ = function setupQualityLevels_() {\n    var _this6 = this;\n\n    var player = videojs.players[this.tech_.options_.playerId]; // if there isn't a player or there isn't a qualityLevels plugin\n    // or qualityLevels_ listeners have already been setup, do nothing.\n\n    if (!player || !player.qualityLevels || this.qualityLevels_) {\n      return;\n    }\n\n    this.qualityLevels_ = player.qualityLevels();\n    this.masterPlaylistController_.on('selectedinitialmedia', function () {\n      handleVhsLoadedMetadata(_this6.qualityLevels_, _this6);\n    });\n    this.playlists.on('mediachange', function () {\n      handleVhsMediaChange(_this6.qualityLevels_, _this6.playlists);\n    });\n  }\n  /**\n   * return the version\n   */\n  ;\n\n  VhsHandler.version = function version$5() {\n    return {\n      '@videojs/http-streaming': version$4,\n      'mux.js': version$3,\n      'mpd-parser': version$2,\n      'm3u8-parser': version$1,\n      'aes-decrypter': version\n    };\n  }\n  /**\n   * return the version\n   */\n  ;\n\n  _proto.version = function version() {\n    return this.constructor.version();\n  };\n\n  _proto.canChangeType = function canChangeType() {\n    return SourceUpdater.canChangeType();\n  }\n  /**\n   * Begin playing the video.\n   */\n  ;\n\n  _proto.play = function play() {\n    this.masterPlaylistController_.play();\n  }\n  /**\n   * a wrapper around the function in MasterPlaylistController\n   */\n  ;\n\n  _proto.setCurrentTime = function setCurrentTime(currentTime) {\n    this.masterPlaylistController_.setCurrentTime(currentTime);\n  }\n  /**\n   * a wrapper around the function in MasterPlaylistController\n   */\n  ;\n\n  _proto.duration = function duration() {\n    return this.masterPlaylistController_.duration();\n  }\n  /**\n   * a wrapper around the function in MasterPlaylistController\n   */\n  ;\n\n  _proto.seekable = function seekable() {\n    return this.masterPlaylistController_.seekable();\n  }\n  /**\n   * Abort all outstanding work and cleanup.\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    if (this.playbackWatcher_) {\n      this.playbackWatcher_.dispose();\n    }\n\n    if (this.masterPlaylistController_) {\n      this.masterPlaylistController_.dispose();\n    }\n\n    if (this.qualityLevels_) {\n      this.qualityLevels_.dispose();\n    }\n\n    if (this.player_) {\n      delete this.player_.vhs;\n      delete this.player_.dash;\n      delete this.player_.hls;\n    }\n\n    if (this.tech_ && this.tech_.vhs) {\n      delete this.tech_.vhs;\n    } // don't check this.tech_.hls as it will log a deprecated warning\n\n\n    if (this.tech_) {\n      delete this.tech_.hls;\n    }\n\n    if (this.mediaSourceUrl_ && window$1.URL.revokeObjectURL) {\n      window$1.URL.revokeObjectURL(this.mediaSourceUrl_);\n      this.mediaSourceUrl_ = null;\n    }\n\n    if (this.tech_) {\n      this.tech_.off('waitingforkey', this.handleWaitingForKey_);\n    }\n\n    _Component.prototype.dispose.call(this);\n  };\n\n  _proto.convertToProgramTime = function convertToProgramTime(time, callback) {\n    return getProgramTime({\n      playlist: this.masterPlaylistController_.media(),\n      time: time,\n      callback: callback\n    });\n  } // the player must be playing before calling this\n  ;\n\n  _proto.seekToProgramTime = function seekToProgramTime$1(programTime, callback, pauseAfterSeek, retryCount) {\n    if (pauseAfterSeek === void 0) {\n      pauseAfterSeek = true;\n    }\n\n    if (retryCount === void 0) {\n      retryCount = 2;\n    }\n\n    return seekToProgramTime({\n      programTime: programTime,\n      playlist: this.masterPlaylistController_.media(),\n      retryCount: retryCount,\n      pauseAfterSeek: pauseAfterSeek,\n      seekTo: this.options_.seekTo,\n      tech: this.options_.tech,\n      callback: callback\n    });\n  };\n\n  return VhsHandler;\n}(Component);\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\n\nvar VhsSourceHandler = {\n  name: 'videojs-http-streaming',\n  VERSION: version$4,\n  canHandleSource: function canHandleSource(srcObj, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    var localOptions = videojs.mergeOptions(videojs.options, options);\n    return VhsSourceHandler.canPlayType(srcObj.type, localOptions);\n  },\n  handleSource: function handleSource(source, tech, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    var localOptions = videojs.mergeOptions(videojs.options, options);\n    tech.vhs = new VhsHandler(source, tech, localOptions);\n\n    if (!videojs.hasOwnProperty('hls')) {\n      Object.defineProperty(tech, 'hls', {\n        get: function get() {\n          videojs.log.warn('player.tech().hls is deprecated. Use player.tech().vhs instead.');\n          return tech.vhs;\n        },\n        configurable: true\n      });\n    }\n\n    tech.vhs.xhr = xhrFactory();\n    tech.vhs.src(source.src, source.type);\n    return tech.vhs;\n  },\n  canPlayType: function canPlayType(type, options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    var _videojs$mergeOptions = videojs.mergeOptions(videojs.options, options),\n        _videojs$mergeOptions2 = _videojs$mergeOptions.vhs;\n\n    _videojs$mergeOptions2 = _videojs$mergeOptions2 === void 0 ? {} : _videojs$mergeOptions2;\n    var _videojs$mergeOptions3 = _videojs$mergeOptions2.overrideNative,\n        overrideNative = _videojs$mergeOptions3 === void 0 ? !videojs.browser.IS_ANY_SAFARI : _videojs$mergeOptions3,\n        _videojs$mergeOptions4 = _videojs$mergeOptions.hls;\n    _videojs$mergeOptions4 = _videojs$mergeOptions4 === void 0 ? {} : _videojs$mergeOptions4;\n    var _videojs$mergeOptions5 = _videojs$mergeOptions4.overrideNative,\n        legacyOverrideNative = _videojs$mergeOptions5 === void 0 ? false : _videojs$mergeOptions5;\n    var supportedType = simpleTypeFromSourceType(type);\n    var canUseMsePlayback = supportedType && (!Vhs.supportsTypeNatively(supportedType) || legacyOverrideNative || overrideNative);\n    return canUseMsePlayback ? 'maybe' : '';\n  }\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {boolean} if  native media sources are supported\n */\n\nvar supportsNativeMediaSources = function supportsNativeMediaSources() {\n  return browserSupportsCodec('avc1.4d400d,mp4a.40.2');\n}; // register source handlers with the appropriate techs\n\n\nif (supportsNativeMediaSources()) {\n  videojs.getTech('Html5').registerSourceHandler(VhsSourceHandler, 0);\n}\n\nvideojs.VhsHandler = VhsHandler;\nObject.defineProperty(videojs, 'HlsHandler', {\n  get: function get() {\n    videojs.log.warn('videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.');\n    return VhsHandler;\n  },\n  configurable: true\n});\nvideojs.VhsSourceHandler = VhsSourceHandler;\nObject.defineProperty(videojs, 'HlsSourceHandler', {\n  get: function get() {\n    videojs.log.warn('videojs.HlsSourceHandler is deprecated. ' + 'Use videojs.VhsSourceHandler instead.');\n    return VhsSourceHandler;\n  },\n  configurable: true\n});\nvideojs.Vhs = Vhs;\nObject.defineProperty(videojs, 'Hls', {\n  get: function get() {\n    videojs.log.warn('videojs.Hls is deprecated. Use videojs.Vhs instead.');\n    return Vhs;\n  },\n  configurable: true\n});\n\nif (!videojs.use) {\n  videojs.registerComponent('Hls', Vhs);\n  videojs.registerComponent('Vhs', Vhs);\n}\n\nvideojs.options.vhs = videojs.options.vhs || {};\nvideojs.options.hls = videojs.options.hls || {};\n\nif (!videojs.getPlugin || !videojs.getPlugin('reloadSourceOnError')) {\n  var registerPlugin = videojs.registerPlugin || videojs.plugin;\n  registerPlugin('reloadSourceOnError', reloadSourceOnError);\n}\n\nexport default videojs;\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function\");\n  }\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      writable: true,\n      configurable: true\n    }\n  });\n  Object.defineProperty(subClass, \"prototype\", {\n    writable: false\n  });\n  if (superClass) setPrototypeOf(subClass, superClass);\n}","/*! @name videojs-landscape-fullscreen @version 11.1111.0 @license ISC */\n!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n(require(\"video.js\"),require(\"global/window\")):\"function\"==typeof define&&define.amd?define([\"video.js\",\"global/window\"],n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).videojsLandscapeFullscreen=n(e.videojs,e.window)}(this,(function(e,n){\"use strict\";function t(e){return e&&\"object\"==typeof e&&\"default\"in e?e:{default:e}}var o=t(e),i=t(n),r={fullscreen:{enterOnRotate:!0,exitOnRotate:!0,alwaysInLandscapeMode:!0,iOS:!0}},l=i.default.screen;l.lockOrientationUniversal=function(e){return l.orientation&&l.orientation.lock(e).then((function(){}),(function(e){return console.log(e)}))||l.mozLockOrientation&&l.mozLockOrientation(e)||l.msLockOrientation&&l.msLockOrientation(e)};var a=function(){return\"number\"==typeof i.default.orientation||l&&l.orientation&&l.orientation.angle?i.default.orientation:(o.default.log(\"angle unknown\"),0)},u=o.default.registerPlugin||o.default.plugin,s=function(e){var n=this;(o.default.browser.IS_ANDROID||o.default.browser.IS_IOS)&&this.ready((function(){!function(e,n){e.addClass(\"vjs-landscape-fullscreen\"),n.fullscreen.iOS&&o.default.browser.IS_IOS&&o.default.browser.IOS_VERSION>9&&!e.el_.ownerDocument.querySelector(\".bc-iframe\")&&(e.tech_.el_.setAttribute(\"playsinline\",\"playsinline\"),e.tech_.supportsFullScreen=function(){return!1});var t=function(){var t=a();90!==t&&270!==t&&-90!==t||n.fullscreen.enterOnRotate&&!1===e.paused()&&(e.requestFullscreen(),l.lockOrientationUniversal(\"landscape\")),0!==t&&180!==t||n.fullscreen.exitOnRotate&&e.isFullscreen()&&e.exitFullscreen()};o.default.browser.IS_IOS?i.default.addEventListener(\"orientationchange\",t):l&&l.orientation&&(l.orientation.onchange=t),e.on(\"fullscreenchange\",(function(t){(o.default.browser.IS_ANDROID||o.default.browser.IS_IOS)&&!a()&&e.isFullscreen()&&n.fullscreen.alwaysInLandscapeMode&&l.lockOrientationUniversal(\"landscape\")})),e.on(\"dispose\",(function(){i.default.removeEventListener(\"orientationchange\",t)}))}(n,o.default.mergeOptions(r,e))}))};return u(\"landscapeFullscreen\",s),s.VERSION=\"11.1111.0\",s}));\n","/*! @name videojs-logo @version 2.1.6 @license MIT */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) :\n\ttypeof define === 'function' && define.amd ? define(['video.js'], factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsLogo = factory(global.videojs));\n}(this, (function (videojs) { 'use strict';\n\n\tfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n\tvar videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);\n\n\tfunction createCommonjsModule(fn, basedir, module) {\n\t\treturn module = {\n\t\t  path: basedir,\n\t\t  exports: {},\n\t\t  require: function (path, base) {\n\t      return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t    }\n\t\t}, fn(module, module.exports), module.exports;\n\t}\n\n\tfunction commonjsRequire () {\n\t\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n\t}\n\n\tvar setPrototypeOf = createCommonjsModule(function (module) {\n\t  function _setPrototypeOf(o, p) {\n\t    module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n\t      o.__proto__ = p;\n\t      return o;\n\t    };\n\n\t    module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t    return _setPrototypeOf(o, p);\n\t  }\n\n\t  module.exports = _setPrototypeOf;\n\t  module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t});\n\n\tvar inheritsLoose = createCommonjsModule(function (module) {\n\t  function _inheritsLoose(subClass, superClass) {\n\t    subClass.prototype = Object.create(superClass.prototype);\n\t    subClass.prototype.constructor = subClass;\n\t    setPrototypeOf(subClass, superClass);\n\t  }\n\n\t  module.exports = _inheritsLoose;\n\t  module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t});\n\n\tvar version = \"2.1.6\";\n\n\tvar Plugin = videojs__default['default'].getPlugin('plugin'); // Default options for the plugin.\n\n\tvar defaults = {\n\t  image: undefined,\n\t  url: undefined,\n\t  position: 'top-right',\n\t  offsetH: 0,\n\t  offsetV: 0,\n\t  width: undefined,\n\t  height: undefined,\n\t  padding: 5,\n\t  fadeDelay: 5000,\n\t  hideOnReady: false,\n\t  opacity: 1\n\t};\n\t/**\n\t * A videojs plugin to display a logo image on the player.\n\t */\n\n\tvar Logo = /*#__PURE__*/function (_Plugin) {\n\t  inheritsLoose(Logo, _Plugin);\n\n\t  /**\n\t   * Create a Logo plugin instance.\n\t   *\n\t   * @param {Player} player A Video.js Player instance.\n\t   * @param {Object} options An optional options object.\n\t   * @param {string} options.image The URL to the logo image.\n\t   * @param {string} [options.url] A url to be linked to from the logo. If the user clicks the logo the link will open in a new window.\n\t   * @param {string} [options.position=\"top-right\"] The location to place the logo (top-left, top-right, bottom-left, or bottom-right).\n\t   * @param {number} [options.offsetH=0] Horizontal offset (px) from the edge of the video.\n\t   * @param {number} [options.offsetV=0] Vertical offset (px) from the edge of the video.\n\t   * @param {number} [options.width] The width of the logo image (px). If not specified, it will be the width of the original image.\n\t   * @param {number} [options.height] The height of the logo image (px). If not specified, it will be the height of the original image.\n\t   * @param {number} [options.padding=5] Padding around the logo image (px).\n\t   * @param {?Number} [options.fadeDelay=5000] Time until fade-out begins (msec). If `null` is specified, automatic fade-out is not performed.\n\t   * @param {boolean} [options.hideOnReady=false] Do not show the logo image when the player is ready.\n\t   * @param {number} [options.opacity=1] The opacity of the image. If not specified it will default to 1.\n\t   */\n\t  function Logo(player, options) {\n\t    var _this;\n\n\t    _this = _Plugin.call(this, player) || this;\n\t    _this.tid = null;\n\t    _this.div = null;\n\t    _this.options = videojs__default['default'].mergeOptions(defaults, options);\n\n\t    _this.player.ready(function () {\n\t      return _this._onPlayerReady();\n\t    });\n\n\t    return _this;\n\t  }\n\t  /**\n\t   * Start the plugin after the player is ready.\n\t   *\n\t   * @private\n\t   */\n\n\n\t  var _proto = Logo.prototype;\n\n\t  _proto._onPlayerReady = function _onPlayerReady() {\n\t    this.player.addClass('vjs-logo');\n\n\t    if (!this.options.image) {\n\t      return;\n\t    }\n\n\t    this._setup();\n\n\t    if (!this.options.hideOnReady) {\n\t      this.show();\n\t    }\n\t  }\n\t  /**\n\t   * Setup the plugin.\n\t   *\n\t   * @private\n\t   */\n\t  ;\n\n\t  _proto._setup = function _setup() {\n\t    var _this2 = this;\n\n\t    var video = this.player.el(); // Create div element\n\n\t    var div = document.createElement('div'); // eslint-disable-line no-undef\n\n\t    div.classList.add('vjs-logo-content');\n\t    div.classList.add('vjs-logo-hide');\n\t    div.style.padding = this.options.padding + 'px'; // Setup position\n\n\t    var _this$options = this.options,\n\t        offsetH = _this$options.offsetH,\n\t        offsetV = _this$options.offsetV;\n\n\t    switch (this.options.position) {\n\t      case 'top-left':\n\t        div.style.top = offsetV + 'px';\n\t        div.style.left = offsetH + 'px';\n\t        break;\n\n\t      case 'top-right':\n\t        div.style.top = offsetV + 'px';\n\t        div.style.right = offsetH + 'px';\n\t        break;\n\n\t      case 'bottom-left':\n\t        div.style.bottom = offsetV + 'px';\n\t        div.style.left = offsetH + 'px';\n\t        break;\n\n\t      case 'bottom-right':\n\t        div.style.bottom = offsetV + 'px';\n\t        div.style.right = offsetH + 'px';\n\t        break;\n\n\t      default:\n\t        div.style.top = offsetV + 'px';\n\t        div.style.right = offsetH + 'px';\n\t    }\n\n\t    this.div = div; // Create img element\n\n\t    var img = document.createElement('img'); // eslint-disable-line no-undef\n\n\t    img.src = this.options.image;\n\t    var _this$options2 = this.options,\n\t        width = _this$options2.width,\n\t        height = _this$options2.height,\n\t        opacity = _this$options2.opacity;\n\n\t    if (width) {\n\t      img.width = width;\n\t    }\n\n\t    if (height) {\n\t      img.height = height;\n\t    }\n\n\t    if (opacity) {\n\t      img.style.opacity = opacity;\n\t    }\n\n\t    if (this.options.url) {\n\t      // Create a element for the image link\n\t      var a = document.createElement('a'); // eslint-disable-line no-undef\n\n\t      a.href = this.options.url;\n\n\t      a.onclick = function (e) {\n\t        e.preventDefault();\n\t        window.open(_this2.options.url); // eslint-disable-line no-undef\n\t      };\n\n\t      a.appendChild(img);\n\t      div.appendChild(a);\n\t    } else {\n\t      div.appendChild(img);\n\t    }\n\n\t    video.appendChild(div);\n\t  }\n\t  /**\n\t   * Show the logo image.\n\t   */\n\t  ;\n\n\t  _proto.show = function show() {\n\t    var _this3 = this;\n\n\t    // Clear timeout if set\n\t    if (this.tid) {\n\t      clearTimeout(this.tid);\n\t      this.tid = null;\n\t    } // Show the logo image\n\n\n\t    if (this.div) {\n\t      this.div.classList.remove('vjs-logo-hide');\n\t    } // Set timeout to hide the logo image\n\n\n\t    if (this.options.fadeDelay !== null) {\n\t      this.tid = setTimeout(function () {\n\t        _this3.hide();\n\n\t        _this3.tid = null;\n\t      }, this.options.fadeDelay);\n\t    }\n\t  }\n\t  /**\n\t   * Hide logo image.\n\t   */\n\t  ;\n\n\t  _proto.hide = function hide() {\n\t    // Hide the logo image\n\t    if (this.div) {\n\t      this.div.classList.add('vjs-logo-hide');\n\t    }\n\t  };\n\n\t  return Logo;\n\t}(Plugin); // Define default values for the plugin's `state` object here.\n\n\n\tLogo.defaultState = {}; // Include the version number.\n\n\tLogo.VERSION = version; // Register the plugin with video.js.\n\n\tvideojs__default['default'].registerPlugin('logo', Logo);\n\n\treturn Logo;\n\n})));\n","/*! @name videojs-seek-buttons @version 3.0.1 @license Apache-2.0 */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) :\n  typeof define === 'function' && define.amd ? define(['video.js'], factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsSeekButtons = factory(global.videojs));\n}(this, (function (videojs) { 'use strict';\n\n  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n  var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);\n\n  function _setPrototypeOf(o, p) {\n    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n      o.__proto__ = p;\n      return o;\n    };\n\n    return _setPrototypeOf(o, p);\n  }\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    _setPrototypeOf(subClass, superClass);\n  }\n\n  var version = \"3.0.1\";\n\n  var Button = videojs__default['default'].getComponent('Button'); // Default options for the plugin.\n\n  var defaults = {\n    forwardIndex: 1,\n    backIndex: 1\n  };\n  /**\n   * Set up buttons when the player is ready.\n   *\n   * @function onPlayerReady\n   * @param    {Player} player\n   *           A Video.js player object.\n   *\n   * @param    {Object} [options={}]\n   *           A plain object containing options for the plugin.\n   */\n\n  var onPlayerReady = function onPlayerReady(player, options) {\n    player.addClass('vjs-seek-buttons');\n\n    if (options.forward && options.forward > 0) {\n      player.controlBar.seekForward = player.controlBar.addChild('seekButton', {\n        direction: 'forward',\n        seconds: options.forward\n      }, options.forwardIndex);\n    }\n\n    if (options.back && options.back > 0) {\n      player.controlBar.seekBack = player.controlBar.addChild('seekButton', {\n        direction: 'back',\n        seconds: options.back\n      }, options.backIndex);\n    }\n  };\n  /**\n   * Plugin init if ready or on ready\n   *\n   * @function seekButtons\n   * @param    {Object} [options={}]\n   *           An object of options left to the plugin author to define.\n   */\n\n\n  var seekButtons = function seekButtons(options) {\n    var _this = this;\n\n    this.ready(function () {\n      onPlayerReady(_this, videojs__default['default'].mergeOptions(defaults, options));\n    });\n  }; // Include the version number.\n\n\n  seekButtons.VERSION = version;\n  /**\n   * Button to seek forward/back\n   *\n   * @extends Button\n   * @class SeekButton\n   */\n\n  var SeekButton = /*#__PURE__*/function (_Button) {\n    _inheritsLoose(SeekButton, _Button);\n\n    /**\n     * Constructor for class\n     *\n     * @param {Player|Object} player The player\n     * @param {Object=} options Button options\n     * @param {string} options.direction back or forward\n     * @param {Int} options.seconds number of seconds to seek\n     */\n    function SeekButton(player, options) {\n      var _this2;\n\n      _this2 = _Button.call(this, player, options) || this;\n\n      if (_this2.options_.direction === 'forward') {\n        _this2.controlText(_this2.localize('Seek forward {{seconds}} seconds').replace('{{seconds}}', _this2.options_.seconds));\n      } else if (_this2.options_.direction === 'back') {\n        _this2.controlText(_this2.localize('Seek back {{seconds}} seconds').replace('{{seconds}}', _this2.options_.seconds));\n      }\n\n      return _this2;\n    }\n    /**\n     * Return button class names which include the seek amount.\n     *\n     * @return {string} css cass string\n     */\n\n\n    var _proto = SeekButton.prototype;\n\n    _proto.buildCSSClass = function buildCSSClass() {\n      /* Each button will have the classes:\n         `vjs-seek-button`\n         `skip-forward` or `skip-back`\n         `skip-n` where `n` is the number of seconds\n         So you could have a generic icon for \"skip back\" and a more\n         specific one for \"skip back 30 seconds\"\n      */\n      return \"vjs-seek-button skip-\" + this.options_.direction + \" \" + (\"skip-\" + this.options_.seconds + \" \" + _Button.prototype.buildCSSClass.call(this));\n    }\n    /**\n     * Seek with the button's configured offset\n     */\n    ;\n\n    _proto.handleClick = function handleClick() {\n      var now = this.player_.currentTime();\n\n      if (this.options_.direction === 'forward') {\n        var duration = this.player_.duration();\n\n        if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {\n          duration = this.player_.liveTracker.seekableEnd();\n        }\n\n        this.player_.currentTime(Math.min(now + this.options_.seconds, duration));\n      } else if (this.options_.direction === 'back') {\n        this.player_.currentTime(Math.max(0, now - this.options_.seconds));\n      }\n    };\n\n    return SeekButton;\n  }(Button);\n\n  videojs__default['default'].registerComponent('SeekButton', SeekButton); // Register the plugin with video.js.\n\n  videojs__default['default'].registerPlugin('seekButtons', seekButtons);\n\n  return seekButtons;\n\n})));\n","(function (global, factory) {\n    if (typeof define === \"function\" && define.amd) {\n        define(['module', 'select'], factory);\n    } else if (typeof exports !== \"undefined\") {\n        factory(module, require('select'));\n    } else {\n        var mod = {\n            exports: {}\n        };\n        factory(mod, global.select);\n        global.clipboardAction = mod.exports;\n    }\n})(this, function (module, _select) {\n    'use strict';\n\n    var _select2 = _interopRequireDefault(_select);\n\n    function _interopRequireDefault(obj) {\n        return obj && obj.__esModule ? obj : {\n            default: obj\n        };\n    }\n\n    var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n        return typeof obj;\n    } : function (obj) {\n        return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    };\n\n    function _classCallCheck(instance, Constructor) {\n        if (!(instance instanceof Constructor)) {\n            throw new TypeError(\"Cannot call a class as a function\");\n        }\n    }\n\n    var _createClass = function () {\n        function defineProperties(target, props) {\n            for (var i = 0; i < props.length; i++) {\n                var descriptor = props[i];\n                descriptor.enumerable = descriptor.enumerable || false;\n                descriptor.configurable = true;\n                if (\"value\" in descriptor) descriptor.writable = true;\n                Object.defineProperty(target, descriptor.key, descriptor);\n            }\n        }\n\n        return function (Constructor, protoProps, staticProps) {\n            if (protoProps) defineProperties(Constructor.prototype, protoProps);\n            if (staticProps) defineProperties(Constructor, staticProps);\n            return Constructor;\n        };\n    }();\n\n    var ClipboardAction = function () {\n        /**\n         * @param {Object} options\n         */\n        function ClipboardAction(options) {\n            _classCallCheck(this, ClipboardAction);\n\n            this.resolveOptions(options);\n            this.initSelection();\n        }\n\n        /**\n         * Defines base properties passed from constructor.\n         * @param {Object} options\n         */\n\n\n        _createClass(ClipboardAction, [{\n            key: 'resolveOptions',\n            value: function resolveOptions() {\n                var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n                this.action = options.action;\n                this.container = options.container;\n                this.emitter = options.emitter;\n                this.target = options.target;\n                this.text = options.text;\n                this.trigger = options.trigger;\n\n                this.selectedText = '';\n            }\n        }, {\n            key: 'initSelection',\n            value: function initSelection() {\n                if (this.text) {\n                    this.selectFake();\n                } else if (this.target) {\n                    this.selectTarget();\n                }\n            }\n        }, {\n            key: 'selectFake',\n            value: function selectFake() {\n                var _this = this;\n\n                var isRTL = document.documentElement.getAttribute('dir') == 'rtl';\n\n                this.removeFake();\n\n                this.fakeHandlerCallback = function () {\n                    return _this.removeFake();\n                };\n                this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;\n\n                this.fakeElem = document.createElement('textarea');\n                // Prevent zooming on iOS\n                this.fakeElem.style.fontSize = '12pt';\n                // Reset box model\n                this.fakeElem.style.border = '0';\n                this.fakeElem.style.padding = '0';\n                this.fakeElem.style.margin = '0';\n                // Move element out of screen horizontally\n                this.fakeElem.style.position = 'absolute';\n                this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';\n                // Move element to the same position vertically\n                var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n                this.fakeElem.style.top = yPosition + 'px';\n\n                this.fakeElem.setAttribute('readonly', '');\n                this.fakeElem.value = this.text;\n\n                this.container.appendChild(this.fakeElem);\n\n                this.selectedText = (0, _select2.default)(this.fakeElem);\n                this.copyText();\n            }\n        }, {\n            key: 'removeFake',\n            value: function removeFake() {\n                if (this.fakeHandler) {\n                    this.container.removeEventListener('click', this.fakeHandlerCallback);\n                    this.fakeHandler = null;\n                    this.fakeHandlerCallback = null;\n                }\n\n                if (this.fakeElem) {\n                    this.container.removeChild(this.fakeElem);\n                    this.fakeElem = null;\n                }\n            }\n        }, {\n            key: 'selectTarget',\n            value: function selectTarget() {\n                this.selectedText = (0, _select2.default)(this.target);\n                this.copyText();\n            }\n        }, {\n            key: 'copyText',\n            value: function copyText() {\n                var succeeded = void 0;\n\n                try {\n                    succeeded = document.execCommand(this.action);\n                } catch (err) {\n                    succeeded = false;\n                }\n\n                this.handleResult(succeeded);\n            }\n        }, {\n            key: 'handleResult',\n            value: function handleResult(succeeded) {\n                this.emitter.emit(succeeded ? 'success' : 'error', {\n                    action: this.action,\n                    text: this.selectedText,\n                    trigger: this.trigger,\n                    clearSelection: this.clearSelection.bind(this)\n                });\n            }\n        }, {\n            key: 'clearSelection',\n            value: function clearSelection() {\n                if (this.trigger) {\n                    this.trigger.focus();\n                }\n\n                window.getSelection().removeAllRanges();\n            }\n        }, {\n            key: 'destroy',\n            value: function destroy() {\n                this.removeFake();\n            }\n        }, {\n            key: 'action',\n            set: function set() {\n                var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';\n\n                this._action = action;\n\n                if (this._action !== 'copy' && this._action !== 'cut') {\n                    throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n                }\n            },\n            get: function get() {\n                return this._action;\n            }\n        }, {\n            key: 'target',\n            set: function set(target) {\n                if (target !== undefined) {\n                    if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {\n                        if (this.action === 'copy' && target.hasAttribute('disabled')) {\n                            throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n                        }\n\n                        if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n                            throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n                        }\n\n                        this._target = target;\n                    } else {\n                        throw new Error('Invalid \"target\" value, use a valid Element');\n                    }\n                }\n            },\n            get: function get() {\n                return this._target;\n            }\n        }]);\n\n        return ClipboardAction;\n    }();\n\n    module.exports = ClipboardAction;\n});","(function (global, factory) {\n    if (typeof define === \"function\" && define.amd) {\n        define(['module', './clipboard-action', 'tiny-emitter', 'good-listener'], factory);\n    } else if (typeof exports !== \"undefined\") {\n        factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));\n    } else {\n        var mod = {\n            exports: {}\n        };\n        factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);\n        global.clipboard = mod.exports;\n    }\n})(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {\n    'use strict';\n\n    var _clipboardAction2 = _interopRequireDefault(_clipboardAction);\n\n    var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);\n\n    var _goodListener2 = _interopRequireDefault(_goodListener);\n\n    function _interopRequireDefault(obj) {\n        return obj && obj.__esModule ? obj : {\n            default: obj\n        };\n    }\n\n    var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n        return typeof obj;\n    } : function (obj) {\n        return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n    };\n\n    function _classCallCheck(instance, Constructor) {\n        if (!(instance instanceof Constructor)) {\n            throw new TypeError(\"Cannot call a class as a function\");\n        }\n    }\n\n    var _createClass = function () {\n        function defineProperties(target, props) {\n            for (var i = 0; i < props.length; i++) {\n                var descriptor = props[i];\n                descriptor.enumerable = descriptor.enumerable || false;\n                descriptor.configurable = true;\n                if (\"value\" in descriptor) descriptor.writable = true;\n                Object.defineProperty(target, descriptor.key, descriptor);\n            }\n        }\n\n        return function (Constructor, protoProps, staticProps) {\n            if (protoProps) defineProperties(Constructor.prototype, protoProps);\n            if (staticProps) defineProperties(Constructor, staticProps);\n            return Constructor;\n        };\n    }();\n\n    function _possibleConstructorReturn(self, call) {\n        if (!self) {\n            throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n        }\n\n        return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n    }\n\n    function _inherits(subClass, superClass) {\n        if (typeof superClass !== \"function\" && superClass !== null) {\n            throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n        }\n\n        subClass.prototype = Object.create(superClass && superClass.prototype, {\n            constructor: {\n                value: subClass,\n                enumerable: false,\n                writable: true,\n                configurable: true\n            }\n        });\n        if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n    }\n\n    var Clipboard = function (_Emitter) {\n        _inherits(Clipboard, _Emitter);\n\n        /**\n         * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n         * @param {Object} options\n         */\n        function Clipboard(trigger, options) {\n            _classCallCheck(this, Clipboard);\n\n            var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));\n\n            _this.resolveOptions(options);\n            _this.listenClick(trigger);\n            return _this;\n        }\n\n        /**\n         * Defines if attributes would be resolved using internal setter functions\n         * or custom functions that were passed in the constructor.\n         * @param {Object} options\n         */\n\n\n        _createClass(Clipboard, [{\n            key: 'resolveOptions',\n            value: function resolveOptions() {\n                var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n                this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n                this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n                this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n                this.container = _typeof(options.container) === 'object' ? options.container : document.body;\n            }\n        }, {\n            key: 'listenClick',\n            value: function listenClick(trigger) {\n                var _this2 = this;\n\n                this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {\n                    return _this2.onClick(e);\n                });\n            }\n        }, {\n            key: 'onClick',\n            value: function onClick(e) {\n                var trigger = e.delegateTarget || e.currentTarget;\n\n                if (this.clipboardAction) {\n                    this.clipboardAction = null;\n                }\n\n                this.clipboardAction = new _clipboardAction2.default({\n                    action: this.action(trigger),\n                    target: this.target(trigger),\n                    text: this.text(trigger),\n                    container: this.container,\n                    trigger: trigger,\n                    emitter: this\n                });\n            }\n        }, {\n            key: 'defaultAction',\n            value: function defaultAction(trigger) {\n                return getAttributeValue('action', trigger);\n            }\n        }, {\n            key: 'defaultTarget',\n            value: function defaultTarget(trigger) {\n                var selector = getAttributeValue('target', trigger);\n\n                if (selector) {\n                    return document.querySelector(selector);\n                }\n            }\n        }, {\n            key: 'defaultText',\n            value: function defaultText(trigger) {\n                return getAttributeValue('text', trigger);\n            }\n        }, {\n            key: 'destroy',\n            value: function destroy() {\n                this.listener.destroy();\n\n                if (this.clipboardAction) {\n                    this.clipboardAction.destroy();\n                    this.clipboardAction = null;\n                }\n            }\n        }], [{\n            key: 'isSupported',\n            value: function isSupported() {\n                var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n\n                var actions = typeof action === 'string' ? [action] : action;\n                var support = !!document.queryCommandSupported;\n\n                actions.forEach(function (action) {\n                    support = support && !!document.queryCommandSupported(action);\n                });\n\n                return support;\n            }\n        }]);\n\n        return Clipboard;\n    }(_tinyEmitter2.default);\n\n    /**\n     * Helper function to retrieve attribute value.\n     * @param {String} suffix\n     * @param {Element} element\n     */\n    function getAttributeValue(suffix, element) {\n        var attribute = 'data-clipboard-' + suffix;\n\n        if (!element.hasAttribute(attribute)) {\n            return;\n        }\n\n        return element.getAttribute(attribute);\n    }\n\n    module.exports = Clipboard;\n});","/*! @name videojs-sprite-thumbnails @version 0.6.0 @license MIT */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('global/window')) :\n\ttypeof define === 'function' && define.amd ? define(['video.js', 'global/window'], factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojsSpriteThumbnails = factory(global.videojs, global.window));\n}(this, (function (videojs, window) { 'use strict';\n\n\tfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n\tvar videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);\n\tvar window__default = /*#__PURE__*/_interopDefaultLegacy(window);\n\n\tfunction createCommonjsModule(fn, basedir, module) {\n\t\treturn module = {\n\t\t  path: basedir,\n\t\t  exports: {},\n\t\t  require: function (path, base) {\n\t      return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n\t    }\n\t\t}, fn(module, module.exports), module.exports;\n\t}\n\n\tfunction commonjsRequire () {\n\t\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n\t}\n\n\tvar assertThisInitialized = createCommonjsModule(function (module) {\n\t  function _assertThisInitialized(self) {\n\t    if (self === void 0) {\n\t      throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\t    }\n\n\t    return self;\n\t  }\n\n\t  module.exports = _assertThisInitialized;\n\t  module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t});\n\n\tvar setPrototypeOf = createCommonjsModule(function (module) {\n\t  function _setPrototypeOf(o, p) {\n\t    module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n\t      o.__proto__ = p;\n\t      return o;\n\t    };\n\n\t    module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t    return _setPrototypeOf(o, p);\n\t  }\n\n\t  module.exports = _setPrototypeOf;\n\t  module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t});\n\n\tvar inheritsLoose = createCommonjsModule(function (module) {\n\t  function _inheritsLoose(subClass, superClass) {\n\t    subClass.prototype = Object.create(superClass.prototype);\n\t    subClass.prototype.constructor = subClass;\n\t    setPrototypeOf(subClass, superClass);\n\t  }\n\n\t  module.exports = _inheritsLoose;\n\t  module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\t});\n\n\t/**\n\t * Set up sprite thumbnails for a player.\n\t *\n\t * @function spriteThumbs\n\t * @param {Player} player\n\t *        The current player instance.\n\t * @param {Plugin} plugin\n\t *        The current spriteThumbnails plugin instance.\n\t * @param {Object} options\n\t *        Plugin configuration options.\n\t */\n\n\tvar spriteThumbs = function spriteThumbs(player, plugin, options) {\n\t  var url = options.url;\n\t  var height = options.height;\n\t  var width = options.width;\n\t  var isPreloading = false;\n\t  var sprites = {};\n\t  var dom = videojs__default['default'].dom || videojs__default['default'];\n\t  var controls = player.controlBar; // default control bar component tree is expected\n\t  // https://docs.videojs.com/tutorial-components.html#default-component-tree\n\n\t  var progress = controls && controls.progressControl;\n\t  var seekBar = progress && progress.seekBar;\n\t  var mouseTimeTooltip = seekBar && seekBar.mouseTimeDisplay && seekBar.mouseTimeDisplay.timeTooltip;\n\n\t  var tooltipStyle = function tooltipStyle(obj) {\n\t    var ttstyle = mouseTimeTooltip.el().style;\n\t    Object.keys(obj).forEach(function (key) {\n\t      var val = obj[key];\n\n\t      if (val !== '') {\n\t        ttstyle.setProperty(key, val);\n\t      } else {\n\t        ttstyle.removeProperty(key);\n\t      }\n\t    });\n\t  };\n\n\t  var resetMouseTooltip = function resetMouseTooltip() {\n\t    tooltipStyle({\n\t      'width': '',\n\t      'height': '',\n\t      'background-image': '',\n\t      'background-repeat': '',\n\t      'background-position': '',\n\t      'background-size': '',\n\t      'top': '',\n\t      'color': '',\n\t      'text-shadow': '',\n\t      'border': '',\n\t      'margin': ''\n\t    });\n\t  };\n\n\t  var hijackMouseTooltip = function hijackMouseTooltip(evt) {\n\t    var sprite = sprites[url];\n\t    var imgWidth = sprite.naturalWidth;\n\t    var imgHeight = sprite.naturalHeight;\n\t    var seekBarEl = seekBar.el();\n\n\t    if (sprite.complete && imgWidth && imgHeight) {\n\t      var position = dom.getPointerPosition(seekBarEl, evt).x * player.duration();\n\t      position = position / options.interval;\n\t      var responsive = options.responsive;\n\t      var playerWidth = player.currentWidth();\n\t      var scaleFactor = responsive && playerWidth < responsive ? playerWidth / responsive : 1;\n\t      var columns = imgWidth / width;\n\t      var scaledWidth = width * scaleFactor;\n\t      var scaledHeight = height * scaleFactor;\n\t      var cleft = Math.floor(position % columns) * -scaledWidth;\n\t      var ctop = Math.floor(position / columns) * -scaledHeight;\n\t      var bgSize = imgWidth * scaleFactor + 'px ' + imgHeight * scaleFactor + 'px';\n\t      var controlsTop = dom.findPosition(controls.el()).top;\n\t      var seekBarTop = dom.findPosition(seekBarEl).top; // top of seekBar is 0 position\n\n\t      var topOffset = -scaledHeight - Math.max(0, seekBarTop - controlsTop);\n\t      tooltipStyle({\n\t        'width': scaledWidth + 'px',\n\t        'height': scaledHeight + 'px',\n\t        'background-image': 'url(' + url + ')',\n\t        'background-repeat': 'no-repeat',\n\t        'background-position': cleft + 'px ' + ctop + 'px',\n\t        'background-size': bgSize,\n\t        'top': topOffset + 'px',\n\t        'color': '#fff',\n\t        'text-shadow': '1px 1px #000',\n\t        'border': '1px solid #000',\n\t        'margin': '0 1px'\n\t      });\n\t    } else {\n\t      resetMouseTooltip();\n\t    }\n\t  };\n\n\t  var spriteready = function spriteready(preload) {\n\t    var spriteEvents = ['mousemove', 'touchmove'];\n\t    var win = window__default['default'];\n\t    var navigator = win.navigator;\n\t    var log = plugin.log;\n\t    var downlink = options.downlink;\n\t    var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;\n\t    var dl = !connection || connection.downlink >= downlink;\n\t    var ready = mouseTimeTooltip && (width && height || preload);\n\t    var cached = sprites[url];\n\n\t    var setReady = function setReady(bool) {\n\t      plugin.setState({\n\t        ready: bool\n\t      });\n\t    };\n\n\t    if (mouseTimeTooltip) {\n\t      resetMouseTooltip();\n\t    }\n\n\t    if (ready && (url && dl || cached)) {\n\t      var msg = 'loading ' + url;\n\n\t      if (!cached) {\n\t        sprites[url] = new win.Image();\n\t        sprites[url].src = url;\n\n\t        if (preload) {\n\t          isPreloading = true;\n\t          msg = 'pre' + msg;\n\t        }\n\t      } else {\n\t        msg = 're' + msg;\n\t      }\n\n\t      log.debug(msg);\n\t      progress.on(spriteEvents, hijackMouseTooltip);\n\t      setReady(true);\n\t    } else if (!preload) {\n\t      progress.off(spriteEvents, hijackMouseTooltip);\n\t      setReady();\n\t      ['url', 'width', 'height'].forEach(function (key) {\n\t        if (!options[key]) {\n\t          log('no thumbnails ' + key + ' given');\n\t        }\n\t      });\n\n\t      if (!dl) {\n\t        log.warn('connection.downlink < ' + downlink);\n\t      }\n\t    }\n\t  }; // preload sprite image if url configured at plugin level\n\t  // NOTE: must be called before loadstart, otherwise\n\t  // neither this call nor the first loadstart has any effect\n\n\n\t  spriteready(true);\n\t  player.on('loadstart', function () {\n\t    if (isPreloading) {\n\t      isPreloading = false;\n\t    } else {\n\t      // load sprite configured as source property\n\t      player.currentSources().forEach(function (src) {\n\t        var spriteOpts = src.spriteThumbnails;\n\n\t        if (spriteOpts) {\n\t          options = videojs__default['default'].mergeOptions(options, spriteOpts);\n\t          url = options.url;\n\t          height = options.height;\n\t          width = options.width;\n\t        }\n\t      });\n\t      spriteready();\n\t    }\n\t  });\n\t  player.addClass('vjs-sprite-thumbnails');\n\t};\n\n\tvar version = \"0.6.0\";\n\n\tvar Plugin = videojs__default['default'].getPlugin('plugin');\n\t/**\n\t * Default plugin options\n\t *\n\t * @param {String} url\n\t *        Sprite location. Must be set by user.\n\t * @param {Integer} width\n\t *        Width in pixels of a thumbnail. Must be set by user.\n\t * @param {Integer} height\n\t *        Height in pixels of a thumbnail. Must be set by user.\n\t * @param {Number} interval\n\t *        Interval between thumbnail frames in seconds. Default: 1.\n\t * @param {Integer} responsive\n\t *        Width of player below which thumbnails are reponsive. Default: 600.\n\t * @param {Number} downlink\n\t *        Minimum of NetworkInformation downlink where supported. Default: 2.\n\t *        https://developer.mozilla.org/docs/Web/API/NetworkInformation/downlink\n\t */\n\n\tvar defaults = {\n\t  url: '',\n\t  width: 0,\n\t  height: 0,\n\t  interval: 1,\n\t  responsive: 600,\n\t  downlink: 2\n\t};\n\t/**\n\t * An advanced Video.js plugin. For more information on the API\n\t *\n\t * See: https://blog.videojs.com/feature-spotlight-advanced-plugins/\n\t */\n\n\tvar SpriteThumbnails = /*#__PURE__*/function (_Plugin) {\n\t  inheritsLoose(SpriteThumbnails, _Plugin);\n\n\t  /**\n\t   * Create a SpriteThumbnails plugin instance.\n\t   *\n\t   * @param  {Player} player\n\t   *         A Video.js Player instance.\n\t   *\n\t   * @param  {Object} [options]\n\t   *         An optional options object.\n\t   */\n\t  function SpriteThumbnails(player, options) {\n\t    var _this;\n\n\t    // the parent class will add player under this.player\n\t    _this = _Plugin.call(this, player) || this;\n\n\t    var that = assertThisInitialized(_this);\n\n\t    var log = that.log;\n\t    that.options = videojs__default['default'].mergeOptions(defaults, options);\n\t    that.setState({\n\t      ready: false\n\t    });\n\t    that.on('statechanged', function () {\n\t      log.debug('will' + (that.state.ready ? '' : ' not') + ' show thumbnails');\n\t    });\n\t    that.player.ready(function () {\n\t      spriteThumbs(that.player, that, that.options);\n\t    });\n\t    return _this;\n\t  }\n\n\t  return SpriteThumbnails;\n\t}(Plugin); // Define default values for the plugin's `state` object here.\n\n\n\tSpriteThumbnails.defaultState = {}; // Include the version number.\n\n\tSpriteThumbnails.VERSION = version; // Register the plugin with video.js.\n\n\tvideojs__default['default'].registerPlugin('spriteThumbnails', SpriteThumbnails);\n\n\treturn SpriteThumbnails;\n\n})));\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Default exports for Node. Export the extended versions of VTTCue and\n// VTTRegion in Node since we likely want the capability to convert back and\n// forth between JSON. If we don't then it's not that big of a deal since we're\n// off browser.\n\nvar window = require('global/window');\n\nvar vttjs = module.exports = {\n  WebVTT: require(\"./vtt.js\"),\n  VTTCue: require(\"./vttcue.js\"),\n  VTTRegion: require(\"./vttregion.js\")\n};\n\nwindow.vttjs = vttjs;\nwindow.WebVTT = vttjs.WebVTT;\n\nvar cueShim = vttjs.VTTCue;\nvar regionShim = vttjs.VTTRegion;\nvar nativeVTTCue = window.VTTCue;\nvar nativeVTTRegion = window.VTTRegion;\n\nvttjs.shim = function() {\n  window.VTTCue = cueShim;\n  window.VTTRegion = regionShim;\n};\n\nvttjs.restore = function() {\n  window.VTTCue = nativeVTTCue;\n  window.VTTRegion = nativeVTTRegion;\n};\n\nif (!window.VTTCue) {\n  vttjs.shim();\n}\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\nvar document = require('global/document');\n\nvar _objCreate = Object.create || (function() {\n  function F() {}\n  return function(o) {\n    if (arguments.length !== 1) {\n      throw new Error('Object.create shim only accepts one parameter.');\n    }\n    F.prototype = o;\n    return new F();\n  };\n})();\n\n// Creates a new ParserError object from an errorData object. The errorData\n// object should have default code and message properties. The default message\n// property can be overriden by passing in a message parameter.\n// See ParsingError.Errors below for acceptable errors.\nfunction ParsingError(errorData, message) {\n  this.name = \"ParsingError\";\n  this.code = errorData.code;\n  this.message = message || errorData.message;\n}\nParsingError.prototype = _objCreate(Error.prototype);\nParsingError.prototype.constructor = ParsingError;\n\n// ParsingError metadata for acceptable ParsingErrors.\nParsingError.Errors = {\n  BadSignature: {\n    code: 0,\n    message: \"Malformed WebVTT signature.\"\n  },\n  BadTimeStamp: {\n    code: 1,\n    message: \"Malformed time stamp.\"\n  }\n};\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n  function computeSeconds(h, m, s, f) {\n    return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n  }\n\n  var m = input.match(/^(\\d+):(\\d{1,2})(:\\d{1,2})?\\.(\\d{3})/);\n  if (!m) {\n    return null;\n  }\n\n  if (m[3]) {\n    // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n    return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n  } else if (m[1] > 59) {\n    // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n    // First position is hours as it's over 59.\n    return computeSeconds(m[1], m[2], 0,  m[4]);\n  } else {\n    // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n    return computeSeconds(0, m[1], m[2], m[4]);\n  }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n  this.values = _objCreate(null);\n}\n\nSettings.prototype = {\n  // Only accept the first assignment to any key.\n  set: function(k, v) {\n    if (!this.get(k) && v !== \"\") {\n      this.values[k] = v;\n    }\n  },\n  // Return the value for a key, or a default value.\n  // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n  // a number of possible default values as properties where 'defaultKey' is\n  // the key of the property that will be chosen; otherwise it's assumed to be\n  // a single value.\n  get: function(k, dflt, defaultKey) {\n    if (defaultKey) {\n      return this.has(k) ? this.values[k] : dflt[defaultKey];\n    }\n    return this.has(k) ? this.values[k] : dflt;\n  },\n  // Check whether we have a value for a key.\n  has: function(k) {\n    return k in this.values;\n  },\n  // Accept a setting if its one of the given alternatives.\n  alt: function(k, v, a) {\n    for (var n = 0; n < a.length; ++n) {\n      if (v === a[n]) {\n        this.set(k, v);\n        break;\n      }\n    }\n  },\n  // Accept a setting if its a valid (signed) integer.\n  integer: function(k, v) {\n    if (/^-?\\d+$/.test(v)) { // integer\n      this.set(k, parseInt(v, 10));\n    }\n  },\n  // Accept a setting if its a valid percentage.\n  percent: function(k, v) {\n    var m;\n    if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n      v = parseFloat(v);\n      if (v >= 0 && v <= 100) {\n        this.set(k, v);\n        return true;\n      }\n    }\n    return false;\n  }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n  var groups = groupDelim ? input.split(groupDelim) : [input];\n  for (var i in groups) {\n    if (typeof groups[i] !== \"string\") {\n      continue;\n    }\n    var kv = groups[i].split(keyValueDelim);\n    if (kv.length !== 2) {\n      continue;\n    }\n    var k = kv[0].trim();\n    var v = kv[1].trim();\n    callback(k, v);\n  }\n}\n\nfunction parseCue(input, cue, regionList) {\n  // Remember the original input if we need to throw an error.\n  var oInput = input;\n  // 4.1 WebVTT timestamp\n  function consumeTimeStamp() {\n    var ts = parseTimeStamp(input);\n    if (ts === null) {\n      throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n                            \"Malformed timestamp: \" + oInput);\n    }\n    // Remove time stamp from input.\n    input = input.replace(/^[^\\sa-zA-Z-]+/, \"\");\n    return ts;\n  }\n\n  // 4.4.2 WebVTT cue settings\n  function consumeCueSettings(input, cue) {\n    var settings = new Settings();\n\n    parseOptions(input, function (k, v) {\n      switch (k) {\n      case \"region\":\n        // Find the last region we parsed with the same region id.\n        for (var i = regionList.length - 1; i >= 0; i--) {\n          if (regionList[i].id === v) {\n            settings.set(k, regionList[i].region);\n            break;\n          }\n        }\n        break;\n      case \"vertical\":\n        settings.alt(k, v, [\"rl\", \"lr\"]);\n        break;\n      case \"line\":\n        var vals = v.split(\",\"),\n            vals0 = vals[0];\n        settings.integer(k, vals0);\n        settings.percent(k, vals0) ? settings.set(\"snapToLines\", false) : null;\n        settings.alt(k, vals0, [\"auto\"]);\n        if (vals.length === 2) {\n          settings.alt(\"lineAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n        }\n        break;\n      case \"position\":\n        vals = v.split(\",\");\n        settings.percent(k, vals[0]);\n        if (vals.length === 2) {\n          settings.alt(\"positionAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n        }\n        break;\n      case \"size\":\n        settings.percent(k, v);\n        break;\n      case \"align\":\n        settings.alt(k, v, [\"start\", \"center\", \"end\", \"left\", \"right\"]);\n        break;\n      }\n    }, /:/, /\\s/);\n\n    // Apply default values for any missing fields.\n    cue.region = settings.get(\"region\", null);\n    cue.vertical = settings.get(\"vertical\", \"\");\n    try {\n      cue.line = settings.get(\"line\", \"auto\");\n    } catch (e) {}\n    cue.lineAlign = settings.get(\"lineAlign\", \"start\");\n    cue.snapToLines = settings.get(\"snapToLines\", true);\n    cue.size = settings.get(\"size\", 100);\n    // Safari still uses the old middle value and won't accept center\n    try {\n      cue.align = settings.get(\"align\", \"center\");\n    } catch (e) {\n      cue.align = settings.get(\"align\", \"middle\");\n    }\n    try {\n      cue.position = settings.get(\"position\", \"auto\");\n    } catch (e) {\n      cue.position = settings.get(\"position\", {\n        start: 0,\n        left: 0,\n        center: 50,\n        middle: 50,\n        end: 100,\n        right: 100\n      }, cue.align);\n    }\n\n\n    cue.positionAlign = settings.get(\"positionAlign\", {\n      start: \"start\",\n      left: \"start\",\n      center: \"center\",\n      middle: \"center\",\n      end: \"end\",\n      right: \"end\"\n    }, cue.align);\n  }\n\n  function skipWhitespace() {\n    input = input.replace(/^\\s+/, \"\");\n  }\n\n  // 4.1 WebVTT cue timings.\n  skipWhitespace();\n  cue.startTime = consumeTimeStamp();   // (1) collect cue start time\n  skipWhitespace();\n  if (input.substr(0, 3) !== \"-->\") {     // (3) next characters must match \"-->\"\n    throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n                           \"Malformed time stamp (time stamps must be separated by '-->'): \" +\n                           oInput);\n  }\n  input = input.substr(3);\n  skipWhitespace();\n  cue.endTime = consumeTimeStamp();     // (5) collect cue end time\n\n  // 4.1 WebVTT cue settings list.\n  skipWhitespace();\n  consumeCueSettings(input, cue);\n}\n\n// When evaluating this file as part of a Webpack bundle for server\n// side rendering, `document` is an empty object.\nvar TEXTAREA_ELEMENT = document.createElement && document.createElement(\"textarea\");\n\nvar TAG_NAME = {\n  c: \"span\",\n  i: \"i\",\n  b: \"b\",\n  u: \"u\",\n  ruby: \"ruby\",\n  rt: \"rt\",\n  v: \"span\",\n  lang: \"span\"\n};\n\n// 5.1 default text color\n// 5.2 default text background color is equivalent to text color with bg_ prefix\nvar DEFAULT_COLOR_CLASS = {\n  white: 'rgba(255,255,255,1)',\n  lime: 'rgba(0,255,0,1)',\n  cyan: 'rgba(0,255,255,1)',\n  red: 'rgba(255,0,0,1)',\n  yellow: 'rgba(255,255,0,1)',\n  magenta: 'rgba(255,0,255,1)',\n  blue: 'rgba(0,0,255,1)',\n  black: 'rgba(0,0,0,1)'\n};\n\nvar TAG_ANNOTATION = {\n  v: \"title\",\n  lang: \"lang\"\n};\n\nvar NEEDS_PARENT = {\n  rt: \"ruby\"\n};\n\n// Parse content into a document fragment.\nfunction parseContent(window, input) {\n  function nextToken() {\n    // Check for end-of-string.\n    if (!input) {\n      return null;\n    }\n\n    // Consume 'n' characters from the input.\n    function consume(result) {\n      input = input.substr(result.length);\n      return result;\n    }\n\n    var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n    // If there is some text before the next tag, return it, otherwise return\n    // the tag.\n    return consume(m[1] ? m[1] : m[2]);\n  }\n\n  function unescape(s) {\n    TEXTAREA_ELEMENT.innerHTML = s;\n    s = TEXTAREA_ELEMENT.textContent;\n    TEXTAREA_ELEMENT.textContent = \"\";\n    return s;\n  }\n\n  function shouldAdd(current, element) {\n    return !NEEDS_PARENT[element.localName] ||\n           NEEDS_PARENT[element.localName] === current.localName;\n  }\n\n  // Create an element for this tag.\n  function createElement(type, annotation) {\n    var tagName = TAG_NAME[type];\n    if (!tagName) {\n      return null;\n    }\n    var element = window.document.createElement(tagName);\n    var name = TAG_ANNOTATION[type];\n    if (name && annotation) {\n      element[name] = annotation.trim();\n    }\n    return element;\n  }\n\n  var rootDiv = window.document.createElement(\"div\"),\n      current = rootDiv,\n      t,\n      tagStack = [];\n\n  while ((t = nextToken()) !== null) {\n    if (t[0] === '<') {\n      if (t[1] === \"/\") {\n        // If the closing tag matches, move back up to the parent node.\n        if (tagStack.length &&\n            tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n          tagStack.pop();\n          current = current.parentNode;\n        }\n        // Otherwise just ignore the end tag.\n        continue;\n      }\n      var ts = parseTimeStamp(t.substr(1, t.length - 2));\n      var node;\n      if (ts) {\n        // Timestamps are lead nodes as well.\n        node = window.document.createProcessingInstruction(\"timestamp\", ts);\n        current.appendChild(node);\n        continue;\n      }\n      var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n      // If we can't parse the tag, skip to the next tag.\n      if (!m) {\n        continue;\n      }\n      // Try to construct an element, and ignore the tag if we couldn't.\n      node = createElement(m[1], m[3]);\n      if (!node) {\n        continue;\n      }\n      // Determine if the tag should be added based on the context of where it\n      // is placed in the cuetext.\n      if (!shouldAdd(current, node)) {\n        continue;\n      }\n      // Set the class list (as a list of classes, separated by space).\n      if (m[2]) {\n        var classes = m[2].split('.');\n\n        classes.forEach(function(cl) {\n          var bgColor = /^bg_/.test(cl);\n          // slice out `bg_` if it's a background color\n          var colorName = bgColor ? cl.slice(3) : cl;\n\n          if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {\n            var propName = bgColor ? 'background-color' : 'color';\n            var propValue = DEFAULT_COLOR_CLASS[colorName];\n\n            node.style[propName] = propValue;\n          }\n        });\n\n        node.className = classes.join(' ');\n      }\n      // Append the node to the current node, and enter the scope of the new\n      // node.\n      tagStack.push(m[1]);\n      current.appendChild(node);\n      current = node;\n      continue;\n    }\n\n    // Text nodes are leaf nodes.\n    current.appendChild(window.document.createTextNode(unescape(t)));\n  }\n\n  return rootDiv;\n}\n\n// This is a list of all the Unicode characters that have a strong\n// right-to-left category. What this means is that these characters are\n// written right-to-left for sure. It was generated by pulling all the strong\n// right-to-left characters out of the Unicode data table. That table can\n// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\nvar strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6],\n [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d],\n [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6],\n [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5],\n [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815],\n [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858],\n [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f],\n [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c],\n [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1],\n [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc],\n [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808],\n [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855],\n [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f],\n [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13],\n [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58],\n [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72],\n [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f],\n [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32],\n [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42],\n [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f],\n [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59],\n [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62],\n [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77],\n [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b],\n [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\nfunction isStrongRTLChar(charCode) {\n  for (var i = 0; i < strongRTLRanges.length; i++) {\n    var currentRange = strongRTLRanges[i];\n    if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction determineBidi(cueDiv) {\n  var nodeStack = [],\n      text = \"\",\n      charCode;\n\n  if (!cueDiv || !cueDiv.childNodes) {\n    return \"ltr\";\n  }\n\n  function pushNodes(nodeStack, node) {\n    for (var i = node.childNodes.length - 1; i >= 0; i--) {\n      nodeStack.push(node.childNodes[i]);\n    }\n  }\n\n  function nextTextNode(nodeStack) {\n    if (!nodeStack || !nodeStack.length) {\n      return null;\n    }\n\n    var node = nodeStack.pop(),\n        text = node.textContent || node.innerText;\n    if (text) {\n      // TODO: This should match all unicode type B characters (paragraph\n      // separator characters). See issue #115.\n      var m = text.match(/^.*(\\n|\\r)/);\n      if (m) {\n        nodeStack.length = 0;\n        return m[0];\n      }\n      return text;\n    }\n    if (node.tagName === \"ruby\") {\n      return nextTextNode(nodeStack);\n    }\n    if (node.childNodes) {\n      pushNodes(nodeStack, node);\n      return nextTextNode(nodeStack);\n    }\n  }\n\n  pushNodes(nodeStack, cueDiv);\n  while ((text = nextTextNode(nodeStack))) {\n    for (var i = 0; i < text.length; i++) {\n      charCode = text.charCodeAt(i);\n      if (isStrongRTLChar(charCode)) {\n        return \"rtl\";\n      }\n    }\n  }\n  return \"ltr\";\n}\n\nfunction computeLinePos(cue) {\n  if (typeof cue.line === \"number\" &&\n      (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) {\n    return cue.line;\n  }\n  if (!cue.track || !cue.track.textTrackList ||\n      !cue.track.textTrackList.mediaElement) {\n    return -1;\n  }\n  var track = cue.track,\n      trackList = track.textTrackList,\n      count = 0;\n  for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n    if (trackList[i].mode === \"showing\") {\n      count++;\n    }\n  }\n  return ++count * -1;\n}\n\nfunction StyleBox() {\n}\n\n// Apply styles to a div. If there is no div passed then it defaults to the\n// div on 'this'.\nStyleBox.prototype.applyStyles = function(styles, div) {\n  div = div || this.div;\n  for (var prop in styles) {\n    if (styles.hasOwnProperty(prop)) {\n      div.style[prop] = styles[prop];\n    }\n  }\n};\n\nStyleBox.prototype.formatStyle = function(val, unit) {\n  return val === 0 ? 0 : val + unit;\n};\n\n// Constructs the computed display state of the cue (a div). Places the div\n// into the overlay which should be a block level element (usually a div).\nfunction CueStyleBox(window, cue, styleOptions) {\n  StyleBox.call(this);\n  this.cue = cue;\n\n  // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n  // have inline positioning and will function as the cue background box.\n  this.cueDiv = parseContent(window, cue.text);\n  var styles = {\n    color: \"rgba(255, 255, 255, 1)\",\n    backgroundColor:  \"rgba(0, 0, 0, 0.8)\",\n    position: \"relative\",\n    left: 0,\n    right: 0,\n    top: 0,\n    bottom: 0,\n    display: \"inline\",\n    writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n                                     : cue.vertical === \"lr\" ? \"vertical-lr\"\n                                                             : \"vertical-rl\",\n    unicodeBidi: \"plaintext\"\n  };\n\n  this.applyStyles(styles, this.cueDiv);\n\n  // Create an absolutely positioned div that will be used to position the cue\n  // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n  // mirrors of them except middle instead of center on Safari.\n  this.div = window.document.createElement(\"div\");\n  styles = {\n    direction: determineBidi(this.cueDiv),\n    writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n                                     : cue.vertical === \"lr\" ? \"vertical-lr\"\n                                                             : \"vertical-rl\",\n    unicodeBidi: \"plaintext\",\n    textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n    font: styleOptions.font,\n    whiteSpace: \"pre-line\",\n    position: \"absolute\"\n  };\n\n  this.applyStyles(styles);\n  this.div.appendChild(this.cueDiv);\n\n  // Calculate the distance from the reference edge of the viewport to the text\n  // position of the cue box. The reference edge will be resolved later when\n  // the box orientation styles are applied.\n  var textPos = 0;\n  switch (cue.positionAlign) {\n  case \"start\":\n    textPos = cue.position;\n    break;\n  case \"center\":\n    textPos = cue.position - (cue.size / 2);\n    break;\n  case \"end\":\n    textPos = cue.position - cue.size;\n    break;\n  }\n\n  // Horizontal box orientation; textPos is the distance from the left edge of the\n  // area to the left edge of the box and cue.size is the distance extending to\n  // the right from there.\n  if (cue.vertical === \"\") {\n    this.applyStyles({\n      left:  this.formatStyle(textPos, \"%\"),\n      width: this.formatStyle(cue.size, \"%\")\n    });\n  // Vertical box orientation; textPos is the distance from the top edge of the\n  // area to the top edge of the box and cue.size is the height extending\n  // downwards from there.\n  } else {\n    this.applyStyles({\n      top: this.formatStyle(textPos, \"%\"),\n      height: this.formatStyle(cue.size, \"%\")\n    });\n  }\n\n  this.move = function(box) {\n    this.applyStyles({\n      top: this.formatStyle(box.top, \"px\"),\n      bottom: this.formatStyle(box.bottom, \"px\"),\n      left: this.formatStyle(box.left, \"px\"),\n      right: this.formatStyle(box.right, \"px\"),\n      height: this.formatStyle(box.height, \"px\"),\n      width: this.formatStyle(box.width, \"px\")\n    });\n  };\n}\nCueStyleBox.prototype = _objCreate(StyleBox.prototype);\nCueStyleBox.prototype.constructor = CueStyleBox;\n\n// Represents the co-ordinates of an Element in a way that we can easily\n// compute things with such as if it overlaps or intersects with another Element.\n// Can initialize it with either a StyleBox or another BoxPosition.\nfunction BoxPosition(obj) {\n  // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n  // was passed in and we need to copy the results of 'getBoundingClientRect'\n  // as the object returned is readonly. All co-ordinate values are in reference\n  // to the viewport origin (top left).\n  var lh, height, width, top;\n  if (obj.div) {\n    height = obj.div.offsetHeight;\n    width = obj.div.offsetWidth;\n    top = obj.div.offsetTop;\n\n    var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n                rects.getClientRects && rects.getClientRects();\n    obj = obj.div.getBoundingClientRect();\n    // In certain cases the outter div will be slightly larger then the sum of\n    // the inner div's lines. This could be due to bold text, etc, on some platforms.\n    // In this case we should get the average line height and use that. This will\n    // result in the desired behaviour.\n    lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n               : 0;\n\n  }\n  this.left = obj.left;\n  this.right = obj.right;\n  this.top = obj.top || top;\n  this.height = obj.height || height;\n  this.bottom = obj.bottom || (top + (obj.height || height));\n  this.width = obj.width || width;\n  this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}\n\n// Move the box along a particular axis. Optionally pass in an amount to move\n// the box. If no amount is passed then the default is the line height of the\n// box.\nBoxPosition.prototype.move = function(axis, toMove) {\n  toMove = toMove !== undefined ? toMove : this.lineHeight;\n  switch (axis) {\n  case \"+x\":\n    this.left += toMove;\n    this.right += toMove;\n    break;\n  case \"-x\":\n    this.left -= toMove;\n    this.right -= toMove;\n    break;\n  case \"+y\":\n    this.top += toMove;\n    this.bottom += toMove;\n    break;\n  case \"-y\":\n    this.top -= toMove;\n    this.bottom -= toMove;\n    break;\n  }\n};\n\n// Check if this box overlaps another box, b2.\nBoxPosition.prototype.overlaps = function(b2) {\n  return this.left < b2.right &&\n         this.right > b2.left &&\n         this.top < b2.bottom &&\n         this.bottom > b2.top;\n};\n\n// Check if this box overlaps any other boxes in boxes.\nBoxPosition.prototype.overlapsAny = function(boxes) {\n  for (var i = 0; i < boxes.length; i++) {\n    if (this.overlaps(boxes[i])) {\n      return true;\n    }\n  }\n  return false;\n};\n\n// Check if this box is within another box.\nBoxPosition.prototype.within = function(container) {\n  return this.top >= container.top &&\n         this.bottom <= container.bottom &&\n         this.left >= container.left &&\n         this.right <= container.right;\n};\n\n// Check if this box is entirely within the container or it is overlapping\n// on the edge opposite of the axis direction passed. For example, if \"+x\" is\n// passed and the box is overlapping on the left edge of the container, then\n// return true.\nBoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {\n  switch (axis) {\n  case \"+x\":\n    return this.left < container.left;\n  case \"-x\":\n    return this.right > container.right;\n  case \"+y\":\n    return this.top < container.top;\n  case \"-y\":\n    return this.bottom > container.bottom;\n  }\n};\n\n// Find the percentage of the area that this box is overlapping with another\n// box.\nBoxPosition.prototype.intersectPercentage = function(b2) {\n  var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n      y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n      intersectArea = x * y;\n  return intersectArea / (this.height * this.width);\n};\n\n// Convert the positions from this box to CSS compatible positions using\n// the reference container's positions. This has to be done because this\n// box's positions are in reference to the viewport origin, whereas, CSS\n// values are in referecne to their respective edges.\nBoxPosition.prototype.toCSSCompatValues = function(reference) {\n  return {\n    top: this.top - reference.top,\n    bottom: reference.bottom - this.bottom,\n    left: this.left - reference.left,\n    right: reference.right - this.right,\n    height: this.height,\n    width: this.width\n  };\n};\n\n// Get an object that represents the box's position without anything extra.\n// Can pass a StyleBox, HTMLElement, or another BoxPositon.\nBoxPosition.getSimpleBoxPosition = function(obj) {\n  var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n  var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n  var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n\n  obj = obj.div ? obj.div.getBoundingClientRect() :\n                obj.tagName ? obj.getBoundingClientRect() : obj;\n  var ret = {\n    left: obj.left,\n    right: obj.right,\n    top: obj.top || top,\n    height: obj.height || height,\n    bottom: obj.bottom || (top + (obj.height || height)),\n    width: obj.width || width\n  };\n  return ret;\n};\n\n// Move a StyleBox to its specified, or next best, position. The containerBox\n// is the box that contains the StyleBox, such as a div. boxPositions are\n// a list of other boxes that the styleBox can't overlap with.\nfunction moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n\n  // Find the best position for a cue box, b, on the video. The axis parameter\n  // is a list of axis, the order of which, it will move the box along. For example:\n  // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n  // direction. If it doesn't find a good position for it there it will then move\n  // it along the x axis in the negative direction.\n  function findBestPosition(b, axis) {\n    var bestPosition,\n        specifiedPosition = new BoxPosition(b),\n        percentage = 1; // Highest possible so the first thing we get is better.\n\n    for (var i = 0; i < axis.length; i++) {\n      while (b.overlapsOppositeAxis(containerBox, axis[i]) ||\n             (b.within(containerBox) && b.overlapsAny(boxPositions))) {\n        b.move(axis[i]);\n      }\n      // We found a spot where we aren't overlapping anything. This is our\n      // best position.\n      if (b.within(containerBox)) {\n        return b;\n      }\n      var p = b.intersectPercentage(containerBox);\n      // If we're outside the container box less then we were on our last try\n      // then remember this position as the best position.\n      if (percentage > p) {\n        bestPosition = new BoxPosition(b);\n        percentage = p;\n      }\n      // Reset the box position to the specified position.\n      b = new BoxPosition(specifiedPosition);\n    }\n    return bestPosition || specifiedPosition;\n  }\n\n  var boxPosition = new BoxPosition(styleBox),\n      cue = styleBox.cue,\n      linePos = computeLinePos(cue),\n      axis = [];\n\n  // If we have a line number to align the cue to.\n  if (cue.snapToLines) {\n    var size;\n    switch (cue.vertical) {\n    case \"\":\n      axis = [ \"+y\", \"-y\" ];\n      size = \"height\";\n      break;\n    case \"rl\":\n      axis = [ \"+x\", \"-x\" ];\n      size = \"width\";\n      break;\n    case \"lr\":\n      axis = [ \"-x\", \"+x\" ];\n      size = \"width\";\n      break;\n    }\n\n    var step = boxPosition.lineHeight,\n        position = step * Math.round(linePos),\n        maxPosition = containerBox[size] + step,\n        initialAxis = axis[0];\n\n    // If the specified intial position is greater then the max position then\n    // clamp the box to the amount of steps it would take for the box to\n    // reach the max position.\n    if (Math.abs(position) > maxPosition) {\n      position = position < 0 ? -1 : 1;\n      position *= Math.ceil(maxPosition / step) * step;\n    }\n\n    // If computed line position returns negative then line numbers are\n    // relative to the bottom of the video instead of the top. Therefore, we\n    // need to increase our initial position by the length or width of the\n    // video, depending on the writing direction, and reverse our axis directions.\n    if (linePos < 0) {\n      position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n      axis = axis.reverse();\n    }\n\n    // Move the box to the specified position. This may not be its best\n    // position.\n    boxPosition.move(initialAxis, position);\n\n  } else {\n    // If we have a percentage line value for the cue.\n    var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;\n\n    switch (cue.lineAlign) {\n    case \"center\":\n      linePos -= (calculatedPercentage / 2);\n      break;\n    case \"end\":\n      linePos -= calculatedPercentage;\n      break;\n    }\n\n    // Apply initial line position to the cue box.\n    switch (cue.vertical) {\n    case \"\":\n      styleBox.applyStyles({\n        top: styleBox.formatStyle(linePos, \"%\")\n      });\n      break;\n    case \"rl\":\n      styleBox.applyStyles({\n        left: styleBox.formatStyle(linePos, \"%\")\n      });\n      break;\n    case \"lr\":\n      styleBox.applyStyles({\n        right: styleBox.formatStyle(linePos, \"%\")\n      });\n      break;\n    }\n\n    axis = [ \"+y\", \"-x\", \"+x\", \"-y\" ];\n\n    // Get the box position again after we've applied the specified positioning\n    // to it.\n    boxPosition = new BoxPosition(styleBox);\n  }\n\n  var bestPosition = findBestPosition(boxPosition, axis);\n  styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n}\n\nfunction WebVTT() {\n  // Nothing\n}\n\n// Helper to allow strings to be decoded instead of the default binary utf8 data.\nWebVTT.StringDecoder = function() {\n  return {\n    decode: function(data) {\n      if (!data) {\n        return \"\";\n      }\n      if (typeof data !== \"string\") {\n        throw new Error(\"Error - expected string data.\");\n      }\n      return decodeURIComponent(encodeURIComponent(data));\n    }\n  };\n};\n\nWebVTT.convertCueToDOMTree = function(window, cuetext) {\n  if (!window || !cuetext) {\n    return null;\n  }\n  return parseContent(window, cuetext);\n};\n\nvar FONT_SIZE_PERCENT = 0.05;\nvar FONT_STYLE = \"sans-serif\";\nvar CUE_BACKGROUND_PADDING = \"1.5%\";\n\n// Runs the processing model over the cues and regions passed to it.\n// @param overlay A block level element (usually a div) that the computed cues\n//                and regions will be placed into.\nWebVTT.processCues = function(window, cues, overlay) {\n  if (!window || !cues || !overlay) {\n    return null;\n  }\n\n  // Remove all previous children.\n  while (overlay.firstChild) {\n    overlay.removeChild(overlay.firstChild);\n  }\n\n  var paddedOverlay = window.document.createElement(\"div\");\n  paddedOverlay.style.position = \"absolute\";\n  paddedOverlay.style.left = \"0\";\n  paddedOverlay.style.right = \"0\";\n  paddedOverlay.style.top = \"0\";\n  paddedOverlay.style.bottom = \"0\";\n  paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n  overlay.appendChild(paddedOverlay);\n\n  // Determine if we need to compute the display states of the cues. This could\n  // be the case if a cue's state has been changed since the last computation or\n  // if it has not been computed yet.\n  function shouldCompute(cues) {\n    for (var i = 0; i < cues.length; i++) {\n      if (cues[i].hasBeenReset || !cues[i].displayState) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  // We don't need to recompute the cues' display states. Just reuse them.\n  if (!shouldCompute(cues)) {\n    for (var i = 0; i < cues.length; i++) {\n      paddedOverlay.appendChild(cues[i].displayState);\n    }\n    return;\n  }\n\n  var boxPositions = [],\n      containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n      fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n  var styleOptions = {\n    font: fontSize + \"px \" + FONT_STYLE\n  };\n\n  (function() {\n    var styleBox, cue;\n\n    for (var i = 0; i < cues.length; i++) {\n      cue = cues[i];\n\n      // Compute the intial position and styles of the cue div.\n      styleBox = new CueStyleBox(window, cue, styleOptions);\n      paddedOverlay.appendChild(styleBox.div);\n\n      // Move the cue div to it's correct line position.\n      moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);\n\n      // Remember the computed div so that we don't have to recompute it later\n      // if we don't have too.\n      cue.displayState = styleBox.div;\n\n      boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n    }\n  })();\n};\n\nWebVTT.Parser = function(window, vttjs, decoder) {\n  if (!decoder) {\n    decoder = vttjs;\n    vttjs = {};\n  }\n  if (!vttjs) {\n    vttjs = {};\n  }\n\n  this.window = window;\n  this.vttjs = vttjs;\n  this.state = \"INITIAL\";\n  this.buffer = \"\";\n  this.decoder = decoder || new TextDecoder(\"utf8\");\n  this.regionList = [];\n};\n\nWebVTT.Parser.prototype = {\n  // If the error is a ParsingError then report it to the consumer if\n  // possible. If it's not a ParsingError then throw it like normal.\n  reportOrThrowError: function(e) {\n    if (e instanceof ParsingError) {\n      this.onparsingerror && this.onparsingerror(e);\n    } else {\n      throw e;\n    }\n  },\n  parse: function (data) {\n    var self = this;\n\n    // If there is no data then we won't decode it, but will just try to parse\n    // whatever is in buffer already. This may occur in circumstances, for\n    // example when flush() is called.\n    if (data) {\n      // Try to decode the data that we received.\n      self.buffer += self.decoder.decode(data, {stream: true});\n    }\n\n    function collectNextLine() {\n      var buffer = self.buffer;\n      var pos = 0;\n      while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n        ++pos;\n      }\n      var line = buffer.substr(0, pos);\n      // Advance the buffer early in case we fail below.\n      if (buffer[pos] === '\\r') {\n        ++pos;\n      }\n      if (buffer[pos] === '\\n') {\n        ++pos;\n      }\n      self.buffer = buffer.substr(pos);\n      return line;\n    }\n\n    // 3.4 WebVTT region and WebVTT region settings syntax\n    function parseRegion(input) {\n      var settings = new Settings();\n\n      parseOptions(input, function (k, v) {\n        switch (k) {\n        case \"id\":\n          settings.set(k, v);\n          break;\n        case \"width\":\n          settings.percent(k, v);\n          break;\n        case \"lines\":\n          settings.integer(k, v);\n          break;\n        case \"regionanchor\":\n        case \"viewportanchor\":\n          var xy = v.split(',');\n          if (xy.length !== 2) {\n            break;\n          }\n          // We have to make sure both x and y parse, so use a temporary\n          // settings object here.\n          var anchor = new Settings();\n          anchor.percent(\"x\", xy[0]);\n          anchor.percent(\"y\", xy[1]);\n          if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n            break;\n          }\n          settings.set(k + \"X\", anchor.get(\"x\"));\n          settings.set(k + \"Y\", anchor.get(\"y\"));\n          break;\n        case \"scroll\":\n          settings.alt(k, v, [\"up\"]);\n          break;\n        }\n      }, /=/, /\\s/);\n\n      // Create the region, using default values for any values that were not\n      // specified.\n      if (settings.has(\"id\")) {\n        var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n        region.width = settings.get(\"width\", 100);\n        region.lines = settings.get(\"lines\", 3);\n        region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n        region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n        region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n        region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n        region.scroll = settings.get(\"scroll\", \"\");\n        // Register the region.\n        self.onregion && self.onregion(region);\n        // Remember the VTTRegion for later in case we parse any VTTCues that\n        // reference it.\n        self.regionList.push({\n          id: settings.get(\"id\"),\n          region: region\n        });\n      }\n    }\n\n    // draft-pantos-http-live-streaming-20\n    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n    // 3.5 WebVTT\n    function parseTimestampMap(input) {\n      var settings = new Settings();\n\n      parseOptions(input, function(k, v) {\n        switch(k) {\n        case \"MPEGT\":\n          settings.integer(k + 'S', v);\n          break;\n        case \"LOCA\":\n          settings.set(k + 'L', parseTimeStamp(v));\n          break;\n        }\n      }, /[^\\d]:/, /,/);\n\n      self.ontimestampmap && self.ontimestampmap({\n        \"MPEGTS\": settings.get(\"MPEGTS\"),\n        \"LOCAL\": settings.get(\"LOCAL\")\n      });\n    }\n\n    // 3.2 WebVTT metadata header syntax\n    function parseHeader(input) {\n      if (input.match(/X-TIMESTAMP-MAP/)) {\n        // This line contains HLS X-TIMESTAMP-MAP metadata\n        parseOptions(input, function(k, v) {\n          switch(k) {\n          case \"X-TIMESTAMP-MAP\":\n            parseTimestampMap(v);\n            break;\n          }\n        }, /=/);\n      } else {\n        parseOptions(input, function (k, v) {\n          switch (k) {\n          case \"Region\":\n            // 3.3 WebVTT region metadata header syntax\n            parseRegion(v);\n            break;\n          }\n        }, /:/);\n      }\n\n    }\n\n    // 5.1 WebVTT file parsing.\n    try {\n      var line;\n      if (self.state === \"INITIAL\") {\n        // We can't start parsing until we have the first line.\n        if (!/\\r\\n|\\n/.test(self.buffer)) {\n          return this;\n        }\n\n        line = collectNextLine();\n\n        var m = line.match(/^WEBVTT([ \\t].*)?$/);\n        if (!m || !m[0]) {\n          throw new ParsingError(ParsingError.Errors.BadSignature);\n        }\n\n        self.state = \"HEADER\";\n      }\n\n      var alreadyCollectedLine = false;\n      while (self.buffer) {\n        // We can't parse a line until we have the full line.\n        if (!/\\r\\n|\\n/.test(self.buffer)) {\n          return this;\n        }\n\n        if (!alreadyCollectedLine) {\n          line = collectNextLine();\n        } else {\n          alreadyCollectedLine = false;\n        }\n\n        switch (self.state) {\n        case \"HEADER\":\n          // 13-18 - Allow a header (metadata) under the WEBVTT line.\n          if (/:/.test(line)) {\n            parseHeader(line);\n          } else if (!line) {\n            // An empty line terminates the header and starts the body (cues).\n            self.state = \"ID\";\n          }\n          continue;\n        case \"NOTE\":\n          // Ignore NOTE blocks.\n          if (!line) {\n            self.state = \"ID\";\n          }\n          continue;\n        case \"ID\":\n          // Check for the start of NOTE blocks.\n          if (/^NOTE($|[ \\t])/.test(line)) {\n            self.state = \"NOTE\";\n            break;\n          }\n          // 19-29 - Allow any number of line terminators, then initialize new cue values.\n          if (!line) {\n            continue;\n          }\n          self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\");\n          // Safari still uses the old middle value and won't accept center\n          try {\n            self.cue.align = \"center\";\n          } catch (e) {\n            self.cue.align = \"middle\";\n          }\n          self.state = \"CUE\";\n          // 30-39 - Check if self line contains an optional identifier or timing data.\n          if (line.indexOf(\"-->\") === -1) {\n            self.cue.id = line;\n            continue;\n          }\n          // Process line as start of a cue.\n          /*falls through*/\n        case \"CUE\":\n          // 40 - Collect cue timings and settings.\n          try {\n            parseCue(line, self.cue, self.regionList);\n          } catch (e) {\n            self.reportOrThrowError(e);\n            // In case of an error ignore rest of the cue.\n            self.cue = null;\n            self.state = \"BADCUE\";\n            continue;\n          }\n          self.state = \"CUETEXT\";\n          continue;\n        case \"CUETEXT\":\n          var hasSubstring = line.indexOf(\"-->\") !== -1;\n          // 34 - If we have an empty line then report the cue.\n          // 35 - If we have the special substring '-->' then report the cue,\n          // but do not collect the line as we need to process the current\n          // one as a new cue.\n          if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n            // We are done parsing self cue.\n            self.oncue && self.oncue(self.cue);\n            self.cue = null;\n            self.state = \"ID\";\n            continue;\n          }\n          if (self.cue.text) {\n            self.cue.text += \"\\n\";\n          }\n          self.cue.text += line.replace(/\\u2028/g, '\\n').replace(/u2029/g, '\\n');\n          continue;\n        case \"BADCUE\": // BADCUE\n          // 54-62 - Collect and discard the remaining cue.\n          if (!line) {\n            self.state = \"ID\";\n          }\n          continue;\n        }\n      }\n    } catch (e) {\n      self.reportOrThrowError(e);\n\n      // If we are currently parsing a cue, report what we have.\n      if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n        self.oncue(self.cue);\n      }\n      self.cue = null;\n      // Enter BADWEBVTT state if header was not parsed correctly otherwise\n      // another exception occurred so enter BADCUE state.\n      self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n    }\n    return this;\n  },\n  flush: function () {\n    var self = this;\n    try {\n      // Finish decoding the stream.\n      self.buffer += self.decoder.decode();\n      // Synthesize the end of the current cue or region.\n      if (self.cue || self.state === \"HEADER\") {\n        self.buffer += \"\\n\\n\";\n        self.parse();\n      }\n      // If we've flushed, parsed, and we're still on the INITIAL state then\n      // that means we don't have enough of the stream to parse the first\n      // line.\n      if (self.state === \"INITIAL\") {\n        throw new ParsingError(ParsingError.Errors.BadSignature);\n      }\n    } catch(e) {\n      self.reportOrThrowError(e);\n    }\n    self.onflush && self.onflush();\n    return this;\n  }\n};\n\nmodule.exports = WebVTT;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar autoKeyword = \"auto\";\nvar directionSetting = {\n  \"\": 1,\n  \"lr\": 1,\n  \"rl\": 1\n};\nvar alignSetting = {\n  \"start\": 1,\n  \"center\": 1,\n  \"end\": 1,\n  \"left\": 1,\n  \"right\": 1,\n  \"auto\": 1,\n  \"line-left\": 1,\n  \"line-right\": 1\n};\n\nfunction findDirectionSetting(value) {\n  if (typeof value !== \"string\") {\n    return false;\n  }\n  var dir = directionSetting[value.toLowerCase()];\n  return dir ? value.toLowerCase() : false;\n}\n\nfunction findAlignSetting(value) {\n  if (typeof value !== \"string\") {\n    return false;\n  }\n  var align = alignSetting[value.toLowerCase()];\n  return align ? value.toLowerCase() : false;\n}\n\nfunction VTTCue(startTime, endTime, text) {\n  /**\n   * Shim implementation specific properties. These properties are not in\n   * the spec.\n   */\n\n  // Lets us know when the VTTCue's data has changed in such a way that we need\n  // to recompute its display state. This lets us compute its display state\n  // lazily.\n  this.hasBeenReset = false;\n\n  /**\n   * VTTCue and TextTrackCue properties\n   * http://dev.w3.org/html5/webvtt/#vttcue-interface\n   */\n\n  var _id = \"\";\n  var _pauseOnExit = false;\n  var _startTime = startTime;\n  var _endTime = endTime;\n  var _text = text;\n  var _region = null;\n  var _vertical = \"\";\n  var _snapToLines = true;\n  var _line = \"auto\";\n  var _lineAlign = \"start\";\n  var _position = \"auto\";\n  var _positionAlign = \"auto\";\n  var _size = 100;\n  var _align = \"center\";\n\n  Object.defineProperties(this, {\n    \"id\": {\n      enumerable: true,\n      get: function() {\n        return _id;\n      },\n      set: function(value) {\n        _id = \"\" + value;\n      }\n    },\n\n    \"pauseOnExit\": {\n      enumerable: true,\n      get: function() {\n        return _pauseOnExit;\n      },\n      set: function(value) {\n        _pauseOnExit = !!value;\n      }\n    },\n\n    \"startTime\": {\n      enumerable: true,\n      get: function() {\n        return _startTime;\n      },\n      set: function(value) {\n        if (typeof value !== \"number\") {\n          throw new TypeError(\"Start time must be set to a number.\");\n        }\n        _startTime = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"endTime\": {\n      enumerable: true,\n      get: function() {\n        return _endTime;\n      },\n      set: function(value) {\n        if (typeof value !== \"number\") {\n          throw new TypeError(\"End time must be set to a number.\");\n        }\n        _endTime = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"text\": {\n      enumerable: true,\n      get: function() {\n        return _text;\n      },\n      set: function(value) {\n        _text = \"\" + value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"region\": {\n      enumerable: true,\n      get: function() {\n        return _region;\n      },\n      set: function(value) {\n        _region = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"vertical\": {\n      enumerable: true,\n      get: function() {\n        return _vertical;\n      },\n      set: function(value) {\n        var setting = findDirectionSetting(value);\n        // Have to check for false because the setting an be an empty string.\n        if (setting === false) {\n          throw new SyntaxError(\"Vertical: an invalid or illegal direction string was specified.\");\n        }\n        _vertical = setting;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"snapToLines\": {\n      enumerable: true,\n      get: function() {\n        return _snapToLines;\n      },\n      set: function(value) {\n        _snapToLines = !!value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"line\": {\n      enumerable: true,\n      get: function() {\n        return _line;\n      },\n      set: function(value) {\n        if (typeof value !== \"number\" && value !== autoKeyword) {\n          throw new SyntaxError(\"Line: an invalid number or illegal string was specified.\");\n        }\n        _line = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"lineAlign\": {\n      enumerable: true,\n      get: function() {\n        return _lineAlign;\n      },\n      set: function(value) {\n        var setting = findAlignSetting(value);\n        if (!setting) {\n          console.warn(\"lineAlign: an invalid or illegal string was specified.\");\n        } else {\n          _lineAlign = setting;\n          this.hasBeenReset = true;\n        }\n      }\n    },\n\n    \"position\": {\n      enumerable: true,\n      get: function() {\n        return _position;\n      },\n      set: function(value) {\n        if (value < 0 || value > 100) {\n          throw new Error(\"Position must be between 0 and 100.\");\n        }\n        _position = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"positionAlign\": {\n      enumerable: true,\n      get: function() {\n        return _positionAlign;\n      },\n      set: function(value) {\n        var setting = findAlignSetting(value);\n        if (!setting) {\n          console.warn(\"positionAlign: an invalid or illegal string was specified.\");\n        } else {\n          _positionAlign = setting;\n          this.hasBeenReset = true;\n        }\n      }\n    },\n\n    \"size\": {\n      enumerable: true,\n      get: function() {\n        return _size;\n      },\n      set: function(value) {\n        if (value < 0 || value > 100) {\n          throw new Error(\"Size must be between 0 and 100.\");\n        }\n        _size = value;\n        this.hasBeenReset = true;\n      }\n    },\n\n    \"align\": {\n      enumerable: true,\n      get: function() {\n        return _align;\n      },\n      set: function(value) {\n        var setting = findAlignSetting(value);\n        if (!setting) {\n          throw new SyntaxError(\"align: an invalid or illegal alignment string was specified.\");\n        }\n        _align = setting;\n        this.hasBeenReset = true;\n      }\n    }\n  });\n\n  /**\n   * Other <track> spec defined properties\n   */\n\n  // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n  this.displayState = undefined;\n}\n\n/**\n * VTTCue methods\n */\n\nVTTCue.prototype.getCueAsHTML = function() {\n  // Assume WebVTT.convertCueToDOMTree is on the global.\n  return WebVTT.convertCueToDOMTree(window, this.text);\n};\n\nmodule.exports = VTTCue;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar scrollSetting = {\n  \"\": true,\n  \"up\": true\n};\n\nfunction findScrollSetting(value) {\n  if (typeof value !== \"string\") {\n    return false;\n  }\n  var scroll = scrollSetting[value.toLowerCase()];\n  return scroll ? value.toLowerCase() : false;\n}\n\nfunction isValidPercentValue(value) {\n  return typeof value === \"number\" && (value >= 0 && value <= 100);\n}\n\n// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\nfunction VTTRegion() {\n  var _width = 100;\n  var _lines = 3;\n  var _regionAnchorX = 0;\n  var _regionAnchorY = 100;\n  var _viewportAnchorX = 0;\n  var _viewportAnchorY = 100;\n  var _scroll = \"\";\n\n  Object.defineProperties(this, {\n    \"width\": {\n      enumerable: true,\n      get: function() {\n        return _width;\n      },\n      set: function(value) {\n        if (!isValidPercentValue(value)) {\n          throw new Error(\"Width must be between 0 and 100.\");\n        }\n        _width = value;\n      }\n    },\n    \"lines\": {\n      enumerable: true,\n      get: function() {\n        return _lines;\n      },\n      set: function(value) {\n        if (typeof value !== \"number\") {\n          throw new TypeError(\"Lines must be set to a number.\");\n        }\n        _lines = value;\n      }\n    },\n    \"regionAnchorY\": {\n      enumerable: true,\n      get: function() {\n        return _regionAnchorY;\n      },\n      set: function(value) {\n        if (!isValidPercentValue(value)) {\n          throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n        }\n        _regionAnchorY = value;\n      }\n    },\n    \"regionAnchorX\": {\n      enumerable: true,\n      get: function() {\n        return _regionAnchorX;\n      },\n      set: function(value) {\n        if(!isValidPercentValue(value)) {\n          throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n        }\n        _regionAnchorX = value;\n      }\n    },\n    \"viewportAnchorY\": {\n      enumerable: true,\n      get: function() {\n        return _viewportAnchorY;\n      },\n      set: function(value) {\n        if (!isValidPercentValue(value)) {\n          throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n        }\n        _viewportAnchorY = value;\n      }\n    },\n    \"viewportAnchorX\": {\n      enumerable: true,\n      get: function() {\n        return _viewportAnchorX;\n      },\n      set: function(value) {\n        if (!isValidPercentValue(value)) {\n          throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n        }\n        _viewportAnchorX = value;\n      }\n    },\n    \"scroll\": {\n      enumerable: true,\n      get: function() {\n        return _scroll;\n      },\n      set: function(value) {\n        var setting = findScrollSetting(value);\n        // Have to check for false as an empty string is a legal value.\n        if (setting === false) {\n          console.warn(\"Scroll: an invalid or illegal string was specified.\");\n        } else {\n          _scroll = setting;\n        }\n      }\n    }\n  });\n}\n\nmodule.exports = VTTRegion;\n","/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n// @version 0.7.24\n(function() {\n  window.WebComponents = window.WebComponents || {\n    flags: {}\n  };\n  var file = \"webcomponents-lite.js\";\n  var script = document.querySelector('script[src*=\"' + file + '\"]');\n  var flags = {};\n  if (!flags.noOpts) {\n    location.search.slice(1).split(\"&\").forEach(function(option) {\n      var parts = option.split(\"=\");\n      var match;\n      if (parts[0] && (match = parts[0].match(/wc-(.+)/))) {\n        flags[match[1]] = parts[1] || true;\n      }\n    });\n    if (script) {\n      for (var i = 0, a; a = script.attributes[i]; i++) {\n        if (a.name !== \"src\") {\n          flags[a.name] = a.value || true;\n        }\n      }\n    }\n    if (flags.log && flags.log.split) {\n      var parts = flags.log.split(\",\");\n      flags.log = {};\n      parts.forEach(function(f) {\n        flags.log[f] = true;\n      });\n    } else {\n      flags.log = {};\n    }\n  }\n  if (flags.register) {\n    window.CustomElements = window.CustomElements || {\n      flags: {}\n    };\n    window.CustomElements.flags.register = flags.register;\n  }\n  WebComponents.flags = flags;\n})();\n\n(function(scope) {\n  \"use strict\";\n  var hasWorkingUrl = false;\n  if (!scope.forceJURL) {\n    try {\n      var u = new URL(\"b\", \"http://a\");\n      u.pathname = \"c%20d\";\n      hasWorkingUrl = u.href === \"http://a/c%20d\";\n    } catch (e) {}\n  }\n  if (hasWorkingUrl) return;\n  var relative = Object.create(null);\n  relative[\"ftp\"] = 21;\n  relative[\"file\"] = 0;\n  relative[\"gopher\"] = 70;\n  relative[\"http\"] = 80;\n  relative[\"https\"] = 443;\n  relative[\"ws\"] = 80;\n  relative[\"wss\"] = 443;\n  var relativePathDotMapping = Object.create(null);\n  relativePathDotMapping[\"%2e\"] = \".\";\n  relativePathDotMapping[\".%2e\"] = \"..\";\n  relativePathDotMapping[\"%2e.\"] = \"..\";\n  relativePathDotMapping[\"%2e%2e\"] = \"..\";\n  function isRelativeScheme(scheme) {\n    return relative[scheme] !== undefined;\n  }\n  function invalid() {\n    clear.call(this);\n    this._isInvalid = true;\n  }\n  function IDNAToASCII(h) {\n    if (\"\" == h) {\n      invalid.call(this);\n    }\n    return h.toLowerCase();\n  }\n  function percentEscape(c) {\n    var unicode = c.charCodeAt(0);\n    if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) {\n      return c;\n    }\n    return encodeURIComponent(c);\n  }\n  function percentEscapeQuery(c) {\n    var unicode = c.charCodeAt(0);\n    if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) {\n      return c;\n    }\n    return encodeURIComponent(c);\n  }\n  var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n  function parse(input, stateOverride, base) {\n    function err(message) {\n      errors.push(message);\n    }\n    var state = stateOverride || \"scheme start\", cursor = 0, buffer = \"\", seenAt = false, seenBracket = false, errors = [];\n    loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {\n      var c = input[cursor];\n      switch (state) {\n       case \"scheme start\":\n        if (c && ALPHA.test(c)) {\n          buffer += c.toLowerCase();\n          state = \"scheme\";\n        } else if (!stateOverride) {\n          buffer = \"\";\n          state = \"no scheme\";\n          continue;\n        } else {\n          err(\"Invalid scheme.\");\n          break loop;\n        }\n        break;\n\n       case \"scheme\":\n        if (c && ALPHANUMERIC.test(c)) {\n          buffer += c.toLowerCase();\n        } else if (\":\" == c) {\n          this._scheme = buffer;\n          buffer = \"\";\n          if (stateOverride) {\n            break loop;\n          }\n          if (isRelativeScheme(this._scheme)) {\n            this._isRelative = true;\n          }\n          if (\"file\" == this._scheme) {\n            state = \"relative\";\n          } else if (this._isRelative && base && base._scheme == this._scheme) {\n            state = \"relative or authority\";\n          } else if (this._isRelative) {\n            state = \"authority first slash\";\n          } else {\n            state = \"scheme data\";\n          }\n        } else if (!stateOverride) {\n          buffer = \"\";\n          cursor = 0;\n          state = \"no scheme\";\n          continue;\n        } else if (EOF == c) {\n          break loop;\n        } else {\n          err(\"Code point not allowed in scheme: \" + c);\n          break loop;\n        }\n        break;\n\n       case \"scheme data\":\n        if (\"?\" == c) {\n          this._query = \"?\";\n          state = \"query\";\n        } else if (\"#\" == c) {\n          this._fragment = \"#\";\n          state = \"fragment\";\n        } else {\n          if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n            this._schemeData += percentEscape(c);\n          }\n        }\n        break;\n\n       case \"no scheme\":\n        if (!base || !isRelativeScheme(base._scheme)) {\n          err(\"Missing scheme.\");\n          invalid.call(this);\n        } else {\n          state = \"relative\";\n          continue;\n        }\n        break;\n\n       case \"relative or authority\":\n        if (\"/\" == c && \"/\" == input[cursor + 1]) {\n          state = \"authority ignore slashes\";\n        } else {\n          err(\"Expected /, got: \" + c);\n          state = \"relative\";\n          continue;\n        }\n        break;\n\n       case \"relative\":\n        this._isRelative = true;\n        if (\"file\" != this._scheme) this._scheme = base._scheme;\n        if (EOF == c) {\n          this._host = base._host;\n          this._port = base._port;\n          this._path = base._path.slice();\n          this._query = base._query;\n          this._username = base._username;\n          this._password = base._password;\n          break loop;\n        } else if (\"/\" == c || \"\\\\\" == c) {\n          if (\"\\\\\" == c) err(\"\\\\ is an invalid code point.\");\n          state = \"relative slash\";\n        } else if (\"?\" == c) {\n          this._host = base._host;\n          this._port = base._port;\n          this._path = base._path.slice();\n          this._query = \"?\";\n          this._username = base._username;\n          this._password = base._password;\n          state = \"query\";\n        } else if (\"#\" == c) {\n          this._host = base._host;\n          this._port = base._port;\n          this._path = base._path.slice();\n          this._query = base._query;\n          this._fragment = \"#\";\n          this._username = base._username;\n          this._password = base._password;\n          state = \"fragment\";\n        } else {\n          var nextC = input[cursor + 1];\n          var nextNextC = input[cursor + 2];\n          if (\"file\" != this._scheme || !ALPHA.test(c) || nextC != \":\" && nextC != \"|\" || EOF != nextNextC && \"/\" != nextNextC && \"\\\\\" != nextNextC && \"?\" != nextNextC && \"#\" != nextNextC) {\n            this._host = base._host;\n            this._port = base._port;\n            this._username = base._username;\n            this._password = base._password;\n            this._path = base._path.slice();\n            this._path.pop();\n          }\n          state = \"relative path\";\n          continue;\n        }\n        break;\n\n       case \"relative slash\":\n        if (\"/\" == c || \"\\\\\" == c) {\n          if (\"\\\\\" == c) {\n            err(\"\\\\ is an invalid code point.\");\n          }\n          if (\"file\" == this._scheme) {\n            state = \"file host\";\n          } else {\n            state = \"authority ignore slashes\";\n          }\n        } else {\n          if (\"file\" != this._scheme) {\n            this._host = base._host;\n            this._port = base._port;\n            this._username = base._username;\n            this._password = base._password;\n          }\n          state = \"relative path\";\n          continue;\n        }\n        break;\n\n       case \"authority first slash\":\n        if (\"/\" == c) {\n          state = \"authority second slash\";\n        } else {\n          err(\"Expected '/', got: \" + c);\n          state = \"authority ignore slashes\";\n          continue;\n        }\n        break;\n\n       case \"authority second slash\":\n        state = \"authority ignore slashes\";\n        if (\"/\" != c) {\n          err(\"Expected '/', got: \" + c);\n          continue;\n        }\n        break;\n\n       case \"authority ignore slashes\":\n        if (\"/\" != c && \"\\\\\" != c) {\n          state = \"authority\";\n          continue;\n        } else {\n          err(\"Expected authority, got: \" + c);\n        }\n        break;\n\n       case \"authority\":\n        if (\"@\" == c) {\n          if (seenAt) {\n            err(\"@ already seen.\");\n            buffer += \"%40\";\n          }\n          seenAt = true;\n          for (var i = 0; i < buffer.length; i++) {\n            var cp = buffer[i];\n            if (\"\\t\" == cp || \"\\n\" == cp || \"\\r\" == cp) {\n              err(\"Invalid whitespace in authority.\");\n              continue;\n            }\n            if (\":\" == cp && null === this._password) {\n              this._password = \"\";\n              continue;\n            }\n            var tempC = percentEscape(cp);\n            null !== this._password ? this._password += tempC : this._username += tempC;\n          }\n          buffer = \"\";\n        } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n          cursor -= buffer.length;\n          buffer = \"\";\n          state = \"host\";\n          continue;\n        } else {\n          buffer += c;\n        }\n        break;\n\n       case \"file host\":\n        if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n          if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == \":\" || buffer[1] == \"|\")) {\n            state = \"relative path\";\n          } else if (buffer.length == 0) {\n            state = \"relative path start\";\n          } else {\n            this._host = IDNAToASCII.call(this, buffer);\n            buffer = \"\";\n            state = \"relative path start\";\n          }\n          continue;\n        } else if (\"\\t\" == c || \"\\n\" == c || \"\\r\" == c) {\n          err(\"Invalid whitespace in file host.\");\n        } else {\n          buffer += c;\n        }\n        break;\n\n       case \"host\":\n       case \"hostname\":\n        if (\":\" == c && !seenBracket) {\n          this._host = IDNAToASCII.call(this, buffer);\n          buffer = \"\";\n          state = \"port\";\n          if (\"hostname\" == stateOverride) {\n            break loop;\n          }\n        } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n          this._host = IDNAToASCII.call(this, buffer);\n          buffer = \"\";\n          state = \"relative path start\";\n          if (stateOverride) {\n            break loop;\n          }\n          continue;\n        } else if (\"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n          if (\"[\" == c) {\n            seenBracket = true;\n          } else if (\"]\" == c) {\n            seenBracket = false;\n          }\n          buffer += c;\n        } else {\n          err(\"Invalid code point in host/hostname: \" + c);\n        }\n        break;\n\n       case \"port\":\n        if (/[0-9]/.test(c)) {\n          buffer += c;\n        } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c || stateOverride) {\n          if (\"\" != buffer) {\n            var temp = parseInt(buffer, 10);\n            if (temp != relative[this._scheme]) {\n              this._port = temp + \"\";\n            }\n            buffer = \"\";\n          }\n          if (stateOverride) {\n            break loop;\n          }\n          state = \"relative path start\";\n          continue;\n        } else if (\"\\t\" == c || \"\\n\" == c || \"\\r\" == c) {\n          err(\"Invalid code point in port: \" + c);\n        } else {\n          invalid.call(this);\n        }\n        break;\n\n       case \"relative path start\":\n        if (\"\\\\\" == c) err(\"'\\\\' not allowed in path.\");\n        state = \"relative path\";\n        if (\"/\" != c && \"\\\\\" != c) {\n          continue;\n        }\n        break;\n\n       case \"relative path\":\n        if (EOF == c || \"/\" == c || \"\\\\\" == c || !stateOverride && (\"?\" == c || \"#\" == c)) {\n          if (\"\\\\\" == c) {\n            err(\"\\\\ not allowed in relative path.\");\n          }\n          var tmp;\n          if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {\n            buffer = tmp;\n          }\n          if (\"..\" == buffer) {\n            this._path.pop();\n            if (\"/\" != c && \"\\\\\" != c) {\n              this._path.push(\"\");\n            }\n          } else if (\".\" == buffer && \"/\" != c && \"\\\\\" != c) {\n            this._path.push(\"\");\n          } else if (\".\" != buffer) {\n            if (\"file\" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == \"|\") {\n              buffer = buffer[0] + \":\";\n            }\n            this._path.push(buffer);\n          }\n          buffer = \"\";\n          if (\"?\" == c) {\n            this._query = \"?\";\n            state = \"query\";\n          } else if (\"#\" == c) {\n            this._fragment = \"#\";\n            state = \"fragment\";\n          }\n        } else if (\"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n          buffer += percentEscape(c);\n        }\n        break;\n\n       case \"query\":\n        if (!stateOverride && \"#\" == c) {\n          this._fragment = \"#\";\n          state = \"fragment\";\n        } else if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n          this._query += percentEscapeQuery(c);\n        }\n        break;\n\n       case \"fragment\":\n        if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n          this._fragment += c;\n        }\n        break;\n      }\n      cursor++;\n    }\n  }\n  function clear() {\n    this._scheme = \"\";\n    this._schemeData = \"\";\n    this._username = \"\";\n    this._password = null;\n    this._host = \"\";\n    this._port = \"\";\n    this._path = [];\n    this._query = \"\";\n    this._fragment = \"\";\n    this._isInvalid = false;\n    this._isRelative = false;\n  }\n  function jURL(url, base) {\n    if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base));\n    this._url = url;\n    clear.call(this);\n    var input = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, \"\");\n    parse.call(this, input, null, base);\n  }\n  jURL.prototype = {\n    toString: function() {\n      return this.href;\n    },\n    get href() {\n      if (this._isInvalid) return this._url;\n      var authority = \"\";\n      if (\"\" != this._username || null != this._password) {\n        authority = this._username + (null != this._password ? \":\" + this._password : \"\") + \"@\";\n      }\n      return this.protocol + (this._isRelative ? \"//\" + authority + this.host : \"\") + this.pathname + this._query + this._fragment;\n    },\n    set href(href) {\n      clear.call(this);\n      parse.call(this, href);\n    },\n    get protocol() {\n      return this._scheme + \":\";\n    },\n    set protocol(protocol) {\n      if (this._isInvalid) return;\n      parse.call(this, protocol + \":\", \"scheme start\");\n    },\n    get host() {\n      return this._isInvalid ? \"\" : this._port ? this._host + \":\" + this._port : this._host;\n    },\n    set host(host) {\n      if (this._isInvalid || !this._isRelative) return;\n      parse.call(this, host, \"host\");\n    },\n    get hostname() {\n      return this._host;\n    },\n    set hostname(hostname) {\n      if (this._isInvalid || !this._isRelative) return;\n      parse.call(this, hostname, \"hostname\");\n    },\n    get port() {\n      return this._port;\n    },\n    set port(port) {\n      if (this._isInvalid || !this._isRelative) return;\n      parse.call(this, port, \"port\");\n    },\n    get pathname() {\n      return this._isInvalid ? \"\" : this._isRelative ? \"/\" + this._path.join(\"/\") : this._schemeData;\n    },\n    set pathname(pathname) {\n      if (this._isInvalid || !this._isRelative) return;\n      this._path = [];\n      parse.call(this, pathname, \"relative path start\");\n    },\n    get search() {\n      return this._isInvalid || !this._query || \"?\" == this._query ? \"\" : this._query;\n    },\n    set search(search) {\n      if (this._isInvalid || !this._isRelative) return;\n      this._query = \"?\";\n      if (\"?\" == search[0]) search = search.slice(1);\n      parse.call(this, search, \"query\");\n    },\n    get hash() {\n      return this._isInvalid || !this._fragment || \"#\" == this._fragment ? \"\" : this._fragment;\n    },\n    set hash(hash) {\n      if (this._isInvalid) return;\n      this._fragment = \"#\";\n      if (\"#\" == hash[0]) hash = hash.slice(1);\n      parse.call(this, hash, \"fragment\");\n    },\n    get origin() {\n      var host;\n      if (this._isInvalid || !this._scheme) {\n        return \"\";\n      }\n      switch (this._scheme) {\n       case \"data\":\n       case \"file\":\n       case \"javascript\":\n       case \"mailto\":\n        return \"null\";\n      }\n      host = this.host;\n      if (!host) {\n        return \"\";\n      }\n      return this._scheme + \"://\" + host;\n    }\n  };\n  var OriginalURL = scope.URL;\n  if (OriginalURL) {\n    jURL.createObjectURL = function(blob) {\n      return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\n    };\n    jURL.revokeObjectURL = function(url) {\n      OriginalURL.revokeObjectURL(url);\n    };\n  }\n  scope.URL = jURL;\n})(self);\n\nif (typeof WeakMap === \"undefined\") {\n  (function() {\n    var defineProperty = Object.defineProperty;\n    var counter = Date.now() % 1e9;\n    var WeakMap = function() {\n      this.name = \"__st\" + (Math.random() * 1e9 >>> 0) + (counter++ + \"__\");\n    };\n    WeakMap.prototype = {\n      set: function(key, value) {\n        var entry = key[this.name];\n        if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {\n          value: [ key, value ],\n          writable: true\n        });\n        return this;\n      },\n      get: function(key) {\n        var entry;\n        return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;\n      },\n      \"delete\": function(key) {\n        var entry = key[this.name];\n        if (!entry || entry[0] !== key) return false;\n        entry[0] = entry[1] = undefined;\n        return true;\n      },\n      has: function(key) {\n        var entry = key[this.name];\n        if (!entry) return false;\n        return entry[0] === key;\n      }\n    };\n    window.WeakMap = WeakMap;\n  })();\n}\n\n(function(global) {\n  if (global.JsMutationObserver) {\n    return;\n  }\n  var registrationsTable = new WeakMap();\n  var setImmediate;\n  if (/Trident|Edge/.test(navigator.userAgent)) {\n    setImmediate = setTimeout;\n  } else if (window.setImmediate) {\n    setImmediate = window.setImmediate;\n  } else {\n    var setImmediateQueue = [];\n    var sentinel = String(Math.random());\n    window.addEventListener(\"message\", function(e) {\n      if (e.data === sentinel) {\n        var queue = setImmediateQueue;\n        setImmediateQueue = [];\n        queue.forEach(function(func) {\n          func();\n        });\n      }\n    });\n    setImmediate = function(func) {\n      setImmediateQueue.push(func);\n      window.postMessage(sentinel, \"*\");\n    };\n  }\n  var isScheduled = false;\n  var scheduledObservers = [];\n  function scheduleCallback(observer) {\n    scheduledObservers.push(observer);\n    if (!isScheduled) {\n      isScheduled = true;\n      setImmediate(dispatchCallbacks);\n    }\n  }\n  function wrapIfNeeded(node) {\n    return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;\n  }\n  function dispatchCallbacks() {\n    isScheduled = false;\n    var observers = scheduledObservers;\n    scheduledObservers = [];\n    observers.sort(function(o1, o2) {\n      return o1.uid_ - o2.uid_;\n    });\n    var anyNonEmpty = false;\n    observers.forEach(function(observer) {\n      var queue = observer.takeRecords();\n      removeTransientObserversFor(observer);\n      if (queue.length) {\n        observer.callback_(queue, observer);\n        anyNonEmpty = true;\n      }\n    });\n    if (anyNonEmpty) dispatchCallbacks();\n  }\n  function removeTransientObserversFor(observer) {\n    observer.nodes_.forEach(function(node) {\n      var registrations = registrationsTable.get(node);\n      if (!registrations) return;\n      registrations.forEach(function(registration) {\n        if (registration.observer === observer) registration.removeTransientObservers();\n      });\n    });\n  }\n  function forEachAncestorAndObserverEnqueueRecord(target, callback) {\n    for (var node = target; node; node = node.parentNode) {\n      var registrations = registrationsTable.get(node);\n      if (registrations) {\n        for (var j = 0; j < registrations.length; j++) {\n          var registration = registrations[j];\n          var options = registration.options;\n          if (node !== target && !options.subtree) continue;\n          var record = callback(options);\n          if (record) registration.enqueue(record);\n        }\n      }\n    }\n  }\n  var uidCounter = 0;\n  function JsMutationObserver(callback) {\n    this.callback_ = callback;\n    this.nodes_ = [];\n    this.records_ = [];\n    this.uid_ = ++uidCounter;\n  }\n  JsMutationObserver.prototype = {\n    observe: function(target, options) {\n      target = wrapIfNeeded(target);\n      if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {\n        throw new SyntaxError();\n      }\n      var registrations = registrationsTable.get(target);\n      if (!registrations) registrationsTable.set(target, registrations = []);\n      var registration;\n      for (var i = 0; i < registrations.length; i++) {\n        if (registrations[i].observer === this) {\n          registration = registrations[i];\n          registration.removeListeners();\n          registration.options = options;\n          break;\n        }\n      }\n      if (!registration) {\n        registration = new Registration(this, target, options);\n        registrations.push(registration);\n        this.nodes_.push(target);\n      }\n      registration.addListeners();\n    },\n    disconnect: function() {\n      this.nodes_.forEach(function(node) {\n        var registrations = registrationsTable.get(node);\n        for (var i = 0; i < registrations.length; i++) {\n          var registration = registrations[i];\n          if (registration.observer === this) {\n            registration.removeListeners();\n            registrations.splice(i, 1);\n            break;\n          }\n        }\n      }, this);\n      this.records_ = [];\n    },\n    takeRecords: function() {\n      var copyOfRecords = this.records_;\n      this.records_ = [];\n      return copyOfRecords;\n    }\n  };\n  function MutationRecord(type, target) {\n    this.type = type;\n    this.target = target;\n    this.addedNodes = [];\n    this.removedNodes = [];\n    this.previousSibling = null;\n    this.nextSibling = null;\n    this.attributeName = null;\n    this.attributeNamespace = null;\n    this.oldValue = null;\n  }\n  function copyMutationRecord(original) {\n    var record = new MutationRecord(original.type, original.target);\n    record.addedNodes = original.addedNodes.slice();\n    record.removedNodes = original.removedNodes.slice();\n    record.previousSibling = original.previousSibling;\n    record.nextSibling = original.nextSibling;\n    record.attributeName = original.attributeName;\n    record.attributeNamespace = original.attributeNamespace;\n    record.oldValue = original.oldValue;\n    return record;\n  }\n  var currentRecord, recordWithOldValue;\n  function getRecord(type, target) {\n    return currentRecord = new MutationRecord(type, target);\n  }\n  function getRecordWithOldValue(oldValue) {\n    if (recordWithOldValue) return recordWithOldValue;\n    recordWithOldValue = copyMutationRecord(currentRecord);\n    recordWithOldValue.oldValue = oldValue;\n    return recordWithOldValue;\n  }\n  function clearRecords() {\n    currentRecord = recordWithOldValue = undefined;\n  }\n  function recordRepresentsCurrentMutation(record) {\n    return record === recordWithOldValue || record === currentRecord;\n  }\n  function selectRecord(lastRecord, newRecord) {\n    if (lastRecord === newRecord) return lastRecord;\n    if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;\n    return null;\n  }\n  function Registration(observer, target, options) {\n    this.observer = observer;\n    this.target = target;\n    this.options = options;\n    this.transientObservedNodes = [];\n  }\n  Registration.prototype = {\n    enqueue: function(record) {\n      var records = this.observer.records_;\n      var length = records.length;\n      if (records.length > 0) {\n        var lastRecord = records[length - 1];\n        var recordToReplaceLast = selectRecord(lastRecord, record);\n        if (recordToReplaceLast) {\n          records[length - 1] = recordToReplaceLast;\n          return;\n        }\n      } else {\n        scheduleCallback(this.observer);\n      }\n      records[length] = record;\n    },\n    addListeners: function() {\n      this.addListeners_(this.target);\n    },\n    addListeners_: function(node) {\n      var options = this.options;\n      if (options.attributes) node.addEventListener(\"DOMAttrModified\", this, true);\n      if (options.characterData) node.addEventListener(\"DOMCharacterDataModified\", this, true);\n      if (options.childList) node.addEventListener(\"DOMNodeInserted\", this, true);\n      if (options.childList || options.subtree) node.addEventListener(\"DOMNodeRemoved\", this, true);\n    },\n    removeListeners: function() {\n      this.removeListeners_(this.target);\n    },\n    removeListeners_: function(node) {\n      var options = this.options;\n      if (options.attributes) node.removeEventListener(\"DOMAttrModified\", this, true);\n      if (options.characterData) node.removeEventListener(\"DOMCharacterDataModified\", this, true);\n      if (options.childList) node.removeEventListener(\"DOMNodeInserted\", this, true);\n      if (options.childList || options.subtree) node.removeEventListener(\"DOMNodeRemoved\", this, true);\n    },\n    addTransientObserver: function(node) {\n      if (node === this.target) return;\n      this.addListeners_(node);\n      this.transientObservedNodes.push(node);\n      var registrations = registrationsTable.get(node);\n      if (!registrations) registrationsTable.set(node, registrations = []);\n      registrations.push(this);\n    },\n    removeTransientObservers: function() {\n      var transientObservedNodes = this.transientObservedNodes;\n      this.transientObservedNodes = [];\n      transientObservedNodes.forEach(function(node) {\n        this.removeListeners_(node);\n        var registrations = registrationsTable.get(node);\n        for (var i = 0; i < registrations.length; i++) {\n          if (registrations[i] === this) {\n            registrations.splice(i, 1);\n            break;\n          }\n        }\n      }, this);\n    },\n    handleEvent: function(e) {\n      e.stopImmediatePropagation();\n      switch (e.type) {\n       case \"DOMAttrModified\":\n        var name = e.attrName;\n        var namespace = e.relatedNode.namespaceURI;\n        var target = e.target;\n        var record = new getRecord(\"attributes\", target);\n        record.attributeName = name;\n        record.attributeNamespace = namespace;\n        var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;\n        forEachAncestorAndObserverEnqueueRecord(target, function(options) {\n          if (!options.attributes) return;\n          if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {\n            return;\n          }\n          if (options.attributeOldValue) return getRecordWithOldValue(oldValue);\n          return record;\n        });\n        break;\n\n       case \"DOMCharacterDataModified\":\n        var target = e.target;\n        var record = getRecord(\"characterData\", target);\n        var oldValue = e.prevValue;\n        forEachAncestorAndObserverEnqueueRecord(target, function(options) {\n          if (!options.characterData) return;\n          if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);\n          return record;\n        });\n        break;\n\n       case \"DOMNodeRemoved\":\n        this.addTransientObserver(e.target);\n\n       case \"DOMNodeInserted\":\n        var changedNode = e.target;\n        var addedNodes, removedNodes;\n        if (e.type === \"DOMNodeInserted\") {\n          addedNodes = [ changedNode ];\n          removedNodes = [];\n        } else {\n          addedNodes = [];\n          removedNodes = [ changedNode ];\n        }\n        var previousSibling = changedNode.previousSibling;\n        var nextSibling = changedNode.nextSibling;\n        var record = getRecord(\"childList\", e.target.parentNode);\n        record.addedNodes = addedNodes;\n        record.removedNodes = removedNodes;\n        record.previousSibling = previousSibling;\n        record.nextSibling = nextSibling;\n        forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {\n          if (!options.childList) return;\n          return record;\n        });\n      }\n      clearRecords();\n    }\n  };\n  global.JsMutationObserver = JsMutationObserver;\n  if (!global.MutationObserver) {\n    global.MutationObserver = JsMutationObserver;\n    JsMutationObserver._isPolyfilled = true;\n  }\n})(self);\n\n(function() {\n  var needsTemplate = typeof HTMLTemplateElement === \"undefined\";\n  if (/Trident/.test(navigator.userAgent)) {\n    (function() {\n      var importNode = document.importNode;\n      document.importNode = function() {\n        var n = importNode.apply(document, arguments);\n        if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n          var f = document.createDocumentFragment();\n          f.appendChild(n);\n          return f;\n        } else {\n          return n;\n        }\n      };\n    })();\n  }\n  var needsCloning = function() {\n    if (!needsTemplate) {\n      var t = document.createElement(\"template\");\n      var t2 = document.createElement(\"template\");\n      t2.content.appendChild(document.createElement(\"div\"));\n      t.content.appendChild(t2);\n      var clone = t.cloneNode(true);\n      return clone.content.childNodes.length === 0 || clone.content.firstChild.content.childNodes.length === 0;\n    }\n  }();\n  var TEMPLATE_TAG = \"template\";\n  var TemplateImpl = function() {};\n  if (needsTemplate) {\n    var contentDoc = document.implementation.createHTMLDocument(\"template\");\n    var canDecorate = true;\n    var templateStyle = document.createElement(\"style\");\n    templateStyle.textContent = TEMPLATE_TAG + \"{display:none;}\";\n    var head = document.head;\n    head.insertBefore(templateStyle, head.firstElementChild);\n    TemplateImpl.prototype = Object.create(HTMLElement.prototype);\n    TemplateImpl.decorate = function(template) {\n      if (template.content) {\n        return;\n      }\n      template.content = contentDoc.createDocumentFragment();\n      var child;\n      while (child = template.firstChild) {\n        template.content.appendChild(child);\n      }\n      template.cloneNode = function(deep) {\n        return TemplateImpl.cloneNode(this, deep);\n      };\n      if (canDecorate) {\n        try {\n          Object.defineProperty(template, \"innerHTML\", {\n            get: function() {\n              var o = \"\";\n              for (var e = this.content.firstChild; e; e = e.nextSibling) {\n                o += e.outerHTML || escapeData(e.data);\n              }\n              return o;\n            },\n            set: function(text) {\n              contentDoc.body.innerHTML = text;\n              TemplateImpl.bootstrap(contentDoc);\n              while (this.content.firstChild) {\n                this.content.removeChild(this.content.firstChild);\n              }\n              while (contentDoc.body.firstChild) {\n                this.content.appendChild(contentDoc.body.firstChild);\n              }\n            },\n            configurable: true\n          });\n        } catch (err) {\n          canDecorate = false;\n        }\n      }\n      TemplateImpl.bootstrap(template.content);\n    };\n    TemplateImpl.bootstrap = function(doc) {\n      var templates = doc.querySelectorAll(TEMPLATE_TAG);\n      for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {\n        TemplateImpl.decorate(t);\n      }\n    };\n    document.addEventListener(\"DOMContentLoaded\", function() {\n      TemplateImpl.bootstrap(document);\n    });\n    var createElement = document.createElement;\n    document.createElement = function() {\n      \"use strict\";\n      var el = createElement.apply(document, arguments);\n      if (el.localName === \"template\") {\n        TemplateImpl.decorate(el);\n      }\n      return el;\n    };\n    var escapeDataRegExp = /[&\\u00A0<>]/g;\n    function escapeReplace(c) {\n      switch (c) {\n       case \"&\":\n        return \"&amp;\";\n\n       case \"<\":\n        return \"&lt;\";\n\n       case \">\":\n        return \"&gt;\";\n\n       case \" \":\n        return \"&nbsp;\";\n      }\n    }\n    function escapeData(s) {\n      return s.replace(escapeDataRegExp, escapeReplace);\n    }\n  }\n  if (needsTemplate || needsCloning) {\n    var nativeCloneNode = Node.prototype.cloneNode;\n    TemplateImpl.cloneNode = function(template, deep) {\n      var clone = nativeCloneNode.call(template, false);\n      if (this.decorate) {\n        this.decorate(clone);\n      }\n      if (deep) {\n        clone.content.appendChild(nativeCloneNode.call(template.content, true));\n        this.fixClonedDom(clone.content, template.content);\n      }\n      return clone;\n    };\n    TemplateImpl.fixClonedDom = function(clone, source) {\n      if (!source.querySelectorAll) return;\n      var s$ = source.querySelectorAll(TEMPLATE_TAG);\n      var t$ = clone.querySelectorAll(TEMPLATE_TAG);\n      for (var i = 0, l = t$.length, t, s; i < l; i++) {\n        s = s$[i];\n        t = t$[i];\n        if (this.decorate) {\n          this.decorate(s);\n        }\n        t.parentNode.replaceChild(s.cloneNode(true), t);\n      }\n    };\n    var originalImportNode = document.importNode;\n    Node.prototype.cloneNode = function(deep) {\n      var dom = nativeCloneNode.call(this, deep);\n      if (deep) {\n        TemplateImpl.fixClonedDom(dom, this);\n      }\n      return dom;\n    };\n    document.importNode = function(element, deep) {\n      if (element.localName === TEMPLATE_TAG) {\n        return TemplateImpl.cloneNode(element, deep);\n      } else {\n        var dom = originalImportNode.call(document, element, deep);\n        if (deep) {\n          TemplateImpl.fixClonedDom(dom, element);\n        }\n        return dom;\n      }\n    };\n    if (needsCloning) {\n      HTMLTemplateElement.prototype.cloneNode = function(deep) {\n        return TemplateImpl.cloneNode(this, deep);\n      };\n    }\n  }\n  if (needsTemplate) {\n    window.HTMLTemplateElement = TemplateImpl;\n  }\n})();\n\n(function(scope) {\n  \"use strict\";\n  if (!(window.performance && window.performance.now)) {\n    var start = Date.now();\n    window.performance = {\n      now: function() {\n        return Date.now() - start;\n      }\n    };\n  }\n  if (!window.requestAnimationFrame) {\n    window.requestAnimationFrame = function() {\n      var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n      return nativeRaf ? function(callback) {\n        return nativeRaf(function() {\n          callback(performance.now());\n        });\n      } : function(callback) {\n        return window.setTimeout(callback, 1e3 / 60);\n      };\n    }();\n  }\n  if (!window.cancelAnimationFrame) {\n    window.cancelAnimationFrame = function() {\n      return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {\n        clearTimeout(id);\n      };\n    }();\n  }\n  var workingDefaultPrevented = function() {\n    var e = document.createEvent(\"Event\");\n    e.initEvent(\"foo\", true, true);\n    e.preventDefault();\n    return e.defaultPrevented;\n  }();\n  if (!workingDefaultPrevented) {\n    var origPreventDefault = Event.prototype.preventDefault;\n    Event.prototype.preventDefault = function() {\n      if (!this.cancelable) {\n        return;\n      }\n      origPreventDefault.call(this);\n      Object.defineProperty(this, \"defaultPrevented\", {\n        get: function() {\n          return true;\n        },\n        configurable: true\n      });\n    };\n  }\n  var isIE = /Trident/.test(navigator.userAgent);\n  if (!window.CustomEvent || isIE && typeof window.CustomEvent !== \"function\") {\n    window.CustomEvent = function(inType, params) {\n      params = params || {};\n      var e = document.createEvent(\"CustomEvent\");\n      e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);\n      return e;\n    };\n    window.CustomEvent.prototype = window.Event.prototype;\n  }\n  if (!window.Event || isIE && typeof window.Event !== \"function\") {\n    var origEvent = window.Event;\n    window.Event = function(inType, params) {\n      params = params || {};\n      var e = document.createEvent(\"Event\");\n      e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n      return e;\n    };\n    window.Event.prototype = origEvent.prototype;\n  }\n})(window.WebComponents);\n\nwindow.HTMLImports = window.HTMLImports || {\n  flags: {}\n};\n\n(function(scope) {\n  var IMPORT_LINK_TYPE = \"import\";\n  var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement(\"link\"));\n  var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);\n  var wrap = function(node) {\n    return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;\n  };\n  var rootDocument = wrap(document);\n  var currentScriptDescriptor = {\n    get: function() {\n      var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== \"complete\" ? document.scripts[document.scripts.length - 1] : null);\n      return wrap(script);\n    },\n    configurable: true\n  };\n  Object.defineProperty(document, \"_currentScript\", currentScriptDescriptor);\n  Object.defineProperty(rootDocument, \"_currentScript\", currentScriptDescriptor);\n  var isIE = /Trident/.test(navigator.userAgent);\n  function whenReady(callback, doc) {\n    doc = doc || rootDocument;\n    whenDocumentReady(function() {\n      watchImportsLoad(callback, doc);\n    }, doc);\n  }\n  var requiredReadyState = isIE ? \"complete\" : \"interactive\";\n  var READY_EVENT = \"readystatechange\";\n  function isDocumentReady(doc) {\n    return doc.readyState === \"complete\" || doc.readyState === requiredReadyState;\n  }\n  function whenDocumentReady(callback, doc) {\n    if (!isDocumentReady(doc)) {\n      var checkReady = function() {\n        if (doc.readyState === \"complete\" || doc.readyState === requiredReadyState) {\n          doc.removeEventListener(READY_EVENT, checkReady);\n          whenDocumentReady(callback, doc);\n        }\n      };\n      doc.addEventListener(READY_EVENT, checkReady);\n    } else if (callback) {\n      callback();\n    }\n  }\n  function markTargetLoaded(event) {\n    event.target.__loaded = true;\n  }\n  function watchImportsLoad(callback, doc) {\n    var imports = doc.querySelectorAll(\"link[rel=import]\");\n    var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = [];\n    function checkDone() {\n      if (parsedCount == importCount && callback) {\n        callback({\n          allImports: imports,\n          loadedImports: newImports,\n          errorImports: errorImports\n        });\n      }\n    }\n    function loadedImport(e) {\n      markTargetLoaded(e);\n      newImports.push(this);\n      parsedCount++;\n      checkDone();\n    }\n    function errorLoadingImport(e) {\n      errorImports.push(this);\n      parsedCount++;\n      checkDone();\n    }\n    if (importCount) {\n      for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) {\n        if (isImportLoaded(imp)) {\n          newImports.push(this);\n          parsedCount++;\n          checkDone();\n        } else {\n          imp.addEventListener(\"load\", loadedImport);\n          imp.addEventListener(\"error\", errorLoadingImport);\n        }\n      }\n    } else {\n      checkDone();\n    }\n  }\n  function isImportLoaded(link) {\n    return useNative ? link.__loaded || link.import && link.import.readyState !== \"loading\" : link.__importParsed;\n  }\n  if (useNative) {\n    new MutationObserver(function(mxns) {\n      for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {\n        if (m.addedNodes) {\n          handleImports(m.addedNodes);\n        }\n      }\n    }).observe(document.head, {\n      childList: true\n    });\n    function handleImports(nodes) {\n      for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n        if (isImport(n)) {\n          handleImport(n);\n        }\n      }\n    }\n    function isImport(element) {\n      return element.localName === \"link\" && element.rel === \"import\";\n    }\n    function handleImport(element) {\n      var loaded = element.import;\n      if (loaded) {\n        markTargetLoaded({\n          target: element\n        });\n      } else {\n        element.addEventListener(\"load\", markTargetLoaded);\n        element.addEventListener(\"error\", markTargetLoaded);\n      }\n    }\n    (function() {\n      if (document.readyState === \"loading\") {\n        var imports = document.querySelectorAll(\"link[rel=import]\");\n        for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {\n          handleImport(imp);\n        }\n      }\n    })();\n  }\n  whenReady(function(detail) {\n    window.HTMLImports.ready = true;\n    window.HTMLImports.readyTime = new Date().getTime();\n    var evt = rootDocument.createEvent(\"CustomEvent\");\n    evt.initCustomEvent(\"HTMLImportsLoaded\", true, true, detail);\n    rootDocument.dispatchEvent(evt);\n  });\n  scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\n  scope.useNative = useNative;\n  scope.rootDocument = rootDocument;\n  scope.whenReady = whenReady;\n  scope.isIE = isIE;\n})(window.HTMLImports);\n\n(function(scope) {\n  var modules = [];\n  var addModule = function(module) {\n    modules.push(module);\n  };\n  var initializeModules = function() {\n    modules.forEach(function(module) {\n      module(scope);\n    });\n  };\n  scope.addModule = addModule;\n  scope.initializeModules = initializeModules;\n})(window.HTMLImports);\n\nwindow.HTMLImports.addModule(function(scope) {\n  var CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n  var CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n  var path = {\n    resolveUrlsInStyle: function(style, linkUrl) {\n      var doc = style.ownerDocument;\n      var resolver = doc.createElement(\"a\");\n      style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver);\n      return style;\n    },\n    resolveUrlsInCssText: function(cssText, linkUrl, urlObj) {\n      var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP);\n      r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP);\n      return r;\n    },\n    replaceUrls: function(text, urlObj, linkUrl, regexp) {\n      return text.replace(regexp, function(m, pre, url, post) {\n        var urlPath = url.replace(/[\"']/g, \"\");\n        if (linkUrl) {\n          urlPath = new URL(urlPath, linkUrl).href;\n        }\n        urlObj.href = urlPath;\n        urlPath = urlObj.href;\n        return pre + \"'\" + urlPath + \"'\" + post;\n      });\n    }\n  };\n  scope.path = path;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var xhr = {\n    async: true,\n    ok: function(request) {\n      return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;\n    },\n    load: function(url, next, nextContext) {\n      var request = new XMLHttpRequest();\n      if (scope.flags.debug || scope.flags.bust) {\n        url += \"?\" + Math.random();\n      }\n      request.open(\"GET\", url, xhr.async);\n      request.addEventListener(\"readystatechange\", function(e) {\n        if (request.readyState === 4) {\n          var redirectedUrl = null;\n          try {\n            var locationHeader = request.getResponseHeader(\"Location\");\n            if (locationHeader) {\n              redirectedUrl = locationHeader.substr(0, 1) === \"/\" ? location.origin + locationHeader : locationHeader;\n            }\n          } catch (e) {\n            console.error(e.message);\n          }\n          next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);\n        }\n      });\n      request.send();\n      return request;\n    },\n    loadDocument: function(url, next, nextContext) {\n      this.load(url, next, nextContext).responseType = \"document\";\n    }\n  };\n  scope.xhr = xhr;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var xhr = scope.xhr;\n  var flags = scope.flags;\n  var Loader = function(onLoad, onComplete) {\n    this.cache = {};\n    this.onload = onLoad;\n    this.oncomplete = onComplete;\n    this.inflight = 0;\n    this.pending = {};\n  };\n  Loader.prototype = {\n    addNodes: function(nodes) {\n      this.inflight += nodes.length;\n      for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n        this.require(n);\n      }\n      this.checkDone();\n    },\n    addNode: function(node) {\n      this.inflight++;\n      this.require(node);\n      this.checkDone();\n    },\n    require: function(elt) {\n      var url = elt.src || elt.href;\n      elt.__nodeUrl = url;\n      if (!this.dedupe(url, elt)) {\n        this.fetch(url, elt);\n      }\n    },\n    dedupe: function(url, elt) {\n      if (this.pending[url]) {\n        this.pending[url].push(elt);\n        return true;\n      }\n      var resource;\n      if (this.cache[url]) {\n        this.onload(url, elt, this.cache[url]);\n        this.tail();\n        return true;\n      }\n      this.pending[url] = [ elt ];\n      return false;\n    },\n    fetch: function(url, elt) {\n      flags.load && console.log(\"fetch\", url, elt);\n      if (!url) {\n        setTimeout(function() {\n          this.receive(url, elt, {\n            error: \"href must be specified\"\n          }, null);\n        }.bind(this), 0);\n      } else if (url.match(/^data:/)) {\n        var pieces = url.split(\",\");\n        var header = pieces[0];\n        var body = pieces[1];\n        if (header.indexOf(\";base64\") > -1) {\n          body = atob(body);\n        } else {\n          body = decodeURIComponent(body);\n        }\n        setTimeout(function() {\n          this.receive(url, elt, null, body);\n        }.bind(this), 0);\n      } else {\n        var receiveXhr = function(err, resource, redirectedUrl) {\n          this.receive(url, elt, err, resource, redirectedUrl);\n        }.bind(this);\n        xhr.load(url, receiveXhr);\n      }\n    },\n    receive: function(url, elt, err, resource, redirectedUrl) {\n      this.cache[url] = resource;\n      var $p = this.pending[url];\n      for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {\n        this.onload(url, p, resource, err, redirectedUrl);\n        this.tail();\n      }\n      this.pending[url] = null;\n    },\n    tail: function() {\n      --this.inflight;\n      this.checkDone();\n    },\n    checkDone: function() {\n      if (!this.inflight) {\n        this.oncomplete();\n      }\n    }\n  };\n  scope.Loader = Loader;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var Observer = function(addCallback) {\n    this.addCallback = addCallback;\n    this.mo = new MutationObserver(this.handler.bind(this));\n  };\n  Observer.prototype = {\n    handler: function(mutations) {\n      for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {\n        if (m.type === \"childList\" && m.addedNodes.length) {\n          this.addedNodes(m.addedNodes);\n        }\n      }\n    },\n    addedNodes: function(nodes) {\n      if (this.addCallback) {\n        this.addCallback(nodes);\n      }\n      for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {\n        if (n.children && n.children.length) {\n          this.addedNodes(n.children);\n        }\n      }\n    },\n    observe: function(root) {\n      this.mo.observe(root, {\n        childList: true,\n        subtree: true\n      });\n    }\n  };\n  scope.Observer = Observer;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var path = scope.path;\n  var rootDocument = scope.rootDocument;\n  var flags = scope.flags;\n  var isIE = scope.isIE;\n  var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n  var IMPORT_SELECTOR = \"link[rel=\" + IMPORT_LINK_TYPE + \"]\";\n  var importParser = {\n    documentSelectors: IMPORT_SELECTOR,\n    importsSelectors: [ IMPORT_SELECTOR, \"link[rel=stylesheet]:not([type])\", \"style:not([type])\", \"script:not([type])\", 'script[type=\"application/javascript\"]', 'script[type=\"text/javascript\"]' ].join(\",\"),\n    map: {\n      link: \"parseLink\",\n      script: \"parseScript\",\n      style: \"parseStyle\"\n    },\n    dynamicElements: [],\n    parseNext: function() {\n      var next = this.nextToParse();\n      if (next) {\n        this.parse(next);\n      }\n    },\n    parse: function(elt) {\n      if (this.isParsed(elt)) {\n        flags.parse && console.log(\"[%s] is already parsed\", elt.localName);\n        return;\n      }\n      var fn = this[this.map[elt.localName]];\n      if (fn) {\n        this.markParsing(elt);\n        fn.call(this, elt);\n      }\n    },\n    parseDynamic: function(elt, quiet) {\n      this.dynamicElements.push(elt);\n      if (!quiet) {\n        this.parseNext();\n      }\n    },\n    markParsing: function(elt) {\n      flags.parse && console.log(\"parsing\", elt);\n      this.parsingElement = elt;\n    },\n    markParsingComplete: function(elt) {\n      elt.__importParsed = true;\n      this.markDynamicParsingComplete(elt);\n      if (elt.__importElement) {\n        elt.__importElement.__importParsed = true;\n        this.markDynamicParsingComplete(elt.__importElement);\n      }\n      this.parsingElement = null;\n      flags.parse && console.log(\"completed\", elt);\n    },\n    markDynamicParsingComplete: function(elt) {\n      var i = this.dynamicElements.indexOf(elt);\n      if (i >= 0) {\n        this.dynamicElements.splice(i, 1);\n      }\n    },\n    parseImport: function(elt) {\n      elt.import = elt.__doc;\n      if (window.HTMLImports.__importsParsingHook) {\n        window.HTMLImports.__importsParsingHook(elt);\n      }\n      if (elt.import) {\n        elt.import.__importParsed = true;\n      }\n      this.markParsingComplete(elt);\n      if (elt.__resource && !elt.__error) {\n        elt.dispatchEvent(new CustomEvent(\"load\", {\n          bubbles: false\n        }));\n      } else {\n        elt.dispatchEvent(new CustomEvent(\"error\", {\n          bubbles: false\n        }));\n      }\n      if (elt.__pending) {\n        var fn;\n        while (elt.__pending.length) {\n          fn = elt.__pending.shift();\n          if (fn) {\n            fn({\n              target: elt\n            });\n          }\n        }\n      }\n      this.parseNext();\n    },\n    parseLink: function(linkElt) {\n      if (nodeIsImport(linkElt)) {\n        this.parseImport(linkElt);\n      } else {\n        linkElt.href = linkElt.href;\n        this.parseGeneric(linkElt);\n      }\n    },\n    parseStyle: function(elt) {\n      var src = elt;\n      elt = cloneStyle(elt);\n      src.__appliedElement = elt;\n      elt.__importElement = src;\n      this.parseGeneric(elt);\n    },\n    parseGeneric: function(elt) {\n      this.trackElement(elt);\n      this.addElementToDocument(elt);\n    },\n    rootImportForElement: function(elt) {\n      var n = elt;\n      while (n.ownerDocument.__importLink) {\n        n = n.ownerDocument.__importLink;\n      }\n      return n;\n    },\n    addElementToDocument: function(elt) {\n      var port = this.rootImportForElement(elt.__importElement || elt);\n      port.parentNode.insertBefore(elt, port);\n    },\n    trackElement: function(elt, callback) {\n      var self = this;\n      var done = function(e) {\n        elt.removeEventListener(\"load\", done);\n        elt.removeEventListener(\"error\", done);\n        if (callback) {\n          callback(e);\n        }\n        self.markParsingComplete(elt);\n        self.parseNext();\n      };\n      elt.addEventListener(\"load\", done);\n      elt.addEventListener(\"error\", done);\n      if (isIE && elt.localName === \"style\") {\n        var fakeLoad = false;\n        if (elt.textContent.indexOf(\"@import\") == -1) {\n          fakeLoad = true;\n        } else if (elt.sheet) {\n          fakeLoad = true;\n          var csr = elt.sheet.cssRules;\n          var len = csr ? csr.length : 0;\n          for (var i = 0, r; i < len && (r = csr[i]); i++) {\n            if (r.type === CSSRule.IMPORT_RULE) {\n              fakeLoad = fakeLoad && Boolean(r.styleSheet);\n            }\n          }\n        }\n        if (fakeLoad) {\n          setTimeout(function() {\n            elt.dispatchEvent(new CustomEvent(\"load\", {\n              bubbles: false\n            }));\n          });\n        }\n      }\n    },\n    parseScript: function(scriptElt) {\n      var script = document.createElement(\"script\");\n      script.__importElement = scriptElt;\n      script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);\n      scope.currentScript = scriptElt;\n      this.trackElement(script, function(e) {\n        if (script.parentNode) {\n          script.parentNode.removeChild(script);\n        }\n        scope.currentScript = null;\n      });\n      this.addElementToDocument(script);\n    },\n    nextToParse: function() {\n      this._mayParse = [];\n      return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());\n    },\n    nextToParseInDoc: function(doc, link) {\n      if (doc && this._mayParse.indexOf(doc) < 0) {\n        this._mayParse.push(doc);\n        var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));\n        for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n          if (!this.isParsed(n)) {\n            if (this.hasResource(n)) {\n              return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;\n            } else {\n              return;\n            }\n          }\n        }\n      }\n      return link;\n    },\n    nextToParseDynamic: function() {\n      return this.dynamicElements[0];\n    },\n    parseSelectorsForNode: function(node) {\n      var doc = node.ownerDocument || node;\n      return doc === rootDocument ? this.documentSelectors : this.importsSelectors;\n    },\n    isParsed: function(node) {\n      return node.__importParsed;\n    },\n    needsDynamicParsing: function(elt) {\n      return this.dynamicElements.indexOf(elt) >= 0;\n    },\n    hasResource: function(node) {\n      if (nodeIsImport(node) && node.__doc === undefined) {\n        return false;\n      }\n      return true;\n    }\n  };\n  function nodeIsImport(elt) {\n    return elt.localName === \"link\" && elt.rel === IMPORT_LINK_TYPE;\n  }\n  function generateScriptDataUrl(script) {\n    var scriptContent = generateScriptContent(script);\n    return \"data:text/javascript;charset=utf-8,\" + encodeURIComponent(scriptContent);\n  }\n  function generateScriptContent(script) {\n    return script.textContent + generateSourceMapHint(script);\n  }\n  function generateSourceMapHint(script) {\n    var owner = script.ownerDocument;\n    owner.__importedScripts = owner.__importedScripts || 0;\n    var moniker = script.ownerDocument.baseURI;\n    var num = owner.__importedScripts ? \"-\" + owner.__importedScripts : \"\";\n    owner.__importedScripts++;\n    return \"\\n//# sourceURL=\" + moniker + num + \".js\\n\";\n  }\n  function cloneStyle(style) {\n    var clone = style.ownerDocument.createElement(\"style\");\n    clone.textContent = style.textContent;\n    path.resolveUrlsInStyle(clone);\n    return clone;\n  }\n  scope.parser = importParser;\n  scope.IMPORT_SELECTOR = IMPORT_SELECTOR;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var flags = scope.flags;\n  var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n  var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;\n  var rootDocument = scope.rootDocument;\n  var Loader = scope.Loader;\n  var Observer = scope.Observer;\n  var parser = scope.parser;\n  var importer = {\n    documents: {},\n    documentPreloadSelectors: IMPORT_SELECTOR,\n    importsPreloadSelectors: [ IMPORT_SELECTOR ].join(\",\"),\n    loadNode: function(node) {\n      importLoader.addNode(node);\n    },\n    loadSubtree: function(parent) {\n      var nodes = this.marshalNodes(parent);\n      importLoader.addNodes(nodes);\n    },\n    marshalNodes: function(parent) {\n      return parent.querySelectorAll(this.loadSelectorsForNode(parent));\n    },\n    loadSelectorsForNode: function(node) {\n      var doc = node.ownerDocument || node;\n      return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;\n    },\n    loaded: function(url, elt, resource, err, redirectedUrl) {\n      flags.load && console.log(\"loaded\", url, elt);\n      elt.__resource = resource;\n      elt.__error = err;\n      if (isImportLink(elt)) {\n        var doc = this.documents[url];\n        if (doc === undefined) {\n          doc = err ? null : makeDocument(resource, redirectedUrl || url);\n          if (doc) {\n            doc.__importLink = elt;\n            this.bootDocument(doc);\n          }\n          this.documents[url] = doc;\n        }\n        elt.__doc = doc;\n      }\n      parser.parseNext();\n    },\n    bootDocument: function(doc) {\n      this.loadSubtree(doc);\n      this.observer.observe(doc);\n      parser.parseNext();\n    },\n    loadedAll: function() {\n      parser.parseNext();\n    }\n  };\n  var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));\n  importer.observer = new Observer();\n  function isImportLink(elt) {\n    return isLinkRel(elt, IMPORT_LINK_TYPE);\n  }\n  function isLinkRel(elt, rel) {\n    return elt.localName === \"link\" && elt.getAttribute(\"rel\") === rel;\n  }\n  function hasBaseURIAccessor(doc) {\n    return !!Object.getOwnPropertyDescriptor(doc, \"baseURI\");\n  }\n  function makeDocument(resource, url) {\n    var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);\n    doc._URL = url;\n    var base = doc.createElement(\"base\");\n    base.setAttribute(\"href\", url);\n    if (!doc.baseURI && !hasBaseURIAccessor(doc)) {\n      Object.defineProperty(doc, \"baseURI\", {\n        value: url\n      });\n    }\n    var meta = doc.createElement(\"meta\");\n    meta.setAttribute(\"charset\", \"utf-8\");\n    doc.head.appendChild(meta);\n    doc.head.appendChild(base);\n    doc.body.innerHTML = resource;\n    if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n      HTMLTemplateElement.bootstrap(doc);\n    }\n    return doc;\n  }\n  if (!document.baseURI) {\n    var baseURIDescriptor = {\n      get: function() {\n        var base = document.querySelector(\"base\");\n        return base ? base.href : window.location.href;\n      },\n      configurable: true\n    };\n    Object.defineProperty(document, \"baseURI\", baseURIDescriptor);\n    Object.defineProperty(rootDocument, \"baseURI\", baseURIDescriptor);\n  }\n  scope.importer = importer;\n  scope.importLoader = importLoader;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n  var parser = scope.parser;\n  var importer = scope.importer;\n  var dynamic = {\n    added: function(nodes) {\n      var owner, parsed, loading;\n      for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n        if (!owner) {\n          owner = n.ownerDocument;\n          parsed = parser.isParsed(owner);\n        }\n        loading = this.shouldLoadNode(n);\n        if (loading) {\n          importer.loadNode(n);\n        }\n        if (this.shouldParseNode(n) && parsed) {\n          parser.parseDynamic(n, loading);\n        }\n      }\n    },\n    shouldLoadNode: function(node) {\n      return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));\n    },\n    shouldParseNode: function(node) {\n      return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));\n    }\n  };\n  importer.observer.addCallback = dynamic.added.bind(dynamic);\n  var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;\n});\n\n(function(scope) {\n  var initializeModules = scope.initializeModules;\n  var isIE = scope.isIE;\n  if (scope.useNative) {\n    return;\n  }\n  initializeModules();\n  var rootDocument = scope.rootDocument;\n  function bootstrap() {\n    window.HTMLImports.importer.bootDocument(rootDocument);\n  }\n  if (document.readyState === \"complete\" || document.readyState === \"interactive\" && !window.attachEvent) {\n    bootstrap();\n  } else {\n    document.addEventListener(\"DOMContentLoaded\", bootstrap);\n  }\n})(window.HTMLImports);\n\nwindow.CustomElements = window.CustomElements || {\n  flags: {}\n};\n\n(function(scope) {\n  var flags = scope.flags;\n  var modules = [];\n  var addModule = function(module) {\n    modules.push(module);\n  };\n  var initializeModules = function() {\n    modules.forEach(function(module) {\n      module(scope);\n    });\n  };\n  scope.addModule = addModule;\n  scope.initializeModules = initializeModules;\n  scope.hasNative = Boolean(document.registerElement);\n  scope.isIE = /Trident/.test(navigator.userAgent);\n  scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);\n})(window.CustomElements);\n\nwindow.CustomElements.addModule(function(scope) {\n  var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : \"none\";\n  function forSubtree(node, cb) {\n    findAllElements(node, function(e) {\n      if (cb(e)) {\n        return true;\n      }\n      forRoots(e, cb);\n    });\n    forRoots(node, cb);\n  }\n  function findAllElements(node, find, data) {\n    var e = node.firstElementChild;\n    if (!e) {\n      e = node.firstChild;\n      while (e && e.nodeType !== Node.ELEMENT_NODE) {\n        e = e.nextSibling;\n      }\n    }\n    while (e) {\n      if (find(e, data) !== true) {\n        findAllElements(e, find, data);\n      }\n      e = e.nextElementSibling;\n    }\n    return null;\n  }\n  function forRoots(node, cb) {\n    var root = node.shadowRoot;\n    while (root) {\n      forSubtree(root, cb);\n      root = root.olderShadowRoot;\n    }\n  }\n  function forDocumentTree(doc, cb) {\n    _forDocumentTree(doc, cb, []);\n  }\n  function _forDocumentTree(doc, cb, processingDocuments) {\n    doc = window.wrap(doc);\n    if (processingDocuments.indexOf(doc) >= 0) {\n      return;\n    }\n    processingDocuments.push(doc);\n    var imports = doc.querySelectorAll(\"link[rel=\" + IMPORT_LINK_TYPE + \"]\");\n    for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {\n      if (n.import) {\n        _forDocumentTree(n.import, cb, processingDocuments);\n      }\n    }\n    cb(doc);\n  }\n  scope.forDocumentTree = forDocumentTree;\n  scope.forSubtree = forSubtree;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n  var flags = scope.flags;\n  var forSubtree = scope.forSubtree;\n  var forDocumentTree = scope.forDocumentTree;\n  function addedNode(node, isAttached) {\n    return added(node, isAttached) || addedSubtree(node, isAttached);\n  }\n  function added(node, isAttached) {\n    if (scope.upgrade(node, isAttached)) {\n      return true;\n    }\n    if (isAttached) {\n      attached(node);\n    }\n  }\n  function addedSubtree(node, isAttached) {\n    forSubtree(node, function(e) {\n      if (added(e, isAttached)) {\n        return true;\n      }\n    });\n  }\n  var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags[\"throttle-attached\"];\n  scope.hasPolyfillMutations = hasThrottledAttached;\n  scope.hasThrottledAttached = hasThrottledAttached;\n  var isPendingMutations = false;\n  var pendingMutations = [];\n  function deferMutation(fn) {\n    pendingMutations.push(fn);\n    if (!isPendingMutations) {\n      isPendingMutations = true;\n      setTimeout(takeMutations);\n    }\n  }\n  function takeMutations() {\n    isPendingMutations = false;\n    var $p = pendingMutations;\n    for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {\n      p();\n    }\n    pendingMutations = [];\n  }\n  function attached(element) {\n    if (hasThrottledAttached) {\n      deferMutation(function() {\n        _attached(element);\n      });\n    } else {\n      _attached(element);\n    }\n  }\n  function _attached(element) {\n    if (element.__upgraded__ && !element.__attached) {\n      element.__attached = true;\n      if (element.attachedCallback) {\n        element.attachedCallback();\n      }\n    }\n  }\n  function detachedNode(node) {\n    detached(node);\n    forSubtree(node, function(e) {\n      detached(e);\n    });\n  }\n  function detached(element) {\n    if (hasThrottledAttached) {\n      deferMutation(function() {\n        _detached(element);\n      });\n    } else {\n      _detached(element);\n    }\n  }\n  function _detached(element) {\n    if (element.__upgraded__ && element.__attached) {\n      element.__attached = false;\n      if (element.detachedCallback) {\n        element.detachedCallback();\n      }\n    }\n  }\n  function inDocument(element) {\n    var p = element;\n    var doc = window.wrap(document);\n    while (p) {\n      if (p == doc) {\n        return true;\n      }\n      p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;\n    }\n  }\n  function watchShadow(node) {\n    if (node.shadowRoot && !node.shadowRoot.__watched) {\n      flags.dom && console.log(\"watching shadow-root for: \", node.localName);\n      var root = node.shadowRoot;\n      while (root) {\n        observe(root);\n        root = root.olderShadowRoot;\n      }\n    }\n  }\n  function handler(root, mutations) {\n    if (flags.dom) {\n      var mx = mutations[0];\n      if (mx && mx.type === \"childList\" && mx.addedNodes) {\n        if (mx.addedNodes) {\n          var d = mx.addedNodes[0];\n          while (d && d !== document && !d.host) {\n            d = d.parentNode;\n          }\n          var u = d && (d.URL || d._URL || d.host && d.host.localName) || \"\";\n          u = u.split(\"/?\").shift().split(\"/\").pop();\n        }\n      }\n      console.group(\"mutations (%d) [%s]\", mutations.length, u || \"\");\n    }\n    var isAttached = inDocument(root);\n    mutations.forEach(function(mx) {\n      if (mx.type === \"childList\") {\n        forEach(mx.addedNodes, function(n) {\n          if (!n.localName) {\n            return;\n          }\n          addedNode(n, isAttached);\n        });\n        forEach(mx.removedNodes, function(n) {\n          if (!n.localName) {\n            return;\n          }\n          detachedNode(n);\n        });\n      }\n    });\n    flags.dom && console.groupEnd();\n  }\n  function takeRecords(node) {\n    node = window.wrap(node);\n    if (!node) {\n      node = window.wrap(document);\n    }\n    while (node.parentNode) {\n      node = node.parentNode;\n    }\n    var observer = node.__observer;\n    if (observer) {\n      handler(node, observer.takeRecords());\n      takeMutations();\n    }\n  }\n  var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);\n  function observe(inRoot) {\n    if (inRoot.__observer) {\n      return;\n    }\n    var observer = new MutationObserver(handler.bind(this, inRoot));\n    observer.observe(inRoot, {\n      childList: true,\n      subtree: true\n    });\n    inRoot.__observer = observer;\n  }\n  function upgradeDocument(doc) {\n    doc = window.wrap(doc);\n    flags.dom && console.group(\"upgradeDocument: \", doc.baseURI.split(\"/\").pop());\n    var isMainDocument = doc === window.wrap(document);\n    addedNode(doc, isMainDocument);\n    observe(doc);\n    flags.dom && console.groupEnd();\n  }\n  function upgradeDocumentTree(doc) {\n    forDocumentTree(doc, upgradeDocument);\n  }\n  var originalCreateShadowRoot = Element.prototype.createShadowRoot;\n  if (originalCreateShadowRoot) {\n    Element.prototype.createShadowRoot = function() {\n      var root = originalCreateShadowRoot.call(this);\n      window.CustomElements.watchShadow(this);\n      return root;\n    };\n  }\n  scope.watchShadow = watchShadow;\n  scope.upgradeDocumentTree = upgradeDocumentTree;\n  scope.upgradeDocument = upgradeDocument;\n  scope.upgradeSubtree = addedSubtree;\n  scope.upgradeAll = addedNode;\n  scope.attached = attached;\n  scope.takeRecords = takeRecords;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n  var flags = scope.flags;\n  function upgrade(node, isAttached) {\n    if (node.localName === \"template\") {\n      if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {\n        HTMLTemplateElement.decorate(node);\n      }\n    }\n    if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {\n      var is = node.getAttribute(\"is\");\n      var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);\n      if (definition) {\n        if (is && definition.tag == node.localName || !is && !definition.extends) {\n          return upgradeWithDefinition(node, definition, isAttached);\n        }\n      }\n    }\n  }\n  function upgradeWithDefinition(element, definition, isAttached) {\n    flags.upgrade && console.group(\"upgrade:\", element.localName);\n    if (definition.is) {\n      element.setAttribute(\"is\", definition.is);\n    }\n    implementPrototype(element, definition);\n    element.__upgraded__ = true;\n    created(element);\n    if (isAttached) {\n      scope.attached(element);\n    }\n    scope.upgradeSubtree(element, isAttached);\n    flags.upgrade && console.groupEnd();\n    return element;\n  }\n  function implementPrototype(element, definition) {\n    if (Object.__proto__) {\n      element.__proto__ = definition.prototype;\n    } else {\n      customMixin(element, definition.prototype, definition.native);\n      element.__proto__ = definition.prototype;\n    }\n  }\n  function customMixin(inTarget, inSrc, inNative) {\n    var used = {};\n    var p = inSrc;\n    while (p !== inNative && p !== HTMLElement.prototype) {\n      var keys = Object.getOwnPropertyNames(p);\n      for (var i = 0, k; k = keys[i]; i++) {\n        if (!used[k]) {\n          Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));\n          used[k] = 1;\n        }\n      }\n      p = Object.getPrototypeOf(p);\n    }\n  }\n  function created(element) {\n    if (element.createdCallback) {\n      element.createdCallback();\n    }\n  }\n  scope.upgrade = upgrade;\n  scope.upgradeWithDefinition = upgradeWithDefinition;\n  scope.implementPrototype = implementPrototype;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n  var isIE = scope.isIE;\n  var upgradeDocumentTree = scope.upgradeDocumentTree;\n  var upgradeAll = scope.upgradeAll;\n  var upgradeWithDefinition = scope.upgradeWithDefinition;\n  var implementPrototype = scope.implementPrototype;\n  var useNative = scope.useNative;\n  function register(name, options) {\n    var definition = options || {};\n    if (!name) {\n      throw new Error(\"document.registerElement: first argument `name` must not be empty\");\n    }\n    if (name.indexOf(\"-\") < 0) {\n      throw new Error(\"document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '\" + String(name) + \"'.\");\n    }\n    if (isReservedTag(name)) {\n      throw new Error(\"Failed to execute 'registerElement' on 'Document': Registration failed for type '\" + String(name) + \"'. The type name is invalid.\");\n    }\n    if (getRegisteredDefinition(name)) {\n      throw new Error(\"DuplicateDefinitionError: a type with name '\" + String(name) + \"' is already registered\");\n    }\n    if (!definition.prototype) {\n      definition.prototype = Object.create(HTMLElement.prototype);\n    }\n    definition.__name = name.toLowerCase();\n    if (definition.extends) {\n      definition.extends = definition.extends.toLowerCase();\n    }\n    definition.lifecycle = definition.lifecycle || {};\n    definition.ancestry = ancestry(definition.extends);\n    resolveTagName(definition);\n    resolvePrototypeChain(definition);\n    overrideAttributeApi(definition.prototype);\n    registerDefinition(definition.__name, definition);\n    definition.ctor = generateConstructor(definition);\n    definition.ctor.prototype = definition.prototype;\n    definition.prototype.constructor = definition.ctor;\n    if (scope.ready) {\n      upgradeDocumentTree(document);\n    }\n    return definition.ctor;\n  }\n  function overrideAttributeApi(prototype) {\n    if (prototype.setAttribute._polyfilled) {\n      return;\n    }\n    var setAttribute = prototype.setAttribute;\n    prototype.setAttribute = function(name, value) {\n      changeAttribute.call(this, name, value, setAttribute);\n    };\n    var removeAttribute = prototype.removeAttribute;\n    prototype.removeAttribute = function(name) {\n      changeAttribute.call(this, name, null, removeAttribute);\n    };\n    prototype.setAttribute._polyfilled = true;\n  }\n  function changeAttribute(name, value, operation) {\n    name = name.toLowerCase();\n    var oldValue = this.getAttribute(name);\n    operation.apply(this, arguments);\n    var newValue = this.getAttribute(name);\n    if (this.attributeChangedCallback && newValue !== oldValue) {\n      this.attributeChangedCallback(name, oldValue, newValue);\n    }\n  }\n  function isReservedTag(name) {\n    for (var i = 0; i < reservedTagList.length; i++) {\n      if (name === reservedTagList[i]) {\n        return true;\n      }\n    }\n  }\n  var reservedTagList = [ \"annotation-xml\", \"color-profile\", \"font-face\", \"font-face-src\", \"font-face-uri\", \"font-face-format\", \"font-face-name\", \"missing-glyph\" ];\n  function ancestry(extnds) {\n    var extendee = getRegisteredDefinition(extnds);\n    if (extendee) {\n      return ancestry(extendee.extends).concat([ extendee ]);\n    }\n    return [];\n  }\n  function resolveTagName(definition) {\n    var baseTag = definition.extends;\n    for (var i = 0, a; a = definition.ancestry[i]; i++) {\n      baseTag = a.is && a.tag;\n    }\n    definition.tag = baseTag || definition.__name;\n    if (baseTag) {\n      definition.is = definition.__name;\n    }\n  }\n  function resolvePrototypeChain(definition) {\n    if (!Object.__proto__) {\n      var nativePrototype = HTMLElement.prototype;\n      if (definition.is) {\n        var inst = document.createElement(definition.tag);\n        nativePrototype = Object.getPrototypeOf(inst);\n      }\n      var proto = definition.prototype, ancestor;\n      var foundPrototype = false;\n      while (proto) {\n        if (proto == nativePrototype) {\n          foundPrototype = true;\n        }\n        ancestor = Object.getPrototypeOf(proto);\n        if (ancestor) {\n          proto.__proto__ = ancestor;\n        }\n        proto = ancestor;\n      }\n      if (!foundPrototype) {\n        console.warn(definition.tag + \" prototype not found in prototype chain for \" + definition.is);\n      }\n      definition.native = nativePrototype;\n    }\n  }\n  function instantiate(definition) {\n    return upgradeWithDefinition(domCreateElement(definition.tag), definition);\n  }\n  var registry = {};\n  function getRegisteredDefinition(name) {\n    if (name) {\n      return registry[name.toLowerCase()];\n    }\n  }\n  function registerDefinition(name, definition) {\n    registry[name] = definition;\n  }\n  function generateConstructor(definition) {\n    return function() {\n      return instantiate(definition);\n    };\n  }\n  var HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n  function createElementNS(namespace, tag, typeExtension) {\n    if (namespace === HTML_NAMESPACE) {\n      return createElement(tag, typeExtension);\n    } else {\n      return domCreateElementNS(namespace, tag);\n    }\n  }\n  function createElement(tag, typeExtension) {\n    if (tag) {\n      tag = tag.toLowerCase();\n    }\n    if (typeExtension) {\n      typeExtension = typeExtension.toLowerCase();\n    }\n    var definition = getRegisteredDefinition(typeExtension || tag);\n    if (definition) {\n      if (tag == definition.tag && typeExtension == definition.is) {\n        return new definition.ctor();\n      }\n      if (!typeExtension && !definition.is) {\n        return new definition.ctor();\n      }\n    }\n    var element;\n    if (typeExtension) {\n      element = createElement(tag);\n      element.setAttribute(\"is\", typeExtension);\n      return element;\n    }\n    element = domCreateElement(tag);\n    if (tag.indexOf(\"-\") >= 0) {\n      implementPrototype(element, HTMLElement);\n    }\n    return element;\n  }\n  var domCreateElement = document.createElement.bind(document);\n  var domCreateElementNS = document.createElementNS.bind(document);\n  var isInstance;\n  if (!Object.__proto__ && !useNative) {\n    isInstance = function(obj, ctor) {\n      if (obj instanceof ctor) {\n        return true;\n      }\n      var p = obj;\n      while (p) {\n        if (p === ctor.prototype) {\n          return true;\n        }\n        p = p.__proto__;\n      }\n      return false;\n    };\n  } else {\n    isInstance = function(obj, base) {\n      return obj instanceof base;\n    };\n  }\n  function wrapDomMethodToForceUpgrade(obj, methodName) {\n    var orig = obj[methodName];\n    obj[methodName] = function() {\n      var n = orig.apply(this, arguments);\n      upgradeAll(n);\n      return n;\n    };\n  }\n  wrapDomMethodToForceUpgrade(Node.prototype, \"cloneNode\");\n  wrapDomMethodToForceUpgrade(document, \"importNode\");\n  document.registerElement = register;\n  document.createElement = createElement;\n  document.createElementNS = createElementNS;\n  scope.registry = registry;\n  scope.instanceof = isInstance;\n  scope.reservedTagList = reservedTagList;\n  scope.getRegisteredDefinition = getRegisteredDefinition;\n  document.register = document.registerElement;\n});\n\n(function(scope) {\n  var useNative = scope.useNative;\n  var initializeModules = scope.initializeModules;\n  var isIE = scope.isIE;\n  if (useNative) {\n    var nop = function() {};\n    scope.watchShadow = nop;\n    scope.upgrade = nop;\n    scope.upgradeAll = nop;\n    scope.upgradeDocumentTree = nop;\n    scope.upgradeSubtree = nop;\n    scope.takeRecords = nop;\n    scope.instanceof = function(obj, base) {\n      return obj instanceof base;\n    };\n  } else {\n    initializeModules();\n  }\n  var upgradeDocumentTree = scope.upgradeDocumentTree;\n  var upgradeDocument = scope.upgradeDocument;\n  if (!window.wrap) {\n    if (window.ShadowDOMPolyfill) {\n      window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;\n      window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;\n    } else {\n      window.wrap = window.unwrap = function(node) {\n        return node;\n      };\n    }\n  }\n  if (window.HTMLImports) {\n    window.HTMLImports.__importsParsingHook = function(elt) {\n      if (elt.import) {\n        upgradeDocument(wrap(elt.import));\n      }\n    };\n  }\n  function bootstrap() {\n    upgradeDocumentTree(window.wrap(document));\n    window.CustomElements.ready = true;\n    var requestAnimationFrame = window.requestAnimationFrame || function(f) {\n      setTimeout(f, 16);\n    };\n    requestAnimationFrame(function() {\n      setTimeout(function() {\n        window.CustomElements.readyTime = Date.now();\n        if (window.HTMLImports) {\n          window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;\n        }\n        document.dispatchEvent(new CustomEvent(\"WebComponentsReady\", {\n          bubbles: true\n        }));\n      });\n    });\n  }\n  if (document.readyState === \"complete\" || scope.flags.eager) {\n    bootstrap();\n  } else if (document.readyState === \"interactive\" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {\n    bootstrap();\n  } else {\n    var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? \"HTMLImportsLoaded\" : \"DOMContentLoaded\";\n    window.addEventListener(loadEvent, bootstrap);\n  }\n})(window.CustomElements);\n\n(function(scope) {\n  var style = document.createElement(\"style\");\n  style.textContent = \"\" + \"body {\" + \"transition: opacity ease-in 0.2s;\" + \" } \\n\" + \"body[unresolved] {\" + \"opacity: 0; display: block; overflow: hidden; position: relative;\" + \" } \\n\";\n  var head = document.querySelector(\"head\");\n  head.insertBefore(style, head.firstChild);\n})(window.WebComponents);","var AdapterConstants = require('../constants/adapter')\nvar Chrono = require('../chrono')\n\nvar AdapterAdsMixin = {\n  /** Override to return current ad position */\n  getPosition: function () {\n    return null\n  },\n\n  /** Override to return the given ad structure (list with number of pre, mid, and post breaks) */\n  getGivenBreaks: function () {\n    return null\n  },\n\n  /** Override to return the ad structure requested (list with number of pre, mid, and post breaks) */\n  getExpectedBreaks: function () {\n    return null\n  },\n\n  /** Override to return the structure of ads requested */\n  getExpectedPattern: function () {\n    return null\n  },\n\n  /** Override to return a list of playheads of ad breaks begin time */\n  getBreaksTime: function () {\n    return null\n  },\n\n  /** Override to return the number of ads given for the break */\n  getGivenAds: function () {\n    return null\n  },\n\n  /** Override to return the number of ads requested for the break */\n  getExpectedAds: function () {\n    return null\n  },\n\n  /** Override to return if the ad is being shown in the screen or not\n   * The standard definition is: more than 50% of the pixels of the ad are on the screen\n   */\n  getIsVisible: function () {\n    return true\n  },\n\n  /** Override to return a boolean showing if the audio is enabled when the ad begins */\n  getAudioEnabled: function () {\n    return null\n  },\n\n  /** Override to return if the ad is skippable */\n  getIsSkippable: function () {\n    return null\n  },\n\n  /** Override to return a boolean showing if the player is in fullscreen mode when the ad begins */\n  getIsFullscreen: function () {\n    return null\n  },\n\n  /** Override to return the ad campaign */\n  getCampaign: function () {\n    return null\n  },\n\n  /** Override to return the ad creative id */\n  getCreativeId: function () {\n    return null\n  },\n\n  /** Override to return the ad provider name */\n  getProvider: function () {\n    return null\n  },\n\n  /** Override to return the ad insertion type\n   * Use constants:\n   * youbora.Constants.AdInsertionType.ClientSide\n   * youbora.Constants.AdInsertionType.ServerSide\n  */\n  getAdInsertionType: function () {\n    return null\n  },\n\n  /**\n * Emits related event and set flags if current status is valid.\n * ie: won't sent start if isStarted is already true.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n */\n  fireClick: function (params) {\n    if (typeof params === 'string') {\n      params = { url: params }\n    }\n    this.emit(AdapterConstants.Event.CLICK, { params: params })\n  },\n\n  /**\n   * Emits related event and set flags if current status is valid.\n   * ie: won't sent start if isStarted is already true.\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   */\n  fireQuartile: function (quartile) {\n    if (this.flags.isStarted && typeof quartile === 'number' &&\n      quartile > this.flags.lastQuartileSent && quartile < 4) {\n      this.flags.lastQuartileSent++\n      this.emit(AdapterConstants.Event.QUARTILE, { params: { quartile: quartile } })\n    }\n  },\n\n  /**\n  * Starts a new chrono for viewedMax and restarts viewedAcum\n  */\n  startChronoView: function () {\n    if (this.getIsVisible() && !this.plugin.backgroundDetector.isInBackground) {\n      var max = this.chronos.viewedMax\n      if (max.length === 0 || max[max.length - 1].stopTime !== 0) {\n        max.push(new Chrono())\n        max[max.length - 1].start()\n      }\n    }\n  },\n\n  /**\n  * Stops a new chrono for viewedMax and restarts viewedAcum\n  */\n  stopChronoView: function () {\n    var max = this.chronos.viewedMax\n    if (max[0] && max.length > 0 && max[max.length - 1].stopTime === 0) {\n      max[max.length - 1].stop()\n    }\n  },\n\n  /**\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireManifest: function (params, message) {\n    var paramsObject = { params: params }\n    if (typeof params === 'string') {\n      paramsObject = { params: { errorType: params, errorMessage: message } }\n    }\n    this.emit(AdapterConstants.Event.MANIFEST, paramsObject)\n  },\n\n  /*\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireSkip: function (params) {\n    if (params === undefined) {\n      params = {}\n    }\n    params.skipped = true\n    this.fireStop(params)\n  },\n\n  /**\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireBreakStart: function (params) {\n    this.emit(AdapterConstants.Event.PODSTART, { params: params })\n  },\n\n  /**\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireBreakStop: function (params) {\n    this.emit(AdapterConstants.Event.PODSTOP, { params: params })\n  }\n}\n\nmodule.exports = AdapterAdsMixin\n","var AdapterConstants = require('../constants/adapter')\nvar Log = require('../log')\n\nvar AdapterContentMixin = {\n  /** Override to return current playrate */\n  getPlayrate: function () {\n    return !this.flags.isPaused ? 1 : 0\n  },\n\n  /** Override to return Frames Per Secon (FPS) */\n  getFramesPerSecond: function () {\n    return null\n  },\n\n  /** Override to return dropped frames since start */\n  getDroppedFrames: function () {\n    return null\n  },\n\n  /** Override to return user bandwidth throughput */\n  getThroughput: function () {\n    return null\n  },\n\n  /** Override to return rendition */\n  getRendition: function () {\n    return null\n  },\n\n  /** Override to return title2 */\n  getTitle2: function () {\n    return null\n  },\n\n  /** Override to recurn true if live and false if VOD */\n  getIsLive: function () {\n    return null\n  },\n\n  /** Override to return CDN traffic bytes not using streamroot or peer5. */\n  getCdnTraffic: function () {\n    return null\n  },\n\n  /** Override to return P2P traffic bytes not using streamroot or peer5. */\n  getP2PTraffic: function () {\n    return null\n  },\n\n  /** Override to return P2P traffic sent in bytes, not using streamroot or peer5. */\n  getUploadTraffic: function () {\n    return null\n  },\n\n  /** Override to return if P2P is enabled not using streamroot or peer5. */\n  getIsP2PEnabled: function () {\n    return null\n  },\n\n  /** Override to return video segment duration. */\n  getSegmentDuration: function () {\n    return null\n  },\n\n  /** Override to return household id */\n  getHouseholdId: function () {\n    return null\n  },\n\n  /** Override to return the latency */\n  getLatency: function () {\n    return null\n  },\n\n  /** Override to return the number of packets lost */\n  getPacketLoss: function () {\n    return null\n  },\n\n  /** Override to return the number of packets sent */\n  getPacketSent: function () {\n    return null\n  },\n\n  /** Override to return a json with metrics */\n  getMetrics: function () {\n    return null\n  },\n\n  /** Override to return the audio codec */\n  getAudioCodec: function () {\n    return null\n  },\n\n  /** Override to return the video codec */\n  getVideoCodec: function () {\n    return null\n  },\n\n  /** Override to return a chunk or intermediate manifest url */\n  getURLToParse: function () {\n    return null\n  },\n\n  /**\n * Emits related event and set flags if current status is valid.\n * ie: won't sent start if isStarted is already true.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n * @param {bool} [convertFromBuffer=true] If false, will convert current buffer to seek.\n * @param {string} [triggeredEvent]\n */\n  fireSeekBegin: function (params, convertFromBuffer, triggeredEvent) {\n    // First, discard false buffers triggered by state changed before seek\n    this._discardFalseBuffers()\n    if (this.plugin && this.plugin.getIsLive() && this.plugin.options['content.isLive.noSeek']) return null\n    if (this.flags.isJoined && !this.flags.isSeeking) {\n      if (this.flags.isBuffering) {\n        if (convertFromBuffer !== false) {\n          Log.notice('Converting current buffer to seek')\n\n          this.chronos.seek = this.chronos.buffer.clone()\n          this.chronos.buffer.reset()\n\n          this.flags.isBuffering = false\n        } else {\n          return\n        }\n      } else {\n        this.chronos.seek.start()\n      }\n\n      try {\n        // Create new seek empty structure to add event to detect seek begins\n        this.fireEventsStruct.seek = []\n        if (triggeredEvent) {\n          this.fireEventsStruct.seek.push(triggeredEvent)\n        } else {\n          this.fireEventsStruct.seek.push('undefinedEvent')\n        }\n      } catch (e) {}\n\n      this.flags.isSeeking = true\n      this.emit(AdapterConstants.Event.SEEK_BEGIN, { params: params })\n    }\n  },\n\n  /**\n   * Emits related event and set flags if current status is valid.\n   * ie: won't sent start if isStarted is already true.\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   * @param {string} [triggeredEvent]\n   */\n  fireSeekEnd: function (params, triggeredEvent) {\n    if (this.plugin && this.plugin.getIsLive() && this.plugin.options['content.isLive.noSeek']) return null\n    if (this.flags.isJoined && this.flags.isSeeking) {\n      try {\n        // Add triggered event to detect buffer ends\n        if (triggeredEvent) {\n          this.fireEventsStruct.seek.push(triggeredEvent)\n        } else {\n          this.fireEventsStruct.seek.push('undefinedEvent')\n        }\n      } catch (e) {}\n\n      params = params || {}\n      params.triggeredEvents = this.fireEventsStruct.seek\n\n      this.cancelSeek()\n      this.emit(AdapterConstants.Event.SEEK_END, { params: params })\n    }\n  },\n\n  /**\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   */\n  cancelSeek: function (params) {\n    if (this.flags.isJoined && this.flags.isSeeking) {\n      this.flags.isSeeking = false\n\n      this.chronos.seek.stop()\n\n      if (this.monitor) this.monitor.skipNextTick()\n    }\n  },\n\n  /**\n * Emits event request.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n */\n  fireEvent: function (eventName, dimensions, values, topLevelDimensions) {\n    var returnparams = topLevelDimensions || {}\n    returnparams.name = eventName || ''\n    returnparams.dimensions = dimensions || {}\n    returnparams.values = values || {}\n    this.emit(AdapterConstants.Event.VIDEO_EVENT, { params: returnparams })\n  }\n}\n\nmodule.exports = AdapterContentMixin\n","var Emitter = require('../emitter')\nvar Log = require('../log')\nvar Util = require('../util')\nvar version = require('../version')\nvar PlaybackChronos = require('./playbackchronos')\nvar PlaybackFlags = require('./playbackflags')\nvar PlayheadMonitor = require('./playheadmonitor')\nvar StateMonitor = require('./statemonitor')\nvar AdapterConstants = require('../constants/adapter')\n\nvar Adapter = Emitter.extend(\n  /** @lends youbora.this.prototype */\n  {\n    /**\n     * Main Adapter class. All specific player adapters should extend this class specifying a player\n     * class.\n     *\n     * The Adapter works as the 'glue' between the player and YOUBORA acting both as event\n     * translator and as proxy for the {@link Plugin} to get info from the player.\n     *\n     * @constructs Adapter\n     * @extends youbora.Emitter\n     * @memberof youbora\n     *\n     * @param {object|string} player Either an instance of the player or a string containing an ID.\n     */\n    constructor: function (player) {\n      /** An instance of {@link FlagStatus} */\n      this.flags = new PlaybackFlags()\n\n      /** An instance of {@link ChronoStatus} */\n      this.chronos = new PlaybackChronos()\n\n      /** A dictionary to store the events fired */\n      this.fireEventsStruct = {}\n      this.fireEventsStruct.buffer = []\n      this.fireEventsStruct.seek = []\n\n      /** Reference to {@link PlayheadMonitor}. Helps the plugin detect buffers/seeks. */\n      this.monitor = null\n\n      /** Reference to {@link Plugin}. */\n      this.plugin = null\n\n      /** Reference to the player tag */\n      this.player = null\n\n      /** Defines if the adapter is used as adapter or adsAdapter */\n      this._isAdsAdapter = null\n\n      // Register player and event listeners\n      this.setPlayer(player)\n\n      /** Reference to the video/object tag, could be the same as the player. */\n      this.tag = this.player\n\n      Log.notice('Adapter ' + this.getVersion() + ' with Lib ' + version + ' is ready.')\n    },\n\n    /**\n     * Sets a new player, removes the old listeners if needed.\n     *\n     * @param {Object} player Player to be registered.\n     */\n    setPlayer: function (player) {\n      if (this.player) this.unregisterListeners()\n\n      if (typeof player === 'string' && typeof document !== 'undefined') {\n        this.player = document.getElementById(player)\n      } else {\n        this.player = player\n      }\n      this.registerListeners()\n    },\n\n    /**\n     * Override to create event binders.\n     * It's a good practice when implementing a new Adapter to create intermediate methods and call\n     * those when player events are detected instead of just calling the `fire*` methods. This\n     * will allow future users of the Adapter to customize its behaviour by overriding these\n     * methods.\n     *\n     * @example\n     * registerListeners: function () {\n     *  this.player.addEventListener('start', this.onStart.bind(this))\n     * },\n     *\n     * onStart: function (e) {\n     *  this.emit('start')\n     * }\n     */\n    registerListeners: function () {\n    },\n\n    /**\n     * Override to create event de-binders.\n     *\n     * @example\n     * registerListeners: function () {\n     *  this.player.removeEventListener('start', this.onStart)\n     * }\n     */\n    /** Unregister listeners to this.player. */\n    unregisterListeners: function () {\n    },\n\n    /**\n     * This function disposes the currend adapter, removes player listeners and drops references.\n     */\n    dispose: function () {\n      // Stop Monitor and Network monitor\n      this.stopMonitor()\n      this.stopReadyStateMonitor()\n      // Fire Stop\n      this.fireStop()\n      // Unregister listener\n      this.unregisterListeners()\n      this.player = null\n      this.tag = null\n    },\n\n    /**\n     * Creates a new {@link PlayheadMonitor} at this.monitor.\n     *\n     * @param {bool} monitorBuffers If true, it will monitor buffers.\n     * @param {bool} monitorSeeks If true, it will monitor seeks.\n     * @param {number} [interval=800] The interval time in ms.\n     */\n    monitorPlayhead: function (monitorBuffers, monitorSeeks, interval) {\n      this.stopMonitor()\n      var type = 0\n      if (monitorBuffers) type |= PlayheadMonitor.Type.BUFFER\n      if (monitorSeeks) type |= PlayheadMonitor.Type.SEEK\n\n      if (!this.monitor || !this.monitor._timer.isRunning) {\n        this.monitor = new PlayheadMonitor(this, type, interval)\n      } else {\n        this.monitor.skipNextTick()\n      }\n    },\n\n    stopMonitor: function () {\n      if (this.monitor) this.monitor.stop()\n    },\n\n    /**\n     *\n     * @param {number} [intervalMilliseconds=300]\n     */\n    monitorReadyState: function (intervalMilliseconds) {\n      this.stopReadyStateMonitor()\n      this.stateMonitor = new StateMonitor(this, intervalMilliseconds)\n    },\n\n    /**\n     * Start ReadyState monitor\n     */\n    startReadyStateMonitor: function () {\n      if (this.stateMonitor) this.stateMonitor.start()\n    },\n\n    /**\n     * Stop ReadyState monitor\n     */\n    stopReadyStateMonitor: function () {\n      if (this.stateMonitor) this.stateMonitor.stop()\n    },\n\n    /**\n     * Check readyState video properties\n     * @param readyState\n     * @param triggeredEvent\n     */\n    checkReadyState: function (readyState, triggeredEvent) {\n      try {\n        if (this.plugin && this.plugin.getReadyStateMonitorEnabled()) {\n          if (readyState) {\n            if (readyState > 3 && !this.flags.isSeeking) {\n              if (this.flags.isBuffering) {\n                this.fireBufferEnd({}, triggeredEvent + '-readyState')\n              } else if (!this.flags.isJoined) {\n                this.fireJoin({}, triggeredEvent + '-readyState')\n              }\n            } else if (readyState < 4 && !this.flags.isBuffering) {\n              this.fireBufferBegin({}, false, triggeredEvent + '-readyState', true)\n            }\n          }\n        }\n      } catch (e) {\n        Log.error('Can\\'t check readyState property correctly')\n      }\n    },\n\n    // GETTERS //\n\n    /** Override to return current playhead of the video */\n    getPlayhead: function () {\n      return null\n    },\n\n    /** Override to return video duration */\n    getDuration: function () {\n      return null\n    },\n\n    /** Override to return current bitrate */\n    getBitrate: function () {\n      return null\n    },\n\n    /** Override to return total downloaded bytes */\n    getTotalBytes: function () {\n      return null\n    },\n\n    /** Override to return title */\n    getTitle: function () {\n      return null\n    },\n\n    /** Override to return resource URL. */\n    getResource: function () {\n      return null\n    },\n\n    /** Override to return player version */\n    getPlayerVersion: function () {\n      return null\n    },\n\n    /** Override to return player's name */\n    getPlayerName: function () {\n      return null\n    },\n\n    /** Override to return adapter version. */\n    getVersion: function () {\n      return version + '-generic-js'\n    },\n\n    /** Override to return video object */\n    getVideoObject: function () {\n      return null\n    },\n\n    // FLOW //\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent init if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireInit: function (params) {\n      if (this.plugin) this.plugin.fireInit()\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireStart: function (params, triggeredEvent) {\n      if (this.plugin && this.plugin.backgroundDetector && this.plugin.backgroundDetector.canBlockStartCalls()) {\n        return null\n      }\n      if (!this.flags.isStarted) {\n        this.flags.isStarted = true\n        this.chronos.total.start()\n        this.chronos.join.start()\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n        this.startReadyStateMonitor()\n        this.emit(AdapterConstants.Event.START, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireJoin: function (params, triggeredEvent) {\n      if (!this.flags.isJoined && !this.flags.isStarted && !this._isAds() && this.plugin && this.plugin.isInitiated) {\n        this.fireStart({}, triggeredEvent)\n      }\n      if (this.flags.isStarted && !this.flags.isJoined) {\n        this.flags.isStarted = true\n        if (this.monitor) this.monitor.start()\n        this.flags.isJoined = true\n        this.chronos.join.stop()\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n        this.emit(AdapterConstants.Event.JOIN, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    firePause: function (params, triggeredEvent) {\n      // First, discard false buffers triggered by state changed before pause\n      this._discardFalseBuffers()\n      if (this.flags.isBuffering) {\n        this.fireBufferEnd(null, 'firePauseCall')\n      }\n      if (this.flags.isJoined && !this.flags.isPaused) {\n        this.flags.isPaused = true\n\n        this.chronos.pause.start()\n\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n\n        this.emit(AdapterConstants.Event.PAUSE, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireResume: function (params, triggeredEvent) {\n      // First, discard false buffers triggered by state changed before resume\n      this._discardFalseBuffers()\n      if (this.flags.isJoined && this.flags.isPaused) {\n        this.flags.isPaused = false\n\n        this.chronos.pause.stop()\n\n        if (this.monitor) this.monitor.skipNextTick()\n\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n\n        this.emit(AdapterConstants.Event.RESUME, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {boolean} [convertFromSeek=false] If true, will convert current seek to buffer.\n     * @param {string} [triggeredEvent]\n     * @param {boolean} [triggeredByStateProperty]\n     */\n    fireBufferBegin: function (params, convertFromSeek, triggeredEvent, triggeredByStateProperty = false) {\n      if (this.flags.isJoined && !this.flags.isBuffering) {\n        if (this.flags.isSeeking) {\n          if (convertFromSeek) {\n            Log.notice('Converting current buffer to seek')\n\n            this.chronos.buffer = this.chronos.seek.clone()\n            this.chronos.seek.reset()\n\n            this.flags.isSeeking = false\n          } else {\n            return\n          }\n        } else {\n          this.chronos.buffer.start()\n        }\n\n        try {\n          // Create new buffer empty structure to add event to detect buffer begins\n          this.fireEventsStruct.buffer = []\n          if (triggeredEvent) {\n            this.fireEventsStruct.buffer.push(triggeredEvent)\n          } else {\n            this.fireEventsStruct.buffer.push('undefinedEvent')\n          }\n        } catch (e) {}\n\n        this.flags.isBuffering = true\n        this.flags.isVideoStateBuffering = triggeredByStateProperty\n        this.emit(AdapterConstants.Event.BUFFER_BEGIN, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireBufferEnd: function (params, triggeredEvent) {\n      if (this.flags.isJoined && this.flags.isBuffering) {\n        try {\n          // Add triggered event to detect buffer ends\n          if (triggeredEvent) {\n            this.fireEventsStruct.buffer.push(triggeredEvent)\n          } else {\n            this.fireEventsStruct.buffer.push('undefinedEvent')\n          }\n        } catch (e) {}\n\n        params = params || {}\n        params.triggeredEvents = this.fireEventsStruct.buffer\n\n        this.cancelBuffer()\n        this.emit(AdapterConstants.Event.BUFFER_END, { params: params })\n      }\n    },\n\n    /**\n     * Discard false buffer events from state changed\n     * @private\n     */\n    _discardFalseBuffers: function () {\n      try {\n        if (this.flags.isBuffering && this.flags.isVideoStateBuffering && (this._getDeltaBufferTime() <= 100)) {\n          this.cancelBuffer()\n        }\n      } catch (e) {}\n    },\n\n    /**\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    cancelBuffer: function (params) {\n      if (this.flags.isJoined && this.flags.isBuffering) {\n        this.flags.isBuffering = false\n        this.flags.isVideoStateBuffering = false\n\n        this.chronos.buffer.stop()\n\n        if (this.monitor) this.monitor.skipNextTick()\n      }\n    },\n\n    /**\n     * Get Delta buffer time\n     * @returns {number|number|*}\n     * @private\n     */\n    _getDeltaBufferTime: function () {\n      if (this.chronos && this.chronos.buffer) {\n        return this.chronos.buffer.getDeltaTime(false)\n      }\n      return 0\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireStop: function (params, triggeredEvent) {\n      if (this._isAds() || (this.plugin && this.plugin._isStopReady())) {\n        if ((this._isAds() && this.flags.isStarted) ||\n          (!this._isAds() && (this.flags.isStarted || (this.plugin && this.plugin.isInitiated)))\n        ) {\n          // Stop Monitor and Network monitor\n          this.stopMonitor()\n          this.stopReadyStateMonitor()\n\n          this.flags.reset()\n          this.chronos.total.stop()\n          this.chronos.join.reset()\n          this.chronos.pause.stop()\n          this.chronos.buffer.stop()\n          this.chronos.seek.stop()\n\n          if (triggeredEvent) {\n            params = params || {}\n            params.triggeredEvents = [triggeredEvent]\n          }\n\n          this.emit(AdapterConstants.Event.STOP, { params: params })\n\n          this.chronos.pause.reset()\n          this.chronos.buffer.reset()\n          this.chronos.seek.reset()\n          this.chronos.viewedMax.splice(0, this.chronos.viewedMax.length)\n        }\n      }\n    },\n\n    setIsAds: function (value) {\n      this._isAdsAdapter = value\n    },\n\n    _isAds: function () {\n      return this._isAdsAdapter\n    },\n\n    /**\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireCasted: function (params, triggeredEvent) {\n      if (!params) params = {}\n      params.casted = true\n      this.fireStop(params, triggeredEvent)\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @param {string} [triggeredEvent]\n     */\n    fireError: function (code, msg, metadata, level, triggeredEvent) {\n      var params = Util.buildErrorParams(code, msg, metadata, level)\n      if (params.code) {\n        delete params.code\n      }\n      if (triggeredEvent) {\n        params = params || {}\n        params.triggeredEvents = [triggeredEvent]\n      }\n      var options = this.plugin ? this.plugin.options : {}\n      if (typeof params.errorCode !== 'undefined' && options['errors.ignore'] &&\n      options['errors.ignore'].indexOf(params.errorCode.toString()) > -1) {\n        // ignore error\n      } else {\n        this.emit(AdapterConstants.Event.ERROR, { params: params })\n        if (typeof params.errorCode !== 'undefined' && options['errors.fatal'] &&\n          options['errors.fatal'].indexOf(params.errorCode.toString()) > -1) {\n          this.fireStop({}, triggeredEvent)\n        }\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @param {string} [triggeredEvent]\n     */\n    fireFatalError: function (code, msg, metadata, level, triggeredEvent) {\n      var options = this.plugin ? this.plugin.options : {}\n      if (typeof code !== 'undefined' && options['errors.ignore'] &&\n      options['errors.ignore'].indexOf(code.toString()) > -1) {\n        // ignore error\n      } else {\n        if (this.monitor) this.monitor.stop()\n        this.fireError(code, msg, metadata, level, triggeredEvent)\n        if (typeof code !== 'undefined' && options['errors.nonFatal'] &&\n          options['errors.nonFatal'].indexOf(code.toString()) > -1) {\n          // no stop\n        } else {\n          this.fireStop({}, triggeredEvent)\n        }\n      }\n    }\n  },\n  {\n    /** @lends youbora.Adapter */\n    // Static Memebers //\n\n    /**\n     * List of events that could be fired\n     * @enum\n     * @event\n     */\n    Event: AdapterConstants.Event\n  }\n)\n\nUtil.assign(Adapter.prototype, require('./adapter+ads'))\nUtil.assign(Adapter.prototype, require('./adapter+content'))\n\nmodule.exports = Adapter\n","var YouboraObject = require('../object')\nvar Chrono = require('../chrono')\n\nvar PlaybackChronos = YouboraObject.extend(\n  /** @lends youbora.PlaybackChronos.prototype */\n  {\n    /**\n     * This class contains all the {@link Chrono}s related to view status.\n     * Chronos measure time lapses between events.\n     * ie: between start and join, between seek-begin and seek-end, etc.\n     * Each plugin will have an instance of this class.\n     *\n     * @constructs PlaybackChronos\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset flag values */\n    reset: function () {\n      /** Chrono between start and joinTime. */\n      this.join = new Chrono()\n\n      /** Chrono between seek-begin and seek-end. */\n      this.seek = new Chrono()\n\n      /** Chrono between pause and resume. */\n      this.pause = new Chrono()\n\n      /** Chrono between buffer-begin and buffer-end. */\n      this.buffer = new Chrono()\n\n      /** Chrono for the totality of the view. */\n      this.total = new Chrono()\n\n      // For ads\n\n      /** List of chronos with seen intervals */\n      this.viewedMax = []\n    }\n  }\n)\n\nmodule.exports = PlaybackChronos\n","var YouboraObject = require('../object')\n\nvar PlaybackFlags = YouboraObject.extend(\n  /** @lends youbora.PlaybackFlags.prototype */\n  {\n    /**\n     * This class contains all the flags related to view status.\n     * Each plugin will have an instance of this class.\n     *\n     * @constructs PlaybackFlags\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset flag values */\n    reset: function () {\n      /** Flag when Start has been sent. */\n      this.isStarted = false\n\n      /** Flag when Join has been sent. */\n      this.isJoined = false\n\n      /** Flag when Player is paused. */\n      this.isPaused = false\n\n      /** Flag when Player is seeking. */\n      this.isSeeking = false\n\n      /** Flag when Player is buffering. */\n      this.isBuffering = false\n\n      /** Flag when Player is buffering by video state. */\n      this.isVideoStateBuffering = false\n\n      /** Flag when Player is ended. */\n      this.isEnded = false\n\n      /** Flag when Player view ends and stop is already sent. */\n      this.isStopped = false\n\n      /** Flag with last quartile sent. */\n      this.lastQuartileSent = 0\n    }\n  }\n)\n\nmodule.exports = PlaybackFlags\n","var YouboraObject = require('../object')\nvar Timer = require('../timer')\nvar Chrono = require('../chrono')\n\nvar PlayheadMonitor = YouboraObject.extend(\n  /** @lends youbora.PlayheadMonitor.prototype */\n  {\n    /**\n     * This class periodically checks the player's playhead in order to infer buffer and/or seek\n     * events.\n     *\n     * Instances of this class are bounded to an {@link Adapter} and fires its buffer and seek\n     * start and end methods.\n     *\n     * In order to use this feature, {@link Adapter#monitorPlayhead} should be used.\n     *\n     * @constructs PlayheadMonitor\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Adapter} adapter Adapter to monitor. Must have getPlayhead defined.\n     * @param {PlayheadMonitor.Type} [type=NONE]\n     * Which metric to monitor seek and/or buffer.\n     * Use bitwise operators to join both values (Type.BUFFER | Type.SEEK)\n     * @param {int} [interval=800] How many ms will wait between progress. -1 to disable.\n     */\n    constructor: function (adapter, type, interval) {\n      this._adapter = adapter\n      this._seekEnabled = type & PlayheadMonitor.Type.SEEK\n      this._bufferEnabled = type & PlayheadMonitor.Type.BUFFER\n      interval = interval || 800\n\n      this._chrono = new Chrono()\n      this._lastPlayhead = 0\n\n      if (interval > 0) {\n        this._timer = new Timer(this.progress.bind(this), interval)\n      }\n    },\n\n    /**\n     * Start interval checks.\n     */\n    start: function () {\n      this.stop()\n      if (this.canBeUsed()) this._timer.start()\n    },\n\n    /**\n     * Stop interval checks.\n     */\n    stop: function () {\n      this._lastPlayhead = 0\n      if (this._timer) this._timer.stop()\n    },\n\n    skipNextTick: function () {\n      this._lastPlayhead = 0\n    },\n\n    /**\n     * Call this method at every tick of timeupdate/progress.\n     * If you defined an interval, do not fire this method manually.\n     */\n    progress: function () {\n      // Reset timer\n      var deltaTime = this._chrono.stop()\n      this._chrono.start()\n\n      // Define thresholds\n      var bufferThreshold = deltaTime * PlayheadMonitor.kBUFFER_THRESHOLD_RATIO\n      var seekThreshold = deltaTime * PlayheadMonitor.kSEEK_THRESHOLD_RATIO\n\n      if (this._adapter.getPlayrate && this._adapter.getPlayrate() && this._adapter.getPlayrate() !== 1) {\n        bufferThreshold *= this._adapter.getPlayrate()\n        seekThreshold *= this._adapter.getPlayrate()\n      }\n\n      // Calculate diff playhead\n      var currentPlayhead = this._getPlayhead()\n      var diffPlayhead = Math.abs(this._lastPlayhead - currentPlayhead) * 1000\n\n      // youbora.Log.debug('curr: ' + currentPlayhead + ' last: ' + this._lastPlayhead + ' diff: ' + diffPlayhead)\n\n      if (diffPlayhead < bufferThreshold) {\n        // Playhead is stalling > buffer\n        if (this._bufferEnabled &&\n          this._lastPlayhead > 0 &&\n          !this._adapter.flags.isPaused &&\n          !this._adapter.flags.isSeeking\n        ) {\n          this._adapter.fireBufferBegin(null, false, 'playheadMonitor')\n        }\n      } else if (diffPlayhead > seekThreshold) {\n        // Playhead has jumped > seek\n        if (this._seekEnabled && this._lastPlayhead > 0) {\n          this._adapter.fireSeekBegin(null, false, 'playheadMonitor')\n        }\n      } else {\n        // Healthy\n        if (this._seekEnabled) {\n          this._adapter.fireSeekEnd(null, 'playheadMonitor')\n        }\n        if (this._bufferEnabled) {\n          this._adapter.fireBufferEnd(null, 'playheadMonitor')\n        }\n      }\n\n      // Update Playhead\n      this._lastPlayhead = currentPlayhead\n    },\n\n    /**\n     * Returns if the monitor can be used or not.\n     * Enabled by default, except the case where the content is live and the option 'content.isLive.noMonitor' is true.\n     * @public\n     * @returns {boolean} If the monitor can be used or not.\n     */\n    canBeUsed: function () {\n      var plugin = this._adapter.plugin\n      if (plugin && plugin.getPlayheadMonitorEnabled() && (this._seekEnabled || this._bufferEnabled)) {\n        return plugin.getIsLive() ? !plugin.options['content.isLive.noMonitor'] : true\n      } else {\n        return false\n      }\n    },\n\n    /**\n     * Returns adapter's playhead. Override to add a custom playhead getter.\n     * @private\n     * @returns {double} Playhead in seconds\n     */\n    _getPlayhead: function () {\n      return this._adapter.getPlayhead()\n    }\n  },\n  /** @lends youbora.PlayheadMonitor */\n  {\n    // Static methods\n\n    /**\n     * Enum for monitoring type\n     * @enum\n     */\n    Type: {\n      /** Would not monitor */\n      NONE: 0,\n      /** Sends buffer-begin/end */\n      BUFFER: 1,\n      /** Sends seek-begin/end */\n      SEEK: 2\n    },\n\n    /** Buffer threshold */\n    kBUFFER_THRESHOLD_RATIO: 0.5,\n\n    /** Seek threshold */\n    kSEEK_THRESHOLD_RATIO: 2\n  })\n\nmodule.exports = PlayheadMonitor\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar StateMonitor = YouboraObject.extend(\n  /** @lends youbora.NetworkMonitor.prototype */\n  {\n    /**\n     * @constructs StateMonitor\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Adapter} adapter Adapter to monitor. Must have getVideoObject defined.\n     * @param {int} [intervalMilliseconds=300] How many ms will wait between progress. -1 to disable.\n     */\n    constructor: function (adapter, intervalMilliseconds) {\n      this._adapter = adapter\n      this._videoElement = adapter.getVideoObject()\n      this._startedStateCheck = false\n      this._intervalCheckId = null\n      this._intervalMilliseconds = intervalMilliseconds || 300\n    },\n\n    /**\n     * Start Network monitor\n     */\n    start: function () {\n      var plugin = this._adapter.plugin\n      if (plugin && plugin.getReadyStateMonitorEnabled()) {\n        if (this._videoElement && !this._startedStateCheck) {\n          this._intervalCheckId = setInterval(this.checkStateProperty.bind(this), this._intervalMilliseconds)\n          this._startedStateCheck = true\n        }\n      }\n    },\n\n    /**\n     * Stop Network monitor\n     */\n    stop: function () {\n      try {\n        if (this._startedStateCheck && this._intervalCheckId) {\n          clearInterval(this._intervalCheckId)\n        }\n        this._intervalCheckId = null\n        this._startedStateCheck = false\n      } catch (e) {\n        Log.error('Produced error stopping the network monitor')\n      }\n    },\n\n    /**\n     * Check ReadyState properties values\n     * @param e\n     */\n    checkStateProperty: function (e) {\n      try {\n        if (this._videoElement && this._adapter) {\n          if (this._videoElement.readyState) {\n            if (this._videoElement.readyState > 3 && !this._adapter.flags.isSeeking) {\n              if (this._adapter.flags.isBuffering) {\n                this.fireBufferEnd({}, 'stateMonitor')\n              } else if (!this._adapter.flags.isJoined) {\n                this.fireJoin({}, 'stateMonitor')\n              }\n            } else if (this._videoElement.readyState < 4 && !this._adapter.flags.isBuffering) {\n              this.fireBufferBegin({}, false, 'stateMonitor', true)\n            }\n          }\n        }\n      } catch (e) {}\n    }\n  })\n\nmodule.exports = StateMonitor\n","var YouboraObject = require('./object')\n\nvar Chrono = YouboraObject.extend(\n  /** @lends youbora.Chrono.prototype */\n  {\n    /**\n     * This class calculates time lapses between two points in time.\n     *\n     * @constructs Chrono\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset chrono values. */\n    reset: function () {\n      /** Start time */\n      this.startTime = 0\n\n      /** Stop time */\n      this.stopTime = 0\n\n      /** Pause time */\n      this.pauseTime = 0\n\n      /** Offset to be added to deltaTime and stop. in ms. */\n      this.offset = 0\n    },\n\n    /**\n     * Returns the time between start() and the last stop() in ms. Returns -1 if start wasn't\n     * called.\n     * @param {boolean} [stop=true] If true, it will force a stop() if it wasn't called before.\n     * @return {number} Time lapse in ms.\n     */\n    getDeltaTime: function (stop) {\n      var retValue = -1\n      var now = new Date().getTime()\n      if (this.startTime) {\n        if (stop && !this.stopTime) {\n          this.stopTime = now\n        }\n        var tempOffset = this.pauseTime ? now - this.pauseTime : 0\n        var tempStop = this.stopTime ? this.stopTime : now\n        retValue = (this.offset - tempOffset) + (tempStop - this.startTime)\n      }\n      return retValue\n    },\n\n    /**\n     * Starts the chrono.\n     */\n    start: function () {\n      this.startTime = new Date().getTime()\n      this.stopTime = 0\n      this.offset = 0\n    },\n\n    /**\n     * Stops the timer and returns current delta time.\n     * @return {number} Returns the delta time\n     */\n    stop: function () {\n      if (this.pauseTime) this.resume()\n      this.stopTime = new Date().getTime()\n      return this.startTime ? this.offset + (this.stopTime - this.startTime) : -1\n    },\n\n    pause: function () {\n      this.pauseTime = new Date().getTime()\n    },\n\n    resume: function () {\n      this.offset -= (new Date().getTime() - this.pauseTime)\n      this.pauseTime = 0\n    },\n\n    /**\n     * Creates a copy of the chrono.\n     */\n    clone: function () {\n      var chrono = new Chrono()\n      chrono.startTime = this.startTime\n      chrono.stopTime = this.stopTime\n      chrono.offset = this.offset\n      return chrono\n    }\n  }\n)\n\nmodule.exports = Chrono\n","var YouboraObject = require('../object')\nvar Log = require('../log')\nvar YBRequest = require('./request')\nvar Transform = require('./transform/transform')\n\nvar Communication = YouboraObject.extend(\n  /** @lends youbora.Communication.prototype */\n  {\n    /**\n     * Youbora Communication implements an abstraction layer over API requests.\n     * Internally, Communication implements queues of {@link Request} objects.\n     * This queue can be blocked using {@link Transform}\n     *\n     * @constructs Communication\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {string} host The fastdata host address.\n     * @param {boolean} httpSecure True for https, false for http, undefined for //.\n     */\n    constructor: function (pluginref) {\n      /** Array of {@link Transform}, only when the array is empty the request Queues will begin sending. */\n      this.transforms = []\n      this.pluginRef = pluginref\n      /**\n       * Queue of {@link YBRequest}\n       * @private\n       */\n      this._requests = []\n    },\n\n    /**\n     * Enqueues the request provided.\n     *\n     * @param {YBRequest} request Request to be enqueued\n     * @param {function} [callback] The defined load callback to the Request\n     */\n    sendRequest: function (request, callback, callbackParams) {\n      if (request) {\n        if (typeof callback === 'function') request.on(YBRequest.Event.SUCCESS, callback, callbackParams)\n        this._registerRequest(request)\n      }\n    },\n\n    /**\n     * Build a generic request to the given host.\n     *\n     * @param {string} host Host of the service called.\n     * @param {string} service A string with the service to be called. ie: '/data', '/joinTime'...\n     * @param {Object} [params] Object of key:value params.\n     * @param {function} [callback] The defined load callback to the Request\n     */\n    buildRequest: function (host, service, params, callback) {\n      params = params || {}\n      var request = new YBRequest(host, service, params)\n      if (typeof callback === 'function') request.on(YBRequest.Event.SUCCESS, callback)\n      this._registerRequest(request)\n    },\n\n    /**\n     * Adds a Transform to the queue. See {@link Transform}.\n     *\n     * @param {RequestTransform} transform\n     */\n    addTransform: function (transform) {\n      if (transform.parse && transform.isBlocking) {\n        this.transforms.push(transform)\n        transform.on(Transform.Event.DONE, this._processRequests.bind(this))\n      } else {\n        Log.warn(transform + ' is not a valid RequestTransform.')\n      }\n    },\n\n    /**\n     * Removes a {@link Transform}.\n     *\n     * @param {RequestTransform} transform Transform object to remove.\n     */\n    removeTransform: function (transform) {\n      var pos = this.transforms.indexOf(transform)\n      if (pos !== -1) {\n        this.transforms.splice(pos, 1)\n      } else {\n        Log.warn('Trying to remove unexisting Transform \\'' + transform + '\\'.')\n      }\n    },\n\n    /**\n     * Adds an {@link YBRequest} to the queue of requests.\n     *\n     * @private\n     * @param {YBRequest} request The Request to be queued.\n     */\n    _registerRequest: function (request) {\n      if (this.pluginRef) {\n        var options = this.pluginRef.options\n        if (options.authToken) {\n          request.options.requestHeaders.Authorization = options.authType + ' ' + options.authToken\n        }\n      }\n      this._requests.push(request)\n      this._processRequests()\n    },\n\n    /**\n     * Execute pending requests in the queue. Returns rejected ones to the queue.\n     * @private\n     */\n    _processRequests: function () {\n      var workingQueue = this._requests\n      this._requests = []\n\n      var rejected = []\n      while (workingQueue.length) {\n        var request = workingQueue.shift()\n        var transformState = this._transform(request)\n        if (transformState === Transform.STATE_NO_BLOCKED) {\n          if (this.pluginRef) request.host = this.pluginRef.getHost()\n          request.send()\n        } else if (transformState === Transform.STATE_BLOCKED) {\n          rejected.push(request)\n        } // else { remove }\n      }\n\n      while (rejected.length) {\n        this._requests.push(rejected.shift())\n      }\n    },\n\n    /**\n     * Pass the given request to each transform.\n     * @private\n     * @returns {int} STATE_NO_BLOCKED if everything is right. STATE_BLOCKED if some parser rejected it.\n     * STATE_OFFLINE if offline transform blocked it.\n     */\n    _transform: function (request) {\n      var ret = Transform.STATE_NO_BLOCKED\n      this.transforms.forEach(function (transform) {\n        if (transform.isBlocking(request)) {\n          ret = Transform.STATE_BLOCKED\n          return\n        } else {\n          transform.parse(request)\n        }\n        if (transform.getState() === Transform.STATE_OFFLINE) {\n          ret = Transform.STATE_OFFLINE\n        }\n      })\n      return ret\n    }\n  })\n\nmodule.exports = Communication\n","/* global  atv, XMLHttpRequest, ActiveXObject */\nvar YouboraObject = require('../object')\nvar Log = require('../log')\nvar Util = require('../util')\n\nvar YBRequest = YouboraObject.extend(\n  /** @lends youbora.YBRequest.prototype */\n  {\n    /**\n     * YBYBRequest class will wrap XmlHttpRequest and extend its functionality, allowing youbora\n     * to manage queues, blockers and retries.\n     *\n     * @constructs YBRequest\n     * @extends youbora.Object\n     * @memberof youbora\n     *\n     * @param {string} host URL of the request. ie: a-fds.youborafds01.com\n     * @param {string} [service] Name of the service. ie '/start'\n     * @param {Object} [params] Object of key:value params.\n     * @param {Object} [options] Object with custom options.\n     * @param {string} [options.method=\"GET\"] Specifies the method of the request. ie: \"GET\", \"HEAD\".\n     * @param {string} [options.requestHeaders] Object with options of requestHeaders.\n     * ie: { header: value }.\n     * @param {number} [options.retryAfter=5000] Time in ms before sending a failed request again.\n     * 0 to disable.\n     * @param {number} [options.maxRetries=3] Max number of retries. 0 to disable.\n     * @param {bool} [options.cache=false] If false, timestamp will be added to each request to\n     * prevent caching.\n     */\n    constructor: function (host, service, params, options) {\n      /** Instance of XmlHttpRequest (or the item returned by createXHR method). */\n      this.xhr = this.createXHR()\n\n      /** Host of the request */\n      this.host = host || ''\n\n      /** Service of the request */\n      this.service = service || ''\n\n      /** Object of params of the request */\n      this.params = params || {}\n\n      /** Options of the current request */\n      this.options = Util.assign({}, YBRequest.defaultOptions, options)\n\n      /** Number of times this request has failed and retried. */\n      this.retries = 0\n\n      /** Define if plugin has enabled to send requests with POST method */\n      this.sendPostRequest = false\n      this.preparedPostRequest = false\n\n      // Add timemark\n      if (!this.options.cache) {\n        this.setParam('timemark', new Date().getTime())\n      }\n    },\n\n    /**\n     * Creates XMLHttpRequest if it is available in the browser.\n     * If not, it tries to create an ActiveXObject XMLHTTP item.\n     * Override this function for custom environments.\n     *\n     * @return YBRequest handler.\n     */\n    createXHR: function () {\n      var xhr = {}\n      try {\n        if (XMLHttpRequest) {\n          xhr = new XMLHttpRequest()\n        } else {\n          xhr = new ActiveXObject('Microsoft.XMLHTTP')\n        }\n      } catch (err) {\n        Log.error(err)\n      }\n      return xhr\n    },\n\n    /**\n     * Returns xhr object.\n     *\n     * @return {XmlHttpRequest} object.\n     */\n    getXHR: function () {\n      return this.xhr\n    },\n\n    getResponse: function () {\n      return this.xhr.response\n    },\n\n    getResponseText: function () {\n      return this.xhr.responseText\n    },\n\n    getResponseHeaders: function () {\n      return this.xhr.getAllResponseHeaders()\n    },\n\n    /** Returns the complete formed url of the request url+service+params. */\n    getUrl: function () {\n      return this.host + this.service + this.getParamString()\n    },\n\n    /**\n     * Wraps this.getHXR.addEventListener.\n     * Accepts a callback that receives (this YBRequest, event)\n     */\n    on: function (event, callback, callbackParams) {\n      if (this.xhr.addEventListener) {\n        this.xhr.addEventListener(event, callback.bind(this, this, callbackParams))\n      } else {\n        if (event === YBRequest.Event.SUCCESS) {\n          this.xhr.onreadystatechange = function () {\n            if (this.xhr.readyState === 4) {\n              callback.bind(this, this, callbackParams)\n            }\n          }.bind(this)\n        }\n      }\n      return this\n    },\n\n    /** Wraps this.getHXR.removeEventListener */\n    off: function (event, callback) {\n      this.xhr.removeEventListener(event, callback)\n      return this\n    },\n\n    /**\n     * Returns the params of the request, stringified.\n     * ie: '?pluginVersion=5.1.0&systemCode=nicetv'.\n     * @return {string} Concatenated Params\n     */\n    getParamString: function () {\n      try {\n        var params = '?'\n        for (var key in this.params) {\n          var param = this.params[key]\n          if (param !== null && typeof param === 'object') {\n            var string = JSON.stringify(param)\n            if (string !== '{}') {\n              params += encodeURIComponent(key) + '=' + encodeURIComponent(string) + '&'\n            }\n          } else if (param !== null && typeof param !== 'undefined' && param !== '') {\n            params += encodeURIComponent(key) + '=' + encodeURIComponent(param) + '&'\n          }\n        }\n        return params.slice(0, -1)\n      } catch (err) {\n        Log.error(err)\n        return ''\n      }\n    },\n\n    /**\n     * Returns the value of the given param, or undefined.\n     * @param {string} key Name of the param.\n     * @return {any}\n     */\n    getParam: function (key) {\n      return this.params[key]\n    },\n\n    /**\n     * Add or set a parameter for the request.\n     * ie: if you want to add 'username=user' use setParam('username', 'user').\n     * @param {string} key Name of the param.\n     * @param {string} value Name of the param.\n     * @return this\n     */\n    setParam: function (key, value) {\n      this.params[key] = value\n      return this\n    },\n\n    setBody: function (body) {\n      this.body = body\n    },\n\n    /**\n     * Set if is enabled send requests with POST method\n     * @param {boolean} sendPostRequest\n     */\n    setPostRequest: function (sendPostRequest) {\n      this.sendPostRequest = sendPostRequest\n    },\n\n    /**\n     * Create Params object with the basic get params we need to send to the Data Collector nodes\n     * @returns {{}}\n     */\n    getParamsForPostMessages: function () {\n      // Creating empty params object\n      var params = {}\n      try {\n        // Get previous params\n        var timemark = this.getParam('timemark')\n        var code = this.getParam('code')\n        var sessionRoot = this.getParam('sessionRoot')\n        var sessionId = this.getParam('sessionId')\n        // Adding params\n        if (timemark) {\n          params.timemark = timemark\n        }\n        if (code) {\n          params.code = code\n        }\n        if (sessionRoot) {\n          params.sessionRoot = sessionRoot\n        }\n        if (sessionId) {\n          params.sessionId = sessionId\n        }\n      } catch (err) {\n        Log.error(err)\n      }\n      return params\n    },\n\n    /**\n     * Sends the request.\n     *\n     * @return returns xhr.send()\n     */\n    send: function () {\n      try {\n        try {\n          if (this.sendPostRequest && !this.preparedPostRequest) {\n            this.options.method = 'POST'\n            this.body = JSON.stringify(this.params)\n            this.params = this.getParamsForPostMessages()\n            this.preparedPostRequest = true\n          }\n        } catch (err) {}\n\n        this.xhr.open(this.options.method, this.getUrl(), true)\n\n        // Add custom headers\n        if (this.options.requestHeaders) {\n          for (var key in this.options.requestHeaders) {\n            if (this.options.requestHeaders.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n              this.xhr.setRequestHeader(key, this.options.requestHeaders[key])\n            }\n          }\n        }\n\n        // Add retries system\n        if (this.options.retryAfter > 0 && this.options.maxRetries > 0) {\n          var genericError = function () {\n            if (this.retries >= this.options.maxRetries) {\n              Log.error('Aborting failed request \"' + this.service + '\". Max retries reached.')\n            } else {\n              Log.warn('YBRequest \"' + this.service + '\" failed. Retry ' + (this.retries + 1) + ' of ' +\n                this.options.maxRetries + ' in ' + this.options.retryAfter + 'ms.')\n              try {\n                setTimeout(function () {\n                  this.retries += 1\n                  this.send()\n                }.bind(this), this.options.retryAfter)\n              } catch (err) {\n                if (typeof atv !== 'undefined') {\n                  atv.setTimeout(function () {\n                    this.retries += 1\n                    this.send()\n                  }.bind(this), this.options.retryAfter)\n                } else {\n                  Log.error(err)\n                }\n              }\n            }\n          }\n          if (this.retries === 0) {\n            this.on(YBRequest.Event.ERROR, genericError.bind(this))\n          }\n        }\n\n        // Log XHR\n        if (Log.logLevel <= Log.Level.VERBOSE) {\n          Log.verbose('XHR Req: ' + this.getUrl())\n        }\n\n        // Register 'on every' listeners\n        for (var event in YBRequest._globalListeners) {\n          YBRequest._globalListeners[event].forEach(function (callback) {\n            this.on(event, callback)\n          }.bind(this))\n        }\n\n        // Send\n        return this.xhr.send(this.body)\n      } catch (err) {\n        Log.error(err)\n      }\n    }\n  },\n\n  /** @lends youbora.YBRequest */\n  {\n    /**\n     * List of events that could be fired from XHR\n     * @enum\n     */\n    Event: {\n      /** Request successful */\n      SUCCESS: 'load',\n      /** Request successful */\n      LOAD: 'load', // Native JS\n      /** Request returned error */\n      ERROR: 'error',\n      /** Request aborted */\n      ABORT: 'abort'\n    },\n\n    /**\n     * This static property includes the default values for the options. In case you do not define\n     * one of them in the constructor, these values will be used instead.\n     *\n     * @param {string} [defaultOptions.method=\"GET\"] Specifies the method of the request.\n     * ie: \"GET\", \"HEAD\".\n     * @param {string} [defaultOptions.requestHeaders] Object with options of requestHeaders.\n     * ie: { header: value }.\n     * @param {number} [defaultOptions.retryAfter=5000] Time in ms before sending a failed request\n     * again. 0 to disable.\n     * @param {number} [defaultOptions.maxRetries=3] Max number of retries. 0 to disable.\n     * @param {bool} [defaultOptions.cache=false] If false, timemark will be added to each request\n     * to prevent caching.\n     */\n    defaultOptions: {\n      method: 'GET',\n      requestHeaders: {},\n      maxRetries: 3,\n      retryAfter: 5000,\n      cache: false\n    },\n\n    /** @private */\n    _globalListeners: {},\n\n    /**\n     * Adds a callback to every instance.\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     */\n    onEvery: function (event, callback) {\n      YBRequest._globalListeners[event] = YBRequest._globalListeners[event] || []\n      YBRequest._globalListeners[event].push(callback)\n    },\n\n    /**\n     * Removes a global callback\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     */\n    offEvery: function (event, callback) {\n      if (YBRequest._globalListeners[event]) {\n        var index = YBRequest._globalListeners[event].indexOf(callback)\n        if (index !== -1) {\n          YBRequest._globalListeners[event].splice(index, 1)\n        }\n      }\n    }\n  })\n\nmodule.exports = YBRequest\n","var Transform = require('./transform')\nvar Constants = require('../../constants')\n\n/**\n * This transform ensures that no requests will be sent before an /init or /start request.\n * As these are the two possible first requests that the API expects for a view.\n *\n * @constructs\n * @extends youbora.Transform\n * @memberof youbora\n * @name FlowTransform\n *\n * @param {Plugin} plugin Instance of {@link Plugin}\n */\nvar FlowTransform = Transform.extend(\n  /** @lends youbora.FlowTransform.prototype */\n  {\n    _services: [Constants.Service.INIT, Constants.Service.START, Constants.Service.OFFLINE_EVENTS],\n    /**\n     * Returns if transform is blocking.\n     *\n     * @param {YBRequest} request Request to transform.\n     * @return {bool} True if queue shall be blocked.\n     */\n    isBlocking: function (request) {\n      if (this._isBusy && request != null) {\n        if (this._services.indexOf(request.service) !== -1) {\n          this.done()\n        } else if (request.service === Constants.Service.ERROR) {\n          return false\n        }\n      }\n      return Transform.prototype.isBlocking.apply(this, arguments)\n    }\n  }\n)\n\nmodule.exports = FlowTransform\n","var Transform = require('./transform')\n\nvar OfflineTransform = Transform.extend(\n  /** @lends youbora.OfflineTransform.prototype */\n  {\n    /**\n     * This class manages Fastdata service and view index.\n     *\n     * @constructs\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     * @param {string} session If provided, plugin will use this as a FD response.\n     */\n    constructor: function (plugin, session) {\n      this._sendRequest = false\n      this._isBusy = false\n      this.plugin = plugin\n      this.session = session\n      this.transformName = 'Offline'\n    },\n\n    /**\n     * Transform requests\n     * @param {youbora.comm.YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      if (request && this.plugin.offlineStorage) {\n        this.plugin.offlineStorage.addEvent(request.service, request.params)\n      }\n    },\n\n    hasToSend: function (request) {\n      return false\n    },\n\n    getState: function () {\n      return Transform.STATE_OFFLINE\n    }\n\n  })\n\nmodule.exports = OfflineTransform\n","/* global atv */\nvar Transform = require('./transform')\nvar HlsParser = require('./resourceparsers/formatparsers/hlsparser')\nvar CdnParser = require('./resourceparsers/cdnparser')\nvar CdnSwitch = require('./resourceparsers/cdnSwitch')\nvar DashParser = require('./resourceparsers/formatparsers/dashparser')\nvar Parser = require('./resourceparsers/formatparsers/parser')\nvar LocationheaderParser = require('./resourceparsers/formatparsers/locationheaderparser')\nvar Log = require('../../log')\nvar Constants = require('../../constants')\n\nvar ResourceTransform = Transform.extend(\n  /** @lends youbora.ResourceTransform.prototype */\n  {\n    /**\n     * This class parses resource to fetch HLS transportstreams and CDN-related info.\n     *\n     * @constructs ResourceTransform\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     */\n    constructor: function (plugin) {\n      ResourceTransform.__super__.constructor.apply(this, arguments)\n\n      this._plugin = plugin\n      this._realResource = null\n      this._transportFormat = null\n      this._initResource = null\n      this._cdnName = null\n      this._cdnNodeHost = null\n      this._cdnNodeTypeString = null\n      this._cdnNodeType = null\n      this._responses = {}\n      this._isBusy = false\n\n      this.transformName = 'Resource'\n    },\n\n    /**\n     * Get the resource. If the transform is done, the real (parsed) resource will be returned\n     * Otherwise the initial one is returned.\n     *\n     * @return {string} The initial or parsed resource\n     */\n    getResource: function () {\n      return this._realResource\n    },\n\n    _getInitialCdnResource: function () {\n      return this._realResource || this._initResource\n    },\n\n    /**\n     * Get the transport format. If the transform detected the chunk format it will be returned, if not, null.\n     *\n     * @return {string} The streaming protocol\n     */\n    getTransportFormat: function () {\n      return this._transportFormat\n    },\n\n    /**\n     * Get the parsed CDN name.\n     *\n     * @return {string} The CDN name or null if unknown\n     */\n    getCdnName: function () {\n      return this._cdnName\n    },\n\n    /**\n     * Get the parsed CDN node.\n     *\n     * @return {string} The CDN node or null if unknown\n     */\n    getNodeHost: function () {\n      return this._cdnNodeHost\n    },\n\n    /**\n     * Get the parsed CDN type string, as returned in the cdn header response.\n     *\n     * @return {string} The CDN type string\n     */\n    getNodeTypeString: function () {\n      return this._cdnNodeTypeString\n    },\n\n    /**\n     * Get the parsed CDN type, parsed from the type string.\n     *\n     * @return {string} The CDN type\n     */\n    getNodeType: function () {\n      return this._cdnNodeType\n    },\n\n    /**\n     * Start the execution. Can be called more than once. If already running, it will be ignored,\n     * if ended it will restart.\n     * @param {string} resource the original resource\n     */\n    init: function (resource) {\n      if (!resource) {\n        this.done()\n        return\n      }\n      if (!this._isBusy) {\n        this._isBusy = true\n        this._initResource = resource\n        this._parseManifestEnabled = this._plugin.isParseManifest()\n        this._cdnEnabled = this._plugin.isParseCdnNode()\n        this._cdnList = this._plugin.getParseCdnNodeList().slice() // clone\n        CdnParser.setBalancerHeaderName(this._plugin.getParseCdnNodeNameHeader(), this._plugin.getParseNodeHeader())\n\n        this._setTimeout()\n        if (this._parseManifestEnabled) {\n          if (!this._isFinalUrl(this._initResource)) {\n            this.parseManifest() // Unknown lastManifest or lastSrc, call without arguments\n          } else {\n            this._realResource = this._initResource\n            this.done()\n          }\n        } else {\n          this._parseCDN()\n        }\n      }\n    },\n\n    _isFinalUrl: function (url) {\n      var segmentExtensions = ['.ts', '.mp4', '.m4s', '.cmfv']\n      url = url || ''\n      for (var i in segmentExtensions) {\n        var ext = segmentExtensions[i]\n        if (url.lastIndexOf(ext) === url.length - ext.length) {\n          return true\n        }\n      }\n      return false\n    },\n\n    // done: function () {\n    //  Transform.prototype.done.apply(this, arguments) // super\n    // },\n\n    _setTimeout: function () {\n      // Abort operation after 3s\n      var timeoutComplete = function () {\n        if (this._isBusy) {\n          this.done()\n          Log.warn('ResourceTransform has exceded the maximum execution time (3s) and will be aborted.')\n        }\n      }.bind(this)\n      try {\n        this._parseTimeout = setTimeout(timeoutComplete, 3000)\n      } catch (err) {\n        if (typeof atv !== 'undefined') {\n          this._parseTimeout = atv.setTimeout(timeoutComplete, 3000)\n        } else {\n          Log.error(err)\n        }\n      }\n    },\n\n    parseManifest: function (lastManifest, lastSrc) {\n      var headers = this._plugin.options['parse.manifest.auth']\n      var parserArray = [new LocationheaderParser(headers), new DashParser(headers), new HlsParser(headers)]\n      this._parseManifest(parserArray, lastManifest, lastSrc || this._initResource)\n    },\n\n    _parseManifest: function (parserArray, lastManifest, lastSrc, format) {\n      if (parserArray.length > 0) {\n        var parser = parserArray[0]\n        if (parser.shouldExecute(lastManifest)) {\n          parser.on(Parser.Event.DONE, function () {\n            this._parseManifest(parserArray.slice(1, parserArray.length), parser.getLastManifest(), parser.getResource(), parser.getTransportFormat() || format)\n          }.bind(this))\n          parser.parse(lastSrc, lastManifest)\n        } else {\n          this._parseManifest(parserArray.slice(1, parserArray.length), lastManifest, lastSrc, format)\n        }\n      } else {\n        this._transportFormat = format\n        this._realResource = lastSrc\n        this._parseCDN()\n      }\n    },\n\n    _parseCDN: function () {\n      if (this._plugin.isCdnSwitch()) {\n        this.switchDetector = new CdnSwitch(this._plugin)\n        this.switchDetector.on(CdnSwitch.Events.DONE, function (resp) {\n          this._cdnName = resp.data\n          this.done()\n        }.bind(this))\n\n        this.switchDetector.on(CdnSwitch.Events.ERROR, function () {\n          this.done()\n        }.bind(this))\n        this.switchDetector.init()\n      } else if (this._cdnEnabled && this._cdnList.length > 0) {\n        var cdn = this._cdnList.shift()\n\n        if (this.getNodeHost()) return // abort\n\n        var cdnParser = CdnParser.create(cdn)\n        if (cdnParser) {\n          cdnParser.on(CdnParser.Event.DONE, function () {\n            this._responses = cdnParser.getResponses()\n            this._cdnName = cdnParser.getParsedCdnName()\n            this._cdnNodeHost = cdnParser.getParsedNodeHost()\n            this._cdnNodeTypeString = cdnParser.getParsedNodeTypeString()\n            this._cdnNodeType = cdnParser.getParsedNodeType()\n            if (this.getNodeHost()) {\n              this.done()\n            } else {\n              this._parseCDN()\n            }\n          }.bind(this))\n          // Run parse\n          cdnParser.parse(this._getInitialCdnResource(), this._responses)\n        } else {\n          this._parseCDN()\n        }\n      } else {\n        this.done()\n      }\n    },\n\n    /**\n     * Replaces the resource and/or Cdn info for the /start service.\n     *\n     * @param {YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      if (request.service === Constants.Service.START) {\n        var lastSent = this._plugin.requestBuilder.lastSent\n        lastSent.parsedResource = request.params.parsedResource = this.getResource() || request.params.parsedResource\n        lastSent.transportFormat = request.params.transportFormat = this.getTransportFormat() || request.params.transportFormat\n        if (this._cdnEnabled) {\n          lastSent.cdn = request.params.cdn = request.params.cdn || this.getCdnName()\n          lastSent.nodeHost = request.params.nodeHost = this.getNodeHost() || request.params.nodeHost\n          lastSent.nodeType = request.params.nodeType = this.getNodeType() || request.params.nodeType\n          lastSent.nodeTypeString = request.params.nodeTypeString = this.getNodeTypeString() || request.params.nodeTypeString\n        }\n      }\n    }\n  })\n\nmodule.exports = ResourceTransform\n","var Emitter = require('../../../emitter')\nvar Log = require('../../../log')\nvar YBRequest = require('../../request')\n\nvar CdnSwitch = Emitter.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.headerName = 'x-cdn'\n  },\n\n  init: function () {\n    var url = null\n    if (this.plugin) {\n      if (this.plugin.getAdapter() && this.plugin.getAdapter().getURLToParse()) {\n        url = this.plugin.getAdapter().getURLToParse()\n      } else {\n        url = this.plugin.getResource()\n      }\n    }\n    if (this.plugin && this.plugin.getAdapter() && this.plugin.getAdapter().flags.isStarted) {\n      this._request(url)\n    }\n  },\n\n  done: function (data) {\n    this.emit(CdnSwitch.Events.DONE, data)\n  },\n\n  error: function () {\n    this.emit(CdnSwitch.Events.ERROR)\n  },\n\n  _successfulRequest: function (resp) {\n    setTimeout(this.init.bind(this), parseInt(this.plugin.options['parse.cdnTTL']) * 1000)\n    var headers = resp.getResponseHeaders().split('\\n')\n    var cdn = null\n    for (var i in headers) {\n      var line = headers[i]\n      var index = line.indexOf(this.headerName)\n      if (index > -1) {\n        cdn = line.substring(index + this.headerName.length + 1, line.length - 1).replace(' ', '')\n      }\n    }\n    this.done(cdn)\n  },\n\n  _failedRequest: function () {\n    setTimeout(this.init.bind(this), parseInt(this.plugin.options['parse.cdnTTL']) * 1000)\n    Log.warn('CDN switch detection request failed')\n    this.error()\n  },\n\n  _request: function (url) {\n    var request = new YBRequest(url, null, null, { method: 'HEAD', cache: true })\n    request.on(YBRequest.Event.SUCCESS, this._successfulRequest.bind(this))\n    request.on(YBRequest.Event.ERROR, this._failedRequest.bind(this))\n    request.send()\n  }\n\n}, {\n  Events: {\n    DONE: 'done',\n    ERROR: 'error'\n  }\n})\n\nmodule.exports = CdnSwitch\n","var Emitter = require('../../../emitter')\nvar Log = require('../../../log')\nvar Util = require('../../../util')\nvar YBRequest = require('../../request')\n\nvar CdnParser = Emitter.extend(\n  /** @lends youbora.CdnParser.prototype */\n  {\n    /**\n         * Class that asynchronously tries to get information about the CDN where a given resource is\n         * hosted.\n         *\n         * The info we care about is the CDN code itself, the node host and node type.\n         *\n         * The CDN is queried with http HEAD requests. This only will work if the CDN has been properly\n         * configured.\n         *\n         * When HEAD requests are performed against the resources, the CDN returns a set of headers that\n         * contain info about the cdn header and/or cdn type.\n         *\n         * Each CDN is different; some require special headers to be set when the HEAD request is\n         * performed and others don't. Also, the info can come back in any fashion of ways, sometimes\n         * both type and host come in the same response header while sometimes they're in different\n         * headers. The format of these response headers is also different from CDN to CDN, so a\n         * different regex is used for each CDN.\n         *\n         * Lastly, as the values indicating the CDN type are also different, we need a specific mapping\n         * for each one.\n         *\n         * Every instance of this class will represent a 'way' of parsing the HEAD response. So an\n         * instance should be created for Level3, Akamai, Highwinds, etc...\n         *\n         * @constructs CdnParser\n         * @extends youbora.Emitter\n         * @memberof youbora\n         *\n         * @param {object} options This object represents the configuration of a certain CDN parsing\n         * methodology.\n         * @param {string} options.cdnName see {@link CdnParser#setCdnName}.\n         * @param {array} options.parsers see {@link CdnParser#addParser}.\n         * @param {array} options.requestMethod see {@link CdnParser#setRequestMethod}.\n         * @param {array} options.requestHeaders see {@link CdnParser#setRequestHeader}.\n         * @param {function} options.parseType see {@link CdnParser#setParseType}.\n         */\n    constructor: function (options) {\n      this._options = Util.assign({\n        cdnName: null,\n        parsers: [],\n        requestMethod: 'HEAD',\n        requestHeaders: {},\n        parseType: function () { return 0 }\n      }, options)\n\n      this._responses = {}\n    },\n\n    /**\n         * Emits DONE event\n         */\n    done: function () {\n      this.emit(CdnParser.Event.DONE)\n    },\n\n    /**\n         * Adds an object that represents a parse step of the headers.\n         *\n         * Each parser item will define the element parsed (whether if it is a host, a type, both...)\n         * a headerName to parse (ie: x-cache) and a regex to execute over that header.\n         *\n         * @param {object} parser\n         * @param {string} parser.element Which element will be parsed from the request.\n         * Use {@link CdnParser.ElementType} enum.\n         * @param {string} parser.headerName Name of the header to parse.\n         * @param {regex} parser.regex Regex to match against the header content.\n         *\n         * @return itself to chain method calls\n         */\n    addParser: function (parser) {\n      this._options.parsers.push(parser)\n      return this\n    },\n\n    /**\n         * Sets the cdn name. Note that this names are provided by Youbora and must coincede with the\n         * ones offered here: {@link http://mapi.youbora.com:8081/cdns}.\n         *\n         * @return itself to chain method calls\n         */\n    setCdnName: function (name) {\n      this._options.cdnName = name\n      return this\n    },\n\n    /**\n         * Sets the method of the request. HEAD by default.\n         *\n         * @return itself to chain method calls\n         */\n    setRequestMethod: function (method) {\n      this._options.requestMethod = method\n      return this\n    },\n\n    /**\n         * if this CDN requires special headers to be set in order to respond with the info we want,\n         * add them using this method.\n         *\n         * @param {string} key Name of the header.\n         * @param {string} value Content of the header.\n         *\n         * @return itself to chain method calls\n         */\n    setRequestHeader: function (key, value) {\n      this._options.requestHeaders[key] = value\n      return this\n    },\n\n    /**\n         * Adds a parsing function for parsing the type (hit or miss) of the request.\n         *\n         * Parser fucntion will receive a string parsed from a type header (see\n         * {@link CdnParser#addParser}). Should return 1 in case of HIT, 2 in case of MISS and\n         * 0 otherwise.\n         *\n         * @param {function} parser Parsing function\n         *\n         * @return itself to chain method calls\n         */\n    setParseType: function (parser) {\n      this._options.parseType = parser\n      return this\n    },\n\n    /**\n         * Get parsed CDN name.\n         *\n         * @return {string} The CDN name or null if unknown\n         */\n    getParsedCdnName: function () {\n      return this._cdnName\n    },\n\n    /**\n         * Get the parsed CDN node.\n         *\n         * @return {string} The CDN node or null if unknown\n         */\n    getParsedNodeHost: function () {\n      return this._cdnNodeHost\n    },\n\n    /**\n         * Get the parsed CDN type string, as returned in the cdn header response.\n         *\n         * @return {string} The CDN type string\n         */\n    getParsedNodeTypeString: function () {\n      return this._cdnNodeTypeString\n    },\n\n    /**\n         * Get the parsed CDN type, parsed from the type string.\n         *\n         * @return {string} The CDN type\n         */\n    getParsedNodeType: function () {\n      return this._cdnNodeType\n    },\n\n    /**\n         * Returns the request responses from this CdnParser.\n         * This is filled with the responses from the constructor, or created empty if null.\n         * Then the performed request response (if any) is added to this map.\n         * Call this method after \"using\" the CdnParser and pass the responses to the following\n         * CdnParser so it can use the responses if it applies.\n         * @return the request responses\n         */\n    getResponses: function () {\n      return this._responses\n    },\n\n    /**\n         * Parses given headers to check for matches.\n         */\n    parse: function (url, responses) {\n      this._responses = responses || {}\n      var headerString = JSON.stringify(this._options.requestHeaders)\n      if (this._responses[headerString]) {\n        this._parseResponse(this._responses[headerString])\n      } else {\n        this._requestResponse(url)\n      }\n    },\n\n    _requestResponse: function (url) {\n      var headerString = JSON.stringify(this._options.requestHeaders)\n      var useheaders = headerString !== '{}'\n\n      var request = new YBRequest(url, null, null, {\n        method: this._options.requestMethod,\n        maxRetries: 0,\n        requestHeaders: this._options.requestHeaders,\n        cache: true\n      })\n\n      request.on(YBRequest.Event.SUCCESS, function (resp) {\n        this._responses[headerString] = resp.getResponseHeaders()\n        this._parseResponse(this._responses[headerString])\n      }.bind(this))\n\n      request.on(YBRequest.Event.ERROR, function (resp) {\n        if (useheaders) {\n          this._options.requestHeaders = {}\n          this._requestResponse(url)\n        } else {\n          this.done()\n        }\n      }.bind(this))\n\n      request.send()\n    },\n\n    _parseResponse: function (headers) {\n      this._options.parsers.forEach(function (parser) {\n        var headerName = (parser.headerName)\n          ? parser.headerName.toLowerCase()\n          : ''\n        if (headerName) {\n          headers.split('\\n').forEach(function (line) {\n            var index = line.indexOf(':')\n            if (index !== -1) {\n              var key = line.slice(0, index).toLowerCase()\n              if (key === headerName) {\n                this._executeParser(parser, line.slice(index + 1))\n              }\n            }\n          }.bind(this))\n        }\n      }.bind(this))\n      this.done()\n    },\n\n    _executeParser: function (parser, value) {\n      try {\n        var matches = parser.regex.exec(value.trim())\n        if (matches !== null) {\n          if (this._options.cdnName) this._cdnName = this._options.cdnName\n          switch (parser.element) {\n            case CdnParser.ElementType.HOST:\n              this._cdnNodeHost = matches[1]\n              break\n            case CdnParser.ElementType.TYPE:\n              this._cdnNodeTypeString = matches[1]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              break\n            case CdnParser.ElementType.HOST_AND_TYPE:\n              this._cdnNodeHost = matches[1]\n              this._cdnNodeTypeString = matches[2]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              break\n            case CdnParser.ElementType.TYPE_AND_HOST:\n              this._cdnNodeTypeString = matches[1]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              this._cdnNodeHost = matches[2]\n              break\n            case CdnParser.ElementType.NAME:\n              this._cdnName = matches[1].toUpperCase()\n              break\n          }\n        }\n      } catch (err) {\n        Log.warn('CDN parsing for ' + this._options.cdnName +\n          ' could not parse header value ' + value)\n      }\n    },\n\n    shouldExecute: function () {\n      return true\n    }\n\n  },\n\n  /** @lends youbora.CdnParser */\n  {\n    // Static members\n\n    /**\n         * List of events that could be fired from this class.\n         *\n         * @enum\n         */\n    Event: {\n      /** Notifies that this CdnParser is done processing. */\n      DONE: 'done'\n    },\n\n    /**\n         * Possible different bits of info we can get from a header.\n         *\n         * @enum\n         */\n    ElementType: {\n      HOST: 'host',\n      TYPE: 'type',\n      HOST_AND_TYPE: 'host+type',\n      TYPE_AND_HOST: 'type+host',\n      NAME: 'name'\n    },\n\n    /**\n         * List of available CDN parsers.\n         * @private\n         */\n    _cdnConfigs: {},\n\n    /**\n         * This is a special case. The BalancerCdnParser is a custom CDN definition\n         * that tries to get the CDN name directly from one of the headers. This method can be used\n         * as a shortcut to creating a new CDN definition.\n         *\n         * This is usually used with DNS-based load balance services, such as Cedexis.\n         *\n         * Youboralib will use this method by itself using the configuration passed in the\n         * {@link Options}.\n         *\n         * @param {string} cdnNameHeader the header response name where to get the CDN name from.\n         * @param {string} cdnNodeNameHeader the header response name where to get the host name from.\n         */\n    setBalancerHeaderName: function (name, nodename) {\n      CdnParser._cdnConfigs.Balancer.parsers[0].headerName = name\n      CdnParser._cdnConfigs.Balancer.parsers[1].headerName = nodename\n    },\n\n    /**\n         * Create one of the pre-defined CDN parsers. This method will be called with the keys passed\n         * to {@link Options#'parse.CdnNode.list'}.\n         *\n         * Before using this method, configs must be added first using {@link CdnParser.add}.\n         *\n         * @param {string} cdnName Name of the CDN\n         * @return {CdnParser} An instance or undefined if the names does not match any CDN.\n         */\n    create: function (key) {\n      if (CdnParser._cdnConfigs[key]) {\n        return new CdnParser(CdnParser._cdnConfigs[key])\n      } else {\n        Log.warn('Tried to create an unexisting CdnParser named ' + key)\n      }\n    },\n\n    /**\n         * Adds the given CdnParser's config to the available list. Objects sent must comply with\n         * CdnParser constructor.\n         *\n         * @param {string} key The name that will identify the CDN.\n         * @param {Object} config The parser that defines the CDN.\n         */\n    add: function (key, config) {\n      CdnParser._cdnConfigs[key] = config\n    }\n  }\n)\n\n// Adding built-in parsers\nCdnParser.add('Level3', require('./cdnparsers/level3'))\nCdnParser.add('Cloudfront', require('./cdnparsers/cloudfront'))\nCdnParser.add('Akamai', require('./cdnparsers/akamai'))\nCdnParser.add('Highwinds', require('./cdnparsers/highwinds'))\nCdnParser.add('Fastly', require('./cdnparsers/fastly'))\nCdnParser.add('Telefonica', require('./cdnparsers/telefonica'))\nCdnParser.add('Amazon', require('./cdnparsers/amazon'))\nCdnParser.add('Edgecast', require('./cdnparsers/edgecast'))\nCdnParser.add('Balancer', require('./cdnparsers/balancer'))\nCdnParser.add('NosOtt', require('./cdnparsers/nosott'))\n\nmodule.exports = CdnParser\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'AKAMAI',\n  // requestMethod: 'GET',\n  parsers: [{\n    element: 'type+host',\n    headerName: 'X-Cache',\n    regex: /(.+)\\sfrom.+AkamaiGHost\\/(.+)\\).+/\n  }, {\n    element: 'host',\n    headerName: 'akamai-mon-iucid-del',\n    regex: /(.*)/\n  }, {\n    element: 'type',\n    headerName: 'akamai-cache-status',\n    regex: /(.+)\\sfrom\\schild/\n  }],\n  requestHeaders: {\n    Pragma: 'akamai-x-cache-on'\n  },\n  parseType: function (type) {\n    var t = type.toLowerCase()\n    if (t.indexOf('hit') !== -1) {\n      return 1\n    } else if (t.indexOf('miss') !== -1) {\n      return 2\n    }\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'AMAZON',\n  parsers: [{\n    element: 'host',\n    headerName: 'x-amz-cf-pop',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'x-cache',\n    regex: /(.+)\\sfrom.+/\n  }],\n  parseType: function (type) {\n    if (type.toLowerCase().indexOf('hit') !== -1) {\n      return 1\n    } else if (type.toLowerCase().indexOf('miss') !== -1) {\n      return 2\n    }\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  parsers: [{\n    element: 'name',\n    headerName: null,\n    regex: /(.+)/\n  },\n  {\n    element: 'host',\n    headerName: null,\n    regex: /(.+)/\n  }]\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'CLOUDFRT',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-Amz-Cf-Id',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(\\S+)\\s.+/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'Hit':\n        return 1\n      case 'Miss':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'EDGECAST',\n  parsers: [{\n    element: 'host',\n    headerName: 'Server',\n    regex: /\\((.+)\\/.+\\)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(.+)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'HIT':\n        return 1\n      case 'MISS':\n      default:\n        return 2\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'FASTLY',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-Served-By',\n    regex: /([^,\\s]+)$/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /([^,\\s]+)$/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'HIT':\n        return 1\n      case 'MISS':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'HIGHNEGR',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'X-HW',\n    regex: /.+,[0-9]+\\.(.+)\\.(.+)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'c':\n      case 'x':\n        return 1\n      default:\n        return 2\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'LEVEL3',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'X-WR-Diag',\n    regex: /Host:(.+)\\sType:(.+)/\n  }],\n  requestHeaders: {\n    'X-WR-Diag': 'host'\n  },\n  parseType: function (type) {\n    if (type) {\n      if (\n        type.indexOf('TCP_HIT') === 0 ||\n        type.indexOf('TCP_MEM_HIT') === 0 ||\n        type.indexOf('TCP_IMS_HIT') === 0\n      ) {\n        return 1\n      } else if (type.indexOf('TCP_MISS') === 0) {\n        return 2\n      }\n    }\n\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'NOSOTT',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-NOS-Server',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(.*)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'Hit':\n        return 1\n      case 'Miss':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'TELEFO',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'x-tcdn',\n    regex: /Host:(.+)\\sType:(.+)/\n  }],\n  requestHeaders: {\n    'x-tcdn': 'host'\n  },\n  parseType: function (type) {\n    if (type) {\n      if (\n        type.indexOf('p') !== -1 ||\n        type.indexOf('c') !== -1\n      ) {\n        return 1\n      } else if (type.indexOf('i') !== -1 ||\n        type.indexOf('m') !== -1) {\n        return 2\n      }\n    }\n    return 0\n  }\n}\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\nvar Log = require('../../../../log')\nvar TransportFormat = require('../../../../constants/transportFormat')\n\nvar DashParser = Parser.extend(\n  /** @lends youbora.DashParser.prototype */\n  {\n    /**\n     * Starts the Dash parsing from the given resource. The first (outside) call should set the\n     * parentResource to null.\n     *\n     * @param {string} resource The resource url.\n     */\n    parse: function (resource, lastManifest) {\n      if (!lastManifest) {\n        var request = new YBRequest(resource, null, null, { cache: true, requestHeaders: this._headers })\n\n        request.on(YBRequest.Event.SUCCESS, function (resp) {\n          this.parseLocation(resp, resource)\n        }.bind(this))\n\n        request.on(YBRequest.Event.ERROR, function (resp) {\n          this.done()\n        }.bind(this))\n\n        request.send()\n      } else {\n        this.parseLocation(lastManifest, resource)\n      }\n    },\n\n    parseLocation: function (lastManifest, resource) {\n      this.iterations--\n      var locationRegexp = new RegExp(/<Location>([\\s\\S]+)<\\/Location>/)\n      try {\n        this._lastManifest = lastManifest\n        var manifest = lastManifest.getResponseText()\n        var matches = locationRegexp.exec(manifest)\n\n        if (matches && matches[1]) {\n          var newRes = this._htmlDecode(matches[1].replace('\\n', ''))\n        }\n        if (newRes && newRes !== resource && this.iterations > 0) {\n          this.parse(newRes)\n        } else {\n          this.parseFinalResource(manifest, resource)\n        }\n      } catch (err) {\n        Log.warn('Dash parse failed')\n        this.done()\n      }\n    },\n\n    _htmlDecode: function (input) {\n      if (typeof document !== 'undefined' && typeof document.createElement === 'function') {\n        var e = document.createElement('textarea')\n        e.innerHTML = input\n        return e.childNodes && e.childNodes.length ? e.childNodes[0].nodeValue : input\n      }\n      return input\n    },\n\n    parseFinalResource: function (manifest, resource) {\n      var baseUrlRegexp = new RegExp(/<BaseURL>[\\r\\n]*(.*?)[\\r\\n]*<\\/BaseURL>/)\n      var segmentUrlRegexp = new RegExp(/<SegmentURL[\\s\\S]*media=\"([^\"]+)/)\n      var segmentTemplateRegexp = new RegExp(/<SegmentTemplate[\\s\\S]*media=\"([^\"]+)/)\n      var matches = null\n      // first: base url, second: segment url, third: segment template\n      try {\n        matches = baseUrlRegexp.exec(manifest) || segmentTemplateRegexp.exec(manifest) || segmentUrlRegexp.exec(manifest)\n        this._getManifestMetadata(manifest)\n        if (matches && matches[1] && this._isFullUrl(matches[1])) {\n          if (matches[1].indexOf('\"') > 0) {\n            this._realResource = matches[1].substr(0, matches[1].indexOf('\"')).replace('\\n', '')\n          } else {\n            this._realResource = matches[1].replace('\\n', '')\n          }\n        } else {\n          this._realResource = resource\n        }\n      } catch (err) {\n        Log.warn('Dash manifest parse failed')\n      }\n      this.done()\n    },\n\n    _getManifestMetadata: function (manifest) {\n      try {\n        var transportFormatRegexp = new RegExp(/<AdaptationSet[\\s\\S]*mimeType=\"video\\/([^\"]+)/)\n        var matches = transportFormatRegexp.exec(manifest)\n        var ret = null\n        switch (matches[1]) {\n          case 'mp4':\n          case 'm4s':\n            ret = TransportFormat.MP4\n            break\n          case 'mp2t':\n            ret = TransportFormat.MPEG2\n            break\n          case 'cmfv':\n            ret = TransportFormat.CMF\n            break\n        }\n        this._transportFormat = ret\n      } catch (err) {\n        Log.warn('Couldnt find the transport format')\n      }\n    },\n\n    _isFullUrl: function (url) {\n      return url.indexOf('http') !== -1\n    },\n\n    shouldExecute: function (lastManifest) {\n      var ret = true\n      if (lastManifest) {\n        var response = lastManifest.getResponseText()\n        ret = response.indexOf('<MPD') !== -1\n      }\n      return ret\n    }\n  }\n)\n\nmodule.exports = DashParser\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\nvar Log = require('../../../../log')\nvar TransportFormat = require('../../../../constants/transportFormat')\n\nvar HlsParser = Parser.extend(\n  /** @lends youbora.HlsParser.prototype */\n  {\n    /**\n     * Starts the HLS parsing from the given resource. The first (outside) call should set the\n     * parentResource to null.\n     *\n     * @param {string} resource Either the resource url or the manifest body.\n     * @param {string} parentResource Parent resource in case relative paths are sent.\n     */\n    parse: function (resource, lastManifest, parentResource) {\n      parentResource = parentResource || ''\n      var matches = null\n      try {\n        matches = /((\\S*?)(\\.m3u8|\\.m3u|\\.ts|\\.m4s|\\.mp4|\\.cmfv)((\\?|;)\\S*|\\n|\\r|$))/i.exec(resource.replaceAll(',URI=', '\\n').replaceAll('\"', '').replaceAll(',', '\\n'))\n      } catch (err) {\n        Log.warn('Parse HLS Regex failed', err)\n        this.done()\n      }\n\n      if (matches !== null) { // get first line ending in .m3u8, .m3u, .mp4, .cmfv or .ts\n        var res = matches[1].trim()\n        var prevParent = ''\n        var index = parentResource.lastIndexOf('/')\n        if (res.indexOf('http') !== 0 && index !== -1) {\n          // If does not start with http, add parentResource relative route.\n          if (res[0] === '/' && res[1] !== '/') {\n            // if its a relative route not using the same path, but the same domain\n            var ind = parentResource.indexOf('/') + 1\n            ind += parentResource.substr(ind, parentResource.length).indexOf('/') + 1 // Second '/'\n            ind += parentResource.substr(ind, parentResource.length).indexOf('/') // Third '/'\n            res = parentResource.slice(0, ind) + res\n          } else {\n            // if its sharing the (omitted) path\n            res = parentResource.slice(0, index) + '/' + res\n          }\n          prevParent = parentResource.slice(0, index) + '/'\n        }\n\n        if (matches[3] === '.m3u8' || matches[3] === '.m3u') { // It is m3u8 or m3u...\n          if (!lastManifest) {\n            var request = new YBRequest(res, null, null, { cache: true, requestHeaders: this._headers })\n\n            request.on(YBRequest.Event.SUCCESS, function (resp) {\n              this._parseWithManifest(resp, prevParent, matches)\n            }.bind(this))\n\n            request.on(YBRequest.Event.ERROR, function (resp) {\n              this.done()\n            }.bind(this))\n\n            request.send()\n          } else {\n            this._parseWithManifest(lastManifest, prevParent, matches)\n          }\n        } else { // It is mp4 or ts...\n          switch (matches[3]) {\n            case '.mp4':\n            case '.m4s':\n              this._transportFormat = TransportFormat.MP4\n              break\n            case '.ts':\n              this._transportFormat = TransportFormat.MPEG2\n              break\n            case '.cmfv':\n              this._transportFormat = TransportFormat.CMF\n          }\n          this._realResource = res\n          this.done()\n        }\n      } else {\n        this.done()\n      }\n    },\n\n    _parseWithManifest: function (resp, prevParent, matches) {\n      this._lastManifest = resp\n      this.parse(resp.getResponseText(), null, prevParent + matches[2])\n    },\n\n    shouldExecute: function (lastManifest) {\n      var ret = true\n      if (lastManifest) {\n        var response = lastManifest.getResponseText()\n        ret = response.indexOf('#EXTM3U') !== -1\n      }\n      return ret\n    }\n  }\n)\n\nmodule.exports = HlsParser\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\n\nvar LocationheaderParser = Parser.extend(\n  /** @lends youbora.LocationheaderParser.prototype */\n  {\n    /**\n     * Parses given header to check.\n     */\n    parse: function (url, lastManifest) {\n      if (!lastManifest) {\n        this._realResource = url\n        var request = new YBRequest(url, null, null, {\n          cache: true,\n          requestHeaders: this._headers\n        })\n\n        request.on(YBRequest.Event.SUCCESS, function (resp) {\n          this._parseWithManifest(resp)\n        }.bind(this))\n\n        request.on(YBRequest.Event.ERROR, function (resp) {\n          this.done()\n        }.bind(this))\n\n        request.send()\n      } else {\n        this._parseWithManifest(lastManifest)\n      }\n    },\n\n    _parseWithManifest: function (resp) {\n      this._lastManifest = resp\n      var response = resp.getResponseHeaders()\n      var found = false\n      if (resp && resp.xhr && resp.xhr.responseURL && resp.xhr.responseURL !== this._realResource) {\n        this._realResource = resp.xhr.responseURL\n        this.parse(this._realResource)\n        found = true\n      } else {\n        response.split('\\n').forEach(function (line) {\n          if (line.startsWith('Location:')) {\n            this._realResource = line.slice(10)\n            this.parse(this._realResource)\n            found = true\n          }\n        }.bind(this))\n      }\n      if (!found) {\n        this.done()\n      }\n    }\n  }\n)\n\nmodule.exports = LocationheaderParser\n","var Emitter = require('../../../../emitter')\n\nvar Parser = Emitter.extend(\n  /** @lends youbora.Parser.prototype */\n  {\n    /**\n     * Class that asynchronously parses a resource in order to get to the URL.\n     *\n     * Since the CDN detection is performed with the resource url, it is essential that this\n     * resource url is pointing to the CDN that is actually hosting the manifest.\n     *\n     * @constructs Parser\n     * @extends youbora.Emitter\n     * @memberof youbora\n     */\n    constructor: function (headers) {\n      this._realResource = null\n      this._lastManifest = null\n      this._transportFormat = null\n      this.iterations = 3\n      this._headers = headers\n    },\n\n    /**\n     * Emits DONE event\n     */\n    done: function () {\n      this.iterations = 3\n      this.emit(Parser.Event.DONE)\n    },\n\n    /**\n     * Starts the parsing from the given resource.\n     *\n     * @param {string} resource The resource url.\n     * @param {object} lastManifest The manifest request response if parsed previously.\n     */\n    parse: function (resource, lastManifest) { },\n\n    /**\n     * Get the parsed resource. Will be null/undefined if parsing is not yet started and can be a partial\n     * (an intermediate manifest) result if the parser is still running.\n     *\n     * @return {string} The parsed resource.\n     */\n    getResource: function () {\n      return this._realResource\n    },\n\n    /**\n     * Get the transport format. Will be null/undefined if parsing is not yet started or is still running.\n     *\n     * @return {string} The parsed resource.\n     */\n    getTransportFormat: function () {\n      return this._transportFormat\n    },\n\n    /**\n     * Get the last request manifest response object used to parse the resource.\n     * Will be null/undefined if parsing is not yet started and can be a partial\n     * (an intermediate manifest) result if the parser is still running.\n     *\n     * @return {object} The last manifest request response used to parse the resource.\n     */\n    getLastManifest: function () {\n      return this._lastManifest\n    },\n\n    /**\n     * Get the result of checking a previous manifest to detect if the parser should be used or not.\n     *\n     * @param {string} resource The resource url.\n     * @return {object} The last manifest request response used to parse the resource.\n     */\n    shouldExecute: function (lastManifest) {\n      return true\n    }\n  },\n\n  /** @lends youbora.Parser */\n  {\n    // Static members\n\n    /**\n     * List of events that could be fired from this class.\n     * @enum\n     */\n    Event: {\n      /** Notifies that this DashParser is done processing. */\n      DONE: 'done'\n    }\n  }\n)\n\nmodule.exports = Parser\n","var Emitter = require('../../emitter')\n\nvar Transform = Emitter.extend(\n  /** @lends youbora.Transform.prototype */\n  {\n    /**\n     * Transform classes in YOUBORA help the library parse and work with data.\n     *\n     * A Transform makes some kind of task that may block requests until it's done, or applies changes\n     * to the requests right before they're finally sent.\n     *\n     * {@link ResourceTransform}, {@link ViewTransform}... all extend from this class.\n     *\n     * @constructs Transform\n     * @extends youbora.Emitter\n     * @memberof youbora\n     * @abstract\n     */\n    constructor: function () {\n      /**\n       * Whether the Transform is currently working or not.\n       * @private\n       */\n      this._isBusy = true\n      this._sendRequest = true\n      this.transformName = 'Transform'\n    },\n\n    /**\n     * Override this method to transform info.\n     *\n     * @param {YBRequest} request Request to transform.\n     */\n    parse: function (request) { },\n\n    /**\n     * By default this will return true until {@link #done()} is called. This can be overridden\n     * in order to block {@link Request}s based on any criteria. For instance its\n     * {@link Request#getService()}.\n     *\n     * @param {YBRequest} request Request to transform.\n     * @return {bool} True if queue shall be blocked.\n     */\n    isBlocking: function (request) {\n      return this._isBusy\n    },\n\n    /**\n     * Emits DONE event\n     */\n    done: function () {\n      this._isBusy = false\n      this.emit(Transform.Event.DONE)\n    },\n\n    // offline\n    hasToSend: function (request) {\n      return this._sendRequest\n    },\n\n    getState: function () {\n      if (!this._sendRequest) {\n        return this.STATE_OFFLINE\n      }\n      if (this._isBusy) {\n        return this.STATE_BLOCKED\n      }\n      return this.STATE_NO_BLOCKED\n    }\n\n  },\n\n  /** @lends youbora.Transform */\n  {\n    // Static members\n\n    STATE_OFFLINE: 2,\n    STATE_BLOCKED: 1,\n    STATE_NO_BLOCKED: 0,\n    /**\n     * List of events that could be fired from this class.\n     * @enum\n     */\n    Event: {\n      /** Notifies that this Transform is done processing. */\n      DONE: 'done'\n    }\n  }\n)\n\nmodule.exports = Transform\n","var YBRequest = require('../request')\nvar Transform = require('./transform')\nvar Log = require('../../log')\nvar Util = require('../../util')\nvar Constants = require('../../constants')\n\nvar ViewTransform = Transform.extend(\n  /** @lends youbora.ViewTransform.prototype */\n  {\n    /**\n     * This class manages Fastdata service and view index.\n     *\n     * @constructs\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     * @param {string} session If provided, plugin will use this as a FD response.\n     */\n    constructor: function (plugin, session) {\n      Transform.prototype.constructor.apply(this, arguments)\n\n      /** /data response */\n      this.response = {}\n\n      this._viewIndex = new Date().getTime()\n\n      this._session = session\n\n      this._httpSecure = plugin.options['app.https']\n\n      this._plugin = plugin\n\n      this.transformName = 'View'\n    },\n\n    /**\n     * Starts the 'FastData' fetching. This will send the initial request to YOUBORA in order to get\n     * the needed info for the rest of the requests.\n     *\n     * This is an asynchronous process.\n     *\n     * When the fetch is complete, {@link #fastDataConfig} will contain the parsed info.\n     * @see FastDataConfig\n     */\n    init: function () {\n      // offline\n      if (this._plugin.options && this._plugin.options.offline) {\n        // set the options\n        this.response.host = 'OFFLINE'\n        this.response.code = 'OFFLINE'\n        this.response.pingTime = 60\n        this.response.beatTime = 60\n        this.done()\n        return null\n      }\n\n      // reusing old data not expired\n      if (this._plugin.storage.isEnabled()) {\n        var now = new Date().getTime()\n        if (now < this._plugin.sessionExpire + (Number(this._plugin.getDataTime()) || 0) &&\n          this._plugin.getStoredData()) {\n          this.setData(this._plugin.getStoredData())\n          return null\n        }\n      }\n\n      // request new data\n      var service = Constants.Service.DATA\n      var params = {\n        outputformat: 'json'\n      }\n\n      params = this._plugin.requestBuilder.buildParams(params, service)\n      if (params !== null) {\n        Log.notice(service + ' ' + params.system)\n        if (params.system === 'nicetest') {\n          // \"nicetest\" is the default accountCode.\n          // If found here, it's very likely that the customer has forgotten to set it.\n          Log.error(\n            'No accountCode has been set. Please set your accountCode inside plugin\\'s options.'\n          )\n        }\n\n        new YBRequest(this._plugin.getHost(), service, params)\n          .on(YBRequest.Event.SUCCESS, this._receiveData.bind(this))\n          .on(YBRequest.Event.ERROR, this._failedData.bind(this))\n          .send()\n      }\n    },\n\n    /**\n     * Uses given response to set fastdata response.\n     *\n     * @param {String} response Fastdata response as json string.\n     */\n    setData: function (response) {\n      try {\n        var resp = JSON.parse(response)\n        if (this._plugin.options['parse.fdsResponseHost']) {\n          response = response.replace(resp.q.h, this._plugin.options['parse.fdsResponseHost'](resp.q.h))\n          resp = JSON.parse(response)\n        }\n        this.response.msg = response\n        this.response.host = Util.addProtocol(resp.q.h, this._httpSecure)\n        this.response.code = resp.q.c\n        this.response.pingTime = resp.q.pt || 5\n        this.response.beatTime = resp.q.i ? resp.q.i.bt || 30 : 30\n        this.response.sessionExpire = resp.q.i ? resp.q.i.exp || 300 : 300\n        this._plugin.storage.setLocal('sessionExpire', this.response.sessionExpire)\n        this.done()\n      } catch (err) {\n        Log.error('Fastdata response is invalid.')\n      }\n    },\n\n    /**\n     * Parse the response from the fastData service.\n     *\n     * @private\n     */\n    _receiveData: function (req, e) {\n      var msg = req.getResponse()\n      this.setData(msg)\n    },\n\n    _failedData: function (req, e) {\n      Log.error('Fastdata request has failed.')\n    },\n\n    /**\n     * This method will increment the view index (timestamp values). The library handles this\n     * automatically, but some error flow might need calling this manually.\n     * @return {string} new viewcode\n     */\n    nextView: function () {\n      this._viewIndex = new Date().getTime()\n      return this.getViewCode()\n    },\n\n    /**\n     * Returns current viewcode\n     * @return {string} viewcode\n     */\n    getViewCode: function () {\n      return this.response.code + '_' + this._viewIndex\n    },\n\n    /**\n     * Returns the current session\n     *\n     * @returns {string} Session\n     */\n    getSession: function () {\n      return this._session\n    },\n\n    /**\n     * Sets the session\n     *\n     * @param {String} sessionId Sets the session\n     */\n    setSession: function (session) {\n      this._session = session\n    },\n\n    /** Sets the host url\n    *\n    * @param {String} host Sets the host\n    */\n    setHost: function (host) {\n      this.response.host = host\n    },\n\n    /**\n     * Transform requests\n     * @param {youbora.comm.YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      // Host, system and sessionRoot for all\n      request.host = request.host || this.response.host\n      request.params.system = this._plugin.getAccountCode()\n      request.params.sessionRoot = request.params.sessionRoot || this.getSession()\n\n      // PingTime for ping and start\n      if (ViewTransform.EventList.PingTime.indexOf(request.service) !== -1) {\n        request.params.pingTime = request.params.pingTime || this.response.pingTime\n      }\n\n      // ViewCode for non infinity events\n      if (ViewTransform.EventList.Infinity.indexOf(request.service) === -1) {\n        request.params.code = request.params.code || this.getViewCode()\n      } else {\n        // For infinity events, sessionId\n        request.params.sessionId = request.params.sessionRoot\n      }\n\n      // For init error and start, parentId and navContext\n      if (ViewTransform.EventList.CreateView.indexOf(request.service) !== -1) {\n        if (this._plugin.infinity.infinityStarted || (this._plugin.storage.isEnabled() && this._plugin.storage.getLocal('infinityStarted'))) {\n          request.params.parentId = request.params.sessionRoot\n          request.params.navContext = request.params.navContext || this._plugin.getContext()\n        }\n      }\n    }\n  },\n  {\n    // Static members\n    EventList: {\n      CreateView: [\n        Constants.Service.START,\n        Constants.Service.INIT,\n        Constants.Service.ERROR\n      ],\n      Infinity: [\n        Constants.Service.NAV,\n        Constants.Service.SESSION_START,\n        Constants.Service.SESSION_STOP,\n        Constants.Service.EVENT,\n        Constants.Service.BEAT\n      ],\n      PingTime: [\n        Constants.Service.START,\n        Constants.Service.PING\n      ]\n    }\n  })\n\nmodule.exports = ViewTransform\n","var Transform = require('./transform')\n\n/**\n * This transform ensures that no requests will be sent without sessionId when is required\n *\n * @constructs\n * @extends youbora.Transform\n * @memberof youbora\n * @name WrongTransform\n *\n * @param {Plugin} plugin Instance of {@link Plugin}\n */\nvar WrongTransform = Transform.extend(\n  /** @lends youbora.WrongTransform.prototype */\n  {\n    /**\n   * Returns if transform is blocking.\n   *\n   * @param {YBRequest} request Request to transform.\n   * @return {bool} True if queue shall be blocked.\n   */\n    isBlocking: function (request) {\n      if (!request.params.sessionId) {\n        return true\n      }\n      return false\n    }\n  }\n)\n\nmodule.exports = WrongTransform\n","var AdPosition = require('./constants/adPosition')\nvar Adapter = require('./constants/adapter')\nvar ManifestError = require('./constants/manifestError')\nvar RequestMethod = require('./constants/requestMethod')\nvar Service = require('./constants/service')\nvar WillSendEvent = require('./constants/willSendEvent')\nvar AdInsertionType = require('./constants/adInsertionType')\n/**\n * This static class englobes youbora constants.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Constants = {\n  AdPosition: AdPosition,\n  ManifestError: ManifestError,\n  RequestMethod: RequestMethod,\n  Service: Service,\n  WillSendEvent: WillSendEvent,\n  AdInsertionType: AdInsertionType,\n  Adapter: Adapter\n}\n\nmodule.exports = Constants\n","/**\n * List of ad insertion types\n */\nvar InsertionType = {\n  ClientSide: 'csai',\n  ServerSide: 'ssai'\n}\nmodule.exports = InsertionType\n","/**\n * List of ad positions\n */\nvar AdPosition = {\n  Preroll: 'pre',\n  Midroll: 'mid',\n  Postroll: 'post'\n}\nmodule.exports = AdPosition\n","var Event = require('./event')\n\nvar Adapter = {\n  Event: Event\n}\nmodule.exports = Adapter\n","/**\n * List of events that can be triggered by the adapter\n */\nvar Event = {\n  START: 'start',\n  JOIN: 'join',\n  PAUSE: 'pause',\n  RESUME: 'resume',\n  SEEK_BEGIN: 'seek-begin',\n  SEEK_END: 'seek-end',\n  BUFFER_BEGIN: 'buffer-begin',\n  BUFFER_END: 'buffer-end',\n  ERROR: 'error',\n  STOP: 'stop',\n  CLICK: 'click',\n  MANIFEST: 'manifest',\n  PODSTART: 'break-start',\n  PODSTOP: 'break-stop',\n  QUARTILE: 'quartile',\n  VIDEO_EVENT: 'video-event'\n}\nmodule.exports = Event\n","/**\n* List of ad manifest errors\n*/\nvar ManifestError = {\n  NO_RESPONSE: 'NO_RESPONSE',\n  EMPTY: 'EMPTY_RESPONSE',\n  WRONG: 'WRONG_RESPONSE'\n}\nmodule.exports = ManifestError\n","/**\n * List of Request Methods\n *   - GET\n *   - POST\n */\nvar RequestMethod = {\n  GET: 'get',\n  POST: 'post'\n}\nmodule.exports = RequestMethod\n","/**\n * List of youbora services.\n *\n * @enum\n */\nvar Service = {\n  DATA: '/data',\n\n  // Video\n  INIT: '/init',\n  START: '/start',\n  JOIN: '/joinTime',\n  PAUSE: '/pause',\n  RESUME: '/resume',\n  SEEK: '/seek',\n  BUFFER: '/bufferUnderrun',\n  ERROR: '/error',\n  STOP: '/stop',\n  PING: '/ping',\n\n  VIDEO_EVENT: '/infinity/video/event',\n\n  // Ads\n  AD_INIT: '/adInit',\n  AD_START: '/adStart',\n  AD_JOIN: '/adJoin',\n  AD_PAUSE: '/adPause',\n  AD_RESUME: '/adResume',\n  AD_BUFFER: '/adBufferUnderrun',\n  AD_STOP: '/adStop',\n  AD_CLICK: '/adClick',\n  AD_ERROR: '/adError',\n  AD_MANIFEST: '/adManifest',\n  AD_POD_START: '/adBreakStart',\n  AD_POD_STOP: '/adBreakStop',\n  AD_QUARTILE: '/adQuartile',\n\n  // Infinity\n  EVENT: '/infinity/session/event',\n  SESSION_START: '/infinity/session/start',\n  SESSION_STOP: '/infinity/session/stop',\n  NAV: '/infinity/session/nav',\n  BEAT: '/infinity/session/beat',\n\n  // Offline\n  OFFLINE_EVENTS: '/offlineEvents'\n}\nmodule.exports = Service\n","/**\n * List of streaming protocols\n *   - HDS (Adobe HDS)\n *   - HLS (Apple HLS)\n *   - MSS (Microsoft Smooth Streaming)\n *   - DASH (MPEG-DASH)\n *   - RTMP (Adobe RTMP)\n *   - RTP (RTP)\n *   - RTSP (RTSP)\n */\nvar StreamingProtocol = {\n  HDS: 'HDS',\n  HLS: 'HLS',\n  MSS: 'MSS',\n  DASH: 'DASH',\n  RTMP: 'RTMP',\n  RTP: 'RTP',\n  RTSP: 'RTSP'\n}\n\nmodule.exports = StreamingProtocol\n","/**\n * List of transport formats\n *   - TS (MPEG-2 TS)\n *   - MP4 (Fragmented MP4)\n *   - CMF\n */\nvar TransportFormat = {\n  MP4: 'MP4',\n  MPEG2: 'TS',\n  CMF: 'CMF'\n}\nmodule.exports = TransportFormat\n","/**\n * List of will-send events.\n *\n * @memberof youbora.Plugin\n * @enum\n * @event\n */\nvar WillSendEvent = {\n  WILL_SEND_INIT: 'will-send-init',\n  WILL_SEND_START: 'will-send-start',\n  WILL_SEND_JOIN: 'will-send-join',\n  WILL_SEND_PAUSE: 'will-send-pause',\n  WILL_SEND_RESUME: 'will-send-resume',\n  WILL_SEND_SEEK: 'will-send-seek',\n  WILL_SEND_BUFFER: 'will-send-buffer',\n  WILL_SEND_ERROR: 'will-send-error',\n  WILL_SEND_FATAL_ERROR: 'will-send-fatal-error',\n  WILL_SEND_STOP: 'will-send-stop',\n  WILL_SEND_PING: 'will-send-ping',\n  WILL_SEND_VIDEO_EVENT: 'will-send-video-event',\n\n  WILL_SEND_AD_START: 'will-send-ad-start',\n  WILL_SEND_AD_JOIN: 'will-send-ad-join',\n  WILL_SEND_AD_PAUSE: 'will-send-ad-pause',\n  WILL_SEND_AD_RESUME: 'will-send-ad-resume',\n  WILL_SEND_AD_BUFFER: 'will-send-ad-buffer',\n  WILL_SEND_AD_STOP: 'will-send-ad-stop',\n  WILL_SEND_AD_CLICK: 'will-send-ad-click',\n  WILL_SEND_AD_ERROR: 'will-send-ad-error',\n  WILL_SEND_AD_MANIFEST: 'will-send-ad-manifest',\n  WILL_SEND_AD_POD_START: 'will-send-ad-break-start',\n  WILL_SEND_AD_POD_STOP: 'will-send-ad-break-stop',\n  WILL_SEND_AD_QUARTILE: 'will-send-ad-quartile',\n\n  WILL_SEND_SESSION_START: 'will-send-session-start',\n  WILL_SEND_SESSION_STOP: 'will-send-session-stop',\n  WILL_SEND_NAV: 'will-send-nav',\n  WILL_SEND_BEAT: 'will-send-beat',\n  WILL_SEND_EVENT: 'will-send-event',\n\n  WILL_SEND_OFFLINE_EVENTS: 'will-send-offline-events'\n}\nmodule.exports = WillSendEvent\n","var YouboraObject = require('../object')\n/**\n * This static class provides device detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar BackgroundDetector = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.isInBackground = false\n    this.listenerReference = this._visibilityListener.bind(this)\n    this._reset()\n  },\n\n  startDetection: function () {\n    if (!this.isBackgroundDetectorStarted && typeof document !== 'undefined') {\n      this.isBackgroundDetectorStarted = true\n      document.addEventListener('visibilitychange', this.listenerReference)\n    }\n  },\n\n  stopDetection: function () {\n    if (this.isBackgroundDetectorStarted && typeof document !== 'undefined') {\n      document.removeEventListener('visibilitychange', this.listenerReference)\n      this._reset()\n    }\n  },\n\n  _reset: function () {\n    this.isBackgroundDetectorStarted = false\n  },\n\n  _visibilityListener: function (e) {\n    if (typeof document !== 'undefined') {\n      var settings = this._getSettings()\n      if (document.visibilityState === 'hidden') {\n        this._toBackground(settings)\n      } else if (document.visibilityState === 'visible') { // to Foreground\n        this._toForeground(settings)\n      }\n    }\n  },\n\n  _toBackground: function (settings) {\n    this.isInBackground = true\n    if (this.plugin && this.plugin._adsAdapter) {\n      this.plugin._adsAdapter.stopChronoView()\n    }\n    if (typeof settings === 'string') {\n      switch (settings) {\n        case 'stop':\n          this._fireStop()\n          break\n        case 'pause':\n          this._firePause()\n          break\n      }\n      if (this.plugin.infinity.infinityStarted) {\n        this.lastBeatTime = new Date().getTime()\n        var difftime = this.plugin._beat.chrono.startTime ? (this.lastBeatTime - this.plugin._beat.chrono.startTime) : 0\n        this.plugin._sendBeat(difftime)\n        this.plugin._beat.stop()\n      }\n    }\n  },\n\n  _toForeground: function (settings) {\n    this.isInBackground = false\n    // ads\n    if (this.plugin && this.plugin._adsAdapter) {\n      this.plugin._adsAdapter.startChronoView()\n    }\n    // nothing for video yet\n    if (typeof settings === 'string' && settings) {\n      if (this.plugin.infinity.infinityStarted) {\n        var now = new Date().getTime()\n        if (now - this.lastBeatTime < this.plugin.sessionExpire) { // if session not expired\n          this.plugin._sendBeat(now - this.lastBeatTime)\n          this.plugin._beat.start()\n        } else { // session expired\n          this.plugin.infinity.newSession()\n        }\n      }\n    }\n  },\n\n  _getSettings: function () {\n    if (typeof this.plugin.options['background.settings'] === 'string' && this.plugin.options['background.settings']) {\n      return this.plugin.options['background.settings']\n    }\n    if (this.plugin.deviceDetector.isSmartTV()) {\n      return this.plugin.options['background.settings.tv']\n    }\n    if (this.plugin.deviceDetector.isDesktop()) {\n      return this.plugin.options['background.settings.desktop']\n    }\n    if (this.plugin.deviceDetector.isAndroid()) {\n      return this.plugin.options['background.settings.android']\n    }\n    if (this.plugin.deviceDetector.isIphone()) {\n      return this.plugin.options['background.settings.iOS']\n    }\n    if (this.plugin.deviceDetector.isPlayStation()) {\n      return this.plugin.options['background.settings.playstation']\n    }\n  },\n\n  _firePause: function () {\n    this._fireX('firePause')\n  },\n\n  _fireStop: function () {\n    this._fireX('fireStop')\n    this.plugin.fireStop()\n  },\n\n  _fireX: function (fireMethod) {\n    this.adsAdapter = this.plugin.getAdsAdapter()\n    if (this.adsAdapter) {\n      this.adsAdapter[fireMethod]()\n    }\n    this.contentAdapter = this.plugin.getAdapter()\n    if (this.contentAdapter) {\n      this.contentAdapter[fireMethod]()\n    }\n  },\n\n  canBlockStartCalls: function () {\n    return (\n      this.isInBackground &&\n      this.plugin.options['background.enabled'] === true &&\n      this._getSettings() // it is stop or pause\n    )\n  }\n})\n\nmodule.exports = BackgroundDetector\n","var YouboraObject = require('../object')\n/**\n * This static class provides device detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar DeviceDetector = YouboraObject.extend({\n  constructor: function () {\n    if (typeof navigator !== 'undefined' && navigator.userAgent) {\n      this._isSmartTVDevice = navigator.userAgent.toLowerCase().match(/smarttv/) ||\n        navigator.userAgent.toLowerCase().match(/smart-tv/) ||\n        navigator.userAgent.toLowerCase().match(/appletv/) ||\n        navigator.userAgent.toLowerCase().match(/apple tv/)\n      this._isPlaystationDevice = navigator.userAgent.match(/PlayStation/) !== null\n      this._isIphoneDevice = navigator.userAgent.match(/iPhone|iPad|iPod/i) !== null\n      this._isAndroidDevice = navigator.userAgent.match(/Android/) !== null\n      this._isSmartphoneDevice = !this._isSmartTVDevice && !this._isPlaystationDevice && (this._isIphoneDevice || this._isAndroidDevice)\n      this._isDesktopDevice = !this._isSmartphoneDevice && !this._isSmartTVDevice && !this._isPlaystationDevice\n    }\n  },\n\n  isIphone: function () {\n    return this._isIphoneDevice\n  },\n\n  isAndroid: function () {\n    return this._isAndroidDevice\n  },\n\n  isSmartphone: function () {\n    return this._isSmartphoneDevice\n  },\n\n  isDesktop: function () {\n    return this._isDesktopDevice\n  },\n\n  isSmartTV: function () {\n    return this._isSmartTVDevice\n  },\n\n  isPlayStation: function () {\n    return this._isPlaystationDevice\n  }\n})\n\nmodule.exports = DeviceDetector\n","var YouboraObject = require('../object')\n/**\n * This static class provides screen scrolling and resizing detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar ResizeScrollDetector = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.pluginref = plugin\n    this.listenerReference = this._changeListener.bind(this)\n    this.loadReference = this._loadListener.bind(this)\n    this.isEnabled = false\n\n    this.pageHeight = 0\n    this.maxHeight = 0\n    this.startDetection()\n  },\n\n  startDetection: function () {\n    if (!this.isEnabled && typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n      window.addEventListener('scroll', this.listenerReference)\n      window.addEventListener('resize', this.listenerReference)\n      window.addEventListener('load', this.loadReference)\n      this.isEnabled = true\n    }\n  },\n\n  stopDetection: function () {\n    if (this.isEnabled && typeof window !== 'undefined' && typeof window.removeEventListener === 'function') {\n      window.removeEventListener('scroll', this.listenerReference)\n      window.removeEventListener('resize', this.listenerReference)\n      window.removeEventListener('load', this.loadReference)\n      this.isEnabled = false\n    }\n  },\n\n  getScrollDepth: function () {\n    var ret = null\n    if (this.maxHeight && this.pageHeight) {\n      ret = Math.min(Math.trunc((this.maxHeight / this.pageHeight) * 100), 100)\n    }\n    return ret\n  },\n\n  _loadListener: function () {\n    if (typeof document !== 'undefined') {\n      var docEl = document.documentElement\n      if (docEl) {\n        this.pageHeight = Math.round(docEl.scrollHeight, docEl.clientHeight, docEl.offsetHeight)\n        this.maxHeight = window.innerHeight\n        this._updateCompletionRate()\n      }\n    }\n  },\n\n  _changeListener: function () {\n    if (this.pageHeight) {\n      var prevHeight = this.maxHeight\n      this.maxHeight = Math.max(this.maxHeight, window.pageYOffset + window.innerHeight)\n      if (prevHeight !== this.maxHeight) {\n        this._updateCompletionRate()\n      }\n    }\n    var adsAdapter = this.pluginref.getAdsAdapter()\n    if (adsAdapter && adsAdapter.flags.isStarted) {\n      if (!adsAdapter.getIsVisible()) {\n        adsAdapter.stopChronoView()\n      } else {\n        adsAdapter.startChronoView()\n      }\n    }\n  },\n\n  _updateCompletionRate: function () {\n    setTimeout(function () {\n      this.pluginref.storage.setSession('pageScrollDepth', this.getScrollDepth())\n    }.bind(this), 3000)\n  }\n})\n\nmodule.exports = ResizeScrollDetector\n","/* global ActiveXObject */\nvar YouboraObject = require('../object')\n\nvar DataExtractor = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n  },\n\n  getAllData: function () {\n    var returnValue = this.getNonRandomData()\n    returnValue.timestamp = this.getTimestamp()\n    return returnValue\n  },\n\n  getNonRandomData: function () {\n    var returnValue = {}\n    returnValue.userAgent = this.getUserAgent()\n    returnValue.threads = this.getVirtualCores()\n    returnValue.language = this.getLanguage()\n    returnValue.langList = this.getAvailableLanguages()\n    returnValue.resolution = this.getResolution()\n    returnValue.colorDepth = this.getColorDepth()\n    returnValue.deviceMemory = this.getMemory()\n    returnValue.touchscreen = this.getTouchscreen()\n    returnValue.localStorage = this.getLocalStorage()\n    returnValue.sessionStorage = this.getSessionStorage()\n    returnValue.cookiesAvailable = this.getCookiesAvailable()\n    returnValue.flashAvailable = this.getHasFlash()\n    returnValue.timeZone = this.getTimeZone()\n    returnValue.plugins = this.getPluginList()\n    return returnValue\n  },\n\n  // Getters\n  getUserAgent: function () {\n    return this._getNavigatorValue('userAgent')\n  },\n\n  getVirtualCores: function () {\n    return this._getNavigatorValue('hardwareConcurrency')\n  },\n\n  getLanguage: function () {\n    return this._getNavigatorValue('language')\n  },\n\n  getAvailableLanguages: function () {\n    return this._getNavigatorValue('languages')\n  },\n\n  getResolution: function () {\n    var ret = null\n    try {\n      if (this._getNavigatorValue('screen')) {\n        ret = navigator.screen.width.toString() + navigator.screen.height.toString()\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  },\n\n  getColorDepth: function () {\n    var ret = null\n    try {\n      if (this._getNavigatorValue('screen')) {\n        ret = navigator.screen.colorDepth\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  },\n\n  getMemory: function () {\n    return this._getNavigatorValue('deviceMemory')\n  },\n\n  getTouchscreen: function () {\n    return this._getNavigatorValue('maxTouchPoints') || false\n  },\n\n  getLocalStorage: function () {\n    var ret = false\n    try {\n      ret = typeof localStorage !== 'undefined'\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getSessionStorage: function () {\n    var ret = false\n    try {\n      ret = typeof sessionStorage !== 'undefined'\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getCookiesAvailable: function () {\n    return this._getNavigatorValue('cookieEnabled') || false\n  },\n\n  getHasFlash: function () {\n    var ret = false\n    try {\n      var plugins = this._getNavigatorValue('plugins')\n      ret = (plugins && typeof plugins['Shockwave Flash'] === 'object') || (typeof window !== 'undefined' && window.ActiveXObject && (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) !== false)\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getPluginList: function () {\n    var ret = null\n    try {\n      var plugins = this._getNavigatorValue('plugins')\n      if (plugins && plugins.length !== 0) {\n        var pluginlist = ''\n        for (var counter = 0; counter < navigator.plugins.length; counter++) {\n          pluginlist += navigator.plugins[counter].description + ' ' + navigator.plugins[counter].filename + ' ' + navigator.plugins[counter].name + ' '\n        }\n        ret = pluginlist\n      }\n    } catch (err) {\n      // return null\n    }\n    return ret\n  },\n\n  getTimeZone: function () {\n    var ret = null\n    try {\n      var date = new Date()\n      ret = date.getTimezoneOffset().toString()\n    } catch (err) {\n      // return null\n    }\n    return ret\n  },\n\n  getTimestamp: function () {\n    return new Date().getTime()\n  },\n\n  _navigatorCheck: function () {\n    return typeof navigator !== 'undefined'\n  },\n\n  _getNavigatorValue: function (key) {\n    var ret = null\n    try {\n      if (this._navigatorCheck()) {\n        ret = navigator[key]\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  }\n\n})\n\nmodule.exports = DataExtractor\n","var DataExtractor = require('./dataextractor')\nvar YouboraObject = require('../object')\nvar MD5 = require('./md5')\n\nvar HashGenerator = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.dataExtractor = new DataExtractor()\n    this.key = this.getPreviousKey()\n  },\n\n  generateHashKey: function () {\n    if (!this.key) {\n      var data = this.dataExtractor.getAllData()\n      this.key = this._hashFunction(data)\n      this.plugin.storage.setLocal('youboraDeviceUUID', this.key)\n    }\n  },\n\n  getKey: function () {\n    if (!this.key) this.generateHashKey()\n    return this.key\n  },\n\n  _hashFunction: function (inputString) {\n    var outputString = inputString\n    if (typeof inputString !== 'string') {\n      outputString = JSON.stringify(inputString)\n    }\n    return MD5(outputString)\n  },\n\n  _reset: function () {\n    this.key = undefined\n  },\n\n  getPreviousKey: function () {\n    return this.plugin.storage.getLocal('youboraDeviceUUID')\n  }\n\n})\n\nmodule.exports = HashGenerator\n","/* istanbul ignore next */\nvar MD5 = function (s) { function L (k, d) { return (k << d) | (k >>> (32 - d)) } function K (G, k) { var I, d, F, H, x; F = (G & 2147483648); H = (k & 2147483648); I = (G & 1073741824); d = (k & 1073741824); x = (G & 1073741823) + (k & 1073741823); if (I & d) { return (x ^ 2147483648 ^ F ^ H) } if (I | d) { if (x & 1073741824) { return (x ^ 3221225472 ^ F ^ H) } else { return (x ^ 1073741824 ^ F ^ H) } } else { return (x ^ F ^ H) } } function r (d, F, k) { return (d & F) | ((~d) & k) } function q (d, F, k) { return (d & k) | (F & (~k)) } function p (d, F, k) { return (d ^ F ^ k) } function n (d, F, k) { return (F ^ (d | (~k))) } function u (G, F, aa, Z, k, H, I) { G = K(G, K(K(r(F, aa, Z), k), I)); return K(L(G, H), F) } function f (G, F, aa, Z, k, H, I) { G = K(G, K(K(q(F, aa, Z), k), I)); return K(L(G, H), F) } function D (G, F, aa, Z, k, H, I) { G = K(G, K(K(p(F, aa, Z), k), I)); return K(L(G, H), F) } function t (G, F, aa, Z, k, H, I) { G = K(G, K(K(n(F, aa, Z), k), I)); return K(L(G, H), F) } function e (G) { var Z; var F = G.length; var x = F + 8; var k = (x - (x % 64)) / 64; var I = (k + 1) * 16; var aa = Array(I - 1); var d = 0; var H = 0; while (H < F) { Z = (H - (H % 4)) / 4; d = (H % 4) * 8; aa[Z] = (aa[Z] | (G.charCodeAt(H) << d)); H++ } Z = (H - (H % 4)) / 4; d = (H % 4) * 8; aa[Z] = aa[Z] | (128 << d); aa[I - 2] = F << 3; aa[I - 1] = F >>> 29; return aa } function B (x) { var k = \"\", F = \"\", G, d; for (d = 0; d <= 3; d++) { G = (x >>> (d * 8)) & 255; F = \"0\" + G.toString(16); k = k + F.substr(F.length - 2, 2) } return k } function J (k) { k = k.replace(/rn/g, \"n\"); var d = \"\"; for (var F = 0; F < k.length; F++) { var x = k.charCodeAt(F); if (x < 128) { d += String.fromCharCode(x) } else { if ((x > 127) && (x < 2048)) { d += String.fromCharCode((x >> 6) | 192); d += String.fromCharCode((x & 63) | 128) } else { d += String.fromCharCode((x >> 12) | 224); d += String.fromCharCode(((x >> 6) & 63) | 128); d += String.fromCharCode((x & 63) | 128) } } } return d } var C = Array(); var P, h, E, v, g, Y, X, W, V; var S = 7, Q = 12, N = 17, M = 22; var A = 5, z = 9, y = 14, w = 20; var o = 4, m = 11, l = 16, j = 23; var U = 6, T = 10, R = 15, O = 21; s = J(s); C = e(s); Y = 1732584193; X = 4023233417; W = 2562383102; V = 271733878; for (P = 0; P < C.length; P += 16) { h = Y; E = X; v = W; g = V; Y = u(Y, X, W, V, C[P + 0], S, 3614090360); V = u(V, Y, X, W, C[P + 1], Q, 3905402710); W = u(W, V, Y, X, C[P + 2], N, 606105819); X = u(X, W, V, Y, C[P + 3], M, 3250441966); Y = u(Y, X, W, V, C[P + 4], S, 4118548399); V = u(V, Y, X, W, C[P + 5], Q, 1200080426); W = u(W, V, Y, X, C[P + 6], N, 2821735955); X = u(X, W, V, Y, C[P + 7], M, 4249261313); Y = u(Y, X, W, V, C[P + 8], S, 1770035416); V = u(V, Y, X, W, C[P + 9], Q, 2336552879); W = u(W, V, Y, X, C[P + 10], N, 4294925233); X = u(X, W, V, Y, C[P + 11], M, 2304563134); Y = u(Y, X, W, V, C[P + 12], S, 1804603682); V = u(V, Y, X, W, C[P + 13], Q, 4254626195); W = u(W, V, Y, X, C[P + 14], N, 2792965006); X = u(X, W, V, Y, C[P + 15], M, 1236535329); Y = f(Y, X, W, V, C[P + 1], A, 4129170786); V = f(V, Y, X, W, C[P + 6], z, 3225465664); W = f(W, V, Y, X, C[P + 11], y, 643717713); X = f(X, W, V, Y, C[P + 0], w, 3921069994); Y = f(Y, X, W, V, C[P + 5], A, 3593408605); V = f(V, Y, X, W, C[P + 10], z, 38016083); W = f(W, V, Y, X, C[P + 15], y, 3634488961); X = f(X, W, V, Y, C[P + 4], w, 3889429448); Y = f(Y, X, W, V, C[P + 9], A, 568446438); V = f(V, Y, X, W, C[P + 14], z, 3275163606); W = f(W, V, Y, X, C[P + 3], y, 4107603335); X = f(X, W, V, Y, C[P + 8], w, 1163531501); Y = f(Y, X, W, V, C[P + 13], A, 2850285829); V = f(V, Y, X, W, C[P + 2], z, 4243563512); W = f(W, V, Y, X, C[P + 7], y, 1735328473); X = f(X, W, V, Y, C[P + 12], w, 2368359562); Y = D(Y, X, W, V, C[P + 5], o, 4294588738); V = D(V, Y, X, W, C[P + 8], m, 2272392833); W = D(W, V, Y, X, C[P + 11], l, 1839030562); X = D(X, W, V, Y, C[P + 14], j, 4259657740); Y = D(Y, X, W, V, C[P + 1], o, 2763975236); V = D(V, Y, X, W, C[P + 4], m, 1272893353); W = D(W, V, Y, X, C[P + 7], l, 4139469664); X = D(X, W, V, Y, C[P + 10], j, 3200236656); Y = D(Y, X, W, V, C[P + 13], o, 681279174); V = D(V, Y, X, W, C[P + 0], m, 3936430074); W = D(W, V, Y, X, C[P + 3], l, 3572445317); X = D(X, W, V, Y, C[P + 6], j, 76029189); Y = D(Y, X, W, V, C[P + 9], o, 3654602809); V = D(V, Y, X, W, C[P + 12], m, 3873151461); W = D(W, V, Y, X, C[P + 15], l, 530742520); X = D(X, W, V, Y, C[P + 2], j, 3299628645); Y = t(Y, X, W, V, C[P + 0], U, 4096336452); V = t(V, Y, X, W, C[P + 7], T, 1126891415); W = t(W, V, Y, X, C[P + 14], R, 2878612391); X = t(X, W, V, Y, C[P + 5], O, 4237533241); Y = t(Y, X, W, V, C[P + 12], U, 1700485571); V = t(V, Y, X, W, C[P + 3], T, 2399980690); W = t(W, V, Y, X, C[P + 10], R, 4293915773); X = t(X, W, V, Y, C[P + 1], O, 2240044497); Y = t(Y, X, W, V, C[P + 8], U, 1873313359); V = t(V, Y, X, W, C[P + 15], T, 4264355552); W = t(W, V, Y, X, C[P + 6], R, 2734768916); X = t(X, W, V, Y, C[P + 13], O, 1309151649); Y = t(Y, X, W, V, C[P + 4], U, 4149444226); V = t(V, Y, X, W, C[P + 11], T, 3174756917); W = t(W, V, Y, X, C[P + 2], R, 718787259); X = t(X, W, V, Y, C[P + 9], O, 3951481745); Y = K(Y, h); X = K(X, E); W = K(W, v); V = K(V, g) } var i = B(Y) + B(X) + B(W) + B(V); return i.toLowerCase() }\nmodule.exports = MD5\n","var YouboraObject = require('./object')\nvar isArray = require('./mixins/isarray')\n\n/**\n * This class extends YouboraObject, adding event emitting/listening functionalities.\n *\n * @constructs Emitter\n * @extends youbora.YouboraObject\n * @memberof youbora\n */\nvar Emitter = YouboraObject.extend(\n  /** @lends youbora.Emitter.prototype */\n  {\n    /**\n     * Sets a listener to a given event. Use {@link emit} to trigger those events.\n     * Pass '*' to listen ALL events.\n     *\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event. Receives event and data.\n     * @return this\n     */\n    on: function (event, callback) {\n      this._listeners = this._listeners || {}\n      if (typeof callback === 'function') {\n        this._listeners[event] = this._listeners[event] || []\n        this._listeners[event].push(callback)\n        return this\n      }\n    },\n\n    /**\n     * Removes given callback from the listeners of this object.\n     *\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     * @return this\n     */\n    off: function (event, callback) {\n      this._listeners = this._listeners || {}\n\n      if (this._listeners[event]) {\n        var index = this._listeners[event].indexOf(callback)\n        if (index !== -1) {\n          this._listeners[event].splice(index, 1)\n        }\n      }\n      return this\n    },\n\n    /**\n     * Emits given event, triggering all the associated callbacks.\n     *\n     * @param {string} event Name of the event.\n     * @param {object} [data] Custom data to be sent to the callbacks.\n     * @return this\n     */\n    emit: function (event, data) {\n      this._listeners = this._listeners || {}\n      data = data || {}\n\n      if (isArray(this._listeners[event])) {\n        this._listeners[event].forEach(this._eachCallback.bind(this, event, data))\n      }\n      if (isArray(this._listeners['*'])) {\n        this._listeners['*'].forEach(this._eachCallback.bind(this, event, data))\n      }\n      return this\n    },\n\n    /**\n     * Travels through the listener list and executes them them.\n     *\n     * @private\n     */\n    _eachCallback: function (event, data, callback) {\n      if (typeof callback === 'function') {\n        var callbackArguments = {\n          type: event,\n          data: data,\n          target: this\n        }\n        callback(callbackArguments)\n      }\n    }\n  }\n)\n\nmodule.exports = Emitter\n","var Emitter = require('../emitter')\nvar Comm = require('../comm/communication')\nvar WrongTransform = require('../comm/transform/wrong')\nvar Util = require('../util')\n\nvar YouboraInfinity = Emitter.extend(\n  /** @lends youbora.Infinity.prototype */\n  {\n\n    /**\n     * This class is the base of youbora infinity. Every plugin will have an instance.\n     *\n     * @param {youbora.Plugin} plugin Parent plugin.\n     *\n     * @constructs youbora.Infinity\n     * @extends youbora.Emitter\n     * @memberof youbora\n     */\n    constructor: function (plugin) {\n      /** Parent {@link youbora.Plugin} reference. */\n      this._plugin = plugin\n      this.infinityStopped = false\n      this.infinityStarted = false\n    },\n\n    /**\n     * @alias youbora.Infinity.prototype.begin.\n     */\n    andBeyond: function () {\n      YouboraInfinity.prototype.begin.apply(this, arguments)\n    },\n\n    /**\n     * This method will start infinity logic, setting storage as needed.\n     * Will call fireSessionStart the first time and fireNav for every subsequent route change.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    begin: function (dimensions) {\n      this._comm = new Comm(this._plugin)\n      this._comm.addTransform(this._plugin.viewTransform)\n      this._comm.addTransform(new WrongTransform(this._plugin))\n      if (this._plugin && this._plugin.storage && typeof this._plugin.storage.getLocal === 'function') {\n        this._registeredProperties = this._plugin.storage.getLocal('inifnityRegisteredProperties')\n      }\n      // send start session with navigation information at beginning\n      this.fireSessionStart(dimensions)\n    },\n\n    _setLastActive: function () {\n      if (!this._firstActive) {\n        this._firstActive = this.getFirstActive()\n      }\n      this._plugin.storage.setStorages('lastactive', new Date().getTime())\n    },\n\n    getFirstActive: function () {\n      return Number(this._plugin.getLastActive()) || 0\n    },\n\n    /**\n     * Returns the current {@link youbora.Communication} instance.\n     *\n     * @returns {youbora.Communication} communication instance\n     */\n    getComm: function () {\n      return this._comm\n    },\n\n    // Fire\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireSessionStart: function (dimensions) {\n      if (this.infinityStopped) {\n        this._plugin.restartViewTransform()\n        this._comm = new Comm(this._plugin)\n        this._comm.addTransform(this._plugin.viewTransform)\n        this._comm.addTransform(new WrongTransform(this._plugin))\n        this.infinityStopped = false\n      }\n      if (!this.infinityStarted) {\n        this._plugin.storage.setLocal('infinityStarted', 'true')\n        this.infinityStarted = true\n        this.emit(YouboraInfinity.Event.SESSION_START, this._getParamsJson(dimensions, null, null, true, true))\n        this._setLastActive()\n      }\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireSessionStop: function (params) {\n      if (this.infinityStarted) {\n        this.infinityStopped = true\n        this.infinityStarted = false\n        this._plugin.storage.removeStorages('infinityStarted')\n        this.emit(YouboraInfinity.Event.SESSION_STOP, params)\n        this._plugin.storage.removeStorages('data')\n        this._plugin.storage.removeStorages('session')\n        this._plugin.storage.removeStorages('lastactive')\n      }\n    },\n\n    /**\n     * Stops the session and creates a new one\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    newSession: function (options, params) {\n      if (this.isActive()) {\n        if (this.infinityStarted) {\n          this.fireSessionStop()\n        } else {\n          this._plugin.storage.removeStorages('infinityStarted')\n          this._plugin.storage.removeStorages('data')\n          if (this._comm) this._comm.removeTransform(this._plugin.viewTransform)\n          this._plugin.restartViewTransform()\n          if (this._comm) this._comm.addTransform(this._plugin.viewTransform)\n        }\n      }\n      this._plugin.setOptions(options)\n      this.begin(params)\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireNav: function (dimensions) {\n      if (this.isActive()) {\n        this.infinityStarted = true\n        this.emit(YouboraInfinity.Event.NAV, this._getParamsJson(dimensions, null, null, true))\n      }\n    },\n\n    _sendExtraBeat: function () {\n      if (this._plugin && this._plugin._beat) {\n        var now = new Date().getTime()\n        var time = this._plugin._beat.chrono.startTime ? (now - this._plugin._beat.chrono.startTime) : 0\n        this._plugin._sendBeat(time)\n        this._plugin._beat.chrono.startTime = now\n      }\n      this._setLastActive()\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireEvent: function (eventName, dimensions, values, topLevelDimensions) {\n      if (this.infinityStarted) {\n        var builtParams = this._getParamsJson(dimensions, values, eventName)\n        Util.assign(builtParams.params, topLevelDimensions || {})\n        this.emit(YouboraInfinity.Event.EVENT, builtParams)\n        this._setLastActive()\n      }\n    },\n\n    /** Register properties sent by the User, to send in all the events\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    register: function (dimensions, values) {\n      this._registeredProperties = { dimensions: dimensions, values: values }\n      this._plugin.storage.setLocal('inifnityRegisteredProperties', JSON.stringify(this._registeredProperties))\n    },\n\n    /** Calls register if registeredProperties is empty\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    registerOnce: function (dimensions, values) {\n      if (!this._registeredProperties) {\n        this.register(dimensions, values)\n      }\n    },\n\n    /** Unregister properties registered with register()\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    unregister: function () {\n      this._registeredProperties = null\n      this._plugin.storage.removeLocal('inifnityRegisteredProperties')\n    },\n\n    /**\n     * Splits params in dimensions (strings) and values (numbers)\n     *\n     * @param {Object} [params] Object of key:value params to split before adding to request.\n     */\n    _getParamsJson: function (dimensions, values, eventName, isNavigaton, isStart) {\n      var returnparams = {}\n      if (eventName) returnparams.name = eventName\n      returnparams.dimensions = dimensions || {}\n      returnparams.values = values || {}\n      if (this._registeredProperties) {\n        for (var key in this._registeredProperties.dimensions) {\n          returnparams.dimensions[key] = this._registeredProperties.dimensions[key]\n        }\n        for (var key2 in this._registeredProperties.values) {\n          returnparams.values[key2] = this._registeredProperties.values[key2]\n        }\n      }\n      var paramsObject = { params: returnparams }\n      if (isNavigaton) {\n        if (paramsObject.params.dimensions.page) {\n          paramsObject.params.page = paramsObject.params.dimensions.page\n          delete paramsObject.params.dimensions.page\n        }\n        if (paramsObject.params.dimensions.route) {\n          paramsObject.params.route = paramsObject.params.dimensions.route\n          delete paramsObject.params.dimensions.route\n        }\n        if (!isStart) {\n          delete paramsObject.params.dimensions\n        }\n        delete paramsObject.params.values\n      }\n      return paramsObject\n    },\n\n    isActive: function () {\n      var started = this._plugin.storage.getLocal('infinityStarted')\n      if (this.infinityStarted || (started && started !== 'false')) {\n        return true\n      }\n      var now = new Date().getTime()\n      if (Number(this._plugin.getLastActive()) + this._plugin.sessionExpire > now) {\n        return true\n      }\n      return false\n    }\n  },\n  /** @lends youbora.Plugin */\n  {\n    // Static Memebers //\n    /**\n     * List of events that could be fired\n     * @enum\n     * @event\n     */\n    Event: {\n      NAV: 'nav',\n      SESSION_START: 'sessionStart',\n      SESSION_STOP: 'sessionStop',\n      BEAT: 'beat',\n      EVENT: 'event'\n    }\n  }\n)\n\nmodule.exports = YouboraInfinity\n","var Emitter = require('./emitter')\nvar isArray = require('./mixins/isarray')\n\n/**\n * Static Log class for YouboraLib\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Log = {\n\n  _emitter: new Emitter(),\n\n  /** Exposes {@link youbora.EvenfulObject.on} */\n  on: function () { Log._emitter.on.apply(Log._emitter, arguments) },\n  /** Exposes {@link youbora.EvenfulObject.off} */\n  off: function () { Log._emitter.off.apply(Log._emitter, arguments) },\n  /** Exposes {@link youbora.EvenfulObject.emit} */\n  emit: function () { Log._emitter.emit.apply(Log._emitter, arguments) },\n\n  /**\n   * Enum for log levels\n   * @enum\n   */\n  Level: {\n    /** No console outputs */\n    SILENT: 6,\n    /** Console will show errors */\n    ERROR: 5,\n    /** Console will show warnings */\n    WARNING: 4,\n    /** Console will show notices (ie: life-cyrcle logs) */\n    NOTICE: 3,\n    /** Console will show debug messages (ie: player events) */\n    DEBUG: 2,\n    /** Console will show verbose messages (ie: Http Requests) */\n    VERBOSE: 1\n  },\n\n  /**\n   * Enum for events\n   * @enum\n   */\n  Event: {\n    /** Sent each time a messaged is issued, even if log level does not handle it. */\n    LOG: 'log'\n  },\n\n  /**\n   * Only logs of this imporance or higher will be shown.\n   * @default youbora.Log.Levels.ERROR\n   * @see {@link youbora.Log.Levels}\n   */\n  logLevel: 5,\n\n  /**\n   * If true, console logs will always be outputed without colors (for debbugin in devices).\n   * @default false\n   */\n  plainLogs: false,\n\n  /**\n   * Returns a console message\n   *\n   * @private\n   * @param {(string|error|array)} msg Message string, error object or array of messages.\n   * @param {Log.Levels} [level=Log.Levels.NOTICE] Defines the level of the error sent.\n   * Only errors with higher or equal level than Log.logLevel will be displayed.\n   * @param {string} [color=darkcyan] Color of the header\n   * @see {@link Youbora.Log.debugLevel}\n   */\n  report: function (msg, level, color) {\n    if (typeof console !== 'undefined' && console.log && typeof document !== 'undefined') {\n      level = level || Log.Level.NOTICE\n      color = color || 'darkcyan'\n\n      var letters = {\n        5: 'e', // Error\n        4: 'w', // Warning\n        3: 'n', // Notice\n        2: 'd', // Debug\n        1: 'v' // Verbose\n      }\n\n      var letter = letters[level]\n      var prefix = '[Youbora]' + Log._getCurrentTime() + ' ' + letter + ':'\n\n      this.emit('log', { level: level, msg: msg, prefix: prefix })\n\n      // Show messages in actual console if level is enought\n      if (Log.logLevel <= level) {\n        if (Log.plainLogs || document.documentMode) { // document.documentMode exits only in IE\n          // Plain log for IE and devices\n          Log._plainReport(msg, prefix)\n        } else {\n          // choose log method\n          var logMethod\n          if (level === Log.Level.ERROR && console.error) {\n            logMethod = console.error\n          } else if (level === Log.Level.WARNING && console.warn) {\n            logMethod = console.warn\n          } else if (level === Log.Level.DEBUG && console.debug) {\n            logMethod = console.debug\n          } else {\n            logMethod = console.log\n          }\n\n          // print message\n          prefix = '%c' + prefix\n          if (isArray(msg)) {\n            msg.splice(0, 0, prefix, 'color: ' + color)\n            logMethod.apply(console, msg)\n          } else {\n            logMethod.call(console, prefix, 'color: ' + color, msg)\n          }\n        }\n      }\n    }\n  },\n\n  /**\n   * Returns the current time in format hh:mm:ss.mmm (with trailing 0s)\n   * @private\n   * @return {string} Current time.\n   */\n  _getCurrentTime: function () {\n    var d = new Date()\n    var hh = ('0' + d.getDate()).slice(-2)\n    var mm = ('0' + d.getMinutes()).slice(-2)\n    var ss = ('0' + d.getSeconds()).slice(-2)\n    var mmm = ('00' + d.getMilliseconds()).slice(-3)\n    return '[' + hh + ':' + mm + ':' + ss + '.' + mmm + ']'\n  },\n\n  /**\n   * Returns a console message without style\n   *\n   * @private\n   * @param {(string|object|array)} msg Message string, object or array of messages.\n   * @param {string} prefix Prefix of the message.\n   */\n  _plainReport: function (msg, prefix) {\n    if (msg instanceof Array) {\n      for (var m in msg) {\n        Log._plainReport(msg[m], prefix)\n      }\n    } else {\n      if (typeof msg === 'string') {\n        console.log(prefix + ' ' + msg)\n      } else {\n        console.log(prefix + ' <next line>')\n        console.log(msg)\n      }\n    }\n  },\n\n  /**\n   * Sends an error (level 1) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  error: function () {\n    Log.report([].slice.call(arguments), Log.Level.ERROR, 'darkred')\n  },\n\n  /**\n   * Sends a warning (level 2) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  warn: function () {\n    Log.report([].slice.call(arguments), Log.Level.WARNING, 'darkorange')\n  },\n\n  /**\n   * Sends a notice (level 3) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  notice: function () {\n    Log.report([].slice.call(arguments), Log.Level.NOTICE, 'darkgreen')\n  },\n\n  /**\n   * Sends a debug message (level 4) to console.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  debug: function () {\n    Log.report([].slice.call(arguments), Log.Level.DEBUG, 'indigo')\n  },\n\n  /**\n   * Sends a verbose message (level 5) to console.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  verbose: function () {\n    Log.report([].slice.call(arguments), Log.Level.VERBOSE, 'navy')\n  },\n\n  /**\n   * This function is automatically executed at youboralib's init.\n   * Will search inside window.location.search for attribute 'youbora-debug=X'.\n   * X can have one of these values, that will modify LogLevel.\n   * 6: SILENT,\n   * 5: ERROR,\n   * 4: WARNING,\n   * 3: NOTICE,\n   * 2: DEBUG,\n   * 1: VERBOSE\n   *\n   * If youbora-console=plain is present, plainLogs will be set to true.\n   */\n  loadLevelFromUrl: function () {\n    if (typeof window !== 'undefined' && window.location) {\n      this._parseLevelFromUrl(window.location.search)\n    }\n  },\n\n  _parseLevelFromUrl: function (url) {\n    if (url) {\n      var m = /\\?.*&*youbora-debug=(.+)/i.exec(url)\n      if (m !== null) {\n        Log.logLevel = m[1]\n      }\n\n      var m2 = /\\?.*&*youbora-debug=plain/i.exec(url)\n      if (m2 !== null) {\n        Log.plainLogs = true\n      }\n    }\n  }\n}\n\nmodule.exports = Log\n","/**\n * See Object.assign.\n *\n * @memberof youbora.Util\n */\nmodule.exports = function (target) {\n  if (target === undefined || target === null) {\n    throw new TypeError('Cannot convert undefined or null to object')\n  }\n\n  var output = Object(target)\n  for (var index = 1; index < arguments.length; index++) {\n    var source = arguments[index]\n    if (source !== undefined && source !== null) {\n      for (var nextKey in source) {\n        if (source.hasOwnProperty(nextKey)) { // eslint-disable-line no-prototype-builtins\n          output[nextKey] = source[nextKey]\n        }\n      }\n    }\n  }\n  return output\n}\n","var F = function () { }\n\n/** See Object.create. */\nmodule.exports = function (o) {\n  if (arguments.length > 1) {\n    throw Error('Second argument not supported')\n  }\n  if (o === null) {\n    throw Error('Cannot set a null [[Prototype]]')\n  }\n  if (typeof o !== 'object') {\n    throw TypeError('Argument must be an object')\n  }\n  F.prototype = o\n  return new F()\n}\n","/**\n * See Array.isArray.\n * @memberof youbora.Util\n */\nmodule.exports = function (obj) {\n  return Object.prototype.toString.call(obj) === '[object Array]'\n}\n","/* global PerformanceObserver */\nvar YouboraObject = require('../object')\nvar RUMSpeedIndex = require('./speedIndex')\n\n/**\n * This static class provides information about the load times of the page\n *\n * @constructs YouboraObject\n * @extends youbora.YouboraObject\n * @memberof youbora\n *\n */\nvar BrowserLoadTimes = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.infinity = plugin.infinity\n    this.timeObject = null\n    this.playerSetup = null\n    this.perfObject = null\n    this.myTimesObject = {}\n\n    if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n      window.addEventListener('load', this._windowLoaded.bind(this))\n      if (window.performance && window.performance.timing) {\n        try {\n          if (typeof window.performance.getEntriesByType === 'function') {\n            this.perfObject = window.performance\n          }\n        } catch (err) {\n          // Nothing\n        }\n        this.timeObject = window.performance.timing\n      }\n    }\n    try {\n      if (typeof PerformanceObserver === 'function') {\n        var observer = new PerformanceObserver(function (list, obj) {\n          var entries = list.getEntries()\n          this.myTimesObject.largestContentfulPaint = entries[entries.length - 1].renderTime\n        }.bind(this))\n        if (PerformanceObserver.supportedEntryTypes.indexOf('largest-contentful-paint') > -1) {\n          observer.observe({ entryTypes: ['largest-contentful-paint'] })\n        }\n      }\n    } catch (err) {\n      // Cant use PerformanceObserver, entryTypes...\n    }\n  },\n\n  _windowLoaded: function () {\n    this.myTimesObject.onLoad = new Date().getTime()\n    this._getEnoughFPS()\n    setTimeout(this._fireLoadTimesEvent.bind(this), 1000)\n  },\n\n  _fireLoadTimesEvent: function () {\n    this._getLastMetrics()\n    this.infinity.fireEvent('loadTimes', {}, this._getAllValues())\n  },\n\n  _getAllValues: function () {\n    var ret = {\n      // Time between the navigation starts and the page loadEventEnd\n      PageLoadTime: this.getPageLoadTime(),\n      // Domain lookup time\n      DNSTime: this.getDnsTime(),\n      // Connection time\n      TCPTime: this.getTcpTime(),\n      // Handshake (https) connection time\n      HandshakeTime: this.getHandshakeTime(),\n      // Time between navigation starts and DOM is ready\n      DomReadyTime: this.getDomReadyTime(),\n      // Time between navigation start and beginning of the backend response\n      BackendTime: this.getBackendTime(),\n      // Time between navigation starts and page load event\n      FrontendTime: this.getFrontendTime(),\n      // The maximum of First Paint / First Contentful Paint and domContentLoadedEventEnd\n      VisualReady: this.getTimeToVisuallyReady(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/Time_to_interactive\n      TimeToInteractive: this.getTimeToInteractive(),\n      // Accumulated time to download all the JS files\n      JsTime: this.getJSTime(),\n      // Accumulated time to download all the CSS files\n      CssTime: this.getCSSTime(),\n      // Accumulated time to download all the images\n      ImageTime: this.getImageTime(),\n      // Accumulated time to download all the fonts\n      FontTime: this.getFontTime(),\n      // Average latency of all the file requests\n      AvgReqLatency: this.getAvgReqLatency(),\n      // Highest latency of all the file requests\n      MaxReqLatency: this.getMaxReqLatency(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/First_paint\n      FirstPaint: this.getFirstPaint(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/First_contentful_paint\n      FirstContentfulPaint: this.getFirstContentfulPaint(),\n      // https://rockcontent.com/blog/largest-contentful-paint/\n      LargestContentfulPaint: this.getLargestContentfulPaint(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/Speed_index\n      SpeedIndex: this.getSpeedIndex()\n    }\n    for (var key in ret) {\n      if (ret[key] === null || ret[key] === undefined || ret[key] < 0) {\n        delete ret[key]\n      } else {\n        ret[key] = Math.round(ret[key])\n      }\n    }\n    return ret\n  },\n\n  // Getters\n\n  getPageLoadTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.loadEventEnd - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getPlayerStartupTime: function () {\n    var ret = null\n    if (this.timeObject && this.playerSetup) {\n      ret = this.playerSetup - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getDnsTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.domainLookupEnd - this.timeObject.domainLookupStart\n    }\n    return ret\n  },\n\n  getTcpTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.connectEnd - this.timeObject.connectStart\n    }\n    return ret\n  },\n\n  getHandshakeTime: function () {\n    var ret = null\n    if (this.timeObject && this.timeObject.secureConnectionStart) {\n      ret = this.timeObject.connectEnd - this.timeObject.secureConnectionStart\n    }\n    return ret\n  },\n\n  getDomReadyTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.domComplete - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getBackendTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.responseStart - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getFrontendTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.myTimesObject.onLoad - this.timeObject.responseStart\n    }\n    return ret\n  },\n\n  getTimeToVisuallyReady: function () {\n    var ret = this.myTimesObject.firstPaint || 0\n    if (this.timeObject) {\n      return Math.max(\n        ret,\n        this.timeObject.domContentLoadedEventEnd - this.timeObject.navigationStart || 0\n      // this.myTimesObject.heroImages - this.timeObject.navigationStart || 0\n      )\n    }\n    return ret || null\n  },\n\n  getTimeToInteractive: function () {\n    if (this.myTimesObject.fps && this.getTimeToVisuallyReady()) {\n      return Math.max(this.myTimesObject.fps, this.getTimeToVisuallyReady())\n    } else {\n      setTimeout(function () { this.getTimeToInteractive() }.bind(this), 500)\n    }\n  },\n\n  getJSTime: function () {\n    return this._getXTime('script')\n  },\n\n  getCSSTime: function () {\n    return this._getXTime('css')\n  },\n\n  getImageTime: function () {\n    return this._getXTime('img')\n  },\n\n  getFontTime: function () {\n    return this._getXTime('css', ['.woff', '.otf', '.ttf'])\n  },\n\n  getAvgReqLatency: function () {\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var count = 0\n        var latency = 0\n        var scripts = this.perfObject.getEntriesByType('resource')\n        for (var i in scripts) {\n          if (scripts[i].requestStart && scripts[i].responseStart) {\n            latency += scripts[i].responseStart - scripts[i].requestStart\n          }\n          count++\n        }\n        return latency / count\n      }\n    } catch (err) {\n      // Nothing\n    }\n    return null\n  },\n\n  getFirstPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.firstPaint : null\n  },\n\n  getFirstContentfulPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.firstContentfulPaint : null\n  },\n\n  getLargestContentfulPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.largestContentfulPaint : null\n  },\n\n  getMaxReqLatency: function () {\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var scripts = this.perfObject.getEntriesByType('resource')\n        var latency = 0\n        for (var i in scripts) {\n          if (scripts[i].requestStart && scripts[i].responseStart) {\n            latency = Math.max(latency, scripts[i].responseStart - scripts[i].requestStart)\n          }\n        }\n        return latency\n      }\n    } catch (err) {\n      // Nothing\n    }\n    return null\n  },\n\n  getSpeedIndex: function () {\n    var ret = null\n    if (typeof window !== 'undefined' && window.performance && typeof window.performance.getEntriesByType === 'function') {\n      try {\n        ret = RUMSpeedIndex()\n      } catch (e) {\n        // nothing\n      }\n    }\n    return ret\n  },\n\n  _getXTime: function (type, validExtensions) {\n    var ret = 0\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var scripts = this.perfObject.getEntriesByType('resource')\n        for (var i in scripts) {\n          if (scripts[i].initiatorType === type) {\n            if (!validExtensions) {\n              ret += scripts[i].duration\n            } else {\n              var valid = false\n              for (var ext in validExtensions) {\n                if (scripts[i].name.indexOf(validExtensions[ext] > 0)) {\n                  valid = true\n                }\n              }\n              if (valid) {\n                ret += scripts[i].duration\n              }\n            }\n          }\n        }\n      }\n    } catch (err) {\n    // Nothing\n    }\n    return Math.round(ret) || null\n  },\n\n  _getLastMetrics: function () {\n    var firstPaint = null\n    var contentfulPaint = null\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var entries = this.perfObject.getEntriesByType('paint')\n        for (var i in entries) {\n          if (entries[i].name === 'first-paint') {\n            firstPaint = entries[i].startTime\n          } else if (entries[i].name === 'first-contentful-paint') {\n            contentfulPaint = entries[i].startTime\n          }\n        }\n      }\n    } catch (err) {\n    // Nothing\n    }\n    // First paint\n    if (!firstPaint && this.timeObject) {\n      firstPaint = this.timeObject.msFirstPaint - this.timeObject.navigationStart\n    }\n    // TODO first paint for firefox\n    this.myTimesObject.firstPaint = firstPaint\n    // First contentful paint\n    this.myTimesObject.firstContentfulPaint = contentfulPaint\n    // Others\n    this.getTimeToInteractive()\n  },\n\n  _getEnoughFPS: function () {\n    if (this.timeObject && typeof window !== 'undefined') {\n      var req = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function () {}\n      this.preFPS = new Date().getTime()\n      req(function () {\n        var now = new Date().getTime()\n        if (now < this.preFPS + 50) {\n          this.myTimesObject.fps = now - this.timeObject.navigationStart\n        } else {\n          setTimeout(function () { return this._getEnoughFPS() }.bind(this), 50)\n        }\n      }.bind(this))\n    } else {\n      return true\n    }\n  },\n\n  // Setters\n\n  setPlayerSetupTime: function () {\n    this.playerSetup = this.playerSetup || new Date().getTime()\n  }\n})\n\nmodule.exports = BrowserLoadTimes\n","/* global Streamroot, peer5, teltoo, CdnBalancerStats */\nvar YouboraObject = require('../object')\n/**\n * This static class provides p2p and cdn network traffic information for\n * Streamroot, Peer5 and EasyBroadcast\n *\n * @constructs YouboraObject\n * @extends youbora.YouboraObject\n * @memberof youbora\n *\n */\nvar HybridNetowrk = YouboraObject.extend({\n  /** Returns CDN traffic bytes using NPAW balancer, streamroot, peer5 or teltoo. Otherwise null */\n  getCdnTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn) {\n      ret = CdnBalancerStats.cdn.totalDownloadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('cdn', false) || this._getStreamrootInstanceObject('cdnDownload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalHttpDownloaded\n    } else if (typeof teltoo !== 'undefined' && teltoo.getStats) {\n      var stats = teltoo.getStats()\n      ret = stats.totalReceivedBytes - stats.p2pReceivedBytes\n    }\n    return ret\n  },\n\n  /** Returns CDN traffic when using multiple cdns, available only for NPAW solution. Otherwise null */\n  getMultiCdnInfo: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn && CdnBalancerStats.cdn.cdns) {\n      var p2p = CdnBalancerStats.p2p\n      ret = {\n        P2P: {\n          downloaded_bytes: p2p.downloadedBytes,\n          uploaded_bytes: p2p.uploadedBytes,\n          downloaded_chunks: p2p.downloadedSegments,\n          uploaded_chunks: p2p.uploadedSegments,\n          errors: p2p.failedRequests ? p2p.failedRequests.total : 0,\n          missed_downloaded_chunks: p2p.failedRequests ? p2p.failedRequests.absent : 0,\n          timeout_errors: p2p.failedRequests ? p2p.failedRequests.timeout : 0,\n          other_errors: p2p.failedRequests ? p2p.failedRequests.error : 0,\n          late_uploaded_chunks: p2p.discardedUploadedSegments,\n          late_uploaded_bytes: p2p.discardedUploadedBytes,\n          late_downloaded_bytes: p2p.discardedDownloadedBytes,\n          time: p2p.downloadMillis,\n          active_peers: p2p.activePeers,\n          peers: p2p.totalPeers\n        }\n      }\n      CdnBalancerStats.cdn.cdns.forEach(function (cdn) {\n        ret[cdn.name] = {\n          downloaded_bytes: cdn.bytes,\n          downloaded_chunks: cdn.chunks,\n          errors: cdn.failures,\n          time: cdn.downloadMillis\n        }\n      })\n    }\n    return ret\n  },\n\n  /** Returns segment duration using NPAW balancer API. Otherwise null */\n  getSegmentDuration: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.segmentDuration) {\n      return CdnBalancerStats.segmentDuration\n    }\n    return ret\n  },\n\n  /** Returns CDN balancer API response id, available only for NPAW solution. Otherwise null */\n  getBalancerResponseId: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn) {\n      return CdnBalancerStats.cdn.responseUUID\n    }\n    return ret\n  },\n\n  /** Returns P2P traffic bytes using NPAW balancer, streamroot, peer5 or teltoo. Otherwise null */\n  getP2PTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.downloadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('p2p', true) || this._getStreamrootInstanceObject('dnaDownload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalP2PDownloaded\n    } else if (typeof teltoo !== 'undefined' && teltoo.getStats) {\n      ret = teltoo.getStats().p2pReceivedBytes\n    }\n    return ret\n  },\n\n  /** Returns P2P traffic sent in bytes, using NPAW balancer, streamroot or peer5. Otherwise null */\n  getUploadTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.uploadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('upload', true) || this._getStreamrootInstanceObject('dnaUpload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalP2PUploaded\n    }\n    return ret\n  },\n\n  /** Returns if P2P is enabled, using NPAW balancer, streamroot or peer5. Otherwise null */\n  getIsP2PEnabled: function () {\n    var ret = false\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.downloadEnabled\n    } else if (typeof Streamroot !== 'undefined') {\n      if (Streamroot.p2pAvailable && Streamroot.peerAgents) {\n        for (var agent in Streamroot.peerAgents) {\n          ret = ret || Streamroot.peerAgents[agent].isP2PEnabled\n        }\n      } else if (Streamroot.instances) {\n        Streamroot.instances.forEach(function (instance) {\n          ret = ret || instance.dnaDownloadEnabled || instance.dnaUploadEnabled\n        })\n      }\n    } else if (typeof peer5 !== 'undefined' && peer5.isEnabled) {\n      ret = peer5.isEnabled()\n    } else if (typeof teltoo !== 'undefined') {\n      ret = true\n    }\n    return ret\n  },\n\n  _getStreamrootPeerObject: function (objectName, check) {\n    var ret = null\n    if (Streamroot.p2pAvailable && Streamroot.peerAgents) {\n      for (var agent in Streamroot.peerAgents) {\n        var agentInst = Streamroot.peerAgents[agent]\n        if (agentInst.stats && (!check || agentInst.isP2PEnabled)) {\n          ret += agentInst.stats[objectName]\n        }\n      }\n    }\n    return ret\n  },\n\n  _getStreamrootInstanceObject: function (objectName) {\n    var ret = null\n    if (Streamroot.instances) {\n      Streamroot.instances.forEach(function (instance) {\n        if (instance.stats && instance.stats.currentContent) {\n          ret += instance.stats.currentContent[objectName]\n        }\n      })\n    }\n    return ret\n  }\n})\n\nmodule.exports = HybridNetowrk\n","/* istanbul ignore next */\n/******************************************************************************\nCopyright (c) 2014, Google Inc.\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n    * Neither the name of the <ORGANIZATION> nor the names of its contributors\n    may be used to endorse or promote products derived from this software\n    without specific prior written permission.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n******************************************************************************/\n\n/******************************************************************************\n*******************************************************************************\n  Calculates the Speed Index for a page by:\n  - Collecting a list of visible rectangles for elements that loaded\n    external resources (images, background images, fonts)\n  - Gets the time when the external resource for those elements loaded\n    through Resource Timing\n  - Calculates the likely time that the background painted\n  - Runs the various paint rectangles through the SpeedIndex calculation:\n    https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metrics/speed-index\n  TODO:\n  - Improve the start render estimate\n  - Handle overlapping rects (though maybe counting the area as multiple paints\n    will work out well)\n  - Detect elements with Custom fonts and the time that the respective font\n    loaded\n  - Better error handling for browsers that don't support resource timing\n*******************************************************************************\n******************************************************************************/\n\nvar RUMSpeedIndex = function (win) {\n  win = win || window\n  var doc = win.document\n\n  /****************************************************************************\n    Support Routines\n  ****************************************************************************/\n  // Get the rect for the visible portion of the provided DOM element\n  var GetElementViewportRect = function (el) {\n    var intersect = false\n    if (el.getBoundingClientRect) {\n      var elRect = el.getBoundingClientRect()\n      intersect = {\n        top: Math.max(elRect.top, 0),\n        left: Math.max(elRect.left, 0),\n        bottom: Math.min(elRect.bottom, (win.innerHeight || doc.documentElement.clientHeight)),\n        right: Math.min(elRect.right, (win.innerWidth || doc.documentElement.clientWidth))\n      }\n      if (intersect.bottom <= intersect.top ||\n          intersect.right <= intersect.left) {\n        intersect = false\n      } else {\n        intersect.area = (intersect.bottom - intersect.top) * (intersect.right - intersect.left)\n      }\n    }\n    return intersect\n  }\n\n  // Check a given element to see if it is visible\n  var CheckElement = function (el, url) {\n    if (url) {\n      var rect = GetElementViewportRect(el)\n      if (rect) {\n        rects.push({\n          url: url,\n          area: rect.area,\n          rect: rect\n        })\n      }\n    }\n  }\n\n  // Get the visible rectangles for elements that we care about\n  var GetRects = function () {\n    // Walk all of the elements in the DOM (try to only do this once)\n    var elements = doc.getElementsByTagName('*')\n    var re = /url\\(.*(http.*)\\)/ig\n    for (var i = 0; i < elements.length; i++) {\n      var el = elements[i]\n      var style = win.getComputedStyle(el)\n\n      // check for Images\n      if (el.tagName === 'IMG') {\n        CheckElement(el, el.src)\n      }\n      // Check for background images\n      if (style['background-image']) {\n        re.lastIndex = 0\n        var matches = re.exec(style['background-image'])\n        if (matches && matches.length > 1) { CheckElement(el, matches[1].replace('\"', '')) }\n      }\n      // recursively walk any iFrames\n      if (el.tagName === 'IFRAME') {\n        try {\n          var rect = GetElementViewportRect(el)\n          if (rect) {\n            var tm = RUMSpeedIndex(el.contentWindow)\n            if (tm) {\n              rects.push({\n                tm: tm,\n                area: rect.area,\n                rect: rect\n              })\n            }\n          }\n        } catch (e) {\n        }\n      }\n    }\n  }\n\n  // Get the time at which each external resource loaded\n  var GetRectTimings = function () {\n    var timings = {}\n    var requests = win.performance.getEntriesByType('resource')\n    for (var i = 0; i < requests.length; i++) { timings[requests[i].name] = requests[i].responseEnd }\n    for (var j = 0; j < rects.length; j++) {\n      if (!('tm' in rects[j])) { rects[j].tm = timings[rects[j].url] !== undefined ? timings[rects[j].url] : 0 }\n    }\n  }\n\n  // Get the first paint time.\n  var GetFirstPaint = function () {\n    // If the browser supports a first paint event, just use what the browser reports\n    if ('msFirstPaint' in win.performance.timing) { firstPaint = win.performance.timing.msFirstPaint - navStart }\n    var paintMetrics = win.performance.getEntriesByType('paint')\n    for (var k = 0; k < paintMetrics.length; k++) {\n      if (paintMetrics[k].name === 'first-paint') {\n        firstPaint = paintMetrics[k].startTime\n      }\n    }\n    // For browsers that don't support first-paint or where we get insane values,\n    // use the time of the last non-async script or css from the head.\n    if (firstPaint === undefined || firstPaint < 0 || firstPaint > 120000) {\n      firstPaint = win.performance.timing.responseStart - navStart\n      var headURLs = {}\n      var headElements = doc.getElementsByTagName('head')[0].children\n      for (var i = 0; i < headElements.length; i++) {\n        var el = headElements[i]\n        if (el.tagName === 'SCRIPT' && el.src && !el.async) { headURLs[el.src] = true }\n        if (el.tagName === 'LINK' && el.rel === 'stylesheet' && el.href) { headURLs[el.href] = true }\n      }\n      var requests = win.performance.getEntriesByType('resource')\n      var doneCritical = false\n      for (var j = 0; j < requests.length; j++) {\n        if (!doneCritical &&\n            headURLs[requests[j].name] &&\n           (requests[j].initiatorType === 'script' || requests[j].initiatorType === 'link')) {\n          var requestEnd = requests[j].responseEnd\n          if (firstPaint === undefined || requestEnd > firstPaint) { firstPaint = requestEnd }\n        } else {\n          doneCritical = true\n        }\n      }\n    }\n    firstPaint = Math.max(firstPaint, 0)\n  }\n\n  // Sort and group all of the paint rects by time and use them to\n  // calculate the visual progress\n  var CalculateVisualProgress = function () {\n    var paints = { 0: 0 }\n    var total = 0\n    for (var i = 0; i < rects.length; i++) {\n      var tm = firstPaint\n      if ('tm' in rects[i] && rects[i].tm > firstPaint) { tm = rects[i].tm }\n      if (paints[tm] === undefined) { paints[tm] = 0 }\n      paints[tm] += rects[i].area\n      total += rects[i].area\n    }\n    // Add a paint area for the page background (count 10% of the pixels not\n    // covered by existing paint rects.\n    var pixels = Math.max(doc.documentElement.clientWidth, win.innerWidth || 0) *\n                 Math.max(doc.documentElement.clientHeight, win.innerHeight || 0)\n    if (pixels > 0) {\n      pixels = Math.max(pixels - total, 0) * pageBackgroundWeight\n      if (paints[firstPaint] === undefined) { paints[firstPaint] = 0 }\n      paints[firstPaint] += pixels\n      total += pixels\n    }\n    // Calculate the visual progress\n    if (total) {\n      for (var time in paints) {\n        if (paints.hasOwnProperty(time)) { // eslint-disable-line no-prototype-builtins\n          progress.push({ tm: time, area: paints[time] })\n        }\n      }\n      progress.sort(function (a, b) { return a.tm - b.tm })\n      var accumulated = 0\n      for (var j = 0; j < progress.length; j++) {\n        accumulated += progress[j].area\n        progress[j].progress = accumulated / total\n      }\n    }\n  }\n\n  // Given the visual progress information, Calculate the speed index.\n  var CalculateSpeedIndex = function () {\n    if (progress.length) {\n      SpeedIndex = 0\n      var lastTime = 0\n      var lastProgress = 0\n      for (var i = 0; i < progress.length; i++) {\n        var elapsed = progress[i].tm - lastTime\n        if (elapsed > 0 && lastProgress < 1) { SpeedIndex += (1 - lastProgress) * elapsed }\n        lastTime = progress[i].tm\n        lastProgress = progress[i].progress\n      }\n    } else {\n      SpeedIndex = firstPaint\n    }\n  }\n\n  /****************************************************************************\n    Main flow\n  ****************************************************************************/\n  var rects = []\n  var progress = []\n  var firstPaint\n  var SpeedIndex\n  var pageBackgroundWeight = 0.1\n  try {\n    var navStart = win.performance.timing.navigationStart\n    GetRects()\n    GetRectTimings()\n    GetFirstPaint()\n    CalculateVisualProgress()\n    CalculateSpeedIndex()\n  } catch (e) {\n  }\n  return SpeedIndex\n}\n\nmodule.exports = RUMSpeedIndex\n","var assign = require('./mixins/assign')\nvar createObject = require('./mixins/create')\n\nvar YouboraObject = function () { }\n\nYouboraObject.prototype = {\n  /**\n   * A base class that other Classes should inherit from.\n   * It has a no-op constructor intended to be overridden by classes that extend from this.\n   *\n   * @constructs YouboraObject\n   * @abstract\n   * @memberof youbora\n   */\n  constructor: function () { }\n}\n\n/**\n * This method allows the extension of the current class, emulating 1-level inheritance.\n * It is inspired by Backbone's extend, but removing all references to underscore.\n *\n * @see http://backbonejs.org/#Model-extend\n *\n * @example\n * var A = YouboraObject.extend({ a: 1, b: 1, c: { d: 0 } });\n * var a = new A(); // { a: 1, b: 1, c: { d: 0 } }\n *\n * var B = A.extend({ b: 2, c: { e: 3 } });\n * var b = new B(); // { a: 1, b: 2, c: { e: 3 } }\n *\n * @param  {Object} protoProps  Prototype properties (available on the instances)\n * @param  {Object} staticProps Static properties (available on the contructor)\n * @return {Object}             New sub class\n */\nYouboraObject.extend = function (protoProps, staticProps) {\n  var parent = this\n  var child\n\n  // The constructor function for the new subclass is either defined by you\n  // (the \"constructor\" property in your `extend` definition), or defaulted\n  // by us to simply call the parent constructor.\n  if (protoProps && protoProps.hasOwnProperty('constructor')) { // eslint-disable-line no-prototype-builtins\n    child = protoProps.constructor\n  } else {\n    child = function () { return parent.apply(this, arguments) }\n  }\n\n  // Add static properties to the constructor function, if supplied.\n  assign(child, parent, staticProps)\n\n  // Set the prototype chain to inherit from `parent`, without calling\n  // `parent`'s constructor function and add the prototype properties.\n  child.prototype = createObject(parent.prototype)\n  if (protoProps) assign(child.prototype, protoProps)\n  child.prototype.constructor = child\n\n  // Set a convenience property in case the parent's prototype is needed\n  // later.\n  child.__super__ = parent.prototype\n  return child\n}\n\nmodule.exports = YouboraObject\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar DeprecatedOptions = YouboraObject.extend({\n  exists: function (optionName) {\n    return DeprecatedOptions.Dictionary.hasOwnProperty(optionName) // eslint-disable-line no-prototype-builtins\n  },\n\n  getNewName: function (optionName) {\n    var newName = DeprecatedOptions.Dictionary[optionName]\n    Log.warn('The option \"' + optionName + '\" is deprecated, use \"' + newName + '\" instead')\n    return newName\n  }\n}, {\n  // Keys are old option names\n  // Values are new option names\n  Dictionary: {\n    httpSecure: 'app.https',\n    username: 'user.name',\n    anonymousUser: 'user.anonymousId',\n    obfuscateIp: 'user.obfuscateIp',\n    userType: 'user.type',\n    'content.title2': 'content.program',\n    'background.settings.iphone': 'background.settings.iOS',\n    'parse.hls': 'parse.manifest',\n    'parse.dash': 'parse.manifest',\n    'parse.locationHeader': 'parse.manifest',\n    'extraparam.1': 'content.customDimension.1',\n    'extraparam.2': 'content.customDimension.2',\n    'extraparam.3': 'content.customDimension.3',\n    'extraparam.4': 'content.customDimension.4',\n    'extraparam.5': 'content.customDimension.5',\n    'extraparam.6': 'content.customDimension.6',\n    'extraparam.7': 'content.customDimension.7',\n    'extraparam.8': 'content.customDimension.8',\n    'extraparam.9': 'content.customDimension.9',\n    'extraparam.10': 'content.customDimension.10',\n    'extraparam.11': 'content.customDimension.11',\n    'extraparam.12': 'content.customDimension.12',\n    'extraparam.13': 'content.customDimension.13',\n    'extraparam.14': 'content.customDimension.14',\n    'extraparam.15': 'content.customDimension.15',\n    'extraparam.16': 'content.customDimension.16',\n    'extraparam.17': 'content.customDimension.17',\n    'extraparam.18': 'content.customDimension.18',\n    'extraparam.19': 'content.customDimension.19',\n    'extraparam.20': 'content.customDimension.20',\n    'ad.extraparam.1': 'ad.customDimension.1',\n    'ad.extraparam.2': 'ad.customDimension.2',\n    'ad.extraparam.3': 'ad.customDimension.3',\n    'ad.extraparam.4': 'ad.customDimension.4',\n    'ad.extraparam.5': 'ad.customDimension.5',\n    'ad.extraparam.6': 'ad.customDimension.6',\n    'ad.extraparam.7': 'ad.customDimension.7',\n    'ad.extraparam.8': 'ad.customDimension.8',\n    'ad.extraparam.9': 'ad.customDimension.9',\n    'ad.extraparam.10': 'ad.customDimension.10'\n  }\n})\n\nmodule.exports = DeprecatedOptions\n","var YouboraObject = require('../object')\nvar Storage = require('./storage')\n\n/**\n * This class manages data storage for offline events in an storage.\n *\n * @extends youbora.Emitter\n * @memberof youbora\n */\nvar OfflineStorage = YouboraObject.extend({\n  constructor: function () {\n    this.storage = new Storage('youboraOffline', true) // No cookies for offline\n    this.actualView = null\n    this.viewList = []\n    this.givenIds = []\n    this._getOldViewList()\n  },\n\n  _newView: function () {\n    // search for first unused id\n    var viewId = this._getValidId()\n\n    // create empty view\n    this.storage.setLocal(viewId, '')\n\n    // add to viewlist\n    this.viewList.push(viewId)\n    this.storage.setLocal('views', this.viewList)\n\n    // save the id\n    this.actualView = viewId\n  },\n\n  addEvent: function (event, params) {\n    // if event is start, create new view\n    if (event === '/start') this._newView()\n\n    // if event is init, ignore\n    if (event === '/init') return null\n\n    // if we have no view discard\n    if (!this.actualView) return null\n\n    // create event object\n    var fullEvent = '{\"request\":\"' + event.slice(1) + '\",' // {\"request\":\"start\",\n    fullEvent += '\"unixtime\":' + Date.now() + ',' // \"unixtime\":1499876515,\n    for (var param in params) {\n      if (params[param] === undefined) break\n      fullEvent += '\"' + param + '\":' // \"aParam\":\n      if (param === 'code') {\n        fullEvent += '\"' + 'CODE_PLACEHOLDER' + '\",' // \"CODE_PLACEHOLDER\",\n      } else if (param === 'sessionId') {\n        fullEvent += '\"' + 'SESSION_PLACEHOLDER' + '\",' // \"SESSION_PLACEHOLDER\",\n      } else if (param === 'sessionRoot') {\n        fullEvent += '\"' + 'ROOT_PLACEHOLDER' + '\",' // \"ROOT_PLACEHOLDER\",\n      } else if (typeof params[param] === 'string') {\n        fullEvent += '\"' + params[param] + '\",' // \"aStringValue\",\n      } else if (typeof params[param] === 'object') {\n        fullEvent += '\"' + JSON.stringify(params[param]).replace(/\"/g, '\\\\\"') + '\",' // json object\n      } else {\n        fullEvent += params[param] + ',' // 123, for example\n      }\n    }\n    fullEvent = fullEvent.slice(0, -1) // remove the last comma\n    fullEvent += '}'\n\n    // get accumulated view object\n    var temp = this.storage.getLocal(this.actualView)\n    if (temp !== '') temp = temp + ',' // comma between events\n\n    // add the event\n    this.storage.setLocal(this.actualView, temp + fullEvent)\n  },\n\n  getView: function () {\n    if (this.viewList.length > this.givenIds.length) { // if we have any view not sent yet\n      var position = 0\n      while (true) {\n        var idToSend = this.viewList[position]\n        if (this.givenIds.indexOf(idToSend) < 0) {\n          this.givenIds.push(idToSend)\n          return ['[' + this.storage.getLocal(idToSend) + ']', idToSend]\n        }\n        position++\n      }\n    }\n    return [null, null]\n  },\n\n  removeView: function (id) {\n    this.storage.removeLocal(id)\n    var position = this.viewList.indexOf(id)\n    if (position !== -1) this.viewList.splice(position, 1)\n    position = this.givenIds.indexOf(id)\n    if (position !== -1) this.givenIds.splice(position, 1)\n    this.storage.setLocal('views', this.viewList.toString())\n    if (id === this.actualView) this.actualView = null\n  },\n\n  _getOldViewList: function () {\n    var stringList = ''\n    if (this.storage.getLocal('views')) {\n      stringList = this.storage.getLocal('views')\n    } else {\n      this.storage.setLocal('views', '')\n    }\n\n    if (stringList === '') {\n      this.viewList = []\n    } else if (typeof stringList.split === 'function') {\n      this.viewList = stringList.split(',')\n    }\n  },\n\n  _getValidId: function () {\n    // get a value not in the list\n    var id = Math.floor(Math.random() * 1e8).toString()\n    if (this.viewList.indexOf(id) >= 0) {\n      return this._getValidId()\n    }\n    return id\n  },\n\n  sent: function () {\n    this.givenIds = []\n  }\n})\n\nmodule.exports = OfflineStorage\n","var YouboraObject = require('../object')\nvar DeprecatedOptions = require('./deprecatedOptions')\nvar Log = require('../log')\nvar TransportFormat = require('../constants/transportFormat')\nvar StreamingProtocol = require('../constants/streamingProtocols')\nvar RequestMethod = require('../constants/requestMethod')\n\nvar Options = YouboraObject.extend(\n  /** @lends youbora.Options.prototype */\n  {\n    /**\n     * This Class store youbora configuration settings.\n     * Any value specified in this class, if set, will override the info the plugin is able to get\n     * on its own.\n     *\n     * @constructs Options\n     * @param {Object|Options} [options] A literal containing values.\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function (options) {\n      /** @prop {boolean} [enabled=true] If false, the plugin won't send NQS requests. */\n      this.enabled = true\n\n      /** @prop {string} [host='a-fds.youborafds01.com'] Host of the Fastdata service. */\n      this.host = 'a-fds.youborafds01.com'\n\n      /**\n      * @prop {string} [accountCode='nicetest']\n      * NicePeopleAtWork account code that indicates the customer account.\n      */\n      this.accountCode = 'nicetest'\n\n      /**\n       * @prop {string} [authToken]\n       * Optional auth token to validate all the requests\n       */\n      this.authToken = null\n\n      /**\n       * @prop {string} [authType]\n       * Optional auth type. Used if authToken is set.\n       * 'Bearer' by default.\n       */\n      this.authType = 'Bearer'\n\n      /**\n      *  @prop {boolean} [preventZombieViews=true]\n      * If true, the plugin will check if the last event\n      * was sent more than 10 mins ago\n      * so it will not send more events to the same view\n      */\n      this.preventZombieViews = true\n\n      /**\n      * @prop {boolean} [offline=false]\n      * If true the plugin will store the events and send them later when there's connection\n      */\n      this.offline = false\n\n      /** @prop {string} [referer] Site url.\n      *  By default window.location.href */\n      this.referer = null\n\n      /** @prop {string} [referral] Previous site url.\n      *  By default document.referrer */\n      this.referral = null\n\n      /**\n      * @prop {boolean} [disableCookies]\n      * To disable cookies storage fallback after local/sessionstorage\n      * True by default\n      */\n      this.disableCookies = true\n\n      /**\n      * @prop {boolean} [forceCookies]\n      * To force the use of cookies storage instead of local/sessionstorage\n      * False by default\n      */\n      this.forceCookies = false\n\n      /**\n      * @prop {boolean} [disableStorage]\n      * To disable all possible storages usage (cookies, localStorage, sessionStorage)\n      * CAUTION: enabling this option session tracking may stop to work properly\n      * False by default\n      */\n      this.disableStorage = false\n\n      // USER\n\n      /**\n      * @prop {string} [user.email]\n      * User email.\n      */\n      this['user.email'] = null\n\n      /**\n      * @prop {string} [user.type]\n      * User type.\n      */\n      this['user.type'] = null\n\n      /**\n      * @prop {string} [user.name]\n      * User ID value inside your system.\n      */\n      this['user.name'] = null\n\n      /**\n      *  @prop {boolean} [user.obfuscateIp=false]\n      * If true, the view will have the IP obfuscated\n      */\n      this['user.obfuscateIp'] = false\n\n      /**\n      * @prop {string} [user.anonymousId]\n      * Anonymous identifyer of the user provided by the customer.\n      */\n      this['user.anonymousId'] = null\n\n      /**\n      * @prop {string} [user.privacyProtocol]\n      * Privacy protocol to be used, nothing by default.\n      * Possible values are \"optin\" and \"optout\"\n      */\n      this['user.privacyProtocol'] = null\n\n      // PARSERS\n\n      /**\n      * @prop {boolean} [parse.manifest=false]\n      * If true the plugin will look for location value in manifest header to retrieve the actual resource,\n      * will parse HLS files to use the first .ts file found as resource and\n      * will look for location and segment values inside DASH manifest to retrieve the actual resource\n      * It might slow performance down.\n      */\n      this['parse.manifest'] = false\n\n      /**\n      * @prop {object} [parse.manifest.auth={}]\n      * If parse.manifest enabled, it adds extra headers to the request of the content.\n      * Use this if for example, the player needs to include authentication headers to request the content,\n      * so the plugin needs it to access to the manifest files too.\n      */\n      this['parse.manifest.auth'] = {}\n\n      /**\n      * @prop {string} [parse.CdnNameHeader]\n      * If defined, resource parse will try to fetch the CDN code from the custom header defined\n      * by this property. ie: 'x-cdn-forward'\n      */\n      this['parse.cdnNameHeader'] = 'x-cdn-forward'\n\n      /**\n      * @prop {string} [parse.CdnNodeHeader]\n      * If defined, resource parse will try to fetch the CDN node name from the custom header defined\n      * by this property. ie: 'x-node'\n      */\n      this['parse.cdnNodeHeader'] = ''\n\n      /**\n      * @prop {boolean} [parse.CdnNode=false]\n      * If true the plugin will query the CDN to retrieve the node name.\n      * It might slow performance down.\n      */\n      this['parse.cdnNode'] = false\n\n      /**\n      * @prop {array<string>} [parse.CdnNode.list=false]\n      * If true the plugin will query the CDN to retrieve the node name.\n      * It might slow performance down.\n      */\n      this['parse.cdnNode.list'] = ['Akamai', 'Amazon', 'Cloudfront', 'Level3', 'Fastly', 'Highwinds', 'Telefonica', 'Edgecast', 'NosOtt']\n\n      /**\n       * @prop {function} [parse.fdsResponseHost=null]\n       * Parses fastdata response to modify the host where the requests will be sent\n       */\n      this['parse.fdsResponseHost'] = null\n\n      /**\n       * @prop {function} [parse.cdnSwitchHeader=false]\n       * Parses a video chunk or manifest every x seconds to read the x-cdn header and report it\n       */\n      this['parse.cdnSwitchHeader'] = false\n\n      /**\n       * @prop {function} [parse.cdnTTL=60]\n       * if parse.cdnSwitchHeader enabled, the time between new requests\n       */\n      this['parse.cdnTTL'] = 60\n\n      // NETWORK\n\n      /** @prop {string} [network.ip] IP of the viewer/user. ie= '100.100.100.100'. */\n      this['network.ip'] = null\n\n      /** @prop {string} [network.isp] Name of the internet service provider of the viewer/user. */\n      this['network.isp'] = null\n\n      /**\n      * @prop {string} [network.connectionType]\n      * Type of connection used\n      */\n      this['network.connectionType'] = null\n\n      // DEVICE\n\n      /**\n       * @prop {string} [device.id]\n       * Unique identifyer of the device. If set it will consider the value as the device id.\n       * By default the plugin tries to generate a unique id based on exposed information on the browser.\n       * It wont be sent if 'device.isAnonymous option' is set to true.\n       */\n      this['device.id'] = null\n\n      /**\n      * @prop {string} [device.code]\n      * Youbora's device code. If specified it will rewrite info gotten from user agent.\n      * See a list of codes in {@link http://mapi.youbora.com:8081/devices}\n      */\n      this['device.code'] = null\n\n      /**\n      * @prop {string} [device.model]\n      * Device model name\n      */\n      this['device.model'] = null\n\n      /**\n      * @prop {string} [device.brand]\n      * Device vendor name\n      */\n      this['device.brand'] = null\n\n      /**\n      * @prop {string} [device.type]\n      * Device type (pc, smartphone, stb, tv, etc.)\n      */\n      this['device.type'] = null\n\n      /**\n      * @prop {string} [device.name]\n      * Device name. It must exist in NPAW database.\n      */\n      this['device.name'] = null\n\n      /**\n      * @prop {string} [device.osName]\n      * OS name.\n      */\n      this['device.osName'] = null\n\n      /**\n      * @prop {string} [device.osVersion]\n      * OS version.\n      */\n      this['device.osVersion'] = null\n\n      /**\n      * @prop {string} [device.browserName]\n      * Browser name.\n      */\n      this['device.browserName'] = null\n\n      /**\n      * @prop {string} [device.browserVersion]\n      * Browser version.\n      */\n      this['device.browserVersion'] = null\n\n      /**\n      * @prop {string} [device.browserType]\n      * Browser type.\n      */\n      this['device.browserType'] = null\n\n      /**\n      * @prop {string} [device.browserEngine]\n      * Browser engine.\n      */\n      this['device.browserEngine'] = null\n\n      /**\n      * @prop {string} [device.EDID]\n      * Connected screen EDID.\n      * The expected format is a hex value\n      */\n      this['device.EDID'] = null\n\n      /**\n      * @prop {bool} [device.isAnonymous]\n      * If true, it blocks 'deviceUUID' parameter in requests.\n      */\n      this['device.isAnonymous'] = false\n\n      // CONTENT\n\n      /** @prop {string} [content.transactionCode] Custom unique code to identify the view. */\n      this['content.transactionCode'] = null\n\n      /** @prop {string} [content.resource] URL/path of the current media resource. */\n      this['content.resource'] = null\n\n      /** @prop {boolean} [content.isLive] True if the content is live false if VOD. */\n      this['content.isLive'] = null\n\n      /** @prop {boolean} [content.isLive.noSeek] True if the player seeks automatically when resumed or ending buffer. Only for live content. False by default */\n      this['content.isLive.noSeek'] = false\n\n      /** @prop {boolean} [content.isLive.noMonitor] True if the player returns non consistent values for the playhead on live, so playhead monitor wont work to detect buffers and seeks. False by default. */\n      this['content.isLive.noMonitor'] = false\n\n      /** @prop {string} [content.title] Title of the media. */\n      this['content.title'] = null\n\n      /** @prop {string} [content.program] Secondary title of the media */\n      this['content.program'] = null\n\n      /** @prop {number} [content.duration] Duration of the media. */\n      this['content.duration'] = null\n\n      /** @prop {number} [content.fps] Frames per second of the content in the current moment. */\n      this['content.fps'] = null\n\n      /** @prop {number} [content.segmentDuration] Video segment length in milliseconds. */\n      this['content.segmentDuration'] = null\n\n      /** @prop {number} [content.bitrate] Bitrate of the content in bits per second. */\n      this['content.bitrate'] = null\n\n      /** @prop {number} [content.totalBytes] Total downloaded bytes of the content. */\n      this['content.totalBytes'] = null\n\n      /** @prop {bool} [content.sendTotalBytes] Additionaly report totalbytes or not, default false. */\n      this['content.sendTotalBytes'] = false\n\n      /** @prop {number} [content.throughput] Throughput of the client bandwith in bits per second. */\n      this['content.throughput'] = null\n\n      /** @prop {string} [content.rendition] Name of the current rendition of the content. */\n      this['content.rendition'] = null\n\n      /**\n       * @prop {string} [content.cdn]\n       * Codename of the CDN where the content is streaming from.\n       * See a list of codes in {@link http://mapi.youbora.com:8081/cdns}\n       * */\n      this['content.cdn'] = null\n\n      /** @prop {string} [content.cdnNode] CDN node id */\n      this['content.cdnNode'] = null\n\n      /**\n       * @prop {number} [content.cdnType] CDN node content access type\n       * It defines if the content request hits the cache or not\n       * TCP_HIT / HIT: 1\n       * TCP_MISS / MISS: 2\n       * TCP_MEM_HIT: 3\n       * TCP_IMS_HIT: 4\n       */\n      this['content.cdnType'] = null\n\n      /**\n       * @prop {object} [content.metadata]\n       * Item containing mixed extra information about the content like: director, parental rating,\n       * device info or the audio channels.This object may store any serializable key:value info.\n       */\n      this['content.metadata'] = {}\n\n      /**\n       * @prop {object} [content.metrics]\n       * Item containing metrics in json format. Reported every ping if the values change\n       */\n      this['content.metrics'] = {}\n\n      /** @prop {string} [content.streamingProtocol] Name of the streaming media protocol.\n       * Can be:\n       *   - HDS (Adobe HDS)\n       *   - HLS (Apple HLS)\n       *   - MSS (Microsoft Smooth Streaming)\n       *   - DASH (MPEG-DASH)\n       *   - RTMP (Adobe RTMP)\n       *   - RTP (RTP)\n       *   - RTSP (RTSP)\n       */\n      this['content.streamingProtocol'] = null\n\n      /** @prop {string} [content.transportFormat] Name of the transport format.\n       * Can be:\n       *   - TS (MPEG-2 TS)\n       *   - MP4 (Fragmented MP4)\n       */\n      this['content.transportFormat'] = null\n\n      /** @prop {number} [content.package] Package of the media. */\n      this['content.package'] = null\n\n      /** @prop {number} [content.saga] Saga of the media. */\n      this['content.saga'] = null\n\n      /** @prop {number} [content.tvShow] TV Show of the media. */\n      this['content.tvShow'] = null\n\n      /** @prop {number} [content.season] Season of the media. */\n      this['content.season'] = null\n\n      /** @prop {number} [content.episodeTitle] Episode title of the media. */\n      this['content.episodeTitle'] = null\n\n      /** @prop {number} [content.channel] Channel name of the media. */\n      this['content.channel'] = null\n\n      /** @prop {number} [content.id] ID of the media. */\n      this['content.id'] = null\n\n      /** @prop {number} [content.imdbId] IMDB id of the media. */\n      this['content.imdbId'] = null\n\n      /** @prop {number} [content.gracenoteId] Gracenote id of the media. */\n      this['content.gracenoteId'] = null\n\n      /** @prop {number} [content.type] Type of the media. */\n      this['content.type'] = null\n\n      /** @prop {number} [content.genre] Genre of the media. */\n      this['content.genre'] = null\n\n      /** @prop {number} [content.language] Language of the media. */\n      this['content.language'] = null\n\n      /** @prop {boolean} [content.autodetect.language] Auto detect change languages value. */\n      this['content.autodetect.language'] = true\n\n      /** @prop {number} [content.subtitles] Subtitles of the media. */\n      this['content.subtitles'] = null\n\n      /** @prop {boolean} [content.autodetect.subtitles] Auto detect change subtitles value. */\n      this['content.autodetect.subtitles'] = true\n\n      /** @prop {number} [content.contractedResolution] Contracted Resolution of the media. */\n      this['content.contractedResolution'] = null\n\n      /** @prop {number} [content.cost] Cost of the media. */\n      this['content.cost'] = null\n\n      /** @prop {number} [content.price] Price of the media. */\n      this['content.price'] = null\n\n      /** @prop {number} [content.playbackType] Type of the media. Can be Vod, Live, catch-up or offline */\n      this['content.playbackType'] = null\n\n      /** @prop {number} [content.drm] DRM of the media. */\n      this['content.drm'] = null\n\n      // Encoding\n\n      /** @prop {number} [content.encoding.videoCodec] Video codec of the media. */\n      this['content.encoding.videoCodec'] = null\n\n      /** @prop {number} [content.encoding.audioCodec] Audio codec of the media. */\n      this['content.encoding.audioCodec'] = null\n\n      /** @prop {number} [content.encoding.codecSettings] Codec settings of the media. */\n      this['content.encoding.codecSettings'] = null\n\n      /** @prop {number} [content.encoding.codecProfile] Codec profile of the media. */\n      this['content.encoding.codecProfile'] = null\n\n      /** @prop {number} [content.encoding.containerFormat] Container format of the media. */\n      this['content.encoding.containerFormat'] = null\n\n      // ADS\n\n      /**\n      * @prop {object} [ad.metadata]\n      * Item containing mixed extra information about ads like: request url.\n      * This object may store any serializable key:value info.\n      */\n      this['ad.metadata'] = {}\n\n      /**\n      * @prop {string} [ad.campaign]\n      * String containing the name of the campaign\n      */\n      this['ad.campaign'] = null\n\n      /**\n      * @prop {string} [ad.creativeId]\n      * String containing the id of the creative\n      */\n      this['ad.creativeId'] = null\n\n      /**\n      * @prop {string} [ad.provider]\n      * String containing the provider of the ad\n      */\n      this['ad.provider'] = null\n\n      /**\n      * @prop {string} [ad.resource]\n      * String containing the ad resource\n      */\n      this['ad.resource'] = null\n\n      /**\n      * @prop {string} [ad.title]\n      * String containing the title of the campaign\n      */\n      this['ad.title'] = null\n\n      /**\n      * @prop {duration} [ad.duration]\n      * Duration of the ad in seconds\n      */\n      this['ad.duration'] = null\n\n      /**\n      * @prop {object} [ad.expectedPattern]\n      * Json with the position of the breaks expected.\n      * Arrays are the number of breaks, and the numbers in them, the number of ads for each break\n      *\n      * Example:\n      * {pre: [1],\n      * mid: [1,2],\n      * post: [1]}\n      * Would be a view with 1 preroll break with 1 ad, 2 midroll breaks, one with 1 ad and\n      * the other with 2, and one postroll break with 1 ad.\n      */\n      this['ad.expectedPattern'] = null\n\n      /**\n      * @prop {string} [ad.givenAds]\n      * Number of ads given by the adserver for this break\n      */\n      this['ad.givenAds'] = null\n\n      /**\n      * @prop {number[]} [ad.breaksTime]\n      * Array of numbers for the time position of adbreaks\n      */\n      this['ad.breaksTime'] = null\n\n      /**\n      * @prop {string} [ad.expectedBreaks]\n      * Number of breaks expected for the view\n      */\n      this['ad.expectedBreaks'] = null\n\n      /**\n      * @prop {number} [ad.givenBreaks]\n      * Number of breaks given by the adserver for the view\n      */\n      this['ad.givenBreaks'] = null\n\n      /**\n      * @prop {boolean} [ad.ignore]\n      * False by default.\n      * If true, youbora blocks ad events and calculates jointime ignoring ad time.\n      */\n      this['ad.ignore'] = false\n\n      /**\n      * @prop {boolean} [ad.blockerDetected]\n      * Null (notified as false) by default.\n      * Sets if an adblocker has been detected\n      */\n      this['ad.blockerDetected'] = null\n\n      // APP\n\n      /**\n      * @prop {string} [app.name]\n      * String containing the name of the app\n      */\n      this['app.name'] = null\n\n      /**\n      * @prop {string} [app.releaseVerson]\n      * String containing the app version\n      */\n      this['app.releaseVersion'] = null\n\n      /**\n      * @prop {boolean} [app.https=null]\n      * Define the security of NQS calls.\n      * If true it will use 'https://',\n      * if false it will use 'http://',\n      * if null/undefined it will use '//'.\n      */\n      this['app.https'] = false\n\n      // BACKGROUND\n\n      /**\n      *  @prop {boolean} [background.enabled=false]\n      * If true, plugin will send background/foreground events\n      * Different device behaviour is settable in background.settings\n      */\n      this['background.enabled'] = true\n\n      /**\n      *  @prop {string} [background.settings]\n      * Action to do when the browser goes to background.\n      * Options are 'stop', 'pause', and '' for no action.\n      * stop will be used to stop the view and track post-foreground events in a new view\n      * pause will be used when after foreground event, an action like pressing play button is expected to resume the content\n      * '' will be used if the content can be played in background\n      * If not defined, specific device options will be used\n      * background.setings.android / background.settings.iOS / background.settings.desktop / background.settings.tv\n      * Default specific device values are stop for android and iphone, nothing for desktop.\n      */\n      this['background.settings'] = null\n\n      /**\n      *  @prop {string} [background.settings.android='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is android type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.android'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.iOS='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is iphone type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.iOS'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.desktop=null]\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is desktop type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * Null by default\n      */\n      this['background.settings.desktop'] = null\n\n      /**\n      *  @prop {string} [background.settings.tv='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is smartTV type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.tv'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.playstation='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is playstation type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * Null by default\n      */\n      this['background.settings.playstation'] = 'stop'\n\n      // SMARTSWITCH\n\n      /**\n      *  @prop {string} [smartswitch.configCode]\n      * Config code for smartswitch\n      * null by default\n      */\n      this['smartswitch.configCode'] = null\n\n      /**\n      *  @prop {string} [smartswitch.groupCode]\n      * Group code for smartswitch\n      * null by default\n      */\n      this['smartswitch.groupCode'] = null\n\n      /**\n      *  @prop {string} [smartswitch.contractCode]\n      * Contract code for smartswitch\n      * null by default\n      */\n      this['smartswitch.contractCode'] = null\n\n      // EXTRAPARAMS // CUSTOM DIMENSIONS\n\n      /** @prop {object} [content.customDimensions] Custom dimensions object. */\n      this['content.customDimensions'] = {}\n\n      /** @prop {string} [content.customDimension.1] Custom parameter 1. */\n      this['content.customDimension.1'] = null\n\n      /** @prop {string} [content.customDimension.2] Custom parameter 2. */\n      this['content.customDimension.2'] = null\n\n      /** @prop {string} [content.customDimension.3] Custom parameter 3. */\n      this['content.customDimension.3'] = null\n\n      /** @prop {string} [content.customDimension.4] Custom parameter 4. */\n      this['content.customDimension.4'] = null\n\n      /** @prop {string} [content.customDimension.5] Custom parameter 5. */\n      this['content.customDimension.5'] = null\n\n      /** @prop {string} [content.customDimension.6] Custom parameter 6. */\n      this['content.customDimension.6'] = null\n\n      /** @prop {string} [content.customDimension.7] Custom parameter 7. */\n      this['content.customDimension.7'] = null\n\n      /** @prop {string} [content.customDimension.8] Custom parameter 8. */\n      this['content.customDimension.8'] = null\n\n      /** @prop {string} [content.customDimension.9] Custom parameter 9. */\n      this['content.customDimension.9'] = null\n\n      /** @prop {string} [content.customDimension.10] Custom parameter 10. */\n      this['content.customDimension.10'] = null\n\n      /** @prop {string} [content.customDimension.11] Custom parameter 11. */\n      this['content.customDimension.11'] = null\n\n      /** @prop {string} [content.customDimension.12] Custom parameter 12. */\n      this['content.customDimension.12'] = null\n\n      /** @prop {string} [content.customDimension.13] Custom parameter 13. */\n      this['content.customDimension.13'] = null\n\n      /** @prop {string} [content.customDimension.14] Custom parameter 14. */\n      this['content.customDimension.14'] = null\n\n      /** @prop {string} [content.customDimension.15] Custom parameter 15. */\n      this['content.customDimension.15'] = null\n\n      /** @prop {string} [content.customDimension.16] Custom parameter 16. */\n      this['content.customDimension.16'] = null\n\n      /** @prop {string} [content.customDimension.17] Custom parameter 17. */\n      this['content.customDimension.17'] = null\n\n      /** @prop {string} [content.customDimension.18] Custom parameter 18. */\n      this['content.customDimension.18'] = null\n\n      /** @prop {string} [content.customDimension.19] Custom parameter 19. */\n      this['content.customDimension.19'] = null\n\n      /** @prop {string} [content.customDimension.20] Custom parameter 20. */\n      this['content.customDimension.20'] = null\n\n      /** @prop {string} [ad.customDimension.1] Ad custom parameter 1. */\n      this['ad.customDimension.1'] = null\n\n      /** @prop {string} [ad.customDimension.2] Ad custom parameter 2. */\n      this['ad.customDimension.2'] = null\n\n      /** @prop {string} [ad.customDimension.3] Ad custom parameter 3. */\n      this['ad.customDimension.3'] = null\n\n      /** @prop {string} [ad.customDimension.4] Ad custom parameter 4. */\n      this['ad.customDimension.4'] = null\n\n      /** @prop {string} [ad.customDimension.5] Ad custom parameter 5. */\n      this['ad.customDimension.5'] = null\n\n      /** @prop {string} [ad.customDimension.6] Ad custom parameter 6. */\n      this['ad.customDimension.6'] = null\n\n      /** @prop {string} [ad.customDimension.7] Ad custom parameter 7. */\n      this['ad.customDimension.7'] = null\n\n      /** @prop {string} [ad.customDimension.8] Ad custom parameter 8. */\n      this['ad.customDimension.8'] = null\n\n      /** @prop {string} [ad.customDimension.9] Ad custom parameter 9. */\n      this['ad.customDimension.9'] = null\n\n      /** @prop {string} [ad.customDimension.10] Ad custom parameter 10. */\n      this['ad.customDimension.10'] = null\n\n      /** @prop {bool} [forceInit] Forces init to be sent instead of start, use it when mediaduration,\n      *  title, source or is live is reported with a wrong value by the player until jointime happens */\n      this.forceInit = false\n\n      /**\n      * @prop {object} [session.metrics]\n      * Item containing metrics in json format. Reported every beat if the values change\n      */\n      this['session.metrics'] = {}\n\n      /**\n      * @prop {bool} [session.context]\n      * Boolean to choose to report context or not. False by default\n      */\n      this['session.context'] = false\n\n      /**\n      * @prop {array<string>} [errors.fatal=[]]\n      * If it has elements on it, all the errors matching this code will fire the stop event to end the view\n      */\n      this['errors.fatal'] = []\n\n      /**\n      * @prop {array<string>} [errors.nonFatal=[]]\n      * If it has elements on it, all the errors matching this code won't fire a stop event to end the view\n      */\n      this['errors.nonFatal'] = []\n\n      /**\n      * @prop {array<string>} [errors.ignore=[]]\n      * If it has elements on it, all the errors matching this code wont be reported\n      */\n      this['errors.ignore'] = []\n\n      /**\n       * @prop {string} linkedViewId\n       * String to send on start events to link views with previous session events\n       */\n      this.linkedViewId = null\n\n      /**\n      * @prop {bool} [waitForMetadata]\n      * Boolean to delay the start event. Use with `pendingMetadata`\n      */\n      this.waitForMetadata = false\n\n      /**\n      * @prop {array<string>} [pendingMetadata]\n      * List of values that should be ready to send in start event. Use with `waitForMetadata` set to True.\n      */\n      this.pendingMetadata = []\n\n      /**\n       * @prop {string} method\n       * Method used to send request to backend side\n       *  Options are 'get' or 'post'\n       *  'get' by default\n       */\n      this.method = RequestMethod.GET\n\n      /**\n       * @prop {bool} [playhead.monitor]\n       * Method to enabled/disable support for playhead monitor method\n       */\n      this['playhead.monitor'] = true\n\n      /**\n       * @prop {bool} [network.monitor]\n       * Method to enabled/disable support for readyState monitor method\n       */\n      this['readyState.monitor'] = true\n\n      this.setOptions(options)\n    },\n\n    /**\n    * Recursively sets the properties present in the params object.\n    * ie: this.username = params.username.\n    *\n    * @param {Object} options A literal or another Data containing values.\n    * @param {Object} [base=this] Start point for recursion.\n    */\n    setOptions: function (options, base) {\n      var isInBase = false\n      if (base === undefined) {\n        base = this\n        isInBase = true\n        var deprecatedOptions = new DeprecatedOptions()\n      }\n      if (typeof options !== 'undefined') {\n        for (var key in options) {\n          var deprecated = false\n          var newKey = null\n          if (isInBase) {\n            if (!this.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n              if (deprecatedOptions.exists(key)) {\n                newKey = deprecatedOptions.getNewName(key)\n                deprecated = true\n              } else {\n                Log.warn('The option \"' + key + '\" does not exist, so it cannot be set')\n              }\n            }\n          }\n          if ((typeof base[key] === 'object' && base[key] !== null) && (!Array.isArray(base[key]) && key === 'parse.cdnNode.list')) {\n            this.setOptions(options[key], base[key])\n          } else {\n            if (deprecated) {\n              base[newKey] = options[key]\n            } else {\n              base[key] = options[key]\n            }\n          }\n        }\n      }\n    },\n\n    /**\n    * Sets all the values given in an array as extraparams. Limit is 20\n    * @param {array<string>} paramsArray array of extraparam strings\n    * */\n    setExtraParams: function (paramsArray) {\n      var maxLength = 20\n      if (typeof paramsArray !== 'object' || !paramsArray.length) return\n      if (paramsArray.length >= maxLength) paramsArray = paramsArray.slice(0, maxLength)\n      while (paramsArray.length < maxLength) {\n        paramsArray.push(null)\n      }\n      paramsArray.forEach(function (param, index) {\n        this['content.customDimension.' + (index + 1).toString()] = param\n      }.bind(this))\n    },\n\n    /**\n    * @alias youbora.options.prototype.setExtraParams.\n    */\n    setCustomDimensions: function () {\n      Options.prototype.setExtraParams.apply(this, arguments)\n    },\n\n    /**\n    * Sets all the values given in an array as extraparams. Limit is 10\n    * @param {array<string>} paramsArray array of extraparam strings\n    * */\n    setAdExtraParams: function (paramsArray) {\n      var maxLength = 10\n      if (typeof paramsArray !== 'object' || !paramsArray.length) return\n      if (paramsArray.length >= maxLength) paramsArray = paramsArray.slice(0, maxLength)\n      while (paramsArray.length < maxLength) {\n        paramsArray.push(null)\n      }\n      paramsArray.forEach(function (param, index) {\n        this['ad.customDimension.' + (index + 1).toString()] = param\n      }.bind(this))\n    },\n\n    /**\n    * @alias youbora.options.prototype.setAdExtraParams.\n    */\n    setAdCustomDimensions: function () {\n      Options.prototype.setAdExtraParams.apply(this, arguments)\n    }\n  }, {\n  // Constants\n    StreamingProtocol: StreamingProtocol,\n    TransportFormat: TransportFormat,\n    RequestMethod: RequestMethod\n  }\n)\n\nmodule.exports = Options\n","var Log = require('../log')\nvar Util = require('../util')\nvar Constants = require('../constants')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginAdsGettersMixin = {\n  /**\n   * Returns ads's PlayerVersion\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPlayerVersion: function () {\n    return this._safeGetterAdsAdapter('getPlayerVersion') || ''\n  },\n\n  /**\n   * Returns ad's position\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPosition: function () {\n    var ret = Constants.AdPosition.Preroll\n    if (this._adsAdapter) {\n      try {\n        var temporalRet = this._adsAdapter.getPosition()\n        if (Constants.AdPosition.Preroll === temporalRet ||\n          Constants.AdPosition.Midroll === temporalRet ||\n          Constants.AdPosition.Postroll === temporalRet) {\n          ret = temporalRet\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling getAdPosition', err)\n      }\n    }\n    if (!ret && this._adapter) {\n      ret = (this._adapter.flags.isJoined) ? Constants.AdPosition.Midroll : Constants.AdPosition.Preroll\n    }\n    return ret\n  },\n\n  getAdNumber: function () {\n    return this.requestBuilder.lastSent.adNumber || 0\n  },\n\n  getAdNumberInBreak: function () {\n    return this.requestBuilder.lastSent.adNumberInBreak || 0\n  },\n\n  getBreakNumber: function () {\n    return this.requestBuilder.lastSent.breakNumber || 0\n  },\n\n  /**\n   * Returns ad's AdPlayhead\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPlayhead: function () {\n    var ret = this._safeGetterAdsAdapter('getPlayhead')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n   * Returns ad's AdDuration\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdDuration: function () {\n    var ret = this._safeGetterAdsAdapter('getDuration', 'ad.duration')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n   * Returns ad's AdBitrate\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdBitrate: function () {\n    var ret = this._safeGetterAdsAdapter('getBitrate')\n    if (!ret || ret === -1) {\n      ret = this.getWebkitAdBitrate()\n    }\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n   * Returns bitrate as per webkitVideoDecodedByteCount\n   *\n   * @param {Object} tag Video tag DOM reference.\n   * @returns {number}\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getWebkitAdBitrate: function () {\n    if (this._adsAdapter && this._adsAdapter.tag && this._adsAdapter.tag.webkitVideoDecodedByteCount) {\n      var bitrate = this._adsAdapter.tag.webkitVideoDecodedByteCount\n      if (this._lastWebkitAdBitrate) {\n        var delta = this._adsAdapter.tag.webkitVideoDecodedByteCount - this._lastWebkitAdBitrate\n        bitrate = Math.round(((delta) / this.viewTransform.response.pingTime) * 8)\n      }\n      this._lastWebkitAdBitrate = this._adsAdapter.tag.webkitVideoDecodedByteCount\n      return bitrate !== 0 ? bitrate : -1\n    }\n  },\n\n  /**\n   * Returns ad's AdTitle\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdTitle: function () {\n    return this._safeGetterAdsAdapter('getTitle', 'ad.title')\n  },\n\n  /**\n   * Returns ad's AdResource\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdResource: function () {\n    return this._safeGetterAdsAdapter('getResource', 'ad.resource')\n  },\n\n  /**\n   * Returns ad's campaign\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdCampaign: function () {\n    return this._safeGetterAdsAdapter('getCampaign', 'ad.campaign')\n  },\n\n  /**\n  * Returns ad's campaign\n  *\n  * @memberof youbora.Plugin.prototype\n  */\n  getAdCreativeId: function () {\n    return this._safeGetterAdsAdapter('getCreativeId', 'ad.creativeId')\n  },\n\n  /**\n  * Returns ad's provider\n  *\n  * @memberof youbora.Plugin.prototype\n  */\n  getAdProvider: function () {\n    return this._safeGetterAdsAdapter('getProvider', 'ad.provider')\n  },\n\n  /**\n   * Returns ads adapter getVersion or null\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdAdapterVersion: function () {\n    return this._safeGetterAdsAdapter('getVersion')\n  },\n\n  /**\n   * Returns ad's AdMetadata\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdMetadata: function () {\n    return this.options['ad.metadata']\n  },\n\n  /**\n   * Returns the type of ad insertion (clientside, serverside)\n   * @returns {string} ad insertion type\n   */\n  getAdInsertionType: function () {\n    return this._safeGetterAdsAdapter('getAdInsertionType')\n  },\n\n  getGivenBreaks: function () {\n    return this._safeGetterAdsAdapter('getGivenBreaks', 'ad.givenBreaks')\n  },\n\n  getExpectedBreaks: function () {\n    var ret = null\n    var expBreaks = this.options['ad.expectedBreaks']\n    var expPattern = this.options['ad.expectedPattern']\n    if (expBreaks) {\n      ret = expBreaks\n    } else if (expPattern) {\n      ret = 0\n      ret = expPattern.pre ? expPattern.pre.length : 0\n      ret += expPattern.mid ? expPattern.mid.length : 0\n      ret += expPattern.post ? expPattern.post.length : 0\n    } else if (this._adsAdapter) {\n      try {\n        ret = this._adsAdapter.getExpectedBreaks()\n      } catch (err) {\n        Log.warn('An error occured while calling expectedBreaks', err)\n      }\n    }\n    return ret\n  },\n\n  getExpectedPattern: function () {\n    return this._safeGetterAdsAdapter('getExpectedPattern', 'ad.expectedPattern')\n  },\n\n  getBreaksTime: function () {\n    return this._safeGetterAdsAdapter('getBreaksTime', 'ad.breaksTime')\n  },\n\n  getGivenAds: function () {\n    return this._safeGetterAdsAdapter('getGivenAds', 'ad.givenAds')\n  },\n\n  getExpectedAds: function () {\n    var ret = null\n    try {\n      if (this._adsAdapter) {\n        var pattern = this.options['ad.expectedPattern']\n        if (pattern && this.getAdPosition()) {\n          var list = []\n          if (pattern.pre) list = list.concat(pattern.pre)\n          if (pattern.mid) list = list.concat(pattern.mid)\n          if (pattern.post) list = list.concat(pattern.post)\n          if (list.length > 0) {\n            var position = this.requestBuilder.lastSent.breakNumber\n            if (position > list.length) position = list.length\n            ret = list[position - 1]\n          }\n        } else {\n          ret = this._adsAdapter.getExpectedAds()\n        }\n      }\n    } catch (err) {\n      Log.warn('An error occured while calling expectedAds', err)\n    }\n    return ret\n  },\n\n  getAdsExpected: function () {\n    var ret = null\n    try {\n      ret = (this.getExpectedPattern() || this.getGivenAds()) || false\n    } catch (err) {\n      Log.warn('An error occured while calling givenAds or expectedPattern', err)\n    }\n    return ret\n  },\n\n  // ----------------------------------------- CHRONOS ------------------------------------------\n\n  /**\n   * Returns AdJoinDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdJoinDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.join.getDeltaTime(false) : -1\n  },\n\n  /**\n   * Returns AdBufferDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdBufferDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.buffer.getDeltaTime(false) : -1\n  },\n\n  /**\n   * Returns AdPauseDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPauseDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.pause.getDeltaTime(false) : 0\n  },\n\n  /**\n   * Returns total totalAdDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdTotalDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.total.getDeltaTime(false) : -1\n  },\n\n  getAdViewedDuration: function () {\n    return this._getTimeMaxOrAcum(true)\n  },\n\n  getAdViewability: function () {\n    return this._getTimeMaxOrAcum()\n  },\n\n  _getTimeMaxOrAcum: function (acum) {\n    var maxTime = 0\n    if (this._adsAdapter) {\n      this._adsAdapter.chronos.viewedMax.forEach(function (chrono) {\n        if (acum) {\n          maxTime += chrono.getDeltaTime(false)\n        } else {\n          maxTime = Math.max(chrono.getDeltaTime(false), maxTime)\n        }\n      })\n    }\n    return maxTime\n  },\n\n  getAudioEnabled: function () {\n    return this._safeGetterAdsAdapter('getAudioEnabled')\n  },\n\n  getIsSkippable: function () {\n    return this._safeGetterAdsAdapter('getIsSkippable')\n  },\n\n  getIsFullscreen: function () {\n    return this._safeGetterAdsAdapter('getIsFullscreen')\n  },\n\n  _safeGetterAdsAdapter: function (func, option) {\n    var ret = null\n    if (option && this.options[option]) {\n      ret = this.options[option]\n    } else {\n      try {\n        if (this._adsAdapter && typeof this._adsAdapter[func] === 'function') {\n          ret = this._adsAdapter[func]()\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling ' + func, err)\n      }\n    }\n    return ret\n  }\n}\n\nmodule.exports = PluginAdsGettersMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\nvar Adapter = require('../adapter/adapter')\nvar Util = require('../util')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginAdsMixin = {\n  /**\n     * Returns current adapter or null.\n     *\n     * @returns {Adapter}\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdsAdapter: function () {\n    return this._adsAdapter\n  },\n\n  /**\n     * Sets an adapter for ads.\n     *\n     * @param {Adapter} adsAdapter\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  setAdsAdapter: function (adsAdapter) {\n    if (adsAdapter.plugin) {\n      Log.warn('Adapters can only be added to a single plugin')\n    } else {\n      this.removeAdsAdapter()\n      adsAdapter.plugin = this\n      this._adsAdapter = adsAdapter\n      adsAdapter.setIsAds(true)\n      this.adsAdapterListeners = {}\n      this.adsAdapterListeners[Adapter.Event.START] = this._adStartListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.JOIN] = this._adJoinListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PAUSE] = this._adPauseListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.RESUME] = this._adResumeListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.BUFFER_BEGIN] = this._adBufferBeginListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.BUFFER_END] = this._adBufferEndListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.STOP] = this._adStopListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.ERROR] = this._adErrorListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.CLICK] = this._adClickListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.MANIFEST] = this._adManifestListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PODSTART] = this._adBreakStartListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PODSTOP] = this._adBreakStopListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.QUARTILE] = this._adQuartileListener.bind(this)\n      for (var key in this.adsAdapterListeners) {\n        this._adsAdapter.on(key, this.adsAdapterListeners[key])\n      }\n    }\n  },\n\n  /**\n     * Removes the current adapter. Fires stop if needed. Calls adapter.dispose()\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  removeAdsAdapter: function () {\n    if (this._adsAdapter) {\n      this._adsAdapter.dispose()\n      this._adsAdapter.plugin = null\n      if (this.adsAdapterListeners) {\n        for (var key in this.adsAdapterListeners) {\n          this._adsAdapter.off(key, this.adsAdapterListeners[key])\n        }\n        delete this.adsAdapterListeners\n      }\n      this.resizeScrollDetector.stopDetection()\n      this._adsAdapter = null\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n  _adStartListener: function (e) {\n    if (this._adapter) {\n      this._adapter.fireBufferEnd(null, 'adStartListener')\n      this._adapter.fireSeekEnd(null, 'adStartListener')\n      if (!this.isInitiated && !this._adapter.flags.isStarted) this._adapter.fireStart()\n      if (this._adapter.flags.isPaused) this._adapter.chronos.pause.reset()\n    } else {\n      this.fireInit()\n    }\n    if (this._adsAdapter) {\n      this._adsAdapter.chronos.viewedMax = []\n    }\n    var params = e.data.params || {}\n    params.adNumber = this.requestBuilder.getNewAdNumber()\n    var allParamsReady = (this.getAdResource() || this.getAdTitle()) && typeof this.getAdDuration() === 'number'\n    if (allParamsReady) {\n      this.adStartSent = true\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_START, Constants.Service.AD_START, params)\n    } else {\n      this.adInitSent = true\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_INIT, Constants.Service.AD_INIT, params)\n    }\n  },\n\n  _adJoinListener: function (e) {\n    var params = {}\n    Util.assign(params, e.data.params || {})\n    if (this.adInitSent && !this.adStartSent) {\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_START, Constants.Service.AD_START, params)\n    }\n    this._adsAdapter.startChronoView()\n    if (this.adConnected) {\n      this._adsAdapter.chronos.join.startTime = this.adConnectedTime\n      this._adsAdapter.chronos.total.startTime = this.adConnectedTime\n      this.adConnectedTime = 0\n      this.adConnected = false\n    }\n    params = e.data.params || {}\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_JOIN, Constants.Service.AD_JOIN, params)\n    this.adInitSent = false\n    this.adStartSent = false\n  },\n\n  _adPauseListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.stopChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_PAUSE, Constants.Service.AD_PAUSE, params)\n  },\n\n  _adResumeListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.startChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_RESUME, Constants.Service.AD_RESUME, params)\n  },\n\n  _adBufferBeginListener: function (e) {\n    Log.notice('Ad Buffer Begin')\n    this._adsAdapter.stopChronoView()\n    if (this._adsAdapter && this._adsAdapter.flags.isPaused) {\n      this._adsAdapter.chronos.pause.reset()\n    }\n  },\n\n  _adBufferEndListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.startChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_BUFFER, Constants.Service.AD_BUFFER, params)\n  },\n\n  _adStopListener: function (e) {\n    this._adsAdapter.stopChronoView()\n    this._adsAdapter.flags.reset()\n    this._totalPrerollsTime = (this._totalPrerollsTime || 0) + this._adsAdapter.chronos.total.getDeltaTime()\n\n    var params = e.data.params || {}\n    params.position = this.requestBuilder.lastSent.position\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_STOP, Constants.Service.AD_STOP, params)\n\n    // If its a stop for a postroll we check if we can detect if its the last one to call view stop\n    if (this.requestBuilder.lastSent.position === Constants.AdPosition.Postroll) {\n      var pat = this.options['ad.expectedPattern']\n      this.playedPostrolls++\n      // If we know the amount of postrolls and this was the last one\n      if ((this.requestBuilder.lastSent.givenAds && this.requestBuilder.lastSent.givenAds <= this.playedPostrolls) ||\n      // Or if we have expected (and not given!) and this was the last expected one\n      (!this.requestBuilder.lastSent.givenAds && pat && pat.post && pat.post[0] && pat.post[0] <= this.playedPostrolls)) {\n        this.fireStop()\n      }\n    }\n\n    this.adConnected = true\n    this.adConnectedTime = new Date().getTime()\n  },\n\n  _adErrorListener: function (e) {\n    var params = e.data.params || {}\n    if (this._adapter && !this._adapter.flags.isStarted && !this.isInitiated) {\n      this._savedAdError = e\n      return null // Ignore ad errors before content\n    }\n    if (this._blockAdError(e.data.params)) return null\n    if (this._adsAdapter) {\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n    }\n    if (!this._adsAdapter || !this._adsAdapter.flags.isStarted) {\n      params.adNumber = this.requestBuilder.getNewAdNumber()\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n    }\n    if (!this.isBreakStarted) {\n      params.breakNumber = this.requestBuilder.getNewBreakNumber()\n    }\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_ERROR, Constants.Service.AD_ERROR, params)\n  },\n\n  _adSavedError: function () {\n    if (this._savedAdError) {\n      this._adErrorListener(this._savedAdError)\n      this._savedAdError = null\n    }\n  },\n\n  _adSavedManifest: function () {\n    if (this._savedAdManifest) {\n      this._adManifestListener(this._savedAdManifest)\n      this._savedAdManifest = null\n    }\n  },\n\n  _blockAdError: function (errorParams) {\n    var now = Date.now()\n    var sameError = this._lastAdErrorParams &&\n      this._lastAdErrorParams.errorCode === errorParams.errorCode &&\n      this._lastAdErrorParams.msg === errorParams.msg &&\n      this._lastAdErrorParams.adCreativeId === this.getAdCreativeId()\n\n    if (sameError && this._lastAdErrorTime + 5000 > now) {\n      this._lastAdErrorTime = now\n      return true\n    }\n    this._lastAdErrorTime = now\n    this._lastAdErrorParams = errorParams\n    return false\n  },\n\n  _adClickListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.stopChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_CLICK, Constants.Service.AD_CLICK, params)\n  },\n\n  _adManifestListener: function (e) {\n    if (!this.isAdsManifestSent) {\n      if (this._adapter && !this._adapter.flags.isStarted && !this.isInitiated) {\n        this._savedAdManifest = e\n        return null // Ignore ad manifest before content\n      }\n      var params = e.data.params || {}\n      this.isAdsManifestSent = true\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_MANIFEST, Constants.Service.AD_MANIFEST, params)\n    }\n  },\n\n  _adBreakStartListener: function (e) {\n    if (!this.isBreakStarted) {\n      this.isBreakStarted = true\n      if (this._adapter) this._adapter.firePause()\n      var params = e.data.params || {}\n      params.breakNumber = this.requestBuilder.getNewBreakNumber()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_POD_START, Constants.Service.AD_POD_START, params)\n      this.adConnected = false\n    }\n  },\n\n  _adBreakStopListener: function (e) {\n    if (this.isBreakStarted) {\n      this.isBreakStarted = false\n      var params = e.data.params || {}\n      params.position = this.requestBuilder.lastSent.position\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_POD_STOP, Constants.Service.AD_POD_STOP, params)\n      this.adConnected = false\n      if (this._adapter) this._adapter.fireResume()\n    }\n  },\n\n  _adQuartileListener: function (e) {\n    var params = e.data.params || {}\n    if (params.quartile) {\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_QUARTILE, Constants.Service.AD_QUARTILE, params)\n    }\n  },\n\n  _sendAdEventIfAllowed: function (willSend, service, params) {\n    if (!this.options['ad.ignore']) this._send(willSend, service, params)\n    Log.notice(service)\n  }\n\n}\n\nmodule.exports = PluginAdsMixin\n","var Log = require('../log')\nvar Util = require('../util')\nvar version = require('../version')\nvar TransportFormat = require('../constants/transportFormat.js')\nvar StreamingProtocol = require('../constants/streamingProtocols')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginContentGetterMixin = {\n  /**\n       * Returns content's playhead\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayhead: function () {\n    var ret = this._safeGetterAdapter('getPlayhead')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n       * Returns content's PlayRate\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayrate: function () {\n    var ret = 0\n    if (this._adapter && this._adapter.flags && !this._adapter.flags.isPaused) {\n      try {\n        ret = this._adapter.getPlayrate()\n      } catch (err) {\n        Log.warn('An error occured while calling getPlayrate', err)\n      }\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's FramesPerSecond\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getFramesPerSecond: function () {\n    return this._safeGetterAdapter('getFramesPerSecond', 'content.fps')\n  },\n\n  /**\n   * Returns content's segment duration\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getSegmentDuration: function () {\n    return this.hybridNetwork.getSegmentDuration() || this._safeGetterAdapter('getSegmentDuration', 'content.segmentDuration')\n  },\n\n  /**\n       * Returns content's DroppedFrames\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDroppedFrames: function () {\n    var ret = this._safeGetterAdapter('getDroppedFrames')\n    if (!ret) {\n      ret = this.getWebkitDroppedFrames()\n    }\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n       * Returns dropped frames as per webkitDroppedFrameCount\n       *\n       * @returns {number}\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getWebkitDroppedFrames: function () {\n    if (this._adapter && this._adapter.tag && this._adapter.tag.webkitDroppedFrameCount) {\n      return this._adapter.tag.webkitDroppedFrameCount\n    }\n    return null\n  },\n\n  /**\n       * Returns content's Duration\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDuration: function () {\n    var ret = this._safeGetterAdapter('getDuration', 'content.duration') || null\n    return Util.parseNumber(Math.round(ret), null)\n  },\n\n  /**\n       * Returns content's Bitrate\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getBitrate: function () {\n    var ret = this._safeGetterAdapter('getBitrate', 'content.bitrate')\n    if (!ret || ret === -1) {\n      ret = this.getWebkitBitrate()\n    }\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n       * Returns content's total bytes downloaded\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTotalBytes: function () {\n    return this.options['content.sendTotalBytes'] ? this._safeGetterAdapter('getTotalBytes', 'content.totalBytes') : null\n  },\n\n  /**\n       * Returns bitrate as per webkitVideoDecodedByteCount\n       *\n       * @param {Object} tag Video tag DOM reference.\n       * @returns {number}\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getWebkitBitrate: function () {\n    if (this._adapter && this._adapter.tag && this._adapter.tag.webkitVideoDecodedByteCount) {\n      var bitrate = this._adapter.tag.webkitVideoDecodedByteCount\n      if (this._lastWebkitBitrate) {\n        var delta = this._adapter.tag.webkitVideoDecodedByteCount - this._lastWebkitBitrate\n        bitrate = Math.round(((delta) / this.viewTransform.response.pingTime) * 8)\n      }\n      this._lastWebkitBitrate = this._adapter.tag.webkitVideoDecodedByteCount\n      return bitrate !== 0 ? bitrate : -1\n    }\n  },\n\n  /**\n       * Returns content's Throughput\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getThroughput: function () {\n    var ret = this._safeGetterAdapter('getThroughput', 'content.throughput')\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n       * Returns content's Rendition\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getRendition: function () {\n    return this._safeGetterAdapter('getRendition', 'content.rendition')\n  },\n\n  /**\n       * Returns content's Title\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTitle: function () {\n    return this._safeGetterAdapter('getTitle', 'content.title')\n  },\n\n  /**\n       * Returns content's Title2\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTitle2: function () {\n    return this._safeGetterAdapter('getTitle2', 'content.program')\n  },\n\n  /**\n       * Returns content's IsLive\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getIsLive: function () {\n    var ret = this.options['content.isLive']\n    if (!ret && ret !== false) {\n      ret = this._safeGetterAdapter('getIsLive') || false\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's Resource after being parsed by the resourceTransform\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getResource: function () {\n    return this._safeGetterAdapter('getResource', 'content.resource')\n  },\n\n  getParsedResource: function () {\n    var ret = null\n    if (!this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getResource()\n    }\n    ret = ret || this._safeGetterAdapter('getURLToParse')\n    return (ret === this.getResource()) ? null : ret\n  },\n\n  /**\n       * Returns content's TransactionCode\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTransactionCode: function () {\n    return this.options['content.transactionCode']\n  },\n\n  /**\n       * Returns content's Metadata\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getMetadata: function () {\n    return this.options['content.metadata']\n  },\n\n  /**\n       * Returns content's PlayerVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayerVersion: function () {\n    return this._safeGetterAdapter('getPlayerVersion') || ''\n  },\n\n  /**\n       * Returns content's PlayerName\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayerName: function () {\n    return this._safeGetterAdapter('getPlayerName') || ''\n  },\n\n  /**\n       * Returns content's Cdn\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCdn: function () {\n    var ret = null\n    if (!this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getCdnName()\n    }\n    return ret || this.options['content.cdn']\n  },\n\n  /**\n       * Returns content's PluginVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPluginVersion: function () {\n    var ret = this.getAdapterVersion()\n    if (!ret) ret = version + '-adapterless-js'\n\n    return ret\n  },\n\n  /**\n       * Returns content's PluginVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getLibVersion: function () {\n    return version\n  },\n\n  /**\n       * Returns ads adapter getVersion or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getAdapterVersion: function () {\n    return this._safeGetterAdapter('getVersion')\n  },\n\n  /**\n       * Returns cdn traffic received in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCdnTraffic: function () {\n    return this._safeGetterAdapter('getCdnTraffic') || this.hybridNetwork.getCdnTraffic()\n  },\n\n  /**\n   * Returns multi cdn traffic received in bytes or null\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getMultiCdnInfo: function () {\n    return this.hybridNetwork.getMultiCdnInfo()\n  },\n\n  /**\n   * Returns cdn balancer response id\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getBalancerResponseId: function () {\n    return this.hybridNetwork.getBalancerResponseId()\n  },\n\n  /**\n       * Returns p2p traffic received in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getP2PTraffic: function () {\n    return this._safeGetterAdapter('getP2PTraffic') || this.hybridNetwork.getP2PTraffic()\n  },\n\n  /**\n       * Returns p2p traffic sent in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getUploadTraffic: function () {\n    return this._safeGetterAdapter('getUploadTraffic') || this.hybridNetwork.getUploadTraffic()\n  },\n\n  /**\n       * Returns if p2p plugin is enabled or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getIsP2PEnabled: function () {\n    return this._safeGetterAdapter('getIsP2PEnabled') || this.hybridNetwork.getIsP2PEnabled()\n  },\n\n  /** Returns streaming protocol (DASH, HLS, HDS...) */\n  getStreamingProtocol: function () {\n    var ret = this.options['content.streamingProtocol']\n    // if ret is not in the list of possible options, ret = null\n    if (ret) {\n      for (var i in StreamingProtocol) {\n        if (StreamingProtocol[i] === ret) {\n          return ret\n        }\n      }\n    }\n    return null\n  },\n\n  /** Returns transport format (TS, MP4) */\n  getTransportFormat: function () {\n    var ret = this.options['content.transportFormat']\n    if (!ret && this.options['parse.manifest'] && !this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getTransportFormat()\n    }\n    // if ret is not in the list of possible options, ret = null\n    if (ret) {\n      for (var i in TransportFormat) {\n        if (TransportFormat[i] === ret) {\n          return ret\n        }\n      }\n    }\n    return null\n  },\n\n  /** Returns household id */\n  getHouseholdId: function () {\n    return this._safeGetterAdapter('getHouseholdId')\n  },\n\n  /**\n       * Returns latency of a live video, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getLatency: function () {\n    return this.getIsLive() ? this._safeGetterAdapter('getLatency') : null\n  },\n\n  /**\n       * Returns the amount of packets lost, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPacketLoss: function () {\n    return this._safeGetterAdapter('getPacketLoss')\n  },\n\n  /**\n       * Returns the amount of packets sent, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPacketSent: function () {\n    return this._safeGetterAdapter('getPacketSent')\n  },\n\n  /**\n       * Returns a json with the metrics to be reported in pings when changed\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoMetrics: function () {\n    return Util.getMetricsFrom(this._adapter ? this._adapter.getMetrics() : null, this.options['content.metrics'])\n  },\n\n  getPlayerStartupTime: function () {\n    return this.browserLoadTimes.getPlayerStartupTime()\n  },\n\n  // ----------------------------------------- CHRONOS ------------------------------------------\n\n  /**\n       * Returns JoinDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getJoinDuration: function () {\n    return this._adapter ? this._adapter.chronos.join.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns BufferDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getBufferDuration: function () {\n    return this._adapter ? this._adapter.chronos.buffer.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns SeekDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSeekDuration: function () {\n    return this._adapter ? this._adapter.chronos.seek.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns pauseDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPauseDuration: function () {\n    return this._adapter ? this._adapter.chronos.pause.getDeltaTime(false) : 0\n  },\n\n  /**\n       * Returns content's package\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPackage: function () {\n    return this.options['content.package']\n  },\n\n  /**\n       * Returns content's saga\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSaga: function () {\n    return this.options['content.saga']\n  },\n\n  /**\n       * Returns content's tv show\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTvShow: function () {\n    return this.options['content.tvShow']\n  },\n\n  /**\n       * Returns content's season\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSeason: function () {\n    return this.options['content.season']\n  },\n\n  /**\n       * Returns content's episode title\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getEpisodeTitle: function () {\n    return this.options['content.episodeTitle']\n  },\n\n  /**\n       * Returns content's channel\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getChannel: function () {\n    return this.options['content.channel']\n  },\n\n  /**\n       * Returns content's id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getID: function () {\n    return this.options['content.id']\n  },\n\n  /**\n       * Returns content's IMDB id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getImdbId: function () {\n    return this.options['content.imdbId']\n  },\n\n  /**\n       * Returns content's gracenote id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getGracenoteID: function () {\n    return this.options['content.gracenoteId']\n  },\n\n  /**\n       * Returns content's type\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getType: function () {\n    return this.options['content.type']\n  },\n\n  /**\n       * Returns content's genre\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getGenre: function () {\n    return this.options['content.genre']\n  },\n\n  /**\n       * Returns content's language\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoLanguage: function () {\n    return this.options['content.language']\n  },\n\n  /**\n       * Returns content's subtitles\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSubtitles: function () {\n    return this.options['content.subtitles']\n  },\n\n  /**\n       * Returns content's contracted resolution\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getContractedResolution: function () {\n    return this.options['content.contractedResolution']\n  },\n\n  /**\n       * Returns content's cost\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCost: function () {\n    return this.options['content.cost']\n  },\n\n  /**\n       * Returns content's price\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPrice: function () {\n    return this.options['content.price']\n  },\n\n  /**\n       * Returns content's playback type\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlaybackType: function () {\n    var ret = this.options['content.playbackType']\n    if (!ret) {\n      var isLive = this.options['content.isLive']\n      if (typeof isLive !== 'boolean') {\n        isLive = this._safeGetterAdapter('getIsLive')\n      }\n      if (typeof isLive === 'boolean') {\n        ret = isLive ? 'Live' : 'VoD'\n      }\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's DRM\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDRM: function () {\n    return this.options['content.drm']\n  },\n\n  /**\n       * Returns content's video codec\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoCodec: function () {\n    return this._safeGetterAdapter('getVideoCodec', 'content.encoding.videoCodec')\n  },\n\n  /**\n       * Returns content's audio codec\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getAudioCodec: function () {\n    return this._safeGetterAdapter('getAudioCodec', 'content.encoding.audioCodec')\n  },\n\n  /**\n       * Returns content's codec settings\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCodecSettings: function () {\n    return this.options['content.encoding.codecSettings']\n  },\n\n  /**\n       * Returns content's codec profile\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCodecProfile: function () {\n    return this.options['content.encoding.codecProfile']\n  },\n\n  /**\n       * Returns content's container format\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getContainerFormat: function () {\n    return this.options['content.encoding.containerFormat']\n  },\n\n  /**\n     * Returns linked view id string\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getLinkedViewId: function () {\n    return this.options.linkedViewId\n  },\n\n  _safeGetterAdapter: function (functionName, optionName) {\n    var ret = null\n    if (optionName && this.options[optionName]) {\n      ret = this.options[optionName]\n    } else {\n      try {\n        if (this._adapter && typeof this._adapter[functionName] === 'function') {\n          ret = this._adapter[functionName]()\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling ' + functionName, err)\n      }\n    }\n    return ret\n  }\n}\n\nmodule.exports = PluginContentGetterMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\nvar Util = require('../util')\nvar Adapter = require('../adapter/adapter')\n\n// This file is designed to add extra functionalities to Plugin class\n\n/** @lends youbora.Plugin.prototype */\nvar PluginContentMixin = {\n  /**\n   * Sets an adapter for video content.\n   *\n   * @param {Adapter} adapter\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  setAdapter: function (adapter) {\n    if (this.browserLoadTimes) this.browserLoadTimes.setPlayerSetupTime()\n    if (adapter.plugin) {\n      Log.warn('Adapters can only be added to a single plugin')\n    } else {\n      this.removeAdapter()\n\n      this._adapter = adapter\n      adapter.plugin = this\n      adapter.setIsAds(false)\n\n      // Register listeners\n      this.contentAdapterListeners = {}\n      this.contentAdapterListeners[Adapter.Event.START] = this._startListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.JOIN] = this._joinListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.PAUSE] = this._pauseListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.RESUME] = this._resumeListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.SEEK_BEGIN] = this._seekBufferBeginListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.SEEK_END] = this._seekEndListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.BUFFER_BEGIN] = this._seekBufferBeginListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.BUFFER_END] = this._bufferEndListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.ERROR] = this._errorListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.STOP] = this._stopListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.VIDEO_EVENT] = this._videoEventListener.bind(this)\n\n      for (var key in this.contentAdapterListeners) {\n        this._adapter.on(key, this.contentAdapterListeners[key])\n      }\n    }\n  },\n\n  /**\n   * Returns current adapter or null.\n   *\n   * @returns {Adapter}\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdapter: function () {\n    return this._adapter\n  },\n\n  /**\n   * Removes the current adapter. Fires stop if needed. Calls adapter.dispose().\n   *\n   * @memberof youbora.Plugin.prototype\n   * */\n  removeAdapter: function () {\n    if (this._adapter) {\n      this._adapter.dispose()\n      this._adapter.plugin = null\n\n      if (this.contentAdapterListeners) {\n        for (var key in this.contentAdapterListeners) {\n          this._adapter.off(key, this.contentAdapterListeners[key])\n        }\n        delete this.contentAdapterListeners\n      }\n\n      this._adapter = null\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n  _startListener: function (e) {\n    if (!this.isInitiated) {\n      this.viewTransform.nextView()\n      this._initComm()\n      this._startPings()\n    } else if (this.initChrono.startTime !== 0) {\n      this._adapter.chronos.join.startTime = this.initChrono.startTime\n    }\n    var params = e.data.params || {}\n    var allParamsReady = this.getResource() && typeof this.getIsLive() === 'boolean' &&\n      (this.getIsLive() || (typeof this.getDuration() === 'number' && this.getDuration() > 0)) && this.getTitle()\n    allParamsReady = this.options.forceInit ? false : (allParamsReady && this._isExtraMetadataReady())\n    if (allParamsReady && !this.isInitiated) { // start\n      this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, params)\n      this._adSavedError()\n      this._adSavedManifest()\n      Log.notice(Constants.Service.START + ' ' + (params.title || params.mediaResource))\n      this.isStarted = true\n      // chrono if had no adapter when inited\n    } else if (!this.isInitiated) { // init\n      this.isInitiated = true\n      this._adapter.chronos.join.start()\n      this._send(Constants.WillSendEvent.WILL_SEND_INIT, Constants.Service.INIT, params)\n      this._adSavedError()\n      this._adSavedManifest()\n      Log.notice(Constants.Service.INIT + ' ' + (params.title || params.mediaResource))\n    }\n  },\n\n  _retryStart: function (e) {\n    if (this._isExtraMetadataReady()) {\n      this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, {})\n      this.startDelayed = false\n    }\n  },\n\n  _joinListener: function (e) {\n    var params = {}\n    Util.assign(params, e.data.params || {})\n    if (!this._adsAdapter || !this._adsAdapter.flags.isStarted) {\n      if (this._adapter) {\n        this._adapter.chronos.join.startTime = Math.min(\n          this._adapter.chronos.join.startTime + (this._totalPrerollsTime || 0),\n          new Date().getTime()\n        )\n        this._totalPrerollsTime = 0\n      }\n      if (this.isInitiated && !this.isStarted) { // start if just inited\n        if (this._isExtraMetadataReady()) {\n          this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, params)\n        } else {\n          this.startDelayed = true\n        }\n        this._adSavedError()\n        this._adSavedManifest()\n        Log.notice(Constants.Service.START + ' ' + (params.title || params.mediaResource))\n        this.isStarted = true\n      }\n      params = e.data.params || {}\n      if (this._adsAdapter && this.isBreakStarted) {\n        this._adsAdapter.fireBreakStop()\n      }\n      this._send(Constants.WillSendEvent.WILL_SEND_JOIN, Constants.Service.JOIN, params)\n      Log.notice(Constants.Service.JOIN + ' ' + params.joinDuration + 'ms')\n    } else { // If it is currently showing ads, join is invalidated\n      if (this._adapter.monitor) this._adapter.monitor.stop()\n      this._adapter.flags.isJoined = false\n      this._adapter.chronos.join.stopTime = 0\n    }\n  },\n\n  _pauseListener: function (e) {\n    if (this._adapter) {\n      if (this._adapter.flags.isBuffering ||\n        this._adapter.flags.isSeeking ||\n        (this._adsAdapter && this._adsAdapter.flags.isStarted)) {\n        this._adapter.chronos.pause.reset()\n      }\n    }\n\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_PAUSE, Constants.Service.PAUSE, params)\n    Log.notice(Constants.Service.PAUSE + ' at ' + params.playhead + 's')\n  },\n\n  _resumeListener: function (e) {\n    if (this._adsAdapter && this.isBreakStarted && !this._adsAdapter.flags.isStarted) {\n      this._adsAdapter.fireBreakStop()\n    }\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_RESUME, Constants.Service.RESUME, params)\n    Log.notice(Constants.Service.RESUME + ' ' + params.pauseDuration + 'ms')\n    this._adapter.chronos.pause.reset()\n  },\n\n  _seekBufferBeginListener: function (e) {\n    if (this._adapter && this._adapter.flags.isPaused) this._adapter.chronos.pause.reset()\n    if (e.type && e.type.includes('buffer')) {\n      Log.notice(e.type + ', eventsTriggered: ' + this._adapter.fireEventsStruct.buffer)\n    } else {\n      Log.notice(e.type + ', eventsTriggered: ' + this._adapter.fireEventsStruct.seek)\n    }\n  },\n\n  _seekEndListener: function (e) {\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_SEEK, Constants.Service.SEEK, params)\n    Log.notice(Constants.Service.SEEK +\n      ' to ' + params.playhead +\n      ' in ' + params.seekDuration + 'ms' +\n      ((params.triggeredEvents) ? ', eventsTriggered: ' + params.triggeredEvents : '')\n    )\n  },\n\n  _bufferEndListener: function (e) {\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_BUFFER, Constants.Service.BUFFER, params)\n    Log.notice(Constants.Service.BUFFER +\n      ' to ' + params.playhead +\n      ' in ' + params.bufferDuration + 'ms' +\n      ((params.triggeredEvents) ? ', eventsTriggered: ' + params.triggeredEvents : '')\n    )\n  },\n\n  _errorListener: function (e) {\n    if (!this._blockError(e.data.params)) {\n      this.fireError(e.data.params || {})\n      this._adSavedError()\n      this._adSavedManifest()\n    }\n  },\n\n  _blockError: function (errorParams) {\n    var now = Date.now()\n    var sameError = this._lastErrorParams\n      ? this._lastErrorParams.errorCode === errorParams.errorCode && this._lastErrorParams.msg === errorParams.msg\n      : false\n    if (sameError && this._lastErrorTime + 5000 > now) {\n      this._lastErrorTime = now\n      return true\n    }\n    this._lastErrorTime = now\n    this._lastErrorParams = errorParams\n    return false\n  },\n\n  _stopListener: function (e) {\n    this.fireStop(e.data.params || {})\n  },\n\n  _isStopReady: function (e) {\n    var ret = false\n    // this solution is only for the case of:\n    if (!this.requestBuilder.lastSent.live && // VOD, live have no postrolls\n      this._adsAdapter && // having ads adapter connected\n      this._adapter && // playhead close to the end of the content (or 0 because is already restarted)\n      (!this._adapter.getPlayhead() || this._adapter.getPlayhead() >= this.requestBuilder.lastSent.mediaDuration - 1)) {\n      var expectedPostrolls = 0\n      var pat = this.options['ad.expectedPattern']\n      // We can get the expectedPostrolls from the expected pattern if it has postrolls defined\n      if (pat && pat.post && pat.post[0]) {\n        expectedPostrolls = pat.post[0]\n        // If not, while playing postrolls after adbreakstart we can get the givenAds\n      } else if (this.requestBuilder.lastSent.breaksTime) {\n        if (this.requestBuilder.lastSent.position === Constants.AdPosition.Postroll) {\n          expectedPostrolls = this.requestBuilder.lastSent.givenAds\n        }\n        // Or before playing postrolls, at least, we can check using breaksTime (from adManifest event) if we expect at least 1 postroll\n        if (!expectedPostrolls && this.requestBuilder.lastSent.breaksTime) {\n          var breaks = this.requestBuilder.lastSent.breaksTime\n          if (breaks.length > 0 && this.requestBuilder.lastSent.mediaDuration) { // If there is no duration probably is a live content, so no postrolls\n            var lastTimePosition = Math.round(breaks[breaks.length - 1])\n            if (lastTimePosition + 1 >= this.requestBuilder.lastSent.mediaDuration) {\n              expectedPostrolls = 1\n            }\n          }\n        }\n        // If none of the previous solutions found anything, we assume we have no postrolls\n      } else {\n        ret = true\n      }\n      // Finally, if the number of played postrolls is the same (or more) than the expected, we can close the view\n      if (expectedPostrolls <= this.playedPostrolls) {\n        ret = true\n      }\n    } else {\n      ret = true\n    }\n    return ret\n  },\n\n  _videoEventListener: function (e) {\n    this._send(Constants.WillSendEvent.WILL_SEND_VIDEO_EVENT, Constants.Service.VIDEO_EVENT, e.data.params)\n  },\n\n  _isExtraMetadataReady: function (e) {\n    // If the option is disabled, always is ready\n    if (!this.options.waitForMetadata || this.options.pendingMetadata.length < 1) return true\n    // If for existing parameters, one of them is false (no value for it), return false\n    var getters = this.requestBuilder.getGetters()\n    return this.options.pendingMetadata.map(function (element) {\n      if (getters.hasOwnProperty(element)) { // eslint-disable-line no-prototype-builtins\n        return !!this[getters[element]]()\n      }\n    }.bind(this)).indexOf(false) < 0\n  }\n}\n\nmodule.exports = PluginContentMixin\n","var Log = require('../log')\nvar Util = require('../util')\nvar Constants = require('../constants')\nvar Transform = require('../comm/transform/transform')\n\n// This file is designed to add extra functionalities to Plugin class\n\n/** @lends youbora.Plugin.prototype */\nvar PluginFireMixin = {\n  /**\n   * Sends /init. Should be called once the user has requested the content. Does not need\n   * a working adapter or player to work. it won't sent start if isInitiated is true.\n   *\n   * @param {Object} [params] Object of key:value params.\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireInit: function (params) {\n    if (!this.isInitiated) {\n      if (!this.getAdapter() || (this.getAdapter() && !this.getAdapter().flags.isStarted)) {\n        this.viewTransform.nextView()\n        this._initComm()\n        this._startPings()\n        this.initChrono.start()\n        this.isInitiated = true\n\n        params = params || {}\n        this._send(Constants.WillSendEvent.WILL_SEND_INIT, Constants.Service.INIT, params)\n        this._adSavedError()\n        this._adSavedManifest()\n        Log.notice(Constants.Service.INIT + ' ' + (params.title || params.mediaResource))\n      }\n    }\n  },\n\n  /**\n   * Sends /error. Should be used when the error is related to out-of-player errors: like async\n   * resource load or player loading errors.\n   *\n   * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n   * @param {String} [msg] Error Message\n   * @param {Object} [metadata] Object defining error metadata\n   * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireError: function (object, msg, metadata, level) {\n    this.fireInit()\n    var params = Util.buildErrorParams(object, msg, metadata, level)\n    if (params.code) {\n      delete params.code\n    }\n    this._send(Constants.WillSendEvent.WILL_SEND_ERROR, Constants.Service.ERROR, params)\n    this._adSavedError()\n    this._adSavedManifest()\n    Log.notice(Constants.Service.ERROR +\n      ' ' + params.errorLevel +\n      ' ' + params.errorCode\n    )\n\n    if (params.errorLevel === 'fatal') {\n      this.fireStop()\n    }\n  },\n\n  /**\n   * Calls fireErrors and then stops pings.\n   *\n   * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n   * @param {String} [msg] Error Message\n   * @param {Object} [metadata] Object defining error metadata\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireFatalError: function (object, msg, metadata, level) {\n    this.fireError(object, msg, metadata, level)\n    this.fireStop()\n  },\n\n  /**\n   * Fires /stop. Should be used to terminate sessions once the player is gone or if\n   * plugin.fireError() is called.\n   *\n   * @param {Object} [params] Object of key:value params.\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireStop: function (params) {\n    if (this.isInitiated || this.isStarted) {\n      if (this._adapter) {\n        this._adapter.flags.isStopped = true\n        if (this._adapter.monitor) this._adapter.monitor.stop()\n      }\n      if (this._adsAdapter && this.isBreakStarted) {\n        this._adsAdapter.fireStop()\n        this._adsAdapter.fireBreakStop()\n      }\n      params = params || {}\n      this._send(Constants.WillSendEvent.WILL_SEND_STOP, Constants.Service.STOP, params)\n      var chronos = this._adapter ? this._adapter.chronos : null\n      if (chronos) {\n        chronos.total.stop()\n        chronos.join.reset()\n        chronos.pause.reset()\n        chronos.buffer.reset()\n        chronos.seek.reset()\n      }\n      Log.notice(Constants.Service.STOP + ' at ' + params.playhead + 's')\n      this._reset()\n    }\n  },\n\n  /**\n   * Fires /offlineEvents. If offline is disabled, will try to send all the views stored.\n   *\n   * @param {Object} [params] Object of key:value params.\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireOfflineEvents: function (params) {\n    if (this.options && !this.options.offline) {\n      if (!this.isInitiated &&\n        (!this._adapter || !this._adapter.flags.isStarted) &&\n        (!this._adsAdapter || !this._adsAdapter.flags.isStarted)) {\n        this._offlineParams = params\n        if (this.viewTransform.response.code && this.viewTransform.response.host) {\n          this._generateAndSendOffline()\n        } else {\n          this.offlineReference = this._generateAndSendOffline.bind(this)\n          this.viewTransform.on(Transform.Event.DONE, this.offlineReference)\n        }\n      } else {\n        Log.error('Adapters have to be stopped')\n      }\n    } else {\n      Log.error('To send offline events, offline option must be disabled')\n    }\n  },\n\n  _generateAndSendOffline: function () {\n    if (this.options.disableStorage) return null\n    var params = this._offlineParams\n    this._initComm()\n    while (true) {\n      var bodyAndId = this.requestBuilder.buildBody(Constants.Service.OFFLINE_EVENTS).viewJson\n      if (bodyAndId[0] === null) break\n      var newViewCode = this.viewTransform.nextView()\n      var body = bodyAndId[0].replace(/CODE_PLACEHOLDER/g, newViewCode.toString())\n        .replace(/,\"sessionId\":\"SESSION_PLACEHOLDER\"/g, '') // this.viewTransform.getSession()\n        .replace(/,\"sessionRoot\":\"ROOT_PLACEHOLDER\"/g, '') // this.viewTransform.getSession()\n      // modify to support offline+infinity\n      this._send(Constants.WillSendEvent.WILL_SEND_OFFLINE_EVENTS, Constants.Service.OFFLINE_EVENTS,\n        params, body, 'POST', function (a, callbackParams) {\n          this.offlineStorage.removeView(callbackParams.offlineId)\n        }.bind(this), { offlineId: bodyAndId[1] })\n    }\n    this.offlineStorage.sent()\n    this._offlineParams = null\n  }\n}\n\nmodule.exports = PluginFireMixin\n","var Util = require('../util')\nvar version = require('../version')\nvar RequestMethod = require('../constants/requestMethod')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginGetterMixin = {\n  /**\n     * Returns service host\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getHost: function () {\n    var host = this.options.host\n    if (this.viewTransform && this.viewTransform.response && this.viewTransform.response.host) {\n      host = this.viewTransform.response.host\n    }\n    return Util.addProtocol(Util.stripProtocol(host), this.options['app.https'])\n  },\n\n  getUserType: function () {\n    return this.options['user.type']\n  },\n\n  /**\n     * Returns parse Manifest Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isParseManifest: function () {\n    return this.options['parse.manifest']\n  },\n\n  /**\n     * Returns parse CdnNode Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isParseCdnNode: function () {\n    return this.options['parse.cdnNode']\n  },\n\n  /**\n     * Returns parse cdn switch Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isCdnSwitch: function () {\n    return this.options['parse.cdnSwitchHeader']\n  },\n\n  /**\n     * Returns Cdn list\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getParseCdnNodeList: function () {\n    return this.options['parse.cdnNode.list']\n  },\n\n  /**\n     * Returns Cdn header name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getParseCdnNodeNameHeader: function () {\n    return this.options['parse.cdnNameHeader']\n  },\n\n  /**\n   * Returns header node name\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getParseNodeHeader: function () {\n    return this.options['parse.cdnNodeHeader']\n  },\n\n  /**\n     * Returns obfuscateIp option\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getObfuscateIp: function () {\n    return this.options['user.obfuscateIp']\n  },\n\n  /**\n   * Returns privacy protocol option\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getPrivacyProtocol: function () {\n    var ret = this.options['user.privacyProtocol']\n    if (typeof ret === 'string') {\n      ret = ret.toLowerCase()\n    }\n    return ret === 'optin' || ret === 'optout' ? ret : null\n  },\n\n  /**\n   * Returns content's custom dimensions\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getCustomDimensions: function () {\n    var dim = this.options['content.customDimensions']\n    return typeof dim === 'object' ? dim : null\n  },\n\n  /**\n     * Returns content's Extraparam1\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam1: function () {\n    return this.options['content.customDimension.1']\n  },\n\n  /**\n     * Returns content's Extraparam2\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam2: function () {\n    return this.options['content.customDimension.2']\n  },\n\n  /**\n     * Returns content's Extraparam3\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam3: function () {\n    return this.options['content.customDimension.3']\n  },\n\n  /**\n     * Returns content's Extraparam4\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam4: function () {\n    return this.options['content.customDimension.4']\n  },\n  /**\n     * Returns content's Extraparam5\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam5: function () {\n    return this.options['content.customDimension.5']\n  },\n\n  /**\n     * Returns content's Extraparam6\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam6: function () {\n    return this.options['content.customDimension.6']\n  },\n\n  /**\n     * Returns content's Extraparam7\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam7: function () {\n    return this.options['content.customDimension.7']\n  },\n\n  /**\n     * Returns content's Extraparam8\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam8: function () {\n    return this.options['content.customDimension.8']\n  },\n\n  /**\n     * Returns content's Extraparam9\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam9: function () {\n    return this.options['content.customDimension.9']\n  },\n\n  /**\n     * Returns content's Extraparam10\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam10: function () {\n    return this.options['content.customDimension.10']\n  },\n\n  /**\n     * Returns content's Extraparam11\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam11: function () {\n    return this.options['content.customDimension.11']\n  },\n\n  /**\n     * Returns content's Extraparam12\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam12: function () {\n    return this.options['content.customDimension.12']\n  },\n\n  /**\n     * Returns content's Extraparam13\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam13: function () {\n    return this.options['content.customDimension.13']\n  },\n\n  /**\n     * Returns content's Extraparam14\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam14: function () {\n    return this.options['content.customDimension.14']\n  },\n  /**\n     * Returns content's Extraparam15\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam15: function () {\n    return this.options['content.customDimension.15']\n  },\n\n  /**\n     * Returns content's Extraparam16\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam16: function () {\n    return this.options['content.customDimension.16']\n  },\n\n  /**\n     * Returns content's Extraparam17\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam17: function () {\n    return this.options['content.customDimension.17']\n  },\n\n  /**\n     * Returns content's Extraparam18\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam18: function () {\n    return this.options['content.customDimension.18']\n  },\n\n  /**\n     * Returns content's Extraparam19\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam19: function () {\n    return this.options['content.customDimension.19']\n  },\n\n  /**\n     * Returns content's Extraparam20\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam20: function () {\n    return this.options['content.customDimension.20']\n  },\n\n  /**\n     * Returns ad's Extraparam1\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam1: function () {\n    return this.options['ad.customDimension.1']\n  },\n\n  /**\n     * Returns ad's Extraparam2\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam2: function () {\n    return this.options['ad.customDimension.2']\n  },\n\n  /**\n     * Returns ad's Extraparam3\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam3: function () {\n    return this.options['ad.customDimension.3']\n  },\n\n  /**\n     * Returns ad's Extraparam4\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam4: function () {\n    return this.options['ad.customDimension.4']\n  },\n  /**\n     * Returns ad's Extraparam5\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam5: function () {\n    return this.options['ad.customDimension.5']\n  },\n\n  /**\n     * Returns ad's Extraparam6\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam6: function () {\n    return this.options['ad.customDimension.6']\n  },\n\n  /**\n     * Returns ad's Extraparam7\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam7: function () {\n    return this.options['ad.customDimension.7']\n  },\n\n  /**\n     * Returns ad's Extraparam8\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam8: function () {\n    return this.options['ad.customDimension.8']\n  },\n\n  /**\n     * Returns ad's Extraparam9\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam9: function () {\n    return this.options['ad.customDimension.9']\n  },\n\n  /**\n     * Returns ad's Extraparam10\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam10: function () {\n    return this.options['ad.customDimension.10']\n  },\n\n  /**\n     * Returns PluginInfo\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getPluginInfo: function () {\n    var ret = {\n      lib: version,\n      adapter: this.getAdapterVersion(),\n      adAdapter: this.getAdAdapterVersion()\n    }\n    return ret\n  },\n\n  /**\n     * Returns Ip\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getIp: function () {\n    return this.options['network.ip']\n  },\n\n  /**\n     * Returns Isp\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getIsp: function () {\n    return this.options['network.isp']\n  },\n\n  /**\n     * Returns ConnectionType\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getConnectionType: function () {\n    return this.options['network.connectionType']\n  },\n\n  /** Returns deviceInfo json\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceInfo: function () {\n    var info = {}\n    if (this.getDeviceCode()) info.deviceCode = this.getDeviceCode()\n    if (this.getModel()) info.model = this.getModel()\n    if (this.getBrand()) info.brand = this.getBrand()\n    if (this.getDeviceType()) info.deviceType = this.getDeviceType()\n    if (this.getDeviceName()) info.deviceName = this.getDeviceName()\n    if (this.getOsName()) info.osName = this.getOsName()\n    if (this.getOsVersion()) info.osVersion = this.getOsVersion()\n    if (this.getBrowserName()) info.browserName = this.getBrowserName()\n    if (this.getBrowserVersion()) info.browserVersion = this.getBrowserVersion()\n    if (this.getBrowserType()) info.browserType = this.getBrowserType()\n    if (this.getBrowserEngine()) info.browserEngine = this.getBrowserEngine()\n    return (info !== {} ? info : null)\n  },\n\n  /** Returns EDID object\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getEDID: function () {\n    var edid = this.options['device.EDID']\n    return edid ? edid.toString() : null\n  },\n\n  /**\n     * Returns DeviceCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceCode: function () {\n    return this.options['device.code']\n  },\n\n  /**\n     * Returns Device model\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getModel: function () {\n    return this.options['device.model']\n  },\n\n  /**\n     * Returns Device brand\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrand: function () {\n    return this.options['device.brand']\n  },\n\n  /**\n     * Returns Device type\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceType: function () {\n    return this.options['device.type']\n  },\n\n  /**\n     * Returns Device name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceName: function () {\n    return this.options['device.name']\n  },\n\n  /**\n     * Returns Device OS name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOsName: function () {\n    return this.options['device.osName']\n  },\n\n  /**\n     * Returns Device OS Version\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOsVersion: function () {\n    return this.options['device.osVersion']\n  },\n\n  /**\n     * Returns Device browser name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserName: function () {\n    return this.options['device.browserName']\n  },\n\n  /**\n     * Returns Device browser version\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserVersion: function () {\n    return this.options['device.browserVersion']\n  },\n\n  /**\n     * Returns Device browser type\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserType: function () {\n    return this.options['device.browserType']\n  },\n\n  /**\n     * Returns DeviceCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserEngine: function () {\n    return this.options['device.browserEngine']\n  },\n\n  /**\n     * Returns AccountCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAccountCode: function () {\n    return this.options.accountCode\n  },\n\n  /**\n     * Returns Username\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getUsername: function () {\n    return this.options['user.name']\n  },\n\n  /**\n     * Returns AnonymousUser\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAnonymousUser: function () {\n    return this.options['user.anonymousId']\n  },\n\n  /**\n     * Returns user email\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getEmail: function () {\n    return this.options['user.email']\n  },\n\n  /**\n     * Get URL referer.\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getReferer: function () {\n    var ret = this.options.referer || ''\n    if (!ret && typeof window !== 'undefined' && window.location) {\n      ret = window.location.href\n    }\n    return ret\n  },\n\n  /**\n     * Get URL referral.\n     * Previous page url.\n     * @memberof youbora.Plugin.prototype\n     */\n  getReferral: function () {\n    var ret = this.options.referral || ''\n    if (!ret && typeof document !== 'undefined') {\n      ret = document.referrer\n    }\n    return ret\n  },\n\n  /**\n     * Get Browser language\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getLanguage: function () {\n    var ret = null\n    if (typeof navigator !== 'undefined') {\n      ret = navigator.language\n    }\n    return ret\n  },\n\n  /**\n     * Returns the nodehost\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeHost: function () {\n    return this.options['content.cdnNode'] || this.resourceTransform.getNodeHost()\n  },\n\n  /**\n     * Returns the node type id\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeType: function () {\n    return this.options['content.cdnType'] || this.resourceTransform.getNodeType()\n  },\n\n  /**\n     * Returns the node type string\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeTypeString: function () {\n    return this.resourceTransform.getNodeTypeString()\n  },\n\n  /**\n     * Returns requestNumber value, to prevent /data calls being cached\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getRequestNumber: function () {\n    return Math.random()\n  },\n\n  /**\n     * Returns a whole offline view and its id.\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOfflineView: function () {\n    var ret = null\n    if (this.offlineStorage) {\n      ret = this.offlineStorage.getView()\n    }\n    return ret\n  },\n\n  getDeviceUUID: function () {\n    var id = null\n    if (!this.options['device.isAnonymous']) {\n      id = this.options['device.id'] || this.uuidGenerator.getKey()\n    }\n    return id\n  },\n\n  getSmartswitchConfigCode: function () {\n    return this.options['smartswitch.configCode']\n  },\n\n  getSmartswitchGroupCode: function () {\n    return this.options['smartswitch.groupCode']\n  },\n\n  getSmartswitchContractCode: function () {\n    return this.options['smartswitch.contractCode']\n  },\n\n  getAppName: function () {\n    return this.options['app.name']\n  },\n\n  getAppReleaseVersion: function () {\n    return this.options['app.releaseVersion']\n  },\n\n  getIsBlocked: function () {\n    return this.options['ad.blockerDetected']\n  },\n\n  isMethodPostEnabled: function () {\n    return (this.options.method && (this.options.method.toLowerCase() === RequestMethod.POST))\n  },\n\n  getPlayheadMonitorEnabled: function () {\n    return this.options['playhead.monitor']\n  },\n\n  getReadyStateMonitorEnabled: function () {\n    return this.options['readyState.monitor']\n  }\n}\n\nmodule.exports = PluginGetterMixin\n","// This file is designed to add extra functionalities to Plugin class\n\nconst Util = require('../util')\n\nvar PluginInfinityGettersMixin = {\n  getContext: function () {\n    return 'Default'\n  },\n\n  getScrollDepth: function () {\n    var ret = this.storage.getSession('pageScrollDepth')\n    this.storage.removeSession('pageScrollDepth')\n    return ret\n  },\n\n  getSession: function () {\n    var ret = this.storage.getStorages('session')\n    // Some tvs set the value as 'undefined' as string when deleting the value\n    if (ret === 'undefined') {\n      ret = undefined\n    }\n    if (!ret) {\n      var data = this.getStoredData()\n      if (data) {\n        try {\n          ret = JSON.parse(data).q.c\n        } catch (err) {\n          // nothing\n        }\n      }\n    }\n    return ret\n  },\n\n  getStorageHost: function () {\n    var ret = null\n    var data = this.getStoredData()\n    if (data) {\n      try {\n        ret = JSON.parse(data).q.h\n      } catch (err) {\n        // nothing\n      }\n    }\n    return ret ? Util.addProtocol(ret, this.options['app.https']) : ret\n  },\n\n  getStoredData: function () {\n    return this.storage.getStorages('data')\n  },\n\n  getDataTime: function () {\n    return this.storage.getStorages('dataTime')\n  },\n\n  getLastActive: function () {\n    return this.storage.getStorages('lastactive')\n  },\n\n  setStoredData: function (data) {\n    this.storage.setStorages('data', data)\n  },\n\n  setSession: function (session) {\n    this.storage.setStorages('session', session)\n  },\n\n  setDataTime: function (time) {\n    this.storage.setStorages('dataTime', time)\n  },\n\n  setLastActive: function (last) {\n    this.storage.setStorages('lastactive', last)\n  },\n\n  getPageName: function () {\n    if (typeof document !== 'undefined' && document.title) {\n      return document.title\n    }\n  },\n\n  getPageLoadTime: function () {\n    return this.browserLoadTimes.getPageLoadTime()\n  },\n\n  getIsSessionExpired: function () {\n    var now = new Date().getTime()\n    return !this.getSession() || (this.infinity.getFirstActive() < now - this.sessionExpire)\n  },\n\n  getIsDataExpired: function () {\n    var now = new Date().getTime()\n    return !this.storage.isEnabled() || !this.getStoredData() || (this.infinity.getFirstActive() < now - this.sessionExpire)\n  }\n}\n\nmodule.exports = PluginInfinityGettersMixin\n","var Constants = require('../constants')\nvar Log = require('../log')\nvar YBRequest = require('../comm/request')\nvar Util = require('../util')\n\nvar YouboraInfinity = require('../infinity/infinity')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginInfinityMixin = {\n  _initInfinity: function () {\n    this.infinity.on(YouboraInfinity.Event.NAV, this._navListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.SESSION_START, this._sessionStartListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.SESSION_STOP, this._sessionStopListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.EVENT, this._eventListener.bind(this))\n  },\n\n  _sendInfinity: function (willSendEvent, service, params) {\n    params = this.requestBuilder.buildParams(params, service)\n\n    var data = {\n      params: params,\n      plugin: this,\n      adapter: this.getAdapter(),\n      adsAdapter: this.getAdsAdapter()\n    }\n\n    this.emit(willSendEvent, data)\n\n    if (this.infinity._comm && params !== null && this.options.enabled) {\n      this.lastServeiceSent = service\n      var request = new YBRequest(null, service, params)\n      if (this.isMethodPostEnabled()) {\n        request.setPostRequest(true)\n      }\n      this.infinity._comm.sendRequest(request)\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n\n  _navListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_NAV, Constants.Service.NAV, params)\n\n    // start beats\n    if (!this._beat.isRunning) this._beat.start()\n\n    Log.notice(Constants.Service.NAV + ' ' + params.route)\n  },\n\n  _sessionStartListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(\n      Constants.WillSendEvent.WILL_SEND_SESSION_START,\n      Constants.Service.SESSION_START,\n      params\n    )\n\n    // start beats\n    if (!this._beat.isRunning) this._beat.start()\n\n    Log.notice(Constants.Service.SESSION_START + ' ' + params.route)\n  },\n\n  _sessionStopListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(\n      Constants.WillSendEvent.WILL_SEND_SESSION_STOP,\n      Constants.Service.SESSION_STOP,\n      params\n    )\n\n    // stop beats\n    if (this._beat.isRunning) this._beat.stop()\n\n    Log.notice(Constants.Service.SESSION_STOP + ' ' + params.route)\n  },\n\n  _eventListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_EVENT, Constants.Service.EVENT, params)\n    Log.notice(Constants.Service.EVENT + ' ' + params.name)\n  },\n\n  /**\n   * Sends beat request\n   *\n   * @param {number} diffTime Time since the last ping\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _sendBeat: function (diffTime) {\n    var params = {\n      diffTime: diffTime\n    }\n\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_BEAT, Constants.Service.BEAT, params)\n    if (this.infinity) {\n      this.infinity._setLastActive()\n    }\n    Log.verbose(Constants.Service.BEAT)\n  },\n\n  // ---------------------------------------- GETTERS -----------------------------------------\n\n  /**\n* Returns a json with the metrics to be reported in beats when changed\n*\n* @memberof youbora.Plugin.prototype\n*/\n  getSessionMetrics: function () {\n    return Util.getMetricsFrom(this.options['session.metrics'])\n  }\n}\n\nmodule.exports = PluginInfinityMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginPingMixin = {\n  /**\n   * Starts sending pings.\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _startPings: function () {\n    if (!this._ping.isRunning) this._ping.start()\n  },\n\n  /**\n   * Stops sending pings.\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _stopPings: function () {\n    this._ping.stop()\n  },\n\n  /**\n   * Sends ping request\n   *\n   * @param {number} diffTime Time since the last ping\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _sendPing: function (diffTime) {\n    var params = {\n      diffTime: diffTime,\n      entities: this.requestBuilder.getChangedEntities()\n    }\n    if (this._adapter) {\n      if (this._adapter.flags.isPaused) {\n        params = this.requestBuilder.fetchParams(params, ['pauseDuration'])\n      } else {\n        params = this.requestBuilder.fetchParams(params, ['bitrate', 'throughput', 'fps'])\n      }\n      if (this._adapter.flags.isJoined) {\n        params = this.requestBuilder.fetchParams(params, ['playhead'])\n      }\n      if (this._adapter.flags.isBuffering) {\n        params = this.requestBuilder.fetchParams(params, ['bufferDuration'])\n      }\n      if (this._adapter.flags.isSeeking) {\n        params = this.requestBuilder.fetchParams(params, ['seekDuration'])\n      }\n    }\n\n    if (this._adsAdapter && !this.options['ad.ignore']) {\n      if (this._adsAdapter.flags.isStarted) {\n        params = this.requestBuilder.fetchParams(params, ['adPlayhead', 'adViewedDuration', 'adViewability'])\n        if (this._adsAdapter.flags.isPaused) {\n          params = this.requestBuilder.fetchParams(params, ['adPauseDuration'])\n        } else {\n          params = this.requestBuilder.fetchParams(params, ['adBitrate'])\n        }\n      }\n      if (this._adsAdapter.flags.isBuffering) {\n        params = this.requestBuilder.fetchParams(params, ['adBufferDuration'])\n      }\n    }\n\n    this._send(Constants.WillSendEvent.WILL_SEND_PING, Constants.Service.PING, params)\n    if (this.startDelayed) {\n      this._retryStart()\n    }\n    Log.verbose(Constants.Service.PING)\n  }\n}\n\nmodule.exports = PluginPingMixin\n","var Emitter = require('../emitter')\nvar Timer = require('../timer')\nvar Chrono = require('../chrono')\nvar Constants = require('../constants')\nvar Util = require('../util')\n\nvar YBRequest = require('../comm/request')\nvar Communication = require('../comm/communication')\nvar FlowTransform = require('../comm/transform/flow')\nvar ViewTransform = require('../comm/transform/view')\nvar ResourceTransform = require('../comm/transform/resource')\nvar OfflineTransform = require('../comm/transform/offline')\n\nvar Options = require('./options')\nvar YouboraStorage = require('./storage')\nvar OfflineStorage = require('./offlineStorage')\nvar RequestBuilder = require('./requestbuilder')\n\nvar YouboraInfinity = require('../infinity/infinity')\n\nvar HybridNetwork = require('../monitors/hybridnetwork')\nvar BrowserLoadTimes = require('../monitors/browserLoadTimes')\nvar BackgroundDetector = require('../detectors/backgroundDetector')\nvar DeviceDetector = require('../detectors/deviceDetector')\nvar ResizeScrollDetector = require('../detectors/resizeScrollDetector')\nvar UUIDGenerator = require('../deviceUUID/hashgenerator')\n\nvar Plugin = Emitter.extend(\n  /** @lends youbora.Plugin.prototype */\n  {\n    /**\n     * This is the main class of video analytics. You may want to have one instance for each video\n     * you want to track. Will need {@link Adapter}s for both content and ads.\n     *\n     * @constructs Plugin\n     * @extends youbora.Emitter\n     * @memberof youbora\n     *\n     * @param {Options} [options] An object complying with {@link Options} constructor.\n     * @param {Adapter} [adapter] If an adapter is provided, setAdapter will be immediately called.\n     * @param {object} [dataReq] If a data response is given, it wont request to /data anything and will use this one instead.\n     */\n    constructor: function (options, adapter, dataReq) {\n      if (typeof adapter === 'string' && !dataReq) {\n        dataReq = adapter\n        adapter = null\n      }\n      /** Reference to {@link youbora.YouboraStorage} */\n      this.storage = new YouboraStorage()\n\n      /** UUIDGenerator manager */\n      this.uuidGenerator = new UUIDGenerator(this)\n\n      /** Instance of youbora infinity. */\n      this.infinity = new YouboraInfinity(this)\n\n      /** This flags indicates that /init has been called. */\n      this.isInitiated = false\n\n      /** This flags indicates that /adManifest has been called. */\n      this.isAdsManifestSent = false\n\n      /** Postroll counter to fix plugins reporting stop before postrolls */\n      this.playedPostrolls = 0\n\n      /** This flags indicates if an ad break is started */\n      this.isBreakStarted = false\n\n      /** Chrono for init times. */\n      this.initChrono = new Chrono()\n\n      /** Stored {@link Options} of the session. */\n      this.options = new Options(options)\n\n      /** Reference to {@link youbora.YouboraStorage} */\n      this.storage = new YouboraStorage(null, this.options.disableCookies, this.options.forceCookies, this.options.disableStorage)\n\n      /** Reference to {@link youbora.OfflineStorage} */\n      if (!this.options.disableStorage) {\n        this.offlineStorage = new OfflineStorage()\n      }\n\n      this._adapter = null\n      this._adsAdapter = null\n      this._ping = new Timer(this._sendPing.bind(this), 5000)\n      this._beat = new Timer(this._sendBeat.bind(this), 30000)\n      this._refreshData = new Timer(this._checkOldData.bind(this), 3600000) // 1h\n      this._refreshData.start()\n      this.sessionExpire = Number(this.storage.getLocal('sessionExpire')) * 1000 || 300000\n\n      this.requestBuilder = new RequestBuilder(this)\n\n      this.resourceTransform = new ResourceTransform(this)\n\n      this.lastEventTime = null\n\n      this.restartViewTransform(dataReq)\n\n      this._initInfinity()\n\n      this.hybridNetwork = new HybridNetwork()\n      this.browserLoadTimes = new BrowserLoadTimes(this)\n      this.deviceDetector = new DeviceDetector()\n      this.backgroundDetector = new BackgroundDetector(this)\n      this.resizeScrollDetector = new ResizeScrollDetector(this)\n      if (this.options['background.enabled']) this.backgroundDetector.startDetection()\n\n      if (adapter) this.setAdapter(adapter)\n    },\n\n    _checkOldData: function () {\n      if (this._adapter && this._adapter.flags.isStarted) return\n      if (this.infinity.infinityStarted) return\n      this.restartViewTransform()\n    },\n\n    restartViewTransform: function (response) {\n      // FastData\n      this.viewTransform = new ViewTransform(this)\n      this.viewTransform.on(ViewTransform.Event.DONE, this._receiveData.bind(this))\n\n      // External response\n      if (response) {\n        this.viewTransform.setData(response)\n        return\n      }\n\n      if (this.getIsDataExpired() || !this.getStorageHost() ||\n        ((this.storage.getLocal('accCode') !== this.options.accountCode) &&\n          (this.storage.getSession('accCode') !== this.options.accountCode))) { // If expired or nonexistant\n        this.storage.removeStorages('data')\n        this.storage.removeStorages('session')\n        this.storage.removeLocal('infinityStarted')\n        this.viewTransform.init() // request a new data\n      } else {\n        this.viewTransform.setData(this.getStoredData()) // use stored data\n      }\n    },\n\n    /**\n    * This callback is called when a correct data response is received.\n    *\n    * @param {any} e Response from fastdata\n    */\n    _receiveData: function (e) {\n      this._ping.interval = e.target.response.pingTime * 1000\n      this._beat.interval = e.target.response.beatTime * 1000\n      this.sessionExpire = e.target.response.sessionExpire * 1000\n      this.storage.setStorages('data', e.target.response.msg)\n      this.storage.setStorages('dataTime', new Date().getTime())\n      this.storage.setStorages('accCode', this.options.accountCode)\n      if (this.getIsSessionExpired()) {\n        this.viewTransform.setSession(this.viewTransform.response.code)\n        this.storage.setStorages('session', this.viewTransform.response.code)\n        this.storage.setStorages('host', this.viewTransform.response.host)\n      } else {\n        this.viewTransform.setSession(this.getSession())\n        this.viewTransform.setHost(this.getStorageHost())\n      }\n    },\n\n    /**\n    * Reset all variables and stop all timers\n    * @private\n    */\n    _reset: function () {\n      this._stopPings()\n      this.resourceTransform = new ResourceTransform(this)\n      if (this._adapter) { // The fix\n        this._adapter.flags.reset()\n      }\n      this.isInitiated = false\n      this.isStarted = false\n      this.startDelayed = false\n      this.isAdsManifestSent = false\n      this.initChrono.reset()\n      this._totalPrerollsTime = 0\n      this.requestBuilder.lastSent.breakNumber = 0\n      this.requestBuilder.lastSent.adNumber = 0\n      this._savedAdManifest = null\n      this._savedAdError = null\n      this.playedPostrolls = 0\n      this.isBreakStarted = false\n    },\n\n    /**\n    * Creates and enqueues related request using {@link Communication#sendRequest}.\n    * It will fire will-send-events.\n    *\n    * @param {string} willSendEvent Name of the will-send event. Use {@link Plugin.Event} enum.\n    * @param {string} service Name of the service. Use {@link Constants.Service} enum.\n    * @param {Object} params Params of the request\n    * @param {Object} body Body of the request, if it is a POST request\n    * @param {string} method Request method. GET by default\n    * @param {function} callback Callback method for successful request\n    * @param {Object} callbackParams Json with params for callback call\n    * @private\n    */\n    _send: function (willSendEvent, service, params, body, method, callback, callbackParams) {\n      var now = new Date().getTime()\n      if (this.options.preventZombieViews && this.lastEventTime && (now > (this.lastEventTime + (600 * 1000)))) { // 600 * 1000ms = 10 minutes\n        // if last event was sent more than 10 minutes ago, it will use new view code\n        this.viewTransform.nextView()\n      }\n      this.lastEventTime = (service === Constants.Service.STOP) ? null : now\n      params = this.requestBuilder.buildParams(params, service)\n\n      if (this.getIsLive()) {\n        params.mediaDuration = this.options['content.duration']\n        params.playhead = undefined\n      }\n\n      var data = {\n        params: params,\n        plugin: this,\n        adapter: this.getAdapter(),\n        adsAdapter: this.getAdsAdapter()\n      }\n\n      this.emit(willSendEvent, data)\n\n      if (this._comm && (params !== null || typeof method !== 'undefined') && this.options.enabled) {\n        this.lastServeiceSent = service\n        var options = {}\n        if (typeof method !== 'undefined' && method !== 'GET') {\n          options.method = method\n        }\n        var request = new YBRequest(null, service, params, options)\n        if (body) request.setBody(body)\n        if (this.isMethodPostEnabled()) {\n          request.setPostRequest(true)\n        }\n        this._comm.sendRequest(request, callback, callbackParams)\n      }\n    },\n\n    /**\n    * Initializes comm and its transforms.\n    * @private\n    */\n    _initComm: function () {\n      var resource = this.getResource()\n      if (this._adapter && this._adapter.getURLToParse()) {\n        resource = this._adapter.getURLToParse()\n      }\n      this.resourceTransform.init(resource)\n\n      this._comm = new Communication()\n      this._comm.addTransform(new FlowTransform())\n      this._comm.addTransform(this.viewTransform)\n      if (this.options && this.options.offline) {\n        this._comm.addTransform(new OfflineTransform(this))\n      } else {\n        this._comm.addTransform(this.resourceTransform)\n      }\n    },\n\n    /**\n    * Returns the current {@link youbora.Communication} instance.\n    *\n    * @returns {youbora.Communication} communication instance\n    */\n    getComm: function () {\n      return this._comm\n    },\n\n    /**\n    * Modifies current options. See {@link Options.setOptions}.\n    *\n    * @param {any} options\n    */\n    setOptions: function (options) {\n      if (options) {\n        this.options.setOptions(options)\n        if (typeof options['background.enabled'] === 'boolean') {\n          if (options['background.enabled']) {\n            this.backgroundDetector.startDetection()\n          } else {\n            this.backgroundDetector.stopDetection()\n          }\n        }\n      }\n    },\n\n    /**\n    * Get fastdata response to set it in another plugin instance\n    */\n    getFastDataConfig: function () {\n      return this.viewTransform.response.msg\n    },\n\n    /**\n    * Disable request sending.\n    */\n    disable: function () {\n      this.setOptions({ enabled: false })\n    },\n\n    /**\n    * Re-enable request sending.\n    */\n    enable: function () {\n      this.setOptions({ enabled: true })\n    }\n  },\n\n  /** @lends youbora.Plugin */\n  {\n    // Static Memebers //\n    /**\n    * List of events that could be fired\n    * @enum\n    * @event\n    */\n    Event: Constants.WillSendEvent\n  }\n)\n\n// Apply Mixins\n// Plugin is actually a big class, I decided to separate the logic into\n// different mixin files to ease the maintainability of each file.\n// Filename convention will be plugin+xxxxx.js where xxxxx is the added functionality.\nUtil.assign(Plugin.prototype, require('./plugin+content'))\nUtil.assign(Plugin.prototype, require('./plugin+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+content+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+ads'))\nUtil.assign(Plugin.prototype, require('./plugin+ads+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+pings'))\nUtil.assign(Plugin.prototype, require('./plugin+fire'))\nUtil.assign(Plugin.prototype, require('./plugin+infinity'))\nUtil.assign(Plugin.prototype, require('./plugin+infinity+getters'))\n\nmodule.exports = Plugin\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar startParams = [\n  'accountCode',\n  'username',\n  'anonymousUser',\n  'rendition',\n  'deviceInfo',\n  'player',\n  'title',\n  'title2',\n  'live',\n  'segmentDuration',\n  'mediaDuration',\n  'mediaResource',\n  'parsedResource',\n  'transactionCode',\n  'properties',\n  'cdn',\n  'playerVersion',\n  'param1',\n  'param2',\n  'param3',\n  'param4',\n  'param5',\n  'param6',\n  'param7',\n  'param8',\n  'param9',\n  'param10',\n  'param11',\n  'param12',\n  'param13',\n  'param14',\n  'param15',\n  'param16',\n  'param17',\n  'param18',\n  'param19',\n  'param20',\n  'dimensions',\n  'playerStartupTime',\n  'obfuscateIp',\n  'privacyProtocol',\n  'p2pEnabled',\n  'pluginVersion',\n  'pluginInfo',\n  'isp',\n  'connectionType',\n  'ip',\n  'referer',\n  'userType',\n  'streamingProtocol',\n  'transportFormat',\n  'householdId',\n  'adsBlocked',\n  'adsExpected',\n  'deviceUUID',\n  'smartswitchConfigCode',\n  'smartswitchGroupCode',\n  'smartswitchContractCode',\n  'libVersion',\n  'nodeHost',\n  'nodeType',\n  'appName',\n  'appReleaseVersion',\n  'package',\n  'saga',\n  'tvshow',\n  'season',\n  'titleEpisode',\n  'channel',\n  'imdbID',\n  'gracenoteID',\n  'contentType',\n  'genre',\n  'contentLanguage',\n  'subtitles',\n  'cost',\n  'price',\n  'playbackType',\n  'email',\n  'drm',\n  'videoCodec',\n  'audioCodec',\n  'codecSettings',\n  'codecProfile',\n  'containerFormat',\n  'contentId',\n  'contractedResolution',\n  'linkedViewId',\n  'edid',\n  'cdnBalancerResponseUUID',\n  'triggeredEvents'\n]\n\nvar adStartParams = [\n  'player',\n  'playhead',\n  'adTitle',\n  'position',\n  'adDuration',\n  'adCampaign',\n  'adCreativeId',\n  'adProvider',\n  'adResource',\n  'adPlayerVersion',\n  'adProperties',\n  'adAdapterVersion',\n  'adInsertionType',\n  'extraparam1',\n  'extraparam2',\n  'extraparam3',\n  'extraparam4',\n  'extraparam5',\n  'extraparam6',\n  'extraparam7',\n  'extraparam8',\n  'extraparam9',\n  'extraparam10',\n  'fullscreen',\n  'audio',\n  'skippable',\n  'adNumber',\n  'adNumberInBreak',\n  'breakNumber'\n]\n\nvar RequestBuilder = YouboraObject.extend(\n  /** @lends youbora.RequestBuilder.prototype */\n  {\n    /**\n     * This class helps building params associated with each event: /start, /joinTime...\n     *\n     * @constructs RequestBuilder\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin A Plugin instance\n     */\n    constructor: function (plugin) {\n      this._plugin = plugin\n      this._adNumber = 0\n      this._adNumberInBreak = 0\n\n      /** Stores a list of the last params fetched */\n      this.lastSent = {}\n    },\n\n    /**\n     * Adds to params all the entities specified in paramList, unless they are already set.\n     *\n     * @param {Object} params Object of params key:value.\n     * @param {Array.string} paramList A list of params to fetch.\n     * @param {bool} onlyDifferent If true, only fetches params that have changed\n     */\n    fetchParams: function (params, paramList, onlyDifferent) {\n      params = params || {}\n      paramList = paramList || []\n      for (var i = 0; i < paramList.length; i++) {\n        var param = paramList[i]\n\n        if (params[param]) { continue }\n        var getterName = RequestBuilder.getters[param]\n\n        if (this._plugin[getterName]) {\n          var value = this._plugin[getterName]()\n          if (value !== null && (!onlyDifferent || this.lastSent[param] !== value)) {\n            params[param] = value\n            this.lastSent[param] = value\n          }\n        } else {\n          Log.warn('Trying to call undefined getter ' + param + ':' + getterName)\n        }\n      }\n      return params\n    },\n\n    getGetters: function () {\n      return RequestBuilder.getters\n    },\n\n    buildBody: function (service) {\n      var body = null\n      return this.fetchParams(body, RequestBuilder.bodyParams[service], false)\n    },\n\n    /**\n     * Adds to params object all the entities specified in paramList, unless they are already set.\n     *\n     * @param {Object} params Object of params key:value.\n     * @param {string} service The name of the service. Use {@link Plugin.Service} enum.\n     */\n    buildParams: function (params, service) {\n      params = params || {}\n      this.fetchParams(params, RequestBuilder.params[service], false)\n      this.fetchParams(params, RequestBuilder.differentParams[service], true)\n      return params\n    },\n\n    /**\n     * Creates an adnumber if it does not exist and stores it in lastSent. If it already exists,\n     * it is incremented by 1.\n     *\n     * @returns {number} adNumber\n     */\n    getNewAdNumber: function () {\n      var adNumber = this.lastSent.adNumber\n      if (adNumber && this.lastSent.position === this._plugin.getAdPosition()) {\n        adNumber += 1\n      } else {\n        adNumber = 1\n      }\n      this.lastSent.adNumber = adNumber\n      return adNumber\n    },\n\n    /**\n     * Creates an adnumberinbreak incrementing by 1.\n     *\n     * @returns {number} adNumber\n     */\n    getNewAdNumberInBreak: function () {\n      this._adNumberInBreak++\n      this.lastSent.adNumberInBreak = this._adNumberInBreak\n      return this._adNumberInBreak\n    },\n\n    /**\n     * Creates an breaknumber if it does not exist and stores it in lastSent. If it already exists,\n     * it is incremented by 1.\n     * Also resets adnumberinbreak\n     * @returns {number} breakNumber\n     */\n    getNewBreakNumber: function () {\n      var breakNumber = 1\n      this._adNumberInBreak = 0\n      if (this.lastSent.breakNumber) {\n        breakNumber = this.lastSent.breakNumber + 1\n      }\n      this.lastSent.breakNumber = breakNumber\n      return breakNumber\n    },\n\n    /**\n     * Return changed entities since last check\n     *\n     * @returns {Object} params\n     */\n    getChangedEntities: function () {\n      return this.fetchParams({}, RequestBuilder.differentParams.entities, true)\n    }\n  },\n  /** @lends youbora.RequestBuilder */\n  {\n    // Static Members\n\n    /** List of params used by each service */\n    params: {\n      '/data': ['system', 'pluginVersion', 'requestNumber', 'username'],\n\n      '/init': startParams,\n      '/start': startParams,\n      '/joinTime': ['joinDuration', 'playhead', 'bitrate', 'triggeredEvents'],\n      '/pause': ['playhead', 'triggeredEvents'],\n      '/resume': ['pauseDuration', 'playhead', 'triggeredEvents'],\n      '/seek': ['seekDuration', 'playhead', 'triggeredEvents'],\n      '/bufferUnderrun': ['bufferDuration', 'playhead', 'triggeredEvents'],\n      '/error': ['player', 'playhead', 'triggeredEvents'].concat(startParams),\n      '/stop': ['bitrate', 'totalBytes', 'playhead', 'pauseDuration', 'metrics', 'cdnDownloadedTraffic', 'multiCdnInfo', 'p2pDownloadedTraffic', 'uploadTraffic', 'triggeredEvents'],\n\n      '/infinity/video/event': [],\n\n      '/adInit': adStartParams,\n      '/adStart': adStartParams,\n      '/adJoin': ['playhead', 'position', 'adJoinDuration', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adPause': ['playhead', 'position', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adResume': ['playhead', 'position', 'adPlayhead', 'adPauseDuration', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adBufferUnderrun': ['playhead', 'position', 'adPlayhead', 'adBufferDuration', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adStop': ['playhead', 'position', 'adPlayhead', 'adBitrate', 'adTotalDuration', 'pauseDuration', 'adViewedDuration', 'adViewability', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adClick': ['playhead', 'position', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adError': ['playhead'].concat(adStartParams),\n      '/adManifest': ['givenBreaks', 'expectedBreaks', 'expectedPattern', 'breaksTime'],\n      '/adBreakStart': ['position', 'givenAds', 'expectedAds', 'breakNumber', 'adInsertionType'],\n      '/adBreakStop': ['position', 'breakNumber'],\n      '/adQuartile': ['position', 'adViewedDuration', 'adViewability', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n\n      '/ping': ['droppedFrames', 'playrate', 'cdnDownloadedTraffic', 'multiCdnInfo', 'p2pDownloadedTraffic', 'uploadTraffic', 'latency', 'packetLoss', 'packetSent', 'metrics', 'totalBytes', 'segmentDuration'],\n\n      '/infinity/session/start': [\n        'accountCode',\n        'username',\n        'userType',\n        'anonymousUser',\n        'route',\n        'page',\n        'referer',\n        'referral',\n        'language',\n        'deviceInfo',\n        'adsBlocked',\n        'deviceUUID',\n        'libVersion',\n        'appName',\n        'appReleaseVersion',\n        'isp',\n        'connectionType',\n        'ip',\n        'obfuscateIp',\n        'privacyProtocol',\n        'dimensions',\n        'param1',\n        'param2',\n        'param3',\n        'param4',\n        'param5',\n        'param6',\n        'param7',\n        'param8',\n        'param9',\n        'param10',\n        'param11',\n        'param12',\n        'param13',\n        'param14',\n        'param15',\n        'param16',\n        'param17',\n        'param18',\n        'param19',\n        'param20',\n        'edid'\n      ],\n      '/infinity/session/stop': ['sessionMetrics'],\n      '/infinity/session/nav': ['route', 'page', 'scrollDepth'],\n      '/infinity/session/beat': ['sessionMetrics'],\n      '/infinity/session/event': ['accountCode'],\n\n      '/offlineEvents': {}\n    },\n\n    /** Values for request body */\n    bodyParams: {\n      '/offlineEvents': ['viewJson']\n    },\n\n    /** List of params used by each service (only if they are different) */\n    differentParams: {\n      entities: [\n        'rendition',\n        'title',\n        'title2',\n        'param1',\n        'param2',\n        'param3',\n        'param4',\n        'param5',\n        'param6',\n        'param7',\n        'param8',\n        'param9',\n        'param10',\n        'param11',\n        'param12',\n        'param13',\n        'param14',\n        'param15',\n        'param16',\n        'param17',\n        'param18',\n        'param19',\n        'param20',\n        'cdn',\n        'nodeHost',\n        'nodeType',\n        'nodeTypeString',\n        'subtitles',\n        'contentLanguage'\n      ]\n    },\n\n    /** List of params and its related getter */\n    getters: {\n      requestNumber: 'getRequestNumber',\n      playhead: 'getPlayhead',\n      playrate: 'getPlayrate',\n      fps: 'getFramesPerSecond',\n      segmentDuration: 'getSegmentDuration',\n      droppedFrames: 'getDroppedFrames',\n      mediaDuration: 'getDuration',\n      bitrate: 'getBitrate',\n      totalBytes: 'getTotalBytes',\n      throughput: 'getThroughput',\n      rendition: 'getRendition',\n      title: 'getTitle',\n      title2: 'getTitle2',\n      live: 'getIsLive',\n      mediaResource: 'getResource',\n      parsedResource: 'getParsedResource',\n      transactionCode: 'getTransactionCode',\n      properties: 'getMetadata',\n      playerVersion: 'getPlayerVersion',\n      player: 'getPlayerName',\n      cdn: 'getCdn',\n      pluginVersion: 'getPluginVersion',\n      libVersion: 'getLibVersion',\n      userType: 'getUserType',\n      streamingProtocol: 'getStreamingProtocol',\n      transportFormat: 'getTransportFormat',\n      obfuscateIp: 'getObfuscateIp',\n      privacyProtocol: 'getPrivacyProtocol',\n      householdId: 'getHouseholdId',\n      latency: 'getLatency',\n      packetLoss: 'getPacketLoss',\n      packetSent: 'getPacketSent',\n      metrics: 'getVideoMetrics',\n      dimensions: 'getCustomDimensions',\n\n      param1: 'getExtraparam1',\n      param2: 'getExtraparam2',\n      param3: 'getExtraparam3',\n      param4: 'getExtraparam4',\n      param5: 'getExtraparam5',\n      param6: 'getExtraparam6',\n      param7: 'getExtraparam7',\n      param8: 'getExtraparam8',\n      param9: 'getExtraparam9',\n      param10: 'getExtraparam10',\n      param11: 'getExtraparam11',\n      param12: 'getExtraparam12',\n      param13: 'getExtraparam13',\n      param14: 'getExtraparam14',\n      param15: 'getExtraparam15',\n      param16: 'getExtraparam16',\n      param17: 'getExtraparam17',\n      param18: 'getExtraparam18',\n      param19: 'getExtraparam19',\n      param20: 'getExtraparam20',\n\n      extraparam1: 'getAdExtraparam1',\n      extraparam2: 'getAdExtraparam2',\n      extraparam3: 'getAdExtraparam3',\n      extraparam4: 'getAdExtraparam4',\n      extraparam5: 'getAdExtraparam5',\n      extraparam6: 'getAdExtraparam6',\n      extraparam7: 'getAdExtraparam7',\n      extraparam8: 'getAdExtraparam8',\n      extraparam9: 'getAdExtraparam9',\n      extraparam10: 'getAdExtraparam10',\n\n      position: 'getAdPosition',\n      adNumber: 'getAdNumber',\n      adNumberInBreak: 'getAdNumberInBreak',\n      breakNumber: 'getBreakNumber',\n      adPlayhead: 'getAdPlayhead',\n      adDuration: 'getAdDuration',\n      adCampaign: 'getAdCampaign',\n      adCreativeId: 'getAdCreativeId',\n      adBitrate: 'getAdBitrate',\n      adTitle: 'getAdTitle',\n      adResource: 'getAdResource',\n      adPlayerVersion: 'getAdPlayerVersion',\n      adProperties: 'getAdMetadata',\n      adAdapterVersion: 'getAdAdapterVersion',\n      givenBreaks: 'getGivenBreaks',\n      expectedBreaks: 'getExpectedBreaks',\n      expectedPattern: 'getExpectedPattern',\n      breaksTime: 'getBreaksTime',\n      givenAds: 'getGivenAds',\n      expectedAds: 'getExpectedAds',\n      adsExpected: 'getAdsExpected',\n      adViewedDuration: 'getAdViewedDuration',\n      adViewability: 'getAdViewability',\n      fullscreen: 'getIsFullscreen',\n      audio: 'getAudioEnabled',\n      skippable: 'getIsSkippable',\n      adProvider: 'getAdProvider',\n      adInsertionType: 'getAdInsertionType',\n\n      pluginInfo: 'getPluginInfo',\n\n      isp: 'getIsp',\n      connectionType: 'getConnectionType',\n      ip: 'getIp',\n\n      deviceInfo: 'getDeviceInfo',\n      edid: 'getEDID',\n\n      system: 'getAccountCode',\n      accountCode: 'getAccountCode',\n      username: 'getUsername',\n      anonymousUser: 'getAnonymousUser',\n\n      joinDuration: 'getJoinDuration',\n      bufferDuration: 'getBufferDuration',\n      seekDuration: 'getSeekDuration',\n      pauseDuration: 'getPauseDuration',\n\n      adJoinDuration: 'getAdJoinDuration',\n      adBufferDuration: 'getAdBufferDuration',\n      adPauseDuration: 'getAdPauseDuration',\n      adTotalDuration: 'getAdTotalDuration',\n\n      referer: 'getReferer',\n      referral: 'getReferral',\n      language: 'getLanguage',\n\n      nodeHost: 'getNodeHost',\n      nodeType: 'getNodeType',\n      nodeTypeString: 'getNodeTypeString',\n\n      route: 'getReferer',\n      page: 'getPageName',\n\n      playerStartupTime: 'getPlayerStartupTime',\n      pageLoadTime: 'getPageLoadTime',\n\n      cdnDownloadedTraffic: 'getCdnTraffic',\n      multiCdnInfo: 'getMultiCdnInfo',\n      p2pDownloadedTraffic: 'getP2PTraffic',\n      p2pEnabled: 'getIsP2PEnabled',\n      uploadTraffic: 'getUploadTraffic',\n      cdnBalancerResponseUUID: 'getBalancerResponseId',\n\n      viewJson: 'getOfflineView',\n      deviceUUID: 'getDeviceUUID',\n      sessionMetrics: 'getSessionMetrics',\n      scrollDepth: 'getScrollDepth',\n\n      adsBlocked: 'getIsBlocked',\n      linkedViewId: 'getLinkedViewId',\n\n      smartswitchConfigCode: 'getSmartswitchConfigCode',\n      smartswitchGroupCode: 'getSmartswitchGroupCode',\n      smartswitchContractCode: 'getSmartswitchContractCode',\n\n      appName: 'getAppName',\n      appReleaseVersion: 'getAppReleaseVersion',\n      package: 'getPackage',\n      saga: 'getSaga',\n      tvshow: 'getTvShow',\n      season: 'getSeason',\n      titleEpisode: 'getEpisodeTitle',\n      channel: 'getChannel',\n      drm: 'getDRM',\n      videoCodec: 'getVideoCodec',\n      audioCodec: 'getAudioCodec',\n      codecSettings: 'getCodecSettings',\n      codecProfile: 'getCodecProfile',\n      containerFormat: 'getContainerFormat',\n      contentId: 'getID',\n      imdbID: 'getImdbId',\n      gracenoteID: 'getGracenoteID',\n      contentType: 'getType',\n      genre: 'getGenre',\n      contentLanguage: 'getVideoLanguage',\n      subtitles: 'getSubtitles',\n      contractedResolution: 'getContractedResolution',\n      cost: 'getCost',\n      price: 'getPrice',\n      playbackType: 'getPlaybackType',\n      email: 'getEmail'\n    }\n\n  }\n)\n\nmodule.exports = RequestBuilder\n","/* global localStorage, sessionStorage, location */\nvar YouboraObject = require('../object')\nvar Log = require('../log')\n\n/**\n * This class manages data sotrage in the browser memory.\n *\n * @extends youbora.Emitter\n * @memberof youbora\n */\nvar YouboraStorage = YouboraObject.extend(\n  /** @lends youbora.YouboraStorage.prototype */\n  {\n    /**\n     *\n     * @constructs YouboraStorage\n     * @extends YouboraObject\n     * @memberof youbora\n     *\n     * @param {String} [prefix] Optional. Sets the prefix for saved objects in storages or cookies. 'youbora' by default.\n     * @param {Boolean} [disableCookies] Optional. Set to true to disable cookies fallback. True by default.\n     */\n    constructor: function (prefix, disableCookies, forceCookies, disable) {\n      this.prefix = prefix || 'youbora'\n      this.disableCookies = disableCookies\n      this.forceCookies = forceCookies\n      this.disabled = disable\n    },\n\n    /**\n     * Returns if storages are available or not\n     *\n     */\n    isEnabled: function () {\n      if (this.disabled) return false\n      var ret = true\n      if (!this.forceCookies) {\n        try {\n          localStorage.setItem(this.prefix + '.' + 'test', 'true')\n          localStorage.removeItem(this.prefix + '.' + 'test')\n        } catch (err) {\n          ret = false\n        }\n      }\n      return ret\n    },\n\n    /**\n     * Saves in localStorage or equivalent\n     *\n     * @param {string} key Key of the value. Prefix will be appended.\n     * @param {string} value Value.\n     */\n    setLocal: function (key, value) {\n      if (this.disabled) return null\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof localStorage === 'undefined' || !localStorage) && !this.disableCookies)) {\n          ret = this._setCookie(this.prefix + '.local.' + key, value)\n        } else {\n          ret = localStorage.setItem(this.prefix + '.' + key, value)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs localStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Reads from localStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getLocal: function (key) {\n      if (this.disabled) return null\n      return this._localGetRemove('getItem', '_getCookie', key)\n    },\n\n    /**\n     * Removes from localStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    removeLocal: function (key) {\n      if (this.disabled) return null\n      return this._localGetRemove('removeItem', '_removeCookie', key)\n    },\n\n    _localGetRemove: function (storageMethod, cookieMethod, key) {\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof localStorage === 'undefined' || !localStorage) && !this.disableCookies)) {\n          ret = this[cookieMethod](this.prefix + '.local.' + key)\n        } else {\n          ret = localStorage[storageMethod](this.prefix + '.' + key)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs localStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Saves in sessionStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     * @param {string} value Value.\n     */\n    setSession: function (key, value) {\n      if (this.disabled) return null\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof sessionStorage === 'undefined' || !sessionStorage) && !this.disableCookies)) {\n          ret = this._setCookie(this.prefix + '.session.' + key, value)\n        } else {\n          ret = sessionStorage.setItem(this.prefix + '.' + key, value)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs sessionStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Reads from sessionStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getSession: function (key) {\n      if (this.disabled) return null\n      return this._sessionGetRemove('getItem', '_getCookie', key)\n    },\n\n    /**\n   * Removes from sessionStorage or equivalent\n   *\n   * @param {string} key Key of the value. prefix will be appended.\n   */\n    removeSession: function (key) {\n      if (this.disabled) return null\n      return this._sessionGetRemove('removeItem', '_removeCookie', key)\n    },\n\n    _sessionGetRemove: function (storageMethod, cookieMethod, key) {\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof sessionStorage === 'undefined' || !sessionStorage) && !this.disableCookies)) {\n          ret = this[cookieMethod](this.prefix + '.session.' + key)\n        } else {\n          ret = sessionStorage[storageMethod](this.prefix + '.' + key)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs sessionStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Calls getSession and getLocal for the same key\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getStorages: function (key) {\n      return this.getSession(key) || this.getLocal(key)\n    },\n\n    /**\n     * Calls getSession and getLocal with the same key and value\n     * @param {string} key Key of the value. prefix will be appended.\n     * @param {string} value Value.\n     */\n    setStorages: function (key, value) {\n      this.setSession(key, value)\n      this.setLocal(key, value)\n    },\n\n    /**\n     * Calls getSession and getLocal for the same key\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    removeStorages: function (key) {\n      this.removeSession(key)\n      this.removeLocal(key)\n    },\n\n    // Private cookies methods\n\n    /**\n   * Sets a cookie value\n   *\n   * @param {string} cname Key of the value.\n   * @param {Object} cvalue Value.\n   */\n    _setCookie: function (cname, cvalue) {\n      if (typeof document !== 'undefined') {\n        var domain = ';'\n        if (typeof location !== 'undefined') {\n          domain += 'domain=' + location.host.split('.').reverse().splice(0, 2).reverse().join('.') + ';path=/;'\n        }\n        document.cookie = cname + '=' + cvalue + domain\n      }\n    },\n\n    /**\n   * Gets a cookie value\n   *\n   * @param {string} cname Key of the value.\n   */\n    _getCookie: function (cname) {\n      if (typeof document !== 'undefined') {\n        var name = cname + '='\n        var decodedCookie = decodeURIComponent(document.cookie)\n        var ca = decodedCookie.split(';')\n        for (var i = 0; i < ca.length; i++) {\n          var c = ca[i]\n          while (c.charAt(0) === ' ') {\n            c = c.substring(1)\n          }\n          if (c.indexOf(name) === 0) {\n            return c.substring(name.length, c.length)\n          }\n        }\n      }\n      return null\n    },\n\n    /**\n   * Removes a cookie\n   *\n   * @param {string} cname Key of the value.\n   */\n    _removeCookie: function (cname) {\n      this._setCookie(cname, '')\n    }\n  }\n)\n\nmodule.exports = YouboraStorage\n","/* eslint no-extend-native: \"off\" */\n\n/**\n * When executed, this function applies polyfills to the following functionalities:\n * Function.prototype.bind and\n * Array.prototype.forEach.\n *\n * @memberof youbora\n */\nvar applyPolyfills = function () {\n  // Bind, changed for compatibility\n  Function.prototype.bind = Function.prototype.bind || function (context) {\n    var slice = Array.prototype.slice\n    var func = this\n    var args = slice.call(arguments, 1)\n    function bound () {\n      var invokedAsConstructor = func.prototype && (this instanceof func)\n      return func.apply(\n        !invokedAsConstructor && context || this, args.concat(slice.call(arguments)) // eslint-disable-line no-mixed-operators\n      )\n    }\n    bound.prototype = func.prototype\n    return bound\n  }\n\n  // Foreach\n  Array.prototype.forEach = Array.prototype.forEach || function (callback, thisArg) {\n    if (typeof (callback) !== 'function') {\n      throw new TypeError(callback + ' is not a function!')\n    }\n    var len = this.length\n    for (var i = 0; i < len; i++) {\n      callback.call(thisArg, this[i], i, this)\n    }\n  }\n\n  // Trunc\n  Math.trunc = Math.trunc || function (x) {\n    if (isNaN(x)) {\n      return NaN\n    }\n    if (x > 0) {\n      return Math.floor(x)\n    }\n    return Math.ceil(x)\n  }\n}\n\nmodule.exports = applyPolyfills\n","/* global atv */\nvar YouboraObject = require('./object')\nvar Chrono = require('./chrono')\n\nvar Timer = YouboraObject.extend(\n  /** @lends youbora.Timer.prototype */\n  {\n    /**\n     * An Utility class that provides timed events in a defined time interval.\n     *\n     * @param {function} callback The callback to call every due interval.\n     * Callback will receive lapsed ms between calls.\n     * @param {int} [interval=5000] Milliseconds between each call.\n     *\n     * @constructs Timer\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function (callback, interval) {\n      this.callback = callback\n      this.interval = interval || 5000\n      this.isRunning = false\n      this._timer = null\n\n      this.chrono = new Chrono()\n    },\n\n    /**\n     * Starts the timer.\n     */\n    start: function () {\n      if (!this.isRunning) {\n        this.isRunning = true\n        this._setTick()\n      }\n    },\n\n    /**\n     * Stops the timer.\n     */\n    stop: function () {\n      this.isRunning = false\n      if (this._timer) {\n        try {\n          clearTimeout(this._timer)\n          this._timer = null\n        } catch (err) {\n          if (typeof atv !== 'undefined') {\n            atv.clearTimeout(this._timer)\n            this._timer = null\n          }\n        }\n      }\n    },\n\n    /**\n     * Sets the next tick execution.\n     * @private\n     */\n    _setTick: function () {\n      if (this.isRunning) {\n        this.chrono.start()\n        try {\n          this._timer = setTimeout(function () {\n            this.callback(this.chrono.stop())\n            this._setTick()\n          }.bind(this), this.interval)\n        } catch (err) {\n          if (typeof atv !== 'undefined') {\n            this._timer = atv.setTimeout(function () {\n              this.callback(this.chrono.stop())\n              this._setTick()\n            }.bind(this), this.interval)\n          }\n        }\n      }\n    }\n  }\n)\n\nmodule.exports = Timer\n","var Log = require('./log')\n\n/**\n * This static class provides utility methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Util = {\n  /**\n     * Strip {protocol}:// and // from the begining of the string.\n     *\n     * @param {string} url\n     * @returns {string} stripped url\n     */\n  stripProtocol: function (url) {\n    var strippedUrl = url\n    try {\n      strippedUrl = url.replace(/^(.*?:\\/\\/|\\/\\/)/i, '')\n    } catch (err) {\n      Log.warn(err)\n    }\n    return strippedUrl\n  },\n\n  /**\n     * Adds specific protocol. ie: [http://]nqs.nice264.com\n     *\n     * @param {string} url Domain of the service. Without protocol. ie: 'nqs.nice264.com'.\n     * @param {boolean|null} [httpSecure]\n     * If true will add https, if false http.\n     * Otherwise will add //\n     * @return Return the complete service URL.\n     */\n  addProtocol: function (url, httpSecure) {\n    var serviceUrl = 'http://localhost/'\n    try {\n      serviceUrl = 'http://' + url\n      if (httpSecure || (typeof window !== 'undefined' && window.location.protocol.indexOf('https') === 0)) {\n        serviceUrl = 'https://' + url\n      } else if (typeof window !== 'undefined' && window.location.protocol.indexOf('http') === 0) {\n        serviceUrl = '//' + url\n      }\n    } catch (err) {\n      Log.warn(err)\n    }\n    return serviceUrl\n  },\n\n  /**\n     * Return n if it isn't NaN, negative, Infinity, null or undefined.\n     * In any other case, return def.\n     *\n     * @param {mixed} n Number to be parsed.\n     * @param {number} def Number to return if n is not correct.\n     */\n  parseNumber: function (n, def) {\n    return (!isNaN(n) &&\n      n >= 0 &&\n      n !== Infinity &&\n      n !== -Infinity &&\n      n !== null &&\n      typeof n !== 'undefined')\n      ? n\n      : def\n  },\n\n  /**\n     * This utility method will add most of the HTML5 common event listeners to the player sent.\n     * This common events will be listened: 'canplay', 'buffering', 'waiting', 'ended', 'play',\n     * 'playing', 'pause', 'resume', 'error', 'abort', 'seek', 'seeking', 'seeked', 'stalled',\n     * 'dispose', 'loadeddata', 'loadstart'.\n     *\n     * Events will be reported as DEBUG level messages.\n     *\n     * @param {object|function} o Object to attach the events.\n     * @param {array} [extraEvents]\n     * An array of extra events to watch. ie:  ['timeupdate', 'progress'].\n     * If the first item is null, no common events will be added.\n     * @param {function} [report] Callback function called to report events.\n     * Default calls Log.debug()\n     */\n  logAllEvents: function (o, extraEvents, report) {\n    try {\n      if (Log.logLevel <= Log.Level.DEBUG) {\n        report = report || function (e) {\n          Log.debug('Event: ' + e.type)\n        }\n\n        var playerEvents = [\n          'canplay', 'buffering', 'waiting', 'ended', 'play', 'playing',\n          'pause', 'resume', 'error', 'abort', 'seek', 'seeking', 'seeked',\n          'stalled', 'dispose', 'loadeddata', 'loadstart'\n        ]\n        if (extraEvents) {\n          if (extraEvents[0] === null) {\n            extraEvents.shift()\n            playerEvents = extraEvents\n          } else {\n            playerEvents = playerEvents.concat(extraEvents)\n          }\n        }\n\n        for (var i = 0; i < playerEvents.length; i++) {\n          if (typeof o === 'function') {\n            o.call(window, playerEvents[i], report)\n          } else if (o.on) {\n            o.on(playerEvents[i], report)\n          } else if (o.addEventListener) {\n            o.addEventListener(playerEvents[i], report)\n          }\n        }\n      }\n    } catch (err) {\n      Log.error(err)\n    }\n  },\n\n  /**\n     * Builds a string that represents the rendition.\n     *\n     * The returned string will have the following format: <width>x<height>@bitrate<suffix?>.\n     * If either the width or height are < 1, only the bitrate will be returned.\n     * If bitrate is < 1, only the dimensions will be returned.\n     * If bitrate is < and there is no dimensions, a null will be returned.\n     * The bitrate will also have one of the following suffixes dependin on its\n     * magnitude: bps, Kbps, Mbps\n     *\n     * @param {any} width The width of the asset. If only 1 argument is sent, it will be treated\n     * as bitrate.\n     * @param {any} height The height of the asset.\n     * @param {any} bitrate The indicated bitrate (in the manifest) of the asset.\n     * @returns {string} A string with the following format: <width>x<height>@<bitrate><suffix>\n     */\n  buildRenditionString: function (width, height, bitrate) {\n    if (arguments.length === 1) {\n      bitrate = width\n      width = null\n      height = null\n    }\n\n    var ret = null\n    if (width && height) {\n      ret = width + 'x' + height\n    }\n\n    if (typeof bitrate === 'number' && !isNaN(bitrate) && bitrate >= 1) {\n      if (ret) {\n        ret += '@'\n      } else {\n        ret = ''\n      }\n\n      if (bitrate < 1e3) {\n        ret += Math.round(bitrate) + 'bps'\n      } else if (bitrate < 1e6) {\n        bitrate = Math.round(bitrate / 1e3)\n        ret += bitrate + 'Kbps'\n      } else {\n        bitrate = Math.round(bitrate / 1e4) / 1e2\n        ret += bitrate + 'Mbps'\n      }\n    }\n    return ret\n  },\n\n  /**\n     * Returns a params dictionary with the error values.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @returns {Object} Key:value params.\n     */\n  buildErrorParams: function (code, msg, metadata, level) {\n    var params = {}\n    if (typeof code === 'object' && code !== null) {\n      params = code\n    } else {\n      params.errorCode = code || 'FAILURE'\n      params.msg = msg || params.errorCode\n      params.errorMetadata = metadata\n      params.errorLevel = level\n    }\n    return params\n  },\n\n  /**\n     * Returns a boolean indicating if more than the desired % of pixels are on screen.\n     *\n     * @param {Object} [player] Player object\n     * @param {Number} [screenPercent] Threshold % of pixels on screen to return true.\n     * @returns {Boolean} Its on screen or not.\n     */\n  calculateAdViewability: function (player, screenPercent) {\n    var isVisible = true\n    if (typeof window !== 'undefined' && player && typeof player.getBoundingClientRect === 'function') {\n      var box = player.getBoundingClientRect()\n      // 100% outside the window cases\n      if (box.top >= window.innerHeight || box.bottom <= 0 ||\n        box.right <= 0 || box.left >= window.innerWidth) {\n        isVisible = false\n      } else {\n        var pixels = Math.trunc(box.height * box.width)\n        var x1 = box.top > 0 ? box.top : 0\n        var x2 = box.bottom > window.innerHeight ? window.innerHeight : box.bottom\n        var y1 = box.left > 0 ? box.left : 0\n        var y2 = box.right > window.innerWidth ? window.innerWidth : box.right\n        var inScreenPixels = (y2 - y1) * (x2 - x1)\n        // more than screenPercent of pixels (by default 50%)\n        isVisible = inScreenPixels * 100 > pixels * (screenPercent || 50)\n      }\n    }\n    return isVisible\n  },\n\n  getMetricsFrom: function (op1, op2) {\n    var metrics = op1 || op2\n    for (var metric in metrics) {\n      if (typeof metrics[metric] !== 'object' || !metrics[metric].value) {\n        var temporal = {}\n        // temporal.oper = 'SUM' //default one?\n        temporal.value = metrics[metric]\n        metrics[metric] = temporal\n      }\n    }\n    return metrics\n  },\n\n  // The following methods replace core js functionallity to ensure compatibility in old versions.\n  assign: require('./mixins/assign'),\n  isArray: require('./mixins/isarray')\n}\n\nmodule.exports = Util\n","module.exports = require('../manifest.json').version\n","// No-Conflict\nvar previousYoubora = youbora // eslint-disable-line no-use-before-define\nvar youbora = {}\n\n/**\n * This allows you to run multiple instances of YouboraLib on the same webapp.\n * After loading the new version, call `noConflict()` to get a reference to it.\n * At the same time the old version will be returned to Youbora.\n */\nyoubora.noConflict = function () {\n  youbora = previousYoubora\n  return this\n}\n\n// Info\nyoubora.VERSION = require('./version')\n\n// Polyfills\nyoubora.polyfills = require('./polyfills')\nyoubora.polyfills()\n\n// Base Classes\nyoubora.Object = require('./object')\nyoubora.Emitter = require('./emitter')\n\n// Log\nyoubora.Log = require('./log')\nyoubora.Log.loadLevelFromUrl()\n\n// General classes\nyoubora.Util = require('./util')\nyoubora.HybridNetwork = require('./monitors/hybridnetwork')\nyoubora.Chrono = require('./chrono')\nyoubora.Timer = require('./timer')\nyoubora.Constants = require('./constants')\n\n// Comm classes\nyoubora.Request = require('./comm/request')\nyoubora.Communication = require('./comm/communication')\n\n// Resource Transform classes\nyoubora.Transform = require('./comm/transform/transform')\nyoubora.ViewTransform = require('./comm/transform/view')\nyoubora.ResourceTransform = require('./comm/transform/resource')\nyoubora.CdnParser = require('./comm/transform/resourceparsers/cdnparser')\nyoubora.HlsParser = require('./comm/transform/resourceparsers/formatparsers/hlsparser')\nyoubora.DashParser = require('./comm/transform/resourceparsers/formatparsers/dashparser')\nyoubora.OfflineParser = require('./comm/transform/offline')\nyoubora.LocationheaderParser = require('./comm/transform/resourceparsers/formatparsers/locationheaderparser')\n\n// Plugin Classes\nyoubora.Options = require('./plugin/options')\nyoubora.Plugin = require('./plugin/plugin')\nyoubora.Storage = require('./plugin/storage')\nyoubora.RequestBuilder = require('./plugin/requestbuilder')\n\n// Adapters\nyoubora.PlayheadMonitor = require('./adapter/playheadmonitor')\nyoubora.Adapter = require('./adapter/adapter')\nyoubora.adapters = {}\n\n// Infinity\nyoubora.Infinity = require('./infinity/infinity')\n\n// Detector classes\nyoubora.BackgroundDetector = require('./detectors/backgroundDetector')\nyoubora.DeviceDetector = require('./detectors/deviceDetector')\nyoubora.UUIDGenerator = require('./deviceUUID/hashgenerator')\n\n/**\n * Register the given adapter in <youbora>.adapters.\n *\n * @param {string} key Unique adapter identifier.\n * @param {youbora.Adapter} Adapter Adapter class.\n *\n * @memberof youbora\n */\nyoubora.registerAdapter = function (key, Adapter) {\n  this.adapters[key] = Adapter\n}.bind(youbora)\n\n/**\n * Remove the given adapter in <youbora>.adapters.\n *\n * @param {string} key Unique adapter identifier.\n *\n * @memberof youbora\n */\nyoubora.unregisterAdapter = function (key) {\n  this.adapters[key] = null\n}.bind(youbora)\n\nmodule.exports = youbora\n","/* global tv */\nvar youbora = require('youboralib')\nvar manifest = require('../manifest.json')\n\nyoubora.adapters.Freewheel = youbora.Adapter.extend({\n  /** Override to return current plugin version */\n  getVersion: function () {\n    return manifest.version + '-' + manifest.name + '-' + manifest.tech\n  },\n\n  /** Override to return current playhead of the video */\n  getPlayhead: function () {\n    return this._getAdInstanceMethodCall('getPlayheadTime')\n  },\n\n  /** Override to return video duration */\n  getDuration: function () {\n    return this._getAdInstanceMethodCall('getDuration')\n  },\n\n  /** Override to return title */\n  getTitle: function () {\n    try {\n      if (this.titles) {\n        return this.titles[this._getAdNumber()]._adId\n      }\n    } catch (err) {\n      // youbora.Log.debug('Cant get title')\n    }\n    return 'unknown'\n  },\n\n  /** Override to return resource URL. */\n  getResource: function () {\n    var ret = null\n    var creativeRendition = this._getAdInstanceMethodCall('getActiveCreativeRendition')\n    if (creativeRendition) {\n      if (typeof creativeRendition.getPrimaryCreativeRenditionAsset === 'function') {\n        asset = creativeRendition.getPrimaryCreativeRenditionAsset()\n        if (asset && typeof asset.getUrl === 'function') { \n          ret = asset.getUrl() \n        }\n      } else if (typeof creativeRendition.getWrapperUrl === 'function') {\n        ret = creativeRendition.getWrapperUrl()\n      }\n    }\n    return ret\n  },\n\n  /** Override to return player version */\n  getPlayerVersion: function () {\n    var ret = null\n    if (typeof tv !== 'undefined' && tv.freewheel && tv.freewheel.SDK) {\n      ret = tv.freewheel.SDK.version\n    }\n    return ret\n  },\n\n  /** Override to return player's name */\n  getPlayerName: function () {\n    return 'Freewheel'\n  },\n\n  getPosition: function () {\n    return this.position\n  },\n\n  getIsVisible: function () {\n    if (!this.contentPlayer) {\n      for (var key in this.player) {\n        var element = this.player[key]\n        if (element && element.videoHeight && element.clientHeight) {\n          this.contentPlayer = element\n          break\n        }\n      }\n    }\n    return youbora.Util.calculateAdViewability(this.contentPlayer)\n  },\n\n  getAudioEnabled: function () {\n    for (var key in this.player) {\n      var element = this.player[key]\n      if (element && element.adManager && element.adManager._context && element.adManager._context.getAdVolume) {\n        return !!element.adManager._context.getAdVolume()\n      }\n    }\n  },\n\n  getGivenAds: function () {\n    return this.slot.getAdCount()\n  },\n\n  getBreaksTime: function () {\n    var slots = this.getSlots()\n    if (!slots) return null\n    var times = []\n    for (var slotindex in slots) {\n      var slot = slots[slotindex]\n      if (slot.getAdCount() > 0) {\n        var ads = slot.getAdInstances()\n        for (var adindex in ads) {\n          if (ads[adindex]._creativeRenditions[0]._baseUnit === 'video') {\n            var duration = this.plugin.getDuration()\n            var position = slot.getTimePosition()\n            times.push(duration && position > duration ? duration : position)\n            break\n          }\n        }\n      }\n    }\n    return times\n  },\n\n  getGivenBreaks: function () {\n    var slots = this.getSlots()\n    if (!slots) return null\n    var breaks = 0\n    for (var slotindex in slots) {\n      var slot = slots[slotindex]\n      if (slot.getAdCount() > 0) {\n        var ads = slot.getAdInstances()\n        for (var adindex in ads) {\n          if (ads[adindex]._creativeRenditions[0]._baseUnit === 'video') {\n            breaks++\n            break\n          }\n        }\n      }\n    }\n    return breaks\n  },\n\n  getCreativeId: function () {\n    var ret = null\n    if (this.slot) {\n      var instances = this.slot.getAdInstances()\n      var adnumber = this._getAdNumber()\n      if (instances && instances[adnumber]) { \n        ret = instances[adnumber]._creativeId \n      }\n    }\n    return ret\n  },\n\n  getSlots: function () {\n    if (this.player.currentAdContext) {\n      return this.player.currentAdContext._adResponse.getTemporalSlots()\n    } else {\n      for (var key in this.player) {\n        var element = this.player[key]\n        if (element && element._adResponse && element._adResponse.getTemporalSlots) {\n          return element\n        }\n      }\n    }\n    return null\n  },\n\n  _getAdNumber: function () {\n    return (this.plugin.requestBuilder.lastSent.adNumber || 1) - 1\n  },\n\n  _getAdInstanceMethodCall: function (methdodName) {\n    ret = null\n    if (this.slot) {\n      var instances = this.slot.getAdInstances()\n      var adNumber = this._getAdNumber()\n      if (instances && instances[adNumber] && typeof instances[adNumber][methdodName] === 'function') {\n        ret = instances[adNumber][methdodName]()\n      }\n    }\n    return ret\n  },\n\n  /** Register listeners to this.player. */\n  registerListeners: function () {\n    this.canRemoveListeners = true\n\n    // References\n    this.events = tv.freewheel.SDK\n    this.manifestNoResponse = [\n      this.events.ERROR_SECURITY,\n      this.events.ERROR_TIMEOUT\n    ]\n    this.manifestEmpty = [\n      this.events.ERROR_NO_AD_AVAILABLE,\n      this.events.ERROR_VAST_NO_AD\n    ]\n    this.manifestWrong = [\n      this.events.ERROR_VAST_VERSION_NOT_SUPPORTED,\n      this.events.ERROR_VAST_WRAPPER_LIMIT_REACH,\n      this.events.ERROR_VAST_XML_PARSING,\n      this.events.ERROR_PARSE\n    ]\n    this.ignoredErrors = [\n      this.events.ERROR_ADINSTANCE_UNAVAILABLE\n    ]\n    this.references = {}\n    this.references[this.events.EVENT_AD] = this.logListener.bind(this)\n    this.references[this.events.EVENT_ERROR] = this.errorListener.bind(this)\n    this.references[this.events.EVENT_SLOT_STARTED] = this.slotListener.bind(this)\n    this.references[this.events.EVENT_SLOT_ENDED] = this.closeListener.bind(this)\n    for (var key in this.manifestNoResponse) {\n      this.references[key] = this.noResponseManifestListener.bind(this)\n    }\n    for (var key2 in this.manifestEmpty) {\n      this.references[key2] = this.manifestEmptyListener.bind(this)\n    }\n    for (var key3 in this.manifestWrong) {\n      this.references[key3] = this.manifestWrongListener.bind(this)\n    }\n\n    for (var key4 in this.references) {\n      this.player.currentAdContext.addEventListener(key4, this.references[key4])\n    }\n  },\n\n  /** Unregister listeners to this.player. */\n  unregisterListeners: function () {\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.currentAdContext.removeEventListener(key, this.references[key])\n      }\n      this.references = {}\n    }\n  },\n\n  noResponseManifestListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE, 'No response')\n  },\n\n  manifestEmptyListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.EMPTY, 'Empty manifest')\n  },\n\n  manifestWrongListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.WRONG, 'Wrong manifest format')\n  },\n\n  logListener: function (e) {\n    youbora.Log.debug(e.subType)\n    if (e.errorCode || e.errorInfo || e.errorModule) {\n      this.errorListener(e)\n      return\n    }\n    switch (e.subType) {\n      case this.events.EVENT_AD_PAUSE:\n        this.pauseListener(e)\n        break\n      case this.events.EVENT_AD_RESUME:\n        this.resumeListener(e)\n        break\n      case this.events.EVENT_AD_IMPRESSION_END:\n        this.endedListener(e)\n        break\n      case this.events.EVENT_AD_INITIATED:\n        this.playListener(e)\n        break\n      case this.events.EVENT_AD_IMPRESSION:\n        this.playingListener(e)\n        break\n      case this.events.EVENT_AD_SKIPPED:\n        this.skipListener(e)\n        break\n      case this.events.EVENT_SLOT_STARTED:\n        this.slotListener(e)\n        break\n      case this.events.EVENT_AD_CLOSE:\n      case this.events.EVENT_SLOT_ENDED:\n        this.closeListener(e)\n        break\n      case this.events.EVENT_AD_CLICK:\n        this.clickListener(e)\n        break\n      case this.events.EVENT_AD_FIRST_QUARTILE:\n        this.fireQuartile(1)\n        break\n      case this.events.EVENT_AD_MIDPOINT:\n        this.fireQuartile(2)\n        break\n      case this.events.EVENT_AD_THIRD_QUARTILE:\n        this.fireQuartile(3)\n        break\n      case this.events.ERROR_SECURITY:\n      case this.events.ERROR_TIMEOUT:\n        this.noResponseManifestListener(e)\n        break\n      case this.events.ERROR_NO_AD_AVAILABLE:\n      case this.events.ERROR_VAST_NO_AD:\n        this.manifestEmptyListener(e)\n        break   \n      case this.events.ERROR_VAST_VERSION_NOT_SUPPORTED:\n      case this.events.ERROR_VAST_WRAPPER_LIMIT_REACH:\n      case this.events.ERROR_VAST_XML_PARSING:\n      case this.events.ERROR_PARSE:\n        this.manifestWrongListener(e)\n        break\n    }\n  },\n\n  slotListener: function (e) {\n    this.slot = e.slot\n    var adapter = this.plugin.getAdapter()\n    this.disable = false\n    switch(slot.getTimePositionClass()) {\n      case 'POSTROLL':\n        this.position = youbora.Constants.AdPosition.Postroll\n        break\n      case 'MIDROLL':\n        this.position = youbora.Constants.AdPosition.Midroll\n        break\n      case 'PREROLL':\n        if (adapter && adapter.flags.isJoined) {\n          this.position = youbora.Constants.AdPosition.Midroll\n        } else {\n          this.position = youbora.Constants.AdPosition.Preroll\n        }\n        break\n      default:\n        this.disable = true\n    }\n    if (!this.disable) {\n      this.titles = slot.getAdInstances()\n      this.unregister()\n      this.plugin.fireInit()\n      this.fireInit()\n    }\n  },\n\n  playListener: function (e) {\n    if (!this.disable) {\n      this.fireStart() \n    }\n  },\n\n  playingListener: function (e) {\n    if (!this.disable) {\n      this.fireStart()\n      this.fireJoin()\n      this.fireResume()\n    }\n  },\n\n  pauseListener: function (e) {\n    this.firePause()\n  },\n\n  resumeListener: function (e) {\n    this.playListener()\n    this.fireResume()\n  },\n\n  endedListener: function (e) {\n    this.fireStop()\n  },\n\n  skipListener: function (e) {\n    this.fireSkip()\n  },\n\n  clickListener: function (e) {\n    var url = e.adInstance.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK, tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]\n    var now = new Date().getTime()\n    if (this.lastUrl === url && now < ((this.lastTime || 0) + 2000)) {\n      return\n    }\n    this.lastUrl = url\n    this.lastTime = now\n    this.fireClick(url)\n  },\n\n  closeListener: function (e) {\n    this.register()\n    if (this.position === youbora.Constants.AdPosition.Postroll && !this.disable) {\n      this.plugin.fireStop()\n    }\n  },\n\n  errorListener: function (e) {\n    this.fireError(e.errorCode || e.subType, e.errorInfo)\n    this.fireStop()\n    this.register()\n  },\n\n  register: function (e) {\n    var adapter = this.plugin.getAdapter()\n    if (adapter && !this.canRemoveListeners) {\n      adapter.registerListeners()\n      adapter.fireResume()\n      this.canRemoveListeners = true\n    }\n  },\n\n  unregister: function(e) {\n    if (adapter && this.canRemoveListeners) {\n      this.canRemoveListeners = false\n      adapter.unregisterListeners()\n      adapter.firePause()\n    }\n  },\n\n  changeVideo: function (e) {\n    if (this.flags.isStarted || this.flags.isInited) {\n      this.fireStop()\n      this.plugin.fireStop()\n      this.register()\n    }\n  }\n})\n\nmodule.exports = youbora.adapters.Freewheel\n","/* global videojs */\nvar youbora = require('youboralib')\nvar manifest = require('../manifest.json')\n\nvar VideojsAdapter = youbora.Adapter.extend({\n  getVersion: function () {\n    return manifest.version + '-' + manifest.name + '-' + manifest.tech\n  },\n\n  getTitle: function () {\n    var ret = null\n    if (this.player.mediainfo) {\n      ret = this.player.mediainfo.name\n    }\n    return ret\n  },\n\n  getPlayhead: function () {\n    var ret = this.player.currentTime()\n    if (this.plugin._adsAdapter && this.plugin._adsAdapter.flags.isStarted) {\n      ret = this.lastPlayhead || ret\n    }\n    return ret\n  },\n\n  getIsLive: function () {\n    var ret = null\n    if (this.player.mediainfo) {\n      ret = true\n      if (typeof this.player.mediainfo.duration === 'number') {\n        ret = this.player.mediainfo.duration < 1\n      }\n    }\n    return ret\n  },\n\n  getDuration: function () {\n    var ret = this.player.duration()\n    if (this.player.mediainfo && typeof this.player.mediainfo.duration !== 'undefined') {\n      ret = this.player.mediainfo.duration\n    }\n    return ret\n  },\n\n  getResource: function () {\n    var ret = null\n    var tech = this.getUsedTech()\n    if (tech && tech.getResource) {\n      ret = tech.getResource(this)\n    }\n    if (!ret) {\n      ret = this.player.currentSrc()\n    }\n    return ret\n  },\n\n  getBitrate: function () {\n    var ret = null\n    var tech = this.getUsedTech()\n    if (tech && tech.getBitrate) {\n      ret = tech.getBitrate(this)\n    }\n    return ret\n  },\n\n  getRendition: function () {\n    var ret = null\n    var tech = this.getUsedTech()\n    if (tech && tech.getRendition) {\n      ret = tech.getRendition(this)\n    }\n    return ret\n  },\n\n  getTotalBytes: function () {\n    var ret = null\n    var tech = this.getUsedTech()\n    if (tech && tech.getTotalBytes) {\n      ret = tech.getTotalBytes(this)\n    }\n    return ret\n  },\n\n  getPlayerName: function () {\n    var name = 'videojs'\n    if (VideojsAdapter.ContribHlsTech.isUsed(this)) {\n      name += '-hls' // hls-contrib\n    } else if (VideojsAdapter.HlsJsTech.isUsed(this)) {\n      name += '-hlsjs' // hlsjs\n    } else if (VideojsAdapter.ShakaTech.isUsed(this)) {\n      name += '-shaka' // shaka\n    } else if (VideojsAdapter.DashShakaTech.isUsed(this)) {\n      name += '-dash-shaka' // dash shaka\n    } else if (VideojsAdapter.DashTech.isUsed(this)) {\n      name += '-dash' // dash\n    }\n    if (VideojsAdapter.ImaAdsAdapter.isUsed(this)) {\n      name += '-ima' // ima3\n    } else if (VideojsAdapter.OnceUXAdsAdapter.isUsed(this)) {\n      this.pluginName += '-oux' // OnceUX\n    } else if (this.player.FreeWheelPlugin) { // TO CHANGE\n      name += '-fw' // freewheel\n    }\n    if (this.player.mediainfo) {\n      name += '-bcove' // brightcove\n    }\n    return name\n  },\n\n  getPlayerVersion: function () {\n    var ret = null\n    if (typeof videojs !== 'undefined') {\n      ret = videojs.VERSION\n    }\n    return ret\n  },\n\n  getPlayrate: function () {\n    return this.player.playbackRate()\n  },\n\n  isOnAdBreak: function() {\n    try {\n      return (this.player && this.player.ads && this.player.ads.inAdBreak && this.player.ads.inAdBreak())\n    } catch (e) {}\n\n    return false\n  },\n\n  getTech: function () {\n    // NOTE: Videojs discourages accessing techs from plugins because they want\n    // devs to develop tech-agnostic plugins. I don't think this applies to us,\n    // as we need to retrieve info from each different tech.\n    // https://github.com/videojs/video.js/issues/2617\n    return this.player.tech({ IWillNotUseThisInPlugins: true })\n  },\n\n  getUsedTech: function () {\n    var ret = null\n    if (VideojsAdapter.ContribHlsTech.isUsed(this)) {\n      ret = VideojsAdapter.ContribHlsTech\n    } else if (VideojsAdapter.HlsJsTech.isUsed(this)) {\n      ret = VideojsAdapter.HlsJsTech\n    } else if (VideojsAdapter.ShakaTech.isUsed(this)) {\n      ret = VideojsAdapter.ShakaTech\n    } else if (VideojsAdapter.DashShakaTech.isUsed(this)) {\n      ret = VideojsAdapter.DashShakaTech\n    } else if (VideojsAdapter.DashTech.isUsed(this)) {\n      ret = VideojsAdapter.DashTech\n    }\n    return ret\n  },\n\n  registerListeners: function () {\n    // Enable playhead monitor\n    this.monitorPlayhead(true, false, 1200)\n    this.acumBytes = 0\n    this.ignoreList = []\n    this.fatalList = []\n    this.nonFatalList = []\n    // Register listeners\n    this.references = {\n      loadstart: this.loadstartListener.bind(this),\n      adsready: this.loadAdsAdapter.bind(this),\n      play: this.playListener.bind(this),\n      timeupdate: this.timeupdateListener.bind(this),\n      pause: this.pauseListener.bind(this),\n      playing: this.playingListener.bind(this),\n      // abort: this.conditionalStop.bind(this),\n      ended: this.conditionalStop.bind(this),\n      dispose: this.disposeListener.bind(this),\n      seeking: this.seekingListener.bind(this),\n      seeked: this.seekedListener.bind(this),\n      error: this.errorListener.bind(this),\n      adserror: this.aderrorListener.bind(this),\n      adsEnded: this.adsEndedListener.bind(this),\n      texttrackchange: this.textListener.bind(this),\n      waiting: this.bufferingListener.bind(this)\n    }\n\n    if (this.player) {\n      for (var key in this.references) {\n        this.player.on(key, this.references[key])\n      }\n    }\n\n    setTimeout(this.loadAdsAdapter.bind(this), 50)\n  },\n\n  unregisterListeners: function () {\n    // Disable playhead monitoring\n    if (this.monitor) this.monitor.stop()\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.off(key, this.references[key])\n      }\n      delete this.references\n    }\n  },\n\n  textListener: function (e) {\n    if (this.player.textTracks) {\n      var tracks = this.player.textTracks()\n      var len = tracks.length\n      for (var i = 0; i < len; ++i) {\n        if (tracks[i] && tracks[i].mode === 'showing') {\n          this.plugin.options['content.subtitles'] = tracks[i].label || tracks[i].language\n        }\n      }\n    }\n  },\n\n  aderrorListener: function (e) {\n    this.loadAdsAdapter()\n    if (this.plugin.getAdsAdapter() && this.plugin.getAdsAdapter().adPlayerErrorListener) {\n      this.plugin.getAdsAdapter().adPlayerErrorListener(e)\n    }\n  },\n\n  loadstartListener: function (e) {\n    this.loadAdsAdapter()\n    youbora.Log.notice('Player detected ' + this.getPlayerName())\n  },\n\n  playListener: function (e) {\n    if (this.isOnAdBreak()) {\n      return\n    }\n    if (!this.flags.isStarted) {\n      this.lastSrc = this.getResource()\n      this._startEvent('playListenerNotStarted')\n    } else {\n      if (this.lastSrc && this.lastSrc !== this.getResource()) {\n        this.fireStop({}, 'playListenerNewResource')\n        this.acumBytesFunc()\n        this.lastPlayhead = undefined\n        this._startEvent('playListenerNewResource')\n        this.lastSrc = this.getResource()\n      }\n    }\n  },\n\n  _startEvent: function (triggerListener) {\n    this.loadAdsAdapter()\n    if (this.player.options_ && this.plugin && !this.plugin.options['content.id']){\n      this.plugin.options['content.id'] = this.player.options_['data-video-id']\n    }\n    this.fireStart({}, triggerListener)\n    if (!this.flags.isJoined) {\n      if (!this.joinPolling) {\n        this.joinPolling = new youbora.Timer(this._jointimePolling.bind(this), 500)\n      }\n      this.joinPolling.start()\n    }\n  },\n\n  _jointimePolling: function (e) {\n    if (this.plugin) {\n      if (!this.plugin.getAdsAdapter() || !this.plugin.getAdsAdapter().flags.isStarted) {\n        if (this.lastPlayhead !== 0 && typeof this.lastPlayhead === 'number' && this.lastPlayhead !== this.getPlayhead()) {\n          this.fireJoin({}, 'jointimePolling')\n          if (this.joinPolling) {\n            this.joinPolling.stop()\n          }\n        }\n        this.lastPlayhead = this.getPlayhead()\n      }\n    } else if (this.joinPolling) {\n      this.joinPolling.stop()\n    }\n  },\n\n  timeupdateListener: function (e) {\n    if (this.getPlayhead() > 0.1) {\n      this.fireJoin({}, 'timeupdateListener')\n      if (this.joinPolling) this.joinPolling.stop()\n      // Send seek end\n      if (!this.flags.isPaused && this.lastSeekPlayhead && this.lastSeekPlayhead !== this.getPlayhead()) {\n        this.fireSeekEnd({}, 'timeupdateListener')\n        this.lastSeekPlayhead = false\n      }\n    }\n    if (!this.flags.isJoined) {\n      if (this.lastPlayhead === undefined) {\n        this.lastPlayhead = this.getPlayhead()\n      }\n      if (this.lastPlayhead !== this.getPlayhead()) {\n        if (this.player.options_ && this.plugin && !this.plugin.options['content.id']){\n          this.plugin.options['content.id'] = this.player.options_['data-video-id']\n        }\n        this.fireStart({}, 'timeupdateListener')\n        this.fireJoin({}, 'timeupdateListener')\n        if (this.joinPolling) this.joinPolling.stop()\n        this.lastPlayhead = undefined\n      }\n    }\n    if (this.plugin._adsAdapter && !this.plugin._adsAdapter.flags.isStarted) {\n      this.lastPlayhead = this.getPlayhead()\n    }\n  },\n\n  pauseListener: function (e) {\n    this.firePause({}, 'pauseListener')\n  },\n\n  playingListener: function (e) {\n    this._startEvent('playingListener')\n    this.fireResume({}, 'playingListener')\n    if (this.getPlayhead() < 1) {\n      this.fireSeekEnd({}, 'playingListener')\n    }\n  },\n\n  disposeListener: function(e) {\n    if (this.plugin) {\n      this.plugin.fireStop({}, 'disposeListener')\n      this.plugin.removeAdsAdapter()\n      this.plugin.removeAdapter()\n    }\n  },\n\n  conditionalStop: function (e) {\n    if (this.isOnAdBreak()) {\n      return\n    }\n    if (this.plugin) {\n      this.adsEnded = false\n      this.fireStop({}, 'conditionalStop')\n      if (this.plugin && !this.plugin.options['content.id']){\n        this.plugin.options['content.id'] = null\n      }\n      this.acumBytesFunc()\n      this.lastPlayhead = undefined\n    }\n  },\n\n  adsEndedListener: function (e) {\n    this.adsEnded = true\n    if (this.plugin.requestBuilder.lastSent.adPosition === youbora.Constants.AdPosition.Postroll) {\n      this.plugin.fireStop({}, 'adsEndedListener')\n      this.acumBytesFunc()\n      this.lastPlayhead = undefined\n    }\n  },\n\n  seekingListener: function (e) {\n    this.fireSeekBegin({}, false, 'seekingListener')\n  },\n\n  seekedListener: function (e) {\n    // We save the playhead after the seek, we will send the seeked in the next timeupdate\n    this.lastSeekPlayhead = this.getPlayhead()\n  },\n\n  bufferingListener: function (e) {\n    this.fireBufferBegin({}, false, 'bufferingListener')\n  },\n\n  errorListener: function (e) {\n    var ignore = false\n    var fatal = false\n    var code = null\n    var msg = null\n\n    if (this.player.error && this.player.error()) {\n      code = Number(this.player.error().code)\n      msg = this.player.error().message\n      if (code === 2 || code === 4 || code < 0) {\n        fatal = true\n      }\n    }\n\n    if (code !== null) {\n      if (this.ignoreList.includes(code)) {\n        ignore = true\n      }\n      if (!fatal && this.fatalList.includes(code)) {\n        fatal = true\n      } else if (fatal && this.nonFatalList.includes(code)) {\n        fatal = false\n      }\n    }\n\n    if (!ignore) {\n      if (fatal) {\n        this.fireFatalError(code, msg, undefined, undefined, 'errorListener')\n        this.acumBytesFunc()\n        this.lastPlayhead = undefined\n        this.crashed = true\n      } else {\n        this.fireError(code, msg, undefined, undefined, 'errorListener')\n      }\n    }\n  },\n\n  loadAdsAdapter: function () {\n    if (this.plugin) {\n      if (this.plugin.getAdsAdapter() === null || this.plugin.getAdsAdapter().isGeneric) {\n        var adapter = null\n        // IMA\n        if (VideojsAdapter.ImaAdsAdapter.isUsed(this)) {\n          adapter = new VideojsAdapter.ImaAdsAdapter(this.player)\n          // OnceUX\n        } else if (VideojsAdapter.OnceUXAdsAdapter.isUsed(this)) {\n          adapter = new VideojsAdapter.OnceUXAdsAdapter(this.player)\n          // Ima Bcove\n        } else if (VideojsAdapter.BcoveImaAdsAdapter.isUsed(this)) {\n          adapter = new VideojsAdapter.BcoveImaAdsAdapter(this.player)\n          // Freewheel Bcove\n        } else if (VideojsAdapter.BcoveFreewheelAdsAdapter.isUsed(this)) {\n          adapter = new VideojsAdapter.BcoveFreewheelAdsAdapter(this.player)\n          // Freewheel\n        } else if (VideojsAdapter.FreewheelAdsAdapter.isUsed(this)) {\n          adapter = new VideojsAdapter.FreewheelAdsAdapter(this.player.freewheelAds.controller)\n          // Generic\n        } else if (this.plugin.getAdsAdapter() === null) {\n          adapter = new VideojsAdapter.GenericAdsAdapter(this.player)\n        }\n        if (adapter) this.plugin.setAdsAdapter(adapter)\n      } else {\n        if (this.plugin.getAdsAdapter().registerImaEvents) this.plugin.getAdsAdapter().registerImaEvents()\n      }\n    }\n  },\n\n  acumBytesFunc: function () {\n    this.acumBytes += this.getTotalBytes() || 0\n  },\n\n  errorModifyer: function (fatal, nonfatal, ignore) {\n    this.fatalList = fatal || []\n    this.nonFatalList = nonfatal || []\n    this.ignoreList = ignore || []\n  }\n},\n// Static members\n{\n  // Ads Adaptrs\n  GenericAdsAdapter: require('./ads/generic'),\n  BcoveImaAdsAdapter: require('./ads/bcove-ima'),\n  BcoveFreewheelAdsAdapter: require('./ads/bcove-freewheel'),\n  FreewheelAdsAdapter: require('./ads/freewheel'),\n  ImaAdsAdapter: require('./ads/ima'),\n  OnceUXAdsAdapter: require('./ads/onceux'),\n\n  // Techs\n  ContribHlsTech: require('./tech/contrib-hls'),\n  HlsJsTech: require('./tech/hls-js'),\n  ShakaTech: require('./tech/shaka'),\n  DashShakaTech: require('./tech/dash-shaka'),\n  DashTech: require('./tech/dash')\n}\n)\n\nyoubora.adapters.Videojs = VideojsAdapter\n\nmodule.exports = youbora.adapters.Videojs\n","/* global tv */\nvar youbora = require('youboralib')\n\nvar FreewheelAdsAdapter = youbora.Adapter.extend({\n  getVersion: function () {\n    var ret = 'unknown'\n    if (this.player.FreeWheelPlugin.getVersion) {\n      ret = 'bcove-fw ' + this.player.FreeWheelPlugin.getVersion()\n    } else if (this.player.FreeWheelPlugin.VERSION) {\n      ret = 'bcove-ssai ' + this.player.FreeWheelPlugin.VERSION\n    }\n    return ret\n  },\n\n  getDuration: function () {\n    var ret = null\n    if (this.player.ads && this.player.ads.ad && this.player.ads.ad.duration) {\n      ret = this.player.ads.ad.duration\n    } else {\n      var player = this.plugin.player\n      if (this.player.FreeWheelPlugin) {\n        var tech = this.player.FreeWheelPlugin.tech\n        if (this.player.FreeWheelPlugin[tech].adPlayer) {\n          player = this.player.FreeWheelPlugin[tech].adPlayer\n        }\n      }\n      if (player && player.duration) {\n        ret = player.duration()\n      }\n    }\n    return ret\n  },\n\n  getPosition: function () {\n    var ret = youbora.Constants.AdPosition.Midroll\n    if (this.player.ads && this.player.ads.ad) {\n      switch (this.player.ads.ad.type) {\n        case 'PREROLL':\n          ret = youbora.Constants.AdPosition.Preroll\n          break\n        case 'MIDROLL':\n          ret = youbora.Constants.AdPosition.Midroll\n          break\n        case 'POSTROLL':\n          ret = youbora.Constants.AdPosition.Postroll\n          break\n      }\n    } else if (!this.plugin._adapter.flags.isJoined) {\n      ret = youbora.Constants.AdPosition.Preroll\n    } else if (this.plugin._adapter.getPlayhead() >= this.plugin._adapter.getDuration()) {\n      ret = youbora.Constants.AdPosition.Postroll\n    }\n    return ret\n  },\n\n  getResource: function () {\n    var ret = null\n    if (this.slot) {\n      var instances = this.slot.getAdInstances()\n      if (instances) {\n        var adnumber = (this.plugin.requestBuilder.lastSent.adNumber || 1) - 1\n        if (instances[adnumber] && instances[adnumber].getActiveCreativeRendition) {\n          var creativeRendition = instances[adnumber].getActiveCreativeRendition()\n          if (creativeRendition && creativeRendition.getPrimaryCreativeRenditionAsset) {\n            var asset = creativeRendition.getPrimaryCreativeRenditionAsset()\n            if (asset && asset.getUrl && asset.getUrl()) {\n              ret = asset.getUrl()\n            }\n          }\n          if (creativeRendition && creativeRendition.getWrapperUrl && !ret) {\n            ret = creativeRendition.getWrapperUrl()\n          }\n        }\n      }\n    }\n    return ret || 'unknown'\n  },\n\n  getTitle: function () {\n    var ret = null\n    if (this.player.FreeWheelPlugin.adsManager &&\n      this.player.FreeWheelPlugin.adsManager.getCurrentAd() &&\n      this.player.FreeWheelPlugin.adsManager.getCurrentAd().getTitle()) {\n      ret = this.player.FreeWheelPlugin.adsManager.getCurrentAd().getTitle()\n    } else if (this.titles) {\n      ret = this.titles[(this.plugin.requestBuilder.lastSent.adNumber || 1) - 1]._adId\n    }\n    return ret\n  },\n\n  getPlayhead: function () {\n    var player = this.plugin.getAdapter().player\n    if (this.player.FreeWheelPlugin.adPlayer) {\n      player = this.player.FreeWheelPlugin.adPlayer\n    }\n    return player.currentTime()\n  },\n\n  getGivenBreaks: function () {\n    var tech = this.player.FreeWheelPlugin.tech\n    var slots = this.player.FreeWheelPlugin[tech]._adContext._adResponse.getTemporalSlots()\n    var breaks = 0\n    for (var slotindex in slots) {\n      var slot = slots[slotindex]\n      if (slot.getAdCount() > 0) {\n        var ads = slot.getAdInstances()\n        for (var adindex in ads) {\n          if (ads[adindex]._creativeRenditions[0]._baseUnit === 'video') {\n            breaks++\n            break\n          }\n        }\n      }\n    }\n    return breaks\n  },\n\n  getBreaksTime: function () {\n    var ret = null\n    var slots = this.player.FreeWheelPlugin[this.player.FreeWheelPlugin.tech]._adContext._adResponse.getTemporalSlots()\n    var times = []\n    for (var slotindex in slots) {\n      var slot = slots[slotindex]\n      if (slot.getAdCount() > 0) {\n        var ads = slot.getAdInstances()\n        for (var adindex in ads) {\n          if (ads[adindex]._creativeRenditions[0]._baseUnit === 'video') {\n            if (this.plugin.getDuration() && slot.getTimePosition() > this.plugin.getDuration()) {\n              times.push(this.plugin.getDuration())\n            } else {\n              times.push(slot.getTimePosition())\n            }\n            break\n          }\n        }\n      }\n    }\n    ret = times.sort()\n    return ret\n  },\n\n  getGivenAds: function () {\n    var tech = this.player.FreeWheelPlugin.tech\n    return this.player.FreeWheelPlugin[tech]._currentSlot.getAdCount()\n  },\n\n  getAudioEnabled: function () {\n    var ret = null\n    if (this.player.muted()) {\n      ret = false\n    } else {\n      ret = !!this.player.volume()\n    }\n    return ret\n  },\n\n  getIsSkippable: function () {\n    return false\n  },\n\n  getIsFullscreen: function () {\n    var ret = null\n    if (this.plugin.deviceDetector.isIphone()) {\n      ret = !this.plugin.deviceDetector.isInBackground\n    } else {\n      var container = null\n      var tech = this.player.FreeWheelPlugin.tech\n      container = this.player.FreeWheelPlugin[tech]._video\n      ret = container ? (window.innerHeight <= container.clientHeight + 30 && window.innerWidth <= container.clientWidth + 30) : false\n    }\n    return ret\n  },\n\n  getIsVisible: function () {\n    var ret = null\n    if (this.plugin.deviceDetector.isIphone()) {\n      ret = !this.plugin.deviceDetector.isInBackground\n    } else {\n      if (!this.contentPlayer) {\n        var tech = this.player.FreeWheelPlugin.tech\n        for (var key in this.player.FreeWheelPlugin[tech]) {\n          var element = this.player.FreeWheelPlugin[tech][key]\n          if (element.videoHeight && element.clientHeight) {\n            this.contentPlayer = element\n            break\n          }\n        }\n      }\n      ret = youbora.Util.calculateAdViewability(this.contentPlayer)\n    }\n    return ret\n  },\n\n  getCreativeId: function () {\n    var ret = null\n    if (this.titles) {\n      ret = this.titles[(this.plugin.requestBuilder.lastSent.adNumber || 1) - 1]._creativeId\n    }\n    return ret\n  },\n\n  registerListeners: function () {\n    // Enable playhead monitor\n    this.monitorPlayhead(true, false)\n\n    this.references = {\n      'ads-ad-started': this.startJoinListener.bind(this),\n      'ads-pause': this.pausedListener.bind(this),\n      'ads-play': this.resumedListener.bind(this),\n      'ads-ad-ended': this.adEndedListener.bind(this),\n      'ads-pod-ended': this.podEndListener.bind(this),\n      'ads-first-quartile': this.firstQuartileListener.bind(this),\n      'ads-midpoint': this.secondQuartileListener.bind(this),\n      'ads-third-quartile': this.thirdQuartileListener.bind(this)\n    }\n\n    if (typeof tv !== 'undefined') {\n      var adcontext = this.player.FreeWheelPlugin[this.player.FreeWheelPlugin.tech]._adContext\n      this.events = tv.freewheel.SDK\n\n      this.fwreferences = {}\n      this.fwreferences[this.events.EVENT_AD] = this.logListener.bind(this)\n      this.fwreferences[this.events.EVENT_SLOT_STARTED] = this.slotListener.bind(this)\n      this.fwreferences[this.events.EVENT_ERROR] = this.errorFwListener.bind(this)\n      this.manifestNoResponse = [\n        this.events.ERROR_SECURITY,\n        this.events.ERROR_TIMEOUT\n      ]\n      for (var key in this.manifestNoResponse) {\n        this.fwreferences[key] = this.noResponseManifestListener.bind(this)\n      }\n      this.manifestEmpty = [\n        this.events.ERROR_NO_AD_AVAILABLE,\n        this.events.ERROR_VAST_NO_AD\n      ]\n      for (var key2 in this.manifestEmpty) {\n        this.fwreferences[key2] = this.manifestEmptyListener.bind(this)\n      }\n      this.manifestWrong = [\n        this.events.ERROR_VAST_VERSION_NOT_SUPPORTED,\n        this.events.ERROR_VAST_WRAPPER_LIMIT_REACH,\n        this.events.ERROR_VAST_XML_PARSING,\n        this.events.ERROR_PARSE\n      ]\n      for (var key3 in this.manifestWrong) {\n        this.fwreferences[key3] = this.manifestWrongListener.bind(this)\n      }\n\n      if (this.player) {\n        for (var key in this.fwreferences) {\n          adcontext.addEventListener(key, this.fwreferences[key])\n        }\n      }\n    }\n\n    if (this.player) {\n      for (var key in this.references) {\n        this.player.on(key, this.references[key])\n      }\n    }\n  },\n\n  logListener: function (e) {\n    if (e.errorCode || e.errorInfo || e.errorModule) {\n      this.errorFwListener(e)\n      return\n    }\n    switch (e.subType) {\n      case this.events.EVENT_AD_SKIPPED:\n        this.skippedListener(e)\n        break\n      case this.events.EVENT_SLOT_STARTED:\n        this.slotListener(e)\n        break\n      case this.events.EVENT_AD_CLICK:\n        this.clickFwListener(e)\n        break\n    }\n  },\n\n  skippedListener: function (e) {\n    this.fireSkip()\n    if (this.plugin._adapter) this.plugin._adapter.fireResume()\n  },\n\n  noResponseManifestListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE, 'No response')\n  },\n\n  manifestEmptyListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.EMPTY, 'Empty manifest')\n  },\n\n  manifestWrongListener: function (e) {\n    this.fireManifest(youbora.Constants.ManifestError.WRONG, 'Wrong manifest format')\n  },\n\n  slotListener: function (e) {\n    this.slot = e.slot\n    if (e && e.slot && e.slot.getAdInstances) {\n      this.titles = e.slot.getAdInstances()\n    }\n  },\n\n  startJoinListener: function (e) {\n    if (this.plugin._adapter) {\n      this.plugin._adapter.firePause()\n    }\n    this.fireStart()\n    this.fireJoin()\n  },\n\n  pausedListener: function (e) {\n    this.firePause()\n  },\n\n  resumedListener: function (e) {\n    this.fireResume()\n  },\n\n  adEndedListener: function (e) {\n    var playheadVal = this.plugin.requestBuilder.lastSent.adPosition === youbora.Constants.AdPosition.Preroll ? 0 : this.plugin._adapter.lastPlayhead\n    this.fireStop({ playhead: playheadVal, adPlayhead: this.getDuration() })\n  },\n\n  errorFwListener: function (e) {\n    this.fireError(e.errorCode || e.subType, e.errorInfo)\n    this.fireStop()\n  },\n\n  clickFwListener: function (e) {\n    var url = e.adInstance.getEventCallbackUrls(this.events.EVENT_AD_CLICK, this.events.EVENT_TYPE_CLICK)[0]\n    this.fireClick(url)\n  },\n\n  firstQuartileListener: function (e) {\n    this.fireQuartile(1)\n  },\n\n  secondQuartileListener: function (e) {\n    this.fireQuartile(2)\n  },\n\n  thirdQuartileListener: function (e) {\n    this.fireQuartile(3)\n  },\n\n  podEndListener: function (e) {\n    this.fireBreakStop()\n  },\n\n  unregisterListeners: function () {\n    // Disable playhead monitoring\n    if (this.monitor) this.monitor.stop()\n\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.off(key, this.references[key])\n      }\n      delete this.references\n    }\n  }\n},\n// Static Members\n{\n  isUsed: function (plugin) {\n    return plugin.player.ads && plugin.player.FreeWheelPlugin\n  }\n})\n\nmodule.exports = FreewheelAdsAdapter\n","/* global google */\nvar youbora = require('youboralib')\n\nvar FreewheelAdsAdapter = youbora.Adapter.extend({\n  getVersion: function () {\n    var ret = null\n    if (typeof google !== 'undefined' && google.ima) {\n      ret = 'bcove-ima ' + google.ima.VERSION\n    }\n    return ret\n  },\n\n  getPlayhead: function () {\n    var player = this.plugin.getAdapter().player\n    if (this.player.ima3) {\n      if (this.player.ima3 && this.player.ima3.adPlayer) {\n        player = this.player.ima3.adPlayer\n      }\n    }\n    return player.currentTime()\n  },\n\n  getDuration: function () {\n    var ret = null\n    if (this.player.ads && this.player.ads.ad && this.player.ads.ad.duration) {\n      ret = this.player.ads.ad.duration\n    } else {\n      var player = this.plugin.player\n      if (this.player.ima3) {\n        player = this.player.ima3.adPlayer\n      }\n      ret = (player && player.duration) ? player.duration() : null\n    }\n    return ret\n  },\n\n  getPosition: function () {\n    var ret = youbora.Constants.AdPosition.Midroll\n    if (this.player.ads && this.player.ads.ad) {\n      switch (this.player.ads.ad.type) {\n        case 'PREROLL':\n          ret = youbora.Constants.AdPosition.Preroll\n          break\n        case 'MIDROLL':\n          ret = youbora.Constants.AdPosition.Midroll\n          break\n        case 'POSTROLL':\n          ret = youbora.Constants.AdPosition.Postroll\n          break\n      }\n    } else if (this.plugin._adapter.getPlayhead() >= this.plugin._adapter.getDuration()) {\n      ret = youbora.Constants.AdPosition.Postroll\n    }\n    if (!this.plugin._adapter.flags.isJoined) {\n      ret = youbora.Constants.AdPosition.Preroll\n    }\n    return ret\n  },\n\n  getResource: function () {\n    var ret = 'unknown'\n    if (this.player.ima3) {\n      ret = this.player.ima3.currentAd.getMediaUrl()\n    }\n    return ret\n  },\n\n  getTitle: function () {\n    var ret = null\n    if (this.player.ima3 && this.player.ima3.currentAd) {\n      ret = this.player.ima3.currentAd.getTitle()\n    }\n    return ret\n  },\n\n  getPlayerVersion: function () {\n    var ret = null\n    if (this.player.ima3) {\n      ret = this.player.ima3.VERSION\n    }\n    return ret\n  },\n\n  getGivenBreaks: function () {\n    var ret = null\n    if (this.player.ima3) {\n      ret = this.player.ima3.adsManager.getCuePoints().length\n    }\n    return ret\n  },\n\n  getBreaksTime: function () {\n    var ret = null\n    if (this.player.ima3) {\n      var cuelist = this.player.ima3.adsManager.getCuePoints()\n      for (var index in cuelist) {\n        if ((!cuelist[index] && cuelist[index] !== 0) || cuelist[index] === -1) {\n          cuelist[index] = this.plugin._adapter.getDuration()\n        }\n      }\n      ret = cuelist\n    }\n    return ret\n  },\n\n  getGivenAds: function () {\n    var ret = null\n    if (this.player.ima3 && this.player.ima3.currentAd && this.player.ima3.currentAd.getAdPodInfo()) {\n      ret = this.player.ima3.currentAd.getAdPodInfo().getTotalAds()\n    }\n    return ret\n  },\n\n  getAudioEnabled: function () {\n    var ret = null\n    if (this.player.muted()) {\n      ret = false\n    } else {\n      ret = !!this.player.volume()\n    }\n    return ret\n  },\n\n  getIsSkippable: function () {\n    var ret = false\n    if (this.player.ima3) {\n      ret = this.player.ima3.currentAd && this.player.ima3.currentAd.isSkippable()\n    }\n    return ret\n  },\n\n  getIsFullscreen: function () {\n    var ret = null\n    if (this.plugin.deviceDetector.isIphone()) {\n      ret = !this.plugin.deviceDetector.isInBackground\n    } else {\n      var container = null\n      if (this.player.ima3) {\n        container = this.player.ima3.el\n      }\n      ret = container ? (window.innerHeight <= container.clientHeight + 30 && window.innerWidth <= container.clientWidth + 30) : false\n    }\n    return ret\n  },\n\n  getIsVisible: function () {\n    var ret = null\n    if (this.plugin.deviceDetector.isIphone()) {\n      ret = !this.plugin.deviceDetector.isInBackground\n    } else if (this.player.ima3) {\n      ret = youbora.Util.calculateAdViewability(this.player.ima3.el)\n    }\n    return ret\n  },\n\n  getBitrate: function () {\n    var bitrate = -1\n    if (this.player.ima3 && this.player.ima3.currentAd && this.player.ima3.currentAd.getVastMediaBitrate()) {\n      bitrate = this.player.ima3.currentAd.getVastMediaBitrate()\n    }\n    return bitrate\n  },\n\n  getCreativeId: function () {\n    var ret = null\n    if (this.player.ima3 && this.player.ima3.currentAd) {\n      ret = this.player.ima3.currentAd.getCreativeAdId() || this.player.ima3.currentAd.getCreativeId()\n    } else if (this.titles) {\n      ret = this.titles[(this.plugin.requestBuilder.lastSent.adNumber || 1) - 1]._creativeId\n    }\n    return ret\n  },\n\n  registerListeners: function () {\n    // Enable playhead monitor\n    this.monitorPlayhead(true, false)\n    this.references = {\n      'ima3-started': this.startJoinListener.bind(this),\n      'ima3-paused': this.pausedListener.bind(this),\n      'ima3-resumed': this.resumedListener.bind(this),\n      'ima3-complete': this.adEndedListener.bind(this),\n      'ima3-skipped': this.skippedListener.bind(this),\n      'ima3-ad-error': this.errorListener.bind(this),\n      'ads-pod-ended': this.podEndListener.bind(this),\n      'ads-click': this.clickListener.bind(this),\n      'ads-first-quartile': this.firstQuartileListener.bind(this),\n      'ads-midpoint': this.secondQuartileListener.bind(this),\n      'ads-third-quartile': this.thirdQuartileListener.bind(this)\n    }\n    if (this.player) {\n      for (var key in this.references) {\n        this.player.on(key, this.references[key])\n      }\n    }\n  },\n\n  startJoinListener: function (e) {\n    if (this.plugin._adapter) {\n      this.plugin._adapter.firePause()\n    }\n    this.fireStart()\n    this.fireJoin()\n  },\n\n  pausedListener: function (e) {\n    this.firePause()\n  },\n\n  resumedListener: function (e) {\n    this.fireResume()\n  },\n\n  skippedListener: function (e) {\n    this.fireSkip()\n    if (this.plugin._adapter) this.plugin._adapter.fireResume()\n  },\n\n  adEndedListener: function (e) {\n    var playheadVal = this.plugin.requestBuilder.lastSent.adPosition === youbora.Constants.AdPosition.Preroll ? 0 : this.plugin._adapter.lastPlayhead\n    this.fireStop({ playhead: playheadVal, adPlayhead: this.getDuration() })\n  },\n\n  errorListener: function (e) {\n    if (this.player.ima3) {\n      if (e.getError && e.getError()) {\n        var error = e.getError()\n        this.fireError(error.getCode(), error.getMessage())\n      } else {\n        this.fireError()\n      }\n    }\n  },\n\n  clickListener: function (e) {\n    if (this.player.ima3) {\n      var clickurl = null\n      if (this.player.ima3.currentAd && this.player.ima3.currentAd.g) {\n        clickurl = this.player.ima3.currentAd.g.clickThroughUrl\n      }\n      this.fireClick(clickurl)\n    }\n  },\n\n  firstQuartileListener: function (e) {\n    this.fireQuartile(1)\n  },\n\n  secondQuartileListener: function (e) {\n    this.fireQuartile(2)\n  },\n\n  thirdQuartileListener: function (e) {\n    this.fireQuartile(3)\n  },\n\n  podEndListener: function (e) {\n    this.fireBreakStop()\n  },\n\n  unregisterListeners: function () {\n    // Disable playhead monitoring\n    if (this.monitor) this.monitor.stop()\n\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.off(key, this.references[key])\n      }\n      delete this.references\n    }\n  },\n\n  adPlayerErrorListener: function (e) {\n    var error = e.data.AdError\n    // https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdError\n    var noResponseErrors = [\n      1012, // There was a problem requesting ads from the server.\n      1005, // There was a problem requesting ads from the server\n      301, // The VAST URI provided, or a VAST URI provided in a subsequent wrapper element,\n      // was either unavailable or reached a timeout, as defined by the video player. The timeout is 5 seconds for initial VAST requests and each subsequent wrapper.\n      402, // Failed to load media assets from a VAST response.\n      302 // The maximum number of VAST wrapper redirects has been reached.\n    ]\n    var emptyResponse = [\n      1007, // No assets were found in the VAST ad response\n      1009, // Empty VAST response\n      303 // No Ads VAST response after one or more wrappers\n    ]\n    var wrongResponse = [\n      403, // Assets were found in the VAST ad response for linear ad, but none of them matched the video player's capabilities\n      100, // The ad response was not recognized as a valid VAST ad\n      503, // Assets were found in the VAST ad response for nonlinear ad, but none of them matched the video player's capabilities\n      101, // VAST schema validation error.\n      102 // The ad response contained an unsupported VAST version\n    ]\n    if (noResponseErrors.indexOf(error.getErrorCode()) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE, error.getMessage())\n    } else if (emptyResponse.indexOf(error.getErrorCode()) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.EMPTY, error.getMessage())\n    } else if (wrongResponse.indexOf(error.getErrorCode()) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.WRONG, error.getMessage())\n    } else {\n      this.fireError(error.getErrorCode(), error.getMessage())\n    }\n  }\n},\n// Static Members\n{\n  isUsed: function (plugin) {\n    return typeof google !== 'undefined' && plugin.player.ima3 && plugin.player.ads\n  }\n})\n\nmodule.exports = FreewheelAdsAdapter\n","var freewheel = require('youbora-adapter-freewheel')\n\nvar FwAdsAdapter = freewheel.extend({\n  register: function () {},\n  unregister: function() {}\n}, {\n  isUsed: function (plugin) {\n    return plugin.player && plugin.player.freewheelAds\n  }\n})\n\nmodule.exports = FwAdsAdapter\n","var youbora = require('youboralib')\nvar manifest = require('../../manifest.json')\n\nvar GenericAdsAdapter = youbora.Adapter.extend({\n  isGeneric: true,\n\n  getVersion: function () {\n    return manifest.version + '-videojs-ads'\n  },\n\n  registerListeners: function () {\n    // Register listeners\n    this.references = {\n      adstart: this.adStartListener.bind(this),\n      adend: this.adEndListener.bind(this),\n      adskip: this.adSkipListener.bind(this),\n      adserror: this.errorListener.bind(this),\n      'ads-click': this.clickListener.bind(this)\n    }\n\n    if (this.player) {\n      for (var key in this.references) {\n        this.player.on(key, this.references[key])\n      }\n    }\n  },\n\n  unregisterListeners: function () {\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.off(key, this.references[key])\n      }\n      delete this.references\n    }\n  },\n\n  adStartListener: function (e) {\n    this.fireStart()\n    this.fireJoin()\n  },\n\n  adEndListener: function (e) {\n    this.fireStop()\n  },\n\n  adSkipListener: function (e) {\n    this.fireSkip()\n  },\n\n  errorListener: function (e) {\n    this.fireError()\n  },\n\n  clickListener: function (e) {\n    this.fireClick()\n  }\n})\n\nmodule.exports = GenericAdsAdapter\n","/* global google:true */\nvar youbora = require('youboralib')\nvar manifest = require('../../manifest.json')\n\nvar ImaAdsAdapter = youbora.Adapter.extend({\n  getVersion: function () {\n    return manifest.version + '-videojs-ima-ads'\n  },\n\n  getDuration: function () {\n    if (this.ima.getAdsManager() && this.ima.getAdsManager().getCurrentAd() !== null) {\n      this.duration = this.ima.getAdsManager().getCurrentAd().getDuration()\n    }\n    return this.duration\n  },\n\n  // NOT AVAILABLE AT adStart\n  getResource: function () {\n    var ret = null\n    var manager = this.ima.getAdsManager()\n    if (manager) {\n      ret = manager.getCurrentAd().getMediaUrl()\n    }\n    return ret\n  },\n\n  getTitle: function () {\n    var ret = null\n    var manager = this.ima.getAdsManager()\n    if (manager) {\n      ret = manager.getCurrentAd().getTitle()\n    }\n    return ret\n  },\n\n  getPlayhead: function () {\n    var ret = null\n    var manager = this.ima.getAdsManager()\n    if (manager) {\n      ret = this.getDuration() - manager.getRemainingTime()\n    }\n    return ret\n  },\n\n  getPlayerVersion: function () {\n    return 'IMA' + google.ima.VERSION + '; contrib-ads ' + this.player.ads.VERSION\n  },\n\n  getPosition: function () {\n    var ret = youbora.Constants.AdPosition.Preroll\n    if (this.plugin._adapter.flags.isJoined) {\n      if (!this.plugin.getIsLive() && this.plugin._adapter.getDuration() - 1 < this.plugin._adapter.getPlayhead()) {\n        ret = youbora.Constants.AdPosition.Postroll\n      } else if (this.plugin._adapter.getPlayhead() > 1) {\n        ret = youbora.Constants.AdPosition.Midroll\n      }\n    }\n    return ret\n  },\n\n  getGivenBreaks: function () {\n    var ret = null\n    if (this.cuepoints) {\n      ret = this.cuepoints.length\n    }\n    return ret\n  },\n\n  getBreaksTime: function () {\n    return this.cuepoints\n  },\n\n  getGivenAds: function () {\n    return this.totalAds\n  },\n\n  getAudioEnabled: function () {\n    return !this.ima.adMuted\n  },\n\n  getIsSkippable: function () {\n    return this.isSkippable\n  },\n\n  getIsFullscreen: function () {\n    var ret = false\n    var container = this.ima.adDisplayContainer\n    for (var index in container) {\n      if (container[index] && container[index].width && container[index].height) {\n        if (window.innerHeight && window.innerWidth && container[index].width && container[index].height) {\n          ret = (window.innerHeight <= container[index].height + 30 && window.innerWidth <= container[index].width + 30)\n        }\n      }\n    }\n    return ret\n  },\n\n  getIsVisible: function () {\n    return youbora.Util.calculateAdViewability(this.ima.adContainerDiv)\n  },\n\n  registerListeners: function () {\n    // Enable playhead monitor\n    this.monitorPlayhead(true, false)\n\n    // Shortcut events\n    var event = google.ima.AdEvent.Type\n\n    // Register listeners\n    this.references = {}\n    this.references[event.AD_METADATA] = this.metadataListener.bind(this)\n    this.references[event.LOADED] = this.loadedListener.bind(this)\n    this.references[event.CONTENT_PAUSE_REQUESTED] =\n      this.contentPauseRequestedListener.bind(this)\n    this.references[event.STARTED] = this.startedListener.bind(this)\n    this.references[event.PAUSED] = this.pausedListener.bind(this)\n    this.references[event.RESUMED] = this.resumedListener.bind(this)\n    this.references[event.COMPLETE] = this.completeListener.bind(this)\n    this.references[event.SKIPPED] = this.skippedListener.bind(this)\n    this.references[event.CLICK] = this.clickListener.bind(this)\n    this.references[google.ima.AdErrorEvent.Type.AD_ERROR] =\n      this.errorListener.bind(this)\n    this.references[event.ALL_ADS_COMPLETED] = this.adsEndedListener.bind(this)\n    this.references[event.FIRST_QUARTILE] = this.firstQuartileListener.bind(this)\n    this.references[event.MIDPOINT] = this.secondQuartileListener.bind(this)\n    this.references[event.THIRD_QUARTILE] = this.thirdQuartileListener.bind(this)\n\n    this.playerReferences = {\n      adend: this.adEndedListener.bind(this),\n      adstart: this.startedListener.bind(this),\n      adskip: this.skippedListener.bind(this),\n      adserror: this.errorListener.bind(this),\n      'ads-click': this.clickListener.bind(this)\n    }\n\n    if (this.player) {\n      this.registerImaEvents()\n      for (var key in this.playerReferences) {\n        this.player.on(key, this.playerReferences[key])\n      }\n    }\n  },\n\n  registerImaEvents: function () {\n    if (this.player.ima.addEventListener) {\n      this.ima = this.player.ima\n    } else if (this.player.ima.sdkImpl && this.player.ima.sdkImpl.addEventListener) {\n      this.ima = this.player.ima.sdkImpl\n    }\n    if (this.ima) {\n      for (var key in this.references) {\n        this.ima.addEventListener(key, this.references[key])\n      }\n    }\n  },\n\n  metadataListener: function (e) {\n    this.cuepoints = e.getAdCuePoints().getCuePoints().slice()\n    if (this.plugin._adapter) {\n      this.cuepoints.forEach(function (value, index) {\n        if (this.cuepoints[index] === -1 || this.cuepoints[index] == null || this.cuepoints[index] === undefined) {\n          this.cuepoints[index] = this.plugin._adapter.getDuration()\n        }\n      }.bind(this))\n    }\n  },\n\n  loadedListener: function (e) {\n    this.isSkippable = e.getAdData().skippable\n    this.totalAds = e.getAdData().adPodInfo.totalAds\n    this.fireInit()\n  },\n\n  contentPauseRequestedListener: function (e) {\n    this.fireInit()\n  },\n\n  startedListener: function (e) {\n    this.fireStart()\n    this.fireJoin()\n    this.plugin.getAdapter().firePause()\n  },\n\n  pausedListener: function (e) {\n    this.firePause()\n  },\n\n  resumedListener: function (e) {\n    this.fireResume()\n  },\n\n  completeListener: function (e) {\n    this.fireStop()\n  },\n\n  skippedListener: function (e) {\n    this.fireSkip()\n  },\n\n  adEndedListener: function (e) {\n    this.fireStop()\n  },\n\n  errorListener: function (e) {\n    var error = null\n    var code = null\n    if (typeof e.getError === 'function') {\n      error = e.getError()\n      code = error.getCode()\n    } else if (e.data && e.data.AdError) {\n      error = e.data.AdError\n      code = error.getErrorCode()\n    }\n    var msg = error ? error.getMessage() : null\n    this.fireError(code, msg)\n  },\n\n  clickListener: function (e) {\n    var url = null\n    try {\n      if (e && typeof e.getAd === 'function') {\n        var ad = e.getAd()\n        for (prop in ad) {\n          if (typeof ad[prop] === 'object' && ad[prop].clickThroughUrl) {\n            url = ad[prop].clickThroughUrl.substring(ad[prop].clickThroughUrl.indexOf('adurl=')).replace('adurl=', '')\n          }\n        }\n      }\n    } catch (err) {\n      youbora.Log.notice('Couldnt get adclick url')\n    }\n    this.fireClick(url)\n  },\n\n  adsEndedListener: function (e) {\n    this.plugin.getAdapter().adsEnded = true\n    this.fireStop()\n    this.plugin.getAdapter().fireResume()\n    if (this.plugin.requestBuilder.lastSent.adPosition === youbora.Constants.AdPosition.Postroll) {\n      this.plugin.fireStop()\n    }\n  },\n\n  firstQuartileListener: function (e) {\n    this.fireQuartile(1)\n  },\n\n  secondQuartileListener: function (e) {\n    this.fireQuartile(2)\n  },\n\n  thirdQuartileListener: function (e) {\n    this.fireQuartile(3)\n  },\n\n  unregisterListeners: function () {\n    // Disable playhead monitoring\n    if (this.monitor) this.monitor.stop()\n\n    // unregister listeners\n    if (this.player && this.ima && this.references && this.playerReferences) {\n      for (var key in this.references) {\n        // this.ima.removeEventListener(key, this.references[key]) //ima has no remove listeners...\n      }\n      for (var key in this.playerReferences) {\n        this.player.off(key, this.playerReferences[key])\n      }\n    }\n    delete this.references\n    delete this.playerReferences\n  },\n\n  adPlayerErrorListener: function (e) {\n    var error = e.data.AdError\n    // https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdError\n    var noResponseErrors = [\n      1012, // There was a problem requesting ads from the server.\n      1005, // There was a problem requesting ads from the server\n      301, // The VAST URI provided, or a VAST URI provided in a subsequent wrapper element,\n      // was either unavailable or reached a timeout, as defined by the video player. The timeout is 5 seconds for initial VAST requests and each subsequent wrapper.\n      402, // Failed to load media assets from a VAST response.\n      302 // The maximum number of VAST wrapper redirects has been reached.\n    ]\n    var emptyResponse = [\n      1007, // No assets were found in the VAST ad response\n      1009, // Empty VAST response\n      303 // No Ads VAST response after one or more wrappers\n    ]\n    var wrongResponse = [\n      403, // Assets were found in the VAST ad response for linear ad, but none of them matched the video player's capabilities\n      100, // The ad response was not recognized as a valid VAST ad\n      503, // Assets were found in the VAST ad response for nonlinear ad, but none of them matched the video player's capabilities\n      101, // VAST schema validation error.\n      102 // The ad response contained an unsupported VAST version\n    ]\n    var code = error.getErrorCode()\n    var msg = error.getMessage()\n    if (noResponseErrors.indexOf(code) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.NO_RESPONSE, msg)\n    } else if (emptyResponse.indexOf(code) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.EMPTY, msg)\n    } else if (wrongResponse.indexOf(code) >= 0) {\n      this.fireManifest(youbora.Constants.ManifestError.WRONG, msg)\n    } else {\n      this.fireError(code, msg)\n    }\n  }\n},\n// Static Members\n{\n  isUsed: function (plugin) {\n    return typeof google !== 'undefined' && google.ima && plugin.player.ima\n  }\n}\n)\n\nmodule.exports = ImaAdsAdapter\n","var youbora = require('youboralib')\nvar manifest = require('../../manifest.json')\n\nvar OnceUXAdsAdapter = youbora.Adapter.extend({\n  getVersion: function () {\n    return manifest.version + '-videojs-onceux-ads'\n  },\n\n  getResource: function () {\n    return this.player.ads.contentSrc\n  },\n\n  getPlayhead: function () {\n    return this.player.onceux.currentTime()\n  },\n\n  getDuration: function () {\n    return this.player.onceux.duration()\n  },\n\n  getPosition: function () {\n    var ret = youbora.Constants.AdPosition.Preroll\n    if (this.plugin.getAdapter().flags.isJoined) {\n      if (this.plugin.getAdapter().getPlayhead() <= this.plugin.getAdapter().getDuration()) {\n        ret = youbora.Constants.AdPosition.Midroll\n      } else {\n        ret = youbora.Constants.AdPosition.Postroll\n      }\n    }\n    return ret\n  },\n\n  registerListeners: function () {\n    // Console all events if logLevel=DEBUG\n    youbora.Util.logAllEvents(this.player, [\n      null,\n      'onceux-ads-complete',\n      'onceux-adroll-start',\n      'onceux-adroll-complete',\n      'onceux-linearad-start',\n      'onceux-linearad-impression',\n      'onceux-linearad-complete',\n      'onceux-linearad-skipped',\n      'onceux-linearad-pause',\n      'onceux-linearad-resume',\n      'onceux-companionad-creativeView',\n      'adserror',\n      'ads-click'\n    ])\n\n    // Enable playhead monitor\n    this.monitorPlayhead(true, false)\n\n    // Register listeners\n    this.references = {\n      'onceux-linearad-start': this.startedListener.bind(this),\n      'onceux-linearad-pause': this.pausedListener.bind(this),\n      'onceux-linearad-resume': this.resumedListener.bind(this),\n      'onceux-linearad-complete': this.completeListener.bind(this),\n      'onceux-linearad-skipped': this.skippedListener.bind(this),\n      adserror: this.errorListener.bind(this),\n      'ads-click': this.clickListener.bind(this)\n    }\n    if (this.player){\n      for (var key in this.references) {\n        this.player.on(key, this.references[key])\n      }\n    }\n  },\n\n  unregisterListeners: function () {\n    // Disable playhead monitoring\n    if (this.monitor) this.monitor.stop()\n\n    // unregister listeners\n    if (this.player && this.references) {\n      for (var key in this.references) {\n        this.player.off(key, this.references[key])\n      }\n      delete this.references\n    }\n  },\n\n  startedListener: function (e) {\n    this.fireStart()\n    this.fireJoin()\n  },\n\n  pausedListener: function (e) {\n    this.firePause()\n  },\n\n  resumedListener: function (e) {\n    this.fireResume()\n  },\n\n  completeListener: function (e) {\n    this.fireStop({ adPlayhead: this.getDuration() })\n  },\n\n  skippedListener: function (e) {\n    this.fireSkip()\n  },\n\n  errorListener: function (e) {\n    this.fireError()\n  },\n\n  clickListener: function (e) {\n    this.fireClick()\n  }\n},\n// Static Members\n{\n  isUsed: function (plugin) {\n    return plugin.player.onceux\n  }\n}\n)\n\nmodule.exports = OnceUXAdsAdapter\n","var youboralib = require('youboralib')\n\nmodule.exports = {\n  getHls: function(adapter) {\n    return adapter.getTech().vhs || adapter.getTech().hls || adapter.getTech().hls_\n  },\n\n  isUsed: function (adapter) {\n    return !!this.getHls(adapter)\n  },\n\n  getBitrate: function (adapter) {\n    var ret = null\n    var media = this.getHls(adapter).playlists.media()\n    if (adapter.player.qualityLevels) {\n      // using videojs-contrib-quality-levels\n      // https://github.com/videojs/videojs-contrib-quality-levels\n      var qualityLevels = adapter.player.qualityLevels()\n      var selected = qualityLevels[qualityLevels.selectedIndex]\n      if (selected) {\n        ret = selected.bitrate\n      }\n    } else if (media && media.attributes && media.attributes.BANDWIDTH) {\n      ret = media.attributes.BANDWIDTH\n    } else if (adapter.player.tech_ && adapter.player.tech_.vhs && adapter.player.tech_.vhs.stats) {\n      ret = adapter.player.tech_.vhs.stats.bandwidth\n    } else if (adapter.player.tech_ && adapter.player.tech_.hls && adapter.player.tech_.hls.bandwidth) {\n      ret = adapter.player.tech_.hls.bandwidth\n    } else if (adapter.player.hls && adapter.player.hls.bandwidth) {\n      ret = adapter.player.hls.bandwidth\n    }\n    return ret\n  },\n\n  getRendition: function (adapter) {\n    var ret = null\n    var media = this.getHls(adapter).playlists.media()\n    if (adapter.player.qualityLevels) {\n      // using videojs-contrib-quality-levels\n      // https://github.com/videojs/videojs-contrib-quality-levels\n      var qualityLevels = adapter.player.qualityLevels()\n      var selected = qualityLevels[qualityLevels.selectedIndex]\n      if (selected) {\n        ret = youboralib.Util.buildRenditionString(selected.width, selected.height, selected.bitrate)\n      }\n    } else if (media && media.attributes) {\n      var att = media.attributes\n      if (att.RESOLUTION) {\n        ret = youboralib.Util.buildRenditionString(\n          att.RESOLUTION.width,\n          att.RESOLUTION.height,\n          att.BANDWIDTH\n        )\n      } else if (att.BANDWIDTH) {\n        ret = youboralib.Util.buildRenditionString(att.BANDWIDTH)\n      } else if (att.NAME) {\n        ret = att.NAME\n      }\n    }\n    return ret\n  },\n\n  getTotalBytes: function (adapter) {\n    var hls = this.getHls(adapter)\n    var ret = hls.bytesReceived\n    if (!ret && hls.stats) {\n      ret = hls.stats.mediaBytesTransferred - adapter.acumBytes\n    }\n    return ret\n  }\n\n}\n","var youboralib = require('youboralib')\n\nmodule.exports = {\n  isUsed: function (adapter) {\n    return adapter.player.dash && adapter.player.dash.shakaPlayer\n  },\n\n  getResource: function (adapter) {\n    var ret = ''\n    var sp = adapter.player.dash.shakaPlayer\n    if (typeof sp.getManifestUri === 'function'){\n      ret = sp.getManifestUri()\n    } else if (typeof sp.getAssetUri === 'function') {\n      ret = sp.getAssetUri()\n    }\n    return ret\n  },\n\n  getBitrate: function (adapter) {\n    return adapter.player.dash.shakaPlayer.getStats().streamBandwidth\n  },\n\n  getRendition: function (adapter) {\n    var shaka = adapter.player.dash.shakaPlayer\n    var stats = shaka.getStats()\n    var ret = youboralib.Util.buildRenditionString(stats.width, stats.height, stats.streamBandwidth)\n    var tracks = shaka.getVariantTracks()\n    for (var i in tracks) {\n      var track = tracks[i]\n      if (track.active && track.type === 'video') {\n        ret = youboralib.Util.buildRenditionString(track.width, track.height, track.bandwidth)\n      }\n    }\n    return ret\n  }\n}\n","var youboralib = require('youboralib')\n\nmodule.exports = {\n  isUsed: function (adapter) {\n    return adapter.player.dash && adapter.player.dash.mediaPlayer && !adapter.player.dash.shakaPlayer\n  },\n\n  getResource: function (adapter) {\n    return this._getDashPlayer(adapter).getSource()\n  },\n\n  getBitrate: function (adapter) {\n    var ret = null\n    var player = this._getDashPlayer(adapter)\n    if (player) {\n      var level = player.getQualityFor('video')\n      if (level) {\n        ret = player.getBitrateInfoListFor('video')[level].bitrate\n      }\n    }\n    return ret\n  },\n\n  getRendition: function (adapter) {\n    var ret = null\n    var player = this._getDashPlayer(adapter)\n    if (player) {\n      var level = player.getQualityFor('video')\n      if (level) {\n        var renditionInfo = player.getBitrateInfoListFor('video')[level]\n        if (renditionInfo) {\n          ret = youboralib.Util.buildRenditionString(renditionInfo.width, renditionInfo.height, renditionInfo.bitrate)\n        }\n      }\n    }\n    return ret\n  },\n\n  _getDashPlayer: function(adapter) {\n    return adapter.player.dash.mediaPlayer\n  }\n}\n","var youboralib = require('youboralib')\n\nmodule.exports = {\n  getHls: function(adapter) {\n    return this.getTech()\n  },\n\n  isUsed: function (adapter) {\n    return !!this.getTech(adapter)\n  },\n\n  getResource: function (adapter) {\n    var ret = null\n    if (this.getTech(adapter) && this.getTech(adapter).url) {\n      ret = this.getTech(adapter).url\n    } else if (this.getHls(adapter) && this.getHls(adapter).source_) {\n      ret = this.getHls(adapter).source_.src\n    }\n    return ret\n  },\n\n  getBitrate: function (adapter) {\n    var ret = null\n    var currentLevel = this.getTech(adapter).currentLevel\n    if (typeof currentLevel !== 'undefined' && currentLevel !== -1 && !!this.getTech(adapter).levels) {\n      var level = this.getTech(adapter).levels[currentLevel]\n      if (level && level.bitrate) {\n        ret = level.bitrate\n      }\n    }\n    return ret\n  },\n\n  getRendition: function (adapter) {\n    var ret = null\n    var currentLevel = this.getTech(adapter).currentLevel\n    if (typeof currentLevel !== 'undefined' && currentLevel !== -1 && !!this.getTech(adapter).levels) {\n      var level = this.getTech(adapter).levels[currentLevel]\n      if (level) {\n        ret = youboralib.Util.buildRenditionString(level.width, level.height, level.bitrate)\n      }\n    }\n    return ret\n  },\n\n  getTech: function(adapter) {\n    var tech = adapter.getTech()\n    return tech.vhs || tech.hls || tech.hls_\n  }\n}\n","var youboralib = require('youboralib')\n\nmodule.exports = {\n  _getShaka: function(adapter) {\n    var tech = adapter.getTech()\n    return tech.shakaPlayer || tech._shakaplayerInstance\n  },\n\n  isUsed: function (adapter) {\n    return !!this._getShaka(adapter)\n  },\n\n  getResource: function (adapter) {\n    var ret = ''\n    var sp = this._getShaka(adapter)\n    if (typeof sp.getManifestUri === 'function'){\n      ret = sp.getManifestUri()\n    } else if (typeof sp.getCurrentSrc === 'function') {\n      ret = sp.getCurrentSrc()\n    }\n    return ret\n  },\n\n  getBitrate: function (adapter) {\n    var ret = -1\n    var sp = this._getShaka(adapter)\n    if (typeof sp.getStats === 'function') {\n      ret = sp.getStats().streamBandwidth\n    } else if ((typeof sp.getVideoTracks === 'function') && (typeof sp.getVideoTrackCurrentIndex === 'function')) {\n      var videoIndex = sp.getVideoTrackCurrentIndex()\n      var videoTracks = sp.getVideoTracks()\n      for (var i in videoTracks) {\n        var track = videoTracks[i]\n        if (track.index == videoIndex) {\n          ret = track.bitrate\n        }\n      }\n    }\n    return ret\n  },\n\n  getRendition: function (adapter) {\n    var shaka = this._getShaka(adapter)\n    var stats = shaka.getStats()\n    var ret = youboralib.Util.buildRenditionString(stats.width, stats.height, stats.streamBandwidth)\n    var tracks = shaka.getVariantTracks()\n    for (var i in tracks) {\n      var track = tracks[i]\n      if (track.active && track.type === 'video') {\n        ret = youboralib.Util.buildRenditionString(track.width, track.height, track.bandwidth)\n        break\n      }\n    }\n    return ret\n  }\n}\n","var AdapterConstants = require('../constants/adapter')\nvar Chrono = require('../chrono')\n\nvar AdapterAdsMixin = {\n  /** Override to return current ad position */\n  getPosition: function () {\n    return null\n  },\n\n  /** Override to return the given ad structure (list with number of pre, mid, and post breaks) */\n  getGivenBreaks: function () {\n    return null\n  },\n\n  /** Override to return the ad structure requested (list with number of pre, mid, and post breaks) */\n  getExpectedBreaks: function () {\n    return null\n  },\n\n  /** Override to return the structure of ads requested */\n  getExpectedPattern: function () {\n    return null\n  },\n\n  /** Override to return a list of playheads of ad breaks begin time */\n  getBreaksTime: function () {\n    return null\n  },\n\n  /** Override to return the number of ads given for the break */\n  getGivenAds: function () {\n    return null\n  },\n\n  /** Override to return the number of ads requested for the break */\n  getExpectedAds: function () {\n    return null\n  },\n\n  /** Override to return if the ad is being shown in the screen or not\n   * The standard definition is: more than 50% of the pixels of the ad are on the screen\n   */\n  getIsVisible: function () {\n    return true\n  },\n\n  /** Override to return a boolean showing if the audio is enabled when the ad begins */\n  getAudioEnabled: function () {\n    return null\n  },\n\n  /** Override to return if the ad is skippable */\n  getIsSkippable: function () {\n    return null\n  },\n\n  /** Override to return a boolean showing if the player is in fullscreen mode when the ad begins */\n  getIsFullscreen: function () {\n    return null\n  },\n\n  /** Override to return the ad campaign */\n  getCampaign: function () {\n    return null\n  },\n\n  /** Override to return the ad creative id */\n  getCreativeId: function () {\n    return null\n  },\n\n  /** Override to return the ad provider name */\n  getProvider: function () {\n    return null\n  },\n\n  /** Override to return the ad insertion type\n   * Use constants:\n   * youbora.Constants.AdInsertionType.ClientSide\n   * youbora.Constants.AdInsertionType.ServerSide\n  */\n  getAdInsertionType: function () {\n    return null\n  },\n\n  /**\n * Emits related event and set flags if current status is valid.\n * ie: won't sent start if isStarted is already true.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n */\n  fireClick: function (params) {\n    if (typeof params === 'string') {\n      params = { url: params }\n    }\n    this.emit(AdapterConstants.Event.CLICK, { params: params })\n  },\n\n  /**\n   * Emits related event and set flags if current status is valid.\n   * ie: won't sent start if isStarted is already true.\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   */\n  fireQuartile: function (quartile) {\n    if (this.flags.isStarted && typeof quartile === 'number' &&\n      quartile > this.flags.lastQuartileSent && quartile < 4) {\n      this.flags.lastQuartileSent++\n      this.emit(AdapterConstants.Event.QUARTILE, { params: { quartile: quartile } })\n    }\n  },\n\n  /**\n  * Starts a new chrono for viewedMax and restarts viewedAcum\n  */\n  startChronoView: function () {\n    if (this.getIsVisible() && !this.plugin.backgroundDetector.isInBackground) {\n      var max = this.chronos.viewedMax\n      if (max.length === 0 || max[max.length - 1].stopTime !== 0) {\n        max.push(new Chrono())\n        max[max.length - 1].start()\n      }\n    }\n  },\n\n  /**\n  * Stops a new chrono for viewedMax and restarts viewedAcum\n  */\n  stopChronoView: function () {\n    var max = this.chronos.viewedMax\n    if (max[0] && max.length > 0 && max[max.length - 1].stopTime === 0) {\n      max[max.length - 1].stop()\n    }\n  },\n\n  /**\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireManifest: function (params, message) {\n    var paramsObject = { params: params }\n    if (typeof params === 'string') {\n      paramsObject = { params: { errorType: params, errorMessage: message } }\n    }\n    this.emit(AdapterConstants.Event.MANIFEST, paramsObject)\n  },\n\n  /*\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireSkip: function (params) {\n    if (params === undefined) {\n      params = {}\n    }\n    params.skipped = true\n    this.fireStop(params)\n  },\n\n  /**\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireBreakStart: function (params) {\n    this.emit(AdapterConstants.Event.PODSTART, { params: params })\n  },\n\n  /**\n  * Emits related event and set flags if current status is valid.\n  * ie: won't sent start if isStarted is already true.\n  *\n  * @param {Object} [params] Object of key:value params to add to the request.\n  */\n  fireBreakStop: function (params) {\n    this.emit(AdapterConstants.Event.PODSTOP, { params: params })\n  }\n}\n\nmodule.exports = AdapterAdsMixin\n","var AdapterConstants = require('../constants/adapter')\nvar Log = require('../log')\n\nvar AdapterContentMixin = {\n  /** Override to return current playrate */\n  getPlayrate: function () {\n    return !this.flags.isPaused ? 1 : 0\n  },\n\n  /** Override to return Frames Per Secon (FPS) */\n  getFramesPerSecond: function () {\n    return null\n  },\n\n  /** Override to return dropped frames since start */\n  getDroppedFrames: function () {\n    return null\n  },\n\n  /** Override to return user bandwidth throughput */\n  getThroughput: function () {\n    return null\n  },\n\n  /** Override to return rendition */\n  getRendition: function () {\n    return null\n  },\n\n  /** Override to return title2 */\n  getTitle2: function () {\n    return null\n  },\n\n  /** Override to recurn true if live and false if VOD */\n  getIsLive: function () {\n    return null\n  },\n\n  /** Override to return CDN traffic bytes not using streamroot or peer5. */\n  getCdnTraffic: function () {\n    return null\n  },\n\n  /** Override to return P2P traffic bytes not using streamroot or peer5. */\n  getP2PTraffic: function () {\n    return null\n  },\n\n  /** Override to return P2P traffic sent in bytes, not using streamroot or peer5. */\n  getUploadTraffic: function () {\n    return null\n  },\n\n  /** Override to return if P2P is enabled not using streamroot or peer5. */\n  getIsP2PEnabled: function () {\n    return null\n  },\n\n  /** Override to return video segment duration. */\n  getSegmentDuration: function () {\n    return null\n  },\n\n  /** Override to return household id */\n  getHouseholdId: function () {\n    return null\n  },\n\n  /** Override to return the latency */\n  getLatency: function () {\n    return null\n  },\n\n  /** Override to return the number of packets lost */\n  getPacketLoss: function () {\n    return null\n  },\n\n  /** Override to return the number of packets sent */\n  getPacketSent: function () {\n    return null\n  },\n\n  /** Override to return a json with metrics */\n  getMetrics: function () {\n    return null\n  },\n\n  /** Override to return the audio codec */\n  getAudioCodec: function () {\n    return null\n  },\n\n  /** Override to return the video codec */\n  getVideoCodec: function () {\n    return null\n  },\n\n  /** Override to return a chunk or intermediate manifest url */\n  getURLToParse: function () {\n    return null\n  },\n\n  /**\n * Emits related event and set flags if current status is valid.\n * ie: won't sent start if isStarted is already true.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n * @param {bool} [convertFromBuffer=true] If false, will convert current buffer to seek.\n * @param {string} [triggeredEvent]\n */\n  fireSeekBegin: function (params, convertFromBuffer, triggeredEvent) {\n    // First, discard false buffers triggered by state changed before seek\n    this._discardFalseBuffers()\n    if (this.plugin && this.plugin.getIsLive() && this.plugin.options['content.isLive.noSeek']) return null\n    if (this.flags.isJoined && !this.flags.isSeeking) {\n      if (this.flags.isBuffering) {\n        if (convertFromBuffer !== false) {\n          Log.notice('Converting current buffer to seek')\n\n          this.chronos.seek = this.chronos.buffer.clone()\n          this.chronos.buffer.reset()\n\n          this.flags.isBuffering = false\n        } else {\n          return\n        }\n      } else {\n        this.chronos.seek.start()\n      }\n\n      try {\n        // Create new seek empty structure to add event to detect seek begins\n        this.fireEventsStruct.seek = []\n        if (triggeredEvent) {\n          this.fireEventsStruct.seek.push(triggeredEvent)\n        } else {\n          this.fireEventsStruct.seek.push('undefinedEvent')\n        }\n      } catch (e) {}\n\n      this.flags.isSeeking = true\n      this.emit(AdapterConstants.Event.SEEK_BEGIN, { params: params })\n    }\n  },\n\n  /**\n   * Emits related event and set flags if current status is valid.\n   * ie: won't sent start if isStarted is already true.\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   * @param {string} [triggeredEvent]\n   */\n  fireSeekEnd: function (params, triggeredEvent) {\n    if (this.plugin && this.plugin.getIsLive() && this.plugin.options['content.isLive.noSeek']) return null\n    if (this.flags.isJoined && this.flags.isSeeking) {\n      try {\n        // Add triggered event to detect buffer ends\n        if (triggeredEvent) {\n          this.fireEventsStruct.seek.push(triggeredEvent)\n        } else {\n          this.fireEventsStruct.seek.push('undefinedEvent')\n        }\n      } catch (e) {}\n\n      params = params || {}\n      params.triggeredEvents = this.fireEventsStruct.seek\n\n      this.cancelSeek()\n      this.emit(AdapterConstants.Event.SEEK_END, { params: params })\n    }\n  },\n\n  /**\n   *\n   * @param {Object} [params] Object of key:value params to add to the request.\n   */\n  cancelSeek: function (params) {\n    if (this.flags.isJoined && this.flags.isSeeking) {\n      this.flags.isSeeking = false\n\n      this.chronos.seek.stop()\n\n      if (this.monitor) this.monitor.skipNextTick()\n    }\n  },\n\n  /**\n * Emits event request.\n *\n * @param {Object} [params] Object of key:value params to add to the request.\n */\n  fireEvent: function (eventName, dimensions, values, topLevelDimensions) {\n    var returnparams = topLevelDimensions || {}\n    returnparams.name = eventName || ''\n    returnparams.dimensions = dimensions || {}\n    returnparams.values = values || {}\n    this.emit(AdapterConstants.Event.VIDEO_EVENT, { params: returnparams })\n  }\n}\n\nmodule.exports = AdapterContentMixin\n","var Emitter = require('../emitter')\nvar Log = require('../log')\nvar Util = require('../util')\nvar version = require('../version')\nvar PlaybackChronos = require('./playbackchronos')\nvar PlaybackFlags = require('./playbackflags')\nvar PlayheadMonitor = require('./playheadmonitor')\nvar StateMonitor = require('./statemonitor')\nvar AdapterConstants = require('../constants/adapter')\n\nvar Adapter = Emitter.extend(\n  /** @lends youbora.this.prototype */\n  {\n    /**\n     * Main Adapter class. All specific player adapters should extend this class specifying a player\n     * class.\n     *\n     * The Adapter works as the 'glue' between the player and YOUBORA acting both as event\n     * translator and as proxy for the {@link Plugin} to get info from the player.\n     *\n     * @constructs Adapter\n     * @extends youbora.Emitter\n     * @memberof youbora\n     *\n     * @param {object|string} player Either an instance of the player or a string containing an ID.\n     */\n    constructor: function (player) {\n      /** An instance of {@link FlagStatus} */\n      this.flags = new PlaybackFlags()\n\n      /** An instance of {@link ChronoStatus} */\n      this.chronos = new PlaybackChronos()\n\n      /** A dictionary to store the events fired */\n      this.fireEventsStruct = {}\n      this.fireEventsStruct.buffer = []\n      this.fireEventsStruct.seek = []\n\n      /** Reference to {@link PlayheadMonitor}. Helps the plugin detect buffers/seeks. */\n      this.monitor = null\n\n      /** Reference to {@link Plugin}. */\n      this.plugin = null\n\n      /** Reference to the player tag */\n      this.player = null\n\n      /** Defines if the adapter is used as adapter or adsAdapter */\n      this._isAdsAdapter = null\n\n      // Register player and event listeners\n      this.setPlayer(player)\n\n      /** Reference to the video/object tag, could be the same as the player. */\n      this.tag = this.player\n\n      Log.notice('Adapter ' + this.getVersion() + ' with Lib ' + version + ' is ready.')\n    },\n\n    /**\n     * Sets a new player, removes the old listeners if needed.\n     *\n     * @param {Object} player Player to be registered.\n     */\n    setPlayer: function (player) {\n      if (this.player) this.unregisterListeners()\n\n      if (typeof player === 'string' && typeof document !== 'undefined') {\n        this.player = document.getElementById(player)\n      } else {\n        this.player = player\n      }\n      this.registerListeners()\n    },\n\n    /**\n     * Override to create event binders.\n     * It's a good practice when implementing a new Adapter to create intermediate methods and call\n     * those when player events are detected instead of just calling the `fire*` methods. This\n     * will allow future users of the Adapter to customize its behaviour by overriding these\n     * methods.\n     *\n     * @example\n     * registerListeners: function () {\n     *  this.player.addEventListener('start', this.onStart.bind(this))\n     * },\n     *\n     * onStart: function (e) {\n     *  this.emit('start')\n     * }\n     */\n    registerListeners: function () {\n    },\n\n    /**\n     * Override to create event de-binders.\n     *\n     * @example\n     * registerListeners: function () {\n     *  this.player.removeEventListener('start', this.onStart)\n     * }\n     */\n    /** Unregister listeners to this.player. */\n    unregisterListeners: function () {\n    },\n\n    /**\n     * This function disposes the currend adapter, removes player listeners and drops references.\n     */\n    dispose: function () {\n      // Stop Monitor and Network monitor\n      this.stopMonitor()\n      this.stopReadyStateMonitor()\n      // Fire Stop\n      this.fireStop()\n      // Unregister listener\n      this.unregisterListeners()\n      this.player = null\n      this.tag = null\n    },\n\n    /**\n     * Creates a new {@link PlayheadMonitor} at this.monitor.\n     *\n     * @param {bool} monitorBuffers If true, it will monitor buffers.\n     * @param {bool} monitorSeeks If true, it will monitor seeks.\n     * @param {number} [interval=800] The interval time in ms.\n     */\n    monitorPlayhead: function (monitorBuffers, monitorSeeks, interval) {\n      this.stopMonitor()\n      var type = 0\n      if (monitorBuffers) type |= PlayheadMonitor.Type.BUFFER\n      if (monitorSeeks) type |= PlayheadMonitor.Type.SEEK\n\n      if (!this.monitor || !this.monitor._timer.isRunning) {\n        this.monitor = new PlayheadMonitor(this, type, interval)\n      } else {\n        this.monitor.skipNextTick()\n      }\n    },\n\n    stopMonitor: function () {\n      if (this.monitor) this.monitor.stop()\n    },\n\n    /**\n     *\n     * @param {number} [intervalMilliseconds=300]\n     */\n    monitorReadyState: function (intervalMilliseconds) {\n      this.stopReadyStateMonitor()\n      this.stateMonitor = new StateMonitor(this, intervalMilliseconds)\n    },\n\n    /**\n     * Start ReadyState monitor\n     */\n    startReadyStateMonitor: function () {\n      if (this.stateMonitor) this.stateMonitor.start()\n    },\n\n    /**\n     * Stop ReadyState monitor\n     */\n    stopReadyStateMonitor: function () {\n      if (this.stateMonitor) this.stateMonitor.stop()\n    },\n\n    /**\n     * Check readyState video properties\n     * @param readyState\n     * @param triggeredEvent\n     */\n    checkReadyState: function (readyState, triggeredEvent) {\n      try {\n        if (this.plugin && this.plugin.getReadyStateMonitorEnabled()) {\n          if (readyState) {\n            if (readyState > 3 && !this.flags.isSeeking) {\n              if (this.flags.isBuffering) {\n                this.fireBufferEnd({}, triggeredEvent + '-readyState')\n              } else if (!this.flags.isJoined) {\n                this.fireJoin({}, triggeredEvent + '-readyState')\n              }\n            } else if (readyState < 4 && !this.flags.isBuffering) {\n              this.fireBufferBegin({}, false, triggeredEvent + '-readyState', true)\n            }\n          }\n        }\n      } catch (e) {\n        Log.error('Can\\'t check readyState property correctly')\n      }\n    },\n\n    // GETTERS //\n\n    /** Override to return current playhead of the video */\n    getPlayhead: function () {\n      return null\n    },\n\n    /** Override to return video duration */\n    getDuration: function () {\n      return null\n    },\n\n    /** Override to return current bitrate */\n    getBitrate: function () {\n      return null\n    },\n\n    /** Override to return total downloaded bytes */\n    getTotalBytes: function () {\n      return null\n    },\n\n    /** Override to return title */\n    getTitle: function () {\n      return null\n    },\n\n    /** Override to return resource URL. */\n    getResource: function () {\n      return null\n    },\n\n    /** Override to return player version */\n    getPlayerVersion: function () {\n      return null\n    },\n\n    /** Override to return player's name */\n    getPlayerName: function () {\n      return null\n    },\n\n    /** Override to return adapter version. */\n    getVersion: function () {\n      return version + '-generic-js'\n    },\n\n    /** Override to return video object */\n    getVideoObject: function () {\n      return null\n    },\n\n    // FLOW //\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent init if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireInit: function (params, triggeredEvent) {\n      if (this.plugin) this.plugin.fireInit(params, triggeredEvent)\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireStart: function (params, triggeredEvent) {\n      if (this.plugin && this.plugin.backgroundDetector && this.plugin.backgroundDetector.canBlockStartCalls()) {\n        return null\n      }\n      if (!this.flags.isStarted) {\n        this.flags.isStarted = true\n        this.chronos.total.start()\n        this.chronos.join.start()\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n        this.startReadyStateMonitor()\n        this.emit(AdapterConstants.Event.START, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireJoin: function (params, triggeredEvent) {\n      if (!this.flags.isJoined && !this.flags.isStarted && !this._isAds() && this.plugin && this.plugin.isInitiated) {\n        this.fireStart({}, triggeredEvent)\n      }\n      if (this.flags.isStarted && !this.flags.isJoined) {\n        this.flags.isStarted = true\n        if (this.monitor) this.monitor.start()\n        this.flags.isJoined = true\n        this.chronos.join.stop()\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n        this.emit(AdapterConstants.Event.JOIN, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    firePause: function (params, triggeredEvent) {\n      // First, discard false buffers triggered by state changed before pause\n      this._discardFalseBuffers()\n      if (this.flags.isBuffering) {\n        this.fireBufferEnd(null, 'firePauseCall')\n      }\n      if (this.flags.isJoined && !this.flags.isPaused) {\n        this.flags.isPaused = true\n\n        this.chronos.pause.start()\n\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n\n        this.emit(AdapterConstants.Event.PAUSE, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireResume: function (params, triggeredEvent) {\n      // First, discard false buffers triggered by state changed before resume\n      this._discardFalseBuffers()\n      if (this.flags.isJoined && this.flags.isPaused) {\n        this.flags.isPaused = false\n\n        this.chronos.pause.stop()\n\n        if (this.monitor) this.monitor.skipNextTick()\n\n        if (triggeredEvent) {\n          params = params || {}\n          params.triggeredEvents = [triggeredEvent]\n        }\n\n        this.emit(AdapterConstants.Event.RESUME, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {boolean} [convertFromSeek=false] If true, will convert current seek to buffer.\n     * @param {string} [triggeredEvent]\n     * @param {boolean} [triggeredByStateProperty]\n     */\n    fireBufferBegin: function (params, convertFromSeek, triggeredEvent, triggeredByStateProperty) {\n      triggeredByStateProperty = triggeredByStateProperty || false\n      if (this.flags.isJoined && !this.flags.isBuffering) {\n        if (this.flags.isSeeking) {\n          if (convertFromSeek) {\n            Log.notice('Converting current buffer to seek')\n\n            this.chronos.buffer = this.chronos.seek.clone()\n            this.chronos.seek.reset()\n\n            this.flags.isSeeking = false\n          } else {\n            return\n          }\n        } else {\n          this.chronos.buffer.start()\n        }\n\n        try {\n          // Create new buffer empty structure to add event to detect buffer begins\n          this.fireEventsStruct.buffer = []\n          if (triggeredEvent) {\n            this.fireEventsStruct.buffer.push(triggeredEvent)\n          } else {\n            this.fireEventsStruct.buffer.push('undefinedEvent')\n          }\n        } catch (e) {}\n\n        this.flags.isBuffering = true\n        this.flags.isVideoStateBuffering = triggeredByStateProperty\n        this.emit(AdapterConstants.Event.BUFFER_BEGIN, { params: params })\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireBufferEnd: function (params, triggeredEvent) {\n      if (this.flags.isJoined && this.flags.isBuffering) {\n        try {\n          // Add triggered event to detect buffer ends\n          if (triggeredEvent) {\n            this.fireEventsStruct.buffer.push(triggeredEvent)\n          } else {\n            this.fireEventsStruct.buffer.push('undefinedEvent')\n          }\n        } catch (e) {}\n\n        params = params || {}\n        params.triggeredEvents = this.fireEventsStruct.buffer\n\n        this.cancelBuffer()\n        this.emit(AdapterConstants.Event.BUFFER_END, { params: params })\n      }\n    },\n\n    /**\n     * Discard false buffer events from state changed\n     * @private\n     */\n    _discardFalseBuffers: function () {\n      try {\n        if (this.flags.isBuffering && this.flags.isVideoStateBuffering && (this._getDeltaBufferTime() <= 100)) {\n          this.cancelBuffer()\n        }\n      } catch (e) {}\n    },\n\n    /**\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    cancelBuffer: function (params) {\n      if (this.flags.isJoined && this.flags.isBuffering) {\n        this.flags.isBuffering = false\n        this.flags.isVideoStateBuffering = false\n\n        this.chronos.buffer.stop()\n\n        if (this.monitor) this.monitor.skipNextTick()\n      }\n    },\n\n    /**\n     * Get Delta buffer time\n     * @returns {number|number|*}\n     * @private\n     */\n    _getDeltaBufferTime: function () {\n      if (this.chronos && this.chronos.buffer) {\n        return this.chronos.buffer.getDeltaTime(false)\n      }\n      return 0\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireStop: function (params, triggeredEvent) {\n      if (this._isAds() || (this.plugin && this.plugin._isStopReady())) {\n        if ((this._isAds() && this.flags.isStarted) ||\n          (!this._isAds() && (this.flags.isStarted || (this.plugin && this.plugin.isInitiated)))\n        ) {\n          // Stop Monitor and Network monitor\n          this.stopMonitor()\n          this.stopReadyStateMonitor()\n\n          this.flags.reset()\n          this.chronos.total.stop()\n          this.chronos.join.reset()\n          this.chronos.pause.stop()\n          this.chronos.buffer.stop()\n          this.chronos.seek.stop()\n\n          if (triggeredEvent) {\n            params = params || {}\n            params.triggeredEvents = [triggeredEvent]\n          }\n\n          this.emit(AdapterConstants.Event.STOP, { params: params })\n\n          this.chronos.pause.reset()\n          this.chronos.buffer.reset()\n          this.chronos.seek.reset()\n          this.chronos.viewedMax.splice(0, this.chronos.viewedMax.length)\n        }\n      }\n    },\n\n    setIsAds: function (value) {\n      this._isAdsAdapter = value\n    },\n\n    _isAds: function () {\n      return this._isAdsAdapter\n    },\n\n    /**\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {string} [triggeredEvent]\n     */\n    fireCasted: function (params, triggeredEvent) {\n      if (!params) params = {}\n      params.casted = true\n      this.fireStop(params, triggeredEvent)\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @param {string} [triggeredEvent]\n     */\n    fireError: function (code, msg, metadata, level, triggeredEvent) {\n      var params = Util.buildErrorParams(code, msg, metadata, level)\n      if (params.code) {\n        delete params.code\n      }\n      if (triggeredEvent) {\n        params = params || {}\n        params.triggeredEvents = [triggeredEvent]\n      }\n      var options = this.plugin ? this.plugin.options : {}\n      if (typeof params.errorCode !== 'undefined' && options['errors.ignore'] &&\n      options['errors.ignore'].indexOf(params.errorCode.toString()) > -1) {\n        // ignore error\n      } else {\n        this.emit(AdapterConstants.Event.ERROR, { params: params })\n        if (typeof params.errorCode !== 'undefined' && options['errors.fatal'] &&\n          options['errors.fatal'].indexOf(params.errorCode.toString()) > -1) {\n          this.fireStop({}, triggeredEvent)\n        }\n      }\n    },\n\n    /**\n     * Emits related event and set flags if current status is valid.\n     * ie: won't sent start if isStarted is already true.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @param {string} [triggeredEvent]\n     */\n    fireFatalError: function (code, msg, metadata, level, triggeredEvent) {\n      var options = this.plugin ? this.plugin.options : {}\n      if (typeof code !== 'undefined' && options['errors.ignore'] &&\n      options['errors.ignore'].indexOf(code.toString()) > -1) {\n        // ignore error\n      } else {\n        if (this.monitor) this.monitor.stop()\n        this.fireError(code, msg, metadata, level, triggeredEvent)\n        if (typeof code !== 'undefined' && options['errors.nonFatal'] &&\n          options['errors.nonFatal'].indexOf(code.toString()) > -1) {\n          // no stop\n        } else {\n          this.fireStop({}, triggeredEvent)\n        }\n      }\n    }\n  },\n  {\n    /** @lends youbora.Adapter */\n    // Static Memebers //\n\n    /**\n     * List of events that could be fired\n     * @enum\n     * @event\n     */\n    Event: AdapterConstants.Event\n  }\n)\n\nUtil.assign(Adapter.prototype, require('./adapter+ads'))\nUtil.assign(Adapter.prototype, require('./adapter+content'))\n\nmodule.exports = Adapter\n","var YouboraObject = require('../object')\nvar Chrono = require('../chrono')\n\nvar PlaybackChronos = YouboraObject.extend(\n  /** @lends youbora.PlaybackChronos.prototype */\n  {\n    /**\n     * This class contains all the {@link Chrono}s related to view status.\n     * Chronos measure time lapses between events.\n     * ie: between start and join, between seek-begin and seek-end, etc.\n     * Each plugin will have an instance of this class.\n     *\n     * @constructs PlaybackChronos\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset flag values */\n    reset: function () {\n      /** Chrono between start and joinTime. */\n      this.join = new Chrono()\n\n      /** Chrono between seek-begin and seek-end. */\n      this.seek = new Chrono()\n\n      /** Chrono between pause and resume. */\n      this.pause = new Chrono()\n\n      /** Chrono between buffer-begin and buffer-end. */\n      this.buffer = new Chrono()\n\n      /** Chrono for the totality of the view. */\n      this.total = new Chrono()\n\n      // For ads\n\n      /** List of chronos with seen intervals */\n      this.viewedMax = []\n    }\n  }\n)\n\nmodule.exports = PlaybackChronos\n","var YouboraObject = require('../object')\n\nvar PlaybackFlags = YouboraObject.extend(\n  /** @lends youbora.PlaybackFlags.prototype */\n  {\n    /**\n     * This class contains all the flags related to view status.\n     * Each plugin will have an instance of this class.\n     *\n     * @constructs PlaybackFlags\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset flag values */\n    reset: function () {\n      /** Flag when Start has been sent. */\n      this.isStarted = false\n\n      /** Flag when Join has been sent. */\n      this.isJoined = false\n\n      /** Flag when Player is paused. */\n      this.isPaused = false\n\n      /** Flag when Player is seeking. */\n      this.isSeeking = false\n\n      /** Flag when Player is buffering. */\n      this.isBuffering = false\n\n      /** Flag when Player is buffering by video state. */\n      this.isVideoStateBuffering = false\n\n      /** Flag when Player is ended. */\n      this.isEnded = false\n\n      /** Flag when Player view ends and stop is already sent. */\n      this.isStopped = false\n\n      /** Flag with last quartile sent. */\n      this.lastQuartileSent = 0\n    }\n  }\n)\n\nmodule.exports = PlaybackFlags\n","var YouboraObject = require('../object')\nvar Timer = require('../timer')\nvar Chrono = require('../chrono')\n\nvar PlayheadMonitor = YouboraObject.extend(\n  /** @lends youbora.PlayheadMonitor.prototype */\n  {\n    /**\n     * This class periodically checks the player's playhead in order to infer buffer and/or seek\n     * events.\n     *\n     * Instances of this class are bounded to an {@link Adapter} and fires its buffer and seek\n     * start and end methods.\n     *\n     * In order to use this feature, {@link Adapter#monitorPlayhead} should be used.\n     *\n     * @constructs PlayheadMonitor\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Adapter} adapter Adapter to monitor. Must have getPlayhead defined.\n     * @param {PlayheadMonitor.Type} [type=NONE]\n     * Which metric to monitor seek and/or buffer.\n     * Use bitwise operators to join both values (Type.BUFFER | Type.SEEK)\n     * @param {int} [interval=800] How many ms will wait between progress. -1 to disable.\n     */\n    constructor: function (adapter, type, interval) {\n      this._adapter = adapter\n      this._seekEnabled = type & PlayheadMonitor.Type.SEEK\n      this._bufferEnabled = type & PlayheadMonitor.Type.BUFFER\n      interval = interval || 800\n\n      this._chrono = new Chrono()\n      this._lastPlayhead = 0\n\n      if (interval > 0) {\n        this._timer = new Timer(this.progress.bind(this), interval)\n      }\n    },\n\n    /**\n     * Start interval checks.\n     */\n    start: function () {\n      this.stop()\n      if (this.canBeUsed()) this._timer.start()\n    },\n\n    /**\n     * Stop interval checks.\n     */\n    stop: function () {\n      this._lastPlayhead = 0\n      if (this._timer) this._timer.stop()\n    },\n\n    skipNextTick: function () {\n      this._lastPlayhead = 0\n    },\n\n    /**\n     * Call this method at every tick of timeupdate/progress.\n     * If you defined an interval, do not fire this method manually.\n     */\n    progress: function () {\n      // Reset timer\n      var deltaTime = this._chrono.stop()\n      this._chrono.start()\n\n      // Define thresholds\n      var bufferThreshold = deltaTime * PlayheadMonitor.kBUFFER_THRESHOLD_RATIO\n      var seekThreshold = deltaTime * PlayheadMonitor.kSEEK_THRESHOLD_RATIO\n\n      if (this._adapter.getPlayrate && this._adapter.getPlayrate() && this._adapter.getPlayrate() !== 1) {\n        bufferThreshold *= this._adapter.getPlayrate()\n        seekThreshold *= this._adapter.getPlayrate()\n      }\n\n      // Calculate diff playhead\n      var currentPlayhead = this._getPlayhead()\n      var diffPlayhead = Math.abs(this._lastPlayhead - currentPlayhead) * 1000\n\n      // youbora.Log.debug('curr: ' + currentPlayhead + ' last: ' + this._lastPlayhead + ' diff: ' + diffPlayhead)\n\n      if (diffPlayhead < bufferThreshold) {\n        // Playhead is stalling > buffer\n        if (this._bufferEnabled &&\n          this._lastPlayhead > 0 &&\n          !this._adapter.flags.isPaused &&\n          !this._adapter.flags.isSeeking\n        ) {\n          this._adapter.fireBufferBegin(null, false, 'playheadMonitor')\n        }\n      } else if (diffPlayhead > seekThreshold) {\n        // Playhead has jumped > seek\n        if (this._seekEnabled && this._lastPlayhead > 0) {\n          this._adapter.fireSeekBegin(null, false, 'playheadMonitor')\n        }\n      } else {\n        // Healthy\n        if (this._seekEnabled) {\n          this._adapter.fireSeekEnd(null, 'playheadMonitor')\n        }\n        if (this._bufferEnabled) {\n          this._adapter.fireBufferEnd(null, 'playheadMonitor')\n        }\n      }\n\n      // Update Playhead\n      this._lastPlayhead = currentPlayhead\n    },\n\n    /**\n     * Returns if the monitor can be used or not.\n     * Enabled by default, except the case where the content is live and the option 'content.isLive.noMonitor' is true.\n     * @public\n     * @returns {boolean} If the monitor can be used or not.\n     */\n    canBeUsed: function () {\n      var plugin = this._adapter.plugin\n      if (plugin && plugin.getPlayheadMonitorEnabled() && (this._seekEnabled || this._bufferEnabled)) {\n        return plugin.getIsLive() ? !plugin.options['content.isLive.noMonitor'] : true\n      } else {\n        return false\n      }\n    },\n\n    /**\n     * Returns adapter's playhead. Override to add a custom playhead getter.\n     * @private\n     * @returns {double} Playhead in seconds\n     */\n    _getPlayhead: function () {\n      return this._adapter.getPlayhead()\n    }\n  },\n  /** @lends youbora.PlayheadMonitor */\n  {\n    // Static methods\n\n    /**\n     * Enum for monitoring type\n     * @enum\n     */\n    Type: {\n      /** Would not monitor */\n      NONE: 0,\n      /** Sends buffer-begin/end */\n      BUFFER: 1,\n      /** Sends seek-begin/end */\n      SEEK: 2\n    },\n\n    /** Buffer threshold */\n    kBUFFER_THRESHOLD_RATIO: 0.5,\n\n    /** Seek threshold */\n    kSEEK_THRESHOLD_RATIO: 2\n  })\n\nmodule.exports = PlayheadMonitor\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar StateMonitor = YouboraObject.extend(\n  /** @lends youbora.NetworkMonitor.prototype */\n  {\n    /**\n     * @constructs StateMonitor\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Adapter} adapter Adapter to monitor. Must have getVideoObject defined.\n     * @param {int} [intervalMilliseconds=300] How many ms will wait between progress. -1 to disable.\n     */\n    constructor: function (adapter, intervalMilliseconds) {\n      this._adapter = adapter\n      this._videoElement = adapter.getVideoObject()\n      this._startedStateCheck = false\n      this._intervalCheckId = null\n      this._intervalMilliseconds = intervalMilliseconds || 300\n    },\n\n    /**\n     * Start Network monitor\n     */\n    start: function () {\n      var plugin = this._adapter.plugin\n      if (plugin && plugin.getReadyStateMonitorEnabled()) {\n        if (this._videoElement && !this._startedStateCheck) {\n          this._intervalCheckId = setInterval(this.checkStateProperty.bind(this), this._intervalMilliseconds)\n          this._startedStateCheck = true\n        }\n      }\n    },\n\n    /**\n     * Stop Network monitor\n     */\n    stop: function () {\n      try {\n        if (this._startedStateCheck && this._intervalCheckId) {\n          clearInterval(this._intervalCheckId)\n        }\n        this._intervalCheckId = null\n        this._startedStateCheck = false\n      } catch (e) {\n        Log.error('Produced error stopping the network monitor')\n      }\n    },\n\n    /**\n     * Check ReadyState properties values\n     * @param e\n     */\n    checkStateProperty: function (e) {\n      try {\n        if (this._videoElement && this._adapter) {\n          if (this._videoElement.readyState) {\n            if (this._videoElement.readyState > 3 && !this._adapter.flags.isSeeking) {\n              if (this._adapter.flags.isBuffering) {\n                this.fireBufferEnd({}, 'stateMonitor')\n              } else if (!this._adapter.flags.isJoined) {\n                this.fireJoin({}, 'stateMonitor')\n              }\n            } else if (this._videoElement.readyState < 4 && !this._adapter.flags.isBuffering) {\n              this.fireBufferBegin({}, false, 'stateMonitor', true)\n            }\n          }\n        }\n      } catch (e) {}\n    }\n  })\n\nmodule.exports = StateMonitor\n","var YouboraObject = require('./object')\n\nvar Chrono = YouboraObject.extend(\n  /** @lends youbora.Chrono.prototype */\n  {\n    /**\n     * This class calculates time lapses between two points in time.\n     *\n     * @constructs Chrono\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function () {\n      this.reset()\n    },\n\n    /** Reset chrono values. */\n    reset: function () {\n      /** Start time */\n      this.startTime = 0\n\n      /** Stop time */\n      this.stopTime = 0\n\n      /** Pause time */\n      this.pauseTime = 0\n\n      /** Offset to be added to deltaTime and stop. in ms. */\n      this.offset = 0\n    },\n\n    /**\n     * Returns the time between start() and the last stop() in ms. Returns -1 if start wasn't\n     * called.\n     * @param {boolean} [stop=true] If true, it will force a stop() if it wasn't called before.\n     * @return {number} Time lapse in ms.\n     */\n    getDeltaTime: function (stop) {\n      var retValue = -1\n      var now = new Date().getTime()\n      if (this.startTime) {\n        if (stop && !this.stopTime) {\n          this.stopTime = now\n        }\n        var tempOffset = this.pauseTime ? now - this.pauseTime : 0\n        var tempStop = this.stopTime ? this.stopTime : now\n        retValue = (this.offset - tempOffset) + (tempStop - this.startTime)\n      }\n      return retValue\n    },\n\n    /**\n     * Starts the chrono.\n     */\n    start: function () {\n      this.startTime = new Date().getTime()\n      this.stopTime = 0\n      this.offset = 0\n    },\n\n    /**\n     * Stops the timer and returns current delta time.\n     * @return {number} Returns the delta time\n     */\n    stop: function () {\n      if (this.pauseTime) this.resume()\n      this.stopTime = new Date().getTime()\n      return this.startTime ? this.offset + (this.stopTime - this.startTime) : -1\n    },\n\n    pause: function () {\n      this.pauseTime = new Date().getTime()\n    },\n\n    resume: function () {\n      this.offset -= (new Date().getTime() - this.pauseTime)\n      this.pauseTime = 0\n    },\n\n    /**\n     * Creates a copy of the chrono.\n     */\n    clone: function () {\n      var chrono = new Chrono()\n      chrono.startTime = this.startTime\n      chrono.stopTime = this.stopTime\n      chrono.offset = this.offset\n      return chrono\n    }\n  }\n)\n\nmodule.exports = Chrono\n","var YouboraObject = require('../object')\nvar Log = require('../log')\nvar YBRequest = require('./request')\nvar Transform = require('./transform/transform')\n\nvar Communication = YouboraObject.extend(\n  /** @lends youbora.Communication.prototype */\n  {\n    /**\n     * Youbora Communication implements an abstraction layer over API requests.\n     * Internally, Communication implements queues of {@link Request} objects.\n     * This queue can be blocked using {@link Transform}\n     *\n     * @constructs Communication\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {string} host The fastdata host address.\n     * @param {boolean} httpSecure True for https, false for http, undefined for //.\n     */\n    constructor: function (pluginref) {\n      /** Array of {@link Transform}, only when the array is empty the request Queues will begin sending. */\n      this.transforms = []\n      this.pluginRef = pluginref\n      /**\n       * Queue of {@link YBRequest}\n       * @private\n       */\n      this._requests = []\n    },\n\n    /**\n     * Enqueues the request provided.\n     *\n     * @param {YBRequest} request Request to be enqueued\n     * @param {function} [callback] The defined load callback to the Request\n     */\n    sendRequest: function (request, callback, callbackParams) {\n      if (request) {\n        if (typeof callback === 'function') request.on(YBRequest.Event.SUCCESS, callback, callbackParams)\n        this._registerRequest(request)\n      }\n    },\n\n    /**\n     * Build a generic request to the given host.\n     *\n     * @param {string} host Host of the service called.\n     * @param {string} service A string with the service to be called. ie: '/data', '/joinTime'...\n     * @param {Object} [params] Object of key:value params.\n     * @param {function} [callback] The defined load callback to the Request\n     */\n    buildRequest: function (host, service, params, callback) {\n      params = params || {}\n      var request = new YBRequest(host, service, params)\n      if (typeof callback === 'function') request.on(YBRequest.Event.SUCCESS, callback)\n      this._registerRequest(request)\n    },\n\n    /**\n     * Adds a Transform to the queue. See {@link Transform}.\n     *\n     * @param {RequestTransform} transform\n     */\n    addTransform: function (transform) {\n      if (transform.parse && transform.isBlocking) {\n        this.transforms.push(transform)\n        transform.on(Transform.Event.DONE, this._processRequests.bind(this))\n      } else {\n        Log.warn(transform + ' is not a valid RequestTransform.')\n      }\n    },\n\n    /**\n     * Removes a {@link Transform}.\n     *\n     * @param {RequestTransform} transform Transform object to remove.\n     */\n    removeTransform: function (transform) {\n      var pos = this.transforms.indexOf(transform)\n      if (pos !== -1) {\n        this.transforms.splice(pos, 1)\n      } else {\n        Log.warn('Trying to remove unexisting Transform \\'' + transform + '\\'.')\n      }\n    },\n\n    /**\n     * Adds an {@link YBRequest} to the queue of requests.\n     *\n     * @private\n     * @param {YBRequest} request The Request to be queued.\n     */\n    _registerRequest: function (request) {\n      if (this.pluginRef) {\n        var options = this.pluginRef.options\n        if (options.authToken) {\n          request.options.requestHeaders.Authorization = options.authType + ' ' + options.authToken\n        }\n      }\n      this._requests.push(request)\n      this._processRequests()\n    },\n\n    /**\n     * Execute pending requests in the queue. Returns rejected ones to the queue.\n     * @private\n     */\n    _processRequests: function () {\n      var workingQueue = this._requests\n      this._requests = []\n\n      var rejected = []\n      while (workingQueue.length) {\n        var request = workingQueue.shift()\n        var transformState = this._transform(request)\n        if (transformState === Transform.STATE_NO_BLOCKED) {\n          if (this.pluginRef) request.host = this.pluginRef.getHost()\n          request.send()\n        } else if (transformState === Transform.STATE_BLOCKED) {\n          rejected.push(request)\n        } // else { remove }\n      }\n\n      while (rejected.length) {\n        this._requests.push(rejected.shift())\n      }\n    },\n\n    /**\n     * Pass the given request to each transform.\n     * @private\n     * @returns {int} STATE_NO_BLOCKED if everything is right. STATE_BLOCKED if some parser rejected it.\n     * STATE_OFFLINE if offline transform blocked it.\n     */\n    _transform: function (request) {\n      var ret = Transform.STATE_NO_BLOCKED\n      this.transforms.forEach(function (transform) {\n        if (transform.isBlocking(request)) {\n          ret = Transform.STATE_BLOCKED\n          return\n        } else {\n          transform.parse(request)\n        }\n        if (transform.getState() === Transform.STATE_OFFLINE) {\n          ret = Transform.STATE_OFFLINE\n        }\n      })\n      return ret\n    }\n  })\n\nmodule.exports = Communication\n","/* global  atv, XMLHttpRequest, ActiveXObject */\nvar YouboraObject = require('../object')\nvar Log = require('../log')\nvar Util = require('../util')\n\nvar YBRequest = YouboraObject.extend(\n  /** @lends youbora.YBRequest.prototype */\n  {\n    /**\n     * YBYBRequest class will wrap XmlHttpRequest and extend its functionality, allowing youbora\n     * to manage queues, blockers and retries.\n     *\n     * @constructs YBRequest\n     * @extends youbora.Object\n     * @memberof youbora\n     *\n     * @param {string} host URL of the request. ie: a-fds.youborafds01.com\n     * @param {string} [service] Name of the service. ie '/start'\n     * @param {Object} [params] Object of key:value params.\n     * @param {Object} [options] Object with custom options.\n     * @param {string} [options.method=\"GET\"] Specifies the method of the request. ie: \"GET\", \"HEAD\".\n     * @param {string} [options.requestHeaders] Object with options of requestHeaders.\n     * ie: { header: value }.\n     * @param {number} [options.retryAfter=5000] Time in ms before sending a failed request again.\n     * 0 to disable.\n     * @param {number} [options.maxRetries=3] Max number of retries. 0 to disable.\n     * @param {bool} [options.cache=false] If false, timestamp will be added to each request to\n     * prevent caching.\n     */\n    constructor: function (host, service, params, options) {\n      /** Instance of XmlHttpRequest (or the item returned by createXHR method). */\n      this.xhr = this.createXHR()\n\n      /** Host of the request */\n      this.host = host || ''\n\n      /** Service of the request */\n      this.service = service || ''\n\n      /** Object of params of the request */\n      this.params = params || {}\n\n      /** Options of the current request */\n      this.options = Util.assign({}, YBRequest.defaultOptions, options)\n\n      /** Number of times this request has failed and retried. */\n      this.retries = 0\n\n      /** Define if plugin has enabled to send requests with POST method */\n      this.sendPostRequest = false\n      this.preparedPostRequest = false\n\n      // Add timemark\n      if (!this.options.cache) {\n        this.setParam('timemark', new Date().getTime())\n      }\n    },\n\n    /**\n     * Creates XMLHttpRequest if it is available in the browser.\n     * If not, it tries to create an ActiveXObject XMLHTTP item.\n     * Override this function for custom environments.\n     *\n     * @return YBRequest handler.\n     */\n    createXHR: function () {\n      var xhr = {}\n      try {\n        if (XMLHttpRequest) {\n          xhr = new XMLHttpRequest()\n        } else {\n          xhr = new ActiveXObject('Microsoft.XMLHTTP')\n        }\n      } catch (err) {\n        Log.error(err)\n      }\n      return xhr\n    },\n\n    /**\n     * Returns xhr object.\n     *\n     * @return {XmlHttpRequest} object.\n     */\n    getXHR: function () {\n      return this.xhr\n    },\n\n    getResponse: function () {\n      return this.xhr.response\n    },\n\n    getResponseText: function () {\n      return this.xhr.responseText\n    },\n\n    getResponseHeaders: function () {\n      return this.xhr.getAllResponseHeaders()\n    },\n\n    /** Returns the complete formed url of the request url+service+params. */\n    getUrl: function () {\n      return this.host + this.service + this.getParamString()\n    },\n\n    /**\n     * Wraps this.getHXR.addEventListener.\n     * Accepts a callback that receives (this YBRequest, event)\n     */\n    on: function (event, callback, callbackParams) {\n      if (this.xhr.addEventListener) {\n        this.xhr.addEventListener(event, callback.bind(this, this, callbackParams))\n      } else {\n        if (event === YBRequest.Event.SUCCESS) {\n          this.xhr.onreadystatechange = function () {\n            if (this.xhr.readyState === 4) {\n              callback.bind(this, this, callbackParams)\n            }\n          }.bind(this)\n        }\n      }\n      return this\n    },\n\n    /** Wraps this.getHXR.removeEventListener */\n    off: function (event, callback) {\n      this.xhr.removeEventListener(event, callback)\n      return this\n    },\n\n    /**\n     * Returns the params of the request, stringified.\n     * ie: '?pluginVersion=5.1.0&systemCode=nicetv'.\n     * @return {string} Concatenated Params\n     */\n    getParamString: function () {\n      try {\n        var params = '?'\n        for (var key in this.params) {\n          var param = this.params[key]\n          if (param !== null && typeof param === 'object') {\n            var string = JSON.stringify(param)\n            if (string !== '{}') {\n              params += encodeURIComponent(key) + '=' + encodeURIComponent(string) + '&'\n            }\n          } else if (param !== null && typeof param !== 'undefined' && param !== '') {\n            params += encodeURIComponent(key) + '=' + encodeURIComponent(param) + '&'\n          }\n        }\n        return params.slice(0, -1)\n      } catch (err) {\n        Log.error(err)\n        return ''\n      }\n    },\n\n    /**\n     * Returns the value of the given param, or undefined.\n     * @param {string} key Name of the param.\n     * @return {any}\n     */\n    getParam: function (key) {\n      return this.params[key]\n    },\n\n    /**\n     * Add or set a parameter for the request.\n     * ie: if you want to add 'username=user' use setParam('username', 'user').\n     * @param {string} key Name of the param.\n     * @param {string} value Name of the param.\n     * @return this\n     */\n    setParam: function (key, value) {\n      this.params[key] = value\n      return this\n    },\n\n    setBody: function (body) {\n      this.body = body\n    },\n\n    /**\n     * Set if is enabled send requests with POST method\n     * @param {boolean} sendPostRequest\n     */\n    setPostRequest: function (sendPostRequest) {\n      this.sendPostRequest = sendPostRequest\n    },\n\n    /**\n     * Create Params object with the basic get params we need to send to the Data Collector nodes\n     * @returns {{}}\n     */\n    getParamsForPostMessages: function () {\n      // Creating empty params object\n      var params = {}\n      try {\n        // Get previous params\n        var timemark = this.getParam('timemark')\n        var code = this.getParam('code')\n        var sessionRoot = this.getParam('sessionRoot')\n        var sessionId = this.getParam('sessionId')\n        // Adding params\n        if (timemark) {\n          params.timemark = timemark\n        }\n        if (code) {\n          params.code = code\n        }\n        if (sessionRoot) {\n          params.sessionRoot = sessionRoot\n        }\n        if (sessionId) {\n          params.sessionId = sessionId\n        }\n      } catch (err) {\n        Log.error(err)\n      }\n      return params\n    },\n\n    /**\n     * Sends the request.\n     *\n     * @return returns xhr.send()\n     */\n    send: function () {\n      try {\n        try {\n          if (this.sendPostRequest && !this.preparedPostRequest) {\n            this.options.method = 'POST'\n            this.body = JSON.stringify(this.params)\n            this.params = this.getParamsForPostMessages()\n            this.preparedPostRequest = true\n          }\n        } catch (err) {}\n\n        this.xhr.open(this.options.method, this.getUrl(), true)\n\n        // Add custom headers\n        if (this.options.requestHeaders) {\n          for (var key in this.options.requestHeaders) {\n            if (this.options.requestHeaders.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n              this.xhr.setRequestHeader(key, this.options.requestHeaders[key])\n            }\n          }\n        }\n\n        // Add retries system\n        if (this.options.retryAfter > 0 && this.options.maxRetries > 0) {\n          var genericError = function () {\n            if (this.retries >= this.options.maxRetries) {\n              Log.error('Aborting failed request \"' + this.service + '\". Max retries reached.')\n            } else {\n              Log.warn('YBRequest \"' + this.service + '\" failed. Retry ' + (this.retries + 1) + ' of ' +\n                this.options.maxRetries + ' in ' + this.options.retryAfter + 'ms.')\n              try {\n                setTimeout(function () {\n                  this.retries += 1\n                  this.send()\n                }.bind(this), this.options.retryAfter)\n              } catch (err) {\n                if (typeof atv !== 'undefined') {\n                  atv.setTimeout(function () {\n                    this.retries += 1\n                    this.send()\n                  }.bind(this), this.options.retryAfter)\n                } else {\n                  Log.error(err)\n                }\n              }\n            }\n          }\n          if (this.retries === 0) {\n            this.on(YBRequest.Event.ERROR, genericError.bind(this))\n          }\n        }\n\n        // Log XHR\n        if (Log.logLevel <= Log.Level.VERBOSE) {\n          Log.verbose('XHR Req: ' + this.getUrl())\n        }\n\n        // Register 'on every' listeners\n        for (var event in YBRequest._globalListeners) {\n          YBRequest._globalListeners[event].forEach(function (callback) {\n            this.on(event, callback)\n          }.bind(this))\n        }\n\n        // Send\n        return this.xhr.send(this.body)\n      } catch (err) {\n        Log.error(err)\n      }\n    }\n  },\n\n  /** @lends youbora.YBRequest */\n  {\n    /**\n     * List of events that could be fired from XHR\n     * @enum\n     */\n    Event: {\n      /** Request successful */\n      SUCCESS: 'load',\n      /** Request successful */\n      LOAD: 'load', // Native JS\n      /** Request returned error */\n      ERROR: 'error',\n      /** Request aborted */\n      ABORT: 'abort'\n    },\n\n    /**\n     * This static property includes the default values for the options. In case you do not define\n     * one of them in the constructor, these values will be used instead.\n     *\n     * @param {string} [defaultOptions.method=\"GET\"] Specifies the method of the request.\n     * ie: \"GET\", \"HEAD\".\n     * @param {string} [defaultOptions.requestHeaders] Object with options of requestHeaders.\n     * ie: { header: value }.\n     * @param {number} [defaultOptions.retryAfter=5000] Time in ms before sending a failed request\n     * again. 0 to disable.\n     * @param {number} [defaultOptions.maxRetries=3] Max number of retries. 0 to disable.\n     * @param {bool} [defaultOptions.cache=false] If false, timemark will be added to each request\n     * to prevent caching.\n     */\n    defaultOptions: {\n      method: 'GET',\n      requestHeaders: {},\n      maxRetries: 3,\n      retryAfter: 5000,\n      cache: false\n    },\n\n    /** @private */\n    _globalListeners: {},\n\n    /**\n     * Adds a callback to every instance.\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     */\n    onEvery: function (event, callback) {\n      YBRequest._globalListeners[event] = YBRequest._globalListeners[event] || []\n      YBRequest._globalListeners[event].push(callback)\n    },\n\n    /**\n     * Removes a global callback\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     */\n    offEvery: function (event, callback) {\n      if (YBRequest._globalListeners[event]) {\n        var index = YBRequest._globalListeners[event].indexOf(callback)\n        if (index !== -1) {\n          YBRequest._globalListeners[event].splice(index, 1)\n        }\n      }\n    }\n  })\n\nmodule.exports = YBRequest\n","var Transform = require('./transform')\nvar Constants = require('../../constants')\n\n/**\n * This transform ensures that no requests will be sent before an /init or /start request.\n * As these are the two possible first requests that the API expects for a view.\n *\n * @constructs\n * @extends youbora.Transform\n * @memberof youbora\n * @name FlowTransform\n *\n * @param {Plugin} plugin Instance of {@link Plugin}\n */\nvar FlowTransform = Transform.extend(\n  /** @lends youbora.FlowTransform.prototype */\n  {\n    _services: [Constants.Service.INIT, Constants.Service.START, Constants.Service.OFFLINE_EVENTS],\n    /**\n     * Returns if transform is blocking.\n     *\n     * @param {YBRequest} request Request to transform.\n     * @return {bool} True if queue shall be blocked.\n     */\n    isBlocking: function (request) {\n      if (this._isBusy && request != null) {\n        if (this._services.indexOf(request.service) !== -1) {\n          this.done()\n        } else if (request.service === Constants.Service.ERROR) {\n          return false\n        }\n      }\n      return Transform.prototype.isBlocking.apply(this, arguments)\n    }\n  }\n)\n\nmodule.exports = FlowTransform\n","var Transform = require('./transform')\n\nvar OfflineTransform = Transform.extend(\n  /** @lends youbora.OfflineTransform.prototype */\n  {\n    /**\n     * This class manages Fastdata service and view index.\n     *\n     * @constructs\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     * @param {string} session If provided, plugin will use this as a FD response.\n     */\n    constructor: function (plugin, session) {\n      this._sendRequest = false\n      this._isBusy = false\n      this.plugin = plugin\n      this.session = session\n      this.transformName = 'Offline'\n    },\n\n    /**\n     * Transform requests\n     * @param {youbora.comm.YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      if (request && this.plugin.offlineStorage) {\n        this.plugin.offlineStorage.addEvent(request.service, request.params)\n      }\n    },\n\n    hasToSend: function (request) {\n      return false\n    },\n\n    getState: function () {\n      return Transform.STATE_OFFLINE\n    }\n\n  })\n\nmodule.exports = OfflineTransform\n","/* global atv */\nvar Transform = require('./transform')\nvar HlsParser = require('./resourceparsers/formatparsers/hlsparser')\nvar CdnParser = require('./resourceparsers/cdnparser')\nvar CdnSwitch = require('./resourceparsers/cdnSwitch')\nvar DashParser = require('./resourceparsers/formatparsers/dashparser')\nvar Parser = require('./resourceparsers/formatparsers/parser')\nvar LocationheaderParser = require('./resourceparsers/formatparsers/locationheaderparser')\nvar Log = require('../../log')\nvar Constants = require('../../constants')\n\nvar ResourceTransform = Transform.extend(\n  /** @lends youbora.ResourceTransform.prototype */\n  {\n    /**\n     * This class parses resource to fetch HLS transportstreams and CDN-related info.\n     *\n     * @constructs ResourceTransform\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     */\n    constructor: function (plugin) {\n      ResourceTransform.__super__.constructor.apply(this, arguments)\n\n      this._plugin = plugin\n      this._realResource = null\n      this._transportFormat = null\n      this._initResource = null\n      this._cdnName = null\n      this._cdnNodeHost = null\n      this._cdnNodeTypeString = null\n      this._cdnNodeType = null\n      this._responses = {}\n      this._isBusy = false\n\n      this.transformName = 'Resource'\n    },\n\n    /**\n     * Get the resource. If the transform is done, the real (parsed) resource will be returned\n     * Otherwise the initial one is returned.\n     *\n     * @return {string} The initial or parsed resource\n     */\n    getResource: function () {\n      return this._realResource\n    },\n\n    _getInitialCdnResource: function () {\n      return this._realResource || this._initResource\n    },\n\n    /**\n     * Get the transport format. If the transform detected the chunk format it will be returned, if not, null.\n     *\n     * @return {string} The streaming protocol\n     */\n    getTransportFormat: function () {\n      return this._transportFormat\n    },\n\n    /**\n     * Get the parsed CDN name.\n     *\n     * @return {string} The CDN name or null if unknown\n     */\n    getCdnName: function () {\n      return this._cdnName\n    },\n\n    /**\n     * Get the parsed CDN node.\n     *\n     * @return {string} The CDN node or null if unknown\n     */\n    getNodeHost: function () {\n      return this._cdnNodeHost\n    },\n\n    /**\n     * Get the parsed CDN type string, as returned in the cdn header response.\n     *\n     * @return {string} The CDN type string\n     */\n    getNodeTypeString: function () {\n      return this._cdnNodeTypeString\n    },\n\n    /**\n     * Get the parsed CDN type, parsed from the type string.\n     *\n     * @return {string} The CDN type\n     */\n    getNodeType: function () {\n      return this._cdnNodeType\n    },\n\n    /**\n     * Start the execution. Can be called more than once. If already running, it will be ignored,\n     * if ended it will restart.\n     * @param {string} resource the original resource\n     */\n    init: function (resource) {\n      if (!resource) {\n        this.done()\n        return\n      }\n      if (!this._isBusy) {\n        this._isBusy = true\n        this._initResource = resource\n        this._parseManifestEnabled = this._plugin.isParseManifest()\n        this._cdnEnabled = this._plugin.isParseCdnNode()\n        this._cdnList = this._plugin.getParseCdnNodeList().slice() // clone\n        CdnParser.setBalancerHeaderName(this._plugin.getParseCdnNodeNameHeader(), this._plugin.getParseNodeHeader())\n\n        this._setTimeout()\n        if (this._parseManifestEnabled) {\n          if (!this._isFinalUrl(this._initResource)) {\n            this.parseManifest() // Unknown lastManifest or lastSrc, call without arguments\n          } else {\n            this._realResource = this._initResource\n            this.done()\n          }\n        } else {\n          this._parseCDN()\n        }\n      }\n    },\n\n    _isFinalUrl: function (url) {\n      var segmentExtensions = ['.ts', '.mp4', '.m4s', '.cmfv']\n      url = url || ''\n      for (var i in segmentExtensions) {\n        var ext = segmentExtensions[i]\n        if (url.lastIndexOf(ext) === url.length - ext.length) {\n          return true\n        }\n      }\n      return false\n    },\n\n    // done: function () {\n    //  Transform.prototype.done.apply(this, arguments) // super\n    // },\n\n    _setTimeout: function () {\n      // Abort operation after 3s\n      var timeoutComplete = function () {\n        if (this._isBusy) {\n          this.done()\n          Log.warn('ResourceTransform has exceeded the maximum execution time (3s) and will be aborted.')\n        }\n      }.bind(this)\n      try {\n        this._parseTimeout = setTimeout(timeoutComplete, 3000)\n      } catch (err) {\n        if (typeof atv !== 'undefined') {\n          this._parseTimeout = atv.setTimeout(timeoutComplete, 3000)\n        } else {\n          Log.error(err)\n        }\n      }\n    },\n\n    parseManifest: function (lastManifest, lastSrc) {\n      var headers = this._plugin.options['parse.manifest.auth']\n      var parserArray = [new LocationheaderParser(headers), new DashParser(headers), new HlsParser(headers)]\n      this._parseManifest(parserArray, lastManifest, lastSrc || this._initResource)\n    },\n\n    _parseManifest: function (parserArray, lastManifest, lastSrc, format) {\n      if (parserArray.length > 0) {\n        var parser = parserArray[0]\n        if (parser.shouldExecute(lastManifest)) {\n          parser.on(Parser.Event.DONE, function () {\n            this._parseManifest(parserArray.slice(1, parserArray.length), parser.getLastManifest(), parser.getResource(), parser.getTransportFormat() || format)\n          }.bind(this))\n          parser.parse(lastSrc, lastManifest)\n        } else {\n          this._parseManifest(parserArray.slice(1, parserArray.length), lastManifest, lastSrc, format)\n        }\n      } else {\n        this._transportFormat = format\n        this._realResource = lastSrc\n        this._parseCDN()\n      }\n    },\n\n    _parseCDN: function () {\n      if (this._plugin.isCdnSwitch()) {\n        this.switchDetector = new CdnSwitch(this._plugin)\n        this.switchDetector.on(CdnSwitch.Events.DONE, function (resp) {\n          this._cdnName = resp.data\n          this.done()\n        }.bind(this))\n\n        this.switchDetector.on(CdnSwitch.Events.ERROR, function () {\n          this.done()\n        }.bind(this))\n        this.switchDetector.init()\n      } else if (this._cdnEnabled && this._cdnList.length > 0) {\n        var cdn = this._cdnList.shift()\n\n        if (this.getNodeHost()) return // abort\n\n        var cdnParser = CdnParser.create(cdn)\n        if (cdnParser) {\n          cdnParser.on(CdnParser.Event.DONE, function () {\n            this._responses = cdnParser.getResponses()\n            this._cdnName = cdnParser.getParsedCdnName()\n            this._cdnNodeHost = cdnParser.getParsedNodeHost()\n            this._cdnNodeTypeString = cdnParser.getParsedNodeTypeString()\n            this._cdnNodeType = cdnParser.getParsedNodeType()\n            if (this.getNodeHost()) {\n              this.done()\n            } else {\n              this._parseCDN()\n            }\n          }.bind(this))\n          // Run parse\n          cdnParser.parse(this._getInitialCdnResource(), this._responses)\n        } else {\n          this._parseCDN()\n        }\n      } else {\n        this.done()\n      }\n    },\n\n    /**\n     * Replaces the resource and/or Cdn info for the /start service.\n     *\n     * @param {YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      if (request.service === Constants.Service.START) {\n        var lastSent = this._plugin.requestBuilder.lastSent\n        lastSent.parsedResource = request.params.parsedResource = this.getResource() || request.params.parsedResource\n        lastSent.transportFormat = request.params.transportFormat = this.getTransportFormat() || request.params.transportFormat\n        if (this._cdnEnabled) {\n          lastSent.cdn = request.params.cdn = request.params.cdn || this.getCdnName()\n          lastSent.nodeHost = request.params.nodeHost = this.getNodeHost() || request.params.nodeHost\n          lastSent.nodeType = request.params.nodeType = this.getNodeType() || request.params.nodeType\n          lastSent.nodeTypeString = request.params.nodeTypeString = this.getNodeTypeString() || request.params.nodeTypeString\n        }\n      }\n    }\n  })\n\nmodule.exports = ResourceTransform\n","var Emitter = require('../../../emitter')\nvar Log = require('../../../log')\nvar YBRequest = require('../../request')\n\nvar CdnSwitch = Emitter.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.headerName = 'x-cdn'\n  },\n\n  init: function () {\n    var url = null\n    if (this.plugin) {\n      if (this.plugin.getAdapter() && this.plugin.getAdapter().getURLToParse()) {\n        url = this.plugin.getAdapter().getURLToParse()\n      } else {\n        url = this.plugin.getResource()\n      }\n    }\n    if (this.plugin && this.plugin.getAdapter() && this.plugin.getAdapter().flags.isStarted) {\n      this._request(url)\n    }\n  },\n\n  done: function (data) {\n    this.emit(CdnSwitch.Events.DONE, data)\n  },\n\n  error: function () {\n    this.emit(CdnSwitch.Events.ERROR)\n  },\n\n  _successfulRequest: function (resp) {\n    setTimeout(this.init.bind(this), parseInt(this.plugin.options['parse.cdnTTL']) * 1000)\n    var headers = resp.getResponseHeaders().split('\\n')\n    var cdn = null\n    for (var i in headers) {\n      var line = headers[i]\n      var index = line.indexOf(this.headerName)\n      if (index > -1) {\n        cdn = line.substring(index + this.headerName.length + 1, line.length - 1).replace(' ', '')\n      }\n    }\n    this.done(cdn)\n  },\n\n  _failedRequest: function () {\n    setTimeout(this.init.bind(this), parseInt(this.plugin.options['parse.cdnTTL']) * 1000)\n    Log.warn('CDN switch detection request failed')\n    this.error()\n  },\n\n  _request: function (url) {\n    var request = new YBRequest(url, null, null, { method: 'HEAD', cache: true })\n    request.on(YBRequest.Event.SUCCESS, this._successfulRequest.bind(this))\n    request.on(YBRequest.Event.ERROR, this._failedRequest.bind(this))\n    request.send()\n  }\n\n}, {\n  Events: {\n    DONE: 'done',\n    ERROR: 'error'\n  }\n})\n\nmodule.exports = CdnSwitch\n","var Emitter = require('../../../emitter')\nvar Log = require('../../../log')\nvar Util = require('../../../util')\nvar YBRequest = require('../../request')\n\nvar CdnParser = Emitter.extend(\n  /** @lends youbora.CdnParser.prototype */\n  {\n    /**\n         * Class that asynchronously tries to get information about the CDN where a given resource is\n         * hosted.\n         *\n         * The info we care about is the CDN code itself, the node host and node type.\n         *\n         * The CDN is queried with http HEAD requests. This only will work if the CDN has been properly\n         * configured.\n         *\n         * When HEAD requests are performed against the resources, the CDN returns a set of headers that\n         * contain info about the cdn header and/or cdn type.\n         *\n         * Each CDN is different; some require special headers to be set when the HEAD request is\n         * performed and others don't. Also, the info can come back in any fashion of ways, sometimes\n         * both type and host come in the same response header while sometimes they're in different\n         * headers. The format of these response headers is also different from CDN to CDN, so a\n         * different regex is used for each CDN.\n         *\n         * Lastly, as the values indicating the CDN type are also different, we need a specific mapping\n         * for each one.\n         *\n         * Every instance of this class will represent a 'way' of parsing the HEAD response. So an\n         * instance should be created for Level3, Akamai, Highwinds, etc...\n         *\n         * @constructs CdnParser\n         * @extends youbora.Emitter\n         * @memberof youbora\n         *\n         * @param {object} options This object represents the configuration of a certain CDN parsing\n         * methodology.\n         * @param {string} options.cdnName see {@link CdnParser#setCdnName}.\n         * @param {array} options.parsers see {@link CdnParser#addParser}.\n         * @param {array} options.requestMethod see {@link CdnParser#setRequestMethod}.\n         * @param {array} options.requestHeaders see {@link CdnParser#setRequestHeader}.\n         * @param {function} options.parseType see {@link CdnParser#setParseType}.\n         */\n    constructor: function (options) {\n      this._options = Util.assign({\n        cdnName: null,\n        parsers: [],\n        requestMethod: 'HEAD',\n        requestHeaders: {},\n        parseType: function () { return 0 }\n      }, options)\n\n      this._responses = {}\n    },\n\n    /**\n         * Emits DONE event\n         */\n    done: function () {\n      this.emit(CdnParser.Event.DONE)\n    },\n\n    /**\n         * Adds an object that represents a parse step of the headers.\n         *\n         * Each parser item will define the element parsed (whether if it is a host, a type, both...)\n         * a headerName to parse (ie: x-cache) and a regex to execute over that header.\n         *\n         * @param {object} parser\n         * @param {string} parser.element Which element will be parsed from the request.\n         * Use {@link CdnParser.ElementType} enum.\n         * @param {string} parser.headerName Name of the header to parse.\n         * @param {regex} parser.regex Regex to match against the header content.\n         *\n         * @return itself to chain method calls\n         */\n    addParser: function (parser) {\n      this._options.parsers.push(parser)\n      return this\n    },\n\n    /**\n         * Sets the cdn name. Note that this names are provided by Youbora and must coincede with the\n         * ones offered here: {@link http://mapi.youbora.com:8081/cdns}.\n         *\n         * @return itself to chain method calls\n         */\n    setCdnName: function (name) {\n      this._options.cdnName = name\n      return this\n    },\n\n    /**\n         * Sets the method of the request. HEAD by default.\n         *\n         * @return itself to chain method calls\n         */\n    setRequestMethod: function (method) {\n      this._options.requestMethod = method\n      return this\n    },\n\n    /**\n         * if this CDN requires special headers to be set in order to respond with the info we want,\n         * add them using this method.\n         *\n         * @param {string} key Name of the header.\n         * @param {string} value Content of the header.\n         *\n         * @return itself to chain method calls\n         */\n    setRequestHeader: function (key, value) {\n      this._options.requestHeaders[key] = value\n      return this\n    },\n\n    /**\n         * Adds a parsing function for parsing the type (hit or miss) of the request.\n         *\n         * Parser fucntion will receive a string parsed from a type header (see\n         * {@link CdnParser#addParser}). Should return 1 in case of HIT, 2 in case of MISS and\n         * 0 otherwise.\n         *\n         * @param {function} parser Parsing function\n         *\n         * @return itself to chain method calls\n         */\n    setParseType: function (parser) {\n      this._options.parseType = parser\n      return this\n    },\n\n    /**\n         * Get parsed CDN name.\n         *\n         * @return {string} The CDN name or null if unknown\n         */\n    getParsedCdnName: function () {\n      return this._cdnName\n    },\n\n    /**\n         * Get the parsed CDN node.\n         *\n         * @return {string} The CDN node or null if unknown\n         */\n    getParsedNodeHost: function () {\n      return this._cdnNodeHost\n    },\n\n    /**\n         * Get the parsed CDN type string, as returned in the cdn header response.\n         *\n         * @return {string} The CDN type string\n         */\n    getParsedNodeTypeString: function () {\n      return this._cdnNodeTypeString\n    },\n\n    /**\n         * Get the parsed CDN type, parsed from the type string.\n         *\n         * @return {string} The CDN type\n         */\n    getParsedNodeType: function () {\n      return this._cdnNodeType\n    },\n\n    /**\n         * Returns the request responses from this CdnParser.\n         * This is filled with the responses from the constructor, or created empty if null.\n         * Then the performed request response (if any) is added to this map.\n         * Call this method after \"using\" the CdnParser and pass the responses to the following\n         * CdnParser so it can use the responses if it applies.\n         * @return the request responses\n         */\n    getResponses: function () {\n      return this._responses\n    },\n\n    /**\n         * Parses given headers to check for matches.\n         */\n    parse: function (url, responses) {\n      this._responses = responses || {}\n      var headerString = JSON.stringify(this._options.requestHeaders)\n      if (this._responses[headerString]) {\n        this._parseResponse(this._responses[headerString])\n      } else {\n        this._requestResponse(url)\n      }\n    },\n\n    _requestResponse: function (url) {\n      var headerString = JSON.stringify(this._options.requestHeaders)\n      var useheaders = headerString !== '{}'\n\n      var request = new YBRequest(url, null, null, {\n        method: this._options.requestMethod,\n        maxRetries: 0,\n        requestHeaders: this._options.requestHeaders,\n        cache: true\n      })\n\n      request.on(YBRequest.Event.SUCCESS, function (resp) {\n        this._responses[headerString] = resp.getResponseHeaders()\n        this._parseResponse(this._responses[headerString])\n      }.bind(this))\n\n      request.on(YBRequest.Event.ERROR, function (resp) {\n        if (useheaders) {\n          this._options.requestHeaders = {}\n          this._requestResponse(url)\n        } else {\n          this.done()\n        }\n      }.bind(this))\n\n      request.send()\n    },\n\n    /**\n     *\n     * @param headers\n     * @private\n     */\n    _parseResponse: function (headers) {\n      this._options.parsers.forEach(function (parser) {\n        if (typeof parser.headerName === 'string') {\n          this._parseHeaderResponse(headers, parser, parser.headerName)\n        } else if (Array.isArray(parser.headerName)) {\n          for (var i = 0, len = parser.headerName.length; i < len; i++) {\n            var headerNameElement = parser.headerName[i]\n            if (typeof headerNameElement === 'string') {\n              this._parseHeaderResponse(headers, parser, headerNameElement)\n            }\n          }\n        }\n      }.bind(this))\n      this.done()\n    },\n\n    /**\n     *\n     * @param headers\n     * @param parser\n     * @param parser\n     * @private\n     */\n    _parseHeaderResponse: function (headers, parser, headerName) {\n      if (headerName) {\n        headerName = (headerName)\n          ? headerName.toLowerCase()\n          : ''\n        headers.split('\\n').forEach(function (line) {\n          var index = line.indexOf(':')\n          if (index !== -1) {\n            var key = line.slice(0, index).toLowerCase()\n            if (key === headerName) {\n              this._executeParser(parser, line.slice(index + 1))\n            }\n          }\n        }.bind(this))\n      }\n    },\n\n    _executeParser: function (parser, value) {\n      try {\n        var matches = parser.regex.exec(value.trim())\n        if (matches !== null) {\n          if (this._options.cdnName) this._cdnName = this._options.cdnName\n          switch (parser.element) {\n            case CdnParser.ElementType.HOST:\n              this._cdnNodeHost = matches[1]\n              break\n            case CdnParser.ElementType.TYPE:\n              this._cdnNodeTypeString = matches[1]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              break\n            case CdnParser.ElementType.HOST_AND_TYPE:\n              this._cdnNodeHost = matches[1]\n              this._cdnNodeTypeString = matches[2]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              break\n            case CdnParser.ElementType.TYPE_AND_HOST:\n              this._cdnNodeTypeString = matches[1]\n              this._cdnNodeType = this._options.parseType(this._cdnNodeTypeString)\n              this._cdnNodeHost = matches[2]\n              break\n            case CdnParser.ElementType.NAME:\n              this._cdnName = matches[1].toUpperCase()\n              break\n          }\n        }\n      } catch (err) {\n        Log.warn('CDN parsing for ' + this._options.cdnName +\n          ' could not parse header value ' + value)\n      }\n    },\n\n    shouldExecute: function () {\n      return true\n    }\n\n  },\n\n  /** @lends youbora.CdnParser */\n  {\n    // Static members\n\n    /**\n         * List of events that could be fired from this class.\n         *\n         * @enum\n         */\n    Event: {\n      /** Notifies that this CdnParser is done processing. */\n      DONE: 'done'\n    },\n\n    /**\n         * Possible different bits of info we can get from a header.\n         *\n         * @enum\n         */\n    ElementType: {\n      HOST: 'host',\n      TYPE: 'type',\n      HOST_AND_TYPE: 'host+type',\n      TYPE_AND_HOST: 'type+host',\n      NAME: 'name'\n    },\n\n    /**\n         * List of available CDN parsers.\n         * @private\n         */\n    _cdnConfigs: {},\n\n    /**\n         * This is a special case. The BalancerCdnParser is a custom CDN definition\n         * that tries to get the CDN name directly from one of the headers. This method can be used\n         * as a shortcut to creating a new CDN definition.\n         *\n         * This is usually used with DNS-based load balance services, such as Cedexis.\n         *\n         * Youboralib will use this method by itself using the configuration passed in the\n         * {@link Options}.\n         *\n         * @param {string} cdnNameHeader the header response name where to get the CDN name from.\n         * @param {string} cdnNodeNameHeader the header response name where to get the host name from.\n         */\n    setBalancerHeaderName: function (name, nodename) {\n      CdnParser._cdnConfigs.Balancer.parsers[0].headerName = name\n      CdnParser._cdnConfigs.Balancer.parsers[1].headerName = nodename\n    },\n\n    /**\n         * Create one of the pre-defined CDN parsers. This method will be called with the keys passed\n         * to {@link Options#'parse.CdnNode.list'}.\n         *\n         * Before using this method, configs must be added first using {@link CdnParser.add}.\n         *\n         * @param {string} cdnName Name of the CDN\n         * @return {CdnParser} An instance or undefined if the names does not match any CDN.\n         */\n    create: function (key) {\n      if (CdnParser._cdnConfigs[key]) {\n        return new CdnParser(CdnParser._cdnConfigs[key])\n      } else {\n        Log.warn('Tried to create an unexisting CdnParser named ' + key)\n      }\n    },\n\n    /**\n         * Adds the given CdnParser's config to the available list. Objects sent must comply with\n         * CdnParser constructor.\n         *\n         * @param {string} key The name that will identify the CDN.\n         * @param {Object} config The parser that defines the CDN.\n         */\n    add: function (key, config) {\n      CdnParser._cdnConfigs[key] = config\n    }\n  }\n)\n\n// Adding built-in parsers\nCdnParser.add('Level3', require('./cdnparsers/level3'))\nCdnParser.add('Cloudfront', require('./cdnparsers/cloudfront'))\nCdnParser.add('Akamai', require('./cdnparsers/akamai'))\nCdnParser.add('Highwinds', require('./cdnparsers/highwinds'))\nCdnParser.add('Fastly', require('./cdnparsers/fastly'))\nCdnParser.add('Telefonica', require('./cdnparsers/telefonica'))\nCdnParser.add('Amazon', require('./cdnparsers/amazon'))\nCdnParser.add('Edgecast', require('./cdnparsers/edgecast'))\nCdnParser.add('Balancer', require('./cdnparsers/balancer'))\nCdnParser.add('NosOtt', require('./cdnparsers/nosott'))\n\nmodule.exports = CdnParser\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'AKAMAI',\n  // requestMethod: 'GET',\n  parsers: [{\n    element: 'type+host',\n    headerName: 'X-Cache',\n    regex: /(.+)\\sfrom.+AkamaiGHost\\/(.+)\\).+/\n  }, {\n    element: 'host',\n    headerName: 'akamai-mon-iucid-del',\n    regex: /(.*)/\n  }, {\n    element: 'type',\n    headerName: 'akamai-cache-status',\n    regex: /(.+)\\sfrom\\schild/\n  }],\n  requestHeaders: {\n    Pragma: 'akamai-x-cache-on'\n  },\n  parseType: function (type) {\n    var t = type.toLowerCase()\n    if (t.indexOf('hit') !== -1) {\n      return 1\n    } else if (t.indexOf('miss') !== -1) {\n      return 2\n    }\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'AMAZON',\n  parsers: [{\n    element: 'host',\n    headerName: 'x-amz-cf-pop',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'x-cache',\n    regex: /(.+)\\sfrom.+/\n  }],\n  parseType: function (type) {\n    if (type.toLowerCase().indexOf('hit') !== -1) {\n      return 1\n    } else if (type.toLowerCase().indexOf('miss') !== -1) {\n      return 2\n    }\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  parsers: [{\n    element: 'name',\n    headerName: null,\n    regex: /(.+)/\n  },\n  {\n    element: 'host',\n    headerName: null,\n    regex: /(.+)/\n  }]\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'CLOUDFRT',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-Amz-Cf-Id',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(\\S+)\\s.+/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'Hit':\n        return 1\n      case 'Miss':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'EDGECAST',\n  parsers: [{\n    element: 'host',\n    headerName: 'Server',\n    regex: /\\((.+)\\/.+\\)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(.+)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'HIT':\n        return 1\n      case 'MISS':\n      default:\n        return 2\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'FASTLY',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-Served-By',\n    regex: /([^,\\s]+)$/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /([^,\\s]+)$/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'HIT':\n        return 1\n      case 'MISS':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'HIGHNEGR',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'X-HW',\n    regex: /.+,[0-9]+\\.(.+)\\.(.+)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'c':\n      case 'x':\n        return 1\n      default:\n        return 2\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'LEVEL3',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'X-WR-Diag',\n    regex: /Host:(.+)\\sType:(.+)/\n  }],\n  requestHeaders: {\n    'X-WR-Diag': 'host'\n  },\n  parseType: function (type) {\n    if (type) {\n      if (\n        type.indexOf('TCP_HIT') === 0 ||\n        type.indexOf('TCP_MEM_HIT') === 0 ||\n        type.indexOf('TCP_IMS_HIT') === 0\n      ) {\n        return 1\n      } else if (type.indexOf('TCP_MISS') === 0) {\n        return 2\n      }\n    }\n\n    return 0\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'NOSOTT',\n  parsers: [{\n    element: 'host',\n    headerName: 'X-NOS-Server',\n    regex: /(.+)/\n  }, {\n    element: 'type',\n    headerName: 'X-Cache',\n    regex: /(.*)/\n  }],\n  parseType: function (type) {\n    switch (type) {\n      case 'Hit':\n        return 1\n      case 'Miss':\n        return 2\n      default:\n        return 0\n    }\n  }\n}\n","// {@see CdnParser}\n\nmodule.exports = {\n  cdnName: 'TELEFO',\n  parsers: [{\n    element: 'host+type',\n    headerName: 'x-tcdn',\n    regex: /Host:(.+)\\sType:(.+)/\n  }],\n  requestHeaders: {\n    'x-tcdn': 'host'\n  },\n  parseType: function (type) {\n    if (type) {\n      if (\n        type.indexOf('p') !== -1 ||\n        type.indexOf('c') !== -1\n      ) {\n        return 1\n      } else if (type.indexOf('i') !== -1 ||\n        type.indexOf('m') !== -1) {\n        return 2\n      }\n    }\n    return 0\n  }\n}\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\nvar Log = require('../../../../log')\nvar TransportFormat = require('../../../../constants/transportFormat')\n\nvar DashParser = Parser.extend(\n  /** @lends youbora.DashParser.prototype */\n  {\n    /**\n     * Starts the Dash parsing from the given resource. The first (outside) call should set the\n     * parentResource to null.\n     *\n     * @param {string} resource The resource url.\n     */\n    parse: function (resource, lastManifest) {\n      if (!lastManifest) {\n        var request = new YBRequest(resource, null, null, { cache: true, requestHeaders: this._headers })\n\n        request.on(YBRequest.Event.SUCCESS, function (resp) {\n          this.parseLocation(resp, resource)\n        }.bind(this))\n\n        request.on(YBRequest.Event.ERROR, function (resp) {\n          this.done()\n        }.bind(this))\n\n        request.send()\n      } else {\n        this.parseLocation(lastManifest, resource)\n      }\n    },\n\n    parseLocation: function (lastManifest, resource) {\n      this.iterations--\n      var locationRegexp = new RegExp(/<Location>([\\s\\S]+)<\\/Location>/)\n      try {\n        this._lastManifest = lastManifest\n        var manifest = lastManifest.getResponseText()\n        var matches = locationRegexp.exec(manifest)\n\n        if (matches && matches[1]) {\n          var newRes = this._htmlDecode(matches[1].replace('\\n', ''))\n        }\n        if (newRes && newRes !== resource && this.iterations > 0) {\n          this.parse(newRes)\n        } else {\n          this.parseFinalResource(manifest, resource)\n        }\n      } catch (err) {\n        Log.warn('Dash parse failed')\n        this.done()\n      }\n    },\n\n    _htmlDecode: function (input) {\n      if (typeof document !== 'undefined' && typeof document.createElement === 'function') {\n        var e = document.createElement('textarea')\n        e.innerHTML = input\n        return e.childNodes && e.childNodes.length ? e.childNodes[0].nodeValue : input\n      }\n      return input\n    },\n\n    parseFinalResource: function (manifest, resource) {\n      var baseUrlRegexp = new RegExp(/<BaseURL>[\\r\\n]*(.*?)[\\r\\n]*<\\/BaseURL>/)\n      var segmentUrlRegexp = new RegExp(/<SegmentURL[\\s\\S]*media=\"([^\"]+)/)\n      var segmentTemplateRegexp = new RegExp(/<SegmentTemplate[\\s\\S]*media=\"([^\"]+)/)\n      var matches = null\n      // first: base url, second: segment url, third: segment template\n      try {\n        matches = baseUrlRegexp.exec(manifest) || segmentTemplateRegexp.exec(manifest) || segmentUrlRegexp.exec(manifest)\n        this._getManifestMetadata(manifest)\n        if (matches && matches[1] && this._isFullUrl(matches[1])) {\n          if (matches[1].indexOf('\"') > 0) {\n            this._realResource = matches[1].substr(0, matches[1].indexOf('\"')).replace('\\n', '')\n          } else {\n            this._realResource = matches[1].replace('\\n', '')\n          }\n        } else {\n          this._realResource = resource\n        }\n      } catch (err) {\n        Log.warn('Dash manifest parse failed')\n      }\n      this.done()\n    },\n\n    _getManifestMetadata: function (manifest) {\n      try {\n        var transportFormatRegexp = new RegExp(/<AdaptationSet[\\s\\S]*mimeType=\"video\\/([^\"]+)/)\n        var matches = transportFormatRegexp.exec(manifest)\n        var ret = null\n        switch (matches[1]) {\n          case 'mp4':\n          case 'm4s':\n            ret = TransportFormat.MP4\n            break\n          case 'mp2t':\n            ret = TransportFormat.MPEG2\n            break\n          case 'cmfv':\n            ret = TransportFormat.CMF\n            break\n        }\n        this._transportFormat = ret\n      } catch (err) {\n        Log.warn('Couldnt find the transport format')\n      }\n    },\n\n    _isFullUrl: function (url) {\n      return url.indexOf('http') !== -1\n    },\n\n    shouldExecute: function (lastManifest) {\n      var ret = true\n      if (lastManifest) {\n        var response = lastManifest.getResponseText()\n        ret = response.indexOf('<MPD') !== -1\n      }\n      return ret\n    }\n  }\n)\n\nmodule.exports = DashParser\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\nvar Log = require('../../../../log')\nvar TransportFormat = require('../../../../constants/transportFormat')\n\nvar HlsParser = Parser.extend(\n  /** @lends youbora.HlsParser.prototype */\n  {\n    /**\n     * Starts the HLS parsing from the given resource. The first (outside) call should set the\n     * parentResource to null.\n     *\n     * @param {string} resource Either the resource url or the manifest body.\n     * @param {string} parentResource Parent resource in case relative paths are sent.\n     */\n    parse: function (resource, lastManifest, parentResource) {\n      parentResource = parentResource || ''\n      var matches = null\n      try {\n        matches = /((\\S*?)(\\.m3u8|\\.m3u|\\.ts|\\.m4s|\\.mp4|\\.cmfv|\\.m4a)((\\?|;)\\S*|\\n|\\r|$))/i.exec(resource.replaceAll(',URI=', '\\n').replaceAll('\"', '').replaceAll(',', '\\n'))\n      } catch (err) {\n        Log.warn('Parse HLS Regex failed', err)\n        this.done()\n      }\n\n      if (matches !== null) { // get first line ending in .m3u8, .m3u, .mp4, .cmfv or .ts\n        var res = matches[1].trim()\n        var prevParent = ''\n        var index = parentResource.lastIndexOf('/')\n        if (res.indexOf('http') !== 0 && index !== -1) {\n          // If does not start with http, add parentResource relative route.\n          if (res[0] === '/' && res[1] !== '/') {\n            // if its a relative route not using the same path, but the same domain\n            var ind = parentResource.indexOf('/') + 1\n            ind += parentResource.substr(ind, parentResource.length).indexOf('/') + 1 // Second '/'\n            ind += parentResource.substr(ind, parentResource.length).indexOf('/') // Third '/'\n            res = parentResource.slice(0, ind) + res\n          } else {\n            // if its sharing the (omitted) path\n            res = parentResource.slice(0, index) + '/' + res\n          }\n          prevParent = parentResource.slice(0, index) + '/'\n        }\n\n        if (matches[3] === '.m3u8' || matches[3] === '.m3u') { // It is m3u8 or m3u...\n          if (!lastManifest) {\n            var request = new YBRequest(res, null, null, { cache: true, requestHeaders: this._headers })\n\n            request.on(YBRequest.Event.SUCCESS, function (resp) {\n              this._parseWithManifest(resp, prevParent, matches)\n            }.bind(this))\n\n            request.on(YBRequest.Event.ERROR, function (resp) {\n              this.done()\n            }.bind(this))\n\n            request.send()\n          } else {\n            this._parseWithManifest(lastManifest, prevParent, matches)\n          }\n        } else { // It is mp4 or ts...\n          switch (matches[3]) {\n            case '.mp4':\n            case '.m4s':\n            case '.m4a':\n              this._transportFormat = TransportFormat.MP4\n              break\n            case '.ts':\n              this._transportFormat = TransportFormat.MPEG2\n              break\n            case '.cmfv':\n              this._transportFormat = TransportFormat.CMF\n          }\n          this._realResource = res\n          this.done()\n        }\n      } else {\n        this.done()\n      }\n    },\n\n    _parseWithManifest: function (resp, prevParent, matches) {\n      this._lastManifest = resp\n      this.parse(resp.getResponseText(), null, prevParent + matches[2])\n    },\n\n    shouldExecute: function (lastManifest) {\n      var ret = true\n      if (lastManifest) {\n        var response = lastManifest.getResponseText()\n        ret = response.indexOf('#EXTM3U') !== -1\n      }\n      return ret\n    }\n  }\n)\n\nmodule.exports = HlsParser\n","var YBRequest = require('../../../request')\nvar Parser = require('./parser')\n\nvar LocationheaderParser = Parser.extend(\n  /** @lends youbora.LocationheaderParser.prototype */\n  {\n    /**\n     * Parses given header to check.\n     */\n    parse: function (url, lastManifest) {\n      if (!lastManifest) {\n        this._realResource = url\n        var request = new YBRequest(url, null, null, {\n          cache: true,\n          requestHeaders: this._headers\n        })\n\n        request.on(YBRequest.Event.SUCCESS, function (resp) {\n          this._parseWithManifest(resp)\n        }.bind(this))\n\n        request.on(YBRequest.Event.ERROR, function (resp) {\n          this.done()\n        }.bind(this))\n\n        request.send()\n      } else {\n        this._parseWithManifest(lastManifest)\n      }\n    },\n\n    _parseWithManifest: function (resp) {\n      this._lastManifest = resp\n      var response = resp.getResponseHeaders()\n      var found = false\n      if (resp && resp.xhr && resp.xhr.responseURL && resp.xhr.responseURL !== this._realResource) {\n        this._realResource = resp.xhr.responseURL\n        this.parse(this._realResource)\n        found = true\n      } else {\n        response.split('\\n').forEach(function (line) {\n          if (line.startsWith('Location:')) {\n            this._realResource = line.slice(10)\n            this.parse(this._realResource)\n            found = true\n          }\n        }.bind(this))\n      }\n      if (!found) {\n        this.done()\n      }\n    }\n  }\n)\n\nmodule.exports = LocationheaderParser\n","var Emitter = require('../../../../emitter')\n\nvar Parser = Emitter.extend(\n  /** @lends youbora.Parser.prototype */\n  {\n    /**\n     * Class that asynchronously parses a resource in order to get to the URL.\n     *\n     * Since the CDN detection is performed with the resource url, it is essential that this\n     * resource url is pointing to the CDN that is actually hosting the manifest.\n     *\n     * @constructs Parser\n     * @extends youbora.Emitter\n     * @memberof youbora\n     */\n    constructor: function (headers) {\n      this._realResource = null\n      this._lastManifest = null\n      this._transportFormat = null\n      this.iterations = 3\n      this._headers = headers\n    },\n\n    /**\n     * Emits DONE event\n     */\n    done: function () {\n      this.iterations = 3\n      this.emit(Parser.Event.DONE)\n    },\n\n    /**\n     * Starts the parsing from the given resource.\n     *\n     * @param {string} resource The resource url.\n     * @param {object} lastManifest The manifest request response if parsed previously.\n     */\n    parse: function (resource, lastManifest) { },\n\n    /**\n     * Get the parsed resource. Will be null/undefined if parsing is not yet started and can be a partial\n     * (an intermediate manifest) result if the parser is still running.\n     *\n     * @return {string} The parsed resource.\n     */\n    getResource: function () {\n      return this._realResource\n    },\n\n    /**\n     * Get the transport format. Will be null/undefined if parsing is not yet started or is still running.\n     *\n     * @return {string} The parsed resource.\n     */\n    getTransportFormat: function () {\n      return this._transportFormat\n    },\n\n    /**\n     * Get the last request manifest response object used to parse the resource.\n     * Will be null/undefined if parsing is not yet started and can be a partial\n     * (an intermediate manifest) result if the parser is still running.\n     *\n     * @return {object} The last manifest request response used to parse the resource.\n     */\n    getLastManifest: function () {\n      return this._lastManifest\n    },\n\n    /**\n     * Get the result of checking a previous manifest to detect if the parser should be used or not.\n     *\n     * @param {string} resource The resource url.\n     * @return {object} The last manifest request response used to parse the resource.\n     */\n    shouldExecute: function (lastManifest) {\n      return true\n    }\n  },\n\n  /** @lends youbora.Parser */\n  {\n    // Static members\n\n    /**\n     * List of events that could be fired from this class.\n     * @enum\n     */\n    Event: {\n      /** Notifies that this DashParser is done processing. */\n      DONE: 'done'\n    }\n  }\n)\n\nmodule.exports = Parser\n","var Emitter = require('../../emitter')\n\nvar Transform = Emitter.extend(\n  /** @lends youbora.Transform.prototype */\n  {\n    /**\n     * Transform classes in YOUBORA help the library parse and work with data.\n     *\n     * A Transform makes some kind of task that may block requests until it's done, or applies changes\n     * to the requests right before they're finally sent.\n     *\n     * {@link ResourceTransform}, {@link ViewTransform}... all extend from this class.\n     *\n     * @constructs Transform\n     * @extends youbora.Emitter\n     * @memberof youbora\n     * @abstract\n     */\n    constructor: function () {\n      /**\n       * Whether the Transform is currently working or not.\n       * @private\n       */\n      this._isBusy = true\n      this._sendRequest = true\n      this.transformName = 'Transform'\n    },\n\n    /**\n     * Override this method to transform info.\n     *\n     * @param {YBRequest} request Request to transform.\n     */\n    parse: function (request) { },\n\n    /**\n     * By default this will return true until {@link #done()} is called. This can be overridden\n     * in order to block {@link Request}s based on any criteria. For instance its\n     * {@link Request#getService()}.\n     *\n     * @param {YBRequest} request Request to transform.\n     * @return {bool} True if queue shall be blocked.\n     */\n    isBlocking: function (request) {\n      return this._isBusy\n    },\n\n    /**\n     * Emits DONE event\n     */\n    done: function () {\n      this._isBusy = false\n      this.emit(Transform.Event.DONE)\n    },\n\n    // offline\n    hasToSend: function (request) {\n      return this._sendRequest\n    },\n\n    getState: function () {\n      if (!this._sendRequest) {\n        return this.STATE_OFFLINE\n      }\n      if (this._isBusy) {\n        return this.STATE_BLOCKED\n      }\n      return this.STATE_NO_BLOCKED\n    }\n\n  },\n\n  /** @lends youbora.Transform */\n  {\n    // Static members\n\n    STATE_OFFLINE: 2,\n    STATE_BLOCKED: 1,\n    STATE_NO_BLOCKED: 0,\n    /**\n     * List of events that could be fired from this class.\n     * @enum\n     */\n    Event: {\n      /** Notifies that this Transform is done processing. */\n      DONE: 'done'\n    }\n  }\n)\n\nmodule.exports = Transform\n","var YBRequest = require('../request')\nvar Transform = require('./transform')\nvar Log = require('../../log')\nvar Util = require('../../util')\nvar Constants = require('../../constants')\n\nvar ViewTransform = Transform.extend(\n  /** @lends youbora.ViewTransform.prototype */\n  {\n    /**\n     * This class manages Fastdata service and view index.\n     *\n     * @constructs\n     * @extends youbora.Transform\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin Instance of {@link Plugin}\n     * @param {string} session If provided, plugin will use this as a FD response.\n     */\n    constructor: function (plugin, session) {\n      Transform.prototype.constructor.apply(this, arguments)\n\n      /** /data response */\n      this.response = {}\n\n      this._viewIndex = new Date().getTime()\n\n      this._session = session\n\n      this._httpSecure = plugin.options['app.https']\n\n      this._plugin = plugin\n\n      this.transformName = 'View'\n    },\n\n    /**\n     * Starts the 'FastData' fetching. This will send the initial request to YOUBORA in order to get\n     * the needed info for the rest of the requests.\n     *\n     * This is an asynchronous process.\n     *\n     * When the fetch is complete, {@link #fastDataConfig} will contain the parsed info.\n     * @see FastDataConfig\n     */\n    init: function () {\n      // offline\n      if (this._plugin.options && this._plugin.options.offline) {\n        // set the options\n        this.response.host = 'OFFLINE'\n        this.response.code = 'OFFLINE'\n        this.response.pingTime = 60\n        this.response.beatTime = 60\n        this.done()\n        return null\n      }\n\n      // reusing old data not expired\n      if (this._plugin.storage.isEnabled()) {\n        var now = new Date().getTime()\n        if (now < this._plugin.sessionExpire + (Number(this._plugin.getDataTime()) || 0) &&\n          this._plugin.getStoredData()) {\n          this.setData(this._plugin.getStoredData())\n          return null\n        }\n      }\n\n      // request new data\n      var service = Constants.Service.DATA\n      var params = {\n        outputformat: 'json'\n      }\n\n      params = this._plugin.requestBuilder.buildParams(params, service)\n      if (params !== null) {\n        Log.notice(service + ' ' + params.system)\n        if (params.system === 'nicetest') {\n          // \"nicetest\" is the default accountCode.\n          // If found here, it's very likely that the customer has forgotten to set it.\n          Log.error(\n            'No accountCode has been set. Please set your accountCode inside plugin\\'s options.'\n          )\n        }\n\n        new YBRequest(this._plugin.getHost(), service, params)\n          .on(YBRequest.Event.SUCCESS, this._receiveData.bind(this))\n          .on(YBRequest.Event.ERROR, this._failedData.bind(this))\n          .send()\n      }\n    },\n\n    /**\n     * Uses given response to set fastdata response.\n     *\n     * @param {String} response Fastdata response as json string.\n     */\n    setData: function (response) {\n      try {\n        var resp = JSON.parse(response)\n        if (this._plugin.options['parse.fdsResponseHost']) {\n          response = response.replace(resp.q.h, this._plugin.options['parse.fdsResponseHost'](resp.q.h))\n          resp = JSON.parse(response)\n        }\n        this.response.msg = response\n        this.response.host = Util.addProtocol(resp.q.h, this._httpSecure)\n        this.response.code = resp.q.c\n        this.response.pingTime = resp.q.pt || 5\n        this.response.beatTime = resp.q.i ? resp.q.i.bt || 30 : 30\n        this.response.sessionExpire = resp.q.i ? resp.q.i.exp || 300 : 300\n        this._plugin.storage.setLocal('sessionExpire', this.response.sessionExpire)\n        this.done()\n      } catch (err) {\n        Log.error('Fastdata response is invalid.')\n      }\n    },\n\n    /**\n     * Parse the response from the fastData service.\n     *\n     * @private\n     */\n    _receiveData: function (req, e) {\n      var msg = req.getResponse()\n      this.setData(msg)\n    },\n\n    _failedData: function (req, e) {\n      Log.error('Fastdata request has failed.')\n    },\n\n    /**\n     * This method will increment the view index (timestamp values). The library handles this\n     * automatically, but some error flow might need calling this manually.\n     * @return {string} new viewcode\n     */\n    nextView: function () {\n      this._viewIndex = new Date().getTime()\n      return this.getViewCode()\n    },\n\n    /**\n     * Returns current viewcode\n     * @return {string} viewcode\n     */\n    getViewCode: function () {\n      return this.response.code + '_' + this._viewIndex\n    },\n\n    /**\n     * Returns the current session\n     *\n     * @returns {string} Session\n     */\n    getSession: function () {\n      return this._session\n    },\n\n    /**\n     * Sets the session\n     *\n     * @param {String} sessionId Sets the session\n     */\n    setSession: function (session) {\n      this._session = session\n    },\n\n    /** Sets the host url\n    *\n    * @param {String} host Sets the host\n    */\n    setHost: function (host) {\n      this.response.host = host\n    },\n\n    /**\n     * Transform requests\n     * @param {youbora.comm.YBRequest} request YBRequest to transform.\n     */\n    parse: function (request) {\n      // Host, system and sessionRoot for all\n      request.host = request.host || this.response.host\n      request.params.system = this._plugin.getAccountCode()\n      request.params.sessionRoot = request.params.sessionRoot || this.getSession()\n\n      // PingTime for ping and start\n      if (ViewTransform.EventList.PingTime.indexOf(request.service) !== -1) {\n        request.params.pingTime = request.params.pingTime || this.response.pingTime\n      }\n\n      // ViewCode for non infinity events\n      if (ViewTransform.EventList.Infinity.indexOf(request.service) === -1) {\n        request.params.code = request.params.code || this.getViewCode()\n      } else {\n        // For infinity events, sessionId\n        request.params.sessionId = request.params.sessionRoot\n      }\n\n      // For init error and start, parentId and navContext\n      if (ViewTransform.EventList.CreateView.indexOf(request.service) !== -1) {\n        if (this._plugin.infinity.infinityStarted || (this._plugin.storage.isEnabled() && this._plugin.storage.getLocal('infinityStarted'))) {\n          request.params.parentId = request.params.sessionRoot\n          request.params.navContext = request.params.navContext || this._plugin.getContext()\n        }\n      }\n    }\n  },\n  {\n    // Static members\n    EventList: {\n      CreateView: [\n        Constants.Service.START,\n        Constants.Service.INIT,\n        Constants.Service.ERROR\n      ],\n      Infinity: [\n        Constants.Service.NAV,\n        Constants.Service.SESSION_START,\n        Constants.Service.SESSION_STOP,\n        Constants.Service.EVENT,\n        Constants.Service.BEAT\n      ],\n      PingTime: [\n        Constants.Service.START,\n        Constants.Service.PING\n      ]\n    }\n  })\n\nmodule.exports = ViewTransform\n","var Transform = require('./transform')\n\n/**\n * This transform ensures that no requests will be sent without sessionId when is required\n *\n * @constructs\n * @extends youbora.Transform\n * @memberof youbora\n * @name WrongTransform\n *\n * @param {Plugin} plugin Instance of {@link Plugin}\n */\nvar WrongTransform = Transform.extend(\n  /** @lends youbora.WrongTransform.prototype */\n  {\n    /**\n   * Returns if transform is blocking.\n   *\n   * @param {YBRequest} request Request to transform.\n   * @return {bool} True if queue shall be blocked.\n   */\n    isBlocking: function (request) {\n      if (!request.params.sessionId) {\n        return true\n      }\n      return false\n    }\n  }\n)\n\nmodule.exports = WrongTransform\n","var AdPosition = require('./constants/adPosition')\nvar Adapter = require('./constants/adapter')\nvar ManifestError = require('./constants/manifestError')\nvar RequestMethod = require('./constants/requestMethod')\nvar Service = require('./constants/service')\nvar WillSendEvent = require('./constants/willSendEvent')\nvar AdInsertionType = require('./constants/adInsertionType')\n/**\n * This static class englobes youbora constants.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Constants = {\n  AdPosition: AdPosition,\n  ManifestError: ManifestError,\n  RequestMethod: RequestMethod,\n  Service: Service,\n  WillSendEvent: WillSendEvent,\n  AdInsertionType: AdInsertionType,\n  Adapter: Adapter\n}\n\nmodule.exports = Constants\n","/**\n * List of ad insertion types\n */\nvar InsertionType = {\n  ClientSide: 'csai',\n  ServerSide: 'ssai'\n}\nmodule.exports = InsertionType\n","/**\n * List of ad positions\n */\nvar AdPosition = {\n  Preroll: 'pre',\n  Midroll: 'mid',\n  Postroll: 'post'\n}\nmodule.exports = AdPosition\n","var Event = require('./event')\n\nvar Adapter = {\n  Event: Event\n}\nmodule.exports = Adapter\n","/**\n * List of events that can be triggered by the adapter\n */\nvar Event = {\n  START: 'start',\n  JOIN: 'join',\n  PAUSE: 'pause',\n  RESUME: 'resume',\n  SEEK_BEGIN: 'seek-begin',\n  SEEK_END: 'seek-end',\n  BUFFER_BEGIN: 'buffer-begin',\n  BUFFER_END: 'buffer-end',\n  ERROR: 'error',\n  STOP: 'stop',\n  CLICK: 'click',\n  MANIFEST: 'manifest',\n  PODSTART: 'break-start',\n  PODSTOP: 'break-stop',\n  QUARTILE: 'quartile',\n  VIDEO_EVENT: 'video-event'\n}\nmodule.exports = Event\n","/**\n* List of ad manifest errors\n*/\nvar ManifestError = {\n  NO_RESPONSE: 'NO_RESPONSE',\n  EMPTY: 'EMPTY_RESPONSE',\n  WRONG: 'WRONG_RESPONSE'\n}\nmodule.exports = ManifestError\n","/**\n * List of Request Methods\n *   - GET\n *   - POST\n */\nvar RequestMethod = {\n  GET: 'get',\n  POST: 'post'\n}\nmodule.exports = RequestMethod\n","/**\n * List of youbora services.\n *\n * @enum\n */\nvar Service = {\n  DATA: '/data',\n\n  // Video\n  INIT: '/init',\n  START: '/start',\n  JOIN: '/joinTime',\n  PAUSE: '/pause',\n  RESUME: '/resume',\n  SEEK: '/seek',\n  BUFFER: '/bufferUnderrun',\n  ERROR: '/error',\n  STOP: '/stop',\n  PING: '/ping',\n\n  VIDEO_EVENT: '/infinity/video/event',\n\n  // Ads\n  AD_INIT: '/adInit',\n  AD_START: '/adStart',\n  AD_JOIN: '/adJoin',\n  AD_PAUSE: '/adPause',\n  AD_RESUME: '/adResume',\n  AD_BUFFER: '/adBufferUnderrun',\n  AD_STOP: '/adStop',\n  AD_CLICK: '/adClick',\n  AD_ERROR: '/adError',\n  AD_MANIFEST: '/adManifest',\n  AD_POD_START: '/adBreakStart',\n  AD_POD_STOP: '/adBreakStop',\n  AD_QUARTILE: '/adQuartile',\n\n  // Infinity\n  EVENT: '/infinity/session/event',\n  SESSION_START: '/infinity/session/start',\n  SESSION_STOP: '/infinity/session/stop',\n  NAV: '/infinity/session/nav',\n  BEAT: '/infinity/session/beat',\n\n  // Offline\n  OFFLINE_EVENTS: '/offlineEvents'\n}\nmodule.exports = Service\n","/**\n * List of streaming protocols\n *   - HDS (Adobe HDS)\n *   - HLS (Apple HLS)\n *   - MSS (Microsoft Smooth Streaming)\n *   - DASH (MPEG-DASH)\n *   - RTMP (Adobe RTMP)\n *   - RTP (RTP)\n *   - RTSP (RTSP)\n *   - MULTICAST (Multicast)\n *   - DVB (DVB)\n *   - DVBC (DVB-C)\n *   - DVBT (DVB-T)\n *   - DVBT2 (DVB-T2)\n */\nvar StreamingProtocol = {\n  HDS: 'HDS',\n  HLS: 'HLS',\n  MSS: 'MSS',\n  DASH: 'DASH',\n  RTMP: 'RTMP',\n  RTP: 'RTP',\n  RTSP: 'RTSP',\n  DVB: 'DVB',\n  DVBC: 'DVB-C',\n  DVBT: 'DVB-T',\n  DVBT2: 'DVB-T2',\n  MULTICAST: 'MULTICAST'\n}\n\nmodule.exports = StreamingProtocol\n","/**\n * List of transport formats\n *   - TS (MPEG-2 TS)\n *   - MP4 (Fragmented MP4)\n *   - CMF\n */\nvar TransportFormat = {\n  MP4: 'MP4',\n  MPEG2: 'TS',\n  CMF: 'CMF'\n}\nmodule.exports = TransportFormat\n","/**\n * List of will-send events.\n *\n * @memberof youbora.Plugin\n * @enum\n * @event\n */\nvar WillSendEvent = {\n  WILL_SEND_INIT: 'will-send-init',\n  WILL_SEND_START: 'will-send-start',\n  WILL_SEND_JOIN: 'will-send-join',\n  WILL_SEND_PAUSE: 'will-send-pause',\n  WILL_SEND_RESUME: 'will-send-resume',\n  WILL_SEND_SEEK: 'will-send-seek',\n  WILL_SEND_BUFFER: 'will-send-buffer',\n  WILL_SEND_ERROR: 'will-send-error',\n  WILL_SEND_FATAL_ERROR: 'will-send-fatal-error',\n  WILL_SEND_STOP: 'will-send-stop',\n  WILL_SEND_PING: 'will-send-ping',\n  WILL_SEND_VIDEO_EVENT: 'will-send-video-event',\n\n  WILL_SEND_AD_START: 'will-send-ad-start',\n  WILL_SEND_AD_JOIN: 'will-send-ad-join',\n  WILL_SEND_AD_PAUSE: 'will-send-ad-pause',\n  WILL_SEND_AD_RESUME: 'will-send-ad-resume',\n  WILL_SEND_AD_BUFFER: 'will-send-ad-buffer',\n  WILL_SEND_AD_STOP: 'will-send-ad-stop',\n  WILL_SEND_AD_CLICK: 'will-send-ad-click',\n  WILL_SEND_AD_ERROR: 'will-send-ad-error',\n  WILL_SEND_AD_MANIFEST: 'will-send-ad-manifest',\n  WILL_SEND_AD_POD_START: 'will-send-ad-break-start',\n  WILL_SEND_AD_POD_STOP: 'will-send-ad-break-stop',\n  WILL_SEND_AD_QUARTILE: 'will-send-ad-quartile',\n\n  WILL_SEND_SESSION_START: 'will-send-session-start',\n  WILL_SEND_SESSION_STOP: 'will-send-session-stop',\n  WILL_SEND_NAV: 'will-send-nav',\n  WILL_SEND_BEAT: 'will-send-beat',\n  WILL_SEND_EVENT: 'will-send-event',\n\n  WILL_SEND_OFFLINE_EVENTS: 'will-send-offline-events'\n}\nmodule.exports = WillSendEvent\n","var YouboraObject = require('../object')\n/**\n * This static class provides device detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar BackgroundDetector = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.isInBackground = false\n    this.listenerReference = this._visibilityListener.bind(this)\n    this._reset()\n  },\n\n  startDetection: function () {\n    if (!this.isBackgroundDetectorStarted && typeof document !== 'undefined') {\n      this.isBackgroundDetectorStarted = true\n      document.addEventListener('visibilitychange', this.listenerReference)\n    }\n  },\n\n  stopDetection: function () {\n    if (this.isBackgroundDetectorStarted && typeof document !== 'undefined') {\n      document.removeEventListener('visibilitychange', this.listenerReference)\n      this._reset()\n    }\n  },\n\n  _reset: function () {\n    this.isBackgroundDetectorStarted = false\n  },\n\n  _visibilityListener: function (e) {\n    if (typeof document !== 'undefined') {\n      var settings = this._getSettings()\n      if (document.visibilityState === 'hidden') {\n        this._toBackground(settings)\n      } else if (document.visibilityState === 'visible') { // to Foreground\n        this._toForeground(settings)\n      }\n    }\n  },\n\n  _toBackground: function (settings) {\n    this.isInBackground = true\n    if (this.plugin && this.plugin._adsAdapter) {\n      this.plugin._adsAdapter.stopChronoView()\n    }\n    if (typeof settings === 'string') {\n      switch (settings) {\n        case 'stop':\n          this._fireStop()\n          break\n        case 'pause':\n          this._firePause()\n          break\n      }\n      if (this.plugin.infinity.infinityStarted) {\n        this.lastBeatTime = new Date().getTime()\n        var difftime = this.plugin._beat.chrono.startTime ? (this.lastBeatTime - this.plugin._beat.chrono.startTime) : 0\n        this.plugin._sendBeat(difftime)\n        this.plugin._beat.stop()\n      }\n    }\n  },\n\n  _toForeground: function (settings) {\n    this.isInBackground = false\n    // ads\n    if (this.plugin && this.plugin._adsAdapter) {\n      this.plugin._adsAdapter.startChronoView()\n    }\n    // nothing for video yet\n    if (typeof settings === 'string' && settings) {\n      if (this.plugin.infinity.infinityStarted) {\n        var now = new Date().getTime()\n        if (now - this.lastBeatTime < this.plugin.sessionExpire) { // if session not expired\n          this.plugin._sendBeat(now - this.lastBeatTime)\n          this.plugin._beat.start()\n        } else { // session expired\n          this.plugin.infinity.newSession()\n        }\n      }\n    }\n  },\n\n  _getSettings: function () {\n    if (typeof this.plugin.options['background.settings'] === 'string' && this.plugin.options['background.settings']) {\n      return this.plugin.options['background.settings']\n    }\n    if (this.plugin.deviceDetector.isSmartTV()) {\n      return this.plugin.options['background.settings.tv']\n    }\n    if (this.plugin.deviceDetector.isDesktop()) {\n      return this.plugin.options['background.settings.desktop']\n    }\n    if (this.plugin.deviceDetector.isAndroid()) {\n      return this.plugin.options['background.settings.android']\n    }\n    if (this.plugin.deviceDetector.isIphone()) {\n      return this.plugin.options['background.settings.iOS']\n    }\n    if (this.plugin.deviceDetector.isPlayStation()) {\n      return this.plugin.options['background.settings.playstation']\n    }\n  },\n\n  _firePause: function () {\n    this._fireX('firePause')\n  },\n\n  _fireStop: function () {\n    this._fireX('fireStop')\n    this.plugin.fireStop()\n  },\n\n  _fireX: function (fireMethod) {\n    this.adsAdapter = this.plugin.getAdsAdapter()\n    if (this.adsAdapter) {\n      this.adsAdapter[fireMethod]()\n    }\n    this.contentAdapter = this.plugin.getAdapter()\n    if (this.contentAdapter) {\n      this.contentAdapter[fireMethod]()\n    }\n  },\n\n  canBlockStartCalls: function () {\n    return (\n      this.isInBackground &&\n      this.plugin.options['background.enabled'] === true &&\n      this._getSettings() // it is stop or pause\n    )\n  }\n})\n\nmodule.exports = BackgroundDetector\n","var YouboraObject = require('../object')\n/**\n * This static class provides device detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar DeviceDetector = YouboraObject.extend({\n  constructor: function () {\n    if (typeof navigator !== 'undefined' && navigator.userAgent) {\n      this._isSmartTVDevice = navigator.userAgent.toLowerCase().match(/smarttv/) ||\n        navigator.userAgent.toLowerCase().match(/smart-tv/) ||\n        navigator.userAgent.toLowerCase().match(/appletv/) ||\n        navigator.userAgent.toLowerCase().match(/apple tv/)\n      this._isPlaystationDevice = navigator.userAgent.match(/PlayStation/) !== null\n      this._isIphoneDevice = navigator.userAgent.match(/iPhone|iPad|iPod/i) !== null\n      this._isAndroidDevice = navigator.userAgent.match(/Android/) !== null\n      this._isSmartphoneDevice = !this._isSmartTVDevice && !this._isPlaystationDevice && (this._isIphoneDevice || this._isAndroidDevice)\n      this._isDesktopDevice = !this._isSmartphoneDevice && !this._isSmartTVDevice && !this._isPlaystationDevice\n    }\n  },\n\n  isIphone: function () {\n    return this._isIphoneDevice\n  },\n\n  isAndroid: function () {\n    return this._isAndroidDevice\n  },\n\n  isSmartphone: function () {\n    return this._isSmartphoneDevice\n  },\n\n  isDesktop: function () {\n    return this._isDesktopDevice\n  },\n\n  isSmartTV: function () {\n    return this._isSmartTVDevice\n  },\n\n  isPlayStation: function () {\n    return this._isPlaystationDevice\n  }\n})\n\nmodule.exports = DeviceDetector\n","var YouboraObject = require('../object')\n/**\n * This static class provides screen scrolling and resizing detection methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar ResizeScrollDetector = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.pluginref = plugin\n    this.listenerReference = this._changeListener.bind(this)\n    this.loadReference = this._loadListener.bind(this)\n    this.isEnabled = false\n\n    this.pageHeight = 0\n    this.maxHeight = 0\n    this.startDetection()\n  },\n\n  startDetection: function () {\n    if (!this.isEnabled && typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n      window.addEventListener('scroll', this.listenerReference)\n      window.addEventListener('resize', this.listenerReference)\n      window.addEventListener('load', this.loadReference)\n      this.isEnabled = true\n    }\n  },\n\n  stopDetection: function () {\n    if (this.isEnabled && typeof window !== 'undefined' && typeof window.removeEventListener === 'function') {\n      window.removeEventListener('scroll', this.listenerReference)\n      window.removeEventListener('resize', this.listenerReference)\n      window.removeEventListener('load', this.loadReference)\n      this.isEnabled = false\n    }\n  },\n\n  getScrollDepth: function () {\n    var ret = null\n    if (this.maxHeight && this.pageHeight) {\n      ret = Math.min(Math.trunc((this.maxHeight / this.pageHeight) * 100), 100)\n    }\n    return ret\n  },\n\n  _loadListener: function () {\n    if (typeof document !== 'undefined') {\n      var docEl = document.documentElement\n      if (docEl) {\n        this.pageHeight = Math.round(docEl.scrollHeight, docEl.clientHeight, docEl.offsetHeight)\n        this.maxHeight = window.innerHeight\n        this._updateCompletionRate()\n      }\n    }\n  },\n\n  _changeListener: function () {\n    if (this.pageHeight) {\n      var prevHeight = this.maxHeight\n      this.maxHeight = Math.max(this.maxHeight, window.pageYOffset + window.innerHeight)\n      if (prevHeight !== this.maxHeight) {\n        this._updateCompletionRate()\n      }\n    }\n    var adsAdapter = this.pluginref.getAdsAdapter()\n    if (adsAdapter && adsAdapter.flags.isStarted) {\n      if (!adsAdapter.getIsVisible()) {\n        adsAdapter.stopChronoView()\n      } else {\n        adsAdapter.startChronoView()\n      }\n    }\n  },\n\n  _updateCompletionRate: function () {\n    setTimeout(function () {\n      this.pluginref.storage.setSession('pageScrollDepth', this.getScrollDepth())\n    }.bind(this), 3000)\n  }\n})\n\nmodule.exports = ResizeScrollDetector\n","/* global ActiveXObject */\nvar YouboraObject = require('../object')\n\nvar DataExtractor = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n  },\n\n  getAllData: function () {\n    var returnValue = this.getNonRandomData()\n    returnValue.timestamp = this.getTimestamp()\n    return returnValue\n  },\n\n  getNonRandomData: function () {\n    var returnValue = {}\n    returnValue.userAgent = this.getUserAgent()\n    returnValue.threads = this.getVirtualCores()\n    returnValue.language = this.getLanguage()\n    returnValue.langList = this.getAvailableLanguages()\n    returnValue.resolution = this.getResolution()\n    returnValue.colorDepth = this.getColorDepth()\n    returnValue.deviceMemory = this.getMemory()\n    returnValue.touchscreen = this.getTouchscreen()\n    returnValue.localStorage = this.getLocalStorage()\n    returnValue.sessionStorage = this.getSessionStorage()\n    returnValue.cookiesAvailable = this.getCookiesAvailable()\n    returnValue.flashAvailable = this.getHasFlash()\n    returnValue.timeZone = this.getTimeZone()\n    returnValue.plugins = this.getPluginList()\n    return returnValue\n  },\n\n  // Getters\n  getUserAgent: function () {\n    return this._getNavigatorValue('userAgent')\n  },\n\n  getVirtualCores: function () {\n    return this._getNavigatorValue('hardwareConcurrency')\n  },\n\n  getLanguage: function () {\n    return this._getNavigatorValue('language')\n  },\n\n  getAvailableLanguages: function () {\n    return this._getNavigatorValue('languages')\n  },\n\n  getResolution: function () {\n    var ret = null\n    try {\n      if (this._getNavigatorValue('screen')) {\n        ret = navigator.screen.width.toString() + navigator.screen.height.toString()\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  },\n\n  getColorDepth: function () {\n    var ret = null\n    try {\n      if (this._getNavigatorValue('screen')) {\n        ret = navigator.screen.colorDepth\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  },\n\n  getMemory: function () {\n    return this._getNavigatorValue('deviceMemory')\n  },\n\n  getTouchscreen: function () {\n    return this._getNavigatorValue('maxTouchPoints') || false\n  },\n\n  getLocalStorage: function () {\n    var ret = false\n    try {\n      ret = typeof localStorage !== 'undefined'\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getSessionStorage: function () {\n    var ret = false\n    try {\n      ret = typeof sessionStorage !== 'undefined'\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getCookiesAvailable: function () {\n    return this._getNavigatorValue('cookieEnabled') || false\n  },\n\n  getHasFlash: function () {\n    var ret = false\n    try {\n      var plugins = this._getNavigatorValue('plugins')\n      ret = (plugins && typeof plugins['Shockwave Flash'] === 'object') || (typeof window !== 'undefined' && window.ActiveXObject && (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) !== false)\n    } catch (err) {\n      // ret = false\n    }\n    return ret\n  },\n\n  getPluginList: function () {\n    var ret = null\n    try {\n      var plugins = this._getNavigatorValue('plugins')\n      if (plugins && plugins.length !== 0) {\n        var pluginlist = ''\n        for (var counter = 0; counter < navigator.plugins.length; counter++) {\n          pluginlist += navigator.plugins[counter].description + ' ' + navigator.plugins[counter].filename + ' ' + navigator.plugins[counter].name + ' '\n        }\n        ret = pluginlist\n      }\n    } catch (err) {\n      // return null\n    }\n    return ret\n  },\n\n  getTimeZone: function () {\n    var ret = null\n    try {\n      var date = new Date()\n      ret = date.getTimezoneOffset().toString()\n    } catch (err) {\n      // return null\n    }\n    return ret\n  },\n\n  getTimestamp: function () {\n    return new Date().getTime()\n  },\n\n  _navigatorCheck: function () {\n    return typeof navigator !== 'undefined'\n  },\n\n  _getNavigatorValue: function (key) {\n    var ret = null\n    try {\n      if (this._navigatorCheck()) {\n        ret = navigator[key]\n      }\n    } catch (err) {\n      // ret = null\n    }\n    return ret\n  }\n\n})\n\nmodule.exports = DataExtractor\n","var DataExtractor = require('./dataextractor')\nvar YouboraObject = require('../object')\nvar MD5 = require('./md5')\n\nvar HashGenerator = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.plugin = plugin\n    this.dataExtractor = new DataExtractor()\n    this.key = this.getPreviousKey()\n  },\n\n  generateHashKey: function () {\n    if (!this.key) {\n      var data = this.dataExtractor.getAllData()\n      this.key = this._hashFunction(data)\n      this.plugin.storage.setLocal('youboraDeviceUUID', this.key)\n    }\n  },\n\n  getKey: function () {\n    if (!this.key) this.generateHashKey()\n    return this.key\n  },\n\n  _hashFunction: function (inputString) {\n    var outputString = inputString\n    if (typeof inputString !== 'string') {\n      outputString = JSON.stringify(inputString)\n    }\n    return MD5(outputString)\n  },\n\n  _reset: function () {\n    this.key = undefined\n  },\n\n  getPreviousKey: function () {\n    return this.plugin.storage.getLocal('youboraDeviceUUID')\n  }\n\n})\n\nmodule.exports = HashGenerator\n","/* istanbul ignore next */\nvar MD5 = function (s) { function L (k, d) { return (k << d) | (k >>> (32 - d)) } function K (G, k) { var I, d, F, H, x; F = (G & 2147483648); H = (k & 2147483648); I = (G & 1073741824); d = (k & 1073741824); x = (G & 1073741823) + (k & 1073741823); if (I & d) { return (x ^ 2147483648 ^ F ^ H) } if (I | d) { if (x & 1073741824) { return (x ^ 3221225472 ^ F ^ H) } else { return (x ^ 1073741824 ^ F ^ H) } } else { return (x ^ F ^ H) } } function r (d, F, k) { return (d & F) | ((~d) & k) } function q (d, F, k) { return (d & k) | (F & (~k)) } function p (d, F, k) { return (d ^ F ^ k) } function n (d, F, k) { return (F ^ (d | (~k))) } function u (G, F, aa, Z, k, H, I) { G = K(G, K(K(r(F, aa, Z), k), I)); return K(L(G, H), F) } function f (G, F, aa, Z, k, H, I) { G = K(G, K(K(q(F, aa, Z), k), I)); return K(L(G, H), F) } function D (G, F, aa, Z, k, H, I) { G = K(G, K(K(p(F, aa, Z), k), I)); return K(L(G, H), F) } function t (G, F, aa, Z, k, H, I) { G = K(G, K(K(n(F, aa, Z), k), I)); return K(L(G, H), F) } function e (G) { var Z; var F = G.length; var x = F + 8; var k = (x - (x % 64)) / 64; var I = (k + 1) * 16; var aa = Array(I - 1); var d = 0; var H = 0; while (H < F) { Z = (H - (H % 4)) / 4; d = (H % 4) * 8; aa[Z] = (aa[Z] | (G.charCodeAt(H) << d)); H++ } Z = (H - (H % 4)) / 4; d = (H % 4) * 8; aa[Z] = aa[Z] | (128 << d); aa[I - 2] = F << 3; aa[I - 1] = F >>> 29; return aa } function B (x) { var k = \"\", F = \"\", G, d; for (d = 0; d <= 3; d++) { G = (x >>> (d * 8)) & 255; F = \"0\" + G.toString(16); k = k + F.substr(F.length - 2, 2) } return k } function J (k) { k = k.replace(/rn/g, \"n\"); var d = \"\"; for (var F = 0; F < k.length; F++) { var x = k.charCodeAt(F); if (x < 128) { d += String.fromCharCode(x) } else { if ((x > 127) && (x < 2048)) { d += String.fromCharCode((x >> 6) | 192); d += String.fromCharCode((x & 63) | 128) } else { d += String.fromCharCode((x >> 12) | 224); d += String.fromCharCode(((x >> 6) & 63) | 128); d += String.fromCharCode((x & 63) | 128) } } } return d } var C = Array(); var P, h, E, v, g, Y, X, W, V; var S = 7, Q = 12, N = 17, M = 22; var A = 5, z = 9, y = 14, w = 20; var o = 4, m = 11, l = 16, j = 23; var U = 6, T = 10, R = 15, O = 21; s = J(s); C = e(s); Y = 1732584193; X = 4023233417; W = 2562383102; V = 271733878; for (P = 0; P < C.length; P += 16) { h = Y; E = X; v = W; g = V; Y = u(Y, X, W, V, C[P + 0], S, 3614090360); V = u(V, Y, X, W, C[P + 1], Q, 3905402710); W = u(W, V, Y, X, C[P + 2], N, 606105819); X = u(X, W, V, Y, C[P + 3], M, 3250441966); Y = u(Y, X, W, V, C[P + 4], S, 4118548399); V = u(V, Y, X, W, C[P + 5], Q, 1200080426); W = u(W, V, Y, X, C[P + 6], N, 2821735955); X = u(X, W, V, Y, C[P + 7], M, 4249261313); Y = u(Y, X, W, V, C[P + 8], S, 1770035416); V = u(V, Y, X, W, C[P + 9], Q, 2336552879); W = u(W, V, Y, X, C[P + 10], N, 4294925233); X = u(X, W, V, Y, C[P + 11], M, 2304563134); Y = u(Y, X, W, V, C[P + 12], S, 1804603682); V = u(V, Y, X, W, C[P + 13], Q, 4254626195); W = u(W, V, Y, X, C[P + 14], N, 2792965006); X = u(X, W, V, Y, C[P + 15], M, 1236535329); Y = f(Y, X, W, V, C[P + 1], A, 4129170786); V = f(V, Y, X, W, C[P + 6], z, 3225465664); W = f(W, V, Y, X, C[P + 11], y, 643717713); X = f(X, W, V, Y, C[P + 0], w, 3921069994); Y = f(Y, X, W, V, C[P + 5], A, 3593408605); V = f(V, Y, X, W, C[P + 10], z, 38016083); W = f(W, V, Y, X, C[P + 15], y, 3634488961); X = f(X, W, V, Y, C[P + 4], w, 3889429448); Y = f(Y, X, W, V, C[P + 9], A, 568446438); V = f(V, Y, X, W, C[P + 14], z, 3275163606); W = f(W, V, Y, X, C[P + 3], y, 4107603335); X = f(X, W, V, Y, C[P + 8], w, 1163531501); Y = f(Y, X, W, V, C[P + 13], A, 2850285829); V = f(V, Y, X, W, C[P + 2], z, 4243563512); W = f(W, V, Y, X, C[P + 7], y, 1735328473); X = f(X, W, V, Y, C[P + 12], w, 2368359562); Y = D(Y, X, W, V, C[P + 5], o, 4294588738); V = D(V, Y, X, W, C[P + 8], m, 2272392833); W = D(W, V, Y, X, C[P + 11], l, 1839030562); X = D(X, W, V, Y, C[P + 14], j, 4259657740); Y = D(Y, X, W, V, C[P + 1], o, 2763975236); V = D(V, Y, X, W, C[P + 4], m, 1272893353); W = D(W, V, Y, X, C[P + 7], l, 4139469664); X = D(X, W, V, Y, C[P + 10], j, 3200236656); Y = D(Y, X, W, V, C[P + 13], o, 681279174); V = D(V, Y, X, W, C[P + 0], m, 3936430074); W = D(W, V, Y, X, C[P + 3], l, 3572445317); X = D(X, W, V, Y, C[P + 6], j, 76029189); Y = D(Y, X, W, V, C[P + 9], o, 3654602809); V = D(V, Y, X, W, C[P + 12], m, 3873151461); W = D(W, V, Y, X, C[P + 15], l, 530742520); X = D(X, W, V, Y, C[P + 2], j, 3299628645); Y = t(Y, X, W, V, C[P + 0], U, 4096336452); V = t(V, Y, X, W, C[P + 7], T, 1126891415); W = t(W, V, Y, X, C[P + 14], R, 2878612391); X = t(X, W, V, Y, C[P + 5], O, 4237533241); Y = t(Y, X, W, V, C[P + 12], U, 1700485571); V = t(V, Y, X, W, C[P + 3], T, 2399980690); W = t(W, V, Y, X, C[P + 10], R, 4293915773); X = t(X, W, V, Y, C[P + 1], O, 2240044497); Y = t(Y, X, W, V, C[P + 8], U, 1873313359); V = t(V, Y, X, W, C[P + 15], T, 4264355552); W = t(W, V, Y, X, C[P + 6], R, 2734768916); X = t(X, W, V, Y, C[P + 13], O, 1309151649); Y = t(Y, X, W, V, C[P + 4], U, 4149444226); V = t(V, Y, X, W, C[P + 11], T, 3174756917); W = t(W, V, Y, X, C[P + 2], R, 718787259); X = t(X, W, V, Y, C[P + 9], O, 3951481745); Y = K(Y, h); X = K(X, E); W = K(W, v); V = K(V, g) } var i = B(Y) + B(X) + B(W) + B(V); return i.toLowerCase() }\nmodule.exports = MD5\n","var YouboraObject = require('./object')\nvar isArray = require('./mixins/isarray')\n\n/**\n * This class extends YouboraObject, adding event emitting/listening functionalities.\n *\n * @constructs Emitter\n * @extends youbora.YouboraObject\n * @memberof youbora\n */\nvar Emitter = YouboraObject.extend(\n  /** @lends youbora.Emitter.prototype */\n  {\n    /**\n     * Sets a listener to a given event. Use {@link emit} to trigger those events.\n     * Pass '*' to listen ALL events.\n     *\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event. Receives event and data.\n     * @return this\n     */\n    on: function (event, callback) {\n      this._listeners = this._listeners || {}\n      if (typeof callback === 'function') {\n        this._listeners[event] = this._listeners[event] || []\n        this._listeners[event].push(callback)\n        return this\n      }\n    },\n\n    /**\n     * Removes given callback from the listeners of this object.\n     *\n     * @param {string} event Name of the event.\n     * @param {function} callback Callback of the event.\n     * @return this\n     */\n    off: function (event, callback) {\n      this._listeners = this._listeners || {}\n\n      if (this._listeners[event]) {\n        var index = this._listeners[event].indexOf(callback)\n        if (index !== -1) {\n          this._listeners[event].splice(index, 1)\n        }\n      }\n      return this\n    },\n\n    /**\n     * Emits given event, triggering all the associated callbacks.\n     *\n     * @param {string} event Name of the event.\n     * @param {object} [data] Custom data to be sent to the callbacks.\n     * @return this\n     */\n    emit: function (event, data) {\n      this._listeners = this._listeners || {}\n      data = data || {}\n\n      if (isArray(this._listeners[event])) {\n        this._listeners[event].forEach(this._eachCallback.bind(this, event, data))\n      }\n      if (isArray(this._listeners['*'])) {\n        this._listeners['*'].forEach(this._eachCallback.bind(this, event, data))\n      }\n      return this\n    },\n\n    /**\n     * Travels through the listener list and executes them them.\n     *\n     * @private\n     */\n    _eachCallback: function (event, data, callback) {\n      if (typeof callback === 'function') {\n        var callbackArguments = {\n          type: event,\n          data: data,\n          target: this\n        }\n        callback(callbackArguments)\n      }\n    }\n  }\n)\n\nmodule.exports = Emitter\n","var Emitter = require('../emitter')\nvar Comm = require('../comm/communication')\nvar WrongTransform = require('../comm/transform/wrong')\nvar Util = require('../util')\n\nvar YouboraInfinity = Emitter.extend(\n  /** @lends youbora.Infinity.prototype */\n  {\n\n    /**\n     * This class is the base of youbora infinity. Every plugin will have an instance.\n     *\n     * @param {youbora.Plugin} plugin Parent plugin.\n     *\n     * @constructs youbora.Infinity\n     * @extends youbora.Emitter\n     * @memberof youbora\n     */\n    constructor: function (plugin) {\n      /** Parent {@link youbora.Plugin} reference. */\n      this._plugin = plugin\n      this.infinityStopped = false\n      this.infinityStarted = false\n    },\n\n    /**\n     * @alias youbora.Infinity.prototype.begin.\n     */\n    andBeyond: function () {\n      YouboraInfinity.prototype.begin.apply(this, arguments)\n    },\n\n    /**\n     * This method will start infinity logic, setting storage as needed.\n     * Will call fireSessionStart the first time and fireNav for every subsequent route change.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     * @param {boolean} [forceNewSession] boolean to force open a new session.\n     */\n    begin: function (dimensions, forceNewSession) {\n      forceNewSession = forceNewSession || false\n      if (forceNewSession) {\n        this._plugin.storage.removeStorages('infinityStarted')\n        this._plugin.storage.removeStorages('data')\n        this._plugin.restartViewTransform()\n      }\n      this._comm = new Comm(this._plugin)\n      this._comm.addTransform(this._plugin.viewTransform)\n      this._comm.addTransform(new WrongTransform(this._plugin))\n      if (this._plugin && this._plugin.storage && typeof this._plugin.storage.getLocal === 'function') {\n        this._registeredProperties = this._plugin.storage.getLocal('inifnityRegisteredProperties')\n      }\n\n      // Retrieve infinityStarted state. Otherwise it will always be false (at this stage) and session will always be started.\n      this.infinityStarted = (this._plugin.storage.getLocal('infinityStarted') === 'true')\n\n      if (this.infinityStopped || !this.infinityStarted) {\n        // send start session with navigation information at beginning\n        this.fireSessionStart(dimensions)\n      } else {\n        // if plugin is previously initiated (appAnalyticsStarted), fire Navigation directly\n        this.fireNav(dimensions)\n        this._sendExtraBeat()\n      }\n    },\n\n    _setLastActive: function () {\n      if (!this._firstActive) {\n        this._firstActive = this.getFirstActive()\n      }\n      this._plugin.storage.setStorages('lastactive', new Date().getTime())\n    },\n\n    getFirstActive: function () {\n      return Number(this._plugin.getLastActive()) || 0\n    },\n\n    /**\n     * Returns the current {@link youbora.Communication} instance.\n     *\n     * @returns {youbora.Communication} communication instance\n     */\n    getComm: function () {\n      return this._comm\n    },\n\n    // Fire\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireSessionStart: function (dimensions) {\n      if (this.infinityStopped) {\n        this._plugin.restartViewTransform()\n        this._comm = new Comm(this._plugin)\n        this._comm.addTransform(this._plugin.viewTransform)\n        this._comm.addTransform(new WrongTransform(this._plugin))\n        this.infinityStopped = false\n      }\n      if (!this.infinityStarted) {\n        this._plugin.storage.setLocal('infinityStarted', 'true')\n        this.infinityStarted = true\n        this.emit(YouboraInfinity.Event.SESSION_START, this._getParamsJson(dimensions, null, null, true, true))\n        this._setLastActive()\n      }\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireSessionStop: function (params) {\n      if (this.infinityStarted) {\n        this.infinityStopped = true\n        this.infinityStarted = false\n        this._plugin.storage.removeStorages('infinityStarted')\n        this.emit(YouboraInfinity.Event.SESSION_STOP, params)\n        this._plugin.storage.removeStorages('data')\n        this._plugin.storage.removeStorages('session')\n        this._plugin.storage.removeStorages('lastactive')\n      }\n    },\n\n    /**\n     * Stops the session and creates a new one\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    newSession: function (options, params) {\n      if (this.isActive()) {\n        if (this.infinityStarted) {\n          this.fireSessionStop()\n        } else {\n          this._plugin.storage.removeStorages('infinityStarted')\n          this._plugin.storage.removeStorages('data')\n          if (this._comm) this._comm.removeTransform(this._plugin.viewTransform)\n          this._plugin.restartViewTransform()\n          if (this._comm) this._comm.addTransform(this._plugin.viewTransform)\n        }\n      }\n      this._plugin.setOptions(options)\n      this.begin(params)\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireNav: function (dimensions) {\n      if (this.isActive()) {\n        this.infinityStarted = true\n        this.emit(YouboraInfinity.Event.NAV, this._getParamsJson(dimensions, null, null, true))\n      }\n    },\n\n    _sendExtraBeat: function () {\n      if (this._plugin && this._plugin._beat) {\n        var now = new Date().getTime()\n        var time = this._plugin._beat.chrono.startTime ? (now - this._plugin._beat.chrono.startTime) : 0\n        this._plugin._sendBeat(time)\n        this._plugin._beat.chrono.startTime = now\n      }\n      this._setLastActive()\n    },\n\n    /**\n     * Emits session start request.\n     *\n     * @param {Object} [params] Object of key:value params to add to the request.\n     */\n    fireEvent: function (eventName, dimensions, values, topLevelDimensions) {\n      if (this.infinityStarted) {\n        var builtParams = this._getParamsJson(dimensions, values, eventName)\n        Util.assign(builtParams.params, topLevelDimensions || {})\n        this.emit(YouboraInfinity.Event.EVENT, builtParams)\n        this._setLastActive()\n      }\n    },\n\n    /** Register properties sent by the User, to send in all the events\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    register: function (dimensions, values) {\n      this._registeredProperties = { dimensions: dimensions, values: values }\n      this._plugin.storage.setLocal('inifnityRegisteredProperties', JSON.stringify(this._registeredProperties))\n    },\n\n    /** Calls register if registeredProperties is empty\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    registerOnce: function (dimensions, values) {\n      if (!this._registeredProperties) {\n        this.register(dimensions, values)\n      }\n    },\n\n    /** Unregister properties registered with register()\n    *\n    * @memberof youbora.Infinity.prototype\n    */\n    unregister: function () {\n      this._registeredProperties = null\n      this._plugin.storage.removeLocal('inifnityRegisteredProperties')\n    },\n\n    /**\n     * Splits params in dimensions (strings) and values (numbers)\n     *\n     * @param {Object} [params] Object of key:value params to split before adding to request.\n     */\n    _getParamsJson: function (dimensions, values, eventName, isNavigaton, isStart) {\n      var returnparams = {}\n      if (eventName) returnparams.name = eventName\n      returnparams.dimensions = dimensions || {}\n      returnparams.values = values || {}\n      if (this._registeredProperties) {\n        for (var key in this._registeredProperties.dimensions) {\n          returnparams.dimensions[key] = this._registeredProperties.dimensions[key]\n        }\n        for (var key2 in this._registeredProperties.values) {\n          returnparams.values[key2] = this._registeredProperties.values[key2]\n        }\n      }\n      var paramsObject = { params: returnparams }\n      if (isNavigaton) {\n        if (paramsObject.params.dimensions.page) {\n          paramsObject.params.page = paramsObject.params.dimensions.page\n          delete paramsObject.params.dimensions.page\n        }\n        if (paramsObject.params.dimensions.route) {\n          paramsObject.params.route = paramsObject.params.dimensions.route\n          delete paramsObject.params.dimensions.route\n        }\n        if (!isStart) {\n          delete paramsObject.params.dimensions\n        }\n        delete paramsObject.params.values\n      }\n      return paramsObject\n    },\n\n    isActive: function () {\n      var started = this._plugin.storage.getLocal('infinityStarted')\n      if (this.infinityStarted || (started && started !== 'false')) {\n        return true\n      }\n      var now = new Date().getTime()\n      if (Number(this._plugin.getLastActive()) + this._plugin.sessionExpire > now) {\n        return true\n      }\n      return false\n    }\n  },\n  /** @lends youbora.Plugin */\n  {\n    // Static Memebers //\n    /**\n     * List of events that could be fired\n     * @enum\n     * @event\n     */\n    Event: {\n      NAV: 'nav',\n      SESSION_START: 'sessionStart',\n      SESSION_STOP: 'sessionStop',\n      BEAT: 'beat',\n      EVENT: 'event'\n    }\n  }\n)\n\nmodule.exports = YouboraInfinity\n","var Emitter = require('./emitter')\nvar isArray = require('./mixins/isarray')\n\n/**\n * Static Log class for YouboraLib\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Log = {\n\n  _emitter: new Emitter(),\n\n  /** Exposes {@link youbora.EvenfulObject.on} */\n  on: function () { Log._emitter.on.apply(Log._emitter, arguments) },\n  /** Exposes {@link youbora.EvenfulObject.off} */\n  off: function () { Log._emitter.off.apply(Log._emitter, arguments) },\n  /** Exposes {@link youbora.EvenfulObject.emit} */\n  emit: function () { Log._emitter.emit.apply(Log._emitter, arguments) },\n\n  /**\n   * Enum for log levels\n   * @enum\n   */\n  Level: {\n    /** No console outputs */\n    SILENT: 6,\n    /** Console will show errors */\n    ERROR: 5,\n    /** Console will show warnings */\n    WARNING: 4,\n    /** Console will show notices (ie: life-cyrcle logs) */\n    NOTICE: 3,\n    /** Console will show debug messages (ie: player events) */\n    DEBUG: 2,\n    /** Console will show verbose messages (ie: Http Requests) */\n    VERBOSE: 1\n  },\n\n  /**\n   * Enum for events\n   * @enum\n   */\n  Event: {\n    /** Sent each time a messaged is issued, even if log level does not handle it. */\n    LOG: 'log'\n  },\n\n  /**\n   * Only logs of this imporance or higher will be shown.\n   * @default youbora.Log.Levels.ERROR\n   * @see {@link youbora.Log.Levels}\n   */\n  logLevel: 5,\n\n  /**\n   * If true, console logs will always be outputed without colors (for debbugin in devices).\n   * @default false\n   */\n  plainLogs: false,\n\n  /**\n   * Returns a console message\n   *\n   * @private\n   * @param {(string|error|array)} msg Message string, error object or array of messages.\n   * @param {Log.Levels} [level=Log.Levels.NOTICE] Defines the level of the error sent.\n   * Only errors with higher or equal level than Log.logLevel will be displayed.\n   * @param {string} [color=darkcyan] Color of the header\n   * @see {@link Youbora.Log.debugLevel}\n   */\n  report: function (msg, level, color) {\n    if (typeof console !== 'undefined' && console.log && typeof document !== 'undefined') {\n      level = level || Log.Level.NOTICE\n      color = color || 'darkcyan'\n\n      var letters = {\n        5: 'e', // Error\n        4: 'w', // Warning\n        3: 'n', // Notice\n        2: 'd', // Debug\n        1: 'v' // Verbose\n      }\n\n      var letter = letters[level]\n      var prefix = '[Youbora]' + Log._getCurrentTime() + ' ' + letter + ':'\n\n      this.emit('log', { level: level, msg: msg, prefix: prefix })\n\n      // Show messages in actual console if level is enought\n      if (Log.logLevel <= level) {\n        if (Log.plainLogs || document.documentMode) { // document.documentMode exits only in IE\n          // Plain log for IE and devices\n          Log._plainReport(msg, prefix)\n        } else {\n          // choose log method\n          var logMethod\n          if (level === Log.Level.ERROR && console.error) {\n            logMethod = console.error\n          } else if (level === Log.Level.WARNING && console.warn) {\n            logMethod = console.warn\n          } else if (level === Log.Level.DEBUG && console.debug) {\n            logMethod = console.debug\n          } else {\n            logMethod = console.log\n          }\n\n          // print message\n          prefix = '%c' + prefix\n          if (isArray(msg)) {\n            msg.splice(0, 0, prefix, 'color: ' + color)\n            logMethod.apply(console, msg)\n          } else {\n            logMethod.call(console, prefix, 'color: ' + color, msg)\n          }\n        }\n      }\n    }\n  },\n\n  /**\n   * Returns the current time in format hh:mm:ss.mmm (with trailing 0s)\n   * @private\n   * @return {string} Current time.\n   */\n  _getCurrentTime: function () {\n    var d = new Date()\n    var hh = ('0' + d.getDate()).slice(-2)\n    var mm = ('0' + d.getMinutes()).slice(-2)\n    var ss = ('0' + d.getSeconds()).slice(-2)\n    var mmm = ('00' + d.getMilliseconds()).slice(-3)\n    return '[' + hh + ':' + mm + ':' + ss + '.' + mmm + ']'\n  },\n\n  /**\n   * Returns a console message without style\n   *\n   * @private\n   * @param {(string|object|array)} msg Message string, object or array of messages.\n   * @param {string} prefix Prefix of the message.\n   */\n  _plainReport: function (msg, prefix) {\n    if (msg instanceof Array) {\n      for (var m in msg) {\n        Log._plainReport(msg[m], prefix)\n      }\n    } else {\n      if (typeof msg === 'string') {\n        console.log(prefix + ' ' + msg)\n      } else {\n        console.log(prefix + ' <next line>')\n        console.log(msg)\n      }\n    }\n  },\n\n  /**\n   * Sends an error (level 1) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  error: function () {\n    Log.report([].slice.call(arguments), Log.Level.ERROR, 'darkred')\n  },\n\n  /**\n   * Sends a warning (level 2) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  warn: function () {\n    Log.report([].slice.call(arguments), Log.Level.WARNING, 'darkorange')\n  },\n\n  /**\n   * Sends a notice (level 3) console log.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  notice: function () {\n    Log.report([].slice.call(arguments), Log.Level.NOTICE, 'darkgreen')\n  },\n\n  /**\n   * Sends a debug message (level 4) to console.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  debug: function () {\n    Log.report([].slice.call(arguments), Log.Level.DEBUG, 'indigo')\n  },\n\n  /**\n   * Sends a verbose message (level 5) to console.\n   * Supports unlimited arguments: (\"this\", \"is\", \"a\", \"message\")\n   * @memberof $YB\n   * @see {@link $YB.report}\n   */\n  verbose: function () {\n    Log.report([].slice.call(arguments), Log.Level.VERBOSE, 'navy')\n  },\n\n  /**\n   * This function is automatically executed at youboralib's init.\n   * Will search inside window.location.search for attribute 'youbora-debug=X'.\n   * X can have one of these values, that will modify LogLevel.\n   * 6: SILENT,\n   * 5: ERROR,\n   * 4: WARNING,\n   * 3: NOTICE,\n   * 2: DEBUG,\n   * 1: VERBOSE\n   *\n   * If youbora-console=plain is present, plainLogs will be set to true.\n   */\n  loadLevelFromUrl: function () {\n    if (typeof window !== 'undefined' && window.location) {\n      this._parseLevelFromUrl(window.location.search)\n    }\n  },\n\n  _parseLevelFromUrl: function (url) {\n    if (url) {\n      var m = /\\?.*&*youbora-debug=(.+)/i.exec(url)\n      if (m !== null) {\n        Log.logLevel = m[1]\n      }\n\n      var m2 = /\\?.*&*youbora-debug=plain/i.exec(url)\n      if (m2 !== null) {\n        Log.plainLogs = true\n      }\n    }\n  }\n}\n\nmodule.exports = Log\n","/**\n * See Object.assign.\n *\n * @memberof youbora.Util\n */\nmodule.exports = function (target) {\n  if (target === undefined || target === null) {\n    throw new TypeError('Cannot convert undefined or null to object')\n  }\n\n  var output = Object(target)\n  for (var index = 1; index < arguments.length; index++) {\n    var source = arguments[index]\n    if (source !== undefined && source !== null) {\n      for (var nextKey in source) {\n        if (source.hasOwnProperty(nextKey)) { // eslint-disable-line no-prototype-builtins\n          output[nextKey] = source[nextKey]\n        }\n      }\n    }\n  }\n  return output\n}\n","var F = function () { }\n\n/** See Object.create. */\nmodule.exports = function (o) {\n  if (arguments.length > 1) {\n    throw Error('Second argument not supported')\n  }\n  if (o === null) {\n    throw Error('Cannot set a null [[Prototype]]')\n  }\n  if (typeof o !== 'object') {\n    throw TypeError('Argument must be an object')\n  }\n  F.prototype = o\n  return new F()\n}\n","/**\n * See Array.isArray.\n * @memberof youbora.Util\n */\nmodule.exports = function (obj) {\n  return Object.prototype.toString.call(obj) === '[object Array]'\n}\n","/* global PerformanceObserver */\nvar YouboraObject = require('../object')\nvar RUMSpeedIndex = require('./speedIndex')\n\n/**\n * This static class provides information about the load times of the page\n *\n * @constructs YouboraObject\n * @extends youbora.YouboraObject\n * @memberof youbora\n *\n */\nvar BrowserLoadTimes = YouboraObject.extend({\n  constructor: function (plugin) {\n    this.infinity = plugin.infinity\n    this.timeObject = null\n    this.playerSetup = null\n    this.perfObject = null\n    this.myTimesObject = {}\n\n    if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n      window.addEventListener('load', this._windowLoaded.bind(this))\n      if (window.performance && window.performance.timing) {\n        try {\n          if (typeof window.performance.getEntriesByType === 'function') {\n            this.perfObject = window.performance\n          }\n        } catch (err) {\n          // Nothing\n        }\n        this.timeObject = window.performance.timing\n      }\n    }\n    try {\n      if (typeof PerformanceObserver === 'function') {\n        var observer = new PerformanceObserver(function (list, obj) {\n          var entries = list.getEntries()\n          this.myTimesObject.largestContentfulPaint = entries[entries.length - 1].renderTime\n        }.bind(this))\n        if (PerformanceObserver.supportedEntryTypes.indexOf('largest-contentful-paint') > -1) {\n          observer.observe({ entryTypes: ['largest-contentful-paint'] })\n        }\n      }\n    } catch (err) {\n      // Cant use PerformanceObserver, entryTypes...\n    }\n  },\n\n  _windowLoaded: function () {\n    this.myTimesObject.onLoad = new Date().getTime()\n    this._getEnoughFPS()\n    setTimeout(this._fireLoadTimesEvent.bind(this), 1000)\n  },\n\n  _fireLoadTimesEvent: function () {\n    this._getLastMetrics()\n    this.infinity.fireEvent('loadTimes', {}, this._getAllValues())\n  },\n\n  _getAllValues: function () {\n    var ret = {\n      // Time between the navigation starts and the page loadEventEnd\n      PageLoadTime: this.getPageLoadTime(),\n      // Domain lookup time\n      DNSTime: this.getDnsTime(),\n      // Connection time\n      TCPTime: this.getTcpTime(),\n      // Handshake (https) connection time\n      HandshakeTime: this.getHandshakeTime(),\n      // Time between navigation starts and DOM is ready\n      DomReadyTime: this.getDomReadyTime(),\n      // Time between navigation start and beginning of the backend response\n      BackendTime: this.getBackendTime(),\n      // Time between navigation starts and page load event\n      FrontendTime: this.getFrontendTime(),\n      // The maximum of First Paint / First Contentful Paint and domContentLoadedEventEnd\n      VisualReady: this.getTimeToVisuallyReady(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/Time_to_interactive\n      TimeToInteractive: this.getTimeToInteractive(),\n      // Accumulated time to download all the JS files\n      JsTime: this.getJSTime(),\n      // Accumulated time to download all the CSS files\n      CssTime: this.getCSSTime(),\n      // Accumulated time to download all the images\n      ImageTime: this.getImageTime(),\n      // Accumulated time to download all the fonts\n      FontTime: this.getFontTime(),\n      // Average latency of all the file requests\n      AvgReqLatency: this.getAvgReqLatency(),\n      // Highest latency of all the file requests\n      MaxReqLatency: this.getMaxReqLatency(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/First_paint\n      FirstPaint: this.getFirstPaint(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/First_contentful_paint\n      FirstContentfulPaint: this.getFirstContentfulPaint(),\n      // https://rockcontent.com/blog/largest-contentful-paint/\n      LargestContentfulPaint: this.getLargestContentfulPaint(),\n      // https://developer.mozilla.org/en-US/docs/Glossary/Speed_index\n      SpeedIndex: this.getSpeedIndex()\n    }\n    for (var key in ret) {\n      if (ret[key] === null || ret[key] === undefined || ret[key] < 0) {\n        delete ret[key]\n      } else {\n        ret[key] = Math.round(ret[key])\n      }\n    }\n    return ret\n  },\n\n  // Getters\n\n  getPageLoadTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.loadEventEnd - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getPlayerStartupTime: function () {\n    var ret = null\n    if (this.timeObject && this.playerSetup) {\n      ret = this.playerSetup - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getDnsTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.domainLookupEnd - this.timeObject.domainLookupStart\n    }\n    return ret\n  },\n\n  getTcpTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.connectEnd - this.timeObject.connectStart\n    }\n    return ret\n  },\n\n  getHandshakeTime: function () {\n    var ret = null\n    if (this.timeObject && this.timeObject.secureConnectionStart) {\n      ret = this.timeObject.connectEnd - this.timeObject.secureConnectionStart\n    }\n    return ret\n  },\n\n  getDomReadyTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.domComplete - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getBackendTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.timeObject.responseStart - this.timeObject.navigationStart\n    }\n    return ret\n  },\n\n  getFrontendTime: function () {\n    var ret = null\n    if (this.timeObject) {\n      ret = this.myTimesObject.onLoad - this.timeObject.responseStart\n    }\n    return ret\n  },\n\n  getTimeToVisuallyReady: function () {\n    var ret = this.myTimesObject.firstPaint || 0\n    if (this.timeObject) {\n      return Math.max(\n        ret,\n        this.timeObject.domContentLoadedEventEnd - this.timeObject.navigationStart || 0\n      // this.myTimesObject.heroImages - this.timeObject.navigationStart || 0\n      )\n    }\n    return ret || null\n  },\n\n  getTimeToInteractive: function () {\n    if (this.myTimesObject.fps && this.getTimeToVisuallyReady()) {\n      return Math.max(this.myTimesObject.fps, this.getTimeToVisuallyReady())\n    } else {\n      setTimeout(function () { this.getTimeToInteractive() }.bind(this), 500)\n    }\n  },\n\n  getJSTime: function () {\n    return this._getXTime('script')\n  },\n\n  getCSSTime: function () {\n    return this._getXTime('css')\n  },\n\n  getImageTime: function () {\n    return this._getXTime('img')\n  },\n\n  getFontTime: function () {\n    return this._getXTime('css', ['.woff', '.otf', '.ttf'])\n  },\n\n  getAvgReqLatency: function () {\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var count = 0\n        var latency = 0\n        var scripts = this.perfObject.getEntriesByType('resource')\n        for (var i in scripts) {\n          if (scripts[i].requestStart && scripts[i].responseStart) {\n            latency += scripts[i].responseStart - scripts[i].requestStart\n          }\n          count++\n        }\n        return latency / count\n      }\n    } catch (err) {\n      // Nothing\n    }\n    return null\n  },\n\n  getFirstPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.firstPaint : null\n  },\n\n  getFirstContentfulPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.firstContentfulPaint : null\n  },\n\n  getLargestContentfulPaint: function () {\n    return this.myTimesObject ? this.myTimesObject.largestContentfulPaint : null\n  },\n\n  getMaxReqLatency: function () {\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var scripts = this.perfObject.getEntriesByType('resource')\n        var latency = 0\n        for (var i in scripts) {\n          if (scripts[i].requestStart && scripts[i].responseStart) {\n            latency = Math.max(latency, scripts[i].responseStart - scripts[i].requestStart)\n          }\n        }\n        return latency\n      }\n    } catch (err) {\n      // Nothing\n    }\n    return null\n  },\n\n  getSpeedIndex: function () {\n    var ret = null\n    if (typeof window !== 'undefined' && window.performance && typeof window.performance.getEntriesByType === 'function') {\n      try {\n        ret = RUMSpeedIndex()\n      } catch (e) {\n        // nothing\n      }\n    }\n    return ret\n  },\n\n  _getXTime: function (type, validExtensions) {\n    var ret = 0\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var scripts = this.perfObject.getEntriesByType('resource')\n        for (var i in scripts) {\n          if (scripts[i].initiatorType === type) {\n            if (!validExtensions) {\n              ret += scripts[i].duration\n            } else {\n              var valid = false\n              for (var ext in validExtensions) {\n                if (scripts[i].name.indexOf(validExtensions[ext] > 0)) {\n                  valid = true\n                }\n              }\n              if (valid) {\n                ret += scripts[i].duration\n              }\n            }\n          }\n        }\n      }\n    } catch (err) {\n    // Nothing\n    }\n    return Math.round(ret) || null\n  },\n\n  _getLastMetrics: function () {\n    var firstPaint = null\n    var contentfulPaint = null\n    try {\n      if (this.perfObject && typeof this.perfObject.getEntriesByType === 'function') {\n        var entries = this.perfObject.getEntriesByType('paint')\n        for (var i in entries) {\n          if (entries[i].name === 'first-paint') {\n            firstPaint = entries[i].startTime\n          } else if (entries[i].name === 'first-contentful-paint') {\n            contentfulPaint = entries[i].startTime\n          }\n        }\n      }\n    } catch (err) {\n    // Nothing\n    }\n    // First paint\n    if (!firstPaint && this.timeObject) {\n      firstPaint = this.timeObject.msFirstPaint - this.timeObject.navigationStart\n    }\n    // TODO first paint for firefox\n    this.myTimesObject.firstPaint = firstPaint\n    // First contentful paint\n    this.myTimesObject.firstContentfulPaint = contentfulPaint\n    // Others\n    this.getTimeToInteractive()\n  },\n\n  _getEnoughFPS: function () {\n    if (this.timeObject && typeof window !== 'undefined') {\n      var req = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function () {}\n      this.preFPS = new Date().getTime()\n      req(function () {\n        var now = new Date().getTime()\n        if (now < this.preFPS + 50) {\n          this.myTimesObject.fps = now - this.timeObject.navigationStart\n        } else {\n          setTimeout(function () { return this._getEnoughFPS() }.bind(this), 50)\n        }\n      }.bind(this))\n    } else {\n      return true\n    }\n  },\n\n  // Setters\n\n  setPlayerSetupTime: function () {\n    this.playerSetup = this.playerSetup || new Date().getTime()\n  }\n})\n\nmodule.exports = BrowserLoadTimes\n","/* global Streamroot, peer5, teltoo, CdnBalancerStats */\nvar YouboraObject = require('../object')\n/**\n * This static class provides p2p and cdn network traffic information for\n * Streamroot, Peer5 and EasyBroadcast\n *\n * @constructs YouboraObject\n * @extends youbora.YouboraObject\n * @memberof youbora\n *\n */\nvar HybridNetowrk = YouboraObject.extend({\n  /** Returns CDN traffic bytes using NPAW balancer, streamroot, peer5 or teltoo. Otherwise null */\n  getCdnTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn) {\n      ret = CdnBalancerStats.cdn.totalDownloadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('cdn', false) || this._getStreamrootInstanceObject('cdnDownload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalHttpDownloaded\n    } else if (typeof teltoo !== 'undefined' && teltoo.getStats) {\n      var stats = teltoo.getStats()\n      ret = stats.totalReceivedBytes - stats.p2pReceivedBytes\n    }\n    return ret\n  },\n\n  /** Returns CDN traffic when using multiple cdns, available only for NPAW solution. Otherwise null */\n  getMultiCdnInfo: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn && CdnBalancerStats.cdn.cdns) {\n      var p2p = CdnBalancerStats.p2p\n      ret = {\n        P2P: {\n          downloaded_bytes: p2p.downloadedBytes,\n          uploaded_bytes: p2p.uploadedBytes,\n          downloaded_chunks: p2p.downloadedSegments,\n          uploaded_chunks: p2p.uploadedSegments,\n          errors: p2p.failedRequests ? p2p.failedRequests.total : 0,\n          missed_downloaded_chunks: p2p.failedRequests ? p2p.failedRequests.absent : 0,\n          timeout_errors: p2p.failedRequests ? p2p.failedRequests.timeout : 0,\n          other_errors: p2p.failedRequests ? p2p.failedRequests.error : 0,\n          late_uploaded_chunks: p2p.discardedUploadedSegments,\n          late_uploaded_bytes: p2p.discardedUploadedBytes,\n          late_downloaded_bytes: p2p.discardedDownloadedBytes,\n          time: p2p.downloadMillis,\n          active_peers: p2p.activePeers,\n          peers: p2p.totalPeers\n        }\n      }\n      CdnBalancerStats.cdn.cdns.forEach(function (cdn) {\n        ret[cdn.name] = {\n          downloaded_bytes: cdn.bytes,\n          downloaded_chunks: cdn.chunks,\n          errors: cdn.failures,\n          time: cdn.downloadMillis\n        }\n      })\n    }\n    return ret\n  },\n\n  /** Returns segment duration using NPAW balancer API. Otherwise null */\n  getSegmentDuration: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.segmentDuration) {\n      return CdnBalancerStats.segmentDuration\n    }\n    return ret\n  },\n\n  /** Returns CDN balancer API response id, available only for NPAW solution. Otherwise null */\n  getBalancerResponseId: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.cdn) {\n      return CdnBalancerStats.cdn.responseUUID\n    }\n    return ret\n  },\n\n  /** Returns P2P traffic bytes using NPAW balancer, streamroot, peer5 or teltoo. Otherwise null */\n  getP2PTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.downloadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('p2p', true) || this._getStreamrootInstanceObject('dnaDownload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalP2PDownloaded\n    } else if (typeof teltoo !== 'undefined' && teltoo.getStats) {\n      ret = teltoo.getStats().p2pReceivedBytes\n    }\n    return ret\n  },\n\n  /** Returns P2P traffic sent in bytes, using NPAW balancer, streamroot or peer5. Otherwise null */\n  getUploadTraffic: function () {\n    var ret = null\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.uploadedBytes\n    } else if (typeof Streamroot !== 'undefined') {\n      ret = this._getStreamrootPeerObject('upload', true) || this._getStreamrootInstanceObject('dnaUpload')\n    } else if (typeof peer5 !== 'undefined' && peer5.getStats) {\n      ret = peer5.getStats().totalP2PUploaded\n    }\n    return ret\n  },\n\n  /** Returns if P2P is enabled, using NPAW balancer, streamroot or peer5. Otherwise null */\n  getIsP2PEnabled: function () {\n    var ret = false\n    if (typeof CdnBalancerStats !== 'undefined' && CdnBalancerStats.p2p) {\n      ret = CdnBalancerStats.p2p.downloadEnabled\n    } else if (typeof Streamroot !== 'undefined') {\n      if (Streamroot.p2pAvailable && Streamroot.peerAgents) {\n        for (var agent in Streamroot.peerAgents) {\n          ret = ret || Streamroot.peerAgents[agent].isP2PEnabled\n        }\n      } else if (Streamroot.instances) {\n        Streamroot.instances.forEach(function (instance) {\n          ret = ret || instance.dnaDownloadEnabled || instance.dnaUploadEnabled\n        })\n      }\n    } else if (typeof peer5 !== 'undefined' && peer5.isEnabled) {\n      ret = peer5.isEnabled()\n    } else if (typeof teltoo !== 'undefined') {\n      ret = true\n    }\n    return ret\n  },\n\n  _getStreamrootPeerObject: function (objectName, check) {\n    var ret = null\n    if (Streamroot.p2pAvailable && Streamroot.peerAgents) {\n      for (var agent in Streamroot.peerAgents) {\n        var agentInst = Streamroot.peerAgents[agent]\n        if (agentInst.stats && (!check || agentInst.isP2PEnabled)) {\n          ret += agentInst.stats[objectName]\n        }\n      }\n    }\n    return ret\n  },\n\n  _getStreamrootInstanceObject: function (objectName) {\n    var ret = null\n    if (Streamroot.instances) {\n      Streamroot.instances.forEach(function (instance) {\n        if (instance.stats && instance.stats.currentContent) {\n          ret += instance.stats.currentContent[objectName]\n        }\n      })\n    }\n    return ret\n  }\n})\n\nmodule.exports = HybridNetowrk\n","/* istanbul ignore next */\n/******************************************************************************\nCopyright (c) 2014, Google Inc.\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n    * Neither the name of the <ORGANIZATION> nor the names of its contributors\n    may be used to endorse or promote products derived from this software\n    without specific prior written permission.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n******************************************************************************/\n\n/******************************************************************************\n*******************************************************************************\n  Calculates the Speed Index for a page by:\n  - Collecting a list of visible rectangles for elements that loaded\n    external resources (images, background images, fonts)\n  - Gets the time when the external resource for those elements loaded\n    through Resource Timing\n  - Calculates the likely time that the background painted\n  - Runs the various paint rectangles through the SpeedIndex calculation:\n    https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metrics/speed-index\n  TODO:\n  - Improve the start render estimate\n  - Handle overlapping rects (though maybe counting the area as multiple paints\n    will work out well)\n  - Detect elements with Custom fonts and the time that the respective font\n    loaded\n  - Better error handling for browsers that don't support resource timing\n*******************************************************************************\n******************************************************************************/\n\nvar RUMSpeedIndex = function (win) {\n  win = win || window\n  var doc = win.document\n\n  /****************************************************************************\n    Support Routines\n  ****************************************************************************/\n  // Get the rect for the visible portion of the provided DOM element\n  var GetElementViewportRect = function (el) {\n    var intersect = false\n    if (el.getBoundingClientRect) {\n      var elRect = el.getBoundingClientRect()\n      intersect = {\n        top: Math.max(elRect.top, 0),\n        left: Math.max(elRect.left, 0),\n        bottom: Math.min(elRect.bottom, (win.innerHeight || doc.documentElement.clientHeight)),\n        right: Math.min(elRect.right, (win.innerWidth || doc.documentElement.clientWidth))\n      }\n      if (intersect.bottom <= intersect.top ||\n          intersect.right <= intersect.left) {\n        intersect = false\n      } else {\n        intersect.area = (intersect.bottom - intersect.top) * (intersect.right - intersect.left)\n      }\n    }\n    return intersect\n  }\n\n  // Check a given element to see if it is visible\n  var CheckElement = function (el, url) {\n    if (url) {\n      var rect = GetElementViewportRect(el)\n      if (rect) {\n        rects.push({\n          url: url,\n          area: rect.area,\n          rect: rect\n        })\n      }\n    }\n  }\n\n  // Get the visible rectangles for elements that we care about\n  var GetRects = function () {\n    // Walk all of the elements in the DOM (try to only do this once)\n    var elements = doc.getElementsByTagName('*')\n    var re = /url\\(.*(http.*)\\)/ig\n    for (var i = 0; i < elements.length; i++) {\n      var el = elements[i]\n      var style = win.getComputedStyle(el)\n\n      // check for Images\n      if (el.tagName === 'IMG') {\n        CheckElement(el, el.src)\n      }\n      // Check for background images\n      if (style['background-image']) {\n        re.lastIndex = 0\n        var matches = re.exec(style['background-image'])\n        if (matches && matches.length > 1) { CheckElement(el, matches[1].replace('\"', '')) }\n      }\n      // recursively walk any iFrames\n      if (el.tagName === 'IFRAME') {\n        try {\n          var rect = GetElementViewportRect(el)\n          if (rect) {\n            var tm = RUMSpeedIndex(el.contentWindow)\n            if (tm) {\n              rects.push({\n                tm: tm,\n                area: rect.area,\n                rect: rect\n              })\n            }\n          }\n        } catch (e) {\n        }\n      }\n    }\n  }\n\n  // Get the time at which each external resource loaded\n  var GetRectTimings = function () {\n    var timings = {}\n    var requests = win.performance.getEntriesByType('resource')\n    for (var i = 0; i < requests.length; i++) { timings[requests[i].name] = requests[i].responseEnd }\n    for (var j = 0; j < rects.length; j++) {\n      if (!('tm' in rects[j])) { rects[j].tm = timings[rects[j].url] !== undefined ? timings[rects[j].url] : 0 }\n    }\n  }\n\n  // Get the first paint time.\n  var GetFirstPaint = function () {\n    // If the browser supports a first paint event, just use what the browser reports\n    if ('msFirstPaint' in win.performance.timing) { firstPaint = win.performance.timing.msFirstPaint - navStart }\n    var paintMetrics = win.performance.getEntriesByType('paint')\n    for (var k = 0; k < paintMetrics.length; k++) {\n      if (paintMetrics[k].name === 'first-paint') {\n        firstPaint = paintMetrics[k].startTime\n      }\n    }\n    // For browsers that don't support first-paint or where we get insane values,\n    // use the time of the last non-async script or css from the head.\n    if (firstPaint === undefined || firstPaint < 0 || firstPaint > 120000) {\n      firstPaint = win.performance.timing.responseStart - navStart\n      var headURLs = {}\n      var headElements = doc.getElementsByTagName('head')[0].children\n      for (var i = 0; i < headElements.length; i++) {\n        var el = headElements[i]\n        if (el.tagName === 'SCRIPT' && el.src && !el.async) { headURLs[el.src] = true }\n        if (el.tagName === 'LINK' && el.rel === 'stylesheet' && el.href) { headURLs[el.href] = true }\n      }\n      var requests = win.performance.getEntriesByType('resource')\n      var doneCritical = false\n      for (var j = 0; j < requests.length; j++) {\n        if (!doneCritical &&\n            headURLs[requests[j].name] &&\n           (requests[j].initiatorType === 'script' || requests[j].initiatorType === 'link')) {\n          var requestEnd = requests[j].responseEnd\n          if (firstPaint === undefined || requestEnd > firstPaint) { firstPaint = requestEnd }\n        } else {\n          doneCritical = true\n        }\n      }\n    }\n    firstPaint = Math.max(firstPaint, 0)\n  }\n\n  // Sort and group all of the paint rects by time and use them to\n  // calculate the visual progress\n  var CalculateVisualProgress = function () {\n    var paints = { 0: 0 }\n    var total = 0\n    for (var i = 0; i < rects.length; i++) {\n      var tm = firstPaint\n      if ('tm' in rects[i] && rects[i].tm > firstPaint) { tm = rects[i].tm }\n      if (paints[tm] === undefined) { paints[tm] = 0 }\n      paints[tm] += rects[i].area\n      total += rects[i].area\n    }\n    // Add a paint area for the page background (count 10% of the pixels not\n    // covered by existing paint rects.\n    var pixels = Math.max(doc.documentElement.clientWidth, win.innerWidth || 0) *\n                 Math.max(doc.documentElement.clientHeight, win.innerHeight || 0)\n    if (pixels > 0) {\n      pixels = Math.max(pixels - total, 0) * pageBackgroundWeight\n      if (paints[firstPaint] === undefined) { paints[firstPaint] = 0 }\n      paints[firstPaint] += pixels\n      total += pixels\n    }\n    // Calculate the visual progress\n    if (total) {\n      for (var time in paints) {\n        if (paints.hasOwnProperty(time)) { // eslint-disable-line no-prototype-builtins\n          progress.push({ tm: time, area: paints[time] })\n        }\n      }\n      progress.sort(function (a, b) { return a.tm - b.tm })\n      var accumulated = 0\n      for (var j = 0; j < progress.length; j++) {\n        accumulated += progress[j].area\n        progress[j].progress = accumulated / total\n      }\n    }\n  }\n\n  // Given the visual progress information, Calculate the speed index.\n  var CalculateSpeedIndex = function () {\n    if (progress.length) {\n      SpeedIndex = 0\n      var lastTime = 0\n      var lastProgress = 0\n      for (var i = 0; i < progress.length; i++) {\n        var elapsed = progress[i].tm - lastTime\n        if (elapsed > 0 && lastProgress < 1) { SpeedIndex += (1 - lastProgress) * elapsed }\n        lastTime = progress[i].tm\n        lastProgress = progress[i].progress\n      }\n    } else {\n      SpeedIndex = firstPaint\n    }\n  }\n\n  /****************************************************************************\n    Main flow\n  ****************************************************************************/\n  var rects = []\n  var progress = []\n  var firstPaint\n  var SpeedIndex\n  var pageBackgroundWeight = 0.1\n  try {\n    var navStart = win.performance.timing.navigationStart\n    GetRects()\n    GetRectTimings()\n    GetFirstPaint()\n    CalculateVisualProgress()\n    CalculateSpeedIndex()\n  } catch (e) {\n  }\n  return SpeedIndex\n}\n\nmodule.exports = RUMSpeedIndex\n","var assign = require('./mixins/assign')\nvar createObject = require('./mixins/create')\n\nvar YouboraObject = function () { }\n\nYouboraObject.prototype = {\n  /**\n   * A base class that other Classes should inherit from.\n   * It has a no-op constructor intended to be overridden by classes that extend from this.\n   *\n   * @constructs YouboraObject\n   * @abstract\n   * @memberof youbora\n   */\n  constructor: function () { }\n}\n\n/**\n * This method allows the extension of the current class, emulating 1-level inheritance.\n * It is inspired by Backbone's extend, but removing all references to underscore.\n *\n * @see http://backbonejs.org/#Model-extend\n *\n * @example\n * var A = YouboraObject.extend({ a: 1, b: 1, c: { d: 0 } });\n * var a = new A(); // { a: 1, b: 1, c: { d: 0 } }\n *\n * var B = A.extend({ b: 2, c: { e: 3 } });\n * var b = new B(); // { a: 1, b: 2, c: { e: 3 } }\n *\n * @param  {Object} protoProps  Prototype properties (available on the instances)\n * @param  {Object} staticProps Static properties (available on the contructor)\n * @return {Object}             New sub class\n */\nYouboraObject.extend = function (protoProps, staticProps) {\n  var parent = this\n  var child\n\n  // The constructor function for the new subclass is either defined by you\n  // (the \"constructor\" property in your `extend` definition), or defaulted\n  // by us to simply call the parent constructor.\n  if (protoProps && protoProps.hasOwnProperty('constructor')) { // eslint-disable-line no-prototype-builtins\n    child = protoProps.constructor\n  } else {\n    child = function () { return parent.apply(this, arguments) }\n  }\n\n  // Add static properties to the constructor function, if supplied.\n  assign(child, parent, staticProps)\n\n  // Set the prototype chain to inherit from `parent`, without calling\n  // `parent`'s constructor function and add the prototype properties.\n  child.prototype = createObject(parent.prototype)\n  if (protoProps) assign(child.prototype, protoProps)\n  child.prototype.constructor = child\n\n  // Set a convenience property in case the parent's prototype is needed\n  // later.\n  child.__super__ = parent.prototype\n  return child\n}\n\nmodule.exports = YouboraObject\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar DeprecatedOptions = YouboraObject.extend({\n  exists: function (optionName) {\n    return DeprecatedOptions.Dictionary.hasOwnProperty(optionName) // eslint-disable-line no-prototype-builtins\n  },\n\n  getNewName: function (optionName) {\n    var newName = DeprecatedOptions.Dictionary[optionName]\n    Log.warn('The option \"' + optionName + '\" is deprecated, use \"' + newName + '\" instead')\n    return newName\n  }\n}, {\n  // Keys are old option names\n  // Values are new option names\n  Dictionary: {\n    httpSecure: 'app.https',\n    username: 'user.name',\n    anonymousUser: 'user.anonymousId',\n    obfuscateIp: 'user.obfuscateIp',\n    userType: 'user.type',\n    'content.title2': 'content.program',\n    'background.settings.iphone': 'background.settings.iOS',\n    'parse.hls': 'parse.manifest',\n    'parse.dash': 'parse.manifest',\n    'parse.locationHeader': 'parse.manifest',\n    'extraparam.1': 'content.customDimension.1',\n    'extraparam.2': 'content.customDimension.2',\n    'extraparam.3': 'content.customDimension.3',\n    'extraparam.4': 'content.customDimension.4',\n    'extraparam.5': 'content.customDimension.5',\n    'extraparam.6': 'content.customDimension.6',\n    'extraparam.7': 'content.customDimension.7',\n    'extraparam.8': 'content.customDimension.8',\n    'extraparam.9': 'content.customDimension.9',\n    'extraparam.10': 'content.customDimension.10',\n    'extraparam.11': 'content.customDimension.11',\n    'extraparam.12': 'content.customDimension.12',\n    'extraparam.13': 'content.customDimension.13',\n    'extraparam.14': 'content.customDimension.14',\n    'extraparam.15': 'content.customDimension.15',\n    'extraparam.16': 'content.customDimension.16',\n    'extraparam.17': 'content.customDimension.17',\n    'extraparam.18': 'content.customDimension.18',\n    'extraparam.19': 'content.customDimension.19',\n    'extraparam.20': 'content.customDimension.20',\n    'ad.extraparam.1': 'ad.customDimension.1',\n    'ad.extraparam.2': 'ad.customDimension.2',\n    'ad.extraparam.3': 'ad.customDimension.3',\n    'ad.extraparam.4': 'ad.customDimension.4',\n    'ad.extraparam.5': 'ad.customDimension.5',\n    'ad.extraparam.6': 'ad.customDimension.6',\n    'ad.extraparam.7': 'ad.customDimension.7',\n    'ad.extraparam.8': 'ad.customDimension.8',\n    'ad.extraparam.9': 'ad.customDimension.9',\n    'ad.extraparam.10': 'ad.customDimension.10'\n  }\n})\n\nmodule.exports = DeprecatedOptions\n","var YouboraObject = require('../object')\nvar Storage = require('./storage')\n\n/**\n * This class manages data storage for offline events in an storage.\n *\n * @extends youbora.Emitter\n * @memberof youbora\n */\nvar OfflineStorage = YouboraObject.extend({\n  constructor: function () {\n    this.storage = new Storage('youboraOffline', true) // No cookies for offline\n    this.actualView = null\n    this.viewList = []\n    this.givenIds = []\n    this._getOldViewList()\n  },\n\n  _newView: function () {\n    // search for first unused id\n    var viewId = this._getValidId()\n\n    // create empty view\n    this.storage.setLocal(viewId, '')\n\n    // add to viewlist\n    this.viewList.push(viewId)\n    this.storage.setLocal('views', this.viewList)\n\n    // save the id\n    this.actualView = viewId\n  },\n\n  addEvent: function (event, params) {\n    // if event is start, create new view\n    if (event === '/start') this._newView()\n\n    // if event is init, ignore\n    if (event === '/init') return null\n\n    // if we have no view discard\n    if (!this.actualView) return null\n\n    // create event object\n    var fullEvent = '{\"request\":\"' + event.slice(1) + '\",' // {\"request\":\"start\",\n    fullEvent += '\"unixtime\":' + Date.now() + ',' // \"unixtime\":1499876515,\n    for (var param in params) {\n      if (params[param] === undefined) break\n      fullEvent += '\"' + param + '\":' // \"aParam\":\n      if (param === 'code') {\n        fullEvent += '\"' + 'CODE_PLACEHOLDER' + '\",' // \"CODE_PLACEHOLDER\",\n      } else if (param === 'sessionId') {\n        fullEvent += '\"' + 'SESSION_PLACEHOLDER' + '\",' // \"SESSION_PLACEHOLDER\",\n      } else if (param === 'sessionRoot') {\n        fullEvent += '\"' + 'ROOT_PLACEHOLDER' + '\",' // \"ROOT_PLACEHOLDER\",\n      } else if (typeof params[param] === 'string') {\n        fullEvent += '\"' + params[param] + '\",' // \"aStringValue\",\n      } else if (typeof params[param] === 'object') {\n        fullEvent += '\"' + JSON.stringify(params[param]).replace(/\"/g, '\\\\\"') + '\",' // json object\n      } else {\n        fullEvent += params[param] + ',' // 123, for example\n      }\n    }\n    fullEvent = fullEvent.slice(0, -1) // remove the last comma\n    fullEvent += '}'\n\n    // get accumulated view object\n    var temp = this.storage.getLocal(this.actualView)\n    if (temp !== '') temp = temp + ',' // comma between events\n\n    // add the event\n    this.storage.setLocal(this.actualView, temp + fullEvent)\n  },\n\n  getView: function () {\n    if (this.viewList.length > this.givenIds.length) { // if we have any view not sent yet\n      var position = 0\n      while (true) {\n        var idToSend = this.viewList[position]\n        if (this.givenIds.indexOf(idToSend) < 0) {\n          this.givenIds.push(idToSend)\n          return ['[' + this.storage.getLocal(idToSend) + ']', idToSend]\n        }\n        position++\n      }\n    }\n    return [null, null]\n  },\n\n  removeView: function (id) {\n    this.storage.removeLocal(id)\n    var position = this.viewList.indexOf(id)\n    if (position !== -1) this.viewList.splice(position, 1)\n    position = this.givenIds.indexOf(id)\n    if (position !== -1) this.givenIds.splice(position, 1)\n    this.storage.setLocal('views', this.viewList.toString())\n    if (id === this.actualView) this.actualView = null\n  },\n\n  _getOldViewList: function () {\n    var stringList = ''\n    if (this.storage.getLocal('views')) {\n      stringList = this.storage.getLocal('views')\n    } else {\n      this.storage.setLocal('views', '')\n    }\n\n    if (stringList === '') {\n      this.viewList = []\n    } else if (typeof stringList.split === 'function') {\n      this.viewList = stringList.split(',')\n    }\n  },\n\n  _getValidId: function () {\n    // get a value not in the list\n    var id = Math.floor(Math.random() * 1e8).toString()\n    if (this.viewList.indexOf(id) >= 0) {\n      return this._getValidId()\n    }\n    return id\n  },\n\n  sent: function () {\n    this.givenIds = []\n  }\n})\n\nmodule.exports = OfflineStorage\n","var YouboraObject = require('../object')\nvar DeprecatedOptions = require('./deprecatedOptions')\nvar Log = require('../log')\nvar TransportFormat = require('../constants/transportFormat')\nvar StreamingProtocol = require('../constants/streamingProtocols')\nvar RequestMethod = require('../constants/requestMethod')\n\nvar Options = YouboraObject.extend(\n  /** @lends youbora.Options.prototype */\n  {\n    /**\n     * This Class store youbora configuration settings.\n     * Any value specified in this class, if set, will override the info the plugin is able to get\n     * on its own.\n     *\n     * @constructs Options\n     * @param {Object|Options} [options] A literal containing values.\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function (options) {\n      /** @prop {boolean} [enabled=true] If false, the plugin won't send NQS requests. */\n      this.enabled = true\n\n      /** @prop {string} [host='a-fds.youborafds01.com'] Host of the Fastdata service. */\n      this.host = 'a-fds.youborafds01.com'\n\n      /**\n      * @prop {string} [accountCode='nicetest']\n      * NicePeopleAtWork account code that indicates the customer account.\n      */\n      this.accountCode = 'nicetest'\n\n      /**\n       * @prop {string} [authToken]\n       * Optional auth token to validate all the requests\n       */\n      this.authToken = null\n\n      /**\n       * @prop {string} [authType]\n       * Optional auth type. Used if authToken is set.\n       * 'Bearer' by default.\n       */\n      this.authType = 'Bearer'\n\n      /**\n      *  @prop {boolean} [preventZombieViews=true]\n      * If true, the plugin will check if the last event\n      * was sent more than 10 mins ago\n      * so it will not send more events to the same view\n      */\n      this.preventZombieViews = true\n\n      /**\n      * @prop {boolean} [offline=false]\n      * If true the plugin will store the events and send them later when there's connection\n      */\n      this.offline = false\n\n      /** @prop {string} [referer] Site url.\n      *  By default window.location.href */\n      this.referer = null\n\n      /** @prop {string} [referral] Previous site url.\n      *  By default document.referrer */\n      this.referral = null\n\n      /**\n      * @prop {boolean} [disableCookies]\n      * To disable cookies storage fallback after local/sessionstorage\n      * True by default\n      */\n      this.disableCookies = true\n\n      /**\n      * @prop {boolean} [forceCookies]\n      * To force the use of cookies storage instead of local/sessionstorage\n      * False by default\n      */\n      this.forceCookies = false\n\n      /**\n      * @prop {boolean} [disableStorage]\n      * To disable all possible storages usage (cookies, localStorage, sessionStorage)\n      * CAUTION: enabling this option session tracking may stop to work properly\n      * False by default\n      */\n      this.disableStorage = false\n\n      // USER\n\n      /**\n      * @prop {string} [user.email]\n      * User email.\n      */\n      this['user.email'] = null\n\n      /**\n      * @prop {string} [user.type]\n      * User type.\n      */\n      this['user.type'] = null\n\n      /**\n      * @prop {string} [user.name]\n      * User ID value inside your system.\n      */\n      this['user.name'] = null\n\n      /**\n      *  @prop {boolean} [user.obfuscateIp=false]\n      * If true, the view will have the IP obfuscated\n      */\n      this['user.obfuscateIp'] = false\n\n      /**\n      * @prop {string} [user.anonymousId]\n      * Anonymous identifyer of the user provided by the customer.\n      */\n      this['user.anonymousId'] = null\n\n      /**\n      * @prop {string} [user.privacyProtocol]\n      * Privacy protocol to be used, nothing by default.\n      * Possible values are \"optin\" and \"optout\"\n      */\n      this['user.privacyProtocol'] = null\n\n      // PARSERS\n\n      /**\n      * @prop {boolean} [parse.manifest=false]\n      * If true the plugin will look for location value in manifest header to retrieve the actual resource,\n      * will parse HLS files to use the first .ts file found as resource and\n      * will look for location and segment values inside DASH manifest to retrieve the actual resource\n      * It might slow performance down.\n      */\n      this['parse.manifest'] = false\n\n      /**\n      * @prop {object} [parse.manifest.auth={}]\n      * If parse.manifest enabled, it adds extra headers to the request of the content.\n      * Use this if for example, the player needs to include authentication headers to request the content,\n      * so the plugin needs it to access to the manifest files too.\n      */\n      this['parse.manifest.auth'] = {}\n\n      /**\n       * @prop {array<string>} [parse.CdnNameHeader]\n       * If defined, resource parse will try to fetch the CDN code from the custom header defined\n       * by this property. ie: '[x-cdn-forward]'\n       */\n      this['parse.cdnNameHeader'] = ['x-cdn-forward']\n\n      /**\n      * @prop {string} [parse.CdnNodeHeader]\n      * If defined, resource parse will try to fetch the CDN node name from the custom header defined\n      * by this property. ie: 'x-node'\n      */\n      this['parse.cdnNodeHeader'] = ''\n\n      /**\n      * @prop {boolean} [parse.CdnNode=false]\n      * If true the plugin will query the CDN to retrieve the node name.\n      * It might slow performance down.\n      */\n      this['parse.cdnNode'] = false\n\n      /**\n      * @prop {array<string>} [parse.CdnNode.list=false]\n      * If true the plugin will query the CDN to retrieve the node name.\n      * It might slow performance down.\n      */\n      this['parse.cdnNode.list'] = ['Akamai', 'Amazon', 'Cloudfront', 'Level3', 'Fastly', 'Highwinds', 'Telefonica', 'Edgecast', 'NosOtt']\n\n      /**\n       * @prop {function} [parse.fdsResponseHost=null]\n       * Parses fastdata response to modify the host where the requests will be sent\n       */\n      this['parse.fdsResponseHost'] = null\n\n      /**\n       * @prop {function} [parse.cdnSwitchHeader=false]\n       * Parses a video chunk or manifest every x seconds to read the x-cdn header and report it\n       */\n      this['parse.cdnSwitchHeader'] = false\n\n      /**\n       * @prop {function} [parse.cdnTTL=60]\n       * if parse.cdnSwitchHeader enabled, the time between new requests\n       */\n      this['parse.cdnTTL'] = 60\n\n      // NETWORK\n\n      /** @prop {string} [network.ip] IP of the viewer/user. ie= '100.100.100.100'. */\n      this['network.ip'] = null\n\n      /** @prop {string} [network.isp] Name of the internet service provider of the viewer/user. */\n      this['network.isp'] = null\n\n      /**\n      * @prop {string} [network.connectionType]\n      * Type of connection used\n      */\n      this['network.connectionType'] = null\n\n      // DEVICE\n\n      /**\n       * @prop {string} [device.id]\n       * Unique identifyer of the device. If set it will consider the value as the device id.\n       * By default the plugin tries to generate a unique id based on exposed information on the browser.\n       * It wont be sent if 'device.isAnonymous option' is set to true.\n       */\n      this['device.id'] = null\n\n      /**\n      * @prop {string} [device.code]\n      * Youbora's device code. If specified it will rewrite info gotten from user agent.\n      * See a list of codes in {@link http://mapi.youbora.com/devices}\n      */\n      this['device.code'] = null\n\n      /**\n      * @prop {string} [device.model]\n      * Device model name\n      */\n      this['device.model'] = null\n\n      /**\n      * @prop {string} [device.brand]\n      * Device vendor name\n      */\n      this['device.brand'] = null\n\n      /**\n      * @prop {string} [device.type]\n      * Device type (pc, smartphone, stb, tv, etc.)\n      */\n      this['device.type'] = null\n\n      /**\n      * @prop {string} [device.name]\n      * Device name. It must exist in NPAW database.\n      */\n      this['device.name'] = null\n\n      /**\n      * @prop {string} [device.osName]\n      * OS name.\n      */\n      this['device.osName'] = null\n\n      /**\n      * @prop {string} [device.osVersion]\n      * OS version.\n      */\n      this['device.osVersion'] = null\n\n      /**\n      * @prop {string} [device.browserName]\n      * Browser name.\n      */\n      this['device.browserName'] = null\n\n      /**\n      * @prop {string} [device.browserVersion]\n      * Browser version.\n      */\n      this['device.browserVersion'] = null\n\n      /**\n      * @prop {string} [device.browserType]\n      * Browser type.\n      */\n      this['device.browserType'] = null\n\n      /**\n      * @prop {string} [device.browserEngine]\n      * Browser engine.\n      */\n      this['device.browserEngine'] = null\n\n      /**\n      * @prop {string} [device.EDID]\n      * Connected screen EDID.\n      * The expected format is a hex value\n      */\n      this['device.EDID'] = null\n\n      /**\n      * @prop {bool} [device.isAnonymous]\n      * If true, it blocks 'deviceUUID' parameter in requests.\n      */\n      this['device.isAnonymous'] = false\n\n      // CONTENT\n\n      /** @prop {string} [content.transactionCode] Custom unique code to identify the view. */\n      this['content.transactionCode'] = null\n\n      /** @prop {string} [content.resource] URL/path of the current media resource. */\n      this['content.resource'] = null\n\n      /** @prop {boolean} [content.isLive] True if the content is live false if VOD. */\n      this['content.isLive'] = null\n\n      /** @prop {boolean} [content.isLive.noSeek] True if the player seeks automatically when resumed or ending buffer. Only for live content. False by default */\n      this['content.isLive.noSeek'] = false\n\n      /** @prop {boolean} [content.isLive.noMonitor] True if the player returns non consistent values for the playhead on live, so playhead monitor wont work to detect buffers and seeks. False by default. */\n      this['content.isLive.noMonitor'] = false\n\n      /** @prop {string} [content.title] Title of the media. */\n      this['content.title'] = null\n\n      /** @prop {string} [content.program] Secondary title of the media */\n      this['content.program'] = null\n\n      /** @prop {number} [content.duration] Duration of the media. */\n      this['content.duration'] = null\n\n      /** @prop {number} [content.fps] Frames per second of the content in the current moment. */\n      this['content.fps'] = null\n\n      /** @prop {number} [content.segmentDuration] Video segment length in milliseconds. */\n      this['content.segmentDuration'] = null\n\n      /** @prop {number} [content.bitrate] Bitrate of the content in bits per second. */\n      this['content.bitrate'] = null\n\n      /** @prop {number} [content.totalBytes] Total downloaded bytes of the content. */\n      this['content.totalBytes'] = null\n\n      /** @prop {bool} [content.sendTotalBytes] Additionaly report totalbytes or not, default false. */\n      this['content.sendTotalBytes'] = false\n\n      /** @prop {number} [content.throughput] Throughput of the client bandwith in bits per second. */\n      this['content.throughput'] = null\n\n      /** @prop {string} [content.rendition] Name of the current rendition of the content. */\n      this['content.rendition'] = null\n\n      /**\n       * @prop {string} [content.cdn]\n       * Codename of the CDN where the content is streaming from.\n       * See a list of codes in {@link http://mapi.youbora.com/cdns}\n       * */\n      this['content.cdn'] = null\n\n      /** @prop {string} [content.cdnNode] CDN node id */\n      this['content.cdnNode'] = null\n\n      /**\n       * @prop {number} [content.cdnType] CDN node content access type\n       * It defines if the content request hits the cache or not\n       * TCP_HIT / HIT: 1\n       * TCP_MISS / MISS: 2\n       * TCP_MEM_HIT: 3\n       * TCP_IMS_HIT: 4\n       */\n      this['content.cdnType'] = null\n\n      /**\n       * @prop {object} [content.metadata]\n       * Item containing mixed extra information about the content like: director, parental rating,\n       * device info or the audio channels.This object may store any serializable key:value info.\n       */\n      this['content.metadata'] = {}\n\n      /**\n       * @prop {object} [content.metrics]\n       * Item containing metrics in json format. Reported every ping if the values change\n       */\n      this['content.metrics'] = {}\n\n      /** @prop {string} [content.streamingProtocol] Name of the streaming media protocol.\n       * Can be:\n       *   - HDS (Adobe HDS)\n       *   - HLS (Apple HLS)\n       *   - MSS (Microsoft Smooth Streaming)\n       *   - DASH (MPEG-DASH)\n       *   - RTMP (Adobe RTMP)\n       *   - RTP (RTP)\n       *   - RTSP (RTSP)\n       *   - MULTICAST (Multicast)\n       *   - DVB (DVB)\n       *   - DVBC (DVB-C)\n       *   - DVBT (DVB-T)\n       *   - DVBT2 (DVB-T2)\n       */\n      this['content.streamingProtocol'] = null\n\n      /** @prop {string} [content.transportFormat] Name of the transport format.\n       * Can be:\n       *   - TS (MPEG-2 TS)\n       *   - MP4 (Fragmented MP4)\n       */\n      this['content.transportFormat'] = null\n\n      /** @prop {number} [content.package] Package of the media. */\n      this['content.package'] = null\n\n      /** @prop {number} [content.saga] Saga of the media. */\n      this['content.saga'] = null\n\n      /** @prop {number} [content.tvShow] TV Show of the media. */\n      this['content.tvShow'] = null\n\n      /** @prop {number} [content.season] Season of the media. */\n      this['content.season'] = null\n\n      /** @prop {number} [content.episodeTitle] Episode title of the media. */\n      this['content.episodeTitle'] = null\n\n      /** @prop {number} [content.channel] Channel name of the media. */\n      this['content.channel'] = null\n\n      /** @prop {number} [content.id] ID of the media. */\n      this['content.id'] = null\n\n      /** @prop {number} [content.imdbId] IMDB id of the media. */\n      this['content.imdbId'] = null\n\n      /** @prop {number} [content.gracenoteId] Gracenote id of the media. */\n      this['content.gracenoteId'] = null\n\n      /** @prop {number} [content.type] Type of the media. */\n      this['content.type'] = null\n\n      /** @prop {number} [content.genre] Genre of the media. */\n      this['content.genre'] = null\n\n      /** @prop {number} [content.language] Language of the media. */\n      this['content.language'] = null\n\n      /** @prop {boolean} [content.autodetect.language] Auto detect change languages value. */\n      this['content.autodetect.language'] = true\n\n      /** @prop {number} [content.subtitles] Subtitles of the media. */\n      this['content.subtitles'] = null\n\n      /** @prop {boolean} [content.autodetect.subtitles] Auto detect change subtitles value. */\n      this['content.autodetect.subtitles'] = true\n\n      /** @prop {number} [content.contractedResolution] Contracted Resolution of the media. */\n      this['content.contractedResolution'] = null\n\n      /** @prop {number} [content.cost] Cost of the media. */\n      this['content.cost'] = null\n\n      /** @prop {number} [content.price] Price of the media. */\n      this['content.price'] = null\n\n      /** @prop {number} [content.playbackType] Type of the media. Can be Vod, Live, catch-up or offline */\n      this['content.playbackType'] = null\n\n      /** @prop {number} [content.drm] DRM of the media. */\n      this['content.drm'] = null\n\n      // Encoding\n\n      /** @prop {number} [content.encoding.videoCodec] Video codec of the media. */\n      this['content.encoding.videoCodec'] = null\n\n      /** @prop {number} [content.encoding.audioCodec] Audio codec of the media. */\n      this['content.encoding.audioCodec'] = null\n\n      /** @prop {number} [content.encoding.codecSettings] Codec settings of the media. */\n      this['content.encoding.codecSettings'] = null\n\n      /** @prop {number} [content.encoding.codecProfile] Codec profile of the media. */\n      this['content.encoding.codecProfile'] = null\n\n      /** @prop {number} [content.encoding.containerFormat] Container format of the media. */\n      this['content.encoding.containerFormat'] = null\n\n      // ADS\n\n      /**\n      * @prop {object} [ad.metadata]\n      * Item containing mixed extra information about ads like: request url.\n      * This object may store any serializable key:value info.\n      */\n      this['ad.metadata'] = {}\n\n      /**\n      * @prop {string} [ad.campaign]\n      * String containing the name of the campaign\n      */\n      this['ad.campaign'] = null\n\n      /**\n      * @prop {string} [ad.creativeId]\n      * String containing the id of the creative\n      */\n      this['ad.creativeId'] = null\n\n      /**\n      * @prop {string} [ad.provider]\n      * String containing the provider of the ad\n      */\n      this['ad.provider'] = null\n\n      /**\n      * @prop {string} [ad.resource]\n      * String containing the ad resource\n      */\n      this['ad.resource'] = null\n\n      /**\n      * @prop {string} [ad.title]\n      * String containing the title of the campaign\n      */\n      this['ad.title'] = null\n\n      /**\n      * @prop {duration} [ad.duration]\n      * Duration of the ad in seconds\n      */\n      this['ad.duration'] = null\n\n      /**\n      * @prop {object} [ad.expectedPattern]\n      * Json with the position of the breaks expected.\n      * Arrays are the number of breaks, and the numbers in them, the number of ads for each break\n      *\n      * Example:\n      * {pre: [1],\n      * mid: [1,2],\n      * post: [1]}\n      * Would be a view with 1 preroll break with 1 ad, 2 midroll breaks, one with 1 ad and\n      * the other with 2, and one postroll break with 1 ad.\n      */\n      this['ad.expectedPattern'] = null\n\n      /**\n      * @prop {string} [ad.givenAds]\n      * Number of ads given by the adserver for this break\n      */\n      this['ad.givenAds'] = null\n\n      /**\n      * @prop {number[]} [ad.breaksTime]\n      * Array of numbers for the time position of adbreaks\n      */\n      this['ad.breaksTime'] = null\n\n      /**\n      * @prop {string} [ad.expectedBreaks]\n      * Number of breaks expected for the view\n      */\n      this['ad.expectedBreaks'] = null\n\n      /**\n      * @prop {number} [ad.givenBreaks]\n      * Number of breaks given by the adserver for the view\n      */\n      this['ad.givenBreaks'] = null\n\n      /**\n      * @prop {boolean} [ad.ignore]\n      * False by default.\n      * If true, youbora blocks ad events and calculates jointime ignoring ad time.\n      */\n      this['ad.ignore'] = false\n\n      /**\n      * @prop {boolean} [ad.blockerDetected]\n      * Null (notified as false) by default.\n      * Sets if an adblocker has been detected\n      */\n      this['ad.blockerDetected'] = null\n\n      // APP\n\n      /**\n      * @prop {string} [app.name]\n      * String containing the name of the app\n      */\n      this['app.name'] = null\n\n      /**\n      * @prop {string} [app.releaseVerson]\n      * String containing the app version\n      */\n      this['app.releaseVersion'] = null\n\n      /**\n      * @prop {boolean} [app.https=null]\n      * Define the security of NQS calls.\n      * If true it will use 'https://',\n      * if false it will use 'http://',\n      * if null/undefined it will use '//'.\n      */\n      this['app.https'] = false\n\n      // BACKGROUND\n\n      /**\n      *  @prop {boolean} [background.enabled=false]\n      * If true, plugin will send background/foreground events\n      * Different device behaviour is settable in background.settings\n      */\n      this['background.enabled'] = true\n\n      /**\n      *  @prop {string} [background.settings]\n      * Action to do when the browser goes to background.\n      * Options are 'stop', 'pause', and '' for no action.\n      * stop will be used to stop the view and track post-foreground events in a new view\n      * pause will be used when after foreground event, an action like pressing play button is expected to resume the content\n      * '' will be used if the content can be played in background\n      * If not defined, specific device options will be used\n      * background.setings.android / background.settings.iOS / background.settings.desktop / background.settings.tv\n      * Default specific device values are stop for android and iphone, nothing for desktop.\n      */\n      this['background.settings'] = null\n\n      /**\n      *  @prop {string} [background.settings.android='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is android type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.android'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.iOS='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is iphone type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.iOS'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.desktop=null]\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is desktop type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * Null by default\n      */\n      this['background.settings.desktop'] = null\n\n      /**\n      *  @prop {string} [background.settings.tv='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is smartTV type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * bg by default\n      */\n      this['background.settings.tv'] = 'stop'\n\n      /**\n      *  @prop {string} [background.settings.playstation='stop']\n      * If background.settings is not defined, action to do when the browser goes to background if\n      * the device is playstation type.\n      * Options are 'stop', 'pause', and '' or not defined for no action.\n      * Null by default\n      */\n      this['background.settings.playstation'] = 'stop'\n\n      // CDN BALANCER\n      /**\n      *  @prop {string} [cdnbalancer.uuid]\n      * CDN Balancer Response UUID\n      * null by default\n      */\n      this['cdnbalancer.uuid'] = null\n\n      // EXTRAPARAMS // CUSTOM DIMENSIONS\n\n      /** @prop {object} [content.customDimensions] Custom dimensions object. */\n      this['content.customDimensions'] = {}\n\n      /** @prop {string} [content.customDimension.1] Custom parameter 1. */\n      this['content.customDimension.1'] = null\n\n      /** @prop {string} [content.customDimension.2] Custom parameter 2. */\n      this['content.customDimension.2'] = null\n\n      /** @prop {string} [content.customDimension.3] Custom parameter 3. */\n      this['content.customDimension.3'] = null\n\n      /** @prop {string} [content.customDimension.4] Custom parameter 4. */\n      this['content.customDimension.4'] = null\n\n      /** @prop {string} [content.customDimension.5] Custom parameter 5. */\n      this['content.customDimension.5'] = null\n\n      /** @prop {string} [content.customDimension.6] Custom parameter 6. */\n      this['content.customDimension.6'] = null\n\n      /** @prop {string} [content.customDimension.7] Custom parameter 7. */\n      this['content.customDimension.7'] = null\n\n      /** @prop {string} [content.customDimension.8] Custom parameter 8. */\n      this['content.customDimension.8'] = null\n\n      /** @prop {string} [content.customDimension.9] Custom parameter 9. */\n      this['content.customDimension.9'] = null\n\n      /** @prop {string} [content.customDimension.10] Custom parameter 10. */\n      this['content.customDimension.10'] = null\n\n      /** @prop {string} [content.customDimension.11] Custom parameter 11. */\n      this['content.customDimension.11'] = null\n\n      /** @prop {string} [content.customDimension.12] Custom parameter 12. */\n      this['content.customDimension.12'] = null\n\n      /** @prop {string} [content.customDimension.13] Custom parameter 13. */\n      this['content.customDimension.13'] = null\n\n      /** @prop {string} [content.customDimension.14] Custom parameter 14. */\n      this['content.customDimension.14'] = null\n\n      /** @prop {string} [content.customDimension.15] Custom parameter 15. */\n      this['content.customDimension.15'] = null\n\n      /** @prop {string} [content.customDimension.16] Custom parameter 16. */\n      this['content.customDimension.16'] = null\n\n      /** @prop {string} [content.customDimension.17] Custom parameter 17. */\n      this['content.customDimension.17'] = null\n\n      /** @prop {string} [content.customDimension.18] Custom parameter 18. */\n      this['content.customDimension.18'] = null\n\n      /** @prop {string} [content.customDimension.19] Custom parameter 19. */\n      this['content.customDimension.19'] = null\n\n      /** @prop {string} [content.customDimension.20] Custom parameter 20. */\n      this['content.customDimension.20'] = null\n\n      /** @prop {string} [ad.customDimension.1] Ad custom parameter 1. */\n      this['ad.customDimension.1'] = null\n\n      /** @prop {string} [ad.customDimension.2] Ad custom parameter 2. */\n      this['ad.customDimension.2'] = null\n\n      /** @prop {string} [ad.customDimension.3] Ad custom parameter 3. */\n      this['ad.customDimension.3'] = null\n\n      /** @prop {string} [ad.customDimension.4] Ad custom parameter 4. */\n      this['ad.customDimension.4'] = null\n\n      /** @prop {string} [ad.customDimension.5] Ad custom parameter 5. */\n      this['ad.customDimension.5'] = null\n\n      /** @prop {string} [ad.customDimension.6] Ad custom parameter 6. */\n      this['ad.customDimension.6'] = null\n\n      /** @prop {string} [ad.customDimension.7] Ad custom parameter 7. */\n      this['ad.customDimension.7'] = null\n\n      /** @prop {string} [ad.customDimension.8] Ad custom parameter 8. */\n      this['ad.customDimension.8'] = null\n\n      /** @prop {string} [ad.customDimension.9] Ad custom parameter 9. */\n      this['ad.customDimension.9'] = null\n\n      /** @prop {string} [ad.customDimension.10] Ad custom parameter 10. */\n      this['ad.customDimension.10'] = null\n\n      /** @prop {bool} [forceInit] Forces init to be sent instead of start, use it when mediaduration,\n      *  title, source or is live is reported with a wrong value by the player until jointime happens */\n      this.forceInit = false\n\n      /**\n      * @prop {object} [session.metrics]\n      * Item containing metrics in json format. Reported every beat if the values change\n      */\n      this['session.metrics'] = {}\n\n      /**\n      * @prop {bool} [session.context]\n      * Boolean to choose to report context or not. False by default\n      */\n      this['session.context'] = false\n\n      /**\n      * @prop {array<string>} [errors.fatal=[]]\n      * If it has elements on it, all the errors matching this code will fire the stop event to end the view\n      */\n      this['errors.fatal'] = []\n\n      /**\n      * @prop {array<string>} [errors.nonFatal=[]]\n      * If it has elements on it, all the errors matching this code won't fire a stop event to end the view\n      */\n      this['errors.nonFatal'] = []\n\n      /**\n      * @prop {array<string>} [errors.ignore=[]]\n      * If it has elements on it, all the errors matching this code wont be reported\n      */\n      this['errors.ignore'] = []\n\n      /**\n       * @prop {string} linkedViewId\n       * String to send on start events to link views with previous session events\n       */\n      this.linkedViewId = null\n\n      /**\n      * @prop {bool} [waitForMetadata]\n      * Boolean to delay the start event. Use with `pendingMetadata`\n      */\n      this.waitForMetadata = false\n\n      /**\n      * @prop {array<string>} [pendingMetadata]\n      * List of values that should be ready to send in start event. Use with `waitForMetadata` set to True.\n      */\n      this.pendingMetadata = []\n\n      /**\n       * @prop {string} method\n       * Method used to send request to backend side\n       *  Options are 'get' or 'post'\n       *  'get' by default\n       */\n      this.method = RequestMethod.GET\n\n      /**\n       * @prop {bool} [playhead.monitor]\n       * Method to enabled/disable support for playhead monitor method\n       */\n      this['playhead.monitor'] = true\n\n      /**\n       * @prop {bool} [network.monitor]\n       * Method to enabled/disable support for readyState monitor method\n       */\n      this['readyState.monitor'] = true\n\n      this.setOptions(options)\n    },\n\n    /**\n    * Recursively sets the properties present in the params object.\n    * ie: this.username = params.username.\n    *\n    * @param {Object} options A literal or another Data containing values.\n    * @param {Object} [base=this] Start point for recursion.\n    */\n    setOptions: function (options, base) {\n      var isInBase = false\n      if (base === undefined) {\n        base = this\n        isInBase = true\n        var deprecatedOptions = new DeprecatedOptions()\n      }\n      if (typeof options !== 'undefined') {\n        for (var key in options) {\n          var deprecated = false\n          var newKey = null\n          if (isInBase) {\n            if (!this.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins\n              if (deprecatedOptions.exists(key)) {\n                newKey = deprecatedOptions.getNewName(key)\n                deprecated = true\n              } else {\n                Log.warn('The option \"' + key + '\" does not exist, so it cannot be set')\n              }\n            }\n          }\n          if ((typeof base[key] === 'object' && base[key] !== null) && (!Array.isArray(base[key]) && key === 'parse.cdnNode.list')) {\n            this.setOptions(options[key], base[key])\n          } else {\n            if (deprecated) {\n              base[newKey] = options[key]\n            } else {\n              base[key] = options[key]\n            }\n          }\n        }\n      }\n    },\n\n    /**\n    * Sets all the values given in an array as extraparams. Limit is 20\n    * @param {array<string>} paramsArray array of extraparam strings\n    * */\n    setExtraParams: function (paramsArray) {\n      var maxLength = 20\n      if (typeof paramsArray !== 'object' || !paramsArray.length) return\n      if (paramsArray.length >= maxLength) paramsArray = paramsArray.slice(0, maxLength)\n      while (paramsArray.length < maxLength) {\n        paramsArray.push(null)\n      }\n      paramsArray.forEach(function (param, index) {\n        this['content.customDimension.' + (index + 1).toString()] = param\n      }.bind(this))\n    },\n\n    /**\n    * @alias youbora.options.prototype.setExtraParams.\n    */\n    setCustomDimensions: function () {\n      Options.prototype.setExtraParams.apply(this, arguments)\n    },\n\n    /**\n    * Sets all the values given in an array as extraparams. Limit is 10\n    * @param {array<string>} paramsArray array of extraparam strings\n    * */\n    setAdExtraParams: function (paramsArray) {\n      var maxLength = 10\n      if (typeof paramsArray !== 'object' || !paramsArray.length) return\n      if (paramsArray.length >= maxLength) paramsArray = paramsArray.slice(0, maxLength)\n      while (paramsArray.length < maxLength) {\n        paramsArray.push(null)\n      }\n      paramsArray.forEach(function (param, index) {\n        this['ad.customDimension.' + (index + 1).toString()] = param\n      }.bind(this))\n    },\n\n    /**\n    * @alias youbora.options.prototype.setAdExtraParams.\n    */\n    setAdCustomDimensions: function () {\n      Options.prototype.setAdExtraParams.apply(this, arguments)\n    }\n  }, {\n  // Constants\n    StreamingProtocol: StreamingProtocol,\n    TransportFormat: TransportFormat,\n    RequestMethod: RequestMethod\n  }\n)\n\nmodule.exports = Options\n","var Log = require('../log')\nvar Util = require('../util')\nvar Constants = require('../constants')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginAdsGettersMixin = {\n  /**\n   * Returns ads's PlayerVersion\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPlayerVersion: function () {\n    return this._safeGetterAdsAdapter('getPlayerVersion') || ''\n  },\n\n  /**\n   * Returns ad's position\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPosition: function () {\n    var ret = Constants.AdPosition.Preroll\n    if (this._adsAdapter) {\n      try {\n        var temporalRet = this._adsAdapter.getPosition()\n        if (Constants.AdPosition.Preroll === temporalRet ||\n          Constants.AdPosition.Midroll === temporalRet ||\n          Constants.AdPosition.Postroll === temporalRet) {\n          ret = temporalRet\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling getAdPosition', err)\n      }\n    }\n    if (!ret && this._adapter) {\n      ret = (this._adapter.flags.isJoined) ? Constants.AdPosition.Midroll : Constants.AdPosition.Preroll\n    }\n    return ret\n  },\n\n  getAdNumber: function () {\n    return this.requestBuilder.lastSent.adNumber || 0\n  },\n\n  getAdNumberInBreak: function () {\n    return this.requestBuilder.lastSent.adNumberInBreak || 0\n  },\n\n  getBreakNumber: function () {\n    return this.requestBuilder.lastSent.breakNumber || 0\n  },\n\n  /**\n   * Returns ad's AdPlayhead\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPlayhead: function () {\n    var ret = this._safeGetterAdsAdapter('getPlayhead')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n   * Returns ad's AdDuration\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdDuration: function () {\n    var ret = this._safeGetterAdsAdapter('getDuration', 'ad.duration')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n   * Returns ad's AdBitrate\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdBitrate: function () {\n    var ret = this._safeGetterAdsAdapter('getBitrate')\n    if (!ret || ret === -1) {\n      ret = this.getWebkitAdBitrate()\n    }\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n   * Returns bitrate as per webkitVideoDecodedByteCount\n   *\n   * @param {Object} tag Video tag DOM reference.\n   * @returns {number}\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getWebkitAdBitrate: function () {\n    if (this._adsAdapter && this._adsAdapter.tag && this._adsAdapter.tag.webkitVideoDecodedByteCount) {\n      var bitrate = this._adsAdapter.tag.webkitVideoDecodedByteCount\n      if (this._lastWebkitAdBitrate) {\n        var delta = this._adsAdapter.tag.webkitVideoDecodedByteCount - this._lastWebkitAdBitrate\n        bitrate = Math.round(((delta) / this.viewTransform.response.pingTime) * 8)\n      }\n      this._lastWebkitAdBitrate = this._adsAdapter.tag.webkitVideoDecodedByteCount\n      return bitrate !== 0 ? bitrate : -1\n    }\n  },\n\n  /**\n   * Returns ad's AdTitle\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdTitle: function () {\n    return this._safeGetterAdsAdapter('getTitle', 'ad.title')\n  },\n\n  /**\n   * Returns ad's AdResource\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdResource: function () {\n    return this._safeGetterAdsAdapter('getResource', 'ad.resource')\n  },\n\n  /**\n   * Returns ad's campaign\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdCampaign: function () {\n    return this._safeGetterAdsAdapter('getCampaign', 'ad.campaign')\n  },\n\n  /**\n  * Returns ad's campaign\n  *\n  * @memberof youbora.Plugin.prototype\n  */\n  getAdCreativeId: function () {\n    return this._safeGetterAdsAdapter('getCreativeId', 'ad.creativeId')\n  },\n\n  /**\n  * Returns ad's provider\n  *\n  * @memberof youbora.Plugin.prototype\n  */\n  getAdProvider: function () {\n    return this._safeGetterAdsAdapter('getProvider', 'ad.provider')\n  },\n\n  /**\n   * Returns ads adapter getVersion or null\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdAdapterVersion: function () {\n    return this._safeGetterAdsAdapter('getVersion')\n  },\n\n  /**\n   * Returns ad's AdMetadata\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdMetadata: function () {\n    return this.options['ad.metadata']\n  },\n\n  /**\n   * Returns the type of ad insertion (clientside, serverside)\n   * @returns {string} ad insertion type\n   */\n  getAdInsertionType: function () {\n    return this._safeGetterAdsAdapter('getAdInsertionType')\n  },\n\n  getGivenBreaks: function () {\n    return this._safeGetterAdsAdapter('getGivenBreaks', 'ad.givenBreaks')\n  },\n\n  getExpectedBreaks: function () {\n    var ret = null\n    var expBreaks = this.options['ad.expectedBreaks']\n    var expPattern = this.options['ad.expectedPattern']\n    if (expBreaks) {\n      ret = expBreaks\n    } else if (expPattern) {\n      ret = 0\n      ret = expPattern.pre ? expPattern.pre.length : 0\n      ret += expPattern.mid ? expPattern.mid.length : 0\n      ret += expPattern.post ? expPattern.post.length : 0\n    } else if (this._adsAdapter) {\n      try {\n        ret = this._adsAdapter.getExpectedBreaks()\n      } catch (err) {\n        Log.warn('An error occured while calling expectedBreaks', err)\n      }\n    }\n    return ret\n  },\n\n  getExpectedPattern: function () {\n    return this._safeGetterAdsAdapter('getExpectedPattern', 'ad.expectedPattern')\n  },\n\n  getBreaksTime: function () {\n    return this._safeGetterAdsAdapter('getBreaksTime', 'ad.breaksTime')\n  },\n\n  getGivenAds: function () {\n    return this._safeGetterAdsAdapter('getGivenAds', 'ad.givenAds')\n  },\n\n  getExpectedAds: function () {\n    var ret = null\n    try {\n      if (this._adsAdapter) {\n        var pattern = this.options['ad.expectedPattern']\n        if (pattern && this.getAdPosition()) {\n          var list = []\n          if (pattern.pre) list = list.concat(pattern.pre)\n          if (pattern.mid) list = list.concat(pattern.mid)\n          if (pattern.post) list = list.concat(pattern.post)\n          if (list.length > 0) {\n            var position = this.requestBuilder.lastSent.breakNumber\n            if (position > list.length) position = list.length\n            ret = list[position - 1]\n          }\n        } else {\n          ret = this._adsAdapter.getExpectedAds()\n        }\n      }\n    } catch (err) {\n      Log.warn('An error occured while calling expectedAds', err)\n    }\n    return ret\n  },\n\n  getAdsExpected: function () {\n    var ret = null\n    try {\n      ret = (this.getExpectedPattern() || this.getGivenAds()) || false\n    } catch (err) {\n      Log.warn('An error occured while calling givenAds or expectedPattern', err)\n    }\n    return ret\n  },\n\n  // ----------------------------------------- CHRONOS ------------------------------------------\n\n  /**\n   * Returns AdJoinDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdJoinDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.join.getDeltaTime(false) : -1\n  },\n\n  /**\n   * Returns AdBufferDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdBufferDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.buffer.getDeltaTime(false) : -1\n  },\n\n  /**\n   * Returns AdPauseDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdPauseDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.pause.getDeltaTime(false) : 0\n  },\n\n  /**\n   * Returns total totalAdDuration chrono delta time\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdTotalDuration: function () {\n    return this._adsAdapter ? this._adsAdapter.chronos.total.getDeltaTime(false) : -1\n  },\n\n  getAdViewedDuration: function () {\n    return this._getTimeMaxOrAcum(true)\n  },\n\n  getAdViewability: function () {\n    return this._getTimeMaxOrAcum()\n  },\n\n  _getTimeMaxOrAcum: function (acum) {\n    var maxTime = 0\n    if (this._adsAdapter) {\n      this._adsAdapter.chronos.viewedMax.forEach(function (chrono) {\n        if (acum) {\n          maxTime += chrono.getDeltaTime(false)\n        } else {\n          maxTime = Math.max(chrono.getDeltaTime(false), maxTime)\n        }\n      })\n    }\n    return maxTime\n  },\n\n  getAudioEnabled: function () {\n    return this._safeGetterAdsAdapter('getAudioEnabled')\n  },\n\n  getIsSkippable: function () {\n    return this._safeGetterAdsAdapter('getIsSkippable')\n  },\n\n  getIsFullscreen: function () {\n    return this._safeGetterAdsAdapter('getIsFullscreen')\n  },\n\n  _safeGetterAdsAdapter: function (func, option) {\n    var ret = null\n    if (option && this.options[option]) {\n      ret = this.options[option]\n    } else {\n      try {\n        if (this._adsAdapter && typeof this._adsAdapter[func] === 'function') {\n          ret = this._adsAdapter[func]()\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling ' + func, err)\n      }\n    }\n    return ret\n  }\n}\n\nmodule.exports = PluginAdsGettersMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\nvar Adapter = require('../adapter/adapter')\nvar Util = require('../util')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginAdsMixin = {\n  /**\n     * Returns current adapter or null.\n     *\n     * @returns {Adapter}\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdsAdapter: function () {\n    return this._adsAdapter\n  },\n\n  /**\n     * Sets an adapter for ads.\n     *\n     * @param {Adapter} adsAdapter\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  setAdsAdapter: function (adsAdapter) {\n    if (adsAdapter.plugin) {\n      Log.warn('Adapters can only be added to a single plugin')\n    } else {\n      this.removeAdsAdapter()\n      adsAdapter.plugin = this\n      this._adsAdapter = adsAdapter\n      adsAdapter.setIsAds(true)\n      this.adsAdapterListeners = {}\n      this.adsAdapterListeners[Adapter.Event.START] = this._adStartListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.JOIN] = this._adJoinListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PAUSE] = this._adPauseListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.RESUME] = this._adResumeListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.BUFFER_BEGIN] = this._adBufferBeginListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.BUFFER_END] = this._adBufferEndListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.STOP] = this._adStopListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.ERROR] = this._adErrorListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.CLICK] = this._adClickListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.MANIFEST] = this._adManifestListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PODSTART] = this._adBreakStartListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.PODSTOP] = this._adBreakStopListener.bind(this)\n      this.adsAdapterListeners[Adapter.Event.QUARTILE] = this._adQuartileListener.bind(this)\n      for (var key in this.adsAdapterListeners) {\n        this._adsAdapter.on(key, this.adsAdapterListeners[key])\n      }\n    }\n  },\n\n  /**\n     * Removes the current adapter. Fires stop if needed. Calls adapter.dispose()\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  removeAdsAdapter: function () {\n    if (this._adsAdapter) {\n      this._adsAdapter.dispose()\n      this._adsAdapter.plugin = null\n      if (this.adsAdapterListeners) {\n        for (var key in this.adsAdapterListeners) {\n          this._adsAdapter.off(key, this.adsAdapterListeners[key])\n        }\n        delete this.adsAdapterListeners\n      }\n      this.resizeScrollDetector.stopDetection()\n      this._adsAdapter = null\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n  _adStartListener: function (e) {\n    if (this._adapter) {\n      this._adapter.fireBufferEnd(null, 'adStartListener')\n      this._adapter.fireSeekEnd(null, 'adStartListener')\n      if (!this.isInitiated && !this._adapter.flags.isStarted) this._adapter.fireStart()\n      if (this._adapter.flags.isPaused) this._adapter.chronos.pause.reset()\n    } else {\n      this.fireInit()\n    }\n    if (this._adsAdapter) {\n      this._adsAdapter.chronos.viewedMax = []\n    }\n    var params = e.data.params || {}\n    params.adNumber = this.requestBuilder.getNewAdNumber()\n    var allParamsReady = (this.getAdResource() || this.getAdTitle()) && typeof this.getAdDuration() === 'number'\n    if (allParamsReady) {\n      this.adStartSent = true\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_START, Constants.Service.AD_START, params)\n    } else {\n      this.adInitSent = true\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_INIT, Constants.Service.AD_INIT, params)\n    }\n  },\n\n  _adJoinListener: function (e) {\n    var params = {}\n    Util.assign(params, e.data.params || {})\n    if (this.adInitSent && !this.adStartSent) {\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_START, Constants.Service.AD_START, params)\n    }\n    this._adsAdapter.startChronoView()\n    if (this.adConnected) {\n      this._adsAdapter.chronos.join.startTime = this.adConnectedTime\n      this._adsAdapter.chronos.total.startTime = this.adConnectedTime\n      this.adConnectedTime = 0\n      this.adConnected = false\n    }\n    params = e.data.params || {}\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_JOIN, Constants.Service.AD_JOIN, params)\n    this.adInitSent = false\n    this.adStartSent = false\n  },\n\n  _adPauseListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.stopChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_PAUSE, Constants.Service.AD_PAUSE, params)\n  },\n\n  _adResumeListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.startChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_RESUME, Constants.Service.AD_RESUME, params)\n  },\n\n  _adBufferBeginListener: function (e) {\n    Log.notice('Ad Buffer Begin')\n    this._adsAdapter.stopChronoView()\n    if (this._adsAdapter && this._adsAdapter.flags.isPaused) {\n      this._adsAdapter.chronos.pause.reset()\n    }\n  },\n\n  _adBufferEndListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.startChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_BUFFER, Constants.Service.AD_BUFFER, params)\n  },\n\n  _adStopListener: function (e) {\n    this._adsAdapter.stopChronoView()\n    this._adsAdapter.flags.reset()\n    this._totalPrerollsTime = (this._totalPrerollsTime || 0) + this._adsAdapter.chronos.total.getDeltaTime()\n\n    var params = e.data.params || {}\n    params.position = this.requestBuilder.lastSent.position\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_STOP, Constants.Service.AD_STOP, params)\n\n    // If its a stop for a postroll we check if we can detect if its the last one to call view stop\n    if (this.requestBuilder.lastSent.position === Constants.AdPosition.Postroll) {\n      var pat = this.options['ad.expectedPattern']\n      this.playedPostrolls++\n      // If we know the amount of postrolls and this was the last one\n      if ((this.requestBuilder.lastSent.givenAds && this.requestBuilder.lastSent.givenAds <= this.playedPostrolls) ||\n      // Or if we have expected (and not given!) and this was the last expected one\n      (!this.requestBuilder.lastSent.givenAds && pat && pat.post && pat.post[0] && pat.post[0] <= this.playedPostrolls)) {\n        this.fireStop()\n      }\n    }\n\n    this.adConnected = true\n    this.adConnectedTime = new Date().getTime()\n  },\n\n  _adErrorListener: function (e) {\n    var params = e.data.params || {}\n    if (this._adapter && !this._adapter.flags.isStarted && !this.isInitiated) {\n      this._savedAdError = e\n      return null // Ignore ad errors before content\n    }\n    if (this._blockAdError(e.data.params)) return null\n    if (this._adsAdapter) {\n      this._adsAdapter.fireManifest()\n      this._adsAdapter.fireBreakStart()\n    }\n    if (!this._adsAdapter || !this._adsAdapter.flags.isStarted) {\n      params.adNumber = this.requestBuilder.getNewAdNumber()\n      params.adNumberInBreak = this.requestBuilder.getNewAdNumberInBreak()\n    }\n    if (!this.isBreakStarted) {\n      params.breakNumber = this.requestBuilder.getNewBreakNumber()\n    }\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_ERROR, Constants.Service.AD_ERROR, params)\n  },\n\n  _adSavedError: function () {\n    if (this._savedAdError) {\n      this._adErrorListener(this._savedAdError)\n      this._savedAdError = null\n    }\n  },\n\n  _adSavedManifest: function () {\n    if (this._savedAdManifest) {\n      this._adManifestListener(this._savedAdManifest)\n      this._savedAdManifest = null\n    }\n  },\n\n  _blockAdError: function (errorParams) {\n    var now = Date.now()\n    var sameError = this._lastAdErrorParams &&\n      this._lastAdErrorParams.errorCode === errorParams.errorCode &&\n      this._lastAdErrorParams.msg === errorParams.msg &&\n      this._lastAdErrorParams.adCreativeId === this.getAdCreativeId()\n\n    if (sameError && this._lastAdErrorTime + 5000 > now) {\n      this._lastAdErrorTime = now\n      return true\n    }\n    this._lastAdErrorTime = now\n    this._lastAdErrorParams = errorParams\n    return false\n  },\n\n  _adClickListener: function (e) {\n    var params = e.data.params || {}\n    this._adsAdapter.stopChronoView()\n    this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_CLICK, Constants.Service.AD_CLICK, params)\n  },\n\n  _adManifestListener: function (e) {\n    if (!this.isAdsManifestSent) {\n      if (this._adapter && !this._adapter.flags.isStarted && !this.isInitiated) {\n        this._savedAdManifest = e\n        return null // Ignore ad manifest before content\n      }\n      var params = e.data.params || {}\n      this.isAdsManifestSent = true\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_MANIFEST, Constants.Service.AD_MANIFEST, params)\n    }\n  },\n\n  _adBreakStartListener: function (e) {\n    if (!this.isBreakStarted) {\n      this.isBreakStarted = true\n      if (this._adapter) this._adapter.firePause()\n      var params = e.data.params || {}\n      params.breakNumber = this.requestBuilder.getNewBreakNumber()\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_POD_START, Constants.Service.AD_POD_START, params)\n      this.adConnected = false\n    }\n  },\n\n  _adBreakStopListener: function (e) {\n    if (this.isBreakStarted) {\n      this.isBreakStarted = false\n      var params = e.data.params || {}\n      params.position = this.requestBuilder.lastSent.position\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_POD_STOP, Constants.Service.AD_POD_STOP, params)\n      this.adConnected = false\n      if (this._adapter) this._adapter.fireResume()\n    }\n  },\n\n  _adQuartileListener: function (e) {\n    var params = e.data.params || {}\n    if (params.quartile) {\n      this._sendAdEventIfAllowed(Constants.WillSendEvent.WILL_SEND_AD_QUARTILE, Constants.Service.AD_QUARTILE, params)\n    }\n  },\n\n  _sendAdEventIfAllowed: function (willSend, service, params) {\n    if (!this.options['ad.ignore']) this._send(willSend, service, params)\n    Log.notice(service)\n  }\n\n}\n\nmodule.exports = PluginAdsMixin\n","var Log = require('../log')\nvar Util = require('../util')\nvar version = require('../version')\nvar TransportFormat = require('../constants/transportFormat.js')\nvar StreamingProtocol = require('../constants/streamingProtocols')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginContentGetterMixin = {\n  /**\n       * Returns content's playhead\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayhead: function () {\n    var ret = this._safeGetterAdapter('getPlayhead')\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n       * Returns content's PlayRate\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayrate: function () {\n    var ret = 0\n    if (this._adapter && this._adapter.flags && !this._adapter.flags.isPaused) {\n      try {\n        ret = this._adapter.getPlayrate()\n      } catch (err) {\n        Log.warn('An error occured while calling getPlayrate', err)\n      }\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's FramesPerSecond\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getFramesPerSecond: function () {\n    return this._safeGetterAdapter('getFramesPerSecond', 'content.fps')\n  },\n\n  /**\n   * Returns content's segment duration\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getSegmentDuration: function () {\n    return this.hybridNetwork.getSegmentDuration() || this._safeGetterAdapter('getSegmentDuration', 'content.segmentDuration')\n  },\n\n  /**\n       * Returns content's DroppedFrames\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDroppedFrames: function () {\n    var ret = this._safeGetterAdapter('getDroppedFrames')\n    if (!ret) {\n      ret = this.getWebkitDroppedFrames()\n    }\n    return Util.parseNumber(ret, 0)\n  },\n\n  /**\n       * Returns dropped frames as per webkitDroppedFrameCount\n       *\n       * @returns {number}\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getWebkitDroppedFrames: function () {\n    if (this._adapter && this._adapter.tag && this._adapter.tag.webkitDroppedFrameCount) {\n      return this._adapter.tag.webkitDroppedFrameCount\n    }\n    return null\n  },\n\n  /**\n       * Returns content's Duration\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDuration: function () {\n    var ret = this._safeGetterAdapter('getDuration', 'content.duration') || null\n    return Util.parseNumber(Math.round(ret), null)\n  },\n\n  /**\n       * Returns content's Bitrate\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getBitrate: function () {\n    var ret = this._safeGetterAdapter('getBitrate', 'content.bitrate')\n    if (!ret || ret === -1) {\n      ret = this.getWebkitBitrate()\n    }\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n       * Returns content's total bytes downloaded\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTotalBytes: function () {\n    return this.options['content.sendTotalBytes'] ? this._safeGetterAdapter('getTotalBytes', 'content.totalBytes') : null\n  },\n\n  /**\n       * Returns bitrate as per webkitVideoDecodedByteCount\n       *\n       * @param {Object} tag Video tag DOM reference.\n       * @returns {number}\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getWebkitBitrate: function () {\n    if (this._adapter && this._adapter.tag && this._adapter.tag.webkitVideoDecodedByteCount) {\n      var bitrate = this._adapter.tag.webkitVideoDecodedByteCount\n      if (this._lastWebkitBitrate) {\n        var delta = this._adapter.tag.webkitVideoDecodedByteCount - this._lastWebkitBitrate\n        bitrate = Math.round(((delta) / this.viewTransform.response.pingTime) * 8)\n      }\n      this._lastWebkitBitrate = this._adapter.tag.webkitVideoDecodedByteCount\n      return bitrate !== 0 ? bitrate : -1\n    }\n  },\n\n  /**\n       * Returns content's Throughput\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getThroughput: function () {\n    var ret = this._safeGetterAdapter('getThroughput', 'content.throughput')\n    return Util.parseNumber(ret, -1)\n  },\n\n  /**\n       * Returns content's Rendition\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getRendition: function () {\n    return this._safeGetterAdapter('getRendition', 'content.rendition')\n  },\n\n  /**\n       * Returns content's Title\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTitle: function () {\n    return this._safeGetterAdapter('getTitle', 'content.title')\n  },\n\n  /**\n       * Returns content's Title2\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTitle2: function () {\n    return this._safeGetterAdapter('getTitle2', 'content.program')\n  },\n\n  /**\n       * Returns content's IsLive\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getIsLive: function () {\n    var ret = this.options['content.isLive']\n    if (!ret && ret !== false) {\n      ret = this._safeGetterAdapter('getIsLive') || false\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's Resource after being parsed by the resourceTransform\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getResource: function () {\n    return this._safeGetterAdapter('getResource', 'content.resource')\n  },\n\n  getParsedResource: function () {\n    var ret = null\n    if (!this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getResource()\n    }\n    ret = ret || this._safeGetterAdapter('getURLToParse')\n    return (ret === this.getResource()) ? null : ret\n  },\n\n  /**\n       * Returns content's TransactionCode\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTransactionCode: function () {\n    return this.options['content.transactionCode']\n  },\n\n  /**\n       * Returns content's Metadata\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getMetadata: function () {\n    return this.options['content.metadata']\n  },\n\n  /**\n       * Returns content's PlayerVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayerVersion: function () {\n    return this._safeGetterAdapter('getPlayerVersion') || ''\n  },\n\n  /**\n       * Returns content's PlayerName\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlayerName: function () {\n    return this._safeGetterAdapter('getPlayerName') || ''\n  },\n\n  /**\n       * Returns content's Cdn\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCdn: function () {\n    var ret = null\n    if (!this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getCdnName()\n    }\n    return ret || this.options['content.cdn']\n  },\n\n  /**\n       * Returns content's PluginVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPluginVersion: function () {\n    var ret = this.getAdapterVersion()\n    if (!ret) ret = version + '-adapterless-js'\n\n    return ret\n  },\n\n  /**\n       * Returns content's PluginVersion\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getLibVersion: function () {\n    return version\n  },\n\n  /**\n       * Returns ads adapter getVersion or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getAdapterVersion: function () {\n    return this._safeGetterAdapter('getVersion')\n  },\n\n  /**\n       * Returns cdn traffic received in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCdnTraffic: function () {\n    return this._safeGetterAdapter('getCdnTraffic') || this.hybridNetwork.getCdnTraffic()\n  },\n\n  /**\n   * Returns multi cdn traffic received in bytes or null\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getMultiCdnInfo: function () {\n    return this.hybridNetwork.getMultiCdnInfo()\n  },\n\n  /**\n   * Returns cdn balancer response id\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getBalancerResponseId: function () {\n    var ret = this.hybridNetwork.getBalancerResponseId()\n    if (!ret && this.options['cdnbalancer.uuid']) {\n      return this.options['cdnbalancer.uuid']\n    }\n    return ret\n  },\n\n  /**\n       * Returns p2p traffic received in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getP2PTraffic: function () {\n    return this._safeGetterAdapter('getP2PTraffic') || this.hybridNetwork.getP2PTraffic()\n  },\n\n  /**\n       * Returns p2p traffic sent in bytes or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getUploadTraffic: function () {\n    return this._safeGetterAdapter('getUploadTraffic') || this.hybridNetwork.getUploadTraffic()\n  },\n\n  /**\n       * Returns if p2p plugin is enabled or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getIsP2PEnabled: function () {\n    return this._safeGetterAdapter('getIsP2PEnabled') || this.hybridNetwork.getIsP2PEnabled()\n  },\n\n  /** Returns streaming protocol (DASH, HLS, HDS...) */\n  getStreamingProtocol: function () {\n    var ret = this.options['content.streamingProtocol']\n    // if ret is not in the list of possible options, ret = null\n    if (ret) {\n      for (var i in StreamingProtocol) {\n        if (StreamingProtocol[i] === ret) {\n          return ret\n        }\n      }\n    }\n    return null\n  },\n\n  /** Returns transport format (TS, MP4) */\n  getTransportFormat: function () {\n    var ret = this.options['content.transportFormat']\n    if (!ret && this.options['parse.manifest'] && !this.resourceTransform.isBlocking()) {\n      ret = this.resourceTransform.getTransportFormat()\n    }\n    // if ret is not in the list of possible options, ret = null\n    if (ret) {\n      for (var i in TransportFormat) {\n        if (TransportFormat[i] === ret) {\n          return ret\n        }\n      }\n    }\n    return null\n  },\n\n  /** Returns household id */\n  getHouseholdId: function () {\n    return this._safeGetterAdapter('getHouseholdId')\n  },\n\n  /**\n       * Returns latency of a live video, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getLatency: function () {\n    return this.getIsLive() ? this._safeGetterAdapter('getLatency') : null\n  },\n\n  /**\n       * Returns the amount of packets lost, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPacketLoss: function () {\n    return this._safeGetterAdapter('getPacketLoss')\n  },\n\n  /**\n       * Returns the amount of packets sent, or null\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPacketSent: function () {\n    return this._safeGetterAdapter('getPacketSent')\n  },\n\n  /**\n       * Returns a json with the metrics to be reported in pings when changed\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoMetrics: function () {\n    return Util.getMetricsFrom(this._adapter ? this._adapter.getMetrics() : null, this.options['content.metrics'])\n  },\n\n  getPlayerStartupTime: function () {\n    return this.browserLoadTimes.getPlayerStartupTime()\n  },\n\n  // ----------------------------------------- CHRONOS ------------------------------------------\n\n  /**\n       * Returns JoinDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getJoinDuration: function () {\n    return this._adapter ? this._adapter.chronos.join.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns BufferDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getBufferDuration: function () {\n    return this._adapter ? this._adapter.chronos.buffer.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns SeekDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSeekDuration: function () {\n    return this._adapter ? this._adapter.chronos.seek.getDeltaTime(false) : -1\n  },\n\n  /**\n       * Returns pauseDuration chrono delta time\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPauseDuration: function () {\n    return this._adapter ? this._adapter.chronos.pause.getDeltaTime(false) : 0\n  },\n\n  /**\n       * Returns content's package\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPackage: function () {\n    return this.options['content.package']\n  },\n\n  /**\n       * Returns content's saga\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSaga: function () {\n    return this.options['content.saga']\n  },\n\n  /**\n       * Returns content's tv show\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getTvShow: function () {\n    return this.options['content.tvShow']\n  },\n\n  /**\n       * Returns content's season\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSeason: function () {\n    return this.options['content.season']\n  },\n\n  /**\n       * Returns content's episode title\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getEpisodeTitle: function () {\n    return this.options['content.episodeTitle']\n  },\n\n  /**\n       * Returns content's channel\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getChannel: function () {\n    return this.options['content.channel']\n  },\n\n  /**\n       * Returns content's id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getID: function () {\n    return this.options['content.id']\n  },\n\n  /**\n       * Returns content's IMDB id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getImdbId: function () {\n    return this.options['content.imdbId']\n  },\n\n  /**\n       * Returns content's gracenote id\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getGracenoteID: function () {\n    return this.options['content.gracenoteId']\n  },\n\n  /**\n       * Returns content's type\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getType: function () {\n    return this.options['content.type']\n  },\n\n  /**\n       * Returns content's genre\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getGenre: function () {\n    return this.options['content.genre']\n  },\n\n  /**\n       * Returns content's language\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoLanguage: function () {\n    return this.options['content.language']\n  },\n\n  /**\n       * Returns content's subtitles\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getSubtitles: function () {\n    return this.options['content.subtitles']\n  },\n\n  /**\n       * Returns content's contracted resolution\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getContractedResolution: function () {\n    return this.options['content.contractedResolution']\n  },\n\n  /**\n       * Returns content's cost\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCost: function () {\n    return this.options['content.cost']\n  },\n\n  /**\n       * Returns content's price\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPrice: function () {\n    return this.options['content.price']\n  },\n\n  /**\n       * Returns content's playback type\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getPlaybackType: function () {\n    var ret = this.options['content.playbackType']\n    if (!ret) {\n      var isLive = this.options['content.isLive']\n      if (typeof isLive !== 'boolean') {\n        isLive = this._safeGetterAdapter('getIsLive')\n      }\n      if (typeof isLive === 'boolean') {\n        ret = isLive ? 'Live' : 'VoD'\n      }\n    }\n    return ret\n  },\n\n  /**\n       * Returns content's DRM\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getDRM: function () {\n    return this.options['content.drm']\n  },\n\n  /**\n       * Returns content's video codec\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getVideoCodec: function () {\n    return this._safeGetterAdapter('getVideoCodec', 'content.encoding.videoCodec')\n  },\n\n  /**\n       * Returns content's audio codec\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getAudioCodec: function () {\n    return this._safeGetterAdapter('getAudioCodec', 'content.encoding.audioCodec')\n  },\n\n  /**\n       * Returns content's codec settings\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCodecSettings: function () {\n    return this.options['content.encoding.codecSettings']\n  },\n\n  /**\n       * Returns content's codec profile\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getCodecProfile: function () {\n    return this.options['content.encoding.codecProfile']\n  },\n\n  /**\n       * Returns content's container format\n       *\n       * @memberof youbora.Plugin.prototype\n       */\n  getContainerFormat: function () {\n    return this.options['content.encoding.containerFormat']\n  },\n\n  /**\n     * Returns linked view id string\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getLinkedViewId: function () {\n    return this.options.linkedViewId\n  },\n\n  _safeGetterAdapter: function (functionName, optionName) {\n    var ret = null\n    if (optionName && this.options[optionName]) {\n      ret = this.options[optionName]\n    } else {\n      try {\n        if (this._adapter && typeof this._adapter[functionName] === 'function') {\n          ret = this._adapter[functionName]()\n        }\n      } catch (err) {\n        Log.warn('An error occured while calling ' + functionName, err)\n      }\n    }\n    return ret\n  }\n}\n\nmodule.exports = PluginContentGetterMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\nvar Util = require('../util')\nvar Adapter = require('../adapter/adapter')\n\n// This file is designed to add extra functionalities to Plugin class\n\n/** @lends youbora.Plugin.prototype */\nvar PluginContentMixin = {\n  /**\n   * Sets an adapter for video content.\n   *\n   * @param {Adapter} adapter\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  setAdapter: function (adapter) {\n    if (this.browserLoadTimes) this.browserLoadTimes.setPlayerSetupTime()\n    if (adapter.plugin) {\n      Log.warn('Adapters can only be added to a single plugin')\n    } else {\n      this.removeAdapter()\n\n      this._adapter = adapter\n      adapter.plugin = this\n      adapter.setIsAds(false)\n\n      // Register listeners\n      this.contentAdapterListeners = {}\n      this.contentAdapterListeners[Adapter.Event.START] = this._startListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.JOIN] = this._joinListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.PAUSE] = this._pauseListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.RESUME] = this._resumeListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.SEEK_BEGIN] = this._seekBufferBeginListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.SEEK_END] = this._seekEndListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.BUFFER_BEGIN] = this._seekBufferBeginListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.BUFFER_END] = this._bufferEndListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.ERROR] = this._errorListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.STOP] = this._stopListener.bind(this)\n      this.contentAdapterListeners[Adapter.Event.VIDEO_EVENT] = this._videoEventListener.bind(this)\n\n      for (var key in this.contentAdapterListeners) {\n        this._adapter.on(key, this.contentAdapterListeners[key])\n      }\n\n      // We have to trigger an ('adapterSet') event in here so that ProductAnalytics can listen to it and call the appropriate methods\n\n      if (this.productAnalytics) {\n        this.productAnalytics.adapterAfterSet()\n      }\n    }\n  },\n\n  /**\n   * Returns current adapter or null.\n   *\n   * @returns {Adapter}\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getAdapter: function () {\n    return this._adapter\n  },\n\n  /**\n   * Removes the current adapter. Fires stop if needed. Calls adapter.dispose().\n   *\n   * @memberof youbora.Plugin.prototype\n   * */\n  removeAdapter: function () {\n    if (this._adapter) {\n      // We have to trigger an ('adapterBeforeRemove') event in here so that ProductAnalytics can listen to it and call the appropriate methods\n\n      if (this.productAnalytics) {\n        this.productAnalytics.adapterBeforeRemove()\n      }\n\n      this._adapter.dispose()\n      this._adapter.plugin = null\n\n      if (this.contentAdapterListeners) {\n        for (var key in this.contentAdapterListeners) {\n          this._adapter.off(key, this.contentAdapterListeners[key])\n        }\n        delete this.contentAdapterListeners\n      }\n\n      this._adapter = null\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n  _startListener: function (e) {\n    if (!this.isInitiated) {\n      this.viewTransform.nextView()\n      this._initComm()\n      this._startPings()\n    } else if (this.initChrono.startTime !== 0) {\n      this._adapter.chronos.join.startTime = this.initChrono.startTime\n    }\n    try {\n      // If exists resourceTransform, init with the resource\n      if (this._adapter && this.resourceTransform) {\n        var resource = this._getResourceForTransform()\n        this.resourceTransform.init(resource)\n      }\n    } catch (e) {}\n    var params = e.data.params || {}\n    var allParamsReady = this.getResource() && typeof this.getIsLive() === 'boolean' &&\n      (this.getIsLive() || (typeof this.getDuration() === 'number' && this.getDuration() > 0)) && this.getTitle()\n    allParamsReady = this.options.forceInit ? false : (allParamsReady && this._isExtraMetadataReady())\n    if (allParamsReady && !this.isInitiated) { // start\n      this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, params)\n      this._adSavedError()\n      this._adSavedManifest()\n      Log.notice(Constants.Service.START + ' ' + (params.title || params.mediaResource))\n      this.isStarted = true\n      // chrono if had no adapter when inited\n    } else if (!this.isInitiated) { // init\n      this.isInitiated = true\n      this._adapter.chronos.join.start()\n      this._send(Constants.WillSendEvent.WILL_SEND_INIT, Constants.Service.INIT, params)\n      this._adSavedError()\n      this._adSavedManifest()\n      Log.notice(Constants.Service.INIT + ' ' + (params.title || params.mediaResource))\n    }\n  },\n\n  _retryStart: function (e) {\n    if (this._isExtraMetadataReady()) {\n      this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, {})\n      this.startDelayed = false\n    }\n  },\n\n  _joinListener: function (e) {\n    var params = {}\n    Util.assign(params, e.data.params || {})\n    if (!this._adsAdapter || !this._adsAdapter.flags.isStarted) {\n      if (this._adapter) {\n        this._adapter.chronos.join.startTime = Math.min(\n          this._adapter.chronos.join.startTime + (this._totalPrerollsTime || 0),\n          new Date().getTime()\n        )\n        this._totalPrerollsTime = 0\n      }\n      if (this.isInitiated && !this.isStarted) { // start if just inited\n        if (this._isExtraMetadataReady()) {\n          this._send(Constants.WillSendEvent.WILL_SEND_START, Constants.Service.START, params)\n        } else {\n          this.startDelayed = true\n        }\n        this._adSavedError()\n        this._adSavedManifest()\n        Log.notice(Constants.Service.START + ' ' + (params.title || params.mediaResource))\n        this.isStarted = true\n      }\n      params = e.data.params || {}\n      if (this._adsAdapter && this.isBreakStarted) {\n        this._adsAdapter.fireBreakStop()\n      }\n      this._send(Constants.WillSendEvent.WILL_SEND_JOIN, Constants.Service.JOIN, params)\n      Log.notice(Constants.Service.JOIN + ' ' + params.joinDuration + 'ms')\n    } else { // If it is currently showing ads, join is invalidated\n      if (this._adapter.monitor) this._adapter.monitor.stop()\n      this._adapter.flags.isJoined = false\n      this._adapter.chronos.join.stopTime = 0\n    }\n  },\n\n  _pauseListener: function (e) {\n    if (this._adapter) {\n      if (this._adapter.flags.isBuffering ||\n        this._adapter.flags.isSeeking ||\n        (this._adsAdapter && this._adsAdapter.flags.isStarted)) {\n        this._adapter.chronos.pause.reset()\n      }\n    }\n\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_PAUSE, Constants.Service.PAUSE, params)\n    Log.notice(Constants.Service.PAUSE + ' at ' + params.playhead + 's')\n  },\n\n  _resumeListener: function (e) {\n    if (this._adsAdapter && this.isBreakStarted && !this._adsAdapter.flags.isStarted) {\n      this._adsAdapter.fireBreakStop()\n    }\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_RESUME, Constants.Service.RESUME, params)\n    Log.notice(Constants.Service.RESUME + ' ' + params.pauseDuration + 'ms')\n    this._adapter.chronos.pause.reset()\n  },\n\n  _seekBufferBeginListener: function (e) {\n    if (this._adapter && this._adapter.flags.isPaused) this._adapter.chronos.pause.reset()\n    if (e.type && e.type.includes('buffer')) {\n      Log.notice(e.type + ', eventsTriggered: ' + this._adapter.fireEventsStruct.buffer)\n    } else {\n      Log.notice(e.type + ', eventsTriggered: ' + this._adapter.fireEventsStruct.seek)\n    }\n  },\n\n  _seekEndListener: function (e) {\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_SEEK, Constants.Service.SEEK, params)\n    Log.notice(Constants.Service.SEEK +\n      ' to ' + params.playhead +\n      ' in ' + params.seekDuration + 'ms' +\n      ((params.triggeredEvents) ? ', eventsTriggered: ' + params.triggeredEvents : '')\n    )\n  },\n\n  _bufferEndListener: function (e) {\n    var params = e.data.params || {}\n    this._send(Constants.WillSendEvent.WILL_SEND_BUFFER, Constants.Service.BUFFER, params)\n    Log.notice(Constants.Service.BUFFER +\n      ' to ' + params.playhead +\n      ' in ' + params.bufferDuration + 'ms' +\n      ((params.triggeredEvents) ? ', eventsTriggered: ' + params.triggeredEvents : '')\n    )\n  },\n\n  _errorListener: function (e) {\n    if (!this._blockError(e.data.params)) {\n      this.fireError(e.data.params || {})\n      this._adSavedError()\n      this._adSavedManifest()\n    }\n  },\n\n  _blockError: function (errorParams) {\n    var now = Date.now()\n    var sameError = this._lastErrorParams\n      ? this._lastErrorParams.errorCode === errorParams.errorCode && this._lastErrorParams.msg === errorParams.msg\n      : false\n    if (sameError && this._lastErrorTime + 5000 > now) {\n      this._lastErrorTime = now\n      return true\n    }\n    this._lastErrorTime = now\n    this._lastErrorParams = errorParams\n    return false\n  },\n\n  _stopListener: function (e) {\n    this.fireStop(e.data.params || {})\n  },\n\n  _isStopReady: function (e) {\n    var ret = false\n    // this solution is only for the case of:\n    if (!this.requestBuilder.lastSent.live && // VOD, live have no postrolls\n      this._adsAdapter && // having ads adapter connected\n      this._adapter && // playhead close to the end of the content (or 0 because is already restarted)\n      (!this._adapter.getPlayhead() || this._adapter.getPlayhead() >= this.requestBuilder.lastSent.mediaDuration - 1)) {\n      var expectedPostrolls = 0\n      var pat = this.options['ad.expectedPattern']\n      // We can get the expectedPostrolls from the expected pattern if it has postrolls defined\n      if (pat && pat.post && pat.post[0]) {\n        expectedPostrolls = pat.post[0]\n        // If not, while playing postrolls after adbreakstart we can get the givenAds\n      } else if (this.requestBuilder.lastSent.breaksTime) {\n        if (this.requestBuilder.lastSent.position === Constants.AdPosition.Postroll) {\n          expectedPostrolls = this.requestBuilder.lastSent.givenAds\n        }\n        // Or before playing postrolls, at least, we can check using breaksTime (from adManifest event) if we expect at least 1 postroll\n        if (!expectedPostrolls && this.requestBuilder.lastSent.breaksTime) {\n          var breaks = this.requestBuilder.lastSent.breaksTime\n          if (breaks.length > 0 && this.requestBuilder.lastSent.mediaDuration) { // If there is no duration probably is a live content, so no postrolls\n            var lastTimePosition = Math.round(breaks[breaks.length - 1])\n            if (lastTimePosition + 1 >= this.requestBuilder.lastSent.mediaDuration) {\n              expectedPostrolls = 1\n            }\n          }\n        }\n        // If none of the previous solutions found anything, we assume we have no postrolls\n      } else {\n        ret = true\n      }\n      // Finally, if the number of played postrolls is the same (or more) than the expected, we can close the view\n      if (expectedPostrolls <= this.playedPostrolls) {\n        ret = true\n      }\n    } else {\n      ret = true\n    }\n    return ret\n  },\n\n  _videoEventListener: function (e) {\n    this._send(Constants.WillSendEvent.WILL_SEND_VIDEO_EVENT, Constants.Service.VIDEO_EVENT, e.data.params)\n  },\n\n  _isExtraMetadataReady: function (e) {\n    // If the option is disabled, always is ready\n    if (!this.options.waitForMetadata || this.options.pendingMetadata.length < 1) return true\n    // If for existing parameters, one of them is false (no value for it), return false\n    var getters = this.requestBuilder.getGetters()\n    return this.options.pendingMetadata.map(function (element) {\n      if (getters.hasOwnProperty(element)) { // eslint-disable-line no-prototype-builtins\n        return !!this[getters[element]]()\n      }\n    }.bind(this)).indexOf(false) < 0\n  }\n}\n\nmodule.exports = PluginContentMixin\n","var Log = require('../log')\nvar Util = require('../util')\nvar Constants = require('../constants')\nvar Transform = require('../comm/transform/transform')\n\n// This file is designed to add extra functionalities to Plugin class\n\n/** @lends youbora.Plugin.prototype */\nvar PluginFireMixin = {\n  /**\n   * Sends /init. Should be called once the user has requested the content. Does not need\n   * a working adapter or player to work. it won't sent start if isInitiated is true.\n   *\n   * @param {Object} [params] Object of key:value params.\n   * @param {string} [triggeredEvent]\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireInit: function (params, triggeredEvent) {\n    if (!this.isInitiated) {\n      if (!this.getAdapter() || (this.getAdapter() && !this.getAdapter().flags.isStarted)) {\n        this.viewTransform.nextView()\n        this._initComm()\n        this._startPings()\n        this.initChrono.start()\n        this.isInitiated = true\n        params = params || {}\n        if (triggeredEvent) {\n          params.triggeredEvents = [triggeredEvent]\n        }\n        this._send(Constants.WillSendEvent.WILL_SEND_INIT, Constants.Service.INIT, params)\n        this._adSavedError()\n        this._adSavedManifest()\n        Log.notice(Constants.Service.INIT + ' ' + (params.title || params.mediaResource))\n      }\n    }\n  },\n\n  /**\n   * Sends /error. Should be used when the error is related to out-of-player errors: like async\n   * resource load or player loading errors.\n   *\n   * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n   * @param {String} [msg] Error Message\n   * @param {Object} [metadata] Object defining error metadata\n   * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireError: function (object, msg, metadata, level) {\n    this.fireInit()\n    var params = Util.buildErrorParams(object, msg, metadata, level)\n    if (params.code) {\n      delete params.code\n    }\n    this._send(Constants.WillSendEvent.WILL_SEND_ERROR, Constants.Service.ERROR, params)\n    this._adSavedError()\n    this._adSavedManifest()\n    Log.notice(Constants.Service.ERROR +\n      ' ' + params.errorLevel +\n      ' ' + params.errorCode\n    )\n\n    if (params.errorLevel === 'fatal') {\n      this.fireStop()\n    }\n  },\n\n  /**\n   * Calls fireErrors and then stops pings.\n   *\n   * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n   * @param {String} [msg] Error Message\n   * @param {Object} [metadata] Object defining error metadata\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireFatalError: function (object, msg, metadata, level) {\n    this.fireError(object, msg, metadata, level)\n    this.fireStop()\n  },\n\n  /**\n   * Fires /stop. Should be used to terminate sessions once the player is gone or if\n   * plugin.fireError() is called.\n   *\n   * @param {Object} [params] Object of key:value params.\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireStop: function (params) {\n    if (this.isInitiated || this.isStarted) {\n      if (this._adapter) {\n        this._adapter.flags.isStopped = true\n        if (this._adapter.monitor) this._adapter.monitor.stop()\n      }\n      if (this._adsAdapter && this.isBreakStarted) {\n        this._adsAdapter.fireStop()\n        this._adsAdapter.fireBreakStop()\n      }\n      params = params || {}\n      this._send(Constants.WillSendEvent.WILL_SEND_STOP, Constants.Service.STOP, params)\n      var chronos = this._adapter ? this._adapter.chronos : null\n      if (chronos) {\n        chronos.total.stop()\n        chronos.join.reset()\n        chronos.pause.reset()\n        chronos.buffer.reset()\n        chronos.seek.reset()\n      }\n      Log.notice(Constants.Service.STOP + ' at ' + params.playhead + 's')\n      this._reset()\n    }\n  },\n\n  /**\n   * Fires /offlineEvents. If offline is disabled, will try to send all the views stored.\n   *\n   * @param {Object} [params] Object of key:value params.\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  fireOfflineEvents: function (params) {\n    if (this.options && !this.options.offline) {\n      if (!this.isInitiated &&\n        (!this._adapter || !this._adapter.flags.isStarted) &&\n        (!this._adsAdapter || !this._adsAdapter.flags.isStarted)) {\n        this._offlineParams = params\n        if (this.viewTransform.response.code && this.viewTransform.response.host) {\n          this._generateAndSendOffline()\n        } else {\n          this.offlineReference = this._generateAndSendOffline.bind(this)\n          this.viewTransform.on(Transform.Event.DONE, this.offlineReference)\n        }\n      } else {\n        Log.error('Adapters have to be stopped')\n      }\n    } else {\n      Log.error('To send offline events, offline option must be disabled')\n    }\n  },\n\n  _generateAndSendOffline: function () {\n    if (this.options.disableStorage) return null\n    var params = this._offlineParams\n    this._initComm()\n    while (true) {\n      var bodyAndId = this.requestBuilder.buildBody(Constants.Service.OFFLINE_EVENTS).viewJson\n      if (bodyAndId[0] === null) break\n      var newViewCode = this.viewTransform.nextView()\n      var body = bodyAndId[0].replace(/CODE_PLACEHOLDER/g, newViewCode.toString())\n        .replace(/,\"sessionId\":\"SESSION_PLACEHOLDER\"/g, '') // this.viewTransform.getSession()\n        .replace(/,\"sessionRoot\":\"ROOT_PLACEHOLDER\"/g, '') // this.viewTransform.getSession()\n      // modify to support offline+infinity\n      this._send(Constants.WillSendEvent.WILL_SEND_OFFLINE_EVENTS, Constants.Service.OFFLINE_EVENTS,\n        params, body, 'POST', function (a, callbackParams) {\n          this.offlineStorage.removeView(callbackParams.offlineId)\n        }.bind(this), { offlineId: bodyAndId[1] })\n    }\n    this.offlineStorage.sent()\n    this._offlineParams = null\n  }\n}\n\nmodule.exports = PluginFireMixin\n","var Util = require('../util')\nvar version = require('../version')\nvar RequestMethod = require('../constants/requestMethod')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginGetterMixin = {\n  /**\n     * Returns service host\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getHost: function () {\n    var host = this.options.host\n    if (this.viewTransform && this.viewTransform.response && this.viewTransform.response.host) {\n      host = this.viewTransform.response.host\n    }\n    return Util.addProtocol(Util.stripProtocol(host), this.options['app.https'])\n  },\n\n  getUserType: function () {\n    return this.options['user.type']\n  },\n\n  /**\n     * Returns parse Manifest Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isParseManifest: function () {\n    return this.options['parse.manifest']\n  },\n\n  /**\n     * Returns parse CdnNode Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isParseCdnNode: function () {\n    return this.options['parse.cdnNode']\n  },\n\n  /**\n     * Returns parse cdn switch Flag\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  isCdnSwitch: function () {\n    return this.options['parse.cdnSwitchHeader']\n  },\n\n  /**\n     * Returns Cdn list\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getParseCdnNodeList: function () {\n    return this.options['parse.cdnNode.list']\n  },\n\n  /**\n     * Returns Cdn header name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getParseCdnNodeNameHeader: function () {\n    return this.options['parse.cdnNameHeader']\n  },\n\n  /**\n   * Returns header node name\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getParseNodeHeader: function () {\n    return this.options['parse.cdnNodeHeader']\n  },\n\n  /**\n     * Returns obfuscateIp option\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getObfuscateIp: function () {\n    return this.options['user.obfuscateIp']\n  },\n\n  /**\n   * Returns privacy protocol option\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getPrivacyProtocol: function () {\n    var ret = this.options['user.privacyProtocol']\n    if (typeof ret === 'string') {\n      ret = ret.toLowerCase()\n    }\n    return ret === 'optin' || ret === 'optout' ? ret : null\n  },\n\n  /**\n   * Returns content's custom dimensions\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getCustomDimensions: function () {\n    var dim = this.options['content.customDimensions']\n    return typeof dim === 'object' ? dim : null\n  },\n\n  /**\n     * Returns content's Extraparam1\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam1: function () {\n    return this.options['content.customDimension.1']\n  },\n\n  /**\n     * Returns content's Extraparam2\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam2: function () {\n    return this.options['content.customDimension.2']\n  },\n\n  /**\n     * Returns content's Extraparam3\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam3: function () {\n    return this.options['content.customDimension.3']\n  },\n\n  /**\n     * Returns content's Extraparam4\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam4: function () {\n    return this.options['content.customDimension.4']\n  },\n  /**\n     * Returns content's Extraparam5\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam5: function () {\n    return this.options['content.customDimension.5']\n  },\n\n  /**\n     * Returns content's Extraparam6\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam6: function () {\n    return this.options['content.customDimension.6']\n  },\n\n  /**\n     * Returns content's Extraparam7\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam7: function () {\n    return this.options['content.customDimension.7']\n  },\n\n  /**\n     * Returns content's Extraparam8\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam8: function () {\n    return this.options['content.customDimension.8']\n  },\n\n  /**\n     * Returns content's Extraparam9\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam9: function () {\n    return this.options['content.customDimension.9']\n  },\n\n  /**\n     * Returns content's Extraparam10\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam10: function () {\n    return this.options['content.customDimension.10']\n  },\n\n  /**\n     * Returns content's Extraparam11\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam11: function () {\n    return this.options['content.customDimension.11']\n  },\n\n  /**\n     * Returns content's Extraparam12\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam12: function () {\n    return this.options['content.customDimension.12']\n  },\n\n  /**\n     * Returns content's Extraparam13\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam13: function () {\n    return this.options['content.customDimension.13']\n  },\n\n  /**\n     * Returns content's Extraparam14\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam14: function () {\n    return this.options['content.customDimension.14']\n  },\n  /**\n     * Returns content's Extraparam15\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam15: function () {\n    return this.options['content.customDimension.15']\n  },\n\n  /**\n     * Returns content's Extraparam16\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam16: function () {\n    return this.options['content.customDimension.16']\n  },\n\n  /**\n     * Returns content's Extraparam17\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam17: function () {\n    return this.options['content.customDimension.17']\n  },\n\n  /**\n     * Returns content's Extraparam18\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam18: function () {\n    return this.options['content.customDimension.18']\n  },\n\n  /**\n     * Returns content's Extraparam19\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam19: function () {\n    return this.options['content.customDimension.19']\n  },\n\n  /**\n     * Returns content's Extraparam20\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getExtraparam20: function () {\n    return this.options['content.customDimension.20']\n  },\n\n  /**\n     * Returns ad's Extraparam1\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam1: function () {\n    return this.options['ad.customDimension.1']\n  },\n\n  /**\n     * Returns ad's Extraparam2\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam2: function () {\n    return this.options['ad.customDimension.2']\n  },\n\n  /**\n     * Returns ad's Extraparam3\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam3: function () {\n    return this.options['ad.customDimension.3']\n  },\n\n  /**\n     * Returns ad's Extraparam4\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam4: function () {\n    return this.options['ad.customDimension.4']\n  },\n  /**\n     * Returns ad's Extraparam5\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam5: function () {\n    return this.options['ad.customDimension.5']\n  },\n\n  /**\n     * Returns ad's Extraparam6\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam6: function () {\n    return this.options['ad.customDimension.6']\n  },\n\n  /**\n     * Returns ad's Extraparam7\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam7: function () {\n    return this.options['ad.customDimension.7']\n  },\n\n  /**\n     * Returns ad's Extraparam8\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam8: function () {\n    return this.options['ad.customDimension.8']\n  },\n\n  /**\n     * Returns ad's Extraparam9\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam9: function () {\n    return this.options['ad.customDimension.9']\n  },\n\n  /**\n     * Returns ad's Extraparam10\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAdExtraparam10: function () {\n    return this.options['ad.customDimension.10']\n  },\n\n  /**\n     * Returns PluginInfo\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getPluginInfo: function () {\n    var ret = {\n      lib: version,\n      adapter: this.getAdapterVersion(),\n      adAdapter: this.getAdAdapterVersion()\n    }\n    return ret\n  },\n\n  /**\n     * Returns Ip\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getIp: function () {\n    return this.options['network.ip']\n  },\n\n  /**\n     * Returns Isp\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getIsp: function () {\n    return this.options['network.isp']\n  },\n\n  /**\n     * Returns ConnectionType\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getConnectionType: function () {\n    return this.options['network.connectionType']\n  },\n\n  /** Returns deviceInfo json\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceInfo: function () {\n    var info = {}\n    if (this.getDeviceCode()) info.deviceCode = this.getDeviceCode()\n    if (this.getModel()) info.model = this.getModel()\n    if (this.getBrand()) info.brand = this.getBrand()\n    if (this.getDeviceType()) info.deviceType = this.getDeviceType()\n    if (this.getDeviceName()) info.deviceName = this.getDeviceName()\n    if (this.getOsName()) info.osName = this.getOsName()\n    if (this.getOsVersion()) info.osVersion = this.getOsVersion()\n    if (this.getBrowserName()) info.browserName = this.getBrowserName()\n    if (this.getBrowserVersion()) info.browserVersion = this.getBrowserVersion()\n    if (this.getBrowserType()) info.browserType = this.getBrowserType()\n    if (this.getBrowserEngine()) info.browserEngine = this.getBrowserEngine()\n    return (info !== {} ? info : null)\n  },\n\n  /** Returns EDID object\n   *\n   * @memberof youbora.Plugin.prototype\n   */\n  getEDID: function () {\n    var edid = this.options['device.EDID']\n    return edid ? edid.toString() : null\n  },\n\n  /**\n     * Returns DeviceCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceCode: function () {\n    return this.options['device.code']\n  },\n\n  /**\n     * Returns Device model\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getModel: function () {\n    return this.options['device.model']\n  },\n\n  /**\n     * Returns Device brand\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrand: function () {\n    return this.options['device.brand']\n  },\n\n  /**\n     * Returns Device type\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceType: function () {\n    return this.options['device.type']\n  },\n\n  /**\n     * Returns Device name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getDeviceName: function () {\n    return this.options['device.name']\n  },\n\n  /**\n     * Returns Device OS name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOsName: function () {\n    return this.options['device.osName']\n  },\n\n  /**\n     * Returns Device OS Version\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOsVersion: function () {\n    return this.options['device.osVersion']\n  },\n\n  /**\n     * Returns Device browser name\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserName: function () {\n    return this.options['device.browserName']\n  },\n\n  /**\n     * Returns Device browser version\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserVersion: function () {\n    return this.options['device.browserVersion']\n  },\n\n  /**\n     * Returns Device browser type\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserType: function () {\n    return this.options['device.browserType']\n  },\n\n  /**\n     * Returns DeviceCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getBrowserEngine: function () {\n    return this.options['device.browserEngine']\n  },\n\n  /**\n     * Returns AccountCode\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAccountCode: function () {\n    return this.options.accountCode\n  },\n\n  /**\n     * Returns Username\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getUsername: function () {\n    return this.options['user.name']\n  },\n\n  /**\n     * Returns AnonymousUser\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getAnonymousUser: function () {\n    return this.options['user.anonymousId']\n  },\n\n  /**\n     * Returns user email\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getEmail: function () {\n    return this.options['user.email']\n  },\n\n  /**\n     * Get URL referer.\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getReferer: function () {\n    var ret = this.options.referer || ''\n    if (!ret && typeof window !== 'undefined' && window.location) {\n      ret = window.location.href\n    }\n    return ret\n  },\n\n  /**\n     * Get URL referral.\n     * Previous page url.\n     * @memberof youbora.Plugin.prototype\n     */\n  getReferral: function () {\n    var ret = this.options.referral || ''\n    if (!ret && typeof document !== 'undefined') {\n      ret = document.referrer\n    }\n    return ret\n  },\n\n  /**\n     * Get Browser language\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getLanguage: function () {\n    var ret = null\n    if (typeof navigator !== 'undefined') {\n      ret = navigator.language\n    }\n    return ret\n  },\n\n  /**\n   * Get Screen resolution\n   *\n   * @memberof npaw.Plugin.prototype\n   */\n  getScreenResolution: function () {\n    var ret = null\n    try {\n      if (window && window.screen) {\n        var devicePixelRatio = window.devicePixelRatio || 1\n        ret = (window.screen.width * devicePixelRatio) + 'x' + (window.screen.height * devicePixelRatio)\n      }\n    } catch (e) {}\n    return ret\n  },\n\n  /**\n     * Returns the nodehost\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeHost: function () {\n    return this.options['content.cdnNode'] || this.resourceTransform.getNodeHost()\n  },\n\n  /**\n     * Returns the node type id\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeType: function () {\n    return this.options['content.cdnType'] || this.resourceTransform.getNodeType()\n  },\n\n  /**\n     * Returns the node type string\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getNodeTypeString: function () {\n    return this.resourceTransform.getNodeTypeString()\n  },\n\n  /**\n     * Returns requestNumber value, to prevent /data calls being cached\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getRequestNumber: function () {\n    return Math.random()\n  },\n\n  /**\n     * Returns a whole offline view and its id.\n     *\n     * @memberof youbora.Plugin.prototype\n     */\n  getOfflineView: function () {\n    var ret = null\n    if (this.offlineStorage) {\n      ret = this.offlineStorage.getView()\n    }\n    return ret\n  },\n\n  getDeviceUUID: function () {\n    var id = null\n    if (!this.options['device.isAnonymous']) {\n      id = this.options['device.id'] || this.uuidGenerator.getKey()\n    }\n    return id\n  },\n\n  getAppName: function () {\n    return this.options['app.name']\n  },\n\n  getAppReleaseVersion: function () {\n    return this.options['app.releaseVersion']\n  },\n\n  getIsBlocked: function () {\n    return this.options['ad.blockerDetected']\n  },\n\n  isMethodPostEnabled: function () {\n    return (this.options.method && (this.options.method.toLowerCase() === RequestMethod.POST))\n  },\n\n  getPlayheadMonitorEnabled: function () {\n    return this.options['playhead.monitor']\n  },\n\n  getReadyStateMonitorEnabled: function () {\n    return this.options['readyState.monitor']\n  }\n}\n\nmodule.exports = PluginGetterMixin\n","// This file is designed to add extra functionalities to Plugin class\n\nvar Util = require('../util')\n\nvar PluginInfinityGettersMixin = {\n  getContext: function () {\n    return 'Default'\n  },\n\n  getScrollDepth: function () {\n    var ret = this.storage.getSession('pageScrollDepth')\n    this.storage.removeSession('pageScrollDepth')\n    return ret\n  },\n\n  getSession: function () {\n    var ret = this.storage.getStorages('session')\n    // Some tvs set the value as 'undefined' as string when deleting the value\n    if (ret === 'undefined') {\n      ret = undefined\n    }\n    if (!ret) {\n      var data = this.getStoredData()\n      if (data) {\n        try {\n          ret = JSON.parse(data).q.c\n        } catch (err) {\n          // nothing\n        }\n      }\n    }\n    return ret\n  },\n\n  getStorageHost: function () {\n    var ret = null\n    var data = this.getStoredData()\n    if (data) {\n      try {\n        ret = JSON.parse(data).q.h\n      } catch (err) {\n        // nothing\n      }\n    }\n    return ret ? Util.addProtocol(ret, this.options['app.https']) : ret\n  },\n\n  getStoredData: function () {\n    return this.storage.getStorages('data')\n  },\n\n  getDataTime: function () {\n    return this.storage.getStorages('dataTime')\n  },\n\n  getLastActive: function () {\n    return this.storage.getStorages('lastactive')\n  },\n\n  setStoredData: function (data) {\n    this.storage.setStorages('data', data)\n  },\n\n  setSession: function (session) {\n    this.storage.setStorages('session', session)\n  },\n\n  setDataTime: function (time) {\n    this.storage.setStorages('dataTime', time)\n  },\n\n  setLastActive: function (last) {\n    this.storage.setStorages('lastactive', last)\n  },\n\n  getPageName: function () {\n    if (typeof document !== 'undefined' && document.title) {\n      return document.title\n    }\n  },\n\n  getPageLoadTime: function () {\n    return this.browserLoadTimes.getPageLoadTime()\n  },\n\n  getIsSessionExpired: function () {\n    var now = new Date().getTime()\n    return !this.getSession() || (this.infinity.getFirstActive() < now - this.sessionExpire)\n  },\n\n  getIsDataExpired: function () {\n    var now = new Date().getTime()\n    return !this.storage.isEnabled() || !this.getStoredData() || (this.infinity.getFirstActive() < now - this.sessionExpire)\n  }\n}\n\nmodule.exports = PluginInfinityGettersMixin\n","var Constants = require('../constants')\nvar Log = require('../log')\nvar YBRequest = require('../comm/request')\nvar Util = require('../util')\n\nvar YouboraInfinity = require('../infinity/infinity')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginInfinityMixin = {\n  _initInfinity: function () {\n    this.infinity.on(YouboraInfinity.Event.NAV, this._navListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.SESSION_START, this._sessionStartListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.SESSION_STOP, this._sessionStopListener.bind(this))\n    this.infinity.on(YouboraInfinity.Event.EVENT, this._eventListener.bind(this))\n  },\n\n  _sendInfinity: function (willSendEvent, service, params) {\n    params = this.requestBuilder.buildParams(params, service)\n\n    var data = {\n      params: params,\n      plugin: this,\n      adapter: this.getAdapter(),\n      adsAdapter: this.getAdsAdapter()\n    }\n\n    this.emit(willSendEvent, data)\n\n    if (this.infinity._comm && params !== null && this.options.enabled) {\n      this.lastServeiceSent = service\n      var request = new YBRequest(null, service, params)\n      if (this.isMethodPostEnabled()) {\n        request.setPostRequest(true)\n      }\n      this.infinity._comm.sendRequest(request)\n    }\n  },\n\n  // ---------------------------------------- LISTENERS -----------------------------------------\n\n  _navListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_NAV, Constants.Service.NAV, params)\n\n    // start beats\n    if (!this._beat.isRunning) this._beat.start()\n\n    Log.notice(Constants.Service.NAV + ' ' + params.route)\n  },\n\n  _sessionStartListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(\n      Constants.WillSendEvent.WILL_SEND_SESSION_START,\n      Constants.Service.SESSION_START,\n      params\n    )\n\n    // start beats\n    if (!this._beat.isRunning) this._beat.start()\n\n    Log.notice(Constants.Service.SESSION_START + ' ' + params.route)\n  },\n\n  _sessionStopListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(\n      Constants.WillSendEvent.WILL_SEND_SESSION_STOP,\n      Constants.Service.SESSION_STOP,\n      params\n    )\n\n    // stop beats\n    if (this._beat.isRunning) this._beat.stop()\n\n    Log.notice(Constants.Service.SESSION_STOP + ' ' + params.route)\n  },\n\n  _eventListener: function (e) {\n    var params = e.data.params || {}\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_EVENT, Constants.Service.EVENT, params)\n    Log.notice(Constants.Service.EVENT + ' ' + params.name)\n  },\n\n  /**\n   * Sends beat request\n   *\n   * @param {number} diffTime Time since the last ping\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _sendBeat: function (diffTime) {\n    var params = {\n      diffTime: diffTime\n    }\n\n    this._sendInfinity(Constants.WillSendEvent.WILL_SEND_BEAT, Constants.Service.BEAT, params)\n    if (this.infinity) {\n      this.infinity._setLastActive()\n    }\n    Log.verbose(Constants.Service.BEAT)\n  },\n\n  // ---------------------------------------- GETTERS -----------------------------------------\n\n  /**\n* Returns a json with the metrics to be reported in beats when changed\n*\n* @memberof youbora.Plugin.prototype\n*/\n  getSessionMetrics: function () {\n    return Util.getMetricsFrom(this.options['session.metrics'])\n  }\n}\n\nmodule.exports = PluginInfinityMixin\n","var Log = require('../log')\nvar Constants = require('../constants')\n\n// This file is designed to add extra functionalities to Plugin class\n\nvar PluginPingMixin = {\n  /**\n   * Starts sending pings.\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _startPings: function () {\n    if (!this._ping.isRunning) this._ping.start()\n  },\n\n  /**\n   * Stops sending pings.\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _stopPings: function () {\n    this._ping.stop()\n  },\n\n  /**\n   * Sends ping request\n   *\n   * @param {number} diffTime Time since the last ping\n   *\n   * @private\n   * @memberof youbora.Plugin.prototype\n   */\n  _sendPing: function (diffTime) {\n    var params = {\n      diffTime: diffTime,\n      entities: this.requestBuilder.getChangedEntities()\n    }\n    if (this._adapter) {\n      if (this._adapter.flags.isPaused) {\n        params = this.requestBuilder.fetchParams(params, ['pauseDuration'])\n      } else {\n        params = this.requestBuilder.fetchParams(params, ['bitrate', 'throughput', 'fps'])\n      }\n      if (this._adapter.flags.isJoined) {\n        params = this.requestBuilder.fetchParams(params, ['playhead'])\n      }\n      if (this._adapter.flags.isBuffering) {\n        params = this.requestBuilder.fetchParams(params, ['bufferDuration'])\n      }\n      if (this._adapter.flags.isSeeking) {\n        params = this.requestBuilder.fetchParams(params, ['seekDuration'])\n      }\n    }\n\n    if (this._adsAdapter && !this.options['ad.ignore']) {\n      if (this._adsAdapter.flags.isStarted) {\n        params = this.requestBuilder.fetchParams(params, ['adPlayhead', 'adViewedDuration', 'adViewability'])\n        if (this._adsAdapter.flags.isPaused) {\n          params = this.requestBuilder.fetchParams(params, ['adPauseDuration'])\n        } else {\n          params = this.requestBuilder.fetchParams(params, ['adBitrate'])\n        }\n      }\n      if (this._adsAdapter.flags.isBuffering) {\n        params = this.requestBuilder.fetchParams(params, ['adBufferDuration'])\n      }\n    }\n\n    this._send(Constants.WillSendEvent.WILL_SEND_PING, Constants.Service.PING, params)\n    if (this.startDelayed) {\n      this._retryStart()\n    }\n    Log.verbose(Constants.Service.PING)\n  }\n}\n\nmodule.exports = PluginPingMixin\n","var Emitter = require('../emitter')\nvar Timer = require('../timer')\nvar Chrono = require('../chrono')\nvar Constants = require('../constants')\nvar Util = require('../util')\n\nvar YBRequest = require('../comm/request')\nvar Communication = require('../comm/communication')\nvar FlowTransform = require('../comm/transform/flow')\nvar ViewTransform = require('../comm/transform/view')\nvar ResourceTransform = require('../comm/transform/resource')\nvar OfflineTransform = require('../comm/transform/offline')\n\nvar Options = require('./options')\nvar YouboraStorage = require('./storage')\nvar OfflineStorage = require('./offlineStorage')\nvar RequestBuilder = require('./requestbuilder')\n\nvar YouboraInfinity = require('../infinity/infinity')\nvar ProductAnalytics = require('../productanalytics/productanalytics')\n\nvar HybridNetwork = require('../monitors/hybridnetwork')\nvar BrowserLoadTimes = require('../monitors/browserLoadTimes')\nvar BackgroundDetector = require('../detectors/backgroundDetector')\nvar DeviceDetector = require('../detectors/deviceDetector')\nvar ResizeScrollDetector = require('../detectors/resizeScrollDetector')\nvar UUIDGenerator = require('../deviceUUID/hashgenerator')\n\nvar Plugin = Emitter.extend(\n  /** @lends youbora.Plugin.prototype */\n  {\n    /**\n     * This is the main class of video analytics. You may want to have one instance for each video\n     * you want to track. Will need {@link Adapter}s for both content and ads.\n     *\n     * @constructs Plugin\n     * @extends youbora.Emitter\n     * @memberof youbora\n     *\n     * @param {Options} [options] An object complying with {@link Options} constructor.\n     * @param {Adapter} [adapter] If an adapter is provided, setAdapter will be immediately called.\n     * @param {object} [dataReq] If a data response is given, it wont request to /data anything and will use this one instead.\n     */\n    constructor: function (options, adapter, dataReq) {\n      if (typeof adapter === 'string' && !dataReq) {\n        dataReq = adapter\n        adapter = null\n      }\n      /** Reference to {@link youbora.YouboraStorage} */\n      this.storage = new YouboraStorage()\n\n      /** UUIDGenerator manager */\n      this.uuidGenerator = new UUIDGenerator(this)\n\n      /** Instance of youbora infinity. */\n      this.infinity = new YouboraInfinity(this)\n\n      /** Instance of youbora Product Analytics. */\n      this.productAnalytics = new ProductAnalytics(this)\n\n      /** This flags indicates that /init has been called. */\n      this.isInitiated = false\n\n      /** This flags indicates that /adManifest has been called. */\n      this.isAdsManifestSent = false\n\n      /** Postroll counter to fix plugins reporting stop before postrolls */\n      this.playedPostrolls = 0\n\n      /** This flags indicates if an ad break is started */\n      this.isBreakStarted = false\n\n      /** Chrono for init times. */\n      this.initChrono = new Chrono()\n\n      /** Stored {@link Options} of the session. */\n      this.options = new Options(options)\n\n      /** Reference to {@link youbora.YouboraStorage} */\n      this.storage = new YouboraStorage(null, this.options.disableCookies, this.options.forceCookies, this.options.disableStorage)\n\n      /** Reference to {@link youbora.OfflineStorage} */\n      if (!this.options.disableStorage) {\n        this.offlineStorage = new OfflineStorage()\n      }\n\n      this._adapter = null\n      this._adsAdapter = null\n      this._ping = new Timer(this._sendPing.bind(this), 5000)\n      this._beat = new Timer(this._sendBeat.bind(this), 30000)\n      this._refreshData = new Timer(this._checkOldData.bind(this), 3600000) // 1h\n      this._refreshData.start()\n      this.sessionExpire = Number(this.storage.getLocal('sessionExpire')) * 1000 || 180000\n\n      this.requestBuilder = new RequestBuilder(this)\n\n      this.resourceTransform = new ResourceTransform(this)\n\n      this.lastEventTime = null\n\n      this.restartViewTransform(dataReq)\n\n      this._initInfinity()\n\n      this.hybridNetwork = new HybridNetwork()\n      this.browserLoadTimes = new BrowserLoadTimes(this)\n      this.deviceDetector = new DeviceDetector()\n      this.backgroundDetector = new BackgroundDetector(this)\n      this.resizeScrollDetector = new ResizeScrollDetector(this)\n      if (this.options['background.enabled']) this.backgroundDetector.startDetection()\n\n      if (adapter) this.setAdapter(adapter)\n    },\n\n    _checkOldData: function () {\n      if (this._adapter && this._adapter.flags.isStarted) return\n      if (this.infinity.infinityStarted) return\n      this.restartViewTransform()\n    },\n\n    restartViewTransform: function (response) {\n      // FastData\n      this.viewTransform = new ViewTransform(this)\n      this.viewTransform.on(ViewTransform.Event.DONE, this._receiveData.bind(this))\n\n      // External response\n      if (response) {\n        this.viewTransform.setData(response)\n        return\n      }\n\n      if (this.getIsDataExpired() || !this.getStorageHost() ||\n        ((this.storage.getLocal('accCode') !== this.options.accountCode) &&\n          (this.storage.getSession('accCode') !== this.options.accountCode))) { // If expired or nonexistant\n        this.storage.removeStorages('data')\n        this.storage.removeStorages('session')\n        this.storage.removeLocal('infinityStarted')\n        this.viewTransform.init() // request a new data\n      } else {\n        this.viewTransform.setData(this.getStoredData()) // use stored data\n      }\n    },\n\n    /**\n    * This callback is called when a correct data response is received.\n    *\n    * @param {any} e Response from fastdata\n    */\n    _receiveData: function (e) {\n      this._ping.interval = e.target.response.pingTime * 1000\n      this._beat.interval = e.target.response.beatTime * 1000\n      this.sessionExpire = e.target.response.sessionExpire * 1000\n      this.storage.setStorages('data', e.target.response.msg)\n      this.storage.setStorages('dataTime', new Date().getTime())\n      this.storage.setStorages('accCode', this.options.accountCode)\n      if (this.getIsSessionExpired()) {\n        this.viewTransform.setSession(this.viewTransform.response.code)\n        this.storage.setStorages('session', this.viewTransform.response.code)\n        this.storage.setStorages('host', this.viewTransform.response.host)\n      } else {\n        this.viewTransform.setSession(this.getSession())\n        this.viewTransform.setHost(this.getStorageHost())\n      }\n    },\n\n    /**\n    * Reset all variables and stop all timers\n    * @private\n    */\n    _reset: function () {\n      this._stopPings()\n      this.resourceTransform = new ResourceTransform(this)\n      if (this._adapter) { // The fix\n        this._adapter.flags.reset()\n      }\n      this.isInitiated = false\n      this.isStarted = false\n      this.startDelayed = false\n      this.isAdsManifestSent = false\n      this.initChrono.reset()\n      this._totalPrerollsTime = 0\n      this.requestBuilder.lastSent.breakNumber = 0\n      this.requestBuilder.lastSent.adNumber = 0\n      this._savedAdManifest = null\n      this._savedAdError = null\n      this.playedPostrolls = 0\n      this.isBreakStarted = false\n    },\n\n    /**\n    * Creates and enqueues related request using {@link Communication#sendRequest}.\n    * It will fire will-send-events.\n    *\n    * @param {string} willSendEvent Name of the will-send event. Use {@link Plugin.Event} enum.\n    * @param {string} service Name of the service. Use {@link Constants.Service} enum.\n    * @param {Object} params Params of the request\n    * @param {Object} body Body of the request, if it is a POST request\n    * @param {string} method Request method. GET by default\n    * @param {function} callback Callback method for successful request\n    * @param {Object} callbackParams Json with params for callback call\n    * @private\n    */\n    _send: function (willSendEvent, service, params, body, method, callback, callbackParams) {\n      var now = new Date().getTime()\n      if (this.options.preventZombieViews && this.lastEventTime && (now > (this.lastEventTime + (600 * 1000)))) { // 600 * 1000ms = 10 minutes\n        // if last event was sent more than 10 minutes ago, it will use new view code\n        this.viewTransform.nextView()\n      }\n      this.lastEventTime = (service === Constants.Service.STOP) ? null : now\n      params = this.requestBuilder.buildParams(params, service)\n\n      if (this.getIsLive()) {\n        params.mediaDuration = this.options['content.duration']\n        params.playhead = undefined\n      }\n\n      var data = {\n        params: params,\n        plugin: this,\n        adapter: this.getAdapter(),\n        adsAdapter: this.getAdsAdapter()\n      }\n\n      this.emit(willSendEvent, data)\n\n      if (this._comm && (params !== null || typeof method !== 'undefined') && this.options.enabled) {\n        this.lastServeiceSent = service\n        var options = {}\n        if (typeof method !== 'undefined' && method !== 'GET') {\n          options.method = method\n        }\n        var request = new YBRequest(null, service, params, options)\n        if (body) request.setBody(body)\n        if (this.isMethodPostEnabled()) {\n          request.setPostRequest(true)\n        }\n        this._comm.sendRequest(request, callback, callbackParams)\n      }\n    },\n\n    /**\n    * Initializes comm and its transforms.\n    * @private\n    */\n    _initComm: function () {\n      var resource = this._getResourceForTransform()\n      this.resourceTransform.init(resource)\n\n      this._comm = new Communication()\n      this._comm.addTransform(new FlowTransform())\n      this._comm.addTransform(this.viewTransform)\n      if (this.options && this.options.offline) {\n        this._comm.addTransform(new OfflineTransform(this))\n      } else {\n        this._comm.addTransform(this.resourceTransform)\n      }\n    },\n\n    _getResourceForTransform: function () {\n      var resource = this.getResource()\n      if (this._adapter && this._adapter.getURLToParse()) {\n        resource = this._adapter.getURLToParse()\n      }\n      return resource\n    },\n\n    /**\n    * Returns the current {@link youbora.Communication} instance.\n    *\n    * @returns {youbora.Communication} communication instance\n    */\n    getComm: function () {\n      return this._comm\n    },\n\n    /**\n    * Modifies current options. See {@link Options.setOptions}.\n    *\n    * @param {any} options\n    */\n    setOptions: function (options) {\n      if (options) {\n        this.options.setOptions(options)\n        if (typeof options['background.enabled'] === 'boolean') {\n          if (options['background.enabled']) {\n            this.backgroundDetector.startDetection()\n          } else {\n            this.backgroundDetector.stopDetection()\n          }\n        }\n      }\n    },\n\n    /**\n    * Get fastdata response to set it in another plugin instance\n    */\n    getFastDataConfig: function () {\n      return this.viewTransform.response.msg\n    },\n\n    /**\n    * Disable request sending.\n    */\n    disable: function () {\n      this.setOptions({ enabled: false })\n    },\n\n    /**\n    * Re-enable request sending.\n    */\n    enable: function () {\n      this.setOptions({ enabled: true })\n    }\n  },\n\n  /** @lends youbora.Plugin */\n  {\n    // Static Memebers //\n    /**\n    * List of events that could be fired\n    * @enum\n    * @event\n    */\n    Event: Constants.WillSendEvent\n  }\n)\n\n// Apply Mixins\n// Plugin is actually a big class, I decided to separate the logic into\n// different mixin files to ease the maintainability of each file.\n// Filename convention will be plugin+xxxxx.js where xxxxx is the added functionality.\nUtil.assign(Plugin.prototype, require('./plugin+content'))\nUtil.assign(Plugin.prototype, require('./plugin+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+content+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+ads'))\nUtil.assign(Plugin.prototype, require('./plugin+ads+getters'))\nUtil.assign(Plugin.prototype, require('./plugin+pings'))\nUtil.assign(Plugin.prototype, require('./plugin+fire'))\nUtil.assign(Plugin.prototype, require('./plugin+infinity'))\nUtil.assign(Plugin.prototype, require('./plugin+infinity+getters'))\n\nmodule.exports = Plugin\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar startParams = [\n  'accountCode',\n  'username',\n  'anonymousUser',\n  'rendition',\n  'deviceInfo',\n  'player',\n  'title',\n  'title2',\n  'live',\n  'segmentDuration',\n  'mediaDuration',\n  'mediaResource',\n  'parsedResource',\n  'transactionCode',\n  'properties',\n  'cdn',\n  'playerVersion',\n  'param1',\n  'param2',\n  'param3',\n  'param4',\n  'param5',\n  'param6',\n  'param7',\n  'param8',\n  'param9',\n  'param10',\n  'param11',\n  'param12',\n  'param13',\n  'param14',\n  'param15',\n  'param16',\n  'param17',\n  'param18',\n  'param19',\n  'param20',\n  'dimensions',\n  'playerStartupTime',\n  'obfuscateIp',\n  'privacyProtocol',\n  'p2pEnabled',\n  'pluginVersion',\n  'pluginInfo',\n  'isp',\n  'connectionType',\n  'ip',\n  'referer',\n  'userType',\n  'streamingProtocol',\n  'transportFormat',\n  'householdId',\n  'adsBlocked',\n  'adsExpected',\n  'deviceUUID',\n  'libVersion',\n  'nodeHost',\n  'nodeType',\n  'appName',\n  'appReleaseVersion',\n  'package',\n  'saga',\n  'tvshow',\n  'season',\n  'titleEpisode',\n  'channel',\n  'imdbID',\n  'gracenoteID',\n  'contentType',\n  'genre',\n  'contentLanguage',\n  'subtitles',\n  'cost',\n  'price',\n  'playbackType',\n  'email',\n  'drm',\n  'videoCodec',\n  'audioCodec',\n  'codecSettings',\n  'codecProfile',\n  'containerFormat',\n  'contentId',\n  'contractedResolution',\n  'linkedViewId',\n  'edid',\n  'cdnBalancerResponseUUID',\n  'triggeredEvents'\n]\n\nvar adStartParams = [\n  'player',\n  'playhead',\n  'adTitle',\n  'position',\n  'adDuration',\n  'adCampaign',\n  'adCreativeId',\n  'adProvider',\n  'adResource',\n  'adPlayerVersion',\n  'adProperties',\n  'adAdapterVersion',\n  'adInsertionType',\n  'extraparam1',\n  'extraparam2',\n  'extraparam3',\n  'extraparam4',\n  'extraparam5',\n  'extraparam6',\n  'extraparam7',\n  'extraparam8',\n  'extraparam9',\n  'extraparam10',\n  'fullscreen',\n  'audio',\n  'skippable',\n  'adNumber',\n  'adNumberInBreak',\n  'breakNumber'\n]\n\nvar RequestBuilder = YouboraObject.extend(\n  /** @lends youbora.RequestBuilder.prototype */\n  {\n    /**\n     * This class helps building params associated with each event: /start, /joinTime...\n     *\n     * @constructs RequestBuilder\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     *\n     * @param {Plugin} plugin A Plugin instance\n     */\n    constructor: function (plugin) {\n      this._plugin = plugin\n      this._adNumber = 0\n      this._adNumberInBreak = 0\n\n      /** Stores a list of the last params fetched */\n      this.lastSent = {}\n    },\n\n    /**\n     * Adds to params all the entities specified in paramList, unless they are already set.\n     *\n     * @param {Object} params Object of params key:value.\n     * @param {Array.string} paramList A list of params to fetch.\n     * @param {bool} onlyDifferent If true, only fetches params that have changed\n     */\n    fetchParams: function (params, paramList, onlyDifferent) {\n      params = params || {}\n      paramList = paramList || []\n      for (var i = 0; i < paramList.length; i++) {\n        var param = paramList[i]\n\n        if (params[param]) { continue }\n        var getterName = RequestBuilder.getters[param]\n\n        if (this._plugin[getterName]) {\n          var value = this._plugin[getterName]()\n          if (value !== null && (!onlyDifferent || this.lastSent[param] !== value)) {\n            params[param] = value\n            this.lastSent[param] = value\n          }\n        } else {\n          Log.warn('Trying to call undefined getter ' + param + ':' + getterName)\n        }\n      }\n      return params\n    },\n\n    getGetters: function () {\n      return RequestBuilder.getters\n    },\n\n    buildBody: function (service) {\n      var body = null\n      return this.fetchParams(body, RequestBuilder.bodyParams[service], false)\n    },\n\n    /**\n     * Adds to params object all the entities specified in paramList, unless they are already set.\n     *\n     * @param {Object} params Object of params key:value.\n     * @param {string} service The name of the service. Use {@link Plugin.Service} enum.\n     */\n    buildParams: function (params, service) {\n      params = params || {}\n      this.fetchParams(params, RequestBuilder.params[service], false)\n      this.fetchParams(params, RequestBuilder.differentParams[service], true)\n      return params\n    },\n\n    /**\n     * Creates an adnumber if it does not exist and stores it in lastSent. If it already exists,\n     * it is incremented by 1.\n     *\n     * @returns {number} adNumber\n     */\n    getNewAdNumber: function () {\n      var adNumber = this.lastSent.adNumber\n      if (adNumber && this.lastSent.position === this._plugin.getAdPosition()) {\n        adNumber += 1\n      } else {\n        adNumber = 1\n      }\n      this.lastSent.adNumber = adNumber\n      return adNumber\n    },\n\n    /**\n     * Creates an adnumberinbreak incrementing by 1.\n     *\n     * @returns {number} adNumber\n     */\n    getNewAdNumberInBreak: function () {\n      this._adNumberInBreak++\n      this.lastSent.adNumberInBreak = this._adNumberInBreak\n      return this._adNumberInBreak\n    },\n\n    /**\n     * Creates an breaknumber if it does not exist and stores it in lastSent. If it already exists,\n     * it is incremented by 1.\n     * Also resets adnumberinbreak\n     * @returns {number} breakNumber\n     */\n    getNewBreakNumber: function () {\n      var breakNumber = 1\n      this._adNumberInBreak = 0\n      if (this.lastSent.breakNumber) {\n        breakNumber = this.lastSent.breakNumber + 1\n      }\n      this.lastSent.breakNumber = breakNumber\n      return breakNumber\n    },\n\n    /**\n     * Return changed entities since last check\n     *\n     * @returns {Object} params\n     */\n    getChangedEntities: function () {\n      return this.fetchParams({}, RequestBuilder.differentParams.entities, true)\n    }\n  },\n  /** @lends youbora.RequestBuilder */\n  {\n    // Static Members\n\n    /** List of params used by each service */\n    params: {\n      '/data': ['system', 'pluginVersion', 'requestNumber', 'username'],\n\n      '/init': startParams,\n      '/start': startParams,\n      '/joinTime': ['joinDuration', 'playhead', 'bitrate', 'triggeredEvents'],\n      '/pause': ['playhead', 'triggeredEvents'],\n      '/resume': ['pauseDuration', 'playhead', 'triggeredEvents'],\n      '/seek': ['seekDuration', 'playhead', 'triggeredEvents'],\n      '/bufferUnderrun': ['bufferDuration', 'playhead', 'triggeredEvents'],\n      '/error': ['player', 'playhead', 'triggeredEvents'].concat(startParams),\n      '/stop': ['bitrate', 'totalBytes', 'playhead', 'pauseDuration', 'metrics', 'cdnDownloadedTraffic', 'multiCdnInfo', 'p2pDownloadedTraffic', 'uploadTraffic', 'triggeredEvents'],\n\n      '/infinity/video/event': [],\n\n      '/adInit': adStartParams,\n      '/adStart': adStartParams,\n      '/adJoin': ['playhead', 'position', 'adJoinDuration', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adPause': ['playhead', 'position', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adResume': ['playhead', 'position', 'adPlayhead', 'adPauseDuration', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adBufferUnderrun': ['playhead', 'position', 'adPlayhead', 'adBufferDuration', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adStop': ['playhead', 'position', 'adPlayhead', 'adBitrate', 'adTotalDuration', 'pauseDuration', 'adViewedDuration', 'adViewability', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adClick': ['playhead', 'position', 'adPlayhead', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n      '/adError': ['playhead'].concat(adStartParams),\n      '/adManifest': ['givenBreaks', 'expectedBreaks', 'expectedPattern', 'breaksTime'],\n      '/adBreakStart': ['position', 'givenAds', 'expectedAds', 'breakNumber', 'adInsertionType'],\n      '/adBreakStop': ['position', 'breakNumber'],\n      '/adQuartile': ['position', 'adViewedDuration', 'adViewability', 'adNumber', 'adNumberInBreak', 'breakNumber'],\n\n      '/ping': ['droppedFrames', 'playrate', 'cdnDownloadedTraffic', 'multiCdnInfo', 'p2pDownloadedTraffic', 'uploadTraffic', 'latency', 'packetLoss', 'packetSent', 'metrics', 'totalBytes', 'segmentDuration'],\n\n      '/infinity/session/start': [\n        'accountCode',\n        'username',\n        'userType',\n        'anonymousUser',\n        'route',\n        'page',\n        'referer',\n        'referral',\n        'screenResolution',\n        'language',\n        'deviceInfo',\n        'adsBlocked',\n        'deviceUUID',\n        'libVersion',\n        'appName',\n        'appReleaseVersion',\n        'isp',\n        'connectionType',\n        'ip',\n        'obfuscateIp',\n        'privacyProtocol',\n        'dimensions',\n        'param1',\n        'param2',\n        'param3',\n        'param4',\n        'param5',\n        'param6',\n        'param7',\n        'param8',\n        'param9',\n        'param10',\n        'param11',\n        'param12',\n        'param13',\n        'param14',\n        'param15',\n        'param16',\n        'param17',\n        'param18',\n        'param19',\n        'param20',\n        'edid'\n      ],\n      '/infinity/session/stop': ['sessionMetrics'],\n      '/infinity/session/nav': ['route', 'page', 'scrollDepth'],\n      '/infinity/session/beat': ['sessionMetrics'],\n      '/infinity/session/event': ['accountCode'],\n\n      '/offlineEvents': {}\n    },\n\n    /** Values for request body */\n    bodyParams: {\n      '/offlineEvents': ['viewJson']\n    },\n\n    /** List of params used by each service (only if they are different) */\n    differentParams: {\n      entities: [\n        'rendition',\n        'title',\n        'title2',\n        'param1',\n        'param2',\n        'param3',\n        'param4',\n        'param5',\n        'param6',\n        'param7',\n        'param8',\n        'param9',\n        'param10',\n        'param11',\n        'param12',\n        'param13',\n        'param14',\n        'param15',\n        'param16',\n        'param17',\n        'param18',\n        'param19',\n        'param20',\n        'cdn',\n        'nodeHost',\n        'nodeType',\n        'nodeTypeString',\n        'subtitles',\n        'contentLanguage',\n        'contentId'\n      ]\n    },\n\n    /** List of params and its related getter */\n    getters: {\n      requestNumber: 'getRequestNumber',\n      playhead: 'getPlayhead',\n      playrate: 'getPlayrate',\n      fps: 'getFramesPerSecond',\n      segmentDuration: 'getSegmentDuration',\n      droppedFrames: 'getDroppedFrames',\n      mediaDuration: 'getDuration',\n      bitrate: 'getBitrate',\n      totalBytes: 'getTotalBytes',\n      throughput: 'getThroughput',\n      rendition: 'getRendition',\n      title: 'getTitle',\n      title2: 'getTitle2',\n      live: 'getIsLive',\n      mediaResource: 'getResource',\n      parsedResource: 'getParsedResource',\n      transactionCode: 'getTransactionCode',\n      properties: 'getMetadata',\n      playerVersion: 'getPlayerVersion',\n      player: 'getPlayerName',\n      cdn: 'getCdn',\n      pluginVersion: 'getPluginVersion',\n      libVersion: 'getLibVersion',\n      userType: 'getUserType',\n      streamingProtocol: 'getStreamingProtocol',\n      transportFormat: 'getTransportFormat',\n      obfuscateIp: 'getObfuscateIp',\n      privacyProtocol: 'getPrivacyProtocol',\n      householdId: 'getHouseholdId',\n      latency: 'getLatency',\n      packetLoss: 'getPacketLoss',\n      packetSent: 'getPacketSent',\n      metrics: 'getVideoMetrics',\n      dimensions: 'getCustomDimensions',\n\n      param1: 'getExtraparam1',\n      param2: 'getExtraparam2',\n      param3: 'getExtraparam3',\n      param4: 'getExtraparam4',\n      param5: 'getExtraparam5',\n      param6: 'getExtraparam6',\n      param7: 'getExtraparam7',\n      param8: 'getExtraparam8',\n      param9: 'getExtraparam9',\n      param10: 'getExtraparam10',\n      param11: 'getExtraparam11',\n      param12: 'getExtraparam12',\n      param13: 'getExtraparam13',\n      param14: 'getExtraparam14',\n      param15: 'getExtraparam15',\n      param16: 'getExtraparam16',\n      param17: 'getExtraparam17',\n      param18: 'getExtraparam18',\n      param19: 'getExtraparam19',\n      param20: 'getExtraparam20',\n\n      extraparam1: 'getAdExtraparam1',\n      extraparam2: 'getAdExtraparam2',\n      extraparam3: 'getAdExtraparam3',\n      extraparam4: 'getAdExtraparam4',\n      extraparam5: 'getAdExtraparam5',\n      extraparam6: 'getAdExtraparam6',\n      extraparam7: 'getAdExtraparam7',\n      extraparam8: 'getAdExtraparam8',\n      extraparam9: 'getAdExtraparam9',\n      extraparam10: 'getAdExtraparam10',\n\n      position: 'getAdPosition',\n      adNumber: 'getAdNumber',\n      adNumberInBreak: 'getAdNumberInBreak',\n      breakNumber: 'getBreakNumber',\n      adPlayhead: 'getAdPlayhead',\n      adDuration: 'getAdDuration',\n      adCampaign: 'getAdCampaign',\n      adCreativeId: 'getAdCreativeId',\n      adBitrate: 'getAdBitrate',\n      adTitle: 'getAdTitle',\n      adResource: 'getAdResource',\n      adPlayerVersion: 'getAdPlayerVersion',\n      adProperties: 'getAdMetadata',\n      adAdapterVersion: 'getAdAdapterVersion',\n      givenBreaks: 'getGivenBreaks',\n      expectedBreaks: 'getExpectedBreaks',\n      expectedPattern: 'getExpectedPattern',\n      breaksTime: 'getBreaksTime',\n      givenAds: 'getGivenAds',\n      expectedAds: 'getExpectedAds',\n      adsExpected: 'getAdsExpected',\n      adViewedDuration: 'getAdViewedDuration',\n      adViewability: 'getAdViewability',\n      fullscreen: 'getIsFullscreen',\n      audio: 'getAudioEnabled',\n      skippable: 'getIsSkippable',\n      adProvider: 'getAdProvider',\n      adInsertionType: 'getAdInsertionType',\n\n      pluginInfo: 'getPluginInfo',\n\n      isp: 'getIsp',\n      connectionType: 'getConnectionType',\n      ip: 'getIp',\n\n      deviceInfo: 'getDeviceInfo',\n      edid: 'getEDID',\n\n      system: 'getAccountCode',\n      accountCode: 'getAccountCode',\n      username: 'getUsername',\n      anonymousUser: 'getAnonymousUser',\n\n      joinDuration: 'getJoinDuration',\n      bufferDuration: 'getBufferDuration',\n      seekDuration: 'getSeekDuration',\n      pauseDuration: 'getPauseDuration',\n\n      adJoinDuration: 'getAdJoinDuration',\n      adBufferDuration: 'getAdBufferDuration',\n      adPauseDuration: 'getAdPauseDuration',\n      adTotalDuration: 'getAdTotalDuration',\n\n      referer: 'getReferer',\n      referral: 'getReferral',\n      language: 'getLanguage',\n      screenResolution: 'getScreenResolution',\n\n      nodeHost: 'getNodeHost',\n      nodeType: 'getNodeType',\n      nodeTypeString: 'getNodeTypeString',\n\n      route: 'getReferer',\n      page: 'getPageName',\n\n      playerStartupTime: 'getPlayerStartupTime',\n      pageLoadTime: 'getPageLoadTime',\n\n      cdnDownloadedTraffic: 'getCdnTraffic',\n      multiCdnInfo: 'getMultiCdnInfo',\n      p2pDownloadedTraffic: 'getP2PTraffic',\n      p2pEnabled: 'getIsP2PEnabled',\n      uploadTraffic: 'getUploadTraffic',\n      cdnBalancerResponseUUID: 'getBalancerResponseId',\n\n      viewJson: 'getOfflineView',\n      deviceUUID: 'getDeviceUUID',\n      sessionMetrics: 'getSessionMetrics',\n      scrollDepth: 'getScrollDepth',\n\n      adsBlocked: 'getIsBlocked',\n      linkedViewId: 'getLinkedViewId',\n\n      appName: 'getAppName',\n      appReleaseVersion: 'getAppReleaseVersion',\n      package: 'getPackage',\n      saga: 'getSaga',\n      tvshow: 'getTvShow',\n      season: 'getSeason',\n      titleEpisode: 'getEpisodeTitle',\n      channel: 'getChannel',\n      drm: 'getDRM',\n      videoCodec: 'getVideoCodec',\n      audioCodec: 'getAudioCodec',\n      codecSettings: 'getCodecSettings',\n      codecProfile: 'getCodecProfile',\n      containerFormat: 'getContainerFormat',\n      contentId: 'getID',\n      imdbID: 'getImdbId',\n      gracenoteID: 'getGracenoteID',\n      contentType: 'getType',\n      genre: 'getGenre',\n      contentLanguage: 'getVideoLanguage',\n      subtitles: 'getSubtitles',\n      contractedResolution: 'getContractedResolution',\n      cost: 'getCost',\n      price: 'getPrice',\n      playbackType: 'getPlaybackType',\n      email: 'getEmail'\n    }\n\n  }\n)\n\nmodule.exports = RequestBuilder\n","/* global localStorage, sessionStorage, location */\nvar YouboraObject = require('../object')\nvar Log = require('../log')\n\n/**\n * This class manages data sotrage in the browser memory.\n *\n * @extends youbora.Emitter\n * @memberof youbora\n */\nvar YouboraStorage = YouboraObject.extend(\n  /** @lends youbora.YouboraStorage.prototype */\n  {\n    /**\n     *\n     * @constructs YouboraStorage\n     * @extends YouboraObject\n     * @memberof youbora\n     *\n     * @param {String} [prefix] Optional. Sets the prefix for saved objects in storages or cookies. 'youbora' by default.\n     * @param {Boolean} [disableCookies] Optional. Set to true to disable cookies fallback. True by default.\n     */\n    constructor: function (prefix, disableCookies, forceCookies, disable) {\n      this.prefix = prefix || 'youbora'\n      this.disableCookies = disableCookies\n      this.forceCookies = forceCookies\n      this.disabled = disable\n    },\n\n    /**\n     * Returns if storages are available or not\n     *\n     */\n    isEnabled: function () {\n      if (this.disabled) return false\n      var ret = true\n      if (!this.forceCookies) {\n        try {\n          localStorage.setItem(this.prefix + '.' + 'test', 'true')\n          localStorage.removeItem(this.prefix + '.' + 'test')\n        } catch (err) {\n          ret = false\n        }\n      }\n      return ret\n    },\n\n    /**\n     * Saves in localStorage or equivalent\n     *\n     * @param {string} key Key of the value. Prefix will be appended.\n     * @param {string} value Value.\n     */\n    setLocal: function (key, value) {\n      if (this.disabled) return null\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof localStorage === 'undefined' || !localStorage) && !this.disableCookies)) {\n          ret = this._setCookie(this.prefix + '.local.' + key, value)\n        } else {\n          ret = localStorage.setItem(this.prefix + '.' + key, value)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs localStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Reads from localStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getLocal: function (key) {\n      if (this.disabled) return null\n      return this._localGetRemove('getItem', '_getCookie', key)\n    },\n\n    /**\n     * Removes from localStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    removeLocal: function (key) {\n      if (this.disabled) return null\n      return this._localGetRemove('removeItem', '_removeCookie', key)\n    },\n\n    _localGetRemove: function (storageMethod, cookieMethod, key) {\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof localStorage === 'undefined' || !localStorage) && !this.disableCookies)) {\n          ret = this[cookieMethod](this.prefix + '.local.' + key)\n        } else {\n          ret = localStorage[storageMethod](this.prefix + '.' + key)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs localStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Saves in sessionStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     * @param {string} value Value.\n     */\n    setSession: function (key, value) {\n      if (this.disabled) return null\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof sessionStorage === 'undefined' || !sessionStorage) && !this.disableCookies)) {\n          ret = this._setCookie(this.prefix + '.session.' + key, value)\n        } else {\n          ret = sessionStorage.setItem(this.prefix + '.' + key, value)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs sessionStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Reads from sessionStorage or equivalent\n     *\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getSession: function (key) {\n      if (this.disabled) return null\n      return this._sessionGetRemove('getItem', '_getCookie', key)\n    },\n\n    /**\n   * Removes from sessionStorage or equivalent\n   *\n   * @param {string} key Key of the value. prefix will be appended.\n   */\n    removeSession: function (key) {\n      if (this.disabled) return null\n      return this._sessionGetRemove('removeItem', '_removeCookie', key)\n    },\n\n    _sessionGetRemove: function (storageMethod, cookieMethod, key) {\n      var ret = null\n      try {\n        if (this.forceCookies || ((typeof sessionStorage === 'undefined' || !sessionStorage) && !this.disableCookies)) {\n          ret = this[cookieMethod](this.prefix + '.session.' + key)\n        } else {\n          ret = sessionStorage[storageMethod](this.prefix + '.' + key)\n        }\n      } catch (err) {\n        Log.error('Youbora Infinity needs sessionStorage or cookies, not supported by your browser.')\n      }\n      return ret\n    },\n\n    /**\n     * Calls getSession and getLocal for the same key\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    getStorages: function (key) {\n      return this.getSession(key) || this.getLocal(key)\n    },\n\n    /**\n     * Calls getSession and getLocal with the same key and value\n     * @param {string} key Key of the value. prefix will be appended.\n     * @param {string} value Value.\n     */\n    setStorages: function (key, value) {\n      this.setSession(key, value)\n      this.setLocal(key, value)\n    },\n\n    /**\n     * Calls getSession and getLocal for the same key\n     * @param {string} key Key of the value. prefix will be appended.\n     */\n    removeStorages: function (key) {\n      this.removeSession(key)\n      this.removeLocal(key)\n    },\n\n    // Private cookies methods\n\n    /**\n   * Sets a cookie value\n   *\n   * @param {string} cname Key of the value.\n   * @param {Object} cvalue Value.\n   */\n    _setCookie: function (cname, cvalue) {\n      if (typeof document !== 'undefined') {\n        var domain = ';'\n        if (typeof location !== 'undefined') {\n          domain += 'domain=' + location.host.split('.').reverse().splice(0, 2).reverse().join('.') + ';path=/;'\n        }\n        document.cookie = cname + '=' + cvalue + domain\n      }\n    },\n\n    /**\n   * Gets a cookie value\n   *\n   * @param {string} cname Key of the value.\n   */\n    _getCookie: function (cname) {\n      if (typeof document !== 'undefined') {\n        var name = cname + '='\n        var decodedCookie = decodeURIComponent(document.cookie)\n        var ca = decodedCookie.split(';')\n        for (var i = 0; i < ca.length; i++) {\n          var c = ca[i]\n          while (c.charAt(0) === ' ') {\n            c = c.substring(1)\n          }\n          if (c.indexOf(name) === 0) {\n            return c.substring(name.length, c.length)\n          }\n        }\n      }\n      return null\n    },\n\n    /**\n   * Removes a cookie\n   *\n   * @param {string} cname Key of the value.\n   */\n    _removeCookie: function (cname) {\n      this._setCookie(cname, '')\n    }\n  }\n)\n\nmodule.exports = YouboraStorage\n","/* eslint no-extend-native: \"off\" */\n\n/**\n * When executed, this function applies polyfills to the following functionalities:\n * Function.prototype.bind and\n * Array.prototype.forEach.\n *\n * @memberof youbora\n */\nvar applyPolyfills = function () {\n  // Bind, changed for compatibility\n  Function.prototype.bind = Function.prototype.bind || function (context) {\n    var slice = Array.prototype.slice\n    var func = this\n    var args = slice.call(arguments, 1)\n    function bound () {\n      var invokedAsConstructor = func.prototype && (this instanceof func)\n      return func.apply(\n        !invokedAsConstructor && context || this, args.concat(slice.call(arguments)) // eslint-disable-line no-mixed-operators\n      )\n    }\n    bound.prototype = func.prototype\n    return bound\n  }\n\n  // Foreach\n  Array.prototype.forEach = Array.prototype.forEach || function (callback, thisArg) {\n    if (typeof (callback) !== 'function') {\n      throw new TypeError(callback + ' is not a function!')\n    }\n    var len = this.length\n    for (var i = 0; i < len; i++) {\n      callback.call(thisArg, this[i], i, this)\n    }\n  }\n\n  // Trunc\n  Math.trunc = Math.trunc || function (x) {\n    if (isNaN(x)) {\n      return NaN\n    }\n    if (x > 0) {\n      return Math.floor(x)\n    }\n    return Math.ceil(x)\n  }\n}\n\nmodule.exports = applyPolyfills\n","var YouboraObject = require('../object')\nvar Log = require('../log')\n\nvar ProductAnalyticsConfig = require('./productanalytics_config')\nvar ProductAnalyticsUserState = require('./productanalytics_userstate')\n\nvar YouboraProductAnalytics = YouboraObject.extend(\n  /** @lends youbora.ProductAnalytics.prototype */\n  {\n    /**\n     * This class is the base of productanalytics. Every plugin will have an instance.\n     *\n     * @param {youbora.Plugin} plugin Parent plugin.\n     *\n     * @constructs youbora.ProductAnalytics\n     * @extends youbora.Emitter\n     * @memberof youbora\n     */\n    constructor: function (plugin) {\n      /** Parent {@link youbora.Plugin} reference. */\n      this._plugin = (typeof (plugin) === 'undefined' ? null : plugin)\n      this._infinity = (this._plugin && this._plugin.infinity ? this._plugin.infinity : null)\n\n      // Product analytics attributes\n      this._productAnalyticsSettingsDefault =\n      {\n        autoTrackNavigation: true,\n        autoTrackAttribution: true,\n        highlightContentAfter: 1000,\n        enableStateTracking: false,\n        activeStateTimeout: 30000,\n        activeStateDimension: 9,\n        pageRules: []\n      }\n\n      this._productAnalyticsSettings = Object.assign({}, this._productAnalyticsSettingsDefault)\n      this._page = null\n\n      this._userState = null\n      this._config = null\n      this._searchQuery = null\n      this._location = (typeof (window) === 'undefined' || typeof (window.location) === 'undefined' ? null : window.location)\n\n      this._contentHighlighted = null\n      this._contentHighlightTimeout = null\n\n      if (!this._plugin) {\n        Log.warn('Plugin reference unset.')\n      }\n\n      if (!this._infinity) {\n        Log.warn('Infinity reference unset.')\n      }\n\n      if (!this._location) {\n        Log.warn('Location reference unset.')\n      }\n    },\n\n    /**\n      * Initializes product analytics\n      * @param {Object} productAnalyticsSettings product analytics settings\n      * @param {Object} [npawtmConfigValue] configuration settings\n      */\n    initialize: function (productAnalyticsSettings) {\n      var query\n\n      // Load settings\n\n      this._productAnalyticsSettings = Object.assign({}, this._productAnalyticsSettingsDefault)\n\n      if (typeof (productAnalyticsSettings) === 'object') {\n        Object.assign(this._productAnalyticsSettings, productAnalyticsSettings)\n      }\n\n      // Validate settings\n\n      if (typeof (this._productAnalyticsSettings.autoTrackNavigation) !== 'boolean') {\n        this._productAnalyticsSettings.autoTrackNavigation = this._productAnalyticsSettingsDefault.autoTrackNavigation\n      }\n\n      if (typeof (this._productAnalyticsSettings.autoTrackAttribution) !== 'boolean') {\n        this._productAnalyticsSettings.autoTrackAttribution = this._productAnalyticsSettingsDefault.autoTrackAttribution\n      }\n\n      if (typeof (this._productAnalyticsSettings.highlightContentAfter) !== 'number') {\n        this._productAnalyticsSettings.highlightContentAfter = this._productAnalyticsSettingsDefault.highlightContentAfter\n      } else if (this._productAnalyticsSettings.highlightContentAfter < 1000) {\n        Log.warn('Invalid higlightContentAfter value. Using default value instead.')\n        this._productAnalyticsSettings.highlightContentAfter = this._productAnalyticsSettingsDefault.highlightContentAfter\n      }\n\n      if (typeof (this._productAnalyticsSettings.enableStateTracking) !== 'boolean') {\n        this._productAnalyticsSettings.enableStateTracking = this._productAnalyticsSettingsDefault.enableStateTracking\n      }\n\n      if (typeof (this._productAnalyticsSettings.activeStateTimeout) !== 'number') {\n        this._productAnalyticsSettings.activeStateTimeout = this._productAnalyticsSettingsDefault.activeStateTimeout\n      }\n\n      if (typeof (this._productAnalyticsSettings.activeStateDimension) !== 'number' || this._productAnalyticsSettings.activeStateDimension < 1 || this._productAnalyticsSettings.activeStateDimension > 9) {\n        this._productAnalyticsSettings.activeStateDimension = this._productAnalyticsSettingsDefault.activeStateDimension\n      }\n\n      if (typeof (this._productAnalyticsSettings.pageRules) === 'undefined' || !Array.isArray(this._productAnalyticsSettings.pageRules)) {\n        this._productAnalyticsSettings.pageRules = this._productAnalyticsSettingsDefault.pageRules\n      }\n\n      // Identify current page\n\n      this._config = new ProductAnalyticsConfig(this._fireEvent.bind(this))\n      this._identify()\n\n      // Track navigation\n\n      if (this._productAnalyticsSettings.autoTrackNavigation) {\n        this._trackNavigation()\n      }\n\n      // Track attribution\n\n      if (this._productAnalyticsSettings.autoTrackAttribution) {\n        query = (this._location === null ? '' : this._location.search)\n        this._trackAttribution(new URLSearchParams(query))\n      }\n    },\n\n    /**\n     * Identify current page\n     * @private\n     */\n\n    _identify: function () {\n      var regex\n      var r\n      var i\n\n      // Try to identify using config approach\n\n      if (this._config === null) {\n        this._page = null\n      } else {\n        this._page = this._config.identify(this._location)\n      }\n\n      // Try to identify using pageRules setting\n\n      for (i = 0; i < this._productAnalyticsSettings.pageRules.length && this._page === null && this._location !== null; i++) {\n        r = this._productAnalyticsSettings.pageRules[i]\n\n        if (typeof (r.rule) !== 'undefined' && typeof (r.page) !== 'undefined') {\n          try {\n            regex = new RegExp(r.rule)\n          } catch (ex) {\n            regex = null\n            Log.warn('Error processing rule', r.rule, r.page)\n          }\n\n          if (regex !== null && this._location.pathname.match(regex) !== null) {\n            this._page = this._location.pathname.replace(regex, r.page)\n          }\n        }\n      }\n\n      // If identication has failed, set pathname as page name\n\n      if (this._page === null && this._location !== null) {\n        this._page = this._location.pathname\n      }\n    },\n\n    // -------------------------------------------------------------------------------------------\n    // ADAPTER\n    // -------------------------------------------------------------------------------------------\n\n    /**\n      * Track adapter start\n      * @private\n      */\n\n    _adapterTrackStart: function () {\n      this.trackPlayerInteraction('start', {}, {}, true)\n    },\n\n    /**\n      * Execute after adapter is set to plugin\n      */\n\n    adapterAfterSet: function () {\n      var adapter\n\n      // Set active state\n\n      if (this._productAnalyticsSettings.enableStateTracking) {\n        if (this._userState !== null) {\n          Log.warn('userState is already initialized')\n        }\n\n        if (!this._plugin) {\n          Log.warn('Cannot track user state since plugin is unavailable')\n        } else if (!this._plugin.setOptions) {\n          Log.warn('Cannot track user state since plugin options are unavailable')\n        } else {\n          this._userState = new ProductAnalyticsUserState(this._productAnalyticsSettings.activeStateDimension, this._productAnalyticsSettings.activeStateTimeout, this._fireAdapterEvent.bind(this), this._plugin.setOptions.bind(this._plugin))\n        }\n      } else {\n        this._userState = null\n      }\n\n      // Track player interaction\n\n      adapter = this._adapterGet()\n\n      if (adapter) {\n        adapter.on('start', this._adapterTrackStart.bind(this))\n      } else {\n        Log.warn('Cannot bind adapter start since it is unavailable')\n      }\n    },\n\n    /**\n      * Execute before removing adapter from plugin\n      */\n\n    adapterBeforeRemove: function () {\n      var adapter\n\n      adapter = this._adapterGet()\n\n      if (adapter) {\n        adapter.off('start', this._adapterTrackStart)\n      } else {\n        Log.warn('Cannot unbind adapter start since it is unavailable')\n      }\n\n      this._userState = null\n    },\n\n    /**\n      * Get adapter\n      * @private\n      */\n\n    _adapterGet: function () {\n      var adapter\n\n      if (!this._plugin) {\n        adapter = null\n      } else if (typeof (this._plugin.getAdapter) !== 'function') {\n        adapter = null\n      } else {\n        adapter = this._plugin.getAdapter()\n      }\n\n      return (typeof (adapter) === 'undefined' ? null : adapter)\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // SESSION\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * New user session\n      */\n\n    newSession: function () {\n      var executed = false\n\n      if (this._infinity) {\n        this._infinity.newSession()\n        executed = true\n      } else {\n        Log.warn('Cannot start a new session since infinity is unavailable')\n      }\n\n      return executed\n    },\n\n    /**\n      * Ends user session\n      */\n\n    endSession: function () {\n      var executed = false\n\n      if (this._infinity) {\n        this._infinity.fireSessionStop()\n        executed = true\n      } else {\n        Log.warn('Cannot end session since infinity is unavailable')\n      }\n\n      return executed\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // NAVIGATION\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks navigation\n      * @param {string} pageName The unique name to identify a page of the application.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackNavigation: function (pageName, dimensions, metrics) {\n      if (typeof pageName !== 'string' || pageName === '') {\n        Log.warn('Cannot track navigation since page has not been supplied.')\n      } else {\n        this._page = pageName\n        this._trackNavigation(dimensions, metrics)\n      }\n    },\n\n    /**\n      * Tracks navigation (either manually or automatically)\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      * @private\n      */\n    _trackNavigation: function (dimensions, metrics) {\n      var route\n      var path\n      var host\n\n      // Get UTM Options\n\n      if (this._location === null) {\n        route = ''\n        path = ''\n        host = ''\n      } else {\n        route = this._location.href\n        path = this._location.pathname\n        host = this._location.hostname\n      }\n\n      if (this._infinity) {\n        this._infinity.begin({\n          route: route,\n          page: this._page\n        })\n\n        Log.notice('[NAV]', this._page)\n        this._fireEvent('[NAV] ' + this._page, {\n          eventType: 'Navigation',\n          route: path,\n          routeDomain: host,\n          fullRoute: route\n        }, dimensions, metrics)\n      } else {\n        Log.warn('Cannot trackNavigation since infinity is unavailable')\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // ATTRIBUTION\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks attribution\n      * @param {string} utmSource The UTM Source parameter. It is commonly used to identify a search engine, newsletter, or other source (i.e., Google, Facebook, etc.).\n      * @param {string} utmMedium The UTM Medium parameter. It is commonly used to identify a medium such as email or cost-per-click (cpc).\n      * @param {string} utmCampaign The UTM Campaign parameter. It is commonly used for campaign analysis to identify a specific product promotion or strategic campaign (i.e., spring sale).\n      * @param {string} utmTerm The UTM Term parameter. It is commonly used with paid search to supply the keywords for ads (i.e., Customer, NonBuyer, etc.).\n      * @param {string} utmContent The UTM Content parameter. It is commonly used for A/B testing and content-targeted ads to differentiate ads or links that point to the same URL (i.e., Banner1, Banner2, etc.)\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackAttribution: function (utmSource, utmMedium, utmCampaign, utmTerm, utmContent, dimensions, metrics) {\n      if (this._productAnalyticsSettings.autoTrackAttribution) {\n        Log.warn('Automatic attribution tracking is enabled: this request won\\'t be processed.')\n      } else {\n        var params\n\n        params = {}\n\n        if (typeof utmSource !== 'undefined') params.utm_source = utmSource\n        if (typeof utmMedium !== 'undefined') params.utm_medium = utmMedium\n        if (typeof utmCampaign !== 'undefined') params.utm_campaign = utmCampaign\n        if (typeof utmTerm !== 'undefined') params.utm_term = utmTerm\n        if (typeof utmContent !== 'undefined') params.utm_content = utmContent\n\n        this._trackAttribution(new URLSearchParams(params), dimensions, metrics)\n      }\n    },\n\n    /**\n      * Tracks attribution (either manually or automatically)\n      * @param {URLSearchParams} params Object where to look for UTM params.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      * @private\n      */\n    _trackAttribution: function (params, dimensions, metrics) {\n      // Get UTM parameters\n\n      var utmParams = this._getUTMParams(params)\n      var url = (this._location === null ? '' : this._location.href)\n\n      // Track attribution\n\n      if (utmParams) {\n        Log.notice('ATTRIBUTION')\n        this._fireEvent('ATTRIBUTION', Object.assign({\n          eventType: 'Attribution',\n          url: url\n        }, utmParams), dimensions, metrics)\n      }\n    },\n\n    /**\n     * Retrieves UTM params from querystring (utm_source, utm_medium, utm_campaign, utm_term, utm_content) and returns an object containing them but\n     * with key formatted as specified by utmFormatDot.\n     * @param {URLSearchParams} params Object where to look for UTM params\n     * @returns {{}}\n     * @private\n     */\n    _getUTMParams: function (params) {\n      var utmParams\n      var keySplitted\n      var keyIndex\n      var keys\n      var key\n\n      keys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']\n      utmParams = {}\n\n      // Look for UTM params and add them to the newly constructed object converting key as specified by utmFormatDot\n\n      params.forEach(function (paramValue, paramKey) {\n        keyIndex = keys.indexOf(paramKey.toLowerCase())\n\n        if (keyIndex !== -1) {\n          key = keys[keyIndex]\n          keySplitted = key.split('_')\n\n          if (keySplitted.length > 1) {\n            key = keySplitted[0] + keySplitted[1].charAt(0).toUpperCase() + keySplitted[1].slice(1)\n          }\n\n          utmParams[key] = paramValue\n        }\n      })\n\n      return (Object.keys(utmParams).length > 0 ? utmParams : null)\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // SECTION\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Section goes into viewport.\n      * @param {string} section The section title. It is commonly used to indicate the section title presented over a grid layout (e.g. Recommended Movies, Continue Watching, etc).\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackSectionIn: function (section, dimensions, metrics) {\n      if (typeof section !== 'string' || section === '') {\n        Log.warn('Cannot track section-in since no section has been supplied.')\n      } else {\n        Log.notice('[SECTION] In')\n        this._fireEvent('SECTION IN', {\n          eventType: 'SectionVisibility',\n          section: section\n        }, dimensions, metrics)\n      }\n    },\n\n    /**\n      * Section goes out of viewport.\n      * @param {string} section The section title. It is commonly used to indicate the section title presented over a grid layout (e.g. Recommended Movies, Continue Watching, etc).\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackSectionOut: function (section, dimensions, metrics) {\n      if (typeof section !== 'string' || section === '') {\n        Log.warn('Cannot track section-out since no section has been supplied.')\n      } else {\n        Log.notice('[SECTION] Out')\n        this._fireEvent('SECTION OUT', {\n          eventType: 'SectionVisibility',\n          section: section\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // CONTENT\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Sends a content highlight event if content is focused during, at least, highlightContentAfter ms.\n      * @param {string} section The section title. It is commonly used to indicate the section title presented over a grid layout (e.g. Recommended Movies, Continue Watching, etc).\n      * @param {integer} column Used to indicate the column number where content is placed in a grid layout The first column is number 1.\n      * @param {integer} row Used to indicate the row number where content is placed in a grid layout. The first row is number 1. In the case of a horizontal list instead of a grid, the row parameter should be set to 1.\n      * @param {string} contentID The unique content identifier of the content linked.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    contentFocusIn: function (section, column, row, contentID, dimensions, metrics) {\n      this.contentFocusOut()\n\n      if (typeof section !== 'string' || section === '') {\n        Log.warn('Cannot track content highlight since no section has been supplied.')\n      } else if (typeof column !== 'number') {\n        Log.warn('Cannot track content highlight since no column has been supplied.')\n      } else if (typeof row !== 'number') {\n        Log.warn('Cannot track content highlight since no row has been supplied.')\n      } else if (typeof contentID !== 'string' || contentID === '') {\n        Log.warn('Cannot track content highlight since no contentID has been supplied.')\n      } else {\n        this._contentHighlighted = { section: section, column: column, row: row, contentID: contentID, dimensions: dimensions, metrics: metrics }\n        this._contentHighlightTimeout = setTimeout(this._trackContentHiglight.bind(this), this._productAnalyticsSettings.highlightContentAfter)\n      }\n    },\n\n    /**\n      * Content loses focus\n      * @private\n      */\n\n    contentFocusOut: function () {\n      if (this._contentHighlightTimeout !== null) {\n        clearTimeout(this._contentHighlightTimeout)\n      }\n\n      this._contentHighlighted = null\n      this._contentHighlightTimeout = null\n    },\n\n    /**\n      * Sends a content highlight event using selected content info\n      * @private\n      */\n\n    _trackContentHiglight: function () {\n      if (this._contentHighlighted) {\n        Log.notice('CONTENT HIGHLIGHT')\n        this._fireEvent('CONTENT HIGHLIGHT', {\n          eventType: 'ContentHighlight',\n          section: this._contentHighlighted.section,\n          column: this._contentHighlighted.column,\n          row: this._contentHighlighted.row,\n          contentId: this._contentHighlighted.contentID\n        }, this._contentHighlighted.dimensions, this._contentHighlighted.metrics)\n      } else {\n        Log.warn('Cannot highlight content since no content is selected')\n      }\n    },\n\n    /**\n      * Tracks the location of user clicks.\n      * @param {string} section The section title. It is commonly used to indicate the section title presented over a grid layout (e.g. Recommended Movies, Continue Watching, etc).\n      * @param {integer} column Used to indicate the column number where content is placed in a grid layout The first column is number 1.\n      * @param {integer} row Used to indicate the row number where content is placed in a grid layout. The first row is number 1. In the case of a horizontal list instead of a grid, the row parameter should be set to 1.\n      * @param {string} contentID The unique content identifier of the content linked.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackContentClick: function (section, column, row, contentID, dimensions, metrics) {\n      if (typeof section !== 'string' || section === '') {\n        Log.warn('Cannot track content click since no section has been supplied.')\n      } else if (typeof column !== 'number') {\n        Log.warn('Cannot track content click since no column has been supplied.')\n      } else if (typeof row !== 'number') {\n        Log.warn('Cannot track content click since no row has been supplied.')\n      } else if (typeof contentID !== 'string' || contentID === '') {\n        Log.warn('Cannot track content click since no contentID has been supplied.')\n      } else {\n        Log.notice('CONTENT CLICK')\n        this._fireEvent('CONTENT CLICK', {\n          eventType: 'ContentClick',\n          section: section,\n          column: column,\n          row: row,\n          contentId: contentID\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // CONTENT PLAYBACK\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks when a content starts playing be it automatically or through a user interaction.\n      * @param {string} contentID The unique content identifier of the content being played.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackPlay: function (contentID, dimensions, metrics) {\n      if (typeof contentID !== 'string' || contentID === '') {\n        Log.warn('Cannot track play since no contentID has been supplied.')\n      } else {\n        Log.notice('[PLAYER] Play')\n        this._fireAdapterEvent('[PLAYER] Play', {\n          eventType: 'ContentPlayback',\n          contentId: contentID\n        }, dimensions, metrics)\n\n        if (this._userState !== null) {\n          this._userState.setActive('Play')\n        }\n      }\n    },\n\n    /**\n      * Tracks content watching events.\n      * TODO: add (2nd) argument to tell whether user state must be updated or not\n      * @param {string} eventName The name of the interaction (i.e., Pause, Seek, Skip Intro, Skip Ads, Switch Language, etc.).\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      * @param {boolean} [playerStarted] Internal param informing that current interaction is responsible of first player start\n      */\n\n    trackPlayerInteraction: function (eventName, dimensions, metrics, playerStarted) {\n      if (typeof (eventName) !== 'string' || eventName === '') {\n        Log.warn('Cannot track player interaction since no interaction name has been supplied.')\n      } else {\n        Log.notice('[PLAYER]', eventName)\n        this._fireAdapterEvent('[PLAYER] ' + eventName, {\n          eventType: 'ContentPlayback'\n        }, dimensions, metrics)\n\n        if (this._userState !== null) {\n          this._userState.setActive(eventName, playerStarted)\n        }\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // CONTENT SEARCH\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks search query events.\n      * @param {string} searchQuery The search term entered by the user.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackSearchQuery: function (searchQuery, dimensions, metrics) {\n      if (typeof searchQuery !== 'string' || searchQuery === '') {\n        Log.warn('Cannot track search query since no searchQuery has been supplied.')\n      } else {\n        Log.notice('[SEARCH] Query', searchQuery)\n        this._searchQuery = searchQuery\n        this._fireEvent('[SEARCH] Query', {\n          eventType: 'ContentSearch',\n          query: this._searchQuery\n        }, dimensions, metrics)\n      }\n    },\n\n    /**\n      * Tracks search result events.\n      * @param {integer} resultCount The number of search results returned by a search query.\n      * @param {String} [searchQuery] The search term entered by the user.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n    trackSearchResult: function (resultCount, searchQuery, dimensions, metrics) {\n      if (typeof resultCount !== 'number') {\n        Log.warn('Cannot track search result since no resultCount has been supplied.')\n      } else {\n        var query = (typeof searchQuery === 'string' && searchQuery !== '' ? searchQuery : this._searchQuery)\n\n        Log.notice('[SEARCH] Results', resultCount)\n        this._fireEvent('[SEARCH] Results', {\n          eventType: 'ContentSearch',\n          query: query,\n          resultCount: resultCount\n        }, dimensions, metrics)\n      }\n    },\n\n    /**\n      * Tracks user interactions with search results.\n      * @param {integer} column The content placement column. It is commonly used to indicate the column number where content is placed in a grid layout (i.e.1, 2, etc..).\n      * @param {integer} row The content placement row. It is commonly used to indicate the row number where content is placed in a grid layout (i.e.1, 2, etc..).\n      * @param {string} contentID The content identifier. It is used for internal content unequivocally identification (i.e., AAA000111222).\n      * @param {String} [searchQuery] The search term entered by the user.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackSearchClick: function (column, row, contentID, searchQuery, dimensions, metrics) {\n      if (typeof column !== 'number') {\n        Log.warn('Cannot track search click since no column has been supplied.')\n      } else if (typeof row !== 'number') {\n        Log.warn('Cannot track search click since no row has been supplied.')\n      } else if (typeof contentID !== 'string' || contentID === '') {\n        Log.warn('Cannot track search click since no contentID has been supplied.')\n      } else {\n        var query = (typeof searchQuery === 'string' && searchQuery !== '' ? searchQuery : this._searchQuery)\n\n        Log.notice('[SEARCH] Result Click')\n        this._fireEvent('[SEARCH] Result Click', {\n          eventType: 'ContentSearch',\n          query: query,\n          column: column,\n          row: row,\n          contentId: contentID\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // EXTERNAL APPLICATIONS\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks external app start events.\n      * @param {string} appName The name of the application being used to deliver the content to the end-user (i.e., Netflix).\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackExternalAppLaunch: function (appName, dimensions, metrics) {\n      if (typeof appName !== 'string' || appName === '') {\n        Log.warn('Cannot track external application launch since no appName has been supplied.')\n      } else {\n        Log.notice('APP LAUNCH', appName)\n        this._fireEvent('APP LAUNCH', {\n          eventType: 'ExternalApplications',\n          appName: appName\n        }, dimensions, metrics)\n      }\n    },\n\n    /**\n      * Tracks external app stop events.\n      * @param {string} appName The name of the application being used to deliver the content to the end-user (i.e., Netflix).\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackExternalAppExit: function (appName, dimensions, metrics) {\n      if (typeof appName !== 'string' || appName === '') {\n        Log.warn('Cannot track external application exit since no appName has been supplied.')\n      } else {\n        Log.notice('APP EXIT', appName)\n        this._fireEvent('APP EXIT', {\n          eventType: 'ExternalApplications',\n          appName: appName\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // ENGAGEMENT\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Tracks engagement events.\n      * @param {string} eventName The name of the engagement event (i.e., Share, Save, Rate, etc.).\n      * @param {string} contentID The unique content identifier of the content the user is engaging with.\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackEngagementEvent: function (eventName, contentID, dimensions, metrics) {\n      if (typeof eventName !== 'string' || eventName === '') {\n        Log.warn('Cannot track engagement event since no eventName has been supplied.')\n      } else if (typeof contentID !== 'string' || contentID === '') {\n        Log.warn('Cannot track engagement event since no contentID has been supplied.')\n      } else {\n        Log.notice(eventName)\n        this._fireEvent(eventName, {\n          eventType: 'Engagement',\n          contentId: contentID\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // CUSTOM EVENT\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Track custom event\n      * @param {string} eventName Name of the event to track\n      * @param {Object} [dimensions] Dimensions to track\n      * @param {Object} [metrics] Metrics to track\n      */\n\n    trackEvent: function (eventName, dimensions, metrics) {\n      if (typeof eventName !== 'string' || eventName === '') {\n        Log.warn('Event cannot be tracked since no eventName has been supplied.')\n      } else {\n        Log.notice(eventName)\n        this._fireEvent(eventName, {\n          eventType: 'CustomEvent'\n        }, dimensions, metrics)\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // INTERNAL\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Fires an event\n      * @param {string} eventName Name of the event to be fired\n      * @param {Object} dimensionsInternal Dimensions supplied by user\n      * @param {Object} dimensionsUser Specific event dimensions\n      * @param {Object} metrics Metrics to track\n      * @private\n      */\n\n    _fireEvent: function (eventName, dimensionsInternal, dimensionsUser, metrics) {\n      var dimensions\n      var fired = false\n\n      // Extract top level dimensions from custom dimensions\n\n      dimensions = this._buildDimensions(dimensionsInternal, dimensionsUser)\n\n      // Track event\n\n      if (this._infinity) {\n        this._infinity.fireEvent(eventName, dimensions.custom, metrics, dimensions.top)\n        fired = true\n      } else {\n        Log.warn('Cannot fire', eventName, 'since infinity is unavailable')\n      }\n\n      return fired\n    },\n\n    /**\n      * Fires an adapter event (in case it is available)\n      * @param {string} eventName Event name\n      * @param {Object} dimensionsInternal Dimensions supplied by user\n      * @param {Object} dimensionsUser Specific event dimensions\n      * @param {Object} metrics Metrics to track\n      * @private\n      */\n\n    _fireAdapterEvent: function (eventName, dimensionsInternal, dimensionsUser, metrics) {\n      var dimensions\n      var adapter\n      var fired = false\n\n      adapter = this._adapterGet()\n\n      if (adapter) {\n        dimensions = this._buildDimensions(dimensionsInternal, dimensionsUser)\n        adapter.fireEvent(eventName, dimensions.custom, metrics, dimensions.top)\n        fired = true\n      } else {\n        Log.warn('Cannot fire ' + eventName + ' event since adapter is unavailable.')\n      }\n\n      return fired\n    },\n\n    /**\n      * Builds a list of top level and custom dimensions\n      * @param {Object} dimensionsInternal Object containing list of internal dimensions\n      * @param {Object} dimensionsUser Object containing list of custom dimensions\n      * @private\n      */\n\n    _buildDimensions: function (dimensionsInternal, dimensionsUser) {\n      var dimensionsTopLevel\n      var dimensionsCustom\n      var topKeysDelete\n      var topKeys\n\n      // Build custom event dimensions\n\n      dimensionsCustom = { page: this._page }\n\n      if (typeof dimensionsInternal !== 'undefined') {\n        dimensionsCustom = Object.assign(dimensionsCustom, dimensionsInternal)\n      }\n\n      if (typeof dimensionsUser !== 'undefined') {\n        dimensionsCustom = Object.assign(dimensionsCustom, dimensionsUser)\n      }\n\n      dimensionsCustom = Object.assign(dimensionsCustom, { eventSource: 'Product Analytics' })\n\n      // List of Top Level Dimension keys\n\n      topKeys = ['contentid', 'contentId', 'contentID', 'utmSource', 'utmMedium', 'utmCampaign', 'utmTerm', 'utmContent']\n      topKeysDelete = ['contentid', 'contentId', 'contentID']\n\n      // Create object with top level dimensions\n\n      dimensionsTopLevel = {}\n\n      for (var key in dimensionsCustom) {\n        if (Object.prototype.hasOwnProperty.call(dimensionsCustom, key) && topKeys.indexOf(key) !== -1) {\n          dimensionsTopLevel[key] = dimensionsCustom[key]\n        }\n      }\n\n      // Remove top level dimensions from custom dimensions list\n\n      topKeysDelete.forEach(function (key) {\n        delete dimensionsCustom[key]\n      })\n\n      return { custom: dimensionsCustom, top: dimensionsTopLevel }\n    }\n  }\n)\n\nmodule.exports = YouboraProductAnalytics\n","var Log = require('../log')\nvar YouboraObject = require('../object')\n\nvar YouboraProductAnalyticsConfig = YouboraObject.extend(\n  /** @lends youbora.ProductAnalyticsConfig.prototype */\n  {\n    /**\n     * This class handles Product Analytics configuration.\n     *\n     * @param {function} fireEvent Fire Event method\n     *\n     * @constructs youbora.ProductAnalyticsConfig\n     * @extends youbora.Object\n     * @memberof youbora\n     */\n\n    constructor: function (fireEvent) {\n      this._fireEvent = (typeof (fireEvent) === 'function' ? fireEvent : null)\n\n      // Load npawtmConfig object\n\n      if (typeof (window) === 'undefined' || typeof (window.npawtmConfig) !== 'object') {\n        // Load directly from AdminAPI?: this.loadTagManager()\n        this._npawtmConfig = null\n      } else {\n        this._npawtmConfig = window.npawtmConfig\n      }\n    },\n\n    /**\n      * Identifies current page and get events to monitor when available.\n      * @param {URL} location URL location\n      * @returns {string} Identified page name / null\n      */\n    identify: function (location) {\n      var events\n      var page\n\n      page = null\n      events = []\n\n      if (!this._npawtmConfig) {\n        Log.warn('no config descriptor available')\n      } else {\n        page = this._getPage(location)\n\n        if (page === null) {\n          // No page identified: set default page name\n          Log.warn('no page found')\n        } else {\n          // Page identified: look for bound events\n          events = this._getEvents(page)\n        }\n      }\n\n      // Bind events\n\n      if (typeof (window) === 'undefined') {\n        Log.warn('Product Analytics Config: cannot bind events since DOM is not available')\n      } else if (events.length > 0) {\n        window.addEventListener('load', function () {\n          this._bindElements(events)\n        }.bind(this))\n      }\n\n      return page\n    },\n\n    /**\n      * Looks for a page matching the supplied URL (either directly or by means of a regular expression).\n      * @param {URL} url URL to look for.\n      * @returns {string|*} Name of the page matching the URL or null if no matches have been found.\n      * @private\n      */\n    _getPage: function (url) {\n      var urlString\n      var regexInfo\n      var pageInfo\n      var regex\n      var i\n\n      var page = null\n\n      if (typeof (url) === 'object' && url !== null && this._npawtmConfig && this._npawtmConfig.urls && this._npawtmConfig.regexes && this._npawtmConfig.domains && this._npawtmConfig.domains.includes(url.hostname.toLowerCase())) {\n        // Direct URL lookup\n        pageInfo = this._npawtmConfig.urls[url.pathname]\n\n        if (typeof (pageInfo) !== 'undefined' && typeof (pageInfo.page) !== 'undefined') {\n          page = pageInfo.page\n        }\n\n        // If URL lookup fails, start regex lookup\n        urlString = url.pathname + url.search\n\n        for (i = 0; i < this._npawtmConfig.regexes.length && page === null; i++) {\n          regexInfo = this._npawtmConfig.regexes[i]\n          regex = new RegExp(regexInfo.regex)\n\n          if (urlString.match(regex)) {\n            page = regexInfo.page\n          }\n        }\n      }\n\n      return page\n    },\n\n    /**\n      * Gets events bound to the current page.\n      * @param {string} page Page name to look for.\n      * @private\n      */\n    _getEvents: function (page) {\n      var events = (this._npawtmConfig && this._npawtmConfig.events ? this._npawtmConfig.events[page] : null)\n\n      if (typeof (events) === 'undefined' || events === null) {\n        events = []\n      }\n\n      return events\n    },\n\n    /**\n      * Binding of element events pointed out by npawtmConfig.\n      * @param {Array} events List of events to bind\n      * @private\n      */\n    _bindElements: function (events) {\n      var eventInfo\n      var eventType\n      var element\n      var j\n      var i\n\n      for (i = 0; i < events.length; i++) {\n        eventInfo = events[i]\n        element = document.querySelector(eventInfo.selector)\n\n        if (element === null) {\n          Log.warn('element ' + eventInfo.selector + ' not found')\n        } else if (eventInfo.events.length === 0) {\n          Log.warn('element ' + eventInfo.selector + ' has no events to bind')\n        } else {\n          for (j = 0; j < eventInfo.events.length; j++) {\n            eventType = eventInfo.events[j]\n            element.npawEventInfo = eventInfo\n            element.npawEventType = eventType\n            element.addEventListener(eventType, function (eventData) {\n              var currentEventInfo = eventData.currentTarget.npawEventInfo\n              var currentEventType = eventData.currentTarget.npawEventType\n              this._elementEvent(currentEventInfo, currentEventType, eventData)\n            }.bind(this))\n          }\n        }\n      }\n    },\n\n    /**\n      * Tracks an event after a monitored element event has been triggered.\n      * @param {Object} eventInfo\n      * @param {string} eventType type of the triggered event (click...).\n      * @param {Object} eventData additional event data supplied by the event listener.\n      * @private\n      */\n    _elementEvent: function (eventInfo, eventType, eventData) {\n      var eventName = '[' + eventType + '] ' + eventInfo.name\n\n      if (this._fireEvent) {\n        this._fireEvent(eventName, {\n          uiElement: eventInfo.name,\n          eventName: eventName,\n          eventType: eventType\n        })\n      } else {\n        Log.warn('Cannot trigger event since no handler has been provided')\n      }\n    }\n  }\n)\n\nmodule.exports = YouboraProductAnalyticsConfig\n","var Log = require('../log')\nvar YouboraObject = require('../object')\n\nvar YouboraProductAnalyticsUserState = YouboraObject.extend(\n  /** @lends youbora.ProductAnalyticsUserState.prototype */\n  {\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // INITIALIZATION\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n     * This class handles Product Analytics user state management.\n     *\n     * @param {number} dimension Custom dimension where to store the user state.\n     * @param {number} interval Interval (in ms) to transition from active to passive state.\n     * @param {function} fireAdapterEvent Handler for firing adapter events\n     * @param {function} pluginOptionsHandler Handler for setting plugin options\n     *\n     * @constructs youbora.ProductAnalyticsUserState\n     * @extends youbora.Object\n     * @memberof youbora\n     */\n\n    constructor: function (dimension, interval, fireAdapterEvent, pluginOptionsHandler) {\n      if (typeof (fireAdapterEvent) !== 'function') {\n        Log.warn('Fire Adapter Event unset')\n        fireAdapterEvent = null\n      }\n\n      if (typeof (pluginOptionsHandler) !== 'function') {\n        Log.warn('Plugin Options Handler unset')\n        pluginOptionsHandler = null\n      }\n\n      if (typeof (dimension) !== 'number' || dimension < 1 || dimension > 9) {\n        dimension = 9\n      }\n\n      if (typeof (interval) !== 'number') {\n        interval = 30000\n      }\n\n      this._state = null\n      this._fireAdapterEvent = fireAdapterEvent\n      this._pluginOptionsHandler = pluginOptionsHandler\n      this._dimension = 'content.customDimension.' + dimension\n      this._timerId = null\n      this._timerInterval = interval\n      this._started = false\n\n      /*\n      We must set state (customDimension) at the very beginning. Otherwise, customDimension will have \"unknown\" value during the time\n      between page load and player first start.\n      */\n\n      this._storeState(YouboraProductAnalyticsUserState.States.ACTIVE)\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // STATE MANAGEMENT\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Set active state\n      * @param {string} eventName\n      * @param {boolean} playerStarted\n      */\n\n    setActive: function (eventName, playerStarted) {\n      var state = YouboraProductAnalyticsUserState.States.ACTIVE\n\n      if (typeof (playerStarted) !== 'boolean') {\n        playerStarted = false\n      }\n\n      if (this._started) {\n        // Player already started: fire event + store state on change and always reset timer\n\n        if (this._state !== state) {\n          this._fireEvent(state, eventName)\n          this._storeState(state)\n        }\n\n        this._timerStart()\n      } else if (playerStarted) {\n        // Player starting NOW: log event and reset timer.\n\n        this._started = true\n        // this._fireEvent(state, eventName)\n        this._timerStart()\n      } else {\n\n        // Player not started yet: discard events\n\n      }\n    },\n\n    /**\n      * Fire switch state event\n      * @private\n      */\n\n    _fireEvent: function (state, eventName) {\n      var dimensions\n\n      Log.notice('User changing from state ' + this._state + ' to ' + state)\n\n      dimensions = {\n        eventType: 'ContentPlayback',\n        newState: state,\n        triggerEvent: eventName,\n        stateFromTo: this._state + ' to ' + state\n      }\n\n      // Fire the event\n\n      if (this._fireAdapterEvent) {\n        switch (state) {\n          case YouboraProductAnalyticsUserState.States.ACTIVE:\n            this._fireAdapterEvent('[PLAYBACK STATE] Switch to Active', dimensions)\n            break\n          case YouboraProductAnalyticsUserState.States.PASSIVE:\n            this._fireAdapterEvent('[PLAYBACK STATE] Switch to Passive', dimensions)\n            break\n        }\n      } else {\n        Log.warn('Cannot fire user state event since handler is unavailable')\n      }\n    },\n\n    /**\n      * Store state\n      * @param {string} state\n      * @private\n      */\n\n    _storeState: function (state) {\n      var options\n\n      this._state = state\n\n      options = {}\n      options[this._dimension] = this._state\n\n      if (this._pluginOptionsHandler) {\n        this._pluginOptionsHandler(options)\n      } else {\n        Log.warn('Cannot store user state since handler is unavailable')\n      }\n    },\n\n    // ------------------------------------------------------------------------------------------------------------------------------\n    // TIMER MANAGEMENT\n    // ------------------------------------------------------------------------------------------------------------------------------\n\n    /**\n      * Starts interaction monitor timer\n      * @private\n      */\n\n    _timerStart: function () {\n      var state = YouboraProductAnalyticsUserState.States.PASSIVE\n\n      this._timerStop()\n\n      this._timerId = setTimeout(function () {\n        this._fireEvent(state, 'timer')\n        this._storeState(state)\n      }.bind(this), this._timerInterval)\n    },\n\n    /**\n      * Stops interaction monitor timer\n      * @private\n      */\n\n    _timerStop: function () {\n      if (this._timerId) {\n        clearTimeout(this._timerId)\n      }\n    }\n  },\n  /** @lends youbora.ProductAnalyticsUserState */\n  {\n    // Static Members //\n    /**\n     * Interaction state enumeration\n     * @enum\n     * @event\n     */\n    States: {\n      ACTIVE: 'active',\n      PASSIVE: 'passive'\n    }\n  }\n)\n\nmodule.exports = YouboraProductAnalyticsUserState\n","/* global atv */\nvar YouboraObject = require('./object')\nvar Chrono = require('./chrono')\n\nvar Timer = YouboraObject.extend(\n  /** @lends youbora.Timer.prototype */\n  {\n    /**\n     * An Utility class that provides timed events in a defined time interval.\n     *\n     * @param {function} callback The callback to call every due interval.\n     * Callback will receive lapsed ms between calls.\n     * @param {int} [interval=5000] Milliseconds between each call.\n     *\n     * @constructs Timer\n     * @extends youbora.YouboraObject\n     * @memberof youbora\n     */\n    constructor: function (callback, interval) {\n      this.callback = callback\n      this.interval = interval || 5000\n      this.isRunning = false\n      this._timer = null\n\n      this.chrono = new Chrono()\n    },\n\n    /**\n     * Starts the timer.\n     */\n    start: function () {\n      if (!this.isRunning) {\n        this.isRunning = true\n        this._setTick()\n      }\n    },\n\n    /**\n     * Stops the timer.\n     */\n    stop: function () {\n      this.isRunning = false\n      if (this._timer) {\n        try {\n          clearTimeout(this._timer)\n          this._timer = null\n        } catch (err) {\n          if (typeof atv !== 'undefined') {\n            atv.clearTimeout(this._timer)\n            this._timer = null\n          }\n        }\n      }\n    },\n\n    /**\n     * Sets the next tick execution.\n     * @private\n     */\n    _setTick: function () {\n      if (this.isRunning) {\n        this.chrono.start()\n        try {\n          this._timer = setTimeout(function () {\n            this.callback(this.chrono.stop())\n            this._setTick()\n          }.bind(this), this.interval)\n        } catch (err) {\n          if (typeof atv !== 'undefined') {\n            this._timer = atv.setTimeout(function () {\n              this.callback(this.chrono.stop())\n              this._setTick()\n            }.bind(this), this.interval)\n          }\n        }\n      }\n    }\n  }\n)\n\nmodule.exports = Timer\n","var Log = require('./log')\n\n/**\n * This static class provides utility methods.\n *\n * @class\n * @static\n * @memberof youbora\n */\nvar Util = {\n  /**\n     * Strip {protocol}:// and // from the begining of the string.\n     *\n     * @param {string} url\n     * @returns {string} stripped url\n     */\n  stripProtocol: function (url) {\n    var strippedUrl = url\n    try {\n      strippedUrl = url.replace(/^(.*?:\\/\\/|\\/\\/)/i, '')\n    } catch (err) {\n      Log.warn(err)\n    }\n    return strippedUrl\n  },\n\n  /**\n     * Adds specific protocol. ie: [http://]nqs.nice264.com\n     *\n     * @param {string} url Domain of the service. Without protocol. ie: 'nqs.nice264.com'.\n     * @param {boolean|null} [httpSecure]\n     * If true will add https, if false http.\n     * Otherwise will add //\n     * @return Return the complete service URL.\n     */\n  addProtocol: function (url, httpSecure) {\n    var serviceUrl = 'http://localhost/'\n    try {\n      serviceUrl = 'http://' + url\n      if (httpSecure || (typeof window !== 'undefined' && window.location.protocol.indexOf('https') === 0)) {\n        serviceUrl = 'https://' + url\n      } else if (typeof window !== 'undefined' && window.location.protocol.indexOf('http') === 0) {\n        serviceUrl = '//' + url\n      }\n    } catch (err) {\n      Log.warn(err)\n    }\n    return serviceUrl\n  },\n\n  /**\n     * Return n if it isn't NaN, negative, Infinity, null or undefined.\n     * In any other case, return def.\n     *\n     * @param {mixed} n Number to be parsed.\n     * @param {number} def Number to return if n is not correct.\n     */\n  parseNumber: function (n, def) {\n    return (!isNaN(n) &&\n      n >= 0 &&\n      n !== Infinity &&\n      n !== -Infinity &&\n      n !== null &&\n      typeof n !== 'undefined')\n      ? n\n      : def\n  },\n\n  /**\n     * This utility method will add most of the HTML5 common event listeners to the player sent.\n     * This common events will be listened: 'canplay', 'buffering', 'waiting', 'ended', 'play',\n     * 'playing', 'pause', 'resume', 'error', 'abort', 'seek', 'seeking', 'seeked', 'stalled',\n     * 'dispose', 'loadeddata', 'loadstart'.\n     *\n     * Events will be reported as DEBUG level messages.\n     *\n     * @param {object|function} o Object to attach the events.\n     * @param {array} [extraEvents]\n     * An array of extra events to watch. ie:  ['timeupdate', 'progress'].\n     * If the first item is null, no common events will be added.\n     * @param {function} [report] Callback function called to report events.\n     * Default calls Log.debug()\n     */\n  logAllEvents: function (o, extraEvents, report) {\n    try {\n      if (Log.logLevel <= Log.Level.DEBUG) {\n        report = report || function (e) {\n          Log.debug('Event: ' + e.type)\n        }\n\n        var playerEvents = [\n          'canplay', 'buffering', 'waiting', 'ended', 'play', 'playing',\n          'pause', 'resume', 'error', 'abort', 'seek', 'seeking', 'seeked',\n          'stalled', 'dispose', 'loadeddata', 'loadstart'\n        ]\n        if (extraEvents) {\n          if (extraEvents[0] === null) {\n            extraEvents.shift()\n            playerEvents = extraEvents\n          } else {\n            playerEvents = playerEvents.concat(extraEvents)\n          }\n        }\n\n        for (var i = 0; i < playerEvents.length; i++) {\n          if (typeof o === 'function') {\n            o.call(window, playerEvents[i], report)\n          } else if (o.on) {\n            o.on(playerEvents[i], report)\n          } else if (o.addEventListener) {\n            o.addEventListener(playerEvents[i], report)\n          }\n        }\n      }\n    } catch (err) {\n      Log.error(err)\n    }\n  },\n\n  /**\n     * Builds a string that represents the rendition.\n     *\n     * The returned string will have the following format: <width>x<height>@bitrate<suffix?>.\n     * If either the width or height are < 1, only the bitrate will be returned.\n     * If bitrate is < 1, only the dimensions will be returned.\n     * If bitrate is < and there is no dimensions, a null will be returned.\n     * The bitrate will also have one of the following suffixes dependin on its\n     * magnitude: bps, Kbps, Mbps\n     *\n     * @param {any} width The width of the asset. If only 1 argument is sent, it will be treated\n     * as bitrate.\n     * @param {any} height The height of the asset.\n     * @param {any} bitrate The indicated bitrate (in the manifest) of the asset.\n     * @returns {string} A string with the following format: <width>x<height>@<bitrate><suffix>\n     */\n  buildRenditionString: function (width, height, bitrate) {\n    if (arguments.length === 1) {\n      bitrate = width\n      width = null\n      height = null\n    }\n\n    var ret = null\n    if (width && height) {\n      ret = width + 'x' + height\n    }\n\n    if (typeof bitrate === 'number' && !isNaN(bitrate) && bitrate >= 1) {\n      if (ret) {\n        ret += '@'\n      } else {\n        ret = ''\n      }\n\n      if (bitrate < 1e3) {\n        ret += Math.round(bitrate) + 'bps'\n      } else if (bitrate < 1e6) {\n        bitrate = Math.round(bitrate / 1e3)\n        ret += bitrate + 'Kbps'\n      } else {\n        bitrate = Math.round(bitrate / 1e4) / 1e2\n        ret += bitrate + 'Mbps'\n      }\n    }\n    return ret\n  },\n\n  /**\n     * Returns a params dictionary with the error values.\n     *\n     * @param {String|Object} [code] Error Code, if an object is sent, it will be treated as params.\n     * @param {String} [msg] Error Message\n     * @param {Object} [metadata] Object defining error metadata\n     * @param {String} [level] Level of the error. Currently supports 'error' and 'fatal'\n     * @returns {Object} Key:value params.\n     */\n  buildErrorParams: function (code, msg, metadata, level) {\n    var params = {}\n    if (typeof code === 'object' && code !== null) {\n      params = code\n    } else {\n      params.errorCode = code || 'FAILURE'\n      params.msg = msg || params.errorCode\n      params.errorMetadata = metadata\n      params.errorLevel = level\n    }\n    return params\n  },\n\n  /**\n     * Returns a boolean indicating if more than the desired % of pixels are on screen.\n     *\n     * @param {Object} [player] Player object\n     * @param {Number} [screenPercent] Threshold % of pixels on screen to return true.\n     * @returns {Boolean} Its on screen or not.\n     */\n  calculateAdViewability: function (player, screenPercent) {\n    var isVisible = true\n    if (typeof window !== 'undefined' && player && typeof player.getBoundingClientRect === 'function') {\n      var box = player.getBoundingClientRect()\n      // 100% outside the window cases\n      if (box.top >= window.innerHeight || box.bottom <= 0 ||\n        box.right <= 0 || box.left >= window.innerWidth) {\n        isVisible = false\n      } else {\n        var pixels = Math.trunc(box.height * box.width)\n        var x1 = box.top > 0 ? box.top : 0\n        var x2 = box.bottom > window.innerHeight ? window.innerHeight : box.bottom\n        var y1 = box.left > 0 ? box.left : 0\n        var y2 = box.right > window.innerWidth ? window.innerWidth : box.right\n        var inScreenPixels = (y2 - y1) * (x2 - x1)\n        // more than screenPercent of pixels (by default 50%)\n        isVisible = inScreenPixels * 100 > pixels * (screenPercent || 50)\n      }\n    }\n    return isVisible\n  },\n\n  getMetricsFrom: function (op1, op2) {\n    var metrics = op1 || op2\n    for (var metric in metrics) {\n      if (typeof metrics[metric] !== 'object' || !metrics[metric].value) {\n        var temporal = {}\n        // temporal.oper = 'SUM' //default one?\n        temporal.value = metrics[metric]\n        metrics[metric] = temporal\n      }\n    }\n    return metrics\n  },\n\n  // The following methods replace core js functionallity to ensure compatibility in old versions.\n  assign: require('./mixins/assign'),\n  isArray: require('./mixins/isarray')\n}\n\nmodule.exports = Util\n","module.exports = require('../manifest.json').version\n","// No-Conflict\nvar previousYoubora = youbora // eslint-disable-line no-use-before-define\nvar youbora = {}\n\n/**\n * This allows you to run multiple instances of YouboraLib on the same webapp.\n * After loading the new version, call `noConflict()` to get a reference to it.\n * At the same time the old version will be returned to Youbora.\n */\nyoubora.noConflict = function () {\n  youbora = previousYoubora\n  return this\n}\n\n// Info\nyoubora.VERSION = require('./version')\n\n// Polyfills\nyoubora.polyfills = require('./polyfills')\nyoubora.polyfills()\n\n// Base Classes\nyoubora.Object = require('./object')\nyoubora.Emitter = require('./emitter')\n\n// Log\nyoubora.Log = require('./log')\nyoubora.Log.loadLevelFromUrl()\n\n// General classes\nyoubora.Util = require('./util')\nyoubora.HybridNetwork = require('./monitors/hybridnetwork')\nyoubora.Chrono = require('./chrono')\nyoubora.Timer = require('./timer')\nyoubora.Constants = require('./constants')\n\n// Comm classes\nyoubora.Request = require('./comm/request')\nyoubora.Communication = require('./comm/communication')\n\n// Resource Transform classes\nyoubora.Transform = require('./comm/transform/transform')\nyoubora.ViewTransform = require('./comm/transform/view')\nyoubora.ResourceTransform = require('./comm/transform/resource')\nyoubora.CdnParser = require('./comm/transform/resourceparsers/cdnparser')\nyoubora.HlsParser = require('./comm/transform/resourceparsers/formatparsers/hlsparser')\nyoubora.DashParser = require('./comm/transform/resourceparsers/formatparsers/dashparser')\nyoubora.OfflineParser = require('./comm/transform/offline')\nyoubora.LocationheaderParser = require('./comm/transform/resourceparsers/formatparsers/locationheaderparser')\n\n// Plugin Classes\nyoubora.Options = require('./plugin/options')\nyoubora.Plugin = require('./plugin/plugin')\nyoubora.Storage = require('./plugin/storage')\nyoubora.RequestBuilder = require('./plugin/requestbuilder')\n\n// Adapters\nyoubora.PlayheadMonitor = require('./adapter/playheadmonitor')\nyoubora.Adapter = require('./adapter/adapter')\nyoubora.adapters = {}\n\n// Infinity\nyoubora.Infinity = require('./infinity/infinity')\n\n// Detector classes\nyoubora.BackgroundDetector = require('./detectors/backgroundDetector')\nyoubora.DeviceDetector = require('./detectors/deviceDetector')\nyoubora.UUIDGenerator = require('./deviceUUID/hashgenerator')\n\n/**\n * Register the given adapter in <youbora>.adapters.\n *\n * @param {string} key Unique adapter identifier.\n * @param {youbora.Adapter} Adapter Adapter class.\n *\n * @memberof youbora\n */\nyoubora.registerAdapter = function (key, Adapter) {\n  this.adapters[key] = Adapter\n}.bind(youbora)\n\n/**\n * Remove the given adapter in <youbora>.adapters.\n *\n * @param {string} key Unique adapter identifier.\n *\n * @memberof youbora\n */\nyoubora.unregisterAdapter = function (key) {\n  this.adapters[key] = null\n}.bind(youbora)\n\nmodule.exports = youbora\n","function _extends() {\n  module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  return _extends.apply(this, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n  \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n  module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n    return exports;\n  }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n  var exports = {},\n    Op = Object.prototype,\n    hasOwn = Op.hasOwnProperty,\n    defineProperty = Object.defineProperty || function (obj, key, desc) {\n      obj[key] = desc.value;\n    },\n    $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n    iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n    asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n    toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n  function define(obj, key, value) {\n    return Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: !0,\n      configurable: !0,\n      writable: !0\n    }), obj[key];\n  }\n  try {\n    define({}, \"\");\n  } catch (err) {\n    define = function define(obj, key, value) {\n      return obj[key] = value;\n    };\n  }\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n      generator = Object.create(protoGenerator.prototype),\n      context = new Context(tryLocsList || []);\n    return defineProperty(generator, \"_invoke\", {\n      value: makeInvokeMethod(innerFn, self, context)\n    }), generator;\n  }\n  function tryCatch(fn, obj, arg) {\n    try {\n      return {\n        type: \"normal\",\n        arg: fn.call(obj, arg)\n      };\n    } catch (err) {\n      return {\n        type: \"throw\",\n        arg: err\n      };\n    }\n  }\n  exports.wrap = wrap;\n  var ContinueSentinel = {};\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n  var IteratorPrototype = {};\n  define(IteratorPrototype, iteratorSymbol, function () {\n    return this;\n  });\n  var getProto = Object.getPrototypeOf,\n    NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n  function defineIteratorMethods(prototype) {\n    [\"next\", \"throw\", \"return\"].forEach(function (method) {\n      define(prototype, method, function (arg) {\n        return this._invoke(method, arg);\n      });\n    });\n  }\n  function AsyncIterator(generator, PromiseImpl) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (\"throw\" !== record.type) {\n        var result = record.arg,\n          value = result.value;\n        return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n          invoke(\"next\", value, resolve, reject);\n        }, function (err) {\n          invoke(\"throw\", err, resolve, reject);\n        }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n          result.value = unwrapped, resolve(result);\n        }, function (error) {\n          return invoke(\"throw\", error, resolve, reject);\n        });\n      }\n      reject(record.arg);\n    }\n    var previousPromise;\n    defineProperty(this, \"_invoke\", {\n      value: function value(method, arg) {\n        function callInvokeWithMethodAndArg() {\n          return new PromiseImpl(function (resolve, reject) {\n            invoke(method, arg, resolve, reject);\n          });\n        }\n        return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n      }\n    });\n  }\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = \"suspendedStart\";\n    return function (method, arg) {\n      if (\"executing\" === state) throw new Error(\"Generator is already running\");\n      if (\"completed\" === state) {\n        if (\"throw\" === method) throw arg;\n        return doneResult();\n      }\n      for (context.method = method, context.arg = arg;;) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n        if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n          if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n          context.dispatchException(context.arg);\n        } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n        state = \"executing\";\n        var record = tryCatch(innerFn, self, context);\n        if (\"normal\" === record.type) {\n          if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n          return {\n            value: record.arg,\n            done: context.done\n          };\n        }\n        \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n      }\n    };\n  }\n  function maybeInvokeDelegate(delegate, context) {\n    var methodName = context.method,\n      method = delegate.iterator[methodName];\n    if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel;\n    var record = tryCatch(method, delegate.iterator, context.arg);\n    if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n    var info = record.arg;\n    return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n  }\n  function pushTryEntry(locs) {\n    var entry = {\n      tryLoc: locs[0]\n    };\n    1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n  }\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = \"normal\", delete record.arg, entry.completion = record;\n  }\n  function Context(tryLocsList) {\n    this.tryEntries = [{\n      tryLoc: \"root\"\n    }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n  }\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) return iteratorMethod.call(iterable);\n      if (\"function\" == typeof iterable.next) return iterable;\n      if (!isNaN(iterable.length)) {\n        var i = -1,\n          next = function next() {\n            for (; ++i < iterable.length;) {\n              if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n            }\n            return next.value = undefined, next.done = !0, next;\n          };\n        return next.next = next;\n      }\n    }\n    return {\n      next: doneResult\n    };\n  }\n  function doneResult() {\n    return {\n      value: undefined,\n      done: !0\n    };\n  }\n  return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n    value: GeneratorFunctionPrototype,\n    configurable: !0\n  }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n    value: GeneratorFunction,\n    configurable: !0\n  }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n    var ctor = \"function\" == typeof genFun && genFun.constructor;\n    return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n  }, exports.mark = function (genFun) {\n    return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n  }, exports.awrap = function (arg) {\n    return {\n      __await: arg\n    };\n  }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n    return this;\n  }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n    void 0 === PromiseImpl && (PromiseImpl = Promise);\n    var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n    return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n      return result.done ? result.value : iter.next();\n    });\n  }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n    return this;\n  }), define(Gp, \"toString\", function () {\n    return \"[object Generator]\";\n  }), exports.keys = function (val) {\n    var object = Object(val),\n      keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    return keys.reverse(), function next() {\n      for (; keys.length;) {\n        var key = keys.pop();\n        if (key in object) return next.value = key, next.done = !1, next;\n      }\n      return next.done = !0, next;\n    };\n  }, exports.values = values, Context.prototype = {\n    constructor: Context,\n    reset: function reset(skipTempReset) {\n      if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n        \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n      }\n    },\n    stop: function stop() {\n      this.done = !0;\n      var rootRecord = this.tryEntries[0].completion;\n      if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n      return this.rval;\n    },\n    dispatchException: function dispatchException(exception) {\n      if (this.done) throw exception;\n      var context = this;\n      function handle(loc, caught) {\n        return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n      }\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i],\n          record = entry.completion;\n        if (\"root\" === entry.tryLoc) return handle(\"end\");\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n            hasFinally = hasOwn.call(entry, \"finallyLoc\");\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n            if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n          } else {\n            if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n            if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n          }\n        }\n      }\n    },\n    abrupt: function abrupt(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n      finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n      var record = finallyEntry ? finallyEntry.completion : {};\n      return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n    },\n    complete: function complete(record, afterLoc) {\n      if (\"throw\" === record.type) throw record.arg;\n      return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n    },\n    finish: function finish(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n      }\n    },\n    \"catch\": function _catch(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (\"throw\" === record.type) {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n      throw new Error(\"illegal catch attempt\");\n    },\n    delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n      return this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n    }\n  }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n    return typeof obj;\n  } : function (obj) {\n    return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n  }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n  regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n  if (typeof globalThis === \"object\") {\n    globalThis.regeneratorRuntime = runtime;\n  } else {\n    Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n  }\n}\n","export default function _arrayLikeToArray(arr, len) {\n  if (len == null || len > arr.length) len = arr.length;\n  for (var i = 0, arr2 = new Array(len); i < len; i++) {\n    arr2[i] = arr[i];\n  }\n  return arr2;\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n  try {\n    var info = gen[key](arg);\n    var value = info.value;\n  } catch (error) {\n    reject(error);\n    return;\n  }\n  if (info.done) {\n    resolve(value);\n  } else {\n    Promise.resolve(value).then(_next, _throw);\n  }\n}\nexport default function _asyncToGenerator(fn) {\n  return function () {\n    var self = this,\n      args = arguments;\n    return new Promise(function (resolve, reject) {\n      var gen = fn.apply(self, args);\n      function _next(value) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n      }\n      function _throw(err) {\n        asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n      }\n      _next(undefined);\n    });\n  };\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n  key = toPropertyKey(key);\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n  return obj;\n}","export default function _extends() {\n  _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n  return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n  if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n  var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n  if (null != _i) {\n    var _s,\n      _e,\n      _x,\n      _r,\n      _arr = [],\n      _n = !0,\n      _d = !1;\n    try {\n      if (_x = (_i = _i.call(arr)).next, 0 === i) {\n        if (Object(_i) !== _i) return;\n        _n = !1;\n      } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {\n        ;\n      }\n    } catch (err) {\n      _d = !0, _e = err;\n    } finally {\n      try {\n        if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n      } finally {\n        if (_d) throw _e;\n      }\n    }\n    return _arr;\n  }\n}","export default function _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n  return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n  if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n  if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n  throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _typeof(obj) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n    return typeof obj;\n  } : function (obj) {\n    return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n  }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n  var key = toPrimitive(arg, \"string\");\n  return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n  if (_typeof(input) !== \"object\" || input === null) return input;\n  var prim = input[Symbol.toPrimitive];\n  if (prim !== undefined) {\n    var res = prim.call(input, hint || \"default\");\n    if (_typeof(res) !== \"object\") return res;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (hint === \"string\" ? String : Number)(input);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n  if (!o) return;\n  if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n  var n = Object.prototype.toString.call(o).slice(8, -1);\n  if (n === \"Object\" && o.constructor) n = o.constructor.name;\n  if (n === \"Map\" || n === \"Set\") return Array.from(o);\n  if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","__webpack_require__.nc = undefined;","\n      import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./main.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./main.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","import URLToolkit from 'url-toolkit';\nimport window from 'global/window';\nvar DEFAULT_LOCATION = 'http://example.com';\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n  // return early if we don't need to resolve\n  if (/^[a-z]+:/i.test(relativeUrl)) {\n    return relativeUrl;\n  } // if baseUrl is a data URI, ignore it and resolve everything relative to window.location\n\n\n  if (/^data:/.test(baseUrl)) {\n    baseUrl = window.location && window.location.href || '';\n  } // IE11 supports URL but not the URL constructor\n  // feature detect the behavior we want\n\n\n  var nativeURL = typeof window.URL === 'function';\n  var protocolLess = /^\\/\\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)\n  // and if baseUrl isn't an absolute url\n\n  var removeLocation = !window.location && !/\\/\\//i.test(baseUrl); // if the base URL is relative then combine with the current location\n\n  if (nativeURL) {\n    baseUrl = new window.URL(baseUrl, window.location || DEFAULT_LOCATION);\n  } else if (!/\\/\\//i.test(baseUrl)) {\n    baseUrl = URLToolkit.buildAbsoluteURL(window.location && window.location.href || '', baseUrl);\n  }\n\n  if (nativeURL) {\n    var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol\n    // and if we're location-less, remove the location\n    // otherwise, return the url unmodified\n\n    if (removeLocation) {\n      return newUrl.href.slice(DEFAULT_LOCATION.length);\n    } else if (protocolLess) {\n      return newUrl.href.slice(newUrl.protocol.length);\n    }\n\n    return newUrl.href;\n  }\n\n  return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\nexport default resolveUrl;","/**\n * @file stream.js\n */\n\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = /*#__PURE__*/function () {\n  function Stream() {\n    this.listeners = {};\n  }\n  /**\n   * Add a listener for a specified event type.\n   *\n   * @param {string} type the event name\n   * @param {Function} listener the callback to be invoked when an event of\n   * the specified type occurs\n   */\n\n\n  var _proto = Stream.prototype;\n\n  _proto.on = function on(type, listener) {\n    if (!this.listeners[type]) {\n      this.listeners[type] = [];\n    }\n\n    this.listeners[type].push(listener);\n  }\n  /**\n   * Remove a listener for a specified event type.\n   *\n   * @param {string} type the event name\n   * @param {Function} listener  a function previously registered for this\n   * type of event through `on`\n   * @return {boolean} if we could turn it off or not\n   */\n  ;\n\n  _proto.off = function off(type, listener) {\n    if (!this.listeners[type]) {\n      return false;\n    }\n\n    var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n    // In Video.js we slice listener functions\n    // on trigger so that it does not mess up the order\n    // while we loop through.\n    //\n    // Here we slice on off so that the loop in trigger\n    // can continue using it's old reference to loop without\n    // messing up the order.\n\n    this.listeners[type] = this.listeners[type].slice(0);\n    this.listeners[type].splice(index, 1);\n    return index > -1;\n  }\n  /**\n   * Trigger an event of the specified type on this stream. Any additional\n   * arguments to this function are passed as parameters to event listeners.\n   *\n   * @param {string} type the event name\n   */\n  ;\n\n  _proto.trigger = function trigger(type) {\n    var callbacks = this.listeners[type];\n\n    if (!callbacks) {\n      return;\n    } // Slicing the arguments on every invocation of this method\n    // can add a significant amount of overhead. Avoid the\n    // intermediate object creation for the common case of a\n    // single callback argument\n\n\n    if (arguments.length === 2) {\n      var length = callbacks.length;\n\n      for (var i = 0; i < length; ++i) {\n        callbacks[i].call(this, arguments[1]);\n      }\n    } else {\n      var args = Array.prototype.slice.call(arguments, 1);\n      var _length = callbacks.length;\n\n      for (var _i = 0; _i < _length; ++_i) {\n        callbacks[_i].apply(this, args);\n      }\n    }\n  }\n  /**\n   * Destroys the stream and cleans up.\n   */\n  ;\n\n  _proto.dispose = function dispose() {\n    this.listeners = {};\n  }\n  /**\n   * Forwards all `data` events on this stream to the destination stream. The\n   * destination stream should provide a method `push` to receive the data\n   * events as they arrive.\n   *\n   * @param {Stream} destination the stream that will receive all `data` events\n   * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n   */\n  ;\n\n  _proto.pipe = function pipe(destination) {\n    this.on('data', function (data) {\n      destination.push(data);\n    });\n  };\n\n  return Stream;\n}();\n\nexport { Stream as default };","import window from 'global/window';\n\nvar atob = function atob(s) {\n  return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nexport default function decodeB64ToUint8Array(b64Text) {\n  var decodedString = atob(b64Text);\n  var array = new Uint8Array(decodedString.length);\n\n  for (var i = 0; i < decodedString.length; i++) {\n    array[i] = decodedString.charCodeAt(i);\n  }\n\n  return array;\n}","/*! @name m3u8-parser @version 7.1.0 @license Apache-2.0 */\nimport Stream from '@videojs/vhs-utils/es/stream.js';\nimport _extends from '@babel/runtime/helpers/extends';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array.js';\n\n/**\n * @file m3u8/line-stream.js\n */\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nclass LineStream extends Stream {\n  constructor() {\n    super();\n    this.buffer = '';\n  }\n  /**\n   * Add new data to be parsed.\n   *\n   * @param {string} data the text to process\n   */\n\n\n  push(data) {\n    let nextNewline;\n    this.buffer += data;\n    nextNewline = this.buffer.indexOf('\\n');\n\n    for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n      this.trigger('data', this.buffer.substring(0, nextNewline));\n      this.buffer = this.buffer.substring(nextNewline + 1);\n    }\n  }\n\n}\n\nconst TAB = String.fromCharCode(0x09);\n\nconst parseByterange = function (byterangeString) {\n  // optionally match and capture 0+ digits before `@`\n  // optionally match and capture 0+ digits after `@`\n  const match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || '');\n  const result = {};\n\n  if (match[1]) {\n    result.length = parseInt(match[1], 10);\n  }\n\n  if (match[2]) {\n    result.offset = parseInt(match[2], 10);\n  }\n\n  return result;\n};\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue   -> key '=' value\n * key        -> [^=]*\n * value      -> '\"' [^\"]* '\"' | [^,]*\n */\n\n\nconst attributeSeparator = function () {\n  const key = '[^=]*';\n  const value = '\"[^\"]*\"|[^,]*';\n  const keyvalue = '(?:' + key + ')=(?:' + value + ')';\n  return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n/**\n * Parse attributes from a line given the separator\n *\n * @param {string} attributes the attribute line to parse\n */\n\n\nconst parseAttributes = function (attributes) {\n  const result = {};\n\n  if (!attributes) {\n    return result;\n  } // split the string using attributes as the separator\n\n\n  const attrs = attributes.split(attributeSeparator());\n  let i = attrs.length;\n  let attr;\n\n  while (i--) {\n    // filter out unmatched portions of the string\n    if (attrs[i] === '') {\n      continue;\n    } // split the key and value\n\n\n    attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1); // trim whitespace and remove optional quotes around the value\n\n    attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n    attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n    attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n    result[attr[0]] = attr[1];\n  }\n\n  return result;\n};\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\n\nclass ParseStream extends Stream {\n  constructor() {\n    super();\n    this.customParsers = [];\n    this.tagMappers = [];\n  }\n  /**\n   * Parses an additional line of input.\n   *\n   * @param {string} line a single line of an M3U8 file to parse\n   */\n\n\n  push(line) {\n    let match;\n    let event; // strip whitespace\n\n    line = line.trim();\n\n    if (line.length === 0) {\n      // ignore empty lines\n      return;\n    } // URIs\n\n\n    if (line[0] !== '#') {\n      this.trigger('data', {\n        type: 'uri',\n        uri: line\n      });\n      return;\n    } // map tags\n\n\n    const newLines = this.tagMappers.reduce((acc, mapper) => {\n      const mappedLine = mapper(line); // skip if unchanged\n\n      if (mappedLine === line) {\n        return acc;\n      }\n\n      return acc.concat([mappedLine]);\n    }, [line]);\n    newLines.forEach(newLine => {\n      for (let i = 0; i < this.customParsers.length; i++) {\n        if (this.customParsers[i].call(this, newLine)) {\n          return;\n        }\n      } // Comments\n\n\n      if (newLine.indexOf('#EXT') !== 0) {\n        this.trigger('data', {\n          type: 'comment',\n          text: newLine.slice(1)\n        });\n        return;\n      } // strip off any carriage returns here so the regex matching\n      // doesn't have to account for them.\n\n\n      newLine = newLine.replace('\\r', ''); // Tags\n\n      match = /^#EXTM3U/.exec(newLine);\n\n      if (match) {\n        this.trigger('data', {\n          type: 'tag',\n          tagType: 'm3u'\n        });\n        return;\n      }\n\n      match = /^#EXTINF:([0-9\\.]*)?,?(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'inf'\n        };\n\n        if (match[1]) {\n          event.duration = parseFloat(match[1]);\n        }\n\n        if (match[2]) {\n          event.title = match[2];\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'targetduration'\n        };\n\n        if (match[1]) {\n          event.duration = parseInt(match[1], 10);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-VERSION:([0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'version'\n        };\n\n        if (match[1]) {\n          event.version = parseInt(match[1], 10);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-MEDIA-SEQUENCE:(\\-?[0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'media-sequence'\n        };\n\n        if (match[1]) {\n          event.number = parseInt(match[1], 10);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\\-?[0-9.]*)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'discontinuity-sequence'\n        };\n\n        if (match[1]) {\n          event.number = parseInt(match[1], 10);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'playlist-type'\n        };\n\n        if (match[1]) {\n          event.playlistType = match[1];\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = _extends(parseByterange(match[1]), {\n          type: 'tag',\n          tagType: 'byterange'\n        });\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'allow-cache'\n        };\n\n        if (match[1]) {\n          event.allowed = !/NO/.test(match[1]);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-MAP:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'map'\n        };\n\n        if (match[1]) {\n          const attributes = parseAttributes(match[1]);\n\n          if (attributes.URI) {\n            event.uri = attributes.URI;\n          }\n\n          if (attributes.BYTERANGE) {\n            event.byterange = parseByterange(attributes.BYTERANGE);\n          }\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-STREAM-INF:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'stream-inf'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n\n          if (event.attributes.RESOLUTION) {\n            const split = event.attributes.RESOLUTION.split('x');\n            const resolution = {};\n\n            if (split[0]) {\n              resolution.width = parseInt(split[0], 10);\n            }\n\n            if (split[1]) {\n              resolution.height = parseInt(split[1], 10);\n            }\n\n            event.attributes.RESOLUTION = resolution;\n          }\n\n          if (event.attributes.BANDWIDTH) {\n            event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n          }\n\n          if (event.attributes['FRAME-RATE']) {\n            event.attributes['FRAME-RATE'] = parseFloat(event.attributes['FRAME-RATE']);\n          }\n\n          if (event.attributes['PROGRAM-ID']) {\n            event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n          }\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-MEDIA:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'media'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-ENDLIST/.exec(newLine);\n\n      if (match) {\n        this.trigger('data', {\n          type: 'tag',\n          tagType: 'endlist'\n        });\n        return;\n      }\n\n      match = /^#EXT-X-DISCONTINUITY/.exec(newLine);\n\n      if (match) {\n        this.trigger('data', {\n          type: 'tag',\n          tagType: 'discontinuity'\n        });\n        return;\n      }\n\n      match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'program-date-time'\n        };\n\n        if (match[1]) {\n          event.dateTimeString = match[1];\n          event.dateTimeObject = new Date(match[1]);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-KEY:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'key'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]); // parse the IV string into a Uint32Array\n\n          if (event.attributes.IV) {\n            if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n              event.attributes.IV = event.attributes.IV.substring(2);\n            }\n\n            event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n            event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n            event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n            event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n            event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n            event.attributes.IV = new Uint32Array(event.attributes.IV);\n          }\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-START:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'start'\n        };\n\n        if (match[1]) {\n          event.attributes = parseAttributes(match[1]);\n          event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n          event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-out-cont'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-CUE-OUT:(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-out'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-CUE-IN:(.*)?$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'cue-in'\n        };\n\n        if (match[1]) {\n          event.data = match[1];\n        } else {\n          event.data = '';\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'skip'\n        };\n        event.attributes = parseAttributes(match[1]);\n\n        if (event.attributes.hasOwnProperty('SKIPPED-SEGMENTS')) {\n          event.attributes['SKIPPED-SEGMENTS'] = parseInt(event.attributes['SKIPPED-SEGMENTS'], 10);\n        }\n\n        if (event.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES')) {\n          event.attributes['RECENTLY-REMOVED-DATERANGES'] = event.attributes['RECENTLY-REMOVED-DATERANGES'].split(TAB);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-PART:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'part'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['DURATION'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        ['INDEPENDENT', 'GAP'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = /YES/.test(event.attributes[key]);\n          }\n        });\n\n        if (event.attributes.hasOwnProperty('BYTERANGE')) {\n          event.attributes.byterange = parseByterange(event.attributes.BYTERANGE);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'server-control'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = /YES/.test(event.attributes[key]);\n          }\n        });\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'part-inf'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['PART-TARGET'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'preload-hint'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseInt(event.attributes[key], 10);\n            const subkey = key === 'BYTERANGE-LENGTH' ? 'length' : 'offset';\n            event.attributes.byterange = event.attributes.byterange || {};\n            event.attributes.byterange[subkey] = event.attributes[key]; // only keep the parsed byterange object.\n\n            delete event.attributes[key];\n          }\n        });\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'rendition-report'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['LAST-MSN', 'LAST-PART'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseInt(event.attributes[key], 10);\n          }\n        });\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-DATERANGE:(.*)$/.exec(newLine);\n\n      if (match && match[1]) {\n        event = {\n          type: 'tag',\n          tagType: 'daterange'\n        };\n        event.attributes = parseAttributes(match[1]);\n        ['ID', 'CLASS'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = String(event.attributes[key]);\n          }\n        });\n        ['START-DATE', 'END-DATE'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = new Date(event.attributes[key]);\n          }\n        });\n        ['DURATION', 'PLANNED-DURATION'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = parseFloat(event.attributes[key]);\n          }\n        });\n        ['END-ON-NEXT'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = /YES/i.test(event.attributes[key]);\n          }\n        });\n        ['SCTE35-CMD', ' SCTE35-OUT', 'SCTE35-IN'].forEach(function (key) {\n          if (event.attributes.hasOwnProperty(key)) {\n            event.attributes[key] = event.attributes[key].toString(16);\n          }\n        });\n        const clientAttributePattern = /^X-([A-Z]+-)+[A-Z]+$/;\n\n        for (const key in event.attributes) {\n          if (!clientAttributePattern.test(key)) {\n            continue;\n          }\n\n          const isHexaDecimal = /[0-9A-Fa-f]{6}/g.test(event.attributes[key]);\n          const isDecimalFloating = /^\\d+(\\.\\d+)?$/.test(event.attributes[key]);\n          event.attributes[key] = isHexaDecimal ? event.attributes[key].toString(16) : isDecimalFloating ? parseFloat(event.attributes[key]) : String(event.attributes[key]);\n        }\n\n        this.trigger('data', event);\n        return;\n      }\n\n      match = /^#EXT-X-INDEPENDENT-SEGMENTS/.exec(newLine);\n\n      if (match) {\n        this.trigger('data', {\n          type: 'tag',\n          tagType: 'independent-segments'\n        });\n        return;\n      }\n\n      match = /^#EXT-X-CONTENT-STEERING:(.*)$/.exec(newLine);\n\n      if (match) {\n        event = {\n          type: 'tag',\n          tagType: 'content-steering'\n        };\n        event.attributes = parseAttributes(match[1]);\n        this.trigger('data', event);\n        return;\n      } // unknown tag type\n\n\n      this.trigger('data', {\n        type: 'tag',\n        data: newLine.slice(4)\n      });\n    });\n  }\n  /**\n   * Add a parser for custom headers\n   *\n   * @param {Object}   options              a map of options for the added parser\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {string}   options.customType   the custom type to register to the output\n   * @param {Function} [options.dataParser] function to parse the line into an object\n   * @param {boolean}  [options.segment]    should tag data be attached to the segment object\n   */\n\n\n  addParser({\n    expression,\n    customType,\n    dataParser,\n    segment\n  }) {\n    if (typeof dataParser !== 'function') {\n      dataParser = line => line;\n    }\n\n    this.customParsers.push(line => {\n      const match = expression.exec(line);\n\n      if (match) {\n        this.trigger('data', {\n          type: 'custom',\n          data: dataParser(line),\n          customType,\n          segment\n        });\n        return true;\n      }\n    });\n  }\n  /**\n   * Add a custom header mapper\n   *\n   * @param {Object}   options\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {Function} options.map          function to translate tag into a different tag\n   */\n\n\n  addTagMapper({\n    expression,\n    map\n  }) {\n    const mapFn = line => {\n      if (expression.test(line)) {\n        return map(line);\n      }\n\n      return line;\n    };\n\n    this.tagMappers.push(mapFn);\n  }\n\n}\n\nconst camelCase = str => str.toLowerCase().replace(/-(\\w)/g, a => a[1].toUpperCase());\n\nconst camelCaseKeys = function (attributes) {\n  const result = {};\n  Object.keys(attributes).forEach(function (key) {\n    result[camelCase(key)] = attributes[key];\n  });\n  return result;\n}; // set SERVER-CONTROL hold back based upon targetDuration and partTargetDuration\n// we need this helper because defaults are based upon targetDuration and\n// partTargetDuration being set, but they may not be if SERVER-CONTROL appears before\n// target durations are set.\n\n\nconst setHoldBack = function (manifest) {\n  const {\n    serverControl,\n    targetDuration,\n    partTargetDuration\n  } = manifest;\n\n  if (!serverControl) {\n    return;\n  }\n\n  const tag = '#EXT-X-SERVER-CONTROL';\n  const hb = 'holdBack';\n  const phb = 'partHoldBack';\n  const minTargetDuration = targetDuration && targetDuration * 3;\n  const minPartDuration = partTargetDuration && partTargetDuration * 2;\n\n  if (targetDuration && !serverControl.hasOwnProperty(hb)) {\n    serverControl[hb] = minTargetDuration;\n    this.trigger('info', {\n      message: `${tag} defaulting HOLD-BACK to targetDuration * 3 (${minTargetDuration}).`\n    });\n  }\n\n  if (minTargetDuration && serverControl[hb] < minTargetDuration) {\n    this.trigger('warn', {\n      message: `${tag} clamping HOLD-BACK (${serverControl[hb]}) to targetDuration * 3 (${minTargetDuration})`\n    });\n    serverControl[hb] = minTargetDuration;\n  } // default no part hold back to part target duration * 3\n\n\n  if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {\n    serverControl[phb] = partTargetDuration * 3;\n    this.trigger('info', {\n      message: `${tag} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${serverControl[phb]}).`\n    });\n  } // if part hold back is too small default it to part target duration * 2\n\n\n  if (partTargetDuration && serverControl[phb] < minPartDuration) {\n    this.trigger('warn', {\n      message: `${tag} clamping PART-HOLD-BACK (${serverControl[phb]}) to partTargetDuration * 2 (${minPartDuration}).`\n    });\n    serverControl[phb] = minPartDuration;\n  }\n};\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\n\nclass Parser extends Stream {\n  constructor() {\n    super();\n    this.lineStream = new LineStream();\n    this.parseStream = new ParseStream();\n    this.lineStream.pipe(this.parseStream);\n    this.lastProgramDateTime = null;\n    /* eslint-disable consistent-this */\n\n    const self = this;\n    /* eslint-enable consistent-this */\n\n    const uris = [];\n    let currentUri = {}; // if specified, the active EXT-X-MAP definition\n\n    let currentMap; // if specified, the active decryption key\n\n    let key;\n    let hasParts = false;\n\n    const noop = function () {};\n\n    const defaultMediaGroups = {\n      'AUDIO': {},\n      'VIDEO': {},\n      'CLOSED-CAPTIONS': {},\n      'SUBTITLES': {}\n    }; // This is the Widevine UUID from DASH IF IOP. The same exact string is\n    // used in MPDs with Widevine encrypted streams.\n\n    const widevineUuid = 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'; // group segments into numbered timelines delineated by discontinuities\n\n    let currentTimeline = 0; // the manifest is empty until the parse stream begins delivering data\n\n    this.manifest = {\n      allowCache: true,\n      discontinuityStarts: [],\n      dateRanges: [],\n      segments: []\n    }; // keep track of the last seen segment's byte range end, as segments are not required\n    // to provide the offset, in which case it defaults to the next byte after the\n    // previous segment\n\n    let lastByterangeEnd = 0; // keep track of the last seen part's byte range end.\n\n    let lastPartByterangeEnd = 0;\n    const dateRangeTags = {};\n    this.on('end', () => {\n      // only add preloadSegment if we don't yet have a uri for it.\n      // and we actually have parts/preloadHints\n      if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {\n        return;\n      }\n\n      if (!currentUri.map && currentMap) {\n        currentUri.map = currentMap;\n      }\n\n      if (!currentUri.key && key) {\n        currentUri.key = key;\n      }\n\n      if (!currentUri.timeline && typeof currentTimeline === 'number') {\n        currentUri.timeline = currentTimeline;\n      }\n\n      this.manifest.preloadSegment = currentUri;\n    }); // update the manifest with the m3u8 entry from the parse stream\n\n    this.parseStream.on('data', function (entry) {\n      let mediaGroup;\n      let rendition;\n      ({\n        tag() {\n          // switch based on the tag type\n          (({\n            version() {\n              if (entry.version) {\n                this.manifest.version = entry.version;\n              }\n            },\n\n            'allow-cache'() {\n              this.manifest.allowCache = entry.allowed;\n\n              if (!('allowed' in entry)) {\n                this.trigger('info', {\n                  message: 'defaulting allowCache to YES'\n                });\n                this.manifest.allowCache = true;\n              }\n            },\n\n            byterange() {\n              const byterange = {};\n\n              if ('length' in entry) {\n                currentUri.byterange = byterange;\n                byterange.length = entry.length;\n\n                if (!('offset' in entry)) {\n                  /*\n                   * From the latest spec (as of this writing):\n                   * https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.2\n                   *\n                   * Same text since EXT-X-BYTERANGE's introduction in draft 7:\n                   * https://tools.ietf.org/html/draft-pantos-http-live-streaming-07#section-3.3.1)\n                   *\n                   * \"If o [offset] is not present, the sub-range begins at the next byte\n                   * following the sub-range of the previous media segment.\"\n                   */\n                  entry.offset = lastByterangeEnd;\n                }\n              }\n\n              if ('offset' in entry) {\n                currentUri.byterange = byterange;\n                byterange.offset = entry.offset;\n              }\n\n              lastByterangeEnd = byterange.offset + byterange.length;\n            },\n\n            endlist() {\n              this.manifest.endList = true;\n            },\n\n            inf() {\n              if (!('mediaSequence' in this.manifest)) {\n                this.manifest.mediaSequence = 0;\n                this.trigger('info', {\n                  message: 'defaulting media sequence to zero'\n                });\n              }\n\n              if (!('discontinuitySequence' in this.manifest)) {\n                this.manifest.discontinuitySequence = 0;\n                this.trigger('info', {\n                  message: 'defaulting discontinuity sequence to zero'\n                });\n              }\n\n              if (entry.title) {\n                currentUri.title = entry.title;\n              }\n\n              if (entry.duration > 0) {\n                currentUri.duration = entry.duration;\n              }\n\n              if (entry.duration === 0) {\n                currentUri.duration = 0.01;\n                this.trigger('info', {\n                  message: 'updating zero segment duration to a small value'\n                });\n              }\n\n              this.manifest.segments = uris;\n            },\n\n            key() {\n              if (!entry.attributes) {\n                this.trigger('warn', {\n                  message: 'ignoring key declaration without attribute list'\n                });\n                return;\n              } // clear the active encryption key\n\n\n              if (entry.attributes.METHOD === 'NONE') {\n                key = null;\n                return;\n              }\n\n              if (!entry.attributes.URI) {\n                this.trigger('warn', {\n                  message: 'ignoring key declaration without URI'\n                });\n                return;\n              }\n\n              if (entry.attributes.KEYFORMAT === 'com.apple.streamingkeydelivery') {\n                this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n                this.manifest.contentProtection['com.apple.fps.1_0'] = {\n                  attributes: entry.attributes\n                };\n                return;\n              }\n\n              if (entry.attributes.KEYFORMAT === 'com.microsoft.playready') {\n                this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n                this.manifest.contentProtection['com.microsoft.playready'] = {\n                  uri: entry.attributes.URI\n                };\n                return;\n              } // check if the content is encrypted for Widevine\n              // Widevine/HLS spec: https://storage.googleapis.com/wvdocs/Widevine_DRM_HLS.pdf\n\n\n              if (entry.attributes.KEYFORMAT === widevineUuid) {\n                const VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];\n\n                if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {\n                  this.trigger('warn', {\n                    message: 'invalid key method provided for Widevine'\n                  });\n                  return;\n                }\n\n                if (entry.attributes.METHOD === 'SAMPLE-AES-CENC') {\n                  this.trigger('warn', {\n                    message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'\n                  });\n                }\n\n                if (entry.attributes.URI.substring(0, 23) !== 'data:text/plain;base64,') {\n                  this.trigger('warn', {\n                    message: 'invalid key URI provided for Widevine'\n                  });\n                  return;\n                }\n\n                if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === '0x')) {\n                  this.trigger('warn', {\n                    message: 'invalid key ID provided for Widevine'\n                  });\n                  return;\n                } // if Widevine key attributes are valid, store them as `contentProtection`\n                // on the manifest to emulate Widevine tag structure in a DASH mpd\n\n\n                this.manifest.contentProtection = this.manifest.contentProtection || {};\n                this.manifest.contentProtection['com.widevine.alpha'] = {\n                  attributes: {\n                    schemeIdUri: entry.attributes.KEYFORMAT,\n                    // remove '0x' from the key id string\n                    keyId: entry.attributes.KEYID.substring(2)\n                  },\n                  // decode the base64-encoded PSSH box\n                  pssh: decodeB64ToUint8Array(entry.attributes.URI.split(',')[1])\n                };\n                return;\n              }\n\n              if (!entry.attributes.METHOD) {\n                this.trigger('warn', {\n                  message: 'defaulting key method to AES-128'\n                });\n              } // setup an encryption key for upcoming segments\n\n\n              key = {\n                method: entry.attributes.METHOD || 'AES-128',\n                uri: entry.attributes.URI\n              };\n\n              if (typeof entry.attributes.IV !== 'undefined') {\n                key.iv = entry.attributes.IV;\n              }\n            },\n\n            'media-sequence'() {\n              if (!isFinite(entry.number)) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid media sequence: ' + entry.number\n                });\n                return;\n              }\n\n              this.manifest.mediaSequence = entry.number;\n            },\n\n            'discontinuity-sequence'() {\n              if (!isFinite(entry.number)) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid discontinuity sequence: ' + entry.number\n                });\n                return;\n              }\n\n              this.manifest.discontinuitySequence = entry.number;\n              currentTimeline = entry.number;\n            },\n\n            'playlist-type'() {\n              if (!/VOD|EVENT/.test(entry.playlistType)) {\n                this.trigger('warn', {\n                  message: 'ignoring unknown playlist type: ' + entry.playlist\n                });\n                return;\n              }\n\n              this.manifest.playlistType = entry.playlistType;\n            },\n\n            map() {\n              currentMap = {};\n\n              if (entry.uri) {\n                currentMap.uri = entry.uri;\n              }\n\n              if (entry.byterange) {\n                currentMap.byterange = entry.byterange;\n              }\n\n              if (key) {\n                currentMap.key = key;\n              }\n            },\n\n            'stream-inf'() {\n              this.manifest.playlists = uris;\n              this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n              if (!entry.attributes) {\n                this.trigger('warn', {\n                  message: 'ignoring empty stream-inf attributes'\n                });\n                return;\n              }\n\n              if (!currentUri.attributes) {\n                currentUri.attributes = {};\n              }\n\n              _extends(currentUri.attributes, entry.attributes);\n            },\n\n            media() {\n              this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n              if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n                this.trigger('warn', {\n                  message: 'ignoring incomplete or missing media group'\n                });\n                return;\n              } // find the media group, creating defaults as necessary\n\n\n              const mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n              mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n              mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']]; // collect the rendition metadata\n\n              rendition = {\n                default: /yes/i.test(entry.attributes.DEFAULT)\n              };\n\n              if (rendition.default) {\n                rendition.autoselect = true;\n              } else {\n                rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n              }\n\n              if (entry.attributes.LANGUAGE) {\n                rendition.language = entry.attributes.LANGUAGE;\n              }\n\n              if (entry.attributes.URI) {\n                rendition.uri = entry.attributes.URI;\n              }\n\n              if (entry.attributes['INSTREAM-ID']) {\n                rendition.instreamId = entry.attributes['INSTREAM-ID'];\n              }\n\n              if (entry.attributes.CHARACTERISTICS) {\n                rendition.characteristics = entry.attributes.CHARACTERISTICS;\n              }\n\n              if (entry.attributes.FORCED) {\n                rendition.forced = /yes/i.test(entry.attributes.FORCED);\n              } // insert the new rendition\n\n\n              mediaGroup[entry.attributes.NAME] = rendition;\n            },\n\n            discontinuity() {\n              currentTimeline += 1;\n              currentUri.discontinuity = true;\n              this.manifest.discontinuityStarts.push(uris.length);\n            },\n\n            'program-date-time'() {\n              if (typeof this.manifest.dateTimeString === 'undefined') {\n                // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n                // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n                // to the manifest object\n                // TODO: Consider removing this in future major version\n                this.manifest.dateTimeString = entry.dateTimeString;\n                this.manifest.dateTimeObject = entry.dateTimeObject;\n              }\n\n              currentUri.dateTimeString = entry.dateTimeString;\n              currentUri.dateTimeObject = entry.dateTimeObject;\n              const {\n                lastProgramDateTime\n              } = this;\n              this.lastProgramDateTime = new Date(entry.dateTimeString).getTime(); // We should extrapolate Program Date Time backward only during first program date time occurrence.\n              // Once we have at least one program date time point, we can always extrapolate it forward using lastProgramDateTime reference.\n\n              if (lastProgramDateTime === null) {\n                // Extrapolate Program Date Time backward\n                // Since it is first program date time occurrence we're assuming that\n                // all this.manifest.segments have no program date time info\n                this.manifest.segments.reduceRight((programDateTime, segment) => {\n                  segment.programDateTime = programDateTime - segment.duration * 1000;\n                  return segment.programDateTime;\n                }, this.lastProgramDateTime);\n              }\n            },\n\n            targetduration() {\n              if (!isFinite(entry.duration) || entry.duration < 0) {\n                this.trigger('warn', {\n                  message: 'ignoring invalid target duration: ' + entry.duration\n                });\n                return;\n              }\n\n              this.manifest.targetDuration = entry.duration;\n              setHoldBack.call(this, this.manifest);\n            },\n\n            start() {\n              if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n                this.trigger('warn', {\n                  message: 'ignoring start declaration without appropriate attribute list'\n                });\n                return;\n              }\n\n              this.manifest.start = {\n                timeOffset: entry.attributes['TIME-OFFSET'],\n                precise: entry.attributes.PRECISE\n              };\n            },\n\n            'cue-out'() {\n              currentUri.cueOut = entry.data;\n            },\n\n            'cue-out-cont'() {\n              currentUri.cueOutCont = entry.data;\n            },\n\n            'cue-in'() {\n              currentUri.cueIn = entry.data;\n            },\n\n            'skip'() {\n              this.manifest.skip = camelCaseKeys(entry.attributes);\n              this.warnOnMissingAttributes_('#EXT-X-SKIP', entry.attributes, ['SKIPPED-SEGMENTS']);\n            },\n\n            'part'() {\n              hasParts = true; // parts are always specifed before a segment\n\n              const segmentIndex = this.manifest.segments.length;\n              const part = camelCaseKeys(entry.attributes);\n              currentUri.parts = currentUri.parts || [];\n              currentUri.parts.push(part);\n\n              if (part.byterange) {\n                if (!part.byterange.hasOwnProperty('offset')) {\n                  part.byterange.offset = lastPartByterangeEnd;\n                }\n\n                lastPartByterangeEnd = part.byterange.offset + part.byterange.length;\n              }\n\n              const partIndex = currentUri.parts.length - 1;\n              this.warnOnMissingAttributes_(`#EXT-X-PART #${partIndex} for segment #${segmentIndex}`, entry.attributes, ['URI', 'DURATION']);\n\n              if (this.manifest.renditionReports) {\n                this.manifest.renditionReports.forEach((r, i) => {\n                  if (!r.hasOwnProperty('lastPart')) {\n                    this.trigger('warn', {\n                      message: `#EXT-X-RENDITION-REPORT #${i} lacks required attribute(s): LAST-PART`\n                    });\n                  }\n                });\n              }\n            },\n\n            'server-control'() {\n              const attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);\n\n              if (!attrs.hasOwnProperty('canBlockReload')) {\n                attrs.canBlockReload = false;\n                this.trigger('info', {\n                  message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false'\n                });\n              }\n\n              setHoldBack.call(this, this.manifest);\n\n              if (attrs.canSkipDateranges && !attrs.hasOwnProperty('canSkipUntil')) {\n                this.trigger('warn', {\n                  message: '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set'\n                });\n              }\n            },\n\n            'preload-hint'() {\n              // parts are always specifed before a segment\n              const segmentIndex = this.manifest.segments.length;\n              const hint = camelCaseKeys(entry.attributes);\n              const isPart = hint.type && hint.type === 'PART';\n              currentUri.preloadHints = currentUri.preloadHints || [];\n              currentUri.preloadHints.push(hint);\n\n              if (hint.byterange) {\n                if (!hint.byterange.hasOwnProperty('offset')) {\n                  // use last part byterange end or zero if not a part.\n                  hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;\n\n                  if (isPart) {\n                    lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;\n                  }\n                }\n              }\n\n              const index = currentUri.preloadHints.length - 1;\n              this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${index} for segment #${segmentIndex}`, entry.attributes, ['TYPE', 'URI']);\n\n              if (!hint.type) {\n                return;\n              } // search through all preload hints except for the current one for\n              // a duplicate type.\n\n\n              for (let i = 0; i < currentUri.preloadHints.length - 1; i++) {\n                const otherHint = currentUri.preloadHints[i];\n\n                if (!otherHint.type) {\n                  continue;\n                }\n\n                if (otherHint.type === hint.type) {\n                  this.trigger('warn', {\n                    message: `#EXT-X-PRELOAD-HINT #${index} for segment #${segmentIndex} has the same TYPE ${hint.type} as preload hint #${i}`\n                  });\n                }\n              }\n            },\n\n            'rendition-report'() {\n              const report = camelCaseKeys(entry.attributes);\n              this.manifest.renditionReports = this.manifest.renditionReports || [];\n              this.manifest.renditionReports.push(report);\n              const index = this.manifest.renditionReports.length - 1;\n              const required = ['LAST-MSN', 'URI'];\n\n              if (hasParts) {\n                required.push('LAST-PART');\n              }\n\n              this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${index}`, entry.attributes, required);\n            },\n\n            'part-inf'() {\n              this.manifest.partInf = camelCaseKeys(entry.attributes);\n              this.warnOnMissingAttributes_('#EXT-X-PART-INF', entry.attributes, ['PART-TARGET']);\n\n              if (this.manifest.partInf.partTarget) {\n                this.manifest.partTargetDuration = this.manifest.partInf.partTarget;\n              }\n\n              setHoldBack.call(this, this.manifest);\n            },\n\n            'daterange'() {\n              this.manifest.dateRanges.push(camelCaseKeys(entry.attributes));\n              const index = this.manifest.dateRanges.length - 1;\n              this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${index}`, entry.attributes, ['ID', 'START-DATE']);\n              const dateRange = this.manifest.dateRanges[index];\n\n              if (dateRange.endDate && dateRange.startDate && new Date(dateRange.endDate) < new Date(dateRange.startDate)) {\n                this.trigger('warn', {\n                  message: 'EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE'\n                });\n              }\n\n              if (dateRange.duration && dateRange.duration < 0) {\n                this.trigger('warn', {\n                  message: 'EXT-X-DATERANGE DURATION must not be negative'\n                });\n              }\n\n              if (dateRange.plannedDuration && dateRange.plannedDuration < 0) {\n                this.trigger('warn', {\n                  message: 'EXT-X-DATERANGE PLANNED-DURATION must not be negative'\n                });\n              }\n\n              const endOnNextYes = !!dateRange.endOnNext;\n\n              if (endOnNextYes && !dateRange.class) {\n                this.trigger('warn', {\n                  message: 'EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute'\n                });\n              }\n\n              if (endOnNextYes && (dateRange.duration || dateRange.endDate)) {\n                this.trigger('warn', {\n                  message: 'EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes'\n                });\n              }\n\n              if (dateRange.duration && dateRange.endDate) {\n                const startDate = dateRange.startDate;\n                const newDateInSeconds = startDate.getTime() + dateRange.duration * 1000;\n                this.manifest.dateRanges[index].endDate = new Date(newDateInSeconds);\n              }\n\n              if (!dateRangeTags[dateRange.id]) {\n                dateRangeTags[dateRange.id] = dateRange;\n              } else {\n                for (const attribute in dateRangeTags[dateRange.id]) {\n                  if (!!dateRange[attribute] && JSON.stringify(dateRangeTags[dateRange.id][attribute]) !== JSON.stringify(dateRange[attribute])) {\n                    this.trigger('warn', {\n                      message: 'EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values'\n                    });\n                    break;\n                  }\n                } // if tags with the same ID do not have conflicting attributes, merge them\n\n\n                const dateRangeWithSameId = this.manifest.dateRanges.findIndex(dateRangeToFind => dateRangeToFind.id === dateRange.id);\n                this.manifest.dateRanges[dateRangeWithSameId] = _extends(this.manifest.dateRanges[dateRangeWithSameId], dateRange);\n                dateRangeTags[dateRange.id] = _extends(dateRangeTags[dateRange.id], dateRange); // after merging, delete the duplicate dateRange that was added last\n\n                this.manifest.dateRanges.pop();\n              }\n            },\n\n            'independent-segments'() {\n              this.manifest.independentSegments = true;\n            },\n\n            'content-steering'() {\n              this.manifest.contentSteering = camelCaseKeys(entry.attributes);\n              this.warnOnMissingAttributes_('#EXT-X-CONTENT-STEERING', entry.attributes, ['SERVER-URI']);\n            }\n\n          })[entry.tagType] || noop).call(self);\n        },\n\n        uri() {\n          currentUri.uri = entry.uri;\n          uris.push(currentUri); // if no explicit duration was declared, use the target duration\n\n          if (this.manifest.targetDuration && !('duration' in currentUri)) {\n            this.trigger('warn', {\n              message: 'defaulting segment duration to the target duration'\n            });\n            currentUri.duration = this.manifest.targetDuration;\n          } // annotate with encryption information, if necessary\n\n\n          if (key) {\n            currentUri.key = key;\n          }\n\n          currentUri.timeline = currentTimeline; // annotate with initialization segment information, if necessary\n\n          if (currentMap) {\n            currentUri.map = currentMap;\n          } // reset the last byterange end as it needs to be 0 between parts\n\n\n          lastPartByterangeEnd = 0; // Once we have at least one program date time we can always extrapolate it forward\n\n          if (this.lastProgramDateTime !== null) {\n            currentUri.programDateTime = this.lastProgramDateTime;\n            this.lastProgramDateTime += currentUri.duration * 1000;\n          } // prepare for the next URI\n\n\n          currentUri = {};\n        },\n\n        comment() {// comments are not important for playback\n        },\n\n        custom() {\n          // if this is segment-level data attach the output to the segment\n          if (entry.segment) {\n            currentUri.custom = currentUri.custom || {};\n            currentUri.custom[entry.customType] = entry.data; // if this is manifest-level data attach to the top level manifest object\n          } else {\n            this.manifest.custom = this.manifest.custom || {};\n            this.manifest.custom[entry.customType] = entry.data;\n          }\n        }\n\n      })[entry.type].call(self);\n    });\n  }\n\n  warnOnMissingAttributes_(identifier, attributes, required) {\n    const missing = [];\n    required.forEach(function (key) {\n      if (!attributes.hasOwnProperty(key)) {\n        missing.push(key);\n      }\n    });\n\n    if (missing.length) {\n      this.trigger('warn', {\n        message: `${identifier} lacks required attribute(s): ${missing.join(', ')}`\n      });\n    }\n  }\n  /**\n   * Parse the input string and update the manifest object.\n   *\n   * @param {string} chunk a potentially incomplete portion of the manifest\n   */\n\n\n  push(chunk) {\n    this.lineStream.push(chunk);\n  }\n  /**\n   * Flush any remaining input. This can be handy if the last line of an M3U8\n   * manifest did not contain a trailing newline but the file has been\n   * completely received.\n   */\n\n\n  end() {\n    // flush any buffered input\n    this.lineStream.push('\\n');\n\n    if (this.manifest.dateRanges.length && this.lastProgramDateTime === null) {\n      this.trigger('warn', {\n        message: 'A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag'\n      });\n    }\n\n    this.lastProgramDateTime = null;\n    this.trigger('end');\n  }\n  /**\n   * Add an additional parser for non-standard tags\n   *\n   * @param {Object}   options              a map of options for the added parser\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {string}   options.customType   the custom type to register to the output\n   * @param {Function} [options.dataParser] function to parse the line into an object\n   * @param {boolean}  [options.segment]    should tag data be attached to the segment object\n   */\n\n\n  addParser(options) {\n    this.parseStream.addParser(options);\n  }\n  /**\n   * Add a custom header mapper\n   *\n   * @param {Object}   options\n   * @param {RegExp}   options.expression   a regular expression to match the custom header\n   * @param {Function} options.map          function to translate tag into a different tag\n   */\n\n\n  addTagMapper(options) {\n    this.parseStream.addTagMapper(options);\n  }\n\n}\n\nexport { LineStream, ParseStream, Parser };\n","import window from 'global/window';\nvar regexs = {\n  // to determine mime types\n  mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,\n  webm: /^(vp0?[89]|av0?1|opus|vorbis)/,\n  ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,\n  // to determine if a codec is audio or video\n  video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,\n  audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,\n  text: /^(stpp.ttml.im1t)/,\n  // mux.js support regex\n  muxerVideo: /^(avc0?1)/,\n  muxerAudio: /^(mp4a)/,\n  // match nothing as muxer does not support text right now.\n  // there cannot never be a character before the start of a string\n  // so this matches nothing.\n  muxerText: /a^/\n};\nvar mediaTypes = ['video', 'audio', 'text'];\nvar upperMediaTypes = ['Video', 'Audio', 'Text'];\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string} codec\n *        Codec string to translate\n * @return {string}\n *         The translated codec string\n */\n\nexport var translateLegacyCodec = function translateLegacyCodec(codec) {\n  if (!codec) {\n    return codec;\n  }\n\n  return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n    var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n    var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n    return 'avc1.' + profileHex + '00' + avcLevelHex;\n  });\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec strings with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string[]} codecs\n *        An array of codec strings to translate\n * @return {string[]}\n *         The translated array of codec strings\n */\n\nexport var translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n  return codecs.map(translateLegacyCodec);\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param {string} codecString\n *        The codec string\n * @return {string}\n *         The codec string with old apple-style codecs replaced\n *\n * @private\n */\n\nexport var mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n  return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n    return translateLegacyCodecs([match])[0];\n  });\n};\n/**\n * @typedef {Object} ParsedCodecInfo\n * @property {number} codecCount\n *           Number of codecs parsed\n * @property {string} [videoCodec]\n *           Parsed video codec (if found)\n * @property {string} [videoObjectTypeIndicator]\n *           Video object type indicator (if found)\n * @property {string|null} audioProfile\n *           Audio profile\n */\n\n/**\n * Parses a codec string to retrieve the number of codecs specified, the video codec and\n * object type indicator, and the audio profile.\n *\n * @param {string} [codecString]\n *        The codec string to parse\n * @return {ParsedCodecInfo}\n *         Parsed codec info\n */\n\nexport var parseCodecs = function parseCodecs(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  var codecs = codecString.split(',');\n  var result = [];\n  codecs.forEach(function (codec) {\n    codec = codec.trim();\n    var codecType;\n    mediaTypes.forEach(function (name) {\n      var match = regexs[name].exec(codec.toLowerCase());\n\n      if (!match || match.length <= 1) {\n        return;\n      }\n\n      codecType = name; // maintain codec case\n\n      var type = codec.substring(0, match[1].length);\n      var details = codec.replace(type, '');\n      result.push({\n        type: type,\n        details: details,\n        mediaType: name\n      });\n    });\n\n    if (!codecType) {\n      result.push({\n        type: codec,\n        details: '',\n        mediaType: 'unknown'\n      });\n    }\n  });\n  return result;\n};\n/**\n * Returns a ParsedCodecInfo object for the default alternate audio playlist if there is\n * a default alternate audio playlist for the provided audio group.\n *\n * @param {Object} master\n *        The master playlist\n * @param {string} audioGroupId\n *        ID of the audio group for which to find the default codec info\n * @return {ParsedCodecInfo}\n *         Parsed codec info\n */\n\nexport var codecsFromDefault = function codecsFromDefault(master, audioGroupId) {\n  if (!master.mediaGroups.AUDIO || !audioGroupId) {\n    return null;\n  }\n\n  var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n  if (!audioGroup) {\n    return null;\n  }\n\n  for (var name in audioGroup) {\n    var audioType = audioGroup[name];\n\n    if (audioType.default && audioType.playlists) {\n      // codec should be the same for all playlists within the audio type\n      return parseCodecs(audioType.playlists[0].attributes.CODECS);\n    }\n  }\n\n  return null;\n};\nexport var isVideoCodec = function isVideoCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.video.test(codec.trim().toLowerCase());\n};\nexport var isAudioCodec = function isAudioCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.audio.test(codec.trim().toLowerCase());\n};\nexport var isTextCodec = function isTextCodec(codec) {\n  if (codec === void 0) {\n    codec = '';\n  }\n\n  return regexs.text.test(codec.trim().toLowerCase());\n};\nexport var getMimeForCodec = function getMimeForCodec(codecString) {\n  if (!codecString || typeof codecString !== 'string') {\n    return;\n  }\n\n  var codecs = codecString.toLowerCase().split(',').map(function (c) {\n    return translateLegacyCodec(c.trim());\n  }); // default to video type\n\n  var type = 'video'; // only change to audio type if the only codec we have is\n  // audio\n\n  if (codecs.length === 1 && isAudioCodec(codecs[0])) {\n    type = 'audio';\n  } else if (codecs.length === 1 && isTextCodec(codecs[0])) {\n    // text uses application/<container> for now\n    type = 'application';\n  } // default the container to mp4\n\n\n  var container = 'mp4'; // every codec must be able to go into the container\n  // for that container to be the correct one\n\n  if (codecs.every(function (c) {\n    return regexs.mp4.test(c);\n  })) {\n    container = 'mp4';\n  } else if (codecs.every(function (c) {\n    return regexs.webm.test(c);\n  })) {\n    container = 'webm';\n  } else if (codecs.every(function (c) {\n    return regexs.ogg.test(c);\n  })) {\n    container = 'ogg';\n  }\n\n  return type + \"/\" + container + \";codecs=\\\"\" + codecString + \"\\\"\";\n};\nexport var browserSupportsCodec = function browserSupportsCodec(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  return window.MediaSource && window.MediaSource.isTypeSupported && window.MediaSource.isTypeSupported(getMimeForCodec(codecString)) || false;\n};\nexport var muxerSupportsCodec = function muxerSupportsCodec(codecString) {\n  if (codecString === void 0) {\n    codecString = '';\n  }\n\n  return codecString.toLowerCase().split(',').every(function (codec) {\n    codec = codec.trim(); // any match is supported.\n\n    for (var i = 0; i < upperMediaTypes.length; i++) {\n      var type = upperMediaTypes[i];\n\n      if (regexs[\"muxer\" + type].test(codec)) {\n        return true;\n      }\n    }\n\n    return false;\n  });\n};\nexport var DEFAULT_AUDIO_CODEC = 'mp4a.40.2';\nexport var DEFAULT_VIDEO_CODEC = 'avc1.4d400d';","import window from 'global/window'; // const log2 = Math.log2 ? Math.log2 : (x) => (Math.log(x) / Math.log(2));\n\nvar repeat = function repeat(str, len) {\n  var acc = '';\n\n  while (len--) {\n    acc += str;\n  }\n\n  return acc;\n}; // count the number of bits it would take to represent a number\n// we used to do this with log2 but BigInt does not support builtin math\n// Math.ceil(log2(x));\n\n\nexport var countBits = function countBits(x) {\n  return x.toString(2).length;\n}; // count the number of whole bytes it would take to represent a number\n\nexport var countBytes = function countBytes(x) {\n  return Math.ceil(countBits(x) / 8);\n};\nexport var padStart = function padStart(b, len, str) {\n  if (str === void 0) {\n    str = ' ';\n  }\n\n  return (repeat(str, len) + b.toString()).slice(-len);\n};\nexport var isArrayBufferView = function isArrayBufferView(obj) {\n  if (ArrayBuffer.isView === 'function') {\n    return ArrayBuffer.isView(obj);\n  }\n\n  return obj && obj.buffer instanceof ArrayBuffer;\n};\nexport var isTypedArray = function isTypedArray(obj) {\n  return isArrayBufferView(obj);\n};\nexport var toUint8 = function toUint8(bytes) {\n  if (bytes instanceof Uint8Array) {\n    return bytes;\n  }\n\n  if (!Array.isArray(bytes) && !isTypedArray(bytes) && !(bytes instanceof ArrayBuffer)) {\n    // any non-number or NaN leads to empty uint8array\n    // eslint-disable-next-line\n    if (typeof bytes !== 'number' || typeof bytes === 'number' && bytes !== bytes) {\n      bytes = 0;\n    } else {\n      bytes = [bytes];\n    }\n  }\n\n  return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);\n};\nexport var toHexString = function toHexString(bytes) {\n  bytes = toUint8(bytes);\n  var str = '';\n\n  for (var i = 0; i < bytes.length; i++) {\n    str += padStart(bytes[i].toString(16), 2, '0');\n  }\n\n  return str;\n};\nexport var toBinaryString = function toBinaryString(bytes) {\n  bytes = toUint8(bytes);\n  var str = '';\n\n  for (var i = 0; i < bytes.length; i++) {\n    str += padStart(bytes[i].toString(2), 8, '0');\n  }\n\n  return str;\n};\nvar BigInt = window.BigInt || Number;\nvar BYTE_TABLE = [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\nexport var ENDIANNESS = function () {\n  var a = new Uint16Array([0xFFCC]);\n  var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n\n  if (b[0] === 0xFF) {\n    return 'big';\n  }\n\n  if (b[0] === 0xCC) {\n    return 'little';\n  }\n\n  return 'unknown';\n}();\nexport var IS_BIG_ENDIAN = ENDIANNESS === 'big';\nexport var IS_LITTLE_ENDIAN = ENDIANNESS === 'little';\nexport var bytesToNumber = function bytesToNumber(bytes, _temp) {\n  var _ref = _temp === void 0 ? {} : _temp,\n      _ref$signed = _ref.signed,\n      signed = _ref$signed === void 0 ? false : _ref$signed,\n      _ref$le = _ref.le,\n      le = _ref$le === void 0 ? false : _ref$le;\n\n  bytes = toUint8(bytes);\n  var fn = le ? 'reduce' : 'reduceRight';\n  var obj = bytes[fn] ? bytes[fn] : Array.prototype[fn];\n  var number = obj.call(bytes, function (total, byte, i) {\n    var exponent = le ? i : Math.abs(i + 1 - bytes.length);\n    return total + BigInt(byte) * BYTE_TABLE[exponent];\n  }, BigInt(0));\n\n  if (signed) {\n    var max = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);\n    number = BigInt(number);\n\n    if (number > max) {\n      number -= max;\n      number -= max;\n      number -= BigInt(2);\n    }\n  }\n\n  return Number(number);\n};\nexport var numberToBytes = function numberToBytes(number, _temp2) {\n  var _ref2 = _temp2 === void 0 ? {} : _temp2,\n      _ref2$le = _ref2.le,\n      le = _ref2$le === void 0 ? false : _ref2$le;\n\n  // eslint-disable-next-line\n  if (typeof number !== 'bigint' && typeof number !== 'number' || typeof number === 'number' && number !== number) {\n    number = 0;\n  }\n\n  number = BigInt(number);\n  var byteCount = countBytes(number);\n  var bytes = new Uint8Array(new ArrayBuffer(byteCount));\n\n  for (var i = 0; i < byteCount; i++) {\n    var byteIndex = le ? i : Math.abs(i + 1 - bytes.length);\n    bytes[byteIndex] = Number(number / BYTE_TABLE[i] & BigInt(0xFF));\n\n    if (number < 0) {\n      bytes[byteIndex] = Math.abs(~bytes[byteIndex]);\n      bytes[byteIndex] -= i === 0 ? 1 : 2;\n    }\n  }\n\n  return bytes;\n};\nexport var bytesToString = function bytesToString(bytes) {\n  if (!bytes) {\n    return '';\n  } // TODO: should toUint8 handle cases where we only have 8 bytes\n  // but report more since this is a Uint16+ Array?\n\n\n  bytes = Array.prototype.slice.call(bytes);\n  var string = String.fromCharCode.apply(null, toUint8(bytes));\n\n  try {\n    return decodeURIComponent(escape(string));\n  } catch (e) {// if decodeURIComponent/escape fails, we are dealing with partial\n    // or full non string data. Just return the potentially garbled string.\n  }\n\n  return string;\n};\nexport var stringToBytes = function stringToBytes(string, stringIsBytes) {\n  if (typeof string !== 'string' && string && typeof string.toString === 'function') {\n    string = string.toString();\n  }\n\n  if (typeof string !== 'string') {\n    return new Uint8Array();\n  } // If the string already is bytes, we don't have to do this\n  // otherwise we do this so that we split multi length characters\n  // into individual bytes\n\n\n  if (!stringIsBytes) {\n    string = unescape(encodeURIComponent(string));\n  }\n\n  var view = new Uint8Array(string.length);\n\n  for (var i = 0; i < string.length; i++) {\n    view[i] = string.charCodeAt(i);\n  }\n\n  return view;\n};\nexport var concatTypedArrays = function concatTypedArrays() {\n  for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {\n    buffers[_key] = arguments[_key];\n  }\n\n  buffers = buffers.filter(function (b) {\n    return b && (b.byteLength || b.length) && typeof b !== 'string';\n  });\n\n  if (buffers.length <= 1) {\n    // for 0 length we will return empty uint8\n    // for 1 length we return the first uint8\n    return toUint8(buffers[0]);\n  }\n\n  var totalLen = buffers.reduce(function (total, buf, i) {\n    return total + (buf.byteLength || buf.length);\n  }, 0);\n  var tempBuffer = new Uint8Array(totalLen);\n  var offset = 0;\n  buffers.forEach(function (buf) {\n    buf = toUint8(buf);\n    tempBuffer.set(buf, offset);\n    offset += buf.byteLength;\n  });\n  return tempBuffer;\n};\n/**\n * Check if the bytes \"b\" are contained within bytes \"a\".\n *\n * @param {Uint8Array|Array} a\n *        Bytes to check in\n *\n * @param {Uint8Array|Array} b\n *        Bytes to check for\n *\n * @param {Object} options\n *        options\n *\n * @param {Array|Uint8Array} [offset=0]\n *        offset to use when looking at bytes in a\n *\n * @param {Array|Uint8Array} [mask=[]]\n *        mask to use on bytes before comparison.\n *\n * @return {boolean}\n *         If all bytes in b are inside of a, taking into account\n *         bit masks.\n */\n\nexport var bytesMatch = function bytesMatch(a, b, _temp3) {\n  var _ref3 = _temp3 === void 0 ? {} : _temp3,\n      _ref3$offset = _ref3.offset,\n      offset = _ref3$offset === void 0 ? 0 : _ref3$offset,\n      _ref3$mask = _ref3.mask,\n      mask = _ref3$mask === void 0 ? [] : _ref3$mask;\n\n  a = toUint8(a);\n  b = toUint8(b); // ie 11 does not support uint8 every\n\n  var fn = b.every ? b.every : Array.prototype.every;\n  return b.length && a.length - offset >= b.length && // ie 11 doesn't support every on uin8\n  fn.call(b, function (bByte, i) {\n    var aByte = mask[i] ? mask[i] & a[offset + i] : a[offset + i];\n    return bByte === aByte;\n  });\n};\nexport var sliceBytes = function sliceBytes(src, start, end) {\n  if (Uint8Array.prototype.slice) {\n    return Uint8Array.prototype.slice.call(src, start, end);\n  }\n\n  return new Uint8Array(Array.prototype.slice.call(src, start, end));\n};\nexport var reverseBytes = function reverseBytes(src) {\n  if (src.reverse) {\n    return src.reverse();\n  }\n\n  return Array.prototype.reverse.call(src);\n};","var MPEGURL_REGEX = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\nvar DASH_REGEX = /^application\\/dash\\+xml/i;\n/**\n * Returns a string that describes the type of source based on a video source object's\n * media type.\n *\n * @see {@link https://dev.w3.org/html5/pf-summary/video.html#dom-source-type|Source Type}\n *\n * @param {string} type\n *        Video source object media type\n * @return {('hls'|'dash'|'vhs-json'|null)}\n *         VHS source type string\n */\n\nexport var simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n  if (MPEGURL_REGEX.test(type)) {\n    return 'hls';\n  }\n\n  if (DASH_REGEX.test(type)) {\n    return 'dash';\n  } // Denotes the special case of a manifest object passed to http-streaming instead of a\n  // source URL.\n  //\n  // See https://en.wikipedia.org/wiki/Media_type for details on specifying media types.\n  //\n  // In this case, vnd stands for vendor, video.js for the organization, VHS for this\n  // project, and the +json suffix identifies the structure of the media type.\n\n\n  if (type === 'application/vnd.videojs.vhs+json') {\n    return 'vhs-json';\n  }\n\n  return null;\n};","/*! @name mpd-parser @version 1.3.0 @license Apache-2.0 */\nimport resolveUrl from '@videojs/vhs-utils/es/resolve-url';\nimport window from 'global/window';\nimport { forEachMediaGroup } from '@videojs/vhs-utils/es/media-groups';\nimport decodeB64ToUint8Array from '@videojs/vhs-utils/es/decode-b64-to-uint8-array';\nimport { DOMParser } from '@xmldom/xmldom';\n\nvar version = \"1.3.0\";\n\nconst isObject = obj => {\n  return !!obj && typeof obj === 'object';\n};\n\nconst merge = (...objects) => {\n  return objects.reduce((result, source) => {\n    if (typeof source !== 'object') {\n      return result;\n    }\n\n    Object.keys(source).forEach(key => {\n      if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n        result[key] = result[key].concat(source[key]);\n      } else if (isObject(result[key]) && isObject(source[key])) {\n        result[key] = merge(result[key], source[key]);\n      } else {\n        result[key] = source[key];\n      }\n    });\n    return result;\n  }, {});\n};\nconst values = o => Object.keys(o).map(k => o[k]);\n\nconst range = (start, end) => {\n  const result = [];\n\n  for (let i = start; i < end; i++) {\n    result.push(i);\n  }\n\n  return result;\n};\nconst flatten = lists => lists.reduce((x, y) => x.concat(y), []);\nconst from = list => {\n  if (!list.length) {\n    return [];\n  }\n\n  const result = [];\n\n  for (let i = 0; i < list.length; i++) {\n    result.push(list[i]);\n  }\n\n  return result;\n};\nconst findIndexes = (l, key) => l.reduce((a, e, i) => {\n  if (e[key]) {\n    a.push(i);\n  }\n\n  return a;\n}, []);\n/**\n * Returns a union of the included lists provided each element can be identified by a key.\n *\n * @param {Array} list - list of lists to get the union of\n * @param {Function} keyFunction - the function to use as a key for each element\n *\n * @return {Array} the union of the arrays\n */\n\nconst union = (lists, keyFunction) => {\n  return values(lists.reduce((acc, list) => {\n    list.forEach(el => {\n      acc[keyFunction(el)] = el;\n    });\n    return acc;\n  }, {}));\n};\n\nvar errors = {\n  INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n  INVALID_NUMBER_OF_CONTENT_STEERING: 'INVALID_NUMBER_OF_CONTENT_STEERING',\n  DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n  DASH_INVALID_XML: 'DASH_INVALID_XML',\n  NO_BASE_URL: 'NO_BASE_URL',\n  MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n  SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n  UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n *   requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls,\n *   follows  RFC 2616, Clause 14.35.1\n * @return {SingleUri} full segment information transformed into a format similar\n *   to m3u8-parser\n */\n\nconst urlTypeToSegment = ({\n  baseUrl = '',\n  source = '',\n  range = '',\n  indexRange = ''\n}) => {\n  const segment = {\n    uri: source,\n    resolvedUri: resolveUrl(baseUrl || '', source)\n  };\n\n  if (range || indexRange) {\n    const rangeStr = range ? range : indexRange;\n    const ranges = rangeStr.split('-'); // default to parsing this as a BigInt if possible\n\n    let startRange = window.BigInt ? window.BigInt(ranges[0]) : parseInt(ranges[0], 10);\n    let endRange = window.BigInt ? window.BigInt(ranges[1]) : parseInt(ranges[1], 10); // convert back to a number if less than MAX_SAFE_INTEGER\n\n    if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === 'bigint') {\n      startRange = Number(startRange);\n    }\n\n    if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === 'bigint') {\n      endRange = Number(endRange);\n    }\n\n    let length;\n\n    if (typeof endRange === 'bigint' || typeof startRange === 'bigint') {\n      length = window.BigInt(endRange) - window.BigInt(startRange) + window.BigInt(1);\n    } else {\n      length = endRange - startRange + 1;\n    }\n\n    if (typeof length === 'bigint' && length < Number.MAX_SAFE_INTEGER) {\n      length = Number(length);\n    } // byterange should be inclusive according to\n    // RFC 2616, Clause 14.35.1\n\n\n    segment.byterange = {\n      length,\n      offset: startRange\n    };\n  }\n\n  return segment;\n};\nconst byteRangeToString = byterange => {\n  // `endRange` is one less than `offset + length` because the HTTP range\n  // header uses inclusive ranges\n  let endRange;\n\n  if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n    endRange = window.BigInt(byterange.offset) + window.BigInt(byterange.length) - window.BigInt(1);\n  } else {\n    endRange = byterange.offset + byterange.length - 1;\n  }\n\n  return `${byterange.offset}-${endRange}`;\n};\n\n/**\n * parse the end number attribue that can be a string\n * number, or undefined.\n *\n * @param {string|number|undefined} endNumber\n *        The end number attribute.\n *\n * @return {number|null}\n *          The result of parsing the end number.\n */\n\nconst parseEndNumber = endNumber => {\n  if (endNumber && typeof endNumber !== 'number') {\n    endNumber = parseInt(endNumber, 10);\n  }\n\n  if (isNaN(endNumber)) {\n    return null;\n  }\n\n  return endNumber;\n};\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\n\nconst segmentRange = {\n  /**\n   * Returns the entire range of available segments for a static MPD\n   *\n   * @param {Object} attributes\n   *        Inheritied MPD attributes\n   * @return {{ start: number, end: number }}\n   *         The start and end numbers for available segments\n   */\n  static(attributes) {\n    const {\n      duration,\n      timescale = 1,\n      sourceDuration,\n      periodDuration\n    } = attributes;\n    const endNumber = parseEndNumber(attributes.endNumber);\n    const segmentDuration = duration / timescale;\n\n    if (typeof endNumber === 'number') {\n      return {\n        start: 0,\n        end: endNumber\n      };\n    }\n\n    if (typeof periodDuration === 'number') {\n      return {\n        start: 0,\n        end: periodDuration / segmentDuration\n      };\n    }\n\n    return {\n      start: 0,\n      end: sourceDuration / segmentDuration\n    };\n  },\n\n  /**\n   * Returns the current live window range of available segments for a dynamic MPD\n   *\n   * @param {Object} attributes\n   *        Inheritied MPD attributes\n   * @return {{ start: number, end: number }}\n   *         The start and end numbers for available segments\n   */\n  dynamic(attributes) {\n    const {\n      NOW,\n      clientOffset,\n      availabilityStartTime,\n      timescale = 1,\n      duration,\n      periodStart = 0,\n      minimumUpdatePeriod = 0,\n      timeShiftBufferDepth = Infinity\n    } = attributes;\n    const endNumber = parseEndNumber(attributes.endNumber); // clientOffset is passed in at the top level of mpd-parser and is an offset calculated\n    // after retrieving UTC server time.\n\n    const now = (NOW + clientOffset) / 1000; // WC stands for Wall Clock.\n    // Convert the period start time to EPOCH.\n\n    const periodStartWC = availabilityStartTime + periodStart; // Period end in EPOCH is manifest's retrieval time + time until next update.\n\n    const periodEndWC = now + minimumUpdatePeriod;\n    const periodDuration = periodEndWC - periodStartWC;\n    const segmentCount = Math.ceil(periodDuration * timescale / duration);\n    const availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n    const availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n    return {\n      start: Math.max(0, availableStart),\n      end: typeof endNumber === 'number' ? endNumber : Math.min(segmentCount, availableEnd)\n    };\n  }\n\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n *        Number of the segment\n * @param {number} index\n *        Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n *         Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n *        Inherited MPD attributes\n * @return {toSegmentsCallback}\n *         Callback map function\n */\n\nconst toSegments = attributes => number => {\n  const {\n    duration,\n    timescale = 1,\n    periodStart,\n    startNumber = 1\n  } = attributes;\n  return {\n    number: startNumber + number,\n    duration: duration / timescale,\n    timeline: periodStart,\n    time: number * duration\n  };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n *        Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\nconst parseByDuration = attributes => {\n  const {\n    type,\n    duration,\n    timescale = 1,\n    periodDuration,\n    sourceDuration\n  } = attributes;\n  const {\n    start,\n    end\n  } = segmentRange[type](attributes);\n  const segments = range(start, end).map(toSegments(attributes));\n\n  if (type === 'static') {\n    const index = segments.length - 1; // section is either a period or the full source\n\n    const sectionDuration = typeof periodDuration === 'number' ? periodDuration : sourceDuration; // final segment may be less than full segment duration\n\n    segments[index].duration = sectionDuration - duration / timescale * index;\n  }\n\n  return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes.  Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @return {Object.<Array>} list of segments\n */\n\nconst segmentsFromBase = attributes => {\n  const {\n    baseUrl,\n    initialization = {},\n    sourceDuration,\n    indexRange = '',\n    periodStart,\n    presentationTime,\n    number = 0,\n    duration\n  } = attributes; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n  if (!baseUrl) {\n    throw new Error(errors.NO_BASE_URL);\n  }\n\n  const initSegment = urlTypeToSegment({\n    baseUrl,\n    source: initialization.sourceURL,\n    range: initialization.range\n  });\n  const segment = urlTypeToSegment({\n    baseUrl,\n    source: baseUrl,\n    indexRange\n  });\n  segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n  // (since SegmentBase is only for one total segment)\n\n  if (duration) {\n    const segmentTimeInfo = parseByDuration(attributes);\n\n    if (segmentTimeInfo.length) {\n      segment.duration = segmentTimeInfo[0].duration;\n      segment.timeline = segmentTimeInfo[0].timeline;\n    }\n  } else if (sourceDuration) {\n    segment.duration = sourceDuration;\n    segment.timeline = periodStart;\n  } // If presentation time is provided, these segments are being generated by SIDX\n  // references, and should use the time provided. For the general case of SegmentBase,\n  // there should only be one segment in the period, so its presentation time is the same\n  // as its period start.\n\n\n  segment.presentationTime = presentationTime || periodStart;\n  segment.number = number;\n  return [segment];\n};\n/**\n * Given a playlist, a sidx box, and a baseUrl, update the segment list of the playlist\n * according to the sidx information given.\n *\n * playlist.sidx has metadadata about the sidx where-as the sidx param\n * is the parsed sidx box itself.\n *\n * @param {Object} playlist the playlist to update the sidx information for\n * @param {Object} sidx the parsed sidx box\n * @return {Object} the playlist object with the updated sidx information\n */\n\nconst addSidxSegmentsToPlaylist$1 = (playlist, sidx, baseUrl) => {\n  // Retain init segment information\n  const initSegment = playlist.sidx.map ? playlist.sidx.map : null; // Retain source duration from initial main manifest parsing\n\n  const sourceDuration = playlist.sidx.duration; // Retain source timeline\n\n  const timeline = playlist.timeline || 0;\n  const sidxByteRange = playlist.sidx.byterange;\n  const sidxEnd = sidxByteRange.offset + sidxByteRange.length; // Retain timescale of the parsed sidx\n\n  const timescale = sidx.timescale; // referenceType 1 refers to other sidx boxes\n\n  const mediaReferences = sidx.references.filter(r => r.referenceType !== 1);\n  const segments = [];\n  const type = playlist.endList ? 'static' : 'dynamic';\n  const periodStart = playlist.sidx.timeline;\n  let presentationTime = periodStart;\n  let number = playlist.mediaSequence || 0; // firstOffset is the offset from the end of the sidx box\n\n  let startIndex; // eslint-disable-next-line\n\n  if (typeof sidx.firstOffset === 'bigint') {\n    startIndex = window.BigInt(sidxEnd) + sidx.firstOffset;\n  } else {\n    startIndex = sidxEnd + sidx.firstOffset;\n  }\n\n  for (let i = 0; i < mediaReferences.length; i++) {\n    const reference = sidx.references[i]; // size of the referenced (sub)segment\n\n    const size = reference.referencedSize; // duration of the referenced (sub)segment, in  the  timescale\n    // this will be converted to seconds when generating segments\n\n    const duration = reference.subsegmentDuration; // should be an inclusive range\n\n    let endIndex; // eslint-disable-next-line\n\n    if (typeof startIndex === 'bigint') {\n      endIndex = startIndex + window.BigInt(size) - window.BigInt(1);\n    } else {\n      endIndex = startIndex + size - 1;\n    }\n\n    const indexRange = `${startIndex}-${endIndex}`;\n    const attributes = {\n      baseUrl,\n      timescale,\n      timeline,\n      periodStart,\n      presentationTime,\n      number,\n      duration,\n      sourceDuration,\n      indexRange,\n      type\n    };\n    const segment = segmentsFromBase(attributes)[0];\n\n    if (initSegment) {\n      segment.map = initSegment;\n    }\n\n    segments.push(segment);\n\n    if (typeof startIndex === 'bigint') {\n      startIndex += window.BigInt(size);\n    } else {\n      startIndex += size;\n    }\n\n    presentationTime += duration / timescale;\n    number++;\n  }\n\n  playlist.segments = segments;\n  return playlist;\n};\n\nconst SUPPORTED_MEDIA_TYPES = ['AUDIO', 'SUBTITLES']; // allow one 60fps frame as leniency (arbitrarily chosen)\n\nconst TIME_FUDGE = 1 / 60;\n/**\n * Given a list of timelineStarts, combines, dedupes, and sorts them.\n *\n * @param {TimelineStart[]} timelineStarts - list of timeline starts\n *\n * @return {TimelineStart[]} the combined and deduped timeline starts\n */\n\nconst getUniqueTimelineStarts = timelineStarts => {\n  return union(timelineStarts, ({\n    timeline\n  }) => timeline).sort((a, b) => a.timeline > b.timeline ? 1 : -1);\n};\n/**\n * Finds the playlist with the matching NAME attribute.\n *\n * @param {Array} playlists - playlists to search through\n * @param {string} name - the NAME attribute to search for\n *\n * @return {Object|null} the matching playlist object, or null\n */\n\nconst findPlaylistWithName = (playlists, name) => {\n  for (let i = 0; i < playlists.length; i++) {\n    if (playlists[i].attributes.NAME === name) {\n      return playlists[i];\n    }\n  }\n\n  return null;\n};\n/**\n * Gets a flattened array of media group playlists.\n *\n * @param {Object} manifest - the main manifest object\n *\n * @return {Array} the media group playlists\n */\n\nconst getMediaGroupPlaylists = manifest => {\n  let mediaGroupPlaylists = [];\n  forEachMediaGroup(manifest, SUPPORTED_MEDIA_TYPES, (properties, type, group, label) => {\n    mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);\n  });\n  return mediaGroupPlaylists;\n};\n/**\n * Updates the playlist's media sequence numbers.\n *\n * @param {Object} config - options object\n * @param {Object} config.playlist - the playlist to update\n * @param {number} config.mediaSequence - the mediaSequence number to start with\n */\n\nconst updateMediaSequenceForPlaylist = ({\n  playlist,\n  mediaSequence\n}) => {\n  playlist.mediaSequence = mediaSequence;\n  playlist.segments.forEach((segment, index) => {\n    segment.number = playlist.mediaSequence + index;\n  });\n};\n/**\n * Updates the media and discontinuity sequence numbers of newPlaylists given oldPlaylists\n * and a complete list of timeline starts.\n *\n * If no matching playlist is found, only the discontinuity sequence number of the playlist\n * will be updated.\n *\n * Since early available timelines are not supported, at least one segment must be present.\n *\n * @param {Object} config - options object\n * @param {Object[]} oldPlaylists - the old playlists to use as a reference\n * @param {Object[]} newPlaylists - the new playlists to update\n * @param {Object} timelineStarts - all timelineStarts seen in the stream to this point\n */\n\nconst updateSequenceNumbers = ({\n  oldPlaylists,\n  newPlaylists,\n  timelineStarts\n}) => {\n  newPlaylists.forEach(playlist => {\n    playlist.discontinuitySequence = timelineStarts.findIndex(function ({\n      timeline\n    }) {\n      return timeline === playlist.timeline;\n    }); // Playlists NAMEs come from DASH Representation IDs, which are mandatory\n    // (see ISO_23009-1-2012 5.3.5.2).\n    //\n    // If the same Representation existed in a prior Period, it will retain the same NAME.\n\n    const oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);\n\n    if (!oldPlaylist) {\n      // Since this is a new playlist, the media sequence values can start from 0 without\n      // consequence.\n      return;\n    } // TODO better support for live SIDX\n    //\n    // As of this writing, mpd-parser does not support multiperiod SIDX (in live or VOD).\n    // This is evident by a playlist only having a single SIDX reference. In a multiperiod\n    // playlist there would need to be multiple SIDX references. In addition, live SIDX is\n    // not supported when the SIDX properties change on refreshes.\n    //\n    // In the future, if support needs to be added, the merging logic here can be called\n    // after SIDX references are resolved. For now, exit early to prevent exceptions being\n    // thrown due to undefined references.\n\n\n    if (playlist.sidx) {\n      return;\n    } // Since we don't yet support early available timelines, we don't need to support\n    // playlists with no segments.\n\n\n    const firstNewSegment = playlist.segments[0];\n    const oldMatchingSegmentIndex = oldPlaylist.segments.findIndex(function (oldSegment) {\n      return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;\n    }); // No matching segment from the old playlist means the entire playlist was refreshed.\n    // In this case the media sequence should account for this update, and the new segments\n    // should be marked as discontinuous from the prior content, since the last prior\n    // timeline was removed.\n\n    if (oldMatchingSegmentIndex === -1) {\n      updateMediaSequenceForPlaylist({\n        playlist,\n        mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length\n      });\n      playlist.segments[0].discontinuity = true;\n      playlist.discontinuityStarts.unshift(0); // No matching segment does not necessarily mean there's missing content.\n      //\n      // If the new playlist's timeline is the same as the last seen segment's timeline,\n      // then a discontinuity can be added to identify that there's potentially missing\n      // content. If there's no missing content, the discontinuity should still be rather\n      // harmless. It's possible that if segment durations are accurate enough, that the\n      // existence of a gap can be determined using the presentation times and durations,\n      // but if the segment timing info is off, it may introduce more problems than simply\n      // adding the discontinuity.\n      //\n      // If the new playlist's timeline is different from the last seen segment's timeline,\n      // then a discontinuity can be added to identify that this is the first seen segment\n      // of a new timeline. However, the logic at the start of this function that\n      // determined the disconinuity sequence by timeline index is now off by one (the\n      // discontinuity of the newest timeline hasn't yet fallen off the manifest...since\n      // we added it), so the disconinuity sequence must be decremented.\n      //\n      // A period may also have a duration of zero, so the case of no segments is handled\n      // here even though we don't yet support early available periods.\n\n      if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {\n        playlist.discontinuitySequence--;\n      }\n\n      return;\n    } // If the first segment matched with a prior segment on a discontinuity (it's matching\n    // on the first segment of a period), then the discontinuitySequence shouldn't be the\n    // timeline's matching one, but instead should be the one prior, and the first segment\n    // of the new manifest should be marked with a discontinuity.\n    //\n    // The reason for this special case is that discontinuity sequence shows how many\n    // discontinuities have fallen off of the playlist, and discontinuities are marked on\n    // the first segment of a new \"timeline.\" Because of this, while DASH will retain that\n    // Period while the \"timeline\" exists, HLS keeps track of it via the discontinuity\n    // sequence, and that first segment is an indicator, but can be removed before that\n    // timeline is gone.\n\n\n    const oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];\n\n    if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {\n      firstNewSegment.discontinuity = true;\n      playlist.discontinuityStarts.unshift(0);\n      playlist.discontinuitySequence--;\n    }\n\n    updateMediaSequenceForPlaylist({\n      playlist,\n      mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number\n    });\n  });\n};\n/**\n * Given an old parsed manifest object and a new parsed manifest object, updates the\n * sequence and timing values within the new manifest to ensure that it lines up with the\n * old.\n *\n * @param {Array} oldManifest - the old main manifest object\n * @param {Array} newManifest - the new main manifest object\n *\n * @return {Object} the updated new manifest object\n */\n\nconst positionManifestOnTimeline = ({\n  oldManifest,\n  newManifest\n}) => {\n  // Starting from v4.1.2 of the IOP, section 4.4.3.3 states:\n  //\n  // \"MPD@availabilityStartTime and Period@start shall not be changed over MPD updates.\"\n  //\n  // This was added from https://github.com/Dash-Industry-Forum/DASH-IF-IOP/issues/160\n  //\n  // Because of this change, and the difficulty of supporting periods with changing start\n  // times, periods with changing start times are not supported. This makes the logic much\n  // simpler, since periods with the same start time can be considerred the same period\n  // across refreshes.\n  //\n  // To give an example as to the difficulty of handling periods where the start time may\n  // change, if a single period manifest is refreshed with another manifest with a single\n  // period, and both the start and end times are increased, then the only way to determine\n  // if it's a new period or an old one that has changed is to look through the segments of\n  // each playlist and determine the presentation time bounds to find a match. In addition,\n  // if the period start changed to exceed the old period end, then there would be no\n  // match, and it would not be possible to determine whether the refreshed period is a new\n  // one or the old one.\n  const oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));\n  const newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest)); // Save all seen timelineStarts to the new manifest. Although this potentially means that\n  // there's a \"memory leak\" in that it will never stop growing, in reality, only a couple\n  // of properties are saved for each seen Period. Even long running live streams won't\n  // generate too many Periods, unless the stream is watched for decades. In the future,\n  // this can be optimized by mapping to discontinuity sequence numbers for each timeline,\n  // but it may not become an issue, and the additional info can be useful for debugging.\n\n  newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);\n  updateSequenceNumbers({\n    oldPlaylists,\n    newPlaylists,\n    timelineStarts: newManifest.timelineStarts\n  });\n  return newManifest;\n};\n\nconst generateSidxKey = sidx => sidx && sidx.uri + '-' + byteRangeToString(sidx.byterange);\n\nconst mergeDiscontiguousPlaylists = playlists => {\n  // Break out playlists into groups based on their baseUrl\n  const playlistsByBaseUrl = playlists.reduce(function (acc, cur) {\n    if (!acc[cur.attributes.baseUrl]) {\n      acc[cur.attributes.baseUrl] = [];\n    }\n\n    acc[cur.attributes.baseUrl].push(cur);\n    return acc;\n  }, {});\n  let allPlaylists = [];\n  Object.values(playlistsByBaseUrl).forEach(playlistGroup => {\n    const mergedPlaylists = values(playlistGroup.reduce((acc, playlist) => {\n      // assuming playlist IDs are the same across periods\n      // TODO: handle multiperiod where representation sets are not the same\n      // across periods\n      const name = playlist.attributes.id + (playlist.attributes.lang || '');\n\n      if (!acc[name]) {\n        // First Period\n        acc[name] = playlist;\n        acc[name].attributes.timelineStarts = [];\n      } else {\n        // Subsequent Periods\n        if (playlist.segments) {\n          // first segment of subsequent periods signal a discontinuity\n          if (playlist.segments[0]) {\n            playlist.segments[0].discontinuity = true;\n          }\n\n          acc[name].segments.push(...playlist.segments);\n        } // bubble up contentProtection, this assumes all DRM content\n        // has the same contentProtection\n\n\n        if (playlist.attributes.contentProtection) {\n          acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n        }\n      }\n\n      acc[name].attributes.timelineStarts.push({\n        // Although they represent the same number, it's important to have both to make it\n        // compatible with HLS potentially having a similar attribute.\n        start: playlist.attributes.periodStart,\n        timeline: playlist.attributes.periodStart\n      });\n      return acc;\n    }, {}));\n    allPlaylists = allPlaylists.concat(mergedPlaylists);\n  });\n  return allPlaylists.map(playlist => {\n    playlist.discontinuityStarts = findIndexes(playlist.segments || [], 'discontinuity');\n    return playlist;\n  });\n};\n\nconst addSidxSegmentsToPlaylist = (playlist, sidxMapping) => {\n  const sidxKey = generateSidxKey(playlist.sidx);\n  const sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;\n\n  if (sidxMatch) {\n    addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);\n  }\n\n  return playlist;\n};\nconst addSidxSegmentsToPlaylists = (playlists, sidxMapping = {}) => {\n  if (!Object.keys(sidxMapping).length) {\n    return playlists;\n  }\n\n  for (const i in playlists) {\n    playlists[i] = addSidxSegmentsToPlaylist(playlists[i], sidxMapping);\n  }\n\n  return playlists;\n};\nconst formatAudioPlaylist = ({\n  attributes,\n  segments,\n  sidx,\n  mediaSequence,\n  discontinuitySequence,\n  discontinuityStarts\n}, isAudioOnly) => {\n  const playlist = {\n    attributes: {\n      NAME: attributes.id,\n      BANDWIDTH: attributes.bandwidth,\n      CODECS: attributes.codecs,\n      ['PROGRAM-ID']: 1\n    },\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: attributes.baseUrl || '',\n    targetDuration: attributes.duration,\n    discontinuitySequence,\n    discontinuityStarts,\n    timelineStarts: attributes.timelineStarts,\n    mediaSequence,\n    segments\n  };\n\n  if (attributes.contentProtection) {\n    playlist.contentProtection = attributes.contentProtection;\n  }\n\n  if (attributes.serviceLocation) {\n    playlist.attributes.serviceLocation = attributes.serviceLocation;\n  }\n\n  if (sidx) {\n    playlist.sidx = sidx;\n  }\n\n  if (isAudioOnly) {\n    playlist.attributes.AUDIO = 'audio';\n    playlist.attributes.SUBTITLES = 'subs';\n  }\n\n  return playlist;\n};\nconst formatVttPlaylist = ({\n  attributes,\n  segments,\n  mediaSequence,\n  discontinuityStarts,\n  discontinuitySequence\n}) => {\n  if (typeof segments === 'undefined') {\n    // vtt tracks may use single file in BaseURL\n    segments = [{\n      uri: attributes.baseUrl,\n      timeline: attributes.periodStart,\n      resolvedUri: attributes.baseUrl || '',\n      duration: attributes.sourceDuration,\n      number: 0\n    }]; // targetDuration should be the same duration as the only segment\n\n    attributes.duration = attributes.sourceDuration;\n  }\n\n  const m3u8Attributes = {\n    NAME: attributes.id,\n    BANDWIDTH: attributes.bandwidth,\n    ['PROGRAM-ID']: 1\n  };\n\n  if (attributes.codecs) {\n    m3u8Attributes.CODECS = attributes.codecs;\n  }\n\n  const vttPlaylist = {\n    attributes: m3u8Attributes,\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: attributes.baseUrl || '',\n    targetDuration: attributes.duration,\n    timelineStarts: attributes.timelineStarts,\n    discontinuityStarts,\n    discontinuitySequence,\n    mediaSequence,\n    segments\n  };\n\n  if (attributes.serviceLocation) {\n    vttPlaylist.attributes.serviceLocation = attributes.serviceLocation;\n  }\n\n  return vttPlaylist;\n};\nconst organizeAudioPlaylists = (playlists, sidxMapping = {}, isAudioOnly = false) => {\n  let mainPlaylist;\n  const formattedPlaylists = playlists.reduce((a, playlist) => {\n    const role = playlist.attributes.role && playlist.attributes.role.value || '';\n    const language = playlist.attributes.lang || '';\n    let label = playlist.attributes.label || 'main';\n\n    if (language && !playlist.attributes.label) {\n      const roleLabel = role ? ` (${role})` : '';\n      label = `${playlist.attributes.lang}${roleLabel}`;\n    }\n\n    if (!a[label]) {\n      a[label] = {\n        language,\n        autoselect: true,\n        default: role === 'main',\n        playlists: [],\n        uri: ''\n      };\n    }\n\n    const formatted = addSidxSegmentsToPlaylist(formatAudioPlaylist(playlist, isAudioOnly), sidxMapping);\n    a[label].playlists.push(formatted);\n\n    if (typeof mainPlaylist === 'undefined' && role === 'main') {\n      mainPlaylist = playlist;\n      mainPlaylist.default = true;\n    }\n\n    return a;\n  }, {}); // if no playlists have role \"main\", mark the first as main\n\n  if (!mainPlaylist) {\n    const firstLabel = Object.keys(formattedPlaylists)[0];\n    formattedPlaylists[firstLabel].default = true;\n  }\n\n  return formattedPlaylists;\n};\nconst organizeVttPlaylists = (playlists, sidxMapping = {}) => {\n  return playlists.reduce((a, playlist) => {\n    const label = playlist.attributes.label || playlist.attributes.lang || 'text';\n\n    if (!a[label]) {\n      a[label] = {\n        language: label,\n        default: false,\n        autoselect: false,\n        playlists: [],\n        uri: ''\n      };\n    }\n\n    a[label].playlists.push(addSidxSegmentsToPlaylist(formatVttPlaylist(playlist), sidxMapping));\n    return a;\n  }, {});\n};\n\nconst organizeCaptionServices = captionServices => captionServices.reduce((svcObj, svc) => {\n  if (!svc) {\n    return svcObj;\n  }\n\n  svc.forEach(service => {\n    const {\n      channel,\n      language\n    } = service;\n    svcObj[language] = {\n      autoselect: false,\n      default: false,\n      instreamId: channel,\n      language\n    };\n\n    if (service.hasOwnProperty('aspectRatio')) {\n      svcObj[language].aspectRatio = service.aspectRatio;\n    }\n\n    if (service.hasOwnProperty('easyReader')) {\n      svcObj[language].easyReader = service.easyReader;\n    }\n\n    if (service.hasOwnProperty('3D')) {\n      svcObj[language]['3D'] = service['3D'];\n    }\n  });\n  return svcObj;\n}, {});\n\nconst formatVideoPlaylist = ({\n  attributes,\n  segments,\n  sidx,\n  discontinuityStarts\n}) => {\n  const playlist = {\n    attributes: {\n      NAME: attributes.id,\n      AUDIO: 'audio',\n      SUBTITLES: 'subs',\n      RESOLUTION: {\n        width: attributes.width,\n        height: attributes.height\n      },\n      CODECS: attributes.codecs,\n      BANDWIDTH: attributes.bandwidth,\n      ['PROGRAM-ID']: 1\n    },\n    uri: '',\n    endList: attributes.type === 'static',\n    timeline: attributes.periodStart,\n    resolvedUri: attributes.baseUrl || '',\n    targetDuration: attributes.duration,\n    discontinuityStarts,\n    timelineStarts: attributes.timelineStarts,\n    segments\n  };\n\n  if (attributes.frameRate) {\n    playlist.attributes['FRAME-RATE'] = attributes.frameRate;\n  }\n\n  if (attributes.contentProtection) {\n    playlist.contentProtection = attributes.contentProtection;\n  }\n\n  if (attributes.serviceLocation) {\n    playlist.attributes.serviceLocation = attributes.serviceLocation;\n  }\n\n  if (sidx) {\n    playlist.sidx = sidx;\n  }\n\n  return playlist;\n};\n\nconst videoOnly = ({\n  attributes\n}) => attributes.mimeType === 'video/mp4' || attributes.mimeType === 'video/webm' || attributes.contentType === 'video';\n\nconst audioOnly = ({\n  attributes\n}) => attributes.mimeType === 'audio/mp4' || attributes.mimeType === 'audio/webm' || attributes.contentType === 'audio';\n\nconst vttOnly = ({\n  attributes\n}) => attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n/**\n * Contains start and timeline properties denoting a timeline start. For DASH, these will\n * be the same number.\n *\n * @typedef {Object} TimelineStart\n * @property {number} start - the start time of the timeline\n * @property {number} timeline - the timeline number\n */\n\n/**\n * Adds appropriate media and discontinuity sequence values to the segments and playlists.\n *\n * Throughout mpd-parser, the `number` attribute is used in relation to `startNumber`, a\n * DASH specific attribute used in constructing segment URI's from templates. However, from\n * an HLS perspective, the `number` attribute on a segment would be its `mediaSequence`\n * value, which should start at the original media sequence value (or 0) and increment by 1\n * for each segment thereafter. Since DASH's `startNumber` values are independent per\n * period, it doesn't make sense to use it for `number`. Instead, assume everything starts\n * from a 0 mediaSequence value and increment from there.\n *\n * Note that VHS currently doesn't use the `number` property, but it can be helpful for\n * debugging and making sense of the manifest.\n *\n * For live playlists, to account for values increasing in manifests when periods are\n * removed on refreshes, merging logic should be used to update the numbers to their\n * appropriate values (to ensure they're sequential and increasing).\n *\n * @param {Object[]} playlists - the playlists to update\n * @param {TimelineStart[]} timelineStarts - the timeline starts for the manifest\n */\n\n\nconst addMediaSequenceValues = (playlists, timelineStarts) => {\n  // increment all segments sequentially\n  playlists.forEach(playlist => {\n    playlist.mediaSequence = 0;\n    playlist.discontinuitySequence = timelineStarts.findIndex(function ({\n      timeline\n    }) {\n      return timeline === playlist.timeline;\n    });\n\n    if (!playlist.segments) {\n      return;\n    }\n\n    playlist.segments.forEach((segment, index) => {\n      segment.number = index;\n    });\n  });\n};\n/**\n * Given a media group object, flattens all playlists within the media group into a single\n * array.\n *\n * @param {Object} mediaGroupObject - the media group object\n *\n * @return {Object[]}\n *         The media group playlists\n */\n\nconst flattenMediaGroupPlaylists = mediaGroupObject => {\n  if (!mediaGroupObject) {\n    return [];\n  }\n\n  return Object.keys(mediaGroupObject).reduce((acc, label) => {\n    const labelContents = mediaGroupObject[label];\n    return acc.concat(labelContents.playlists);\n  }, []);\n};\nconst toM3u8 = ({\n  dashPlaylists,\n  locations,\n  contentSteering,\n  sidxMapping = {},\n  previousManifest,\n  eventStream\n}) => {\n  if (!dashPlaylists.length) {\n    return {};\n  } // grab all main manifest attributes\n\n\n  const {\n    sourceDuration: duration,\n    type,\n    suggestedPresentationDelay,\n    minimumUpdatePeriod\n  } = dashPlaylists[0].attributes;\n  const videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n  const audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n  const vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));\n  const captions = dashPlaylists.map(playlist => playlist.attributes.captionServices).filter(Boolean);\n  const manifest = {\n    allowCache: true,\n    discontinuityStarts: [],\n    segments: [],\n    endList: true,\n    mediaGroups: {\n      AUDIO: {},\n      VIDEO: {},\n      ['CLOSED-CAPTIONS']: {},\n      SUBTITLES: {}\n    },\n    uri: '',\n    duration,\n    playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)\n  };\n\n  if (minimumUpdatePeriod >= 0) {\n    manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000;\n  }\n\n  if (locations) {\n    manifest.locations = locations;\n  }\n\n  if (contentSteering) {\n    manifest.contentSteering = contentSteering;\n  }\n\n  if (type === 'dynamic') {\n    manifest.suggestedPresentationDelay = suggestedPresentationDelay;\n  }\n\n  if (eventStream && eventStream.length > 0) {\n    manifest.eventStream = eventStream;\n  }\n\n  const isAudioOnly = manifest.playlists.length === 0;\n  const organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly) : null;\n  const organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;\n  const formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));\n  const playlistTimelineStarts = formattedPlaylists.map(({\n    timelineStarts\n  }) => timelineStarts);\n  manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);\n  addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);\n\n  if (organizedAudioGroup) {\n    manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;\n  }\n\n  if (organizedVttGroup) {\n    manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;\n  }\n\n  if (captions.length) {\n    manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);\n  }\n\n  if (previousManifest) {\n    return positionManifestOnTimeline({\n      oldManifest: previousManifest,\n      newManifest: manifest\n    });\n  }\n\n  return manifest;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {number} time\n *        current time (typically the total time up until the final segment)\n * @param {number} duration\n *        duration property for the given <S />\n *\n * @return {number}\n *        R value to reach the end of the given period\n */\nconst getLiveRValue = (attributes, time, duration) => {\n  const {\n    NOW,\n    clientOffset,\n    availabilityStartTime,\n    timescale = 1,\n    periodStart = 0,\n    minimumUpdatePeriod = 0\n  } = attributes;\n  const now = (NOW + clientOffset) / 1000;\n  const periodStartWC = availabilityStartTime + periodStart;\n  const periodEndWC = now + minimumUpdatePeriod;\n  const periodDuration = periodEndWC - periodStartWC;\n  return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\n\nconst parseByTimeline = (attributes, segmentTimeline) => {\n  const {\n    type,\n    minimumUpdatePeriod = 0,\n    media = '',\n    sourceDuration,\n    timescale = 1,\n    startNumber = 1,\n    periodStart: timeline\n  } = attributes;\n  const segments = [];\n  let time = -1;\n\n  for (let sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n    const S = segmentTimeline[sIndex];\n    const duration = S.d;\n    const repeat = S.r || 0;\n    const segmentTime = S.t || 0;\n\n    if (time < 0) {\n      // first segment\n      time = segmentTime;\n    }\n\n    if (segmentTime && segmentTime > time) {\n      // discontinuity\n      // TODO: How to handle this type of discontinuity\n      // timeline++ here would treat it like HLS discontuity and content would\n      // get appended without gap\n      // E.G.\n      //  <S t=\"0\" d=\"1\" />\n      //  <S d=\"1\" />\n      //  <S d=\"1\" />\n      //  <S t=\"5\" d=\"1\" />\n      // would have $Time$ values of [0, 1, 2, 5]\n      // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n      // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n      // does the value of sourceDuration consider this when calculating arbitrary\n      // negative @r repeat value?\n      // E.G. Same elements as above with this added at the end\n      //  <S d=\"1\" r=\"-1\" />\n      //  with a sourceDuration of 10\n      // Would the 2 gaps be included in the time duration calculations resulting in\n      // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n      // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n      time = segmentTime;\n    }\n\n    let count;\n\n    if (repeat < 0) {\n      const nextS = sIndex + 1;\n\n      if (nextS === segmentTimeline.length) {\n        // last segment\n        if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n          count = getLiveRValue(attributes, time, duration);\n        } else {\n          // TODO: This may be incorrect depending on conclusion of TODO above\n          count = (sourceDuration * timescale - time) / duration;\n        }\n      } else {\n        count = (segmentTimeline[nextS].t - time) / duration;\n      }\n    } else {\n      count = repeat + 1;\n    }\n\n    const end = startNumber + segments.length + count;\n    let number = startNumber + segments.length;\n\n    while (number < end) {\n      segments.push({\n        number,\n        duration: duration / timescale,\n        time,\n        timeline\n      });\n      time += duration;\n      number++;\n    }\n  }\n\n  return segments;\n};\n\nconst identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n *        Entire match of identifier\n * @param {string} identifier\n *        Name of matched identifier\n * @param {string} format\n *        Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n *        Desired length of the replaced value. Values less than this width shall be left\n *        zero padded\n * @return {string}\n *         Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n *        Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n *        Value of the Representation@id attribute\n * @param {number} values.Number\n *        Number of the corresponding segment\n * @param {number} values.Bandwidth\n *        Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n *        Timestamp value of the corresponding segment\n * @return {replaceCallback}\n *         Callback to be used with String.prototype.replace to replace identifiers\n */\n\nconst identifierReplacement = values => (match, identifier, format, width) => {\n  if (match === '$$') {\n    // escape sequence\n    return '$';\n  }\n\n  if (typeof values[identifier] === 'undefined') {\n    return match;\n  }\n\n  const value = '' + values[identifier];\n\n  if (identifier === 'RepresentationID') {\n    // Format tag shall not be present with RepresentationID\n    return value;\n  }\n\n  if (!format) {\n    width = 1;\n  } else {\n    width = parseInt(width, 10);\n  }\n\n  if (value.length >= width) {\n    return value;\n  }\n\n  return `${new Array(width - value.length + 1).join('0')}${value}`;\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n *        Template string to construct url from\n * @param {Obect} values\n *        Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n *        Value of the Representation@id attribute\n * @param {number} values.Number\n *        Number of the corresponding segment\n * @param {number} values.Bandwidth\n *        Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n *        Timestamp value of the corresponding segment\n * @return {string}\n *         Segment url with identifiers replaced\n */\n\nconst constructTemplateUrl = (url, values) => url.replace(identifierPattern, identifierReplacement(values));\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n *         List of Objects with segment timing and duration info\n */\n\nconst parseTemplateInfo = (attributes, segmentTimeline) => {\n  if (!attributes.duration && !segmentTimeline) {\n    // if neither @duration or SegmentTimeline are present, then there shall be exactly\n    // one media segment\n    return [{\n      number: attributes.startNumber || 1,\n      duration: attributes.sourceDuration,\n      time: 0,\n      timeline: attributes.periodStart\n    }];\n  }\n\n  if (attributes.duration) {\n    return parseByDuration(attributes);\n  }\n\n  return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n *        Object containing all inherited attributes from parent elements with attribute\n *        names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {Object[]}\n *         List of segment objects\n */\n\nconst segmentsFromTemplate = (attributes, segmentTimeline) => {\n  const templateValues = {\n    RepresentationID: attributes.id,\n    Bandwidth: attributes.bandwidth || 0\n  };\n  const {\n    initialization = {\n      sourceURL: '',\n      range: ''\n    }\n  } = attributes;\n  const mapSegment = urlTypeToSegment({\n    baseUrl: attributes.baseUrl,\n    source: constructTemplateUrl(initialization.sourceURL, templateValues),\n    range: initialization.range\n  });\n  const segments = parseTemplateInfo(attributes, segmentTimeline);\n  return segments.map(segment => {\n    templateValues.Number = segment.number;\n    templateValues.Time = segment.time;\n    const uri = constructTemplateUrl(attributes.media || '', templateValues); // See DASH spec section 5.3.9.2.2\n    // - if timescale isn't present on any level, default to 1.\n\n    const timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n    const presentationTimeOffset = attributes.presentationTimeOffset || 0;\n    const presentationTime = // Even if the @t attribute is not specified for the segment, segment.time is\n    // calculated in mpd-parser prior to this, so it's assumed to be available.\n    attributes.periodStart + (segment.time - presentationTimeOffset) / timescale;\n    const map = {\n      uri,\n      timeline: segment.timeline,\n      duration: segment.duration,\n      resolvedUri: resolveUrl(attributes.baseUrl || '', uri),\n      map: mapSegment,\n      number: segment.number,\n      presentationTime\n    };\n    return map;\n  });\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @param {Object} segmentUrl\n *   <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nconst SegmentURLToSegmentObject = (attributes, segmentUrl) => {\n  const {\n    baseUrl,\n    initialization = {}\n  } = attributes;\n  const initSegment = urlTypeToSegment({\n    baseUrl,\n    source: initialization.sourceURL,\n    range: initialization.range\n  });\n  const segment = urlTypeToSegment({\n    baseUrl,\n    source: segmentUrl.media,\n    range: segmentUrl.mediaRange\n  });\n  segment.map = initSegment;\n  return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes.  Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n *   Object containing all inherited attributes from parent elements with attribute\n *   names as keys\n * @param {Object[]|undefined} segmentTimeline\n *        List of objects representing the attributes of each S element contained within\n *        the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nconst segmentsFromList = (attributes, segmentTimeline) => {\n  const {\n    duration,\n    segmentUrls = [],\n    periodStart\n  } = attributes; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n  // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n  if (!duration && !segmentTimeline || duration && segmentTimeline) {\n    throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);\n  }\n\n  const segmentUrlMap = segmentUrls.map(segmentUrlObject => SegmentURLToSegmentObject(attributes, segmentUrlObject));\n  let segmentTimeInfo;\n\n  if (duration) {\n    segmentTimeInfo = parseByDuration(attributes);\n  }\n\n  if (segmentTimeline) {\n    segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n  }\n\n  const segments = segmentTimeInfo.map((segmentTime, index) => {\n    if (segmentUrlMap[index]) {\n      const segment = segmentUrlMap[index]; // See DASH spec section 5.3.9.2.2\n      // - if timescale isn't present on any level, default to 1.\n\n      const timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n      const presentationTimeOffset = attributes.presentationTimeOffset || 0;\n      segment.timeline = segmentTime.timeline;\n      segment.duration = segmentTime.duration;\n      segment.number = segmentTime.number;\n      segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset) / timescale;\n      return segment;\n    } // Since we're mapping we should get rid of any blank segments (in case\n    // the given SegmentTimeline is handling for more elements than we have\n    // SegmentURLs for).\n\n  }).filter(segment => segment);\n  return segments;\n};\n\nconst generateSegments = ({\n  attributes,\n  segmentInfo\n}) => {\n  let segmentAttributes;\n  let segmentsFn;\n\n  if (segmentInfo.template) {\n    segmentsFn = segmentsFromTemplate;\n    segmentAttributes = merge(attributes, segmentInfo.template);\n  } else if (segmentInfo.base) {\n    segmentsFn = segmentsFromBase;\n    segmentAttributes = merge(attributes, segmentInfo.base);\n  } else if (segmentInfo.list) {\n    segmentsFn = segmentsFromList;\n    segmentAttributes = merge(attributes, segmentInfo.list);\n  }\n\n  const segmentsInfo = {\n    attributes\n  };\n\n  if (!segmentsFn) {\n    return segmentsInfo;\n  }\n\n  const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n  // must be in seconds. Since we've generated the segment list, we no longer need\n  // @duration to be in @timescale units, so we can convert it here.\n\n  if (segmentAttributes.duration) {\n    const {\n      duration,\n      timescale = 1\n    } = segmentAttributes;\n    segmentAttributes.duration = duration / timescale;\n  } else if (segments.length) {\n    // if there is no @duration attribute, use the largest segment duration as\n    // as target duration\n    segmentAttributes.duration = segments.reduce((max, segment) => {\n      return Math.max(max, Math.ceil(segment.duration));\n    }, 0);\n  } else {\n    segmentAttributes.duration = 0;\n  }\n\n  segmentsInfo.attributes = segmentAttributes;\n  segmentsInfo.segments = segments; // This is a sidx box without actual segment information\n\n  if (segmentInfo.base && segmentAttributes.indexRange) {\n    segmentsInfo.sidx = segments[0];\n    segmentsInfo.segments = [];\n  }\n\n  return segmentsInfo;\n};\nconst toPlaylists = representations => representations.map(generateSegments);\n\nconst findChildren = (element, name) => from(element.childNodes).filter(({\n  tagName\n}) => tagName === name);\nconst getContent = element => element.textContent.trim();\n\n/**\n * Converts the provided string that may contain a division operation to a number.\n *\n * @param {string} value - the provided string value\n *\n * @return {number} the parsed string value\n */\nconst parseDivisionValue = value => {\n  return parseFloat(value.split('/').reduce((prev, current) => prev / current));\n};\n\nconst parseDuration = str => {\n  const SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n  const SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n  const SECONDS_IN_DAY = 24 * 60 * 60;\n  const SECONDS_IN_HOUR = 60 * 60;\n  const SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n  const durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n  const match = durationRegex.exec(str);\n\n  if (!match) {\n    return 0;\n  }\n\n  const [year, month, day, hour, minute, second] = match.slice(1);\n  return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nconst parseDate = str => {\n  // Date format without timezone according to ISO 8601\n  // YYY-MM-DDThh:mm:ss.ssssss\n  const dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n  // expressed by ending with 'Z'\n\n  if (dateRegex.test(str)) {\n    str += 'Z';\n  }\n\n  return Date.parse(str);\n};\n\nconst parsers = {\n  /**\n   * Specifies the duration of the entire Media Presentation. Format is a duration string\n   * as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  mediaPresentationDuration(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the Segment availability start time for all Segments referred to in this\n   * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n   * time. Format is a date string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The date as seconds from unix epoch\n   */\n  availabilityStartTime(value) {\n    return parseDate(value) / 1000;\n  },\n\n  /**\n   * Specifies the smallest period between potential changes to the MPD. Format is a\n   * duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  minimumUpdatePeriod(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the suggested presentation delay. Format is a\n   * duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  suggestedPresentationDelay(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * specifices the type of mpd. Can be either \"static\" or \"dynamic\"\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   *\n   * @return {string}\n   *         The type as a string\n   */\n  type(value) {\n    return value;\n  },\n\n  /**\n   * Specifies the duration of the smallest time shifting buffer for any Representation\n   * in the MPD. Format is a duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  timeShiftBufferDepth(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n   * Format is a duration string as specified in ISO 8601\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The duration in seconds\n   */\n  start(value) {\n    return parseDuration(value);\n  },\n\n  /**\n   * Specifies the width of the visual presentation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed width\n   */\n  width(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the height of the visual presentation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed height\n   */\n  height(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the bitrate of the representation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed bandwidth\n   */\n  bandwidth(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the frame rate of the representation\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed frame rate\n   */\n  frameRate(value) {\n    return parseDivisionValue(value);\n  },\n\n  /**\n   * Specifies the number of the first Media Segment in this Representation in the Period\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed number\n   */\n  startNumber(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the timescale in units per seconds\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed timescale\n   */\n  timescale(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the presentationTimeOffset.\n   *\n   * @param {string} value\n   *        value of the attribute as a string\n   *\n   * @return {number}\n   *         The parsed presentationTimeOffset\n   */\n  presentationTimeOffset(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the constant approximate Segment duration\n   * NOTE: The <Period> element also contains an @duration attribute. This duration\n   *       specifies the duration of the Period. This attribute is currently not\n   *       supported by the rest of the parser, however we still check for it to prevent\n   *       errors.\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed duration\n   */\n  duration(value) {\n    const parsedValue = parseInt(value, 10);\n\n    if (isNaN(parsedValue)) {\n      return parseDuration(value);\n    }\n\n    return parsedValue;\n  },\n\n  /**\n   * Specifies the Segment duration, in units of the value of the @timescale.\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed duration\n   */\n  d(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the MPD start time, in @timescale units, the first Segment in the series\n   * starts relative to the beginning of the Period\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed time\n   */\n  t(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the repeat count of the number of following contiguous Segments with the\n   * same duration expressed by the value of @d\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {number}\n   *         The parsed number\n   */\n  r(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Specifies the presentationTime.\n   *\n   * @param {string} value\n   *        value of the attribute as a string\n   *\n   * @return {number}\n   *         The parsed presentationTime\n   */\n  presentationTime(value) {\n    return parseInt(value, 10);\n  },\n\n  /**\n   * Default parser for all other attributes. Acts as a no-op and just returns the value\n   * as a string\n   *\n   * @param {string} value\n   *        value of attribute as a string\n   * @return {string}\n   *         Unparsed value\n   */\n  DEFAULT(value) {\n    return value;\n  }\n\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n *        The node to parse attributes from\n * @return {Object}\n *         Object with all attributes of el parsed\n */\n\nconst parseAttributes = el => {\n  if (!(el && el.attributes)) {\n    return {};\n  }\n\n  return from(el.attributes).reduce((a, e) => {\n    const parseFn = parsers[e.name] || parsers.DEFAULT;\n    a[e.name] = parseFn(e.value);\n    return a;\n  }, {});\n};\n\nconst keySystemsMap = {\n  'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n  'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n  'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n  'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime',\n  // ISO_IEC 23009-1_2022 5.8.5.2.2 The mp4 Protection Scheme\n  'urn:mpeg:dash:mp4protection:2011': 'mp4protection'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {Object[]} references\n *        List of objects containing the reference URL as well as its attributes\n * @param {Node[]} baseUrlElements\n *        List of BaseURL nodes from the mpd\n * @return {Object[]}\n *         List of objects with resolved urls and attributes\n */\n\nconst buildBaseUrls = (references, baseUrlElements) => {\n  if (!baseUrlElements.length) {\n    return references;\n  }\n\n  return flatten(references.map(function (reference) {\n    return baseUrlElements.map(function (baseUrlElement) {\n      const initialBaseUrl = getContent(baseUrlElement);\n      const resolvedBaseUrl = resolveUrl(reference.baseUrl, initialBaseUrl);\n      const finalBaseUrl = merge(parseAttributes(baseUrlElement), {\n        baseUrl: resolvedBaseUrl\n      }); // If the URL is resolved, we want to get the serviceLocation from the reference\n      // assuming there is no serviceLocation on the initialBaseUrl\n\n      if (resolvedBaseUrl !== initialBaseUrl && !finalBaseUrl.serviceLocation && reference.serviceLocation) {\n        finalBaseUrl.serviceLocation = reference.serviceLocation;\n      }\n\n      return finalBaseUrl;\n    });\n  }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n *           Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} segmentTimeline\n *           Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n *           Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n *           Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n *        The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n *         The Segment information contained within the provided AdaptationSet\n */\n\nconst getSegmentInformation = adaptationSet => {\n  const segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n  const segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n  const segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(s => merge({\n    tag: 'SegmentURL'\n  }, parseAttributes(s)));\n  const segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n  const segmentTimelineParentNode = segmentList || segmentTemplate;\n  const segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n  const segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n  const segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n  // @initialization and an <Initialization> node.  @initialization can be templated,\n  // while the node can have a url and range specified.  If the <SegmentTemplate> has\n  // both @initialization and an <Initialization> subelement we opt to override with\n  // the node, as this interaction is not defined in the spec.\n\n  const template = segmentTemplate && parseAttributes(segmentTemplate);\n\n  if (template && segmentInitialization) {\n    template.initialization = segmentInitialization && parseAttributes(segmentInitialization);\n  } else if (template && template.initialization) {\n    // If it is @initialization we convert it to an object since this is the format that\n    // later functions will rely on for the initialization segment.  This is only valid\n    // for <SegmentTemplate>\n    template.initialization = {\n      sourceURL: template.initialization\n    };\n  }\n\n  const segmentInfo = {\n    template,\n    segmentTimeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(s => parseAttributes(s)),\n    list: segmentList && merge(parseAttributes(segmentList), {\n      segmentUrls,\n      initialization: parseAttributes(segmentInitialization)\n    }),\n    base: segmentBase && merge(parseAttributes(segmentBase), {\n      initialization: parseAttributes(segmentInitialization)\n    })\n  };\n  Object.keys(segmentInfo).forEach(key => {\n    if (!segmentInfo[key]) {\n      delete segmentInfo[key];\n    }\n  });\n  return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n *           Segment information for this Representation\n * @property {Object} attributes\n *           Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n *        Representation node from the mpd\n * @return {RepresentationInformation}\n *         Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n *        Contains attributes inherited by the AdaptationSet\n * @param {Object[]} adaptationSetBaseUrls\n *        List of objects containing resolved base URLs and attributes\n *        inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n *        Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n *         Callback map function\n */\n\nconst inheritBaseUrls = (adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) => representation => {\n  const repBaseUrlElements = findChildren(representation, 'BaseURL');\n  const repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n  const attributes = merge(adaptationSetAttributes, parseAttributes(representation));\n  const representationSegmentInfo = getSegmentInformation(representation);\n  return repBaseUrls.map(baseUrl => {\n    return {\n      segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n      attributes: merge(attributes, baseUrl)\n    };\n  });\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n *        Content protection nodes\n * @return {Object}\n *        Object containing pssh data by key system\n */\n\nconst generateKeySystemInformation = contentProtectionNodes => {\n  return contentProtectionNodes.reduce((acc, node) => {\n    const attributes = parseAttributes(node); // Although it could be argued that according to the UUID RFC spec the UUID string (a-f chars) should be generated\n    // as a lowercase string it also mentions it should be treated as case-insensitive on input. Since the key system\n    // UUIDs in the keySystemsMap are hardcoded as lowercase in the codebase there isn't any reason not to do\n    // .toLowerCase() on the input UUID string from the manifest (at least I could not think of one).\n\n    if (attributes.schemeIdUri) {\n      attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();\n    }\n\n    const keySystem = keySystemsMap[attributes.schemeIdUri];\n\n    if (keySystem) {\n      acc[keySystem] = {\n        attributes\n      };\n      const psshNode = findChildren(node, 'cenc:pssh')[0];\n\n      if (psshNode) {\n        const pssh = getContent(psshNode);\n        acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);\n      }\n    }\n\n    return acc;\n  }, {});\n}; // defined in ANSI_SCTE 214-1 2016\n\n\nconst parseCaptionServiceMetadata = service => {\n  // 608 captions\n  if (service.schemeIdUri === 'urn:scte:dash:cc:cea-608:2015') {\n    const values = typeof service.value !== 'string' ? [] : service.value.split(';');\n    return values.map(value => {\n      let channel;\n      let language; // default language to value\n\n      language = value;\n\n      if (/^CC\\d=/.test(value)) {\n        [channel, language] = value.split('=');\n      } else if (/^CC\\d$/.test(value)) {\n        channel = value;\n      }\n\n      return {\n        channel,\n        language\n      };\n    });\n  } else if (service.schemeIdUri === 'urn:scte:dash:cc:cea-708:2015') {\n    const values = typeof service.value !== 'string' ? [] : service.value.split(';');\n    return values.map(value => {\n      const flags = {\n        // service or channel number 1-63\n        'channel': undefined,\n        // language is a 3ALPHA per ISO 639.2/B\n        // field is required\n        'language': undefined,\n        // BIT 1/0 or ?\n        // default value is 1, meaning 16:9 aspect ratio, 0 is 4:3, ? is unknown\n        'aspectRatio': 1,\n        // BIT 1/0\n        // easy reader flag indicated the text is tailed to the needs of beginning readers\n        // default 0, or off\n        'easyReader': 0,\n        // BIT 1/0\n        // If 3d metadata is present (CEA-708.1) then 1\n        // default 0\n        '3D': 0\n      };\n\n      if (/=/.test(value)) {\n        const [channel, opts = ''] = value.split('=');\n        flags.channel = channel;\n        flags.language = value;\n        opts.split(',').forEach(opt => {\n          const [name, val] = opt.split(':');\n\n          if (name === 'lang') {\n            flags.language = val; // er for easyReadery\n          } else if (name === 'er') {\n            flags.easyReader = Number(val); // war for wide aspect ratio\n          } else if (name === 'war') {\n            flags.aspectRatio = Number(val);\n          } else if (name === '3D') {\n            flags['3D'] = Number(val);\n          }\n        });\n      } else {\n        flags.language = value;\n      }\n\n      if (flags.channel) {\n        flags.channel = 'SERVICE' + flags.channel;\n      }\n\n      return flags;\n    });\n  }\n};\n/**\n * A map callback that will parse all event stream data for a collection of periods\n * DASH ISO_IEC_23009 5.10.2.2\n * https://dashif-documents.azurewebsites.net/Events/master/event.html#mpd-event-timing\n *\n * @param {PeriodInformation} period object containing necessary period information\n * @return a collection of parsed eventstream event objects\n */\n\nconst toEventStream = period => {\n  // get and flatten all EventStreams tags and parse attributes and children\n  return flatten(findChildren(period.node, 'EventStream').map(eventStream => {\n    const eventStreamAttributes = parseAttributes(eventStream);\n    const schemeIdUri = eventStreamAttributes.schemeIdUri; // find all Events per EventStream tag and map to return objects\n\n    return findChildren(eventStream, 'Event').map(event => {\n      const eventAttributes = parseAttributes(event);\n      const presentationTime = eventAttributes.presentationTime || 0;\n      const timescale = eventStreamAttributes.timescale || 1;\n      const duration = eventAttributes.duration || 0;\n      const start = presentationTime / timescale + period.attributes.start;\n      return {\n        schemeIdUri,\n        value: eventStreamAttributes.value,\n        id: eventAttributes.id,\n        start,\n        end: start + duration / timescale,\n        messageData: getContent(event) || eventAttributes.messageData,\n        contentEncoding: eventStreamAttributes.contentEncoding,\n        presentationTimeOffset: eventStreamAttributes.presentationTimeOffset || 0\n      };\n    });\n  }));\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n *        AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n *         List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n *        Contains attributes inherited by the Period\n * @param {Object[]} periodBaseUrls\n *        Contains list of objects with resolved base urls and attributes\n *        inherited by the Period\n * @param {string[]} periodSegmentInfo\n *        Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n *         Callback map function\n */\n\nconst toRepresentations = (periodAttributes, periodBaseUrls, periodSegmentInfo) => adaptationSet => {\n  const adaptationSetAttributes = parseAttributes(adaptationSet);\n  const adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n  const role = findChildren(adaptationSet, 'Role')[0];\n  const roleAttributes = {\n    role: parseAttributes(role)\n  };\n  let attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n  const accessibility = findChildren(adaptationSet, 'Accessibility')[0];\n  const captionServices = parseCaptionServiceMetadata(parseAttributes(accessibility));\n\n  if (captionServices) {\n    attrs = merge(attrs, {\n      captionServices\n    });\n  }\n\n  const label = findChildren(adaptationSet, 'Label')[0];\n\n  if (label && label.childNodes.length) {\n    const labelVal = label.childNodes[0].nodeValue.trim();\n    attrs = merge(attrs, {\n      label: labelVal\n    });\n  }\n\n  const contentProtection = generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n  if (Object.keys(contentProtection).length) {\n    attrs = merge(attrs, {\n      contentProtection\n    });\n  }\n\n  const segmentInfo = getSegmentInformation(adaptationSet);\n  const representations = findChildren(adaptationSet, 'Representation');\n  const adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n  return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n};\n/**\n * Contains all period information for mapping nodes onto adaptation sets.\n *\n * @typedef {Object} PeriodInformation\n * @property {Node} period.node\n *           Period node from the mpd\n * @property {Object} period.attributes\n *           Parsed period attributes from node plus any added\n */\n\n/**\n * Maps a PeriodInformation object to a list of Representation information objects for all\n * AdaptationSet nodes contained within the Period.\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {PeriodInformation} period\n *        Period object containing necessary period information\n * @param {number} periodStart\n *        Start time of the Period within the mpd\n * @return {RepresentationInformation[]}\n *         List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n *        Contains attributes inherited by the mpd\n  * @param {Object[]} mpdBaseUrls\n *        Contains list of objects with resolved base urls and attributes\n *        inherited by the mpd\n * @return {toAdaptationSetsCallback}\n *         Callback map function\n */\n\nconst toAdaptationSets = (mpdAttributes, mpdBaseUrls) => (period, index) => {\n  const periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, 'BaseURL'));\n  const periodAttributes = merge(mpdAttributes, {\n    periodStart: period.attributes.start\n  });\n\n  if (typeof period.attributes.duration === 'number') {\n    periodAttributes.periodDuration = period.attributes.duration;\n  }\n\n  const adaptationSets = findChildren(period.node, 'AdaptationSet');\n  const periodSegmentInfo = getSegmentInformation(period.node);\n  return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n};\n/**\n * Tranforms an array of content steering nodes into an object\n * containing CDN content steering information from the MPD manifest.\n *\n * For more information on the DASH spec for Content Steering parsing, see:\n * https://dashif.org/docs/DASH-IF-CTS-00XX-Content-Steering-Community-Review.pdf\n *\n * @param {Node[]} contentSteeringNodes\n *        Content steering nodes\n * @param {Function} eventHandler\n *        The event handler passed into the parser options to handle warnings\n * @return {Object}\n *        Object containing content steering data\n */\n\nconst generateContentSteeringInformation = (contentSteeringNodes, eventHandler) => {\n  // If there are more than one ContentSteering tags, throw an error\n  if (contentSteeringNodes.length > 1) {\n    eventHandler({\n      type: 'warn',\n      message: 'The MPD manifest should contain no more than one ContentSteering tag'\n    });\n  } // Return a null value if there are no ContentSteering tags\n\n\n  if (!contentSteeringNodes.length) {\n    return null;\n  }\n\n  const infoFromContentSteeringTag = merge({\n    serverURL: getContent(contentSteeringNodes[0])\n  }, parseAttributes(contentSteeringNodes[0])); // Converts `queryBeforeStart` to a boolean, as well as setting the default value\n  // to `false` if it doesn't exist\n\n  infoFromContentSteeringTag.queryBeforeStart = infoFromContentSteeringTag.queryBeforeStart === 'true';\n  return infoFromContentSteeringTag;\n};\n/**\n * Gets Period@start property for a given period.\n *\n * @param {Object} options\n *        Options object\n * @param {Object} options.attributes\n *        Period attributes\n * @param {Object} [options.priorPeriodAttributes]\n *        Prior period attributes (if prior period is available)\n * @param {string} options.mpdType\n *        The MPD@type these periods came from\n * @return {number|null}\n *         The period start, or null if it's an early available period or error\n */\n\nconst getPeriodStart = ({\n  attributes,\n  priorPeriodAttributes,\n  mpdType\n}) => {\n  // Summary of period start time calculation from DASH spec section 5.3.2.1\n  //\n  // A period's start is the first period's start + time elapsed after playing all\n  // prior periods to this one. Periods continue one after the other in time (without\n  // gaps) until the end of the presentation.\n  //\n  // The value of Period@start should be:\n  // 1. if Period@start is present: value of Period@start\n  // 2. if previous period exists and it has @duration: previous Period@start +\n  //    previous Period@duration\n  // 3. if this is first period and MPD@type is 'static': 0\n  // 4. in all other cases, consider the period an \"early available period\" (note: not\n  //    currently supported)\n  // (1)\n  if (typeof attributes.start === 'number') {\n    return attributes.start;\n  } // (2)\n\n\n  if (priorPeriodAttributes && typeof priorPeriodAttributes.start === 'number' && typeof priorPeriodAttributes.duration === 'number') {\n    return priorPeriodAttributes.start + priorPeriodAttributes.duration;\n  } // (3)\n\n\n  if (!priorPeriodAttributes && mpdType === 'static') {\n    return 0;\n  } // (4)\n  // There is currently no logic for calculating the Period@start value if there is\n  // no Period@start or prior Period@start and Period@duration available. This is not made\n  // explicit by the DASH interop guidelines or the DASH spec, however, since there's\n  // nothing about any other resolution strategies, it's implied. Thus, this case should\n  // be considered an early available period, or error, and null should suffice for both\n  // of those cases.\n\n\n  return null;\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n *        The root node of the mpd\n * @param {Object} options\n *        Available options for inheritAttributes\n * @param {string} options.manifestUri\n *        The uri source of the mpd\n * @param {number} options.NOW\n *        Current time per DASH IOP.  Default is current time in ms since epoch\n * @param {number} options.clientOffset\n *        Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n *         List of objects containing Representation information\n */\n\nconst inheritAttributes = (mpd, options = {}) => {\n  const {\n    manifestUri = '',\n    NOW = Date.now(),\n    clientOffset = 0,\n    // TODO: For now, we are expecting an eventHandler callback function\n    // to be passed into the mpd parser as an option.\n    // In the future, we should enable stream parsing by using the Stream class from vhs-utils.\n    // This will support new features including a standardized event handler.\n    // See the m3u8 parser for examples of how stream parsing is currently used for HLS parsing.\n    // https://github.com/videojs/vhs-utils/blob/88d6e10c631e57a5af02c5a62bc7376cd456b4f5/src/stream.js#L9\n    eventHandler = function () {}\n  } = options;\n  const periodNodes = findChildren(mpd, 'Period');\n\n  if (!periodNodes.length) {\n    throw new Error(errors.INVALID_NUMBER_OF_PERIOD);\n  }\n\n  const locations = findChildren(mpd, 'Location');\n  const mpdAttributes = parseAttributes(mpd);\n  const mpdBaseUrls = buildBaseUrls([{\n    baseUrl: manifestUri\n  }], findChildren(mpd, 'BaseURL'));\n  const contentSteeringNodes = findChildren(mpd, 'ContentSteering'); // See DASH spec section 5.3.1.2, Semantics of MPD element. Default type to 'static'.\n\n  mpdAttributes.type = mpdAttributes.type || 'static';\n  mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n  mpdAttributes.NOW = NOW;\n  mpdAttributes.clientOffset = clientOffset;\n\n  if (locations.length) {\n    mpdAttributes.locations = locations.map(getContent);\n  }\n\n  const periods = []; // Since toAdaptationSets acts on individual periods right now, the simplest approach to\n  // adding properties that require looking at prior periods is to parse attributes and add\n  // missing ones before toAdaptationSets is called. If more such properties are added, it\n  // may be better to refactor toAdaptationSets.\n\n  periodNodes.forEach((node, index) => {\n    const attributes = parseAttributes(node); // Use the last modified prior period, as it may contain added information necessary\n    // for this period.\n\n    const priorPeriod = periods[index - 1];\n    attributes.start = getPeriodStart({\n      attributes,\n      priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,\n      mpdType: mpdAttributes.type\n    });\n    periods.push({\n      node,\n      attributes\n    });\n  });\n  return {\n    locations: mpdAttributes.locations,\n    contentSteeringInfo: generateContentSteeringInformation(contentSteeringNodes, eventHandler),\n    // TODO: There are occurences where this `representationInfo` array contains undesired\n    // duplicates. This generally occurs when there are multiple BaseURL nodes that are\n    // direct children of the MPD node. When we attempt to resolve URLs from a combination of the\n    // parent BaseURL and a child BaseURL, and the value does not resolve,\n    // we end up returning the child BaseURL multiple times.\n    // We need to determine a way to remove these duplicates in a safe way.\n    // See: https://github.com/videojs/mpd-parser/pull/17#discussion_r162750527\n    representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls))),\n    eventStream: flatten(periods.map(toEventStream))\n  };\n};\n\nconst stringToMpdXml = manifestString => {\n  if (manifestString === '') {\n    throw new Error(errors.DASH_EMPTY_MANIFEST);\n  }\n\n  const parser = new DOMParser();\n  let xml;\n  let mpd;\n\n  try {\n    xml = parser.parseFromString(manifestString, 'application/xml');\n    mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n  } catch (e) {// ie 11 throws on invalid xml\n  }\n\n  if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n    throw new Error(errors.DASH_INVALID_XML);\n  }\n\n  return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n *        XML string of the MPD manifest\n * @return {Object|null}\n *         Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nconst parseUTCTimingScheme = mpd => {\n  const UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n  if (!UTCTimingNode) {\n    return null;\n  }\n\n  const attributes = parseAttributes(UTCTimingNode);\n\n  switch (attributes.schemeIdUri) {\n    case 'urn:mpeg:dash:utc:http-head:2014':\n    case 'urn:mpeg:dash:utc:http-head:2012':\n      attributes.method = 'HEAD';\n      break;\n\n    case 'urn:mpeg:dash:utc:http-xsdate:2014':\n    case 'urn:mpeg:dash:utc:http-iso:2014':\n    case 'urn:mpeg:dash:utc:http-xsdate:2012':\n    case 'urn:mpeg:dash:utc:http-iso:2012':\n      attributes.method = 'GET';\n      break;\n\n    case 'urn:mpeg:dash:utc:direct:2014':\n    case 'urn:mpeg:dash:utc:direct:2012':\n      attributes.method = 'DIRECT';\n      attributes.value = Date.parse(attributes.value);\n      break;\n\n    case 'urn:mpeg:dash:utc:http-ntp:2014':\n    case 'urn:mpeg:dash:utc:ntp:2014':\n    case 'urn:mpeg:dash:utc:sntp:2014':\n    default:\n      throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n  }\n\n  return attributes;\n};\n\nconst VERSION = version;\n/*\n * Given a DASH manifest string and options, parses the DASH manifest into an object in the\n * form outputed by m3u8-parser and accepted by videojs/http-streaming.\n *\n * For live DASH manifests, if `previousManifest` is provided in options, then the newly\n * parsed DASH manifest will have its media sequence and discontinuity sequence values\n * updated to reflect its position relative to the prior manifest.\n *\n * @param {string} manifestString - the DASH manifest as a string\n * @param {options} [options] - any options\n *\n * @return {Object} the manifest object\n */\n\nconst parse = (manifestString, options = {}) => {\n  const parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options);\n  const playlists = toPlaylists(parsedManifestInfo.representationInfo);\n  return toM3u8({\n    dashPlaylists: playlists,\n    locations: parsedManifestInfo.locations,\n    contentSteering: parsedManifestInfo.contentSteeringInfo,\n    sidxMapping: options.sidxMapping,\n    previousManifest: options.previousManifest,\n    eventStream: parsedManifestInfo.eventStream\n  });\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n *        XML string of the MPD manifest\n * @return {Object|null}\n *         Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\n\nconst parseUTCTiming = manifestString => parseUTCTimingScheme(stringToMpdXml(manifestString));\n\nexport { VERSION, addSidxSegmentsToPlaylist$1 as addSidxSegmentsToPlaylist, generateSidxKey, inheritAttributes, parse, parseUTCTiming, stringToMpdXml, toM3u8, toPlaylists };\n","/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n *        The parsed master manifest object\n * @param {string[]} groups\n *        The media groups to call the callback for\n * @param {Function} callback\n *        Callback to call for each media group\n */\nexport var forEachMediaGroup = function forEachMediaGroup(master, groups, callback) {\n  groups.forEach(function (mediaType) {\n    for (var groupKey in master.mediaGroups[mediaType]) {\n      for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n        var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n        callback(mediaProperties, mediaType, groupKey, labelKey);\n      }\n    }\n  });\n};","import window from 'global/window';\n\nvar atob = function atob(s) {\n  return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nexport default function decodeB64ToUint8Array(b64Text) {\n  var decodedString = atob(b64Text);\n  var array = new Uint8Array(decodedString.length);\n\n  for (var i = 0; i < decodedString.length; i++) {\n    array[i] = decodedString.charCodeAt(i);\n  }\n\n  return array;\n}","import { stringToBytes, toUint8, bytesMatch, bytesToString, toHexString, padStart, bytesToNumber } from './byte-helpers.js';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js';\nimport { parseOpusHead } from './opus-helpers.js';\n\nvar normalizePath = function normalizePath(path) {\n  if (typeof path === 'string') {\n    return stringToBytes(path);\n  }\n\n  if (typeof path === 'number') {\n    return path;\n  }\n\n  return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n  if (!Array.isArray(paths)) {\n    return [normalizePath(paths)];\n  }\n\n  return paths.map(function (p) {\n    return normalizePath(p);\n  });\n};\n\nvar DESCRIPTORS;\nexport var parseDescriptors = function parseDescriptors(bytes) {\n  bytes = toUint8(bytes);\n  var results = [];\n  var i = 0;\n\n  while (bytes.length > i) {\n    var tag = bytes[i];\n    var size = 0;\n    var headerSize = 0; // tag\n\n    headerSize++;\n    var byte = bytes[headerSize]; // first byte\n\n    headerSize++;\n\n    while (byte & 0x80) {\n      size = (byte & 0x7F) << 7;\n      byte = bytes[headerSize];\n      headerSize++;\n    }\n\n    size += byte & 0x7F;\n\n    for (var z = 0; z < DESCRIPTORS.length; z++) {\n      var _DESCRIPTORS$z = DESCRIPTORS[z],\n          id = _DESCRIPTORS$z.id,\n          parser = _DESCRIPTORS$z.parser;\n\n      if (tag === id) {\n        results.push(parser(bytes.subarray(headerSize, headerSize + size)));\n        break;\n      }\n    }\n\n    i += size + headerSize;\n  }\n\n  return results;\n};\nDESCRIPTORS = [{\n  id: 0x03,\n  parser: function parser(bytes) {\n    var desc = {\n      tag: 0x03,\n      id: bytes[0] << 8 | bytes[1],\n      flags: bytes[2],\n      size: 3,\n      dependsOnEsId: 0,\n      ocrEsId: 0,\n      descriptors: [],\n      url: ''\n    }; // depends on es id\n\n    if (desc.flags & 0x80) {\n      desc.dependsOnEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n      desc.size += 2;\n    } // url\n\n\n    if (desc.flags & 0x40) {\n      var len = bytes[desc.size];\n      desc.url = bytesToString(bytes.subarray(desc.size + 1, desc.size + 1 + len));\n      desc.size += len;\n    } // ocr es id\n\n\n    if (desc.flags & 0x20) {\n      desc.ocrEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n      desc.size += 2;\n    }\n\n    desc.descriptors = parseDescriptors(bytes.subarray(desc.size)) || [];\n    return desc;\n  }\n}, {\n  id: 0x04,\n  parser: function parser(bytes) {\n    // DecoderConfigDescriptor\n    var desc = {\n      tag: 0x04,\n      oti: bytes[0],\n      streamType: bytes[1],\n      bufferSize: bytes[2] << 16 | bytes[3] << 8 | bytes[4],\n      maxBitrate: bytes[5] << 24 | bytes[6] << 16 | bytes[7] << 8 | bytes[8],\n      avgBitrate: bytes[9] << 24 | bytes[10] << 16 | bytes[11] << 8 | bytes[12],\n      descriptors: parseDescriptors(bytes.subarray(13))\n    };\n    return desc;\n  }\n}, {\n  id: 0x05,\n  parser: function parser(bytes) {\n    // DecoderSpecificInfo\n    return {\n      tag: 0x05,\n      bytes: bytes\n    };\n  }\n}, {\n  id: 0x06,\n  parser: function parser(bytes) {\n    // SLConfigDescriptor\n    return {\n      tag: 0x06,\n      bytes: bytes\n    };\n  }\n}];\n/**\n * find any number of boxes by name given a path to it in an iso bmff\n * such as mp4.\n *\n * @param {TypedArray} bytes\n *        bytes for the iso bmff to search for boxes in\n *\n * @param {Uint8Array[]|string[]|string|Uint8Array} name\n *        An array of paths or a single path representing the name\n *        of boxes to search through in bytes. Paths may be\n *        uint8 (character codes) or strings.\n *\n * @param {boolean} [complete=false]\n *        Should we search only for complete boxes on the final path.\n *        This is very useful when you do not want to get back partial boxes\n *        in the case of streaming files.\n *\n * @return {Uint8Array[]}\n *         An array of the end paths that we found.\n */\n\nexport var findBox = function findBox(bytes, paths, complete) {\n  if (complete === void 0) {\n    complete = false;\n  }\n\n  paths = normalizePaths(paths);\n  bytes = toUint8(bytes);\n  var results = [];\n\n  if (!paths.length) {\n    // short-circuit the search for empty paths\n    return results;\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    var size = (bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]) >>> 0;\n    var type = bytes.subarray(i + 4, i + 8); // invalid box format.\n\n    if (size === 0) {\n      break;\n    }\n\n    var end = i + size;\n\n    if (end > bytes.length) {\n      // this box is bigger than the number of bytes we have\n      // and complete is set, we cannot find any more boxes.\n      if (complete) {\n        break;\n      }\n\n      end = bytes.length;\n    }\n\n    var data = bytes.subarray(i + 8, end);\n\n    if (bytesMatch(type, paths[0])) {\n      if (paths.length === 1) {\n        // this is the end of the path and we've found the box we were\n        // looking for\n        results.push(data);\n      } else {\n        // recursively search for the next box along the path\n        results.push.apply(results, findBox(data, paths.slice(1), complete));\n      }\n    }\n\n    i = end;\n  } // we've finished searching all of bytes\n\n\n  return results;\n};\n/**\n * Search for a single matching box by name in an iso bmff format like\n * mp4. This function is useful for finding codec boxes which\n * can be placed arbitrarily in sample descriptions depending\n * on the version of the file or file type.\n *\n * @param {TypedArray} bytes\n *        bytes for the iso bmff to search for boxes in\n *\n * @param {string|Uint8Array} name\n *        The name of the box to find.\n *\n * @return {Uint8Array[]}\n *         a subarray of bytes representing the name boxed we found.\n */\n\nexport var findNamedBox = function findNamedBox(bytes, name) {\n  name = normalizePath(name);\n\n  if (!name.length) {\n    // short-circuit the search for empty paths\n    return bytes.subarray(bytes.length);\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    if (bytesMatch(bytes.subarray(i, i + name.length), name)) {\n      var size = (bytes[i - 4] << 24 | bytes[i - 3] << 16 | bytes[i - 2] << 8 | bytes[i - 1]) >>> 0;\n      var end = size > 1 ? i + size : bytes.byteLength;\n      return bytes.subarray(i + 4, end);\n    }\n\n    i++;\n  } // we've finished searching all of bytes\n\n\n  return bytes.subarray(bytes.length);\n};\n\nvar parseSamples = function parseSamples(data, entrySize, parseEntry) {\n  if (entrySize === void 0) {\n    entrySize = 4;\n  }\n\n  if (parseEntry === void 0) {\n    parseEntry = function parseEntry(d) {\n      return bytesToNumber(d);\n    };\n  }\n\n  var entries = [];\n\n  if (!data || !data.length) {\n    return entries;\n  }\n\n  var entryCount = bytesToNumber(data.subarray(4, 8));\n\n  for (var i = 8; entryCount; i += entrySize, entryCount--) {\n    entries.push(parseEntry(data.subarray(i, i + entrySize)));\n  }\n\n  return entries;\n};\n\nexport var buildFrameTable = function buildFrameTable(stbl, timescale) {\n  var keySamples = parseSamples(findBox(stbl, ['stss'])[0]);\n  var chunkOffsets = parseSamples(findBox(stbl, ['stco'])[0]);\n  var timeToSamples = parseSamples(findBox(stbl, ['stts'])[0], 8, function (entry) {\n    return {\n      sampleCount: bytesToNumber(entry.subarray(0, 4)),\n      sampleDelta: bytesToNumber(entry.subarray(4, 8))\n    };\n  });\n  var samplesToChunks = parseSamples(findBox(stbl, ['stsc'])[0], 12, function (entry) {\n    return {\n      firstChunk: bytesToNumber(entry.subarray(0, 4)),\n      samplesPerChunk: bytesToNumber(entry.subarray(4, 8)),\n      sampleDescriptionIndex: bytesToNumber(entry.subarray(8, 12))\n    };\n  });\n  var stsz = findBox(stbl, ['stsz'])[0]; // stsz starts with a 4 byte sampleSize which we don't need\n\n  var sampleSizes = parseSamples(stsz && stsz.length && stsz.subarray(4) || null);\n  var frames = [];\n\n  for (var chunkIndex = 0; chunkIndex < chunkOffsets.length; chunkIndex++) {\n    var samplesInChunk = void 0;\n\n    for (var i = 0; i < samplesToChunks.length; i++) {\n      var sampleToChunk = samplesToChunks[i];\n      var isThisOne = chunkIndex + 1 >= sampleToChunk.firstChunk && (i + 1 >= samplesToChunks.length || chunkIndex + 1 < samplesToChunks[i + 1].firstChunk);\n\n      if (isThisOne) {\n        samplesInChunk = sampleToChunk.samplesPerChunk;\n        break;\n      }\n    }\n\n    var chunkOffset = chunkOffsets[chunkIndex];\n\n    for (var _i = 0; _i < samplesInChunk; _i++) {\n      var frameEnd = sampleSizes[frames.length]; // if we don't have key samples every frame is a keyframe\n\n      var keyframe = !keySamples.length;\n\n      if (keySamples.length && keySamples.indexOf(frames.length + 1) !== -1) {\n        keyframe = true;\n      }\n\n      var frame = {\n        keyframe: keyframe,\n        start: chunkOffset,\n        end: chunkOffset + frameEnd\n      };\n\n      for (var k = 0; k < timeToSamples.length; k++) {\n        var _timeToSamples$k = timeToSamples[k],\n            sampleCount = _timeToSamples$k.sampleCount,\n            sampleDelta = _timeToSamples$k.sampleDelta;\n\n        if (frames.length <= sampleCount) {\n          // ms to ns\n          var lastTimestamp = frames.length ? frames[frames.length - 1].timestamp : 0;\n          frame.timestamp = lastTimestamp + sampleDelta / timescale * 1000;\n          frame.duration = sampleDelta;\n          break;\n        }\n      }\n\n      frames.push(frame);\n      chunkOffset += frameEnd;\n    }\n  }\n\n  return frames;\n};\nexport var addSampleDescription = function addSampleDescription(track, bytes) {\n  var codec = bytesToString(bytes.subarray(0, 4));\n\n  if (track.type === 'video') {\n    track.info = track.info || {};\n    track.info.width = bytes[28] << 8 | bytes[29];\n    track.info.height = bytes[30] << 8 | bytes[31];\n  } else if (track.type === 'audio') {\n    track.info = track.info || {};\n    track.info.channels = bytes[20] << 8 | bytes[21];\n    track.info.bitDepth = bytes[22] << 8 | bytes[23];\n    track.info.sampleRate = bytes[28] << 8 | bytes[29];\n  }\n\n  if (codec === 'avc1') {\n    var avcC = findNamedBox(bytes, 'avcC'); // AVCDecoderConfigurationRecord\n\n    codec += \".\" + getAvcCodec(avcC);\n    track.info.avcC = avcC; // TODO: do we need to parse all this?\n\n    /* {\n      configurationVersion: avcC[0],\n      profile: avcC[1],\n      profileCompatibility: avcC[2],\n      level: avcC[3],\n      lengthSizeMinusOne: avcC[4] & 0x3\n    };\n     let spsNalUnitCount = avcC[5] & 0x1F;\n    const spsNalUnits = track.info.avc.spsNalUnits = [];\n     // past spsNalUnitCount\n    let offset = 6;\n     while (spsNalUnitCount--) {\n      const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n       spsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n       offset += nalLen + 2;\n    }\n    let ppsNalUnitCount = avcC[offset];\n    const ppsNalUnits = track.info.avc.ppsNalUnits = [];\n     // past ppsNalUnitCount\n    offset += 1;\n     while (ppsNalUnitCount--) {\n      const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n       ppsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n       offset += nalLen + 2;\n    }*/\n    // HEVCDecoderConfigurationRecord\n  } else if (codec === 'hvc1' || codec === 'hev1') {\n    codec += \".\" + getHvcCodec(findNamedBox(bytes, 'hvcC'));\n  } else if (codec === 'mp4a' || codec === 'mp4v') {\n    var esds = findNamedBox(bytes, 'esds');\n    var esDescriptor = parseDescriptors(esds.subarray(4))[0];\n    var decoderConfig = esDescriptor && esDescriptor.descriptors.filter(function (_ref) {\n      var tag = _ref.tag;\n      return tag === 0x04;\n    })[0];\n\n    if (decoderConfig) {\n      // most codecs do not have a further '.'\n      // such as 0xa5 for ac-3 and 0xa6 for e-ac-3\n      codec += '.' + toHexString(decoderConfig.oti);\n\n      if (decoderConfig.oti === 0x40) {\n        codec += '.' + (decoderConfig.descriptors[0].bytes[0] >> 3).toString();\n      } else if (decoderConfig.oti === 0x20) {\n        codec += '.' + decoderConfig.descriptors[0].bytes[4].toString();\n      } else if (decoderConfig.oti === 0xdd) {\n        codec = 'vorbis';\n      }\n    } else if (track.type === 'audio') {\n      codec += '.40.2';\n    } else {\n      codec += '.20.9';\n    }\n  } else if (codec === 'av01') {\n    // AV1DecoderConfigurationRecord\n    codec += \".\" + getAv1Codec(findNamedBox(bytes, 'av1C'));\n  } else if (codec === 'vp09') {\n    // VPCodecConfigurationRecord\n    var vpcC = findNamedBox(bytes, 'vpcC'); // https://www.webmproject.org/vp9/mp4/\n\n    var profile = vpcC[0];\n    var level = vpcC[1];\n    var bitDepth = vpcC[2] >> 4;\n    var chromaSubsampling = (vpcC[2] & 0x0F) >> 1;\n    var videoFullRangeFlag = (vpcC[2] & 0x0F) >> 3;\n    var colourPrimaries = vpcC[3];\n    var transferCharacteristics = vpcC[4];\n    var matrixCoefficients = vpcC[5];\n    codec += \".\" + padStart(profile, 2, '0');\n    codec += \".\" + padStart(level, 2, '0');\n    codec += \".\" + padStart(bitDepth, 2, '0');\n    codec += \".\" + padStart(chromaSubsampling, 2, '0');\n    codec += \".\" + padStart(colourPrimaries, 2, '0');\n    codec += \".\" + padStart(transferCharacteristics, 2, '0');\n    codec += \".\" + padStart(matrixCoefficients, 2, '0');\n    codec += \".\" + padStart(videoFullRangeFlag, 2, '0');\n  } else if (codec === 'theo') {\n    codec = 'theora';\n  } else if (codec === 'spex') {\n    codec = 'speex';\n  } else if (codec === '.mp3') {\n    codec = 'mp4a.40.34';\n  } else if (codec === 'msVo') {\n    codec = 'vorbis';\n  } else if (codec === 'Opus') {\n    codec = 'opus';\n    var dOps = findNamedBox(bytes, 'dOps');\n    track.info.opus = parseOpusHead(dOps); // TODO: should this go into the webm code??\n    // Firefox requires a codecDelay for opus playback\n    // see https://bugzilla.mozilla.org/show_bug.cgi?id=1276238\n\n    track.info.codecDelay = 6500000;\n  } else {\n    codec = codec.toLowerCase();\n  }\n  /* eslint-enable */\n  // flac, ac-3, ec-3, opus\n\n\n  track.codec = codec;\n};\nexport var parseTracks = function parseTracks(bytes, frameTable) {\n  if (frameTable === void 0) {\n    frameTable = true;\n  }\n\n  bytes = toUint8(bytes);\n  var traks = findBox(bytes, ['moov', 'trak'], true);\n  var tracks = [];\n  traks.forEach(function (trak) {\n    var track = {\n      bytes: trak\n    };\n    var mdia = findBox(trak, ['mdia'])[0];\n    var hdlr = findBox(mdia, ['hdlr'])[0];\n    var trakType = bytesToString(hdlr.subarray(8, 12));\n\n    if (trakType === 'soun') {\n      track.type = 'audio';\n    } else if (trakType === 'vide') {\n      track.type = 'video';\n    } else {\n      track.type = trakType;\n    }\n\n    var tkhd = findBox(trak, ['tkhd'])[0];\n\n    if (tkhd) {\n      var view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n      var tkhdVersion = view.getUint8(0);\n      track.number = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n    }\n\n    var mdhd = findBox(mdia, ['mdhd'])[0];\n\n    if (mdhd) {\n      // mdhd is a FullBox, meaning it will have its own version as the first byte\n      var version = mdhd[0];\n      var index = version === 0 ? 12 : 20;\n      track.timescale = (mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]) >>> 0;\n    }\n\n    var stbl = findBox(mdia, ['minf', 'stbl'])[0];\n    var stsd = findBox(stbl, ['stsd'])[0];\n    var descriptionCount = bytesToNumber(stsd.subarray(4, 8));\n    var offset = 8; // add codec and codec info\n\n    while (descriptionCount--) {\n      var len = bytesToNumber(stsd.subarray(offset, offset + 4));\n      var sampleDescriptor = stsd.subarray(offset + 4, offset + 4 + len);\n      addSampleDescription(track, sampleDescriptor);\n      offset += 4 + len;\n    }\n\n    if (frameTable) {\n      track.frameTable = buildFrameTable(stbl, track.timescale);\n    } // codec has no sub parameters\n\n\n    tracks.push(track);\n  });\n  return tracks;\n};\nexport var parseMediaInfo = function parseMediaInfo(bytes) {\n  var mvhd = findBox(bytes, ['moov', 'mvhd'], true)[0];\n\n  if (!mvhd || !mvhd.length) {\n    return;\n  }\n\n  var info = {}; // ms to ns\n  // mvhd v1 has 8 byte duration and other fields too\n\n  if (mvhd[0] === 1) {\n    info.timestampScale = bytesToNumber(mvhd.subarray(20, 24));\n    info.duration = bytesToNumber(mvhd.subarray(24, 32));\n  } else {\n    info.timestampScale = bytesToNumber(mvhd.subarray(12, 16));\n    info.duration = bytesToNumber(mvhd.subarray(16, 20));\n  }\n\n  info.bytes = mvhd;\n  return info;\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nvar ID3 = toUint8([0x49, 0x44, 0x33]);\nexport var getId3Size = function getId3Size(bytes, offset) {\n  if (offset === void 0) {\n    offset = 0;\n  }\n\n  bytes = toUint8(bytes);\n  var flags = bytes[offset + 5];\n  var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];\n  var footerPresent = (flags & 16) >> 4;\n\n  if (footerPresent) {\n    return returnSize + 20;\n  }\n\n  return returnSize + 10;\n};\nexport var getId3Offset = function getId3Offset(bytes, offset) {\n  if (offset === void 0) {\n    offset = 0;\n  }\n\n  bytes = toUint8(bytes);\n\n  if (bytes.length - offset < 10 || !bytesMatch(bytes, ID3, {\n    offset: offset\n  })) {\n    return offset;\n  }\n\n  offset += getId3Size(bytes, offset); // recursive check for id3 tags as some files\n  // have multiple ID3 tag sections even though\n  // they should not.\n\n  return getId3Offset(bytes, offset);\n};","export var OPUS_HEAD = new Uint8Array([// O, p, u, s\n0x4f, 0x70, 0x75, 0x73, // H, e, a, d\n0x48, 0x65, 0x61, 0x64]); // https://wiki.xiph.org/OggOpus\n// https://vfrmaniac.fushizen.eu/contents/opus_in_isobmff.html\n// https://opus-codec.org/docs/opusfile_api-0.7/structOpusHead.html\n\nexport var parseOpusHead = function parseOpusHead(bytes) {\n  var view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n  var version = view.getUint8(0); // version 0, from mp4, does not use littleEndian.\n\n  var littleEndian = version !== 0;\n  var config = {\n    version: version,\n    channels: view.getUint8(1),\n    preSkip: view.getUint16(2, littleEndian),\n    sampleRate: view.getUint32(4, littleEndian),\n    outputGain: view.getUint16(8, littleEndian),\n    channelMappingFamily: view.getUint8(10)\n  };\n\n  if (config.channelMappingFamily > 0 && bytes.length > 10) {\n    config.streamCount = view.getUint8(11);\n    config.twoChannelStreamCount = view.getUint8(12);\n    config.channelMapping = [];\n\n    for (var c = 0; c < config.channels; c++) {\n      config.channelMapping.push(view.getUint8(13 + c));\n    }\n  }\n\n  return config;\n};\nexport var setOpusHead = function setOpusHead(config) {\n  var size = config.channelMappingFamily <= 0 ? 11 : 12 + config.channels;\n  var view = new DataView(new ArrayBuffer(size));\n  var littleEndian = config.version !== 0;\n  view.setUint8(0, config.version);\n  view.setUint8(1, config.channels);\n  view.setUint16(2, config.preSkip, littleEndian);\n  view.setUint32(4, config.sampleRate, littleEndian);\n  view.setUint16(8, config.outputGain, littleEndian);\n  view.setUint8(10, config.channelMappingFamily);\n\n  if (config.channelMappingFamily > 0) {\n    view.setUint8(11, config.streamCount);\n    config.channelMapping.foreach(function (cm, i) {\n      view.setUint8(12 + i, cm);\n    });\n  }\n\n  return new Uint8Array(view.buffer);\n};","import { toUint8, bytesToNumber, bytesMatch, bytesToString, numberToBytes, padStart } from './byte-helpers';\nimport { getAvcCodec, getHvcCodec, getAv1Codec } from './codec-helpers.js'; // relevant specs for this parser:\n// https://matroska-org.github.io/libebml/specs.html\n// https://www.matroska.org/technical/elements.html\n// https://www.webmproject.org/docs/container/\n\nexport var EBML_TAGS = {\n  EBML: toUint8([0x1A, 0x45, 0xDF, 0xA3]),\n  DocType: toUint8([0x42, 0x82]),\n  Segment: toUint8([0x18, 0x53, 0x80, 0x67]),\n  SegmentInfo: toUint8([0x15, 0x49, 0xA9, 0x66]),\n  Tracks: toUint8([0x16, 0x54, 0xAE, 0x6B]),\n  Track: toUint8([0xAE]),\n  TrackNumber: toUint8([0xd7]),\n  DefaultDuration: toUint8([0x23, 0xe3, 0x83]),\n  TrackEntry: toUint8([0xAE]),\n  TrackType: toUint8([0x83]),\n  FlagDefault: toUint8([0x88]),\n  CodecID: toUint8([0x86]),\n  CodecPrivate: toUint8([0x63, 0xA2]),\n  VideoTrack: toUint8([0xe0]),\n  AudioTrack: toUint8([0xe1]),\n  // Not used yet, but will be used for live webm/mkv\n  // see https://www.matroska.org/technical/basics.html#block-structure\n  // see https://www.matroska.org/technical/basics.html#simpleblock-structure\n  Cluster: toUint8([0x1F, 0x43, 0xB6, 0x75]),\n  Timestamp: toUint8([0xE7]),\n  TimestampScale: toUint8([0x2A, 0xD7, 0xB1]),\n  BlockGroup: toUint8([0xA0]),\n  BlockDuration: toUint8([0x9B]),\n  Block: toUint8([0xA1]),\n  SimpleBlock: toUint8([0xA3])\n};\n/**\n * This is a simple table to determine the length\n * of things in ebml. The length is one based (starts at 1,\n * rather than zero) and for every zero bit before a one bit\n * we add one to length. We also need this table because in some\n * case we have to xor all the length bits from another value.\n */\n\nvar LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];\n\nvar getLength = function getLength(byte) {\n  var len = 1;\n\n  for (var i = 0; i < LENGTH_TABLE.length; i++) {\n    if (byte & LENGTH_TABLE[i]) {\n      break;\n    }\n\n    len++;\n  }\n\n  return len;\n}; // length in ebml is stored in the first 4 to 8 bits\n// of the first byte. 4 for the id length and 8 for the\n// data size length. Length is measured by converting the number to binary\n// then 1 + the number of zeros before a 1 is encountered starting\n// from the left.\n\n\nvar getvint = function getvint(bytes, offset, removeLength, signed) {\n  if (removeLength === void 0) {\n    removeLength = true;\n  }\n\n  if (signed === void 0) {\n    signed = false;\n  }\n\n  var length = getLength(bytes[offset]);\n  var valueBytes = bytes.subarray(offset, offset + length); // NOTE that we do **not** subarray here because we need to copy these bytes\n  // as they will be modified below to remove the dataSizeLen bits and we do not\n  // want to modify the original data. normally we could just call slice on\n  // uint8array but ie 11 does not support that...\n\n  if (removeLength) {\n    valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);\n    valueBytes[0] ^= LENGTH_TABLE[length - 1];\n  }\n\n  return {\n    length: length,\n    value: bytesToNumber(valueBytes, {\n      signed: signed\n    }),\n    bytes: valueBytes\n  };\n};\n\nvar normalizePath = function normalizePath(path) {\n  if (typeof path === 'string') {\n    return path.match(/.{1,2}/g).map(function (p) {\n      return normalizePath(p);\n    });\n  }\n\n  if (typeof path === 'number') {\n    return numberToBytes(path);\n  }\n\n  return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n  if (!Array.isArray(paths)) {\n    return [normalizePath(paths)];\n  }\n\n  return paths.map(function (p) {\n    return normalizePath(p);\n  });\n};\n\nvar getInfinityDataSize = function getInfinityDataSize(id, bytes, offset) {\n  if (offset >= bytes.length) {\n    return bytes.length;\n  }\n\n  var innerid = getvint(bytes, offset, false);\n\n  if (bytesMatch(id.bytes, innerid.bytes)) {\n    return offset;\n  }\n\n  var dataHeader = getvint(bytes, offset + innerid.length);\n  return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);\n};\n/**\n * Notes on the EBLM format.\n *\n * EBLM uses \"vints\" tags. Every vint tag contains\n * two parts\n *\n * 1. The length from the first byte. You get this by\n *    converting the byte to binary and counting the zeros\n *    before a 1. Then you add 1 to that. Examples\n *    00011111 = length 4 because there are 3 zeros before a 1.\n *    00100000 = length 3 because there are 2 zeros before a 1.\n *    00000011 = length 7 because there are 6 zeros before a 1.\n *\n * 2. The bits used for length are removed from the first byte\n *    Then all the bytes are merged into a value. NOTE: this\n *    is not the case for id ebml tags as there id includes\n *    length bits.\n *\n */\n\n\nexport var findEbml = function findEbml(bytes, paths) {\n  paths = normalizePaths(paths);\n  bytes = toUint8(bytes);\n  var results = [];\n\n  if (!paths.length) {\n    return results;\n  }\n\n  var i = 0;\n\n  while (i < bytes.length) {\n    var id = getvint(bytes, i, false);\n    var dataHeader = getvint(bytes, i + id.length);\n    var dataStart = i + id.length + dataHeader.length; // dataSize is unknown or this is a live stream\n\n    if (dataHeader.value === 0x7f) {\n      dataHeader.value = getInfinityDataSize(id, bytes, dataStart);\n\n      if (dataHeader.value !== bytes.length) {\n        dataHeader.value -= dataStart;\n      }\n    }\n\n    var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;\n    var data = bytes.subarray(dataStart, dataEnd);\n\n    if (bytesMatch(paths[0], id.bytes)) {\n      if (paths.length === 1) {\n        // this is the end of the paths and we've found the tag we were\n        // looking for\n        results.push(data);\n      } else {\n        // recursively search for the next tag inside of the data\n        // of this one\n        results = results.concat(findEbml(data, paths.slice(1)));\n      }\n    }\n\n    var totalLength = id.length + dataHeader.length + data.length; // move past this tag entirely, we are not looking for it\n\n    i += totalLength;\n  }\n\n  return results;\n}; // see https://www.matroska.org/technical/basics.html#block-structure\n\nexport var decodeBlock = function decodeBlock(block, type, timestampScale, clusterTimestamp) {\n  var duration;\n\n  if (type === 'group') {\n    duration = findEbml(block, [EBML_TAGS.BlockDuration])[0];\n\n    if (duration) {\n      duration = bytesToNumber(duration);\n      duration = 1 / timestampScale * duration * timestampScale / 1000;\n    }\n\n    block = findEbml(block, [EBML_TAGS.Block])[0];\n    type = 'block'; // treat data as a block after this point\n  }\n\n  var dv = new DataView(block.buffer, block.byteOffset, block.byteLength);\n  var trackNumber = getvint(block, 0);\n  var timestamp = dv.getInt16(trackNumber.length, false);\n  var flags = block[trackNumber.length + 2];\n  var data = block.subarray(trackNumber.length + 3); // pts/dts in seconds\n\n  var ptsdts = 1 / timestampScale * (clusterTimestamp + timestamp) * timestampScale / 1000; // return the frame\n\n  var parsed = {\n    duration: duration,\n    trackNumber: trackNumber.value,\n    keyframe: type === 'simple' && flags >> 7 === 1,\n    invisible: (flags & 0x08) >> 3 === 1,\n    lacing: (flags & 0x06) >> 1,\n    discardable: type === 'simple' && (flags & 0x01) === 1,\n    frames: [],\n    pts: ptsdts,\n    dts: ptsdts,\n    timestamp: timestamp\n  };\n\n  if (!parsed.lacing) {\n    parsed.frames.push(data);\n    return parsed;\n  }\n\n  var numberOfFrames = data[0] + 1;\n  var frameSizes = [];\n  var offset = 1; // Fixed\n\n  if (parsed.lacing === 2) {\n    var sizeOfFrame = (data.length - offset) / numberOfFrames;\n\n    for (var i = 0; i < numberOfFrames; i++) {\n      frameSizes.push(sizeOfFrame);\n    }\n  } // xiph\n\n\n  if (parsed.lacing === 1) {\n    for (var _i = 0; _i < numberOfFrames - 1; _i++) {\n      var size = 0;\n\n      do {\n        size += data[offset];\n        offset++;\n      } while (data[offset - 1] === 0xFF);\n\n      frameSizes.push(size);\n    }\n  } // ebml\n\n\n  if (parsed.lacing === 3) {\n    // first vint is unsinged\n    // after that vints are singed and\n    // based on a compounding size\n    var _size = 0;\n\n    for (var _i2 = 0; _i2 < numberOfFrames - 1; _i2++) {\n      var vint = _i2 === 0 ? getvint(data, offset) : getvint(data, offset, true, true);\n      _size += vint.value;\n      frameSizes.push(_size);\n      offset += vint.length;\n    }\n  }\n\n  frameSizes.forEach(function (size) {\n    parsed.frames.push(data.subarray(offset, offset + size));\n    offset += size;\n  });\n  return parsed;\n}; // VP9 Codec Feature Metadata (CodecPrivate)\n// https://www.webmproject.org/docs/container/\n\nvar parseVp9Private = function parseVp9Private(bytes) {\n  var i = 0;\n  var params = {};\n\n  while (i < bytes.length) {\n    var id = bytes[i] & 0x7f;\n    var len = bytes[i + 1];\n    var val = void 0;\n\n    if (len === 1) {\n      val = bytes[i + 2];\n    } else {\n      val = bytes.subarray(i + 2, i + 2 + len);\n    }\n\n    if (id === 1) {\n      params.profile = val;\n    } else if (id === 2) {\n      params.level = val;\n    } else if (id === 3) {\n      params.bitDepth = val;\n    } else if (id === 4) {\n      params.chromaSubsampling = val;\n    } else {\n      params[id] = val;\n    }\n\n    i += 2 + len;\n  }\n\n  return params;\n};\n\nexport var parseTracks = function parseTracks(bytes) {\n  bytes = toUint8(bytes);\n  var decodedTracks = [];\n  var tracks = findEbml(bytes, [EBML_TAGS.Segment, EBML_TAGS.Tracks, EBML_TAGS.Track]);\n\n  if (!tracks.length) {\n    tracks = findEbml(bytes, [EBML_TAGS.Tracks, EBML_TAGS.Track]);\n  }\n\n  if (!tracks.length) {\n    tracks = findEbml(bytes, [EBML_TAGS.Track]);\n  }\n\n  if (!tracks.length) {\n    return decodedTracks;\n  }\n\n  tracks.forEach(function (track) {\n    var trackType = findEbml(track, EBML_TAGS.TrackType)[0];\n\n    if (!trackType || !trackType.length) {\n      return;\n    } // 1 is video, 2 is audio, 17 is subtitle\n    // other values are unimportant in this context\n\n\n    if (trackType[0] === 1) {\n      trackType = 'video';\n    } else if (trackType[0] === 2) {\n      trackType = 'audio';\n    } else if (trackType[0] === 17) {\n      trackType = 'subtitle';\n    } else {\n      return;\n    } // todo parse language\n\n\n    var decodedTrack = {\n      rawCodec: bytesToString(findEbml(track, [EBML_TAGS.CodecID])[0]),\n      type: trackType,\n      codecPrivate: findEbml(track, [EBML_TAGS.CodecPrivate])[0],\n      number: bytesToNumber(findEbml(track, [EBML_TAGS.TrackNumber])[0]),\n      defaultDuration: bytesToNumber(findEbml(track, [EBML_TAGS.DefaultDuration])[0]),\n      default: findEbml(track, [EBML_TAGS.FlagDefault])[0],\n      rawData: track\n    };\n    var codec = '';\n\n    if (/V_MPEG4\\/ISO\\/AVC/.test(decodedTrack.rawCodec)) {\n      codec = \"avc1.\" + getAvcCodec(decodedTrack.codecPrivate);\n    } else if (/V_MPEGH\\/ISO\\/HEVC/.test(decodedTrack.rawCodec)) {\n      codec = \"hev1.\" + getHvcCodec(decodedTrack.codecPrivate);\n    } else if (/V_MPEG4\\/ISO\\/ASP/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        codec = 'mp4v.20.' + decodedTrack.codecPrivate[4].toString();\n      } else {\n        codec = 'mp4v.20.9';\n      }\n    } else if (/^V_THEORA/.test(decodedTrack.rawCodec)) {\n      codec = 'theora';\n    } else if (/^V_VP8/.test(decodedTrack.rawCodec)) {\n      codec = 'vp8';\n    } else if (/^V_VP9/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        var _parseVp9Private = parseVp9Private(decodedTrack.codecPrivate),\n            profile = _parseVp9Private.profile,\n            level = _parseVp9Private.level,\n            bitDepth = _parseVp9Private.bitDepth,\n            chromaSubsampling = _parseVp9Private.chromaSubsampling;\n\n        codec = 'vp09.';\n        codec += padStart(profile, 2, '0') + \".\";\n        codec += padStart(level, 2, '0') + \".\";\n        codec += padStart(bitDepth, 2, '0') + \".\";\n        codec += \"\" + padStart(chromaSubsampling, 2, '0'); // Video -> Colour -> Ebml name\n\n        var matrixCoefficients = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB1]])[0] || [];\n        var videoFullRangeFlag = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB9]])[0] || [];\n        var transferCharacteristics = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBA]])[0] || [];\n        var colourPrimaries = findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBB]])[0] || []; // if we find any optional codec parameter specify them all.\n\n        if (matrixCoefficients.length || videoFullRangeFlag.length || transferCharacteristics.length || colourPrimaries.length) {\n          codec += \".\" + padStart(colourPrimaries[0], 2, '0');\n          codec += \".\" + padStart(transferCharacteristics[0], 2, '0');\n          codec += \".\" + padStart(matrixCoefficients[0], 2, '0');\n          codec += \".\" + padStart(videoFullRangeFlag[0], 2, '0');\n        }\n      } else {\n        codec = 'vp9';\n      }\n    } else if (/^V_AV1/.test(decodedTrack.rawCodec)) {\n      codec = \"av01.\" + getAv1Codec(decodedTrack.codecPrivate);\n    } else if (/A_ALAC/.test(decodedTrack.rawCodec)) {\n      codec = 'alac';\n    } else if (/A_MPEG\\/L2/.test(decodedTrack.rawCodec)) {\n      codec = 'mp2';\n    } else if (/A_MPEG\\/L3/.test(decodedTrack.rawCodec)) {\n      codec = 'mp3';\n    } else if (/^A_AAC/.test(decodedTrack.rawCodec)) {\n      if (decodedTrack.codecPrivate) {\n        codec = 'mp4a.40.' + (decodedTrack.codecPrivate[0] >>> 3).toString();\n      } else {\n        codec = 'mp4a.40.2';\n      }\n    } else if (/^A_AC3/.test(decodedTrack.rawCodec)) {\n      codec = 'ac-3';\n    } else if (/^A_PCM/.test(decodedTrack.rawCodec)) {\n      codec = 'pcm';\n    } else if (/^A_MS\\/ACM/.test(decodedTrack.rawCodec)) {\n      codec = 'speex';\n    } else if (/^A_EAC3/.test(decodedTrack.rawCodec)) {\n      codec = 'ec-3';\n    } else if (/^A_VORBIS/.test(decodedTrack.rawCodec)) {\n      codec = 'vorbis';\n    } else if (/^A_FLAC/.test(decodedTrack.rawCodec)) {\n      codec = 'flac';\n    } else if (/^A_OPUS/.test(decodedTrack.rawCodec)) {\n      codec = 'opus';\n    }\n\n    decodedTrack.codec = codec;\n    decodedTracks.push(decodedTrack);\n  });\n  return decodedTracks.sort(function (a, b) {\n    return a.number - b.number;\n  });\n};\nexport var parseData = function parseData(data, tracks) {\n  var allBlocks = [];\n  var segment = findEbml(data, [EBML_TAGS.Segment])[0];\n  var timestampScale = findEbml(segment, [EBML_TAGS.SegmentInfo, EBML_TAGS.TimestampScale])[0]; // in nanoseconds, defaults to 1ms\n\n  if (timestampScale && timestampScale.length) {\n    timestampScale = bytesToNumber(timestampScale);\n  } else {\n    timestampScale = 1000000;\n  }\n\n  var clusters = findEbml(segment, [EBML_TAGS.Cluster]);\n\n  if (!tracks) {\n    tracks = parseTracks(segment);\n  }\n\n  clusters.forEach(function (cluster, ci) {\n    var simpleBlocks = findEbml(cluster, [EBML_TAGS.SimpleBlock]).map(function (b) {\n      return {\n        type: 'simple',\n        data: b\n      };\n    });\n    var blockGroups = findEbml(cluster, [EBML_TAGS.BlockGroup]).map(function (b) {\n      return {\n        type: 'group',\n        data: b\n      };\n    });\n    var timestamp = findEbml(cluster, [EBML_TAGS.Timestamp])[0] || 0;\n\n    if (timestamp && timestamp.length) {\n      timestamp = bytesToNumber(timestamp);\n    } // get all blocks then sort them into the correct order\n\n\n    var blocks = simpleBlocks.concat(blockGroups).sort(function (a, b) {\n      return a.data.byteOffset - b.data.byteOffset;\n    });\n    blocks.forEach(function (block, bi) {\n      var decoded = decodeBlock(block.data, block.type, timestampScale, timestamp);\n      allBlocks.push(decoded);\n    });\n  });\n  return {\n    tracks: tracks,\n    blocks: allBlocks\n  };\n};","import { bytesMatch, toUint8 } from './byte-helpers.js';\nexport var NAL_TYPE_ONE = toUint8([0x00, 0x00, 0x00, 0x01]);\nexport var NAL_TYPE_TWO = toUint8([0x00, 0x00, 0x01]);\nexport var EMULATION_PREVENTION = toUint8([0x00, 0x00, 0x03]);\n/**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n *\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\nexport var discardEmulationPreventionBytes = function discardEmulationPreventionBytes(bytes) {\n  var positions = [];\n  var i = 1; // Find all `Emulation Prevention Bytes`\n\n  while (i < bytes.length - 2) {\n    if (bytesMatch(bytes.subarray(i, i + 3), EMULATION_PREVENTION)) {\n      positions.push(i + 2);\n      i++;\n    }\n\n    i++;\n  } // If no Emulation Prevention Bytes were found just return the original\n  // array\n\n\n  if (positions.length === 0) {\n    return bytes;\n  } // Create a new array to hold the NAL unit data\n\n\n  var newLength = bytes.length - positions.length;\n  var newData = new Uint8Array(newLength);\n  var sourceIndex = 0;\n\n  for (i = 0; i < newLength; sourceIndex++, i++) {\n    if (sourceIndex === positions[0]) {\n      // Skip this byte\n      sourceIndex++; // Remove this position index\n\n      positions.shift();\n    }\n\n    newData[i] = bytes[sourceIndex];\n  }\n\n  return newData;\n};\nexport var findNal = function findNal(bytes, dataType, types, nalLimit) {\n  if (nalLimit === void 0) {\n    nalLimit = Infinity;\n  }\n\n  bytes = toUint8(bytes);\n  types = [].concat(types);\n  var i = 0;\n  var nalStart;\n  var nalsFound = 0; // keep searching until:\n  // we reach the end of bytes\n  // we reach the maximum number of nals they want to seach\n  // NOTE: that we disregard nalLimit when we have found the start\n  // of the nal we want so that we can find the end of the nal we want.\n\n  while (i < bytes.length && (nalsFound < nalLimit || nalStart)) {\n    var nalOffset = void 0;\n\n    if (bytesMatch(bytes.subarray(i), NAL_TYPE_ONE)) {\n      nalOffset = 4;\n    } else if (bytesMatch(bytes.subarray(i), NAL_TYPE_TWO)) {\n      nalOffset = 3;\n    } // we are unsynced,\n    // find the next nal unit\n\n\n    if (!nalOffset) {\n      i++;\n      continue;\n    }\n\n    nalsFound++;\n\n    if (nalStart) {\n      return discardEmulationPreventionBytes(bytes.subarray(nalStart, i));\n    }\n\n    var nalType = void 0;\n\n    if (dataType === 'h264') {\n      nalType = bytes[i + nalOffset] & 0x1f;\n    } else if (dataType === 'h265') {\n      nalType = bytes[i + nalOffset] >> 1 & 0x3f;\n    }\n\n    if (types.indexOf(nalType) !== -1) {\n      nalStart = i + nalOffset;\n    } // nal header is 1 length for h264, and 2 for h265\n\n\n    i += nalOffset + (dataType === 'h264' ? 1 : 2);\n  }\n\n  return bytes.subarray(0, 0);\n};\nexport var findH264Nal = function findH264Nal(bytes, type, nalLimit) {\n  return findNal(bytes, 'h264', type, nalLimit);\n};\nexport var findH265Nal = function findH265Nal(bytes, type, nalLimit) {\n  return findNal(bytes, 'h265', type, nalLimit);\n};","import { toUint8, bytesMatch } from './byte-helpers.js';\nimport { findBox } from './mp4-helpers.js';\nimport { findEbml, EBML_TAGS } from './ebml-helpers.js';\nimport { getId3Offset } from './id3-helpers.js';\nimport { findH264Nal, findH265Nal } from './nal-helpers.js';\nvar CONSTANTS = {\n  // \"webm\" string literal in hex\n  'webm': toUint8([0x77, 0x65, 0x62, 0x6d]),\n  // \"matroska\" string literal in hex\n  'matroska': toUint8([0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61]),\n  // \"fLaC\" string literal in hex\n  'flac': toUint8([0x66, 0x4c, 0x61, 0x43]),\n  // \"OggS\" string literal in hex\n  'ogg': toUint8([0x4f, 0x67, 0x67, 0x53]),\n  // ac-3 sync byte, also works for ec-3 as that is simply a codec\n  // of ac-3\n  'ac3': toUint8([0x0b, 0x77]),\n  // \"RIFF\" string literal in hex used for wav and avi\n  'riff': toUint8([0x52, 0x49, 0x46, 0x46]),\n  // \"AVI\" string literal in hex\n  'avi': toUint8([0x41, 0x56, 0x49]),\n  // \"WAVE\" string literal in hex\n  'wav': toUint8([0x57, 0x41, 0x56, 0x45]),\n  // \"ftyp3g\" string literal in hex\n  '3gp': toUint8([0x66, 0x74, 0x79, 0x70, 0x33, 0x67]),\n  // \"ftyp\" string literal in hex\n  'mp4': toUint8([0x66, 0x74, 0x79, 0x70]),\n  // \"styp\" string literal in hex\n  'fmp4': toUint8([0x73, 0x74, 0x79, 0x70]),\n  // \"ftypqt\" string literal in hex\n  'mov': toUint8([0x66, 0x74, 0x79, 0x70, 0x71, 0x74]),\n  // moov string literal in hex\n  'moov': toUint8([0x6D, 0x6F, 0x6F, 0x76]),\n  // moof string literal in hex\n  'moof': toUint8([0x6D, 0x6F, 0x6F, 0x66])\n};\nvar _isLikely = {\n  aac: function aac(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, [0xFF, 0x10], {\n      offset: offset,\n      mask: [0xFF, 0x16]\n    });\n  },\n  mp3: function mp3(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, [0xFF, 0x02], {\n      offset: offset,\n      mask: [0xFF, 0x06]\n    });\n  },\n  webm: function webm(bytes) {\n    var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is webm\n\n    return bytesMatch(docType, CONSTANTS.webm);\n  },\n  mkv: function mkv(bytes) {\n    var docType = findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is matroska\n\n    return bytesMatch(docType, CONSTANTS.matroska);\n  },\n  mp4: function mp4(bytes) {\n    // if this file is another base media file format, it is not mp4\n    if (_isLikely['3gp'](bytes) || _isLikely.mov(bytes)) {\n      return false;\n    } // if this file starts with a ftyp or styp box its mp4\n\n\n    if (bytesMatch(bytes, CONSTANTS.mp4, {\n      offset: 4\n    }) || bytesMatch(bytes, CONSTANTS.fmp4, {\n      offset: 4\n    })) {\n      return true;\n    } // if this file starts with a moof/moov box its mp4\n\n\n    if (bytesMatch(bytes, CONSTANTS.moof, {\n      offset: 4\n    }) || bytesMatch(bytes, CONSTANTS.moov, {\n      offset: 4\n    })) {\n      return true;\n    }\n  },\n  mov: function mov(bytes) {\n    return bytesMatch(bytes, CONSTANTS.mov, {\n      offset: 4\n    });\n  },\n  '3gp': function gp(bytes) {\n    return bytesMatch(bytes, CONSTANTS['3gp'], {\n      offset: 4\n    });\n  },\n  ac3: function ac3(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, CONSTANTS.ac3, {\n      offset: offset\n    });\n  },\n  ts: function ts(bytes) {\n    if (bytes.length < 189 && bytes.length >= 1) {\n      return bytes[0] === 0x47;\n    }\n\n    var i = 0; // check the first 376 bytes for two matching sync bytes\n\n    while (i + 188 < bytes.length && i < 188) {\n      if (bytes[i] === 0x47 && bytes[i + 188] === 0x47) {\n        return true;\n      }\n\n      i += 1;\n    }\n\n    return false;\n  },\n  flac: function flac(bytes) {\n    var offset = getId3Offset(bytes);\n    return bytesMatch(bytes, CONSTANTS.flac, {\n      offset: offset\n    });\n  },\n  ogg: function ogg(bytes) {\n    return bytesMatch(bytes, CONSTANTS.ogg);\n  },\n  avi: function avi(bytes) {\n    return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.avi, {\n      offset: 8\n    });\n  },\n  wav: function wav(bytes) {\n    return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.wav, {\n      offset: 8\n    });\n  },\n  'h264': function h264(bytes) {\n    // find seq_parameter_set_rbsp\n    return findH264Nal(bytes, 7, 3).length;\n  },\n  'h265': function h265(bytes) {\n    // find video_parameter_set_rbsp or seq_parameter_set_rbsp\n    return findH265Nal(bytes, [32, 33], 3).length;\n  }\n}; // get all the isLikely functions\n// but make sure 'ts' is above h264 and h265\n// but below everything else as it is the least specific\n\nvar isLikelyTypes = Object.keys(_isLikely) // remove ts, h264, h265\n.filter(function (t) {\n  return t !== 'ts' && t !== 'h264' && t !== 'h265';\n}) // add it back to the bottom\n.concat(['ts', 'h264', 'h265']); // make sure we are dealing with uint8 data.\n\nisLikelyTypes.forEach(function (type) {\n  var isLikelyFn = _isLikely[type];\n\n  _isLikely[type] = function (bytes) {\n    return isLikelyFn(toUint8(bytes));\n  };\n}); // export after wrapping\n\nexport var isLikely = _isLikely; // A useful list of file signatures can be found here\n// https://en.wikipedia.org/wiki/List_of_file_signatures\n\nexport var detectContainerForBytes = function detectContainerForBytes(bytes) {\n  bytes = toUint8(bytes);\n\n  for (var i = 0; i < isLikelyTypes.length; i++) {\n    var type = isLikelyTypes[i];\n\n    if (isLikely[type](bytes)) {\n      return type;\n    }\n  }\n\n  return '';\n}; // fmp4 is not a container\n\nexport var isLikelyFmp4MediaSegment = function isLikelyFmp4MediaSegment(bytes) {\n  return findBox(bytes, ['moof']).length > 0;\n};","/*! @name @videojs/http-streaming @version 3.10.0 @license Apache-2.0 */\nimport document from 'global/document';\nimport window$1 from 'global/window';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _resolveUrl from '@videojs/vhs-utils/es/resolve-url.js';\nimport videojs from 'video.js';\nimport { Parser } from 'm3u8-parser';\nimport { isAudioCodec, translateLegacyCodec, codecsFromDefault, parseCodecs, getMimeForCodec, DEFAULT_VIDEO_CODEC, DEFAULT_AUDIO_CODEC, browserSupportsCodec, muxerSupportsCodec } from '@videojs/vhs-utils/es/codecs.js';\nimport { simpleTypeFromSourceType } from '@videojs/vhs-utils/es/media-types.js';\nexport { simpleTypeFromSourceType } from '@videojs/vhs-utils/es/media-types.js';\nimport { isArrayBufferView, concatTypedArrays, stringToBytes, toUint8 } from '@videojs/vhs-utils/es/byte-helpers';\nimport { generateSidxKey, parseUTCTiming, parse, addSidxSegmentsToPlaylist } from 'mpd-parser';\nimport parseSidx from 'mux.js/lib/tools/parse-sidx';\nimport { getId3Offset } from '@videojs/vhs-utils/es/id3-helpers';\nimport { detectContainerForBytes, isLikelyFmp4MediaSegment } from '@videojs/vhs-utils/es/containers';\nimport { ONE_SECOND_IN_TS } from 'mux.js/lib/utils/clock';\n\n/**\n * @file resolve-url.js - Handling how URLs are resolved and manipulated\n */\nconst resolveUrl = _resolveUrl;\n/**\n * If the xhr request was redirected, return the responseURL, otherwise,\n * return the original url.\n *\n * @api private\n *\n * @param  {string} url - an url being requested\n * @param  {XMLHttpRequest} req - xhr request result\n *\n * @return {string}\n */\n\nconst resolveManifestRedirect = (url, req) => {\n  // To understand how the responseURL below is set and generated:\n  // - https://fetch.spec.whatwg.org/#concept-response-url\n  // - https://fetch.spec.whatwg.org/#atomic-http-redirect-handling\n  if (req && req.responseURL && url !== req.responseURL) {\n    return req.responseURL;\n  }\n\n  return url;\n};\n\nconst logger = source => {\n  if (videojs.log.debug) {\n    return videojs.log.debug.bind(videojs, 'VHS:', `${source} >`);\n  }\n\n  return function () {};\n};\n\n/**\n * Provides a compatibility layer between Video.js 7 and 8 API changes for VHS.\n */\n/**\n * Delegates to videojs.obj.merge (Video.js 8) or\n * videojs.mergeOptions (Video.js 7).\n */\n\nfunction merge(...args) {\n  const context = videojs.obj || videojs;\n  const fn = context.merge || context.mergeOptions;\n  return fn.apply(context, args);\n}\n/**\n * Delegates to videojs.time.createTimeRanges (Video.js 8) or\n * videojs.createTimeRanges (Video.js 7).\n */\n\nfunction createTimeRanges(...args) {\n  const context = videojs.time || videojs;\n  const fn = context.createTimeRanges || context.createTimeRanges;\n  return fn.apply(context, args);\n}\n\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n\nconst TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nconst SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\n\nconst filterRanges = function (timeRanges, predicate) {\n  const results = [];\n  let i;\n\n  if (timeRanges && timeRanges.length) {\n    // Search for ranges that match the predicate\n    for (i = 0; i < timeRanges.length; i++) {\n      if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n        results.push([timeRanges.start(i), timeRanges.end(i)]);\n      }\n    }\n  }\n\n  return createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n *\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time  - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object\n */\n\n\nconst findRange = function (buffered, time) {\n  return filterRanges(buffered, function (start, end) {\n    return start - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;\n  });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n *\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object.\n */\n\nconst findNextRange = function (timeRanges, time) {\n  return filterRanges(timeRanges, function (start) {\n    return start - TIME_FUDGE_FACTOR >= time;\n  });\n};\n/**\n * Returns gaps within a list of TimeRanges\n *\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\nconst findGaps = function (buffered) {\n  if (buffered.length < 2) {\n    return createTimeRanges();\n  }\n\n  const ranges = [];\n\n  for (let i = 1; i < buffered.length; i++) {\n    const start = buffered.end(i - 1);\n    const end = buffered.start(i);\n    ranges.push([start, end]);\n  }\n\n  return createTimeRanges(ranges);\n};\n/**\n * Calculate the intersection of two TimeRanges\n *\n * @param {TimeRanges} bufferA\n * @param {TimeRanges} bufferB\n * @return {TimeRanges} The interesection of `bufferA` with `bufferB`\n */\n\nconst bufferIntersection = function (bufferA, bufferB) {\n  let start = null;\n  let end = null;\n  let arity = 0;\n  const extents = [];\n  const ranges = [];\n\n  if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {\n    return createTimeRanges();\n  } // Handle the case where we have both buffers and create an\n  // intersection of the two\n\n\n  let count = bufferA.length; // A) Gather up all start and end times\n\n  while (count--) {\n    extents.push({\n      time: bufferA.start(count),\n      type: 'start'\n    });\n    extents.push({\n      time: bufferA.end(count),\n      type: 'end'\n    });\n  }\n\n  count = bufferB.length;\n\n  while (count--) {\n    extents.push({\n      time: bufferB.start(count),\n      type: 'start'\n    });\n    extents.push({\n      time: bufferB.end(count),\n      type: 'end'\n    });\n  } // B) Sort them by time\n\n\n  extents.sort(function (a, b) {\n    return a.time - b.time;\n  }); // C) Go along one by one incrementing arity for start and decrementing\n  //    arity for ends\n\n  for (count = 0; count < extents.length; count++) {\n    if (extents[count].type === 'start') {\n      arity++; // D) If arity is ever incremented to 2 we are entering an\n      //    overlapping range\n\n      if (arity === 2) {\n        start = extents[count].time;\n      }\n    } else if (extents[count].type === 'end') {\n      arity--; // E) If arity is ever decremented to 1 we leaving an\n      //    overlapping range\n\n      if (arity === 1) {\n        end = extents[count].time;\n      }\n    } // F) Record overlapping ranges\n\n\n    if (start !== null && end !== null) {\n      ranges.push([start, end]);\n      start = null;\n      end = null;\n    }\n  }\n\n  return createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @return {string} a human readable string\n */\n\nconst printableRange = range => {\n  const strArr = [];\n\n  if (!range || !range.length) {\n    return '';\n  }\n\n  for (let i = 0; i < range.length; i++) {\n    strArr.push(range.start(i) + ' => ' + range.end(i));\n  }\n\n  return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n *        The state of the buffer\n * @param {Numnber} currentTime\n *        The current time of the player\n * @param {number} playbackRate\n *        The current playback rate of the player. Defaults to 1.\n * @return {number}\n *         Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\nconst timeUntilRebuffer = function (buffered, currentTime, playbackRate = 1) {\n  const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n  return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n *\n * @param {TimeRanges} timeRanges\n * @return {Array}\n */\n\nconst timeRangesToArray = timeRanges => {\n  const timeRangesList = [];\n\n  for (let i = 0; i < timeRanges.length; i++) {\n    timeRangesList.push({\n      start: timeRanges.start(i),\n      end: timeRanges.end(i)\n    });\n  }\n\n  return timeRangesList;\n};\n/**\n * Determines if two time range objects are different.\n *\n * @param {TimeRange} a\n *        the first time range object to check\n *\n * @param {TimeRange} b\n *        the second time range object to check\n *\n * @return {Boolean}\n *         Whether the time range objects differ\n */\n\nconst isRangeDifferent = function (a, b) {\n  // same object\n  if (a === b) {\n    return false;\n  } // one or the other is undefined\n\n\n  if (!a && b || !b && a) {\n    return true;\n  } // length is different\n\n\n  if (a.length !== b.length) {\n    return true;\n  } // see if any start/end pair is different\n\n\n  for (let i = 0; i < a.length; i++) {\n    if (a.start(i) !== b.start(i) || a.end(i) !== b.end(i)) {\n      return true;\n    }\n  } // if the length and every pair is the same\n  // this is the same time range\n\n\n  return false;\n};\nconst lastBufferedEnd = function (a) {\n  if (!a || !a.length || !a.end) {\n    return;\n  }\n\n  return a.end(a.length - 1);\n};\n/**\n * A utility function to add up the amount of time in a timeRange\n * after a specified startTime.\n * ie:[[0, 10], [20, 40], [50, 60]] with a startTime 0\n *     would return 40 as there are 40s seconds after 0 in the timeRange\n *\n * @param {TimeRange} range\n *        The range to check against\n * @param {number} startTime\n *        The time in the time range that you should start counting from\n *\n * @return {number}\n *          The number of seconds in the buffer passed the specified time.\n */\n\nconst timeAheadOf = function (range, startTime) {\n  let time = 0;\n\n  if (!range || !range.length) {\n    return time;\n  }\n\n  for (let i = 0; i < range.length; i++) {\n    const start = range.start(i);\n    const end = range.end(i); // startTime is after this range entirely\n\n    if (startTime > end) {\n      continue;\n    } // startTime is within this range\n\n\n    if (startTime > start && startTime <= end) {\n      time += end - startTime;\n      continue;\n    } // startTime is before this range.\n\n\n    time += end - start;\n  }\n\n  return time;\n};\n\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n/**\n * Get the duration of a segment, with special cases for\n * llhls segments that do not have a duration yet.\n *\n * @param {Object} playlist\n *        the playlist that the segment belongs to.\n * @param {Object} segment\n *        the segment to get a duration for.\n *\n * @return {number}\n *          the segment duration\n */\n\nconst segmentDurationWithParts = (playlist, segment) => {\n  // if this isn't a preload segment\n  // then we will have a segment duration that is accurate.\n  if (!segment.preload) {\n    return segment.duration;\n  } // otherwise we have to add up parts and preload hints\n  // to get an up to date duration.\n\n\n  let result = 0;\n  (segment.parts || []).forEach(function (p) {\n    result += p.duration;\n  }); // for preload hints we have to use partTargetDuration\n  // as they won't even have a duration yet.\n\n  (segment.preloadHints || []).forEach(function (p) {\n    if (p.type === 'PART') {\n      result += playlist.partTargetDuration;\n    }\n  });\n  return result;\n};\n/**\n * A function to get a combined list of parts and segments with durations\n * and indexes.\n *\n * @param {Playlist} playlist the playlist to get the list for.\n *\n * @return {Array} The part/segment list.\n */\n\nconst getPartsAndSegments = playlist => (playlist.segments || []).reduce((acc, segment, si) => {\n  if (segment.parts) {\n    segment.parts.forEach(function (part, pi) {\n      acc.push({\n        duration: part.duration,\n        segmentIndex: si,\n        partIndex: pi,\n        part,\n        segment\n      });\n    });\n  } else {\n    acc.push({\n      duration: segment.duration,\n      segmentIndex: si,\n      partIndex: null,\n      segment,\n      part: null\n    });\n  }\n\n  return acc;\n}, []);\nconst getLastParts = media => {\n  const lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];\n  return lastSegment && lastSegment.parts || [];\n};\nconst getKnownPartCount = ({\n  preloadSegment\n}) => {\n  if (!preloadSegment) {\n    return;\n  }\n\n  const {\n    parts,\n    preloadHints\n  } = preloadSegment;\n  let partCount = (preloadHints || []).reduce((count, hint) => count + (hint.type === 'PART' ? 1 : 0), 0);\n  partCount += parts && parts.length ? parts.length : 0;\n  return partCount;\n};\n/**\n * Get the number of seconds to delay from the end of a\n * live playlist.\n *\n * @param {Playlist} main the main playlist\n * @param {Playlist} media the media playlist\n * @return {number} the hold back in seconds.\n */\n\nconst liveEdgeDelay = (main, media) => {\n  if (media.endList) {\n    return 0;\n  } // dash suggestedPresentationDelay trumps everything\n\n\n  if (main && main.suggestedPresentationDelay) {\n    return main.suggestedPresentationDelay;\n  }\n\n  const hasParts = getLastParts(media).length > 0; // look for \"part\" delays from ll-hls first\n\n  if (hasParts && media.serverControl && media.serverControl.partHoldBack) {\n    return media.serverControl.partHoldBack;\n  } else if (hasParts && media.partTargetDuration) {\n    return media.partTargetDuration * 3; // finally look for full segment delays\n  } else if (media.serverControl && media.serverControl.holdBack) {\n    return media.serverControl.holdBack;\n  } else if (media.targetDuration) {\n    return media.targetDuration * 3;\n  }\n\n  return 0;\n};\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\nconst backwardDuration = function (playlist, endSequence) {\n  let result = 0;\n  let i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n  // the interval, use it\n\n  let segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n  // information that is earlier than endSequence\n\n  if (segment) {\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: segment.start,\n        precise: true\n      };\n    }\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: segment.end - segment.duration,\n        precise: true\n      };\n    }\n  }\n\n  while (i--) {\n    segment = playlist.segments[i];\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: result + segment.end,\n        precise: true\n      };\n    }\n\n    result += segmentDurationWithParts(playlist, segment);\n\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: result + segment.start,\n        precise: true\n      };\n    }\n  }\n\n  return {\n    result,\n    precise: false\n  };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {number} endSequence the mediaSequence to stop walking on\n */\n\n\nconst forwardDuration = function (playlist, endSequence) {\n  let result = 0;\n  let segment;\n  let i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n  // information\n\n  for (; i < playlist.segments.length; i++) {\n    segment = playlist.segments[i];\n\n    if (typeof segment.start !== 'undefined') {\n      return {\n        result: segment.start - result,\n        precise: true\n      };\n    }\n\n    result += segmentDurationWithParts(playlist, segment);\n\n    if (typeof segment.end !== 'undefined') {\n      return {\n        result: segment.end - result,\n        precise: true\n      };\n    }\n  } // indicate we didn't find a useful duration estimate\n\n\n  return {\n    result: -1,\n    precise: false\n  };\n};\n/**\n  * Calculate the media duration from the segments associated with a\n  * playlist. The duration of a subinterval of the available segments\n  * may be calculated by specifying an end index.\n  *\n  * @param {Object} playlist a media playlist object\n  * @param {number=} endSequence an exclusive upper boundary\n  * for the playlist.  Defaults to playlist length.\n  * @param {number} expired the amount of time that has dropped\n  * off the front of the playlist in a live scenario\n  * @return {number} the duration between the first available segment\n  * and end index.\n  */\n\n\nconst intervalDuration = function (playlist, endSequence, expired) {\n  if (typeof endSequence === 'undefined') {\n    endSequence = playlist.mediaSequence + playlist.segments.length;\n  }\n\n  if (endSequence < playlist.mediaSequence) {\n    return 0;\n  } // do a backward walk to estimate the duration\n\n\n  const backward = backwardDuration(playlist, endSequence);\n\n  if (backward.precise) {\n    // if we were able to base our duration estimate on timing\n    // information provided directly from the Media Source, return\n    // it\n    return backward.result;\n  } // walk forward to see if a precise duration estimate can be made\n  // that way\n\n\n  const forward = forwardDuration(playlist, endSequence);\n\n  if (forward.precise) {\n    // we found a segment that has been buffered and so it's\n    // position is known precisely\n    return forward.result;\n  } // return the less-precise, playlist-based duration estimate\n\n\n  return backward.result + expired;\n};\n/**\n  * Calculates the duration of a playlist. If a start and end index\n  * are specified, the duration will be for the subset of the media\n  * timeline between those two indices. The total duration for live\n  * playlists is always Infinity.\n  *\n  * @param {Object} playlist a media playlist object\n  * @param {number=} endSequence an exclusive upper\n  * boundary for the playlist. Defaults to the playlist media\n  * sequence number plus its length.\n  * @param {number=} expired the amount of time that has\n  * dropped off the front of the playlist in a live scenario\n  * @return {number} the duration between the start index and end\n  * index.\n  */\n\n\nconst duration = function (playlist, endSequence, expired) {\n  if (!playlist) {\n    return 0;\n  }\n\n  if (typeof expired !== 'number') {\n    expired = 0;\n  } // if a slice of the total duration is not requested, use\n  // playlist-level duration indicators when they're present\n\n\n  if (typeof endSequence === 'undefined') {\n    // if present, use the duration specified in the playlist\n    if (playlist.totalDuration) {\n      return playlist.totalDuration;\n    } // duration should be Infinity for live playlists\n\n\n    if (!playlist.endList) {\n      return window$1.Infinity;\n    }\n  } // calculate the total duration based on the segment durations\n\n\n  return intervalDuration(playlist, endSequence, expired);\n};\n/**\n  * Calculate the time between two indexes in the current playlist\n  * neight the start- nor the end-index need to be within the current\n  * playlist in which case, the targetDuration of the playlist is used\n  * to approximate the durations of the segments\n  *\n  * @param {Array} options.durationList list to iterate over for durations.\n  * @param {number} options.defaultDuration duration to use for elements before or after the durationList\n  * @param {number} options.startIndex partsAndSegments index to start\n  * @param {number} options.endIndex partsAndSegments index to end.\n  * @return {number} the number of seconds between startIndex and endIndex\n  */\n\nconst sumDurations = function ({\n  defaultDuration,\n  durationList,\n  startIndex,\n  endIndex\n}) {\n  let durations = 0;\n\n  if (startIndex > endIndex) {\n    [startIndex, endIndex] = [endIndex, startIndex];\n  }\n\n  if (startIndex < 0) {\n    for (let i = startIndex; i < Math.min(0, endIndex); i++) {\n      durations += defaultDuration;\n    }\n\n    startIndex = 0;\n  }\n\n  for (let i = startIndex; i < endIndex; i++) {\n    durations += durationList[i].duration;\n  }\n\n  return durations;\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} expired the amount of time that has\n *                  dropped off the front of the playlist in a live scenario\n * @param {boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n *                        playlist end calculation should consider the safe live end\n *                        (truncate the playlist end by three segments). This is normally\n *                        used for calculating the end of the playlist's seekable range.\n *                        This takes into account the value of liveEdgePadding.\n *                        Setting liveEdgePadding to 0 is equivalent to setting this to false.\n * @param {number} liveEdgePadding a number indicating how far from the end of the playlist we should be in seconds.\n *                 If this is provided, it is used in the safe live end calculation.\n *                 Setting useSafeLiveEnd=false or liveEdgePadding=0 are equivalent.\n *                 Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {number} the end time of playlist\n * @function playlistEnd\n */\n\nconst playlistEnd = function (playlist, expired, useSafeLiveEnd, liveEdgePadding) {\n  if (!playlist || !playlist.segments) {\n    return null;\n  }\n\n  if (playlist.endList) {\n    return duration(playlist);\n  }\n\n  if (expired === null) {\n    return null;\n  }\n\n  expired = expired || 0;\n  let lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);\n\n  if (useSafeLiveEnd) {\n    liveEdgePadding = typeof liveEdgePadding === 'number' ? liveEdgePadding : liveEdgeDelay(null, playlist);\n    lastSegmentEndTime -= liveEdgePadding;\n  } // don't return a time less than zero\n\n\n  return Math.max(0, lastSegmentEndTime);\n};\n/**\n  * Calculates the interval of time that is currently seekable in a\n  * playlist. The returned time ranges are relative to the earliest\n  * moment in the specified playlist that is still available. A full\n  * seekable implementation for live streams would need to offset\n  * these values by the duration of content that has expired from the\n  * stream.\n  *\n  * @param {Object} playlist a media playlist object\n  * dropped off the front of the playlist in a live scenario\n  * @param {number=} expired the amount of time that has\n  * dropped off the front of the playlist in a live scenario\n  * @param {number} liveEdgePadding how far from the end of the playlist we should be in seconds.\n  *        Corresponds to suggestedPresentationDelay in DASH manifests.\n  * @return {TimeRanges} the periods of time that are valid targets\n  * for seeking\n  */\n\nconst seekable = function (playlist, expired, liveEdgePadding) {\n  const useSafeLiveEnd = true;\n  const seekableStart = expired || 0;\n  let seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);\n\n  if (seekableEnd === null) {\n    return createTimeRanges();\n  } // Clamp seekable end since it can not be less than the seekable start\n\n\n  if (seekableEnd < seekableStart) {\n    seekableEnd = seekableStart;\n  }\n\n  return createTimeRanges(seekableStart, seekableEnd);\n};\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} options.playlist the media playlist to query\n * @param {number} options.currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {number} options.startTime the time when the segment/part starts\n * @param {number} options.startingSegmentIndex the segment index to start looking at.\n * @param {number?} [options.startingPartIndex] the part index to look at within the segment.\n *\n * @return {Object} an object with partIndex, segmentIndex, and startTime.\n */\n\nconst getMediaInfoForTime = function ({\n  playlist,\n  currentTime,\n  startingSegmentIndex,\n  startingPartIndex,\n  startTime,\n  exactManifestTimings\n}) {\n  let time = currentTime - startTime;\n  const partsAndSegments = getPartsAndSegments(playlist);\n  let startIndex = 0;\n\n  for (let i = 0; i < partsAndSegments.length; i++) {\n    const partAndSegment = partsAndSegments[i];\n\n    if (startingSegmentIndex !== partAndSegment.segmentIndex) {\n      continue;\n    } // skip this if part index does not match.\n\n\n    if (typeof startingPartIndex === 'number' && typeof partAndSegment.partIndex === 'number' && startingPartIndex !== partAndSegment.partIndex) {\n      continue;\n    }\n\n    startIndex = i;\n    break;\n  }\n\n  if (time < 0) {\n    // Walk backward from startIndex in the playlist, adding durations\n    // until we find a segment that contains `time` and return it\n    if (startIndex > 0) {\n      for (let i = startIndex - 1; i >= 0; i--) {\n        const partAndSegment = partsAndSegments[i];\n        time += partAndSegment.duration;\n\n        if (exactManifestTimings) {\n          if (time < 0) {\n            continue;\n          }\n        } else if (time + TIME_FUDGE_FACTOR <= 0) {\n          continue;\n        }\n\n        return {\n          partIndex: partAndSegment.partIndex,\n          segmentIndex: partAndSegment.segmentIndex,\n          startTime: startTime - sumDurations({\n            defaultDuration: playlist.targetDuration,\n            durationList: partsAndSegments,\n            startIndex,\n            endIndex: i\n          })\n        };\n      }\n    } // We were unable to find a good segment within the playlist\n    // so select the first segment\n\n\n    return {\n      partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n      segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n      startTime: currentTime\n    };\n  } // When startIndex is negative, we first walk forward to first segment\n  // adding target durations. If we \"run out of time\" before getting to\n  // the first segment, return the first segment\n\n\n  if (startIndex < 0) {\n    for (let i = startIndex; i < 0; i++) {\n      time -= playlist.targetDuration;\n\n      if (time < 0) {\n        return {\n          partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n          segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n          startTime: currentTime\n        };\n      }\n    }\n\n    startIndex = 0;\n  } // Walk forward from startIndex in the playlist, subtracting durations\n  // until we find a segment that contains `time` and return it\n\n\n  for (let i = startIndex; i < partsAndSegments.length; i++) {\n    const partAndSegment = partsAndSegments[i];\n    time -= partAndSegment.duration;\n    const canUseFudgeFactor = partAndSegment.duration > TIME_FUDGE_FACTOR;\n    const isExactlyAtTheEnd = time === 0;\n    const isExtremelyCloseToTheEnd = canUseFudgeFactor && time + TIME_FUDGE_FACTOR >= 0;\n\n    if (isExactlyAtTheEnd || isExtremelyCloseToTheEnd) {\n      // 1) We are exactly at the end of the current segment.\n      // 2) We are extremely close to the end of the current segment (The difference is less than  1 / 30).\n      //    We may encounter this situation when\n      //    we don't have exact match between segment duration info in the manifest and the actual duration of the segment\n      //    For example:\n      //    We appended 3 segments 10 seconds each, meaning we should have 30 sec buffered,\n      //    but we the actual buffered is 29.99999\n      //\n      // In both cases:\n      // if we passed current time -> it means that we already played current segment\n      // if we passed buffered.end -> it means that this segment is already loaded and buffered\n      // we should select the next segment if we have one:\n      if (i !== partsAndSegments.length - 1) {\n        continue;\n      }\n    }\n\n    if (exactManifestTimings) {\n      if (time > 0) {\n        continue;\n      }\n    } else if (time - TIME_FUDGE_FACTOR >= 0) {\n      continue;\n    }\n\n    return {\n      partIndex: partAndSegment.partIndex,\n      segmentIndex: partAndSegment.segmentIndex,\n      startTime: startTime + sumDurations({\n        defaultDuration: playlist.targetDuration,\n        durationList: partsAndSegments,\n        startIndex,\n        endIndex: i\n      })\n    };\n  } // We are out of possible candidates so load the last one...\n\n\n  return {\n    segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,\n    partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,\n    startTime: currentTime\n  };\n};\n/**\n * Check whether the playlist is excluded or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is excluded or not\n * @function isExcluded\n */\n\nconst isExcluded = function (playlist) {\n  return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been excluded permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\nconst isIncompatible = function (playlist) {\n  return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\nconst isEnabled = function (playlist) {\n  const excluded = isExcluded(playlist);\n  return !playlist.disabled && !excluded;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\nconst isDisabled = function (playlist) {\n  return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {boolean} true if it's an AES encrypted HLS stream\n */\n\nconst isAes = function (media) {\n  for (let i = 0; i < media.segments.length; i++) {\n    if (media.segments[i].key) {\n      return true;\n    }\n  }\n\n  return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {string} attr\n *        Attribute to check for\n * @param {Object} playlist\n *        The media playlist object\n * @return {boolean}\n *         Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\nconst hasAttribute = function (attr, playlist) {\n  return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {number} segmentDuration\n *        Duration of requested segment\n * @param {number} bandwidth\n *        Current measured bandwidth of the player\n * @param {Object} playlist\n *        The media playlist object\n * @param {number=} bytesReceived\n *        Number of bytes already received for the request. Defaults to 0\n * @return {number|NaN}\n *         The estimated time to request the segment. NaN if bandwidth information for\n *         the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\nconst estimateSegmentRequestTime = function (segmentDuration, bandwidth, playlist, bytesReceived = 0) {\n  if (!hasAttribute('BANDWIDTH', playlist)) {\n    return NaN;\n  }\n\n  const size = segmentDuration * playlist.attributes.BANDWIDTH;\n  return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\nconst isLowestEnabledRendition = (main, media) => {\n  if (main.playlists.length === 1) {\n    return true;\n  }\n\n  const currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n  return main.playlists.filter(playlist => {\n    if (!isEnabled(playlist)) {\n      return false;\n    }\n\n    return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n  }).length === 0;\n};\nconst playlistMatch = (a, b) => {\n  // both playlits are null\n  // or only one playlist is non-null\n  // no match\n  if (!a && !b || !a && b || a && !b) {\n    return false;\n  } // playlist objects are the same, match\n\n\n  if (a === b) {\n    return true;\n  } // first try to use id as it should be the most\n  // accurate\n\n\n  if (a.id && b.id && a.id === b.id) {\n    return true;\n  } // next try to use reslovedUri as it should be the\n  // second most accurate.\n\n\n  if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {\n    return true;\n  } // finally try to use uri as it should be accurate\n  // but might miss a few cases for relative uris\n\n\n  if (a.uri && b.uri && a.uri === b.uri) {\n    return true;\n  }\n\n  return false;\n};\n\nconst someAudioVariant = function (main, callback) {\n  const AUDIO = main && main.mediaGroups && main.mediaGroups.AUDIO || {};\n  let found = false;\n\n  for (const groupName in AUDIO) {\n    for (const label in AUDIO[groupName]) {\n      found = callback(AUDIO[groupName][label]);\n\n      if (found) {\n        break;\n      }\n    }\n\n    if (found) {\n      break;\n    }\n  }\n\n  return !!found;\n};\n\nconst isAudioOnly = main => {\n  // we are audio only if we have no main playlists but do\n  // have media group playlists.\n  if (!main || !main.playlists || !main.playlists.length) {\n    // without audio variants or playlists this\n    // is not an audio only main.\n    const found = someAudioVariant(main, variant => variant.playlists && variant.playlists.length || variant.uri);\n    return found;\n  } // if every playlist has only an audio codec it is audio only\n\n\n  for (let i = 0; i < main.playlists.length; i++) {\n    const playlist = main.playlists[i];\n    const CODECS = playlist.attributes && playlist.attributes.CODECS; // all codecs are audio, this is an audio playlist.\n\n    if (CODECS && CODECS.split(',').every(c => isAudioCodec(c))) {\n      continue;\n    } // playlist is in an audio group it is audio only\n\n\n    const found = someAudioVariant(main, variant => playlistMatch(playlist, variant));\n\n    if (found) {\n      continue;\n    } // if we make it here this playlist isn't audio and we\n    // are not audio only\n\n\n    return false;\n  } // if we make it past every playlist without returning, then\n  // this is an audio only playlist.\n\n\n  return true;\n}; // exports\n\nvar Playlist = {\n  liveEdgeDelay,\n  duration,\n  seekable,\n  getMediaInfoForTime,\n  isEnabled,\n  isDisabled,\n  isExcluded,\n  isIncompatible,\n  playlistEnd,\n  isAes,\n  hasAttribute,\n  estimateSegmentRequestTime,\n  isLowestEnabledRendition,\n  isAudioOnly,\n  playlistMatch,\n  segmentDurationWithParts\n};\n\nconst {\n  log\n} = videojs;\nconst createPlaylistID = (index, uri) => {\n  return `${index}-${uri}`;\n}; // default function for creating a group id\n\nconst groupID = (type, group, label) => {\n  return `placeholder-uri-${type}-${group}-${label}`;\n};\n/**\n * Parses a given m3u8 playlist\n *\n * @param {Function} [onwarn]\n *        a function to call when the parser triggers a warning event.\n * @param {Function} [oninfo]\n *        a function to call when the parser triggers an info event.\n * @param {string} manifestString\n *        The downloaded manifest string\n * @param {Object[]} [customTagParsers]\n *        An array of custom tag parsers for the m3u8-parser instance\n * @param {Object[]} [customTagMappers]\n *        An array of custom tag mappers for the m3u8-parser instance\n * @param {boolean} [llhls]\n *        Whether to keep ll-hls features in the manifest after parsing.\n * @return {Object}\n *         The manifest object\n */\n\nconst parseManifest = ({\n  onwarn,\n  oninfo,\n  manifestString,\n  customTagParsers = [],\n  customTagMappers = [],\n  llhls\n}) => {\n  const parser = new Parser();\n\n  if (onwarn) {\n    parser.on('warn', onwarn);\n  }\n\n  if (oninfo) {\n    parser.on('info', oninfo);\n  }\n\n  customTagParsers.forEach(customParser => parser.addParser(customParser));\n  customTagMappers.forEach(mapper => parser.addTagMapper(mapper));\n  parser.push(manifestString);\n  parser.end();\n  const manifest = parser.manifest; // remove llhls features from the parsed manifest\n  // if we don't want llhls support.\n\n  if (!llhls) {\n    ['preloadSegment', 'skip', 'serverControl', 'renditionReports', 'partInf', 'partTargetDuration'].forEach(function (k) {\n      if (manifest.hasOwnProperty(k)) {\n        delete manifest[k];\n      }\n    });\n\n    if (manifest.segments) {\n      manifest.segments.forEach(function (segment) {\n        ['parts', 'preloadHints'].forEach(function (k) {\n          if (segment.hasOwnProperty(k)) {\n            delete segment[k];\n          }\n        });\n      });\n    }\n  }\n\n  if (!manifest.targetDuration) {\n    let targetDuration = 10;\n\n    if (manifest.segments && manifest.segments.length) {\n      targetDuration = manifest.segments.reduce((acc, s) => Math.max(acc, s.duration), 0);\n    }\n\n    if (onwarn) {\n      onwarn({\n        message: `manifest has no targetDuration defaulting to ${targetDuration}`\n      });\n    }\n\n    manifest.targetDuration = targetDuration;\n  }\n\n  const parts = getLastParts(manifest);\n\n  if (parts.length && !manifest.partTargetDuration) {\n    const partTargetDuration = parts.reduce((acc, p) => Math.max(acc, p.duration), 0);\n\n    if (onwarn) {\n      onwarn({\n        message: `manifest has no partTargetDuration defaulting to ${partTargetDuration}`\n      });\n      log.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.');\n    }\n\n    manifest.partTargetDuration = partTargetDuration;\n  }\n\n  return manifest;\n};\n/**\n * Loops through all supported media groups in main and calls the provided\n * callback for each group\n *\n * @param {Object} main\n *        The parsed main manifest object\n * @param {Function} callback\n *        Callback to call for each media group\n */\n\nconst forEachMediaGroup = (main, callback) => {\n  if (!main.mediaGroups) {\n    return;\n  }\n\n  ['AUDIO', 'SUBTITLES'].forEach(mediaType => {\n    if (!main.mediaGroups[mediaType]) {\n      return;\n    }\n\n    for (const groupKey in main.mediaGroups[mediaType]) {\n      for (const labelKey in main.mediaGroups[mediaType][groupKey]) {\n        const mediaProperties = main.mediaGroups[mediaType][groupKey][labelKey];\n        callback(mediaProperties, mediaType, groupKey, labelKey);\n      }\n    }\n  });\n};\n/**\n * Adds properties and attributes to the playlist to keep consistent functionality for\n * playlists throughout VHS.\n *\n * @param {Object} config\n *        Arguments object\n * @param {Object} config.playlist\n *        The media playlist\n * @param {string} [config.uri]\n *        The uri to the media playlist (if media playlist is not from within a main\n *        playlist)\n * @param {string} id\n *        ID to use for the playlist\n */\n\nconst setupMediaPlaylist = ({\n  playlist,\n  uri,\n  id\n}) => {\n  playlist.id = id;\n  playlist.playlistErrors_ = 0;\n\n  if (uri) {\n    // For media playlists, m3u8-parser does not have access to a URI, as HLS media\n    // playlists do not contain their own source URI, but one is needed for consistency in\n    // VHS.\n    playlist.uri = uri;\n  } // For HLS main playlists, even though certain attributes MUST be defined, the\n  // stream may still be played without them.\n  // For HLS media playlists, m3u8-parser does not attach an attributes object to the\n  // manifest.\n  //\n  // To avoid undefined reference errors through the project, and make the code easier\n  // to write/read, add an empty attributes object for these cases.\n\n\n  playlist.attributes = playlist.attributes || {};\n};\n/**\n * Adds ID, resolvedUri, and attributes properties to each playlist of the main, where\n * necessary. In addition, creates playlist IDs for each playlist and adds playlist ID to\n * playlist references to the playlists array.\n *\n * @param {Object} main\n *        The main playlist\n */\n\nconst setupMediaPlaylists = main => {\n  let i = main.playlists.length;\n\n  while (i--) {\n    const playlist = main.playlists[i];\n    setupMediaPlaylist({\n      playlist,\n      id: createPlaylistID(i, playlist.uri)\n    });\n    playlist.resolvedUri = resolveUrl(main.uri, playlist.uri);\n    main.playlists[playlist.id] = playlist; // URI reference added for backwards compatibility\n\n    main.playlists[playlist.uri] = playlist; // Although the spec states an #EXT-X-STREAM-INF tag MUST have a BANDWIDTH attribute,\n    // the stream can be played without it. Although an attributes property may have been\n    // added to the playlist to prevent undefined references, issue a warning to fix the\n    // manifest.\n\n    if (!playlist.attributes.BANDWIDTH) {\n      log.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n    }\n  }\n};\n/**\n * Adds resolvedUri properties to each media group.\n *\n * @param {Object} main\n *        The main playlist\n */\n\nconst resolveMediaGroupUris = main => {\n  forEachMediaGroup(main, properties => {\n    if (properties.uri) {\n      properties.resolvedUri = resolveUrl(main.uri, properties.uri);\n    }\n  });\n};\n/**\n * Creates a main playlist wrapper to insert a sole media playlist into.\n *\n * @param {Object} media\n *        Media playlist\n * @param {string} uri\n *        The media URI\n *\n * @return {Object}\n *         main playlist\n */\n\nconst mainForMedia = (media, uri) => {\n  const id = createPlaylistID(0, uri);\n  const main = {\n    mediaGroups: {\n      'AUDIO': {},\n      'VIDEO': {},\n      'CLOSED-CAPTIONS': {},\n      'SUBTITLES': {}\n    },\n    uri: window$1.location.href,\n    resolvedUri: window$1.location.href,\n    playlists: [{\n      uri,\n      id,\n      resolvedUri: uri,\n      // m3u8-parser does not attach an attributes property to media playlists so make\n      // sure that the property is attached to avoid undefined reference errors\n      attributes: {}\n    }]\n  }; // set up ID reference\n\n  main.playlists[id] = main.playlists[0]; // URI reference added for backwards compatibility\n\n  main.playlists[uri] = main.playlists[0];\n  return main;\n};\n/**\n * Does an in-place update of the main manifest to add updated playlist URI references\n * as well as other properties needed by VHS that aren't included by the parser.\n *\n * @param {Object} main\n *        main manifest object\n * @param {string} uri\n *        The source URI\n * @param {function} createGroupID\n *        A function to determine how to create the groupID for mediaGroups\n */\n\nconst addPropertiesToMain = (main, uri, createGroupID = groupID) => {\n  main.uri = uri;\n\n  for (let i = 0; i < main.playlists.length; i++) {\n    if (!main.playlists[i].uri) {\n      // Set up phony URIs for the playlists since playlists are referenced by their URIs\n      // throughout VHS, but some formats (e.g., DASH) don't have external URIs\n      // TODO: consider adding dummy URIs in mpd-parser\n      const phonyUri = `placeholder-uri-${i}`;\n      main.playlists[i].uri = phonyUri;\n    }\n  }\n\n  const audioOnlyMain = isAudioOnly(main);\n  forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n    // add a playlist array under properties\n    if (!properties.playlists || !properties.playlists.length) {\n      // If the manifest is audio only and this media group does not have a uri, check\n      // if the media group is located in the main list of playlists. If it is, don't add\n      // placeholder properties as it shouldn't be considered an alternate audio track.\n      if (audioOnlyMain && mediaType === 'AUDIO' && !properties.uri) {\n        for (let i = 0; i < main.playlists.length; i++) {\n          const p = main.playlists[i];\n\n          if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {\n            return;\n          }\n        }\n      }\n\n      properties.playlists = [_extends({}, properties)];\n    }\n\n    properties.playlists.forEach(function (p, i) {\n      const groupId = createGroupID(mediaType, groupKey, labelKey, p);\n      const id = createPlaylistID(i, groupId);\n\n      if (p.uri) {\n        p.resolvedUri = p.resolvedUri || resolveUrl(main.uri, p.uri);\n      } else {\n        // DEPRECATED, this has been added to prevent a breaking change.\n        // previously we only ever had a single media group playlist, so\n        // we mark the first playlist uri without prepending the index as we used to\n        // ideally we would do all of the playlists the same way.\n        p.uri = i === 0 ? groupId : id; // don't resolve a placeholder uri to an absolute url, just use\n        // the placeholder again\n\n        p.resolvedUri = p.uri;\n      }\n\n      p.id = p.id || id; // add an empty attributes object, all playlists are\n      // expected to have this.\n\n      p.attributes = p.attributes || {}; // setup ID and URI references (URI for backwards compatibility)\n\n      main.playlists[p.id] = p;\n      main.playlists[p.uri] = p;\n    });\n  });\n  setupMediaPlaylists(main);\n  resolveMediaGroupUris(main);\n};\n\nclass DateRangesStorage {\n  constructor() {\n    this.offset_ = null;\n    this.pendingDateRanges_ = new Map();\n    this.processedDateRanges_ = new Map();\n  }\n\n  setOffset(segments = []) {\n    // already set\n    if (this.offset_ !== null) {\n      return;\n    } // no segment to process\n\n\n    if (!segments.length) {\n      return;\n    }\n\n    const [firstSegment] = segments; // no program date time\n\n    if (firstSegment.programDateTime === undefined) {\n      return;\n    } // Set offset as ProgramDateTime for the very first segment of the very first playlist load:\n\n\n    this.offset_ = firstSegment.programDateTime / 1000;\n  }\n\n  setPendingDateRanges(dateRanges = []) {\n    if (!dateRanges.length) {\n      return;\n    }\n\n    const [dateRange] = dateRanges;\n    const startTime = dateRange.startDate.getTime();\n    this.trimProcessedDateRanges_(startTime);\n    this.pendingDateRanges_ = dateRanges.reduce((map, pendingDateRange) => {\n      map.set(pendingDateRange.id, pendingDateRange);\n      return map;\n    }, new Map());\n  }\n\n  processDateRange(dateRange) {\n    this.pendingDateRanges_.delete(dateRange.id);\n    this.processedDateRanges_.set(dateRange.id, dateRange);\n  }\n\n  getDateRangesToProcess() {\n    if (this.offset_ === null) {\n      return [];\n    }\n\n    const dateRangeClasses = {};\n    const dateRangesToProcess = [];\n    this.pendingDateRanges_.forEach((dateRange, id) => {\n      if (this.processedDateRanges_.has(id)) {\n        return;\n      }\n\n      dateRange.startTime = dateRange.startDate.getTime() / 1000 - this.offset_;\n\n      dateRange.processDateRange = () => this.processDateRange(dateRange);\n\n      dateRangesToProcess.push(dateRange);\n\n      if (!dateRange.class) {\n        return;\n      }\n\n      if (dateRangeClasses[dateRange.class]) {\n        const length = dateRangeClasses[dateRange.class].push(dateRange);\n        dateRange.classListIndex = length - 1;\n      } else {\n        dateRangeClasses[dateRange.class] = [dateRange];\n        dateRange.classListIndex = 0;\n      }\n    });\n\n    for (const dateRange of dateRangesToProcess) {\n      const classList = dateRangeClasses[dateRange.class] || [];\n\n      if (dateRange.endDate) {\n        dateRange.endTime = dateRange.endDate.getTime() / 1000 - this.offset_;\n      } else if (dateRange.endOnNext && classList[dateRange.classListIndex + 1]) {\n        dateRange.endTime = classList[dateRange.classListIndex + 1].startTime;\n      } else if (dateRange.duration) {\n        dateRange.endTime = dateRange.startTime + dateRange.duration;\n      } else if (dateRange.plannedDuration) {\n        dateRange.endTime = dateRange.startTime + dateRange.plannedDuration;\n      } else {\n        dateRange.endTime = dateRange.startTime;\n      }\n    }\n\n    return dateRangesToProcess;\n  }\n\n  trimProcessedDateRanges_(startTime) {\n    const copy = new Map(this.processedDateRanges_);\n    copy.forEach((dateRange, id) => {\n      if (dateRange.startDate.getTime() < startTime) {\n        this.processedDateRanges_.delete(id);\n      }\n    });\n  }\n\n}\n\nconst {\n  EventTarget: EventTarget$1\n} = videojs;\n\nconst addLLHLSQueryDirectives = (uri, media) => {\n  if (media.endList || !media.serverControl) {\n    return uri;\n  }\n\n  const parameters = {};\n\n  if (media.serverControl.canBlockReload) {\n    const {\n      preloadSegment\n    } = media; // next msn is a zero based value, length is not.\n\n    let nextMSN = media.mediaSequence + media.segments.length; // If preload segment has parts then it is likely\n    // that we are going to request a part of that preload segment.\n    // the logic below is used to determine that.\n\n    if (preloadSegment) {\n      const parts = preloadSegment.parts || []; // _HLS_part is a zero based index\n\n      const nextPart = getKnownPartCount(media) - 1; // if nextPart is > -1 and not equal to just the\n      // length of parts, then we know we had part preload hints\n      // and we need to add the _HLS_part= query\n\n      if (nextPart > -1 && nextPart !== parts.length - 1) {\n        // add existing parts to our preload hints\n        // eslint-disable-next-line\n        parameters._HLS_part = nextPart;\n      } // this if statement makes sure that we request the msn\n      // of the preload segment if:\n      // 1. the preload segment had parts (and was not yet a full segment)\n      //    but was added to our segments array\n      // 2. the preload segment had preload hints for parts that are not in\n      //    the manifest yet.\n      // in all other cases we want the segment after the preload segment\n      // which will be given by using media.segments.length because it is 1 based\n      // rather than 0 based.\n\n\n      if (nextPart > -1 || parts.length) {\n        nextMSN--;\n      }\n    } // add _HLS_msn= in front of any _HLS_part query\n    // eslint-disable-next-line\n\n\n    parameters._HLS_msn = nextMSN;\n  }\n\n  if (media.serverControl && media.serverControl.canSkipUntil) {\n    // add _HLS_skip= infront of all other queries.\n    // eslint-disable-next-line\n    parameters._HLS_skip = media.serverControl.canSkipDateranges ? 'v2' : 'YES';\n  }\n\n  if (Object.keys(parameters).length) {\n    const parsedUri = new window$1.URL(uri);\n    ['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function (name) {\n      if (!parameters.hasOwnProperty(name)) {\n        return;\n      }\n\n      parsedUri.searchParams.set(name, parameters[name]);\n    });\n    uri = parsedUri.toString();\n  }\n\n  return uri;\n};\n/**\n * Returns a new segment object with properties and\n * the parts array merged.\n *\n * @param {Object} a the old segment\n * @param {Object} b the new segment\n *\n * @return {Object} the merged segment\n */\n\n\nconst updateSegment = (a, b) => {\n  if (!a) {\n    return b;\n  }\n\n  const result = merge(a, b); // if only the old segment has preload hints\n  // and the new one does not, remove preload hints.\n\n  if (a.preloadHints && !b.preloadHints) {\n    delete result.preloadHints;\n  } // if only the old segment has parts\n  // then the parts are no longer valid\n\n\n  if (a.parts && !b.parts) {\n    delete result.parts; // if both segments have parts\n    // copy part propeties from the old segment\n    // to the new one.\n  } else if (a.parts && b.parts) {\n    for (let i = 0; i < b.parts.length; i++) {\n      if (a.parts && a.parts[i]) {\n        result.parts[i] = merge(a.parts[i], b.parts[i]);\n      }\n    }\n  } // set skipped to false for segments that have\n  // have had information merged from the old segment.\n\n\n  if (!a.skipped && b.skipped) {\n    result.skipped = false;\n  } // set preload to false for segments that have\n  // had information added in the new segment.\n\n\n  if (a.preload && !b.preload) {\n    result.preload = false;\n  }\n\n  return result;\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be ovewritten.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return {Array} a list of merged segment objects\n */\n\nconst updateSegments = (original, update, offset) => {\n  const oldSegments = original.slice();\n  const newSegments = update.slice();\n  offset = offset || 0;\n  const result = [];\n  let currentMap;\n\n  for (let newIndex = 0; newIndex < newSegments.length; newIndex++) {\n    const oldSegment = oldSegments[newIndex + offset];\n    const newSegment = newSegments[newIndex];\n\n    if (oldSegment) {\n      currentMap = oldSegment.map || currentMap;\n      result.push(updateSegment(oldSegment, newSegment));\n    } else {\n      // carry over map to new segment if it is missing\n      if (currentMap && !newSegment.map) {\n        newSegment.map = currentMap;\n      }\n\n      result.push(newSegment);\n    }\n  }\n\n  return result;\n};\nconst resolveSegmentUris = (segment, baseUri) => {\n  // preloadSegment will not have a uri at all\n  // as the segment isn't actually in the manifest yet, only parts\n  if (!segment.resolvedUri && segment.uri) {\n    segment.resolvedUri = resolveUrl(baseUri, segment.uri);\n  }\n\n  if (segment.key && !segment.key.resolvedUri) {\n    segment.key.resolvedUri = resolveUrl(baseUri, segment.key.uri);\n  }\n\n  if (segment.map && !segment.map.resolvedUri) {\n    segment.map.resolvedUri = resolveUrl(baseUri, segment.map.uri);\n  }\n\n  if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {\n    segment.map.key.resolvedUri = resolveUrl(baseUri, segment.map.key.uri);\n  }\n\n  if (segment.parts && segment.parts.length) {\n    segment.parts.forEach(p => {\n      if (p.resolvedUri) {\n        return;\n      }\n\n      p.resolvedUri = resolveUrl(baseUri, p.uri);\n    });\n  }\n\n  if (segment.preloadHints && segment.preloadHints.length) {\n    segment.preloadHints.forEach(p => {\n      if (p.resolvedUri) {\n        return;\n      }\n\n      p.resolvedUri = resolveUrl(baseUri, p.uri);\n    });\n  }\n};\n\nconst getAllSegments = function (media) {\n  const segments = media.segments || [];\n  const preloadSegment = media.preloadSegment; // a preloadSegment with only preloadHints is not currently\n  // a usable segment, only include a preloadSegment that has\n  // parts.\n\n  if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {\n    // if preloadHints has a MAP that means that the\n    // init segment is going to change. We cannot use any of the parts\n    // from this preload segment.\n    if (preloadSegment.preloadHints) {\n      for (let i = 0; i < preloadSegment.preloadHints.length; i++) {\n        if (preloadSegment.preloadHints[i].type === 'MAP') {\n          return segments;\n        }\n      }\n    } // set the duration for our preload segment to target duration.\n\n\n    preloadSegment.duration = media.targetDuration;\n    preloadSegment.preload = true;\n    segments.push(preloadSegment);\n  }\n\n  return segments;\n}; // consider the playlist unchanged if the playlist object is the same or\n// the number of segments is equal, the media sequence number is unchanged,\n// and this playlist hasn't become the end of the playlist\n\n\nconst isPlaylistUnchanged = (a, b) => a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;\n/**\n  * Returns a new main playlist that is the result of merging an\n  * updated media playlist into the original version. If the\n  * updated media playlist does not match any of the playlist\n  * entries in the original main playlist, null is returned.\n  *\n  * @param {Object} main a parsed main M3U8 object\n  * @param {Object} media a parsed media M3U8 object\n  * @return {Object} a new object that represents the original\n  * main playlist with the updated media playlist merged in, or\n  * null if the merge produced no change.\n  */\n\nconst updateMain$1 = (main, newMedia, unchangedCheck = isPlaylistUnchanged) => {\n  const result = merge(main, {});\n  const oldMedia = result.playlists[newMedia.id];\n\n  if (!oldMedia) {\n    return null;\n  }\n\n  if (unchangedCheck(oldMedia, newMedia)) {\n    return null;\n  }\n\n  newMedia.segments = getAllSegments(newMedia);\n  const mergedPlaylist = merge(oldMedia, newMedia); // always use the new media's preload segment\n\n  if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {\n    delete mergedPlaylist.preloadSegment;\n  } // if the update could overlap existing segment information, merge the two segment lists\n\n\n  if (oldMedia.segments) {\n    if (newMedia.skip) {\n      newMedia.segments = newMedia.segments || []; // add back in objects for skipped segments, so that we merge\n      // old properties into the new segments\n\n      for (let i = 0; i < newMedia.skip.skippedSegments; i++) {\n        newMedia.segments.unshift({\n          skipped: true\n        });\n      }\n    }\n\n    mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);\n  } // resolve any segment URIs to prevent us from having to do it later\n\n\n  mergedPlaylist.segments.forEach(segment => {\n    resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n  }); // TODO Right now in the playlists array there are two references to each playlist, one\n  // that is referenced by index, and one by URI. The index reference may no longer be\n  // necessary.\n\n  for (let i = 0; i < result.playlists.length; i++) {\n    if (result.playlists[i].id === newMedia.id) {\n      result.playlists[i] = mergedPlaylist;\n    }\n  }\n\n  result.playlists[newMedia.id] = mergedPlaylist; // URI reference added for backwards compatibility\n\n  result.playlists[newMedia.uri] = mergedPlaylist; // update media group playlist references.\n\n  forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n    if (!properties.playlists) {\n      return;\n    }\n\n    for (let i = 0; i < properties.playlists.length; i++) {\n      if (newMedia.id === properties.playlists[i].id) {\n        properties.playlists[i] = mergedPlaylist;\n      }\n    }\n  });\n  return result;\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n *        The current media\n * @param {boolean} update\n *        True if there were any updates from the last refresh, false otherwise\n * @return {number}\n *         The time in ms to wait before refreshing the live playlist\n */\n\nconst refreshDelay = (media, update) => {\n  const segments = media.segments || [];\n  const lastSegment = segments[segments.length - 1];\n  const lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];\n  const lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;\n\n  if (update && lastDuration) {\n    return lastDuration * 1000;\n  } // if the playlist is unchanged since the last reload or last segment duration\n  // cannot be determined, try again after half the target duration\n\n\n  return (media.partTargetDuration || media.targetDuration || 10) * 500;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {string|Object} src url or object of manifest\n * @param {boolean} withCredentials the withCredentials xhr option\n * @class\n */\n\nclass PlaylistLoader extends EventTarget$1 {\n  constructor(src, vhs, options = {}) {\n    super();\n\n    if (!src) {\n      throw new Error('A non-empty playlist URL or object is required');\n    }\n\n    this.logger_ = logger('PlaylistLoader');\n    const {\n      withCredentials = false\n    } = options;\n    this.src = src;\n    this.vhs_ = vhs;\n    this.withCredentials = withCredentials;\n    this.addDateRangesToTextTrack_ = options.addDateRangesToTextTrack;\n    const vhsOptions = vhs.options_;\n    this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];\n    this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];\n    this.llhls = vhsOptions && vhsOptions.llhls;\n    this.dateRangesStorage_ = new DateRangesStorage(); // initialize the loader state\n\n    this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n    this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this);\n    this.on('mediaupdatetimeout', this.handleMediaupdatetimeout_);\n    this.on('loadedplaylist', this.handleLoadedPlaylist_.bind(this));\n  }\n\n  handleLoadedPlaylist_() {\n    const mediaPlaylist = this.media();\n\n    if (!mediaPlaylist) {\n      return;\n    }\n\n    this.dateRangesStorage_.setOffset(mediaPlaylist.segments);\n    this.dateRangesStorage_.setPendingDateRanges(mediaPlaylist.dateRanges);\n    const availableDateRanges = this.dateRangesStorage_.getDateRangesToProcess();\n\n    if (!availableDateRanges.length || !this.addDateRangesToTextTrack_) {\n      return;\n    }\n\n    this.addDateRangesToTextTrack_(availableDateRanges);\n  }\n\n  handleMediaupdatetimeout_() {\n    if (this.state !== 'HAVE_METADATA') {\n      // only refresh the media playlist if no other activity is going on\n      return;\n    }\n\n    const media = this.media();\n    let uri = resolveUrl(this.main.uri, media.uri);\n\n    if (this.llhls) {\n      uri = addLLHLSQueryDirectives(uri, media);\n    }\n\n    this.state = 'HAVE_CURRENT_METADATA';\n    this.request = this.vhs_.xhr({\n      uri,\n      withCredentials: this.withCredentials\n    }, (error, req) => {\n      // disposed\n      if (!this.request) {\n        return;\n      }\n\n      if (error) {\n        return this.playlistRequestError(this.request, this.media(), 'HAVE_METADATA');\n      }\n\n      this.haveMetadata({\n        playlistString: this.request.responseText,\n        url: this.media().uri,\n        id: this.media().id\n      });\n    });\n  }\n\n  playlistRequestError(xhr, playlist, startingState) {\n    const {\n      uri,\n      id\n    } = playlist; // any in-flight request is now finished\n\n    this.request = null;\n\n    if (startingState) {\n      this.state = startingState;\n    }\n\n    this.error = {\n      playlist: this.main.playlists[id],\n      status: xhr.status,\n      message: `HLS playlist request error at URL: ${uri}.`,\n      responseText: xhr.responseText,\n      code: xhr.status >= 500 ? 4 : 2\n    };\n    this.trigger('error');\n  }\n\n  parseManifest_({\n    url,\n    manifestString\n  }) {\n    return parseManifest({\n      onwarn: ({\n        message\n      }) => this.logger_(`m3u8-parser warn for ${url}: ${message}`),\n      oninfo: ({\n        message\n      }) => this.logger_(`m3u8-parser info for ${url}: ${message}`),\n      manifestString,\n      customTagParsers: this.customTagParsers,\n      customTagMappers: this.customTagMappers,\n      llhls: this.llhls\n    });\n  }\n  /**\n   * Update the playlist loader's state in response to a new or updated playlist.\n   *\n   * @param {string} [playlistString]\n   *        Playlist string (if playlistObject is not provided)\n   * @param {Object} [playlistObject]\n   *        Playlist object (if playlistString is not provided)\n   * @param {string} url\n   *        URL of playlist\n   * @param {string} id\n   *        ID to use for playlist\n   */\n\n\n  haveMetadata({\n    playlistString,\n    playlistObject,\n    url,\n    id\n  }) {\n    // any in-flight request is now finished\n    this.request = null;\n    this.state = 'HAVE_METADATA';\n    const playlist = playlistObject || this.parseManifest_({\n      url,\n      manifestString: playlistString\n    });\n    playlist.lastRequest = Date.now();\n    setupMediaPlaylist({\n      playlist,\n      uri: url,\n      id\n    }); // merge this playlist into the main manifest\n\n    const update = updateMain$1(this.main, playlist);\n    this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;\n    this.pendingMedia_ = null;\n\n    if (update) {\n      this.main = update;\n      this.media_ = this.main.playlists[id];\n    } else {\n      this.trigger('playlistunchanged');\n    }\n\n    this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));\n    this.trigger('loadedplaylist');\n  }\n  /**\n    * Abort any outstanding work and clean up.\n    */\n\n\n  dispose() {\n    this.trigger('dispose');\n    this.stopRequest();\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    window$1.clearTimeout(this.finalRenditionTimeout);\n    this.dateRangesStorage_ = new DateRangesStorage();\n    this.off();\n  }\n\n  stopRequest() {\n    if (this.request) {\n      const oldRequest = this.request;\n      this.request = null;\n      oldRequest.onreadystatechange = null;\n      oldRequest.abort();\n    }\n  }\n  /**\n    * When called without any arguments, returns the currently\n    * active media playlist. When called with a single argument,\n    * triggers the playlist loader to asynchronously switch to the\n    * specified media playlist. Calling this method while the\n    * loader is in the HAVE_NOTHING causes an error to be emitted\n    * but otherwise has no effect.\n    *\n    * @param {Object=} playlist the parsed media playlist\n    * object to switch to\n    * @param {boolean=} shouldDelay whether we should delay the request by half target duration\n    *\n    * @return {Playlist} the current loaded media\n    */\n\n\n  media(playlist, shouldDelay) {\n    // getter\n    if (!playlist) {\n      return this.media_;\n    } // setter\n\n\n    if (this.state === 'HAVE_NOTHING') {\n      throw new Error('Cannot switch media playlist from ' + this.state);\n    } // find the playlist object if the target playlist has been\n    // specified by URI\n\n\n    if (typeof playlist === 'string') {\n      if (!this.main.playlists[playlist]) {\n        throw new Error('Unknown playlist URI: ' + playlist);\n      }\n\n      playlist = this.main.playlists[playlist];\n    }\n\n    window$1.clearTimeout(this.finalRenditionTimeout);\n\n    if (shouldDelay) {\n      const delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1000 || 5 * 1000;\n      this.finalRenditionTimeout = window$1.setTimeout(this.media.bind(this, playlist, false), delay);\n      return;\n    }\n\n    const startingState = this.state;\n    const mediaChange = !this.media_ || playlist.id !== this.media_.id;\n    const mainPlaylistRef = this.main.playlists[playlist.id]; // switch to fully loaded playlists immediately\n\n    if (mainPlaylistRef && mainPlaylistRef.endList || // handle the case of a playlist object (e.g., if using vhs-json with a resolved\n    // media playlist or, for the case of demuxed audio, a resolved audio media group)\n    playlist.endList && playlist.segments.length) {\n      // abort outstanding playlist requests\n      if (this.request) {\n        this.request.onreadystatechange = null;\n        this.request.abort();\n        this.request = null;\n      }\n\n      this.state = 'HAVE_METADATA';\n      this.media_ = playlist; // trigger media change if the active media has been updated\n\n      if (mediaChange) {\n        this.trigger('mediachanging');\n\n        if (startingState === 'HAVE_MAIN_MANIFEST') {\n          // The initial playlist was a main manifest, and the first media selected was\n          // also provided (in the form of a resolved playlist object) as part of the\n          // source object (rather than just a URL). Therefore, since the media playlist\n          // doesn't need to be requested, loadedmetadata won't trigger as part of the\n          // normal flow, and needs an explicit trigger here.\n          this.trigger('loadedmetadata');\n        } else {\n          this.trigger('mediachange');\n        }\n      }\n\n      return;\n    } // We update/set the timeout here so that live playlists\n    // that are not a media change will \"start\" the loader as expected.\n    // We expect that this function will start the media update timeout\n    // cycle again. This also prevents a playlist switch failure from\n    // causing us to stall during live.\n\n\n    this.updateMediaUpdateTimeout_(refreshDelay(playlist, true)); // switching to the active playlist is a no-op\n\n    if (!mediaChange) {\n      return;\n    }\n\n    this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n    if (this.request) {\n      if (playlist.resolvedUri === this.request.url) {\n        // requesting to switch to the same playlist multiple times\n        // has no effect after the first\n        return;\n      }\n\n      this.request.onreadystatechange = null;\n      this.request.abort();\n      this.request = null;\n    } // request the new playlist\n\n\n    if (this.media_) {\n      this.trigger('mediachanging');\n    }\n\n    this.pendingMedia_ = playlist;\n    this.request = this.vhs_.xhr({\n      uri: playlist.resolvedUri,\n      withCredentials: this.withCredentials\n    }, (error, req) => {\n      // disposed\n      if (!this.request) {\n        return;\n      }\n\n      playlist.lastRequest = Date.now();\n      playlist.resolvedUri = resolveManifestRedirect(playlist.resolvedUri, req);\n\n      if (error) {\n        return this.playlistRequestError(this.request, playlist, startingState);\n      }\n\n      this.haveMetadata({\n        playlistString: req.responseText,\n        url: playlist.uri,\n        id: playlist.id\n      }); // fire loadedmetadata the first time a media playlist is loaded\n\n      if (startingState === 'HAVE_MAIN_MANIFEST') {\n        this.trigger('loadedmetadata');\n      } else {\n        this.trigger('mediachange');\n      }\n    });\n  }\n  /**\n   * pause loading of the playlist\n   */\n\n\n  pause() {\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    }\n\n    this.stopRequest();\n\n    if (this.state === 'HAVE_NOTHING') {\n      // If we pause the loader before any data has been retrieved, its as if we never\n      // started, so reset to an unstarted state.\n      this.started = false;\n    } // Need to restore state now that no activity is happening\n\n\n    if (this.state === 'SWITCHING_MEDIA') {\n      // if the loader was in the process of switching media, it should either return to\n      // HAVE_MAIN_MANIFEST or HAVE_METADATA depending on if the loader has loaded a media\n      // playlist yet. This is determined by the existence of loader.media_\n      if (this.media_) {\n        this.state = 'HAVE_METADATA';\n      } else {\n        this.state = 'HAVE_MAIN_MANIFEST';\n      }\n    } else if (this.state === 'HAVE_CURRENT_METADATA') {\n      this.state = 'HAVE_METADATA';\n    }\n  }\n  /**\n   * start loading of the playlist\n   */\n\n\n  load(shouldDelay) {\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    }\n\n    const media = this.media();\n\n    if (shouldDelay) {\n      const delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1000 : 5 * 1000;\n      this.mediaUpdateTimeout = window$1.setTimeout(() => {\n        this.mediaUpdateTimeout = null;\n        this.load();\n      }, delay);\n      return;\n    }\n\n    if (!this.started) {\n      this.start();\n      return;\n    }\n\n    if (media && !media.endList) {\n      this.trigger('mediaupdatetimeout');\n    } else {\n      this.trigger('loadedplaylist');\n    }\n  }\n\n  updateMediaUpdateTimeout_(delay) {\n    if (this.mediaUpdateTimeout) {\n      window$1.clearTimeout(this.mediaUpdateTimeout);\n      this.mediaUpdateTimeout = null;\n    } // we only have use mediaupdatetimeout for live playlists.\n\n\n    if (!this.media() || this.media().endList) {\n      return;\n    }\n\n    this.mediaUpdateTimeout = window$1.setTimeout(() => {\n      this.mediaUpdateTimeout = null;\n      this.trigger('mediaupdatetimeout');\n      this.updateMediaUpdateTimeout_(delay);\n    }, delay);\n  }\n  /**\n   * start loading of the playlist\n   */\n\n\n  start() {\n    this.started = true;\n\n    if (typeof this.src === 'object') {\n      // in the case of an entirely constructed manifest object (meaning there's no actual\n      // manifest on a server), default the uri to the page's href\n      if (!this.src.uri) {\n        this.src.uri = window$1.location.href;\n      } // resolvedUri is added on internally after the initial request. Since there's no\n      // request for pre-resolved manifests, add on resolvedUri here.\n\n\n      this.src.resolvedUri = this.src.uri; // Since a manifest object was passed in as the source (instead of a URL), the first\n      // request can be skipped (since the top level of the manifest, at a minimum, is\n      // already available as a parsed manifest object). However, if the manifest object\n      // represents a main playlist, some media playlists may need to be resolved before\n      // the starting segment list is available. Therefore, go directly to setup of the\n      // initial playlist, and let the normal flow continue from there.\n      //\n      // Note that the call to setup is asynchronous, as other sections of VHS may assume\n      // that the first request is asynchronous.\n\n      setTimeout(() => {\n        this.setupInitialPlaylist(this.src);\n      }, 0);\n      return;\n    } // request the specified URL\n\n\n    this.request = this.vhs_.xhr({\n      uri: this.src,\n      withCredentials: this.withCredentials\n    }, (error, req) => {\n      // disposed\n      if (!this.request) {\n        return;\n      } // clear the loader's request reference\n\n\n      this.request = null;\n\n      if (error) {\n        this.error = {\n          status: req.status,\n          message: `HLS playlist request error at URL: ${this.src}.`,\n          responseText: req.responseText,\n          // MEDIA_ERR_NETWORK\n          code: 2\n        };\n\n        if (this.state === 'HAVE_NOTHING') {\n          this.started = false;\n        }\n\n        return this.trigger('error');\n      }\n\n      this.src = resolveManifestRedirect(this.src, req);\n      const manifest = this.parseManifest_({\n        manifestString: req.responseText,\n        url: this.src\n      });\n      this.setupInitialPlaylist(manifest);\n    });\n  }\n\n  srcUri() {\n    return typeof this.src === 'string' ? this.src : this.src.uri;\n  }\n  /**\n   * Given a manifest object that's either a main or media playlist, trigger the proper\n   * events and set the state of the playlist loader.\n   *\n   * If the manifest object represents a main playlist, `loadedplaylist` will be\n   * triggered to allow listeners to select a playlist. If none is selected, the loader\n   * will default to the first one in the playlists array.\n   *\n   * If the manifest object represents a media playlist, `loadedplaylist` will be\n   * triggered followed by `loadedmetadata`, as the only available playlist is loaded.\n   *\n   * In the case of a media playlist, a main playlist object wrapper with one playlist\n   * will be created so that all logic can handle playlists in the same fashion (as an\n   * assumed manifest object schema).\n   *\n   * @param {Object} manifest\n   *        The parsed manifest object\n   */\n\n\n  setupInitialPlaylist(manifest) {\n    this.state = 'HAVE_MAIN_MANIFEST';\n\n    if (manifest.playlists) {\n      this.main = manifest;\n      addPropertiesToMain(this.main, this.srcUri()); // If the initial main playlist has playlists wtih segments already resolved,\n      // then resolve URIs in advance, as they are usually done after a playlist request,\n      // which may not happen if the playlist is resolved.\n\n      manifest.playlists.forEach(playlist => {\n        playlist.segments = getAllSegments(playlist);\n        playlist.segments.forEach(segment => {\n          resolveSegmentUris(segment, playlist.resolvedUri);\n        });\n      });\n      this.trigger('loadedplaylist');\n\n      if (!this.request) {\n        // no media playlist was specifically selected so start\n        // from the first listed one\n        this.media(this.main.playlists[0]);\n      }\n\n      return;\n    } // In order to support media playlists passed in as vhs-json, the case where the uri\n    // is not provided as part of the manifest should be considered, and an appropriate\n    // default used.\n\n\n    const uri = this.srcUri() || window$1.location.href;\n    this.main = mainForMedia(manifest, uri);\n    this.haveMetadata({\n      playlistObject: manifest,\n      url: uri,\n      id: this.main.playlists[0].id\n    });\n    this.trigger('loadedmetadata');\n  }\n  /**\n   * Updates or deletes a preexisting pathway clone.\n   * Ensures that all playlists related to the old pathway clone are\n   * either updated or deleted.\n   *\n   * @param {Object} clone On update, the pathway clone object for the newly updated pathway clone.\n   *        On delete, the old pathway clone object to be deleted.\n   * @param {boolean} isUpdate True if the pathway is to be updated,\n   *        false if it is meant to be deleted.\n   */\n\n\n  updateOrDeleteClone(clone, isUpdate) {\n    const main = this.main;\n    const pathway = clone.ID;\n    let i = main.playlists.length; // Iterate backwards through the playlist so we can remove playlists if necessary.\n\n    while (i--) {\n      const p = main.playlists[i];\n\n      if (p.attributes['PATHWAY-ID'] === pathway) {\n        const oldPlaylistUri = p.resolvedUri;\n        const oldPlaylistId = p.id; // update the indexed playlist and add new playlists by ID and URI\n\n        if (isUpdate) {\n          const newPlaylistUri = this.createCloneURI_(p.resolvedUri, clone);\n          const newPlaylistId = createPlaylistID(pathway, newPlaylistUri);\n          const attributes = this.createCloneAttributes_(pathway, p.attributes);\n          const updatedPlaylist = this.createClonePlaylist_(p, newPlaylistId, clone, attributes);\n          main.playlists[i] = updatedPlaylist;\n          main.playlists[newPlaylistId] = updatedPlaylist;\n          main.playlists[newPlaylistUri] = updatedPlaylist;\n        } else {\n          // Remove the indexed playlist.\n          main.playlists.splice(i, 1);\n        } // Remove playlists by the old ID and URI.\n\n\n        delete main.playlists[oldPlaylistId];\n        delete main.playlists[oldPlaylistUri];\n      }\n    }\n\n    this.updateOrDeleteCloneMedia(clone, isUpdate);\n  }\n  /**\n   * Updates or deletes media data based on the pathway clone object.\n   * Due to the complexity of the media groups and playlists, in all cases\n   * we remove all of the old media groups and playlists.\n   * On updates, we then create new media groups and playlists based on the\n   * new pathway clone object.\n   *\n   * @param {Object} clone The pathway clone object for the newly updated pathway clone.\n   * @param {boolean} isUpdate True if the pathway is to be updated,\n   *        false if it is meant to be deleted.\n   */\n\n\n  updateOrDeleteCloneMedia(clone, isUpdate) {\n    const main = this.main;\n    const id = clone.ID;\n    ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(mediaType => {\n      if (!main.mediaGroups[mediaType] || !main.mediaGroups[mediaType][id]) {\n        return;\n      }\n\n      for (const groupKey in main.mediaGroups[mediaType]) {\n        // Remove all media playlists for the media group for this pathway clone.\n        if (groupKey === id) {\n          for (const labelKey in main.mediaGroups[mediaType][groupKey]) {\n            const oldMedia = main.mediaGroups[mediaType][groupKey][labelKey];\n            oldMedia.playlists.forEach((p, i) => {\n              const oldMediaPlaylist = main.playlists[p.id];\n              const oldPlaylistId = oldMediaPlaylist.id;\n              const oldPlaylistUri = oldMediaPlaylist.resolvedUri;\n              delete main.playlists[oldPlaylistId];\n              delete main.playlists[oldPlaylistUri];\n            });\n          } // Delete the old media group.\n\n\n          delete main.mediaGroups[mediaType][groupKey];\n        }\n      }\n    }); // Create the new media groups and playlists if there is an update.\n\n    if (isUpdate) {\n      this.createClonedMediaGroups_(clone);\n    }\n  }\n  /**\n   * Given a pathway clone object, clones all necessary playlists.\n   *\n   * @param {Object} clone The pathway clone object.\n   * @param {Object} basePlaylist The original playlist to clone from.\n   */\n\n\n  addClonePathway(clone, basePlaylist = {}) {\n    const main = this.main;\n    const index = main.playlists.length;\n    const uri = this.createCloneURI_(basePlaylist.resolvedUri, clone);\n    const playlistId = createPlaylistID(clone.ID, uri);\n    const attributes = this.createCloneAttributes_(clone.ID, basePlaylist.attributes);\n    const playlist = this.createClonePlaylist_(basePlaylist, playlistId, clone, attributes);\n    main.playlists[index] = playlist; // add playlist by ID and URI\n\n    main.playlists[playlistId] = playlist;\n    main.playlists[uri] = playlist;\n    this.createClonedMediaGroups_(clone);\n  }\n  /**\n   * Given a pathway clone object we create clones of all media.\n   * In this function, all necessary information and updated playlists\n   * are added to the `mediaGroup` object.\n   * Playlists are also added to the `playlists` array so the media groups\n   * will be properly linked.\n   *\n   * @param {Object} clone The pathway clone object.\n   */\n\n\n  createClonedMediaGroups_(clone) {\n    const id = clone.ID;\n    const baseID = clone['BASE-ID'];\n    const main = this.main;\n    ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(mediaType => {\n      // If the media type doesn't exist, or there is already a clone, skip\n      // to the next media type.\n      if (!main.mediaGroups[mediaType] || main.mediaGroups[mediaType][id]) {\n        return;\n      }\n\n      for (const groupKey in main.mediaGroups[mediaType]) {\n        if (groupKey === baseID) {\n          // Create the group.\n          main.mediaGroups[mediaType][id] = {};\n        } else {\n          // There is no need to iterate over label keys in this case.\n          continue;\n        }\n\n        for (const labelKey in main.mediaGroups[mediaType][groupKey]) {\n          const oldMedia = main.mediaGroups[mediaType][groupKey][labelKey];\n          main.mediaGroups[mediaType][id][labelKey] = _extends({}, oldMedia);\n          const newMedia = main.mediaGroups[mediaType][id][labelKey]; // update URIs on the media\n\n          const newUri = this.createCloneURI_(oldMedia.resolvedUri, clone);\n          newMedia.resolvedUri = newUri;\n          newMedia.uri = newUri; // Reset playlists in the new media group.\n\n          newMedia.playlists = []; // Create new playlists in the newly cloned media group.\n\n          oldMedia.playlists.forEach((p, i) => {\n            const oldMediaPlaylist = main.playlists[p.id];\n            const group = groupID(mediaType, id, labelKey);\n            const newPlaylistID = createPlaylistID(id, group); // Check to see if it already exists\n\n            if (oldMediaPlaylist && !main.playlists[newPlaylistID]) {\n              const newMediaPlaylist = this.createClonePlaylist_(oldMediaPlaylist, newPlaylistID, clone);\n              const newPlaylistUri = newMediaPlaylist.resolvedUri;\n              main.playlists[newPlaylistID] = newMediaPlaylist;\n              main.playlists[newPlaylistUri] = newMediaPlaylist;\n            }\n\n            newMedia.playlists[i] = this.createClonePlaylist_(p, newPlaylistID, clone);\n          });\n        }\n      }\n    });\n  }\n  /**\n   * Using the original playlist to be cloned, and the pathway clone object\n   * information, we create a new playlist.\n   *\n   * @param {Object} basePlaylist  The original playlist to be cloned from.\n   * @param {string} id The desired id of the newly cloned playlist.\n   * @param {Object} clone The pathway clone object.\n   * @param {Object} attributes An optional object to populate the `attributes` property in the playlist.\n   *\n   * @return {Object} The combined cloned playlist.\n   */\n\n\n  createClonePlaylist_(basePlaylist, id, clone, attributes) {\n    const uri = this.createCloneURI_(basePlaylist.resolvedUri, clone);\n    const newProps = {\n      resolvedUri: uri,\n      uri,\n      id\n    }; // Remove all segments from previous playlist in the clone.\n\n    if (basePlaylist.segments) {\n      newProps.segments = [];\n    }\n\n    if (attributes) {\n      newProps.attributes = attributes;\n    }\n\n    return merge(basePlaylist, newProps);\n  }\n  /**\n   * Generates an updated URI for a cloned pathway based on the original\n   * pathway's URI and the paramaters from the pathway clone object in the\n   * content steering server response.\n   *\n   * @param {string} baseUri URI to be updated in the cloned pathway.\n   * @param {Object} clone The pathway clone object.\n   *\n   * @return {string} The updated URI for the cloned pathway.\n   */\n\n\n  createCloneURI_(baseURI, clone) {\n    const uri = new URL(baseURI);\n    uri.hostname = clone['URI-REPLACEMENT'].HOST;\n    const params = clone['URI-REPLACEMENT'].PARAMS; // Add params to the cloned URL.\n\n    for (const key of Object.keys(params)) {\n      uri.searchParams.set(key, params[key]);\n    }\n\n    return uri.href;\n  }\n  /**\n   * Helper function to create the attributes needed for the new clone.\n   * This mainly adds the necessary media attributes.\n   *\n   * @param {string} id The pathway clone object ID.\n   * @param {Object} oldAttributes The old attributes to compare to.\n   * @return {Object} The new attributes to add to the playlist.\n   */\n\n\n  createCloneAttributes_(id, oldAttributes) {\n    const attributes = {\n      ['PATHWAY-ID']: id\n    };\n    ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(mediaType => {\n      if (oldAttributes[mediaType]) {\n        attributes[mediaType] = id;\n      }\n    });\n    return attributes;\n  }\n  /**\n   * Returns the key ID set from a playlist\n   *\n   * @param {playlist} playlist to fetch the key ID set from.\n   * @return a Set of 32 digit hex strings that represent the unique keyIds for that playlist.\n   */\n\n\n  getKeyIdSet(playlist) {\n    if (playlist.contentProtection) {\n      const keyIds = new Set();\n\n      for (const keysystem in playlist.contentProtection) {\n        const keyId = playlist.contentProtection[keysystem].attributes.keyId;\n\n        if (keyId) {\n          keyIds.add(keyId.toLowerCase());\n        }\n      }\n\n      return keyIds;\n    }\n  }\n\n}\n\n/**\n * @file xhr.js\n */\nconst {\n  xhr: videojsXHR\n} = videojs;\n\nconst callbackWrapper = function (request, error, response, callback) {\n  const reqResponse = request.responseType === 'arraybuffer' ? request.response : request.responseText;\n\n  if (!error && reqResponse) {\n    request.responseTime = Date.now();\n    request.roundTripTime = request.responseTime - request.requestTime;\n    request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n\n    if (!request.bandwidth) {\n      request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n    }\n  }\n\n  if (response.headers) {\n    request.responseHeaders = response.headers;\n  } // videojs.xhr now uses a specific code on the error\n  // object to signal that a request has timed out instead\n  // of setting a boolean on the request object\n\n\n  if (error && error.code === 'ETIMEDOUT') {\n    request.timedout = true;\n  } // videojs.xhr no longer considers status codes outside of 200 and 0\n  // (for file uris) to be errors, but the old XHR did, so emulate that\n  // behavior. Status 206 may be used in response to byterange requests.\n\n\n  if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n    error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n  }\n\n  callback(error, request);\n};\n/**\n * Iterates over the request hooks Set and calls them in order\n *\n * @param {Set} hooks the hook Set to iterate over\n * @param {Object} options the request options to pass to the xhr wrapper\n * @return the callback hook function return value, the modified or new options Object.\n */\n\n\nconst callAllRequestHooks = (requestSet, options) => {\n  if (!requestSet || !requestSet.size) {\n    return;\n  }\n\n  let newOptions = options;\n  requestSet.forEach(requestCallback => {\n    newOptions = requestCallback(newOptions);\n  });\n  return newOptions;\n};\n/**\n * Iterates over the response hooks Set and calls them in order.\n *\n * @param {Set} hooks the hook Set to iterate over\n * @param {Object} request the xhr request object\n * @param {Object} error the xhr error object\n * @param {Object} response the xhr response object\n */\n\n\nconst callAllResponseHooks = (responseSet, request, error, response) => {\n  if (!responseSet || !responseSet.size) {\n    return;\n  }\n\n  responseSet.forEach(responseCallback => {\n    responseCallback(request, error, response);\n  });\n};\n\nconst xhrFactory = function () {\n  const xhr = function XhrFunction(options, callback) {\n    // Add a default timeout\n    options = merge({\n      timeout: 45e3\n    }, options); // Allow an optional user-specified function to modify the option\n    // object before we construct the xhr request\n    // TODO: Remove beforeRequest in the next major release.\n\n    const beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest; // onRequest and onResponse hooks as a Set, at either the player or global level.\n    // TODO: new Set added here for beforeRequest alias. Remove this when beforeRequest is removed.\n\n    const _requestCallbackSet = XhrFunction._requestCallbackSet || videojs.Vhs.xhr._requestCallbackSet || new Set();\n\n    const _responseCallbackSet = XhrFunction._responseCallbackSet || videojs.Vhs.xhr._responseCallbackSet;\n\n    if (beforeRequest && typeof beforeRequest === 'function') {\n      videojs.log.warn('beforeRequest is deprecated, use onRequest instead.');\n\n      _requestCallbackSet.add(beforeRequest);\n    } // Use the standard videojs.xhr() method unless `videojs.Vhs.xhr` has been overriden\n    // TODO: switch back to videojs.Vhs.xhr.name === 'XhrFunction' when we drop IE11\n\n\n    const xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr; // call all registered onRequest hooks, assign new options.\n\n    const beforeRequestOptions = callAllRequestHooks(_requestCallbackSet, options); // Remove the beforeRequest function from the hooks set so stale beforeRequest functions are not called.\n\n    _requestCallbackSet.delete(beforeRequest); // xhrMethod will call XMLHttpRequest.open and XMLHttpRequest.send\n\n\n    const request = xhrMethod(beforeRequestOptions || options, function (error, response) {\n      // call all registered onResponse hooks\n      callAllResponseHooks(_responseCallbackSet, request, error, response);\n      return callbackWrapper(request, error, response, callback);\n    });\n    const originalAbort = request.abort;\n\n    request.abort = function () {\n      request.aborted = true;\n      return originalAbort.apply(request, arguments);\n    };\n\n    request.uri = options.uri;\n    request.requestTime = Date.now();\n    return request;\n  };\n\n  xhr.original = true;\n  return xhr;\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n *                             of a byte-range\n */\n\n\nconst byterangeStr = function (byterange) {\n  // `byterangeEnd` is one less than `offset + length` because the HTTP range\n  // header uses inclusive ranges\n  let byterangeEnd;\n  const byterangeStart = byterange.offset;\n\n  if (typeof byterange.offset === 'bigint' || typeof byterange.length === 'bigint') {\n    byterangeEnd = window$1.BigInt(byterange.offset) + window$1.BigInt(byterange.length) - window$1.BigInt(1);\n  } else {\n    byterangeEnd = byterange.offset + byterange.length - 1;\n  }\n\n  return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n */\n\nconst segmentXhrHeaders = function (segment) {\n  const headers = {};\n\n  if (segment.byterange) {\n    headers.Range = byterangeStr(segment.byterange);\n  }\n\n  return headers;\n};\n\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {number} i the iterator on the range to convert\n * @return {string} the range in string format\n */\n\nconst textRange = function (range, i) {\n  return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {number} e The number\n * @param {number} i the iterator\n * @return {string} the hex formatted number as a string\n */\n\n\nconst formatHexString = function (e, i) {\n  const value = e.toString(16);\n  return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\n\nconst formatAsciiString = function (e) {\n  if (e >= 0x20 && e < 0x7e) {\n    return String.fromCharCode(e);\n  }\n\n  return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n *        Object of properties and values to send to the web worker\n * @return {Object}\n *         Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\nconst createTransferableMessage = function (message) {\n  const transferable = {};\n  Object.keys(message).forEach(key => {\n    const value = message[key];\n\n    if (isArrayBufferView(value)) {\n      transferable[key] = {\n        bytes: value.buffer,\n        byteOffset: value.byteOffset,\n        byteLength: value.byteLength\n      };\n    } else {\n      transferable[key] = value;\n    }\n  });\n  return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n *\n * @param {Object} initSegment\n *        the init segment object.\n *\n * @return {string} the generated init segment id\n */\n\nconst initSegmentId = function (initSegment) {\n  const byterange = initSegment.byterange || {\n    length: Infinity,\n    offset: 0\n  };\n  return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * Returns a unique string identifier for a media segment key.\n *\n * @param {Object} key the encryption key\n * @return {string} the unique id for the media segment key.\n */\n\nconst segmentKeyId = function (key) {\n  return key.resolvedUri;\n};\n/**\n * utils to help dump binary data to the console\n *\n * @param {Array|TypedArray} data\n *        data to dump to a string\n *\n * @return {string} the data as a hex string.\n */\n\nconst hexDump = data => {\n  const bytes = Array.prototype.slice.call(data);\n  const step = 16;\n  let result = '';\n  let hex;\n  let ascii;\n\n  for (let j = 0; j < bytes.length / step; j++) {\n    hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n    ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n    result += hex + ' ' + ascii + '\\n';\n  }\n\n  return result;\n};\nconst tagDump = ({\n  bytes\n}) => hexDump(bytes);\nconst textRanges = ranges => {\n  let result = '';\n  let i;\n\n  for (i = 0; i < ranges.length; i++) {\n    result += textRange(ranges, i) + ' ';\n  }\n\n  return result;\n};\n\nvar utils = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  createTransferableMessage: createTransferableMessage,\n  initSegmentId: initSegmentId,\n  segmentKeyId: segmentKeyId,\n  hexDump: hexDump,\n  tagDump: tagDump,\n  textRanges: textRanges\n});\n\n// TODO handle fmp4 case where the timing info is accurate and doesn't involve transmux\n// 25% was arbitrarily chosen, and may need to be refined over time.\n\nconst SEGMENT_END_FUDGE_PERCENT = 0.25;\n/**\n * Converts a player time (any time that can be gotten/set from player.currentTime(),\n * e.g., any time within player.seekable().start(0) to player.seekable().end(0)) to a\n * program time (any time referencing the real world (e.g., EXT-X-PROGRAM-DATE-TIME)).\n *\n * The containing segment is required as the EXT-X-PROGRAM-DATE-TIME serves as an \"anchor\n * point\" (a point where we have a mapping from program time to player time, with player\n * time being the post transmux start of the segment).\n *\n * For more details, see [this doc](../../docs/program-time-from-player-time.md).\n *\n * @param {number} playerTime the player time\n * @param {Object} segment the segment which contains the player time\n * @return {Date} program time\n */\n\nconst playerTimeToProgramTime = (playerTime, segment) => {\n  if (!segment.dateTimeObject) {\n    // Can't convert without an \"anchor point\" for the program time (i.e., a time that can\n    // be used to map the start of a segment with a real world time).\n    return null;\n  }\n\n  const transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;\n  const transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart; // get the start of the content from before old content is prepended\n\n  const startOfSegment = transmuxedStart + transmuxerPrependedSeconds;\n  const offsetFromSegmentStart = playerTime - startOfSegment;\n  return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1000);\n};\nconst originalSegmentVideoDuration = videoTimingInfo => {\n  return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;\n};\n/**\n * Finds a segment that contains the time requested given as an ISO-8601 string. The\n * returned segment might be an estimate or an accurate match.\n *\n * @param {string} programTime The ISO-8601 programTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\nconst findSegmentForProgramTime = (programTime, playlist) => {\n  // Assumptions:\n  //  - verifyProgramDateTimeTags has already been run\n  //  - live streams have been started\n  let dateTimeObject;\n\n  try {\n    dateTimeObject = new Date(programTime);\n  } catch (e) {\n    return null;\n  }\n\n  if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n    return null;\n  }\n\n  let segment = playlist.segments[0];\n\n  if (dateTimeObject < new Date(segment.dateTimeObject)) {\n    // Requested time is before stream start.\n    return null;\n  }\n\n  for (let i = 0; i < playlist.segments.length - 1; i++) {\n    segment = playlist.segments[i];\n    const nextSegmentStart = new Date(playlist.segments[i + 1].dateTimeObject);\n\n    if (dateTimeObject < nextSegmentStart) {\n      break;\n    }\n  }\n\n  const lastSegment = playlist.segments[playlist.segments.length - 1];\n  const lastSegmentStart = lastSegment.dateTimeObject;\n  const lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;\n  const lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1000);\n\n  if (dateTimeObject > lastSegmentEnd) {\n    // Beyond the end of the stream, or our best guess of the end of the stream.\n    return null;\n  }\n\n  if (dateTimeObject > new Date(lastSegmentStart)) {\n    segment = lastSegment;\n  }\n\n  return {\n    segment,\n    estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),\n    // Although, given that all segments have accurate date time objects, the segment\n    // selected should be accurate, unless the video has been transmuxed at some point\n    // (determined by the presence of the videoTimingInfo object), the segment's \"player\n    // time\" (the start time in the player) can't be considered accurate.\n    type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n  };\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\nconst findSegmentForPlayerTime = (time, playlist) => {\n  // Assumptions:\n  // - there will always be a segment.duration\n  // - we can start from zero\n  // - segments are in time order\n  if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n    return null;\n  }\n\n  let segmentEnd = 0;\n  let segment;\n\n  for (let i = 0; i < playlist.segments.length; i++) {\n    segment = playlist.segments[i]; // videoTimingInfo is set after the segment is downloaded and transmuxed, and\n    // should contain the most accurate values we have for the segment's player times.\n    //\n    // Use the accurate transmuxedPresentationEnd value if it is available, otherwise fall\n    // back to an estimate based on the manifest derived (inaccurate) segment.duration, to\n    // calculate an end value.\n\n    segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;\n\n    if (time <= segmentEnd) {\n      break;\n    }\n  }\n\n  const lastSegment = playlist.segments[playlist.segments.length - 1];\n\n  if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {\n    // The time requested is beyond the stream end.\n    return null;\n  }\n\n  if (time > segmentEnd) {\n    // The time is within or beyond the last segment.\n    //\n    // Check to see if the time is beyond a reasonable guess of the end of the stream.\n    if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {\n      // Technically, because the duration value is only an estimate, the time may still\n      // exist in the last segment, however, there isn't enough information to make even\n      // a reasonable estimate.\n      return null;\n    }\n\n    segment = lastSegment;\n  }\n\n  return {\n    segment,\n    estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,\n    // Because videoTimingInfo is only set after transmux, it is the only way to get\n    // accurate timing values.\n    type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n  };\n};\n/**\n * Gives the offset of the comparisonTimestamp from the programTime timestamp in seconds.\n * If the offset returned is positive, the programTime occurs after the\n * comparisonTimestamp.\n * If the offset is negative, the programTime occurs before the comparisonTimestamp.\n *\n * @param {string} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {string} programTime The programTime as an ISO-8601 string\n * @return {number} offset\n */\n\nconst getOffsetFromTimestamp = (comparisonTimeStamp, programTime) => {\n  let segmentDateTime;\n  let programDateTime;\n\n  try {\n    segmentDateTime = new Date(comparisonTimeStamp);\n    programDateTime = new Date(programTime);\n  } catch (e) {// TODO handle error\n  }\n\n  const segmentTimeEpoch = segmentDateTime.getTime();\n  const programTimeEpoch = programDateTime.getTime();\n  return (programTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\nconst verifyProgramDateTimeTags = playlist => {\n  if (!playlist.segments || playlist.segments.length === 0) {\n    return false;\n  }\n\n  for (let i = 0; i < playlist.segments.length; i++) {\n    const segment = playlist.segments[i];\n\n    if (!segment.dateTimeObject) {\n      return false;\n    }\n  }\n\n  return true;\n};\n/**\n * Returns the programTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {number} time A playerTime in seconds\n * @param {Function} callback(err, programTime)\n * @return {string} err.message A detailed error message\n * @return {Object} programTime\n * @return {number} programTime.mediaSeconds The streamTime in seconds\n * @return {string} programTime.programDateTime The programTime as an ISO-8601 String\n */\n\nconst getProgramTime = ({\n  playlist,\n  time = undefined,\n  callback\n}) => {\n  if (!callback) {\n    throw new Error('getProgramTime: callback must be provided');\n  }\n\n  if (!playlist || time === undefined) {\n    return callback({\n      message: 'getProgramTime: playlist and time must be provided'\n    });\n  }\n\n  const matchedSegment = findSegmentForPlayerTime(time, playlist);\n\n  if (!matchedSegment) {\n    return callback({\n      message: 'valid programTime was not found'\n    });\n  }\n\n  if (matchedSegment.type === 'estimate') {\n    return callback({\n      message: 'Accurate programTime could not be determined.' + ' Please seek to e.seekTime and try again',\n      seekTime: matchedSegment.estimatedStart\n    });\n  }\n\n  const programTimeObject = {\n    mediaSeconds: time\n  };\n  const programTime = playerTimeToProgramTime(time, matchedSegment.segment);\n\n  if (programTime) {\n    programTimeObject.programDateTime = programTime.toISOString();\n  }\n\n  return callback(null, programTimeObject);\n};\n/**\n * Seeks in the player to a time that matches the given programTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {string} args.programTime A programTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @return {string} err.message A detailed error message\n * @return {number} newTime The exact time that was seeked to in seconds\n */\n\nconst seekToProgramTime = ({\n  programTime,\n  playlist,\n  retryCount = 2,\n  seekTo,\n  pauseAfterSeek = true,\n  tech,\n  callback\n}) => {\n  if (!callback) {\n    throw new Error('seekToProgramTime: callback must be provided');\n  }\n\n  if (typeof programTime === 'undefined' || !playlist || !seekTo) {\n    return callback({\n      message: 'seekToProgramTime: programTime, seekTo and playlist must be provided'\n    });\n  }\n\n  if (!playlist.endList && !tech.hasStarted_) {\n    return callback({\n      message: 'player must be playing a live stream to start buffering'\n    });\n  }\n\n  if (!verifyProgramDateTimeTags(playlist)) {\n    return callback({\n      message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n    });\n  }\n\n  const matchedSegment = findSegmentForProgramTime(programTime, playlist); // no match\n\n  if (!matchedSegment) {\n    return callback({\n      message: `${programTime} was not found in the stream`\n    });\n  }\n\n  const segment = matchedSegment.segment;\n  const mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);\n\n  if (matchedSegment.type === 'estimate') {\n    // we've run out of retries\n    if (retryCount === 0) {\n      return callback({\n        message: `${programTime} is not buffered yet. Try again`\n      });\n    }\n\n    seekTo(matchedSegment.estimatedStart + mediaOffset);\n    tech.one('seeked', () => {\n      seekToProgramTime({\n        programTime,\n        playlist,\n        retryCount: retryCount - 1,\n        seekTo,\n        pauseAfterSeek,\n        tech,\n        callback\n      });\n    });\n    return;\n  } // Since the segment.start value is determined from the buffered end or ending time\n  // of the prior segment, the seekToTime doesn't need to account for any transmuxer\n  // modifications.\n\n\n  const seekToTime = segment.start + mediaOffset;\n\n  const seekedCallback = () => {\n    return callback(null, tech.currentTime());\n  }; // listen for seeked event\n\n\n  tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n  if (pauseAfterSeek) {\n    tech.pause();\n  }\n\n  seekTo(seekToTime);\n};\n\n// which will only happen if the request is complete.\n\nconst callbackOnCompleted = (request, cb) => {\n  if (request.readyState === 4) {\n    return cb();\n  }\n\n  return;\n};\n\nconst containerRequest = (uri, xhr, cb) => {\n  let bytes = [];\n  let id3Offset;\n  let finished = false;\n\n  const endRequestAndCallback = function (err, req, type, _bytes) {\n    req.abort();\n    finished = true;\n    return cb(err, req, type, _bytes);\n  };\n\n  const progressListener = function (error, request) {\n    if (finished) {\n      return;\n    }\n\n    if (error) {\n      return endRequestAndCallback(error, request, '', bytes);\n    } // grap the new part of content that was just downloaded\n\n\n    const newPart = request.responseText.substring(bytes && bytes.byteLength || 0, request.responseText.length); // add that onto bytes\n\n    bytes = concatTypedArrays(bytes, stringToBytes(newPart, true));\n    id3Offset = id3Offset || getId3Offset(bytes); // we need at least 10 bytes to determine a type\n    // or we need at least two bytes after an id3Offset\n\n    if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {\n      return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n    }\n\n    const type = detectContainerForBytes(bytes); // if this looks like a ts segment but we don't have enough data\n    // to see the second sync byte, wait until we have enough data\n    // before declaring it ts\n\n    if (type === 'ts' && bytes.length < 188) {\n      return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n    } // this may be an unsynced ts segment\n    // wait for 376 bytes before detecting no container\n\n\n    if (!type && bytes.length < 376) {\n      return callbackOnCompleted(request, () => endRequestAndCallback(error, request, '', bytes));\n    }\n\n    return endRequestAndCallback(null, request, type, bytes);\n  };\n\n  const options = {\n    uri,\n\n    beforeSend(request) {\n      // this forces the browser to pass the bytes to us unprocessed\n      request.overrideMimeType('text/plain; charset=x-user-defined');\n      request.addEventListener('progress', function ({\n        total,\n        loaded\n      }) {\n        return callbackWrapper(request, null, {\n          statusCode: request.status\n        }, progressListener);\n      });\n    }\n\n  };\n  const request = xhr(options, function (error, response) {\n    return callbackWrapper(request, error, response, progressListener);\n  });\n  return request;\n};\n\nconst {\n  EventTarget\n} = videojs;\n\nconst dashPlaylistUnchanged = function (a, b) {\n  if (!isPlaylistUnchanged(a, b)) {\n    return false;\n  } // for dash the above check will often return true in scenarios where\n  // the playlist actually has changed because mediaSequence isn't a\n  // dash thing, and we often set it to 1. So if the playlists have the same amount\n  // of segments we return true.\n  // So for dash we need to make sure that the underlying segments are different.\n  // if sidx changed then the playlists are different.\n\n\n  if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {\n    return false;\n  } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {\n    return false;\n  } // one or the other does not have segments\n  // there was a change.\n\n\n  if (a.segments && !b.segments || !a.segments && b.segments) {\n    return false;\n  } // neither has segments nothing changed\n\n\n  if (!a.segments && !b.segments) {\n    return true;\n  } // check segments themselves\n\n\n  for (let i = 0; i < a.segments.length; i++) {\n    const aSegment = a.segments[i];\n    const bSegment = b.segments[i]; // if uris are different between segments there was a change\n\n    if (aSegment.uri !== bSegment.uri) {\n      return false;\n    } // neither segment has a byterange, there will be no byterange change.\n\n\n    if (!aSegment.byterange && !bSegment.byterange) {\n      continue;\n    }\n\n    const aByterange = aSegment.byterange;\n    const bByterange = bSegment.byterange; // if byterange only exists on one of the segments, there was a change.\n\n    if (aByterange && !bByterange || !aByterange && bByterange) {\n      return false;\n    } // if both segments have byterange with different offsets, there was a change.\n\n\n    if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {\n      return false;\n    }\n  } // if everything was the same with segments, this is the same playlist.\n\n\n  return true;\n};\n/**\n * Use the representation IDs from the mpd object to create groupIDs, the NAME is set to mandatory representation\n * ID in the parser. This allows for continuous playout across periods with the same representation IDs\n * (continuous periods as defined in DASH-IF 3.2.12). This is assumed in the mpd-parser as well. If we want to support\n * periods without continuous playback this function may need modification as well as the parser.\n */\n\n\nconst dashGroupId = (type, group, label, playlist) => {\n  // If the manifest somehow does not have an ID (non-dash compliant), use the label.\n  const playlistId = playlist.attributes.NAME || label;\n  return `placeholder-uri-${type}-${group}-${playlistId}`;\n};\n/**\n * Parses the main XML string and updates playlist URI references.\n *\n * @param {Object} config\n *        Object of arguments\n * @param {string} config.mainXml\n *        The mpd XML\n * @param {string} config.srcUrl\n *        The mpd URL\n * @param {Date} config.clientOffset\n *         A time difference between server and client\n * @param {Object} config.sidxMapping\n *        SIDX mappings for moof/mdat URIs and byte ranges\n * @return {Object}\n *         The parsed mpd manifest object\n */\n\n\nconst parseMainXml = ({\n  mainXml,\n  srcUrl,\n  clientOffset,\n  sidxMapping,\n  previousManifest\n}) => {\n  const manifest = parse(mainXml, {\n    manifestUri: srcUrl,\n    clientOffset,\n    sidxMapping,\n    previousManifest\n  });\n  addPropertiesToMain(manifest, srcUrl, dashGroupId);\n  return manifest;\n};\n/**\n * Removes any mediaGroup labels that no longer exist in the newMain\n *\n * @param {Object} update\n *         The previous mpd object being updated\n * @param {Object} newMain\n *         The new mpd object\n */\n\nconst removeOldMediaGroupLabels = (update, newMain) => {\n  forEachMediaGroup(update, (properties, type, group, label) => {\n    if (!(label in newMain.mediaGroups[type][group])) {\n      delete update.mediaGroups[type][group][label];\n    }\n  });\n};\n/**\n * Returns a new main manifest that is the result of merging an updated main manifest\n * into the original version.\n *\n * @param {Object} oldMain\n *        The old parsed mpd object\n * @param {Object} newMain\n *        The updated parsed mpd object\n * @return {Object}\n *         A new object representing the original main manifest with the updated media\n *         playlists merged in\n */\n\n\nconst updateMain = (oldMain, newMain, sidxMapping) => {\n  let noChanges = true;\n  let update = merge(oldMain, {\n    // These are top level properties that can be updated\n    duration: newMain.duration,\n    minimumUpdatePeriod: newMain.minimumUpdatePeriod,\n    timelineStarts: newMain.timelineStarts\n  }); // First update the playlists in playlist list\n\n  for (let i = 0; i < newMain.playlists.length; i++) {\n    const playlist = newMain.playlists[i];\n\n    if (playlist.sidx) {\n      const sidxKey = generateSidxKey(playlist.sidx); // add sidx segments to the playlist if we have all the sidx info already\n\n      if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {\n        addSidxSegmentsToPlaylist(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);\n      }\n    }\n\n    const playlistUpdate = updateMain$1(update, playlist, dashPlaylistUnchanged);\n\n    if (playlistUpdate) {\n      update = playlistUpdate;\n      noChanges = false;\n    }\n  } // Then update media group playlists\n\n\n  forEachMediaGroup(newMain, (properties, type, group, label) => {\n    if (properties.playlists && properties.playlists.length) {\n      const id = properties.playlists[0].id;\n      const playlistUpdate = updateMain$1(update, properties.playlists[0], dashPlaylistUnchanged);\n\n      if (playlistUpdate) {\n        update = playlistUpdate; // add new mediaGroup label if it doesn't exist and assign the new mediaGroup.\n\n        if (!(label in update.mediaGroups[type][group])) {\n          update.mediaGroups[type][group][label] = properties;\n        } // update the playlist reference within media groups\n\n\n        update.mediaGroups[type][group][label].playlists[0] = update.playlists[id];\n        noChanges = false;\n      }\n    }\n  }); // remove mediaGroup labels and references that no longer exist in the newMain\n\n  removeOldMediaGroupLabels(update, newMain);\n\n  if (newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {\n    noChanges = false;\n  }\n\n  if (noChanges) {\n    return null;\n  }\n\n  return update;\n}; // SIDX should be equivalent if the URI and byteranges of the SIDX match.\n// If the SIDXs have maps, the two maps should match,\n// both `a` and `b` missing SIDXs is considered matching.\n// If `a` or `b` but not both have a map, they aren't matching.\n\nconst equivalentSidx = (a, b) => {\n  const neitherMap = Boolean(!a.map && !b.map);\n  const equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);\n  return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;\n}; // exported for testing\n\n\nconst compareSidxEntry = (playlists, oldSidxMapping) => {\n  const newSidxMapping = {};\n\n  for (const id in playlists) {\n    const playlist = playlists[id];\n    const currentSidxInfo = playlist.sidx;\n\n    if (currentSidxInfo) {\n      const key = generateSidxKey(currentSidxInfo);\n\n      if (!oldSidxMapping[key]) {\n        break;\n      }\n\n      const savedSidxInfo = oldSidxMapping[key].sidxInfo;\n\n      if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {\n        newSidxMapping[key] = oldSidxMapping[key];\n      }\n    }\n  }\n\n  return newSidxMapping;\n};\n/**\n *  A function that filters out changed items as they need to be requested separately.\n *\n *  The method is exported for testing\n *\n *  @param {Object} main the parsed mpd XML returned via mpd-parser\n *  @param {Object} oldSidxMapping the SIDX to compare against\n */\n\nconst filterChangedSidxMappings = (main, oldSidxMapping) => {\n  const videoSidx = compareSidxEntry(main.playlists, oldSidxMapping);\n  let mediaGroupSidx = videoSidx;\n  forEachMediaGroup(main, (properties, mediaType, groupKey, labelKey) => {\n    if (properties.playlists && properties.playlists.length) {\n      const playlists = properties.playlists;\n      mediaGroupSidx = merge(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));\n    }\n  });\n  return mediaGroupSidx;\n};\nclass DashPlaylistLoader extends EventTarget {\n  // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n  // playlist loader setups from media groups will expect to be able to pass a playlist\n  // (since there aren't external URLs to media playlists with DASH)\n  constructor(srcUrlOrPlaylist, vhs, options = {}, mainPlaylistLoader) {\n    super();\n    this.mainPlaylistLoader_ = mainPlaylistLoader || this;\n\n    if (!mainPlaylistLoader) {\n      this.isMain_ = true;\n    }\n\n    const {\n      withCredentials = false\n    } = options;\n    this.vhs_ = vhs;\n    this.withCredentials = withCredentials;\n    this.addMetadataToTextTrack = options.addMetadataToTextTrack;\n\n    if (!srcUrlOrPlaylist) {\n      throw new Error('A non-empty playlist URL or object is required');\n    } // event naming?\n\n\n    this.on('minimumUpdatePeriod', () => {\n      this.refreshXml_();\n    }); // live playlist staleness timeout\n\n    this.on('mediaupdatetimeout', () => {\n      this.refreshMedia_(this.media().id);\n    });\n    this.state = 'HAVE_NOTHING';\n    this.loadedPlaylists_ = {};\n    this.logger_ = logger('DashPlaylistLoader'); // initialize the loader state\n    // The mainPlaylistLoader will be created with a string\n\n    if (this.isMain_) {\n      this.mainPlaylistLoader_.srcUrl = srcUrlOrPlaylist; // TODO: reset sidxMapping between period changes\n      // once multi-period is refactored\n\n      this.mainPlaylistLoader_.sidxMapping_ = {};\n    } else {\n      this.childPlaylist_ = srcUrlOrPlaylist;\n    }\n  }\n\n  requestErrored_(err, request, startingState) {\n    // disposed\n    if (!this.request) {\n      return true;\n    } // pending request is cleared\n\n\n    this.request = null;\n\n    if (err) {\n      // use the provided error object or create one\n      // based on the request/response\n      this.error = typeof err === 'object' && !(err instanceof Error) ? err : {\n        status: request.status,\n        message: 'DASH request error at URL: ' + request.uri,\n        response: request.response,\n        // MEDIA_ERR_NETWORK\n        code: 2\n      };\n\n      if (startingState) {\n        this.state = startingState;\n      }\n\n      this.trigger('error');\n      return true;\n    }\n  }\n  /**\n   * Verify that the container of the sidx segment can be parsed\n   * and if it can, get and parse that segment.\n   */\n\n\n  addSidxSegments_(playlist, startingState, cb) {\n    const sidxKey = playlist.sidx && generateSidxKey(playlist.sidx); // playlist lacks sidx or sidx segments were added to this playlist already.\n\n    if (!playlist.sidx || !sidxKey || this.mainPlaylistLoader_.sidxMapping_[sidxKey]) {\n      // keep this function async\n      this.mediaRequest_ = window$1.setTimeout(() => cb(false), 0);\n      return;\n    } // resolve the segment URL relative to the playlist\n\n\n    const uri = resolveManifestRedirect(playlist.sidx.resolvedUri);\n\n    const fin = (err, request) => {\n      if (this.requestErrored_(err, request, startingState)) {\n        return;\n      }\n\n      const sidxMapping = this.mainPlaylistLoader_.sidxMapping_;\n      let sidx;\n\n      try {\n        sidx = parseSidx(toUint8(request.response).subarray(8));\n      } catch (e) {\n        // sidx parsing failed.\n        this.requestErrored_(e, request, startingState);\n        return;\n      }\n\n      sidxMapping[sidxKey] = {\n        sidxInfo: playlist.sidx,\n        sidx\n      };\n      addSidxSegmentsToPlaylist(playlist, sidx, playlist.sidx.resolvedUri);\n      return cb(true);\n    };\n\n    this.request = containerRequest(uri, this.vhs_.xhr, (err, request, container, bytes) => {\n      if (err) {\n        return fin(err, request);\n      }\n\n      if (!container || container !== 'mp4') {\n        return fin({\n          status: request.status,\n          message: `Unsupported ${container || 'unknown'} container type for sidx segment at URL: ${uri}`,\n          // response is just bytes in this case\n          // but we really don't want to return that.\n          response: '',\n          playlist,\n          internal: true,\n          playlistExclusionDuration: Infinity,\n          // MEDIA_ERR_NETWORK\n          code: 2\n        }, request);\n      } // if we already downloaded the sidx bytes in the container request, use them\n\n\n      const {\n        offset,\n        length\n      } = playlist.sidx.byterange;\n\n      if (bytes.length >= length + offset) {\n        return fin(err, {\n          response: bytes.subarray(offset, offset + length),\n          status: request.status,\n          uri: request.uri\n        });\n      } // otherwise request sidx bytes\n\n\n      this.request = this.vhs_.xhr({\n        uri,\n        responseType: 'arraybuffer',\n        headers: segmentXhrHeaders({\n          byterange: playlist.sidx.byterange\n        })\n      }, fin);\n    });\n  }\n\n  dispose() {\n    this.trigger('dispose');\n    this.stopRequest();\n    this.loadedPlaylists_ = {};\n    window$1.clearTimeout(this.minimumUpdatePeriodTimeout_);\n    window$1.clearTimeout(this.mediaRequest_);\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n    this.mediaRequest_ = null;\n    this.minimumUpdatePeriodTimeout_ = null;\n\n    if (this.mainPlaylistLoader_.createMupOnMedia_) {\n      this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_);\n      this.mainPlaylistLoader_.createMupOnMedia_ = null;\n    }\n\n    this.off();\n  }\n\n  hasPendingRequest() {\n    return this.request || this.mediaRequest_;\n  }\n\n  stopRequest() {\n    if (this.request) {\n      const oldRequest = this.request;\n      this.request = null;\n      oldRequest.onreadystatechange = null;\n      oldRequest.abort();\n    }\n  }\n\n  media(playlist) {\n    // getter\n    if (!playlist) {\n      return this.media_;\n    } // setter\n\n\n    if (this.state === 'HAVE_NOTHING') {\n      throw new Error('Cannot switch media playlist from ' + this.state);\n    }\n\n    const startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n    if (typeof playlist === 'string') {\n      if (!this.mainPlaylistLoader_.main.playlists[playlist]) {\n        throw new Error('Unknown playlist URI: ' + playlist);\n      }\n\n      playlist = this.mainPlaylistLoader_.main.playlists[playlist];\n    }\n\n    const mediaChange = !this.media_ || playlist.id !== this.media_.id; // switch to previously loaded playlists immediately\n\n    if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {\n      this.state = 'HAVE_METADATA';\n      this.media_ = playlist; // trigger media change if the active media has been updated\n\n      if (mediaChange) {\n        this.trigger('mediachanging');\n        this.trigger('mediachange');\n      }\n\n      return;\n    } // switching to the active playlist is a no-op\n\n\n    if (!mediaChange) {\n      return;\n    } // switching from an already loaded playlist\n\n\n    if (this.media_) {\n      this.trigger('mediachanging');\n    }\n\n    this.addSidxSegments_(playlist, startingState, sidxChanged => {\n      // everything is ready just continue to haveMetadata\n      this.haveMetadata({\n        startingState,\n        playlist\n      });\n    });\n  }\n\n  haveMetadata({\n    startingState,\n    playlist\n  }) {\n    this.state = 'HAVE_METADATA';\n    this.loadedPlaylists_[playlist.id] = playlist;\n    this.mediaRequest_ = null; // This will trigger loadedplaylist\n\n    this.refreshMedia_(playlist.id); // fire loadedmetadata the first time a media playlist is loaded\n    // to resolve setup of media groups\n\n    if (startingState === 'HAVE_MAIN_MANIFEST') {\n      this.trigger('loadedmetadata');\n    } else {\n      // trigger media change if the active media has been updated\n      this.trigger('mediachange');\n    }\n  }\n\n  pause() {\n    if (this.mainPlaylistLoader_.createMupOnMedia_) {\n      this.off('loadedmetadata', this.mainPlaylistLoader_.createMupOnMedia_);\n      this.mainPlaylistLoader_.createMupOnMedia_ = null;\n    }\n\n    this.stopRequest();\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n\n    if (this.isMain_) {\n      window$1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);\n      this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;\n    }\n\n    if (this.state === 'HAVE_NOTHING') {\n      // If we pause the loader before any data has been retrieved, its as if we never\n      // started, so reset to an unstarted state.\n      this.started = false;\n    }\n  }\n\n  load(isFinalRendition) {\n    window$1.clearTimeout(this.mediaUpdateTimeout);\n    this.mediaUpdateTimeout = null;\n    const media = this.media();\n\n    if (isFinalRendition) {\n      const delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n      this.mediaUpdateTimeout = window$1.setTimeout(() => this.load(), delay);\n      return;\n    } // because the playlists are internal to the manifest, load should either load the\n    // main manifest, or do nothing but trigger an event\n\n\n    if (!this.started) {\n      this.start();\n      return;\n    }\n\n    if (media && !media.endList) {\n      // Check to see if this is the main loader and the MUP was cleared (this happens\n      // when the loader was paused). `media` should be set at this point since one is always\n      // set during `start()`.\n      if (this.isMain_ && !this.minimumUpdatePeriodTimeout_) {\n        // Trigger minimumUpdatePeriod to refresh the main manifest\n        this.trigger('minimumUpdatePeriod'); // Since there was no prior minimumUpdatePeriodTimeout it should be recreated\n\n        this.updateMinimumUpdatePeriodTimeout_();\n      }\n\n      this.trigger('mediaupdatetimeout');\n    } else {\n      this.trigger('loadedplaylist');\n    }\n  }\n\n  start() {\n    this.started = true; // We don't need to request the main manifest again\n    // Call this asynchronously to match the xhr request behavior below\n\n    if (!this.isMain_) {\n      this.mediaRequest_ = window$1.setTimeout(() => this.haveMain_(), 0);\n      return;\n    }\n\n    this.requestMain_((req, mainChanged) => {\n      this.haveMain_();\n\n      if (!this.hasPendingRequest() && !this.media_) {\n        this.media(this.mainPlaylistLoader_.main.playlists[0]);\n      }\n    });\n  }\n\n  requestMain_(cb) {\n    this.request = this.vhs_.xhr({\n      uri: this.mainPlaylistLoader_.srcUrl,\n      withCredentials: this.withCredentials\n    }, (error, req) => {\n      if (this.requestErrored_(error, req)) {\n        if (this.state === 'HAVE_NOTHING') {\n          this.started = false;\n        }\n\n        return;\n      }\n\n      const mainChanged = req.responseText !== this.mainPlaylistLoader_.mainXml_;\n      this.mainPlaylistLoader_.mainXml_ = req.responseText;\n\n      if (req.responseHeaders && req.responseHeaders.date) {\n        this.mainLoaded_ = Date.parse(req.responseHeaders.date);\n      } else {\n        this.mainLoaded_ = Date.now();\n      }\n\n      this.mainPlaylistLoader_.srcUrl = resolveManifestRedirect(this.mainPlaylistLoader_.srcUrl, req);\n\n      if (mainChanged) {\n        this.handleMain_();\n        this.syncClientServerClock_(() => {\n          return cb(req, mainChanged);\n        });\n        return;\n      }\n\n      return cb(req, mainChanged);\n    });\n  }\n  /**\n   * Parses the main xml for UTCTiming node to sync the client clock to the server\n   * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n   *\n   * @param {Function} done\n   *        Function to call when clock sync has completed\n   */\n\n\n  syncClientServerClock_(done) {\n    const utcTiming = parseUTCTiming(this.mainPlaylistLoader_.mainXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n    // server clock\n\n    if (utcTiming === null) {\n      this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();\n      return done();\n    }\n\n    if (utcTiming.method === 'DIRECT') {\n      this.mainPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();\n      return done();\n    }\n\n    this.request = this.vhs_.xhr({\n      uri: resolveUrl(this.mainPlaylistLoader_.srcUrl, utcTiming.value),\n      method: utcTiming.method,\n      withCredentials: this.withCredentials\n    }, (error, req) => {\n      // disposed\n      if (!this.request) {\n        return;\n      }\n\n      if (error) {\n        // sync request failed, fall back to using date header from mpd\n        // TODO: log warning\n        this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();\n        return done();\n      }\n\n      let serverTime;\n\n      if (utcTiming.method === 'HEAD') {\n        if (!req.responseHeaders || !req.responseHeaders.date) {\n          // expected date header not preset, fall back to using date header from mpd\n          // TODO: log warning\n          serverTime = this.mainLoaded_;\n        } else {\n          serverTime = Date.parse(req.responseHeaders.date);\n        }\n      } else {\n        serverTime = Date.parse(req.responseText);\n      }\n\n      this.mainPlaylistLoader_.clientOffset_ = serverTime - Date.now();\n      done();\n    });\n  }\n\n  haveMain_() {\n    this.state = 'HAVE_MAIN_MANIFEST';\n\n    if (this.isMain_) {\n      // We have the main playlist at this point, so\n      // trigger this to allow PlaylistController\n      // to make an initial playlist selection\n      this.trigger('loadedplaylist');\n    } else if (!this.media_) {\n      // no media playlist was specifically selected so select\n      // the one the child playlist loader was created with\n      this.media(this.childPlaylist_);\n    }\n  }\n\n  handleMain_() {\n    // clear media request\n    this.mediaRequest_ = null;\n    const oldMain = this.mainPlaylistLoader_.main;\n    let newMain = parseMainXml({\n      mainXml: this.mainPlaylistLoader_.mainXml_,\n      srcUrl: this.mainPlaylistLoader_.srcUrl,\n      clientOffset: this.mainPlaylistLoader_.clientOffset_,\n      sidxMapping: this.mainPlaylistLoader_.sidxMapping_,\n      previousManifest: oldMain\n    }); // if we have an old main to compare the new main against\n\n    if (oldMain) {\n      newMain = updateMain(oldMain, newMain, this.mainPlaylistLoader_.sidxMapping_);\n    } // only update main if we have a new main\n\n\n    this.mainPlaylistLoader_.main = newMain ? newMain : oldMain;\n    const location = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0];\n\n    if (location && location !== this.mainPlaylistLoader_.srcUrl) {\n      this.mainPlaylistLoader_.srcUrl = location;\n    }\n\n    if (!oldMain || newMain && newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {\n      this.updateMinimumUpdatePeriodTimeout_();\n    }\n\n    this.addEventStreamToMetadataTrack_(newMain);\n    return Boolean(newMain);\n  }\n\n  updateMinimumUpdatePeriodTimeout_() {\n    const mpl = this.mainPlaylistLoader_; // cancel any pending creation of mup on media\n    // a new one will be added if needed.\n\n    if (mpl.createMupOnMedia_) {\n      mpl.off('loadedmetadata', mpl.createMupOnMedia_);\n      mpl.createMupOnMedia_ = null;\n    } // clear any pending timeouts\n\n\n    if (mpl.minimumUpdatePeriodTimeout_) {\n      window$1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);\n      mpl.minimumUpdatePeriodTimeout_ = null;\n    }\n\n    let mup = mpl.main && mpl.main.minimumUpdatePeriod; // If the minimumUpdatePeriod has a value of 0, that indicates that the current\n    // MPD has no future validity, so a new one will need to be acquired when new\n    // media segments are to be made available. Thus, we use the target duration\n    // in this case\n\n    if (mup === 0) {\n      if (mpl.media()) {\n        mup = mpl.media().targetDuration * 1000;\n      } else {\n        mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;\n        mpl.one('loadedmetadata', mpl.createMupOnMedia_);\n      }\n    } // if minimumUpdatePeriod is invalid or <= zero, which\n    // can happen when a live video becomes VOD. skip timeout\n    // creation.\n\n\n    if (typeof mup !== 'number' || mup <= 0) {\n      if (mup < 0) {\n        this.logger_(`found invalid minimumUpdatePeriod of ${mup}, not setting a timeout`);\n      }\n\n      return;\n    }\n\n    this.createMUPTimeout_(mup);\n  }\n\n  createMUPTimeout_(mup) {\n    const mpl = this.mainPlaylistLoader_;\n    mpl.minimumUpdatePeriodTimeout_ = window$1.setTimeout(() => {\n      mpl.minimumUpdatePeriodTimeout_ = null;\n      mpl.trigger('minimumUpdatePeriod');\n      mpl.createMUPTimeout_(mup);\n    }, mup);\n  }\n  /**\n   * Sends request to refresh the main xml and updates the parsed main manifest\n   */\n\n\n  refreshXml_() {\n    this.requestMain_((req, mainChanged) => {\n      if (!mainChanged) {\n        return;\n      }\n\n      if (this.media_) {\n        this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id];\n      } // This will filter out updated sidx info from the mapping\n\n\n      this.mainPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_);\n      this.addSidxSegments_(this.media(), this.state, sidxChanged => {\n        // TODO: do we need to reload the current playlist?\n        this.refreshMedia_(this.media().id);\n      });\n    });\n  }\n  /**\n   * Refreshes the media playlist by re-parsing the main xml and updating playlist\n   * references. If this is an alternate loader, the updated parsed manifest is retrieved\n   * from the main loader.\n   */\n\n\n  refreshMedia_(mediaID) {\n    if (!mediaID) {\n      throw new Error('refreshMedia_ must take a media id');\n    } // for main we have to reparse the main xml\n    // to re-create segments based on current timing values\n    // which may change media. We only skip updating the main manifest\n    // if this is the first time this.media_ is being set.\n    // as main was just parsed in that case.\n\n\n    if (this.media_ && this.isMain_) {\n      this.handleMain_();\n    }\n\n    const playlists = this.mainPlaylistLoader_.main.playlists;\n    const mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];\n\n    if (mediaChanged) {\n      this.media_ = playlists[mediaID];\n    } else {\n      this.trigger('playlistunchanged');\n    }\n\n    if (!this.mediaUpdateTimeout) {\n      const createMediaUpdateTimeout = () => {\n        if (this.media().endList) {\n          return;\n        }\n\n        this.mediaUpdateTimeout = window$1.setTimeout(() => {\n          this.trigger('mediaupdatetimeout');\n          createMediaUpdateTimeout();\n        }, refreshDelay(this.media(), Boolean(mediaChanged)));\n      };\n\n      createMediaUpdateTimeout();\n    }\n\n    this.trigger('loadedplaylist');\n  }\n  /**\n   * Takes eventstream data from a parsed DASH manifest and adds it to the metadata text track.\n   *\n   * @param {manifest} newMain the newly parsed manifest\n   */\n\n\n  addEventStreamToMetadataTrack_(newMain) {\n    // Only add new event stream metadata if we have a new manifest.\n    if (newMain && this.mainPlaylistLoader_.main.eventStream) {\n      // convert EventStream to ID3-like data.\n      const metadataArray = this.mainPlaylistLoader_.main.eventStream.map(eventStreamNode => {\n        return {\n          cueTime: eventStreamNode.start,\n          frames: [{\n            data: eventStreamNode.messageData\n          }]\n        };\n      });\n      this.addMetadataToTextTrack('EventStream', metadataArray, this.mainPlaylistLoader_.main.duration);\n    }\n  }\n  /**\n   * Returns the key ID set from a playlist\n   *\n   * @param {playlist} playlist to fetch the key ID set from.\n   * @return a Set of 32 digit hex strings that represent the unique keyIds for that playlist.\n   */\n\n\n  getKeyIdSet(playlist) {\n    if (playlist.contentProtection) {\n      const keyIds = new Set();\n\n      for (const keysystem in playlist.contentProtection) {\n        const defaultKID = playlist.contentProtection[keysystem].attributes['cenc:default_KID'];\n\n        if (defaultKID) {\n          // DASH keyIds are separated by dashes.\n          keyIds.add(defaultKID.replace(/-/g, '').toLowerCase());\n        }\n      }\n\n      return keyIds;\n    }\n  }\n\n}\n\nvar Config = {\n  GOAL_BUFFER_LENGTH: 30,\n  MAX_GOAL_BUFFER_LENGTH: 60,\n  BACK_BUFFER_LENGTH: 30,\n  GOAL_BUFFER_LENGTH_RATE: 1,\n  // 0.5 MB/s\n  INITIAL_BANDWIDTH: 4194304,\n  // A fudge factor to apply to advertised playlist bitrates to account for\n  // temporary flucations in client bandwidth\n  BANDWIDTH_VARIANCE: 1.2,\n  // How much of the buffer must be filled before we consider upswitching\n  BUFFER_LOW_WATER_LINE: 0,\n  MAX_BUFFER_LOW_WATER_LINE: 30,\n  // TODO: Remove this when experimentalBufferBasedABR is removed\n  EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,\n  BUFFER_LOW_WATER_LINE_RATE: 1,\n  // If the buffer is greater than the high water line, we won't switch down\n  BUFFER_HIGH_WATER_LINE: 30\n};\n\nconst stringToArrayBuffer = string => {\n  const view = new Uint8Array(new ArrayBuffer(string.length));\n\n  for (let i = 0; i < string.length; i++) {\n    view[i] = string.charCodeAt(i);\n  }\n\n  return view.buffer;\n};\n\n/* global Blob, BlobBuilder, Worker */\n// unify worker interface\nconst browserWorkerPolyFill = function (workerObj) {\n  // node only supports on/off\n  workerObj.on = workerObj.addEventListener;\n  workerObj.off = workerObj.removeEventListener;\n  return workerObj;\n};\n\nconst createObjectURL = function (str) {\n  try {\n    return URL.createObjectURL(new Blob([str], {\n      type: 'application/javascript'\n    }));\n  } catch (e) {\n    const blob = new BlobBuilder();\n    blob.append(str);\n    return URL.createObjectURL(blob.getBlob());\n  }\n};\n\nconst factory = function (code) {\n  return function () {\n    const objectUrl = createObjectURL(code);\n    const worker = browserWorkerPolyFill(new Worker(objectUrl));\n    worker.objURL = objectUrl;\n    const terminate = worker.terminate;\n    worker.on = worker.addEventListener;\n    worker.off = worker.removeEventListener;\n\n    worker.terminate = function () {\n      URL.revokeObjectURL(objectUrl);\n      return terminate.call(this);\n    };\n\n    return worker;\n  };\n};\nconst transform = function (code) {\n  return `var browserWorkerPolyFill = ${browserWorkerPolyFill.toString()};\\n` + 'browserWorkerPolyFill(self);\\n' + code;\n};\n\nconst getWorkerString = function (fn) {\n  return fn.toString().replace(/^function.+?{/, '').slice(0, -1);\n};\n\n/* rollup-plugin-worker-factory start for worker!/home/runner/work/http-streaming/http-streaming/src/transmuxer-worker.js */\nconst workerCode$1 = transform(getWorkerString(function () {\n\n  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * A lightweight readable stream implemention that handles event dispatching.\n   * Objects that inherit from streams should call init in their constructors.\n   */\n\n  var Stream$8 = function () {\n    this.init = function () {\n      var listeners = {};\n      /**\n       * Add a listener for a specified event type.\n       * @param type {string} the event name\n       * @param listener {function} the callback to be invoked when an event of\n       * the specified type occurs\n       */\n\n      this.on = function (type, listener) {\n        if (!listeners[type]) {\n          listeners[type] = [];\n        }\n\n        listeners[type] = listeners[type].concat(listener);\n      };\n      /**\n       * Remove a listener for a specified event type.\n       * @param type {string} the event name\n       * @param listener {function} a function previously registered for this\n       * type of event through `on`\n       */\n\n\n      this.off = function (type, listener) {\n        var index;\n\n        if (!listeners[type]) {\n          return false;\n        }\n\n        index = listeners[type].indexOf(listener);\n        listeners[type] = listeners[type].slice();\n        listeners[type].splice(index, 1);\n        return index > -1;\n      };\n      /**\n       * Trigger an event of the specified type on this stream. Any additional\n       * arguments to this function are passed as parameters to event listeners.\n       * @param type {string} the event name\n       */\n\n\n      this.trigger = function (type) {\n        var callbacks, i, length, args;\n        callbacks = listeners[type];\n\n        if (!callbacks) {\n          return;\n        } // Slicing the arguments on every invocation of this method\n        // can add a significant amount of overhead. Avoid the\n        // intermediate object creation for the common case of a\n        // single callback argument\n\n\n        if (arguments.length === 2) {\n          length = callbacks.length;\n\n          for (i = 0; i < length; ++i) {\n            callbacks[i].call(this, arguments[1]);\n          }\n        } else {\n          args = [];\n          i = arguments.length;\n\n          for (i = 1; i < arguments.length; ++i) {\n            args.push(arguments[i]);\n          }\n\n          length = callbacks.length;\n\n          for (i = 0; i < length; ++i) {\n            callbacks[i].apply(this, args);\n          }\n        }\n      };\n      /**\n       * Destroys the stream and cleans up.\n       */\n\n\n      this.dispose = function () {\n        listeners = {};\n      };\n    };\n  };\n  /**\n   * Forwards all `data` events on this stream to the destination stream. The\n   * destination stream should provide a method `push` to receive the data\n   * events as they arrive.\n   * @param destination {stream} the stream that will receive all `data` events\n   * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n   *                            when the current stream emits a 'done' event\n   * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n   */\n\n\n  Stream$8.prototype.pipe = function (destination) {\n    this.on('data', function (data) {\n      destination.push(data);\n    });\n    this.on('done', function (flushSource) {\n      destination.flush(flushSource);\n    });\n    this.on('partialdone', function (flushSource) {\n      destination.partialFlush(flushSource);\n    });\n    this.on('endedtimeline', function (flushSource) {\n      destination.endTimeline(flushSource);\n    });\n    this.on('reset', function (flushSource) {\n      destination.reset(flushSource);\n    });\n    return destination;\n  }; // Default stream functions that are expected to be overridden to perform\n  // actual work. These are provided by the prototype as a sort of no-op\n  // implementation so that we don't have to check for their existence in the\n  // `pipe` function above.\n\n\n  Stream$8.prototype.push = function (data) {\n    this.trigger('data', data);\n  };\n\n  Stream$8.prototype.flush = function (flushSource) {\n    this.trigger('done', flushSource);\n  };\n\n  Stream$8.prototype.partialFlush = function (flushSource) {\n    this.trigger('partialdone', flushSource);\n  };\n\n  Stream$8.prototype.endTimeline = function (flushSource) {\n    this.trigger('endedtimeline', flushSource);\n  };\n\n  Stream$8.prototype.reset = function (flushSource) {\n    this.trigger('reset', flushSource);\n  };\n\n  var stream = Stream$8;\n  var MAX_UINT32$1 = Math.pow(2, 32);\n\n  var getUint64$3 = function (uint8) {\n    var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);\n    var value;\n\n    if (dv.getBigUint64) {\n      value = dv.getBigUint64(0);\n\n      if (value < Number.MAX_SAFE_INTEGER) {\n        return Number(value);\n      }\n\n      return value;\n    }\n\n    return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);\n  };\n\n  var numbers = {\n    getUint64: getUint64$3,\n    MAX_UINT32: MAX_UINT32$1\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Functions that generate fragmented MP4s suitable for use with Media\n   * Source Extensions.\n   */\n\n  var MAX_UINT32 = numbers.MAX_UINT32;\n  var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n  (function () {\n    var i;\n    types = {\n      avc1: [],\n      // codingname\n      avcC: [],\n      btrt: [],\n      dinf: [],\n      dref: [],\n      esds: [],\n      ftyp: [],\n      hdlr: [],\n      mdat: [],\n      mdhd: [],\n      mdia: [],\n      mfhd: [],\n      minf: [],\n      moof: [],\n      moov: [],\n      mp4a: [],\n      // codingname\n      mvex: [],\n      mvhd: [],\n      pasp: [],\n      sdtp: [],\n      smhd: [],\n      stbl: [],\n      stco: [],\n      stsc: [],\n      stsd: [],\n      stsz: [],\n      stts: [],\n      styp: [],\n      tfdt: [],\n      tfhd: [],\n      traf: [],\n      trak: [],\n      trun: [],\n      trex: [],\n      tkhd: [],\n      vmhd: []\n    }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n    // don't throw an error\n\n    if (typeof Uint8Array === 'undefined') {\n      return;\n    }\n\n    for (i in types) {\n      if (types.hasOwnProperty(i)) {\n        types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n      }\n    }\n\n    MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n    AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n    MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n    VIDEO_HDLR = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // pre_defined\n    0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n    ]);\n    AUDIO_HDLR = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // pre_defined\n    0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n    ]);\n    HDLR_TYPES = {\n      video: VIDEO_HDLR,\n      audio: AUDIO_HDLR\n    };\n    DREF = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x01, // entry_count\n    0x00, 0x00, 0x00, 0x0c, // entry_size\n    0x75, 0x72, 0x6c, 0x20, // 'url' type\n    0x00, // version 0\n    0x00, 0x00, 0x01 // entry_flags\n    ]);\n    SMHD = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, // balance, 0 means centered\n    0x00, 0x00 // reserved\n    ]);\n    STCO = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00 // entry_count\n    ]);\n    STSC = STCO;\n    STSZ = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x00, // sample_size\n    0x00, 0x00, 0x00, 0x00 // sample_count\n    ]);\n    STTS = STCO;\n    VMHD = new Uint8Array([0x00, // version\n    0x00, 0x00, 0x01, // flags\n    0x00, 0x00, // graphicsmode\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n    ]);\n  })();\n\n  box = function (type) {\n    var payload = [],\n        size = 0,\n        i,\n        result,\n        view;\n\n    for (i = 1; i < arguments.length; i++) {\n      payload.push(arguments[i]);\n    }\n\n    i = payload.length; // calculate the total size we need to allocate\n\n    while (i--) {\n      size += payload[i].byteLength;\n    }\n\n    result = new Uint8Array(size + 8);\n    view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n    view.setUint32(0, result.byteLength);\n    result.set(type, 4); // copy the payload into the result\n\n    for (i = 0, size = 8; i < payload.length; i++) {\n      result.set(payload[i], size);\n      size += payload[i].byteLength;\n    }\n\n    return result;\n  };\n\n  dinf = function () {\n    return box(types.dinf, box(types.dref, DREF));\n  };\n\n  esds = function (track) {\n    return box(types.esds, new Uint8Array([0x00, // version\n    0x00, 0x00, 0x00, // flags\n    // ES_Descriptor\n    0x03, // tag, ES_DescrTag\n    0x19, // length\n    0x00, 0x00, // ES_ID\n    0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n    // DecoderConfigDescriptor\n    0x04, // tag, DecoderConfigDescrTag\n    0x11, // length\n    0x40, // object type\n    0x15, // streamType\n    0x00, 0x06, 0x00, // bufferSizeDB\n    0x00, 0x00, 0xda, 0xc0, // maxBitrate\n    0x00, 0x00, 0xda, 0xc0, // avgBitrate\n    // DecoderSpecificInfo\n    0x05, // tag, DecoderSpecificInfoTag\n    0x02, // length\n    // ISO/IEC 14496-3, AudioSpecificConfig\n    // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n    track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n    ]));\n  };\n\n  ftyp = function () {\n    return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n  };\n\n  hdlr = function (type) {\n    return box(types.hdlr, HDLR_TYPES[type]);\n  };\n\n  mdat = function (data) {\n    return box(types.mdat, data);\n  };\n\n  mdhd = function (track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x02, // creation_time\n    0x00, 0x00, 0x00, 0x03, // modification_time\n    0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n    track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF, // duration\n    0x55, 0xc4, // 'und' language (undetermined)\n    0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n    // defined. The sample rate can be parsed out of an ADTS header, for\n    // instance.\n\n    if (track.samplerate) {\n      result[12] = track.samplerate >>> 24 & 0xFF;\n      result[13] = track.samplerate >>> 16 & 0xFF;\n      result[14] = track.samplerate >>> 8 & 0xFF;\n      result[15] = track.samplerate & 0xFF;\n    }\n\n    return box(types.mdhd, result);\n  };\n\n  mdia = function (track) {\n    return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n  };\n\n  mfhd = function (sequenceNumber) {\n    return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n    (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n    ]));\n  };\n\n  minf = function (track) {\n    return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n  };\n\n  moof = function (sequenceNumber, tracks) {\n    var trackFragments = [],\n        i = tracks.length; // build traf boxes for each track fragment\n\n    while (i--) {\n      trackFragments[i] = traf(tracks[i]);\n    }\n\n    return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n  };\n  /**\n   * Returns a movie box.\n   * @param tracks {array} the tracks associated with this movie\n   * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n   */\n\n\n  moov = function (tracks) {\n    var i = tracks.length,\n        boxes = [];\n\n    while (i--) {\n      boxes[i] = trak(tracks[i]);\n    }\n\n    return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n  };\n\n  mvex = function (tracks) {\n    var i = tracks.length,\n        boxes = [];\n\n    while (i--) {\n      boxes[i] = trex(tracks[i]);\n    }\n\n    return box.apply(null, [types.mvex].concat(boxes));\n  };\n\n  mvhd = function (duration) {\n    var bytes = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    0x00, 0x00, 0x00, 0x01, // creation_time\n    0x00, 0x00, 0x00, 0x02, // modification_time\n    0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n    (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF, // duration\n    0x00, 0x01, 0x00, 0x00, // 1.0 rate\n    0x01, 0x00, // 1.0 volume\n    0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n    0xff, 0xff, 0xff, 0xff // next_track_ID\n    ]);\n    return box(types.mvhd, bytes);\n  };\n\n  sdtp = function (track) {\n    var samples = track.samples || [],\n        bytes = new Uint8Array(4 + samples.length),\n        flags,\n        i; // leave the full box header (4 bytes) all zero\n    // write the sample table\n\n    for (i = 0; i < samples.length; i++) {\n      flags = samples[i].flags;\n      bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n    }\n\n    return box(types.sdtp, bytes);\n  };\n\n  stbl = function (track) {\n    return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n  };\n\n  (function () {\n    var videoSample, audioSample;\n\n    stsd = function (track) {\n      return box(types.stsd, new Uint8Array([0x00, // version 0\n      0x00, 0x00, 0x00, // flags\n      0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n    };\n\n    videoSample = function (track) {\n      var sps = track.sps || [],\n          pps = track.pps || [],\n          sequenceParameterSets = [],\n          pictureParameterSets = [],\n          i,\n          avc1Box; // assemble the SPSs\n\n      for (i = 0; i < sps.length; i++) {\n        sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n        sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n        sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n      } // assemble the PPSs\n\n\n      for (i = 0; i < pps.length; i++) {\n        pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n        pictureParameterSets.push(pps[i].byteLength & 0xFF);\n        pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n      }\n\n      avc1Box = [types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // data_reference_index\n      0x00, 0x00, // pre_defined\n      0x00, 0x00, // reserved\n      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n      (track.width & 0xff00) >> 8, track.width & 0xff, // width\n      (track.height & 0xff00) >> 8, track.height & 0xff, // height\n      0x00, 0x48, 0x00, 0x00, // horizresolution\n      0x00, 0x48, 0x00, 0x00, // vertresolution\n      0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // frame_count\n      0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n      0x00, 0x18, // depth = 24\n      0x11, 0x11 // pre_defined = -1\n      ]), box(types.avcC, new Uint8Array([0x01, // configurationVersion\n      track.profileIdc, // AVCProfileIndication\n      track.profileCompatibility, // profile_compatibility\n      track.levelIdc, // AVCLevelIndication\n      0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n      ].concat([sps.length], // numOfSequenceParameterSets\n      sequenceParameterSets, // \"SPS\"\n      [pps.length], // numOfPictureParameterSets\n      pictureParameterSets // \"PPS\"\n      ))), box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n      0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n      0x00, 0x2d, 0xc6, 0xc0 // avgBitrate\n      ]))];\n\n      if (track.sarRatio) {\n        var hSpacing = track.sarRatio[0],\n            vSpacing = track.sarRatio[1];\n        avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 0xFF000000) >> 24, (hSpacing & 0xFF0000) >> 16, (hSpacing & 0xFF00) >> 8, hSpacing & 0xFF, (vSpacing & 0xFF000000) >> 24, (vSpacing & 0xFF0000) >> 16, (vSpacing & 0xFF00) >> 8, vSpacing & 0xFF])));\n      }\n\n      return box.apply(null, avc1Box);\n    };\n\n    audioSample = function (track) {\n      return box(types.mp4a, new Uint8Array([// SampleEntry, ISO/IEC 14496-12\n      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x01, // data_reference_index\n      // AudioSampleEntry, ISO/IEC 14496-12\n      0x00, 0x00, 0x00, 0x00, // reserved\n      0x00, 0x00, 0x00, 0x00, // reserved\n      (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff, // channelcount\n      (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff, // samplesize\n      0x00, 0x00, // pre_defined\n      0x00, 0x00, // reserved\n      (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n      // MP4AudioSampleEntry, ISO/IEC 14496-14\n      ]), esds(track));\n    };\n  })();\n\n  tkhd = function (track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x07, // flags\n    0x00, 0x00, 0x00, 0x00, // creation_time\n    0x00, 0x00, 0x00, 0x00, // modification_time\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x00, // reserved\n    (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF, // duration\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n    0x00, 0x00, // layer\n    0x00, 0x00, // alternate_group\n    0x01, 0x00, // non-audio track volume\n    0x00, 0x00, // reserved\n    0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n    (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00, // width\n    (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n    ]);\n    return box(types.tkhd, result);\n  };\n  /**\n   * Generate a track fragment (traf) box. A traf box collects metadata\n   * about tracks in a movie fragment (moof) box.\n   */\n\n\n  traf = function (track) {\n    var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n    trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x3a, // flags\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x01, // sample_description_index\n    0x00, 0x00, 0x00, 0x00, // default_sample_duration\n    0x00, 0x00, 0x00, 0x00, // default_sample_size\n    0x00, 0x00, 0x00, 0x00 // default_sample_flags\n    ]));\n    upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT32);\n    lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT32);\n    trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01, // version 1\n    0x00, 0x00, 0x00, // flags\n    // baseMediaDecodeTime\n    upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n    // the containing moof to the first payload byte of the associated\n    // mdat\n\n    dataOffset = 32 + // tfhd\n    20 + // tfdt\n    8 + // traf header\n    16 + // mfhd\n    8 + // moof header\n    8; // mdat header\n    // audio tracks require less metadata\n\n    if (track.type === 'audio') {\n      trackFragmentRun = trun$1(track, dataOffset);\n      return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n    } // video tracks should contain an independent and disposable samples\n    // box (sdtp)\n    // generate one and adjust offsets to match\n\n\n    sampleDependencyTable = sdtp(track);\n    trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);\n    return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n  };\n  /**\n   * Generate a track box.\n   * @param track {object} a track definition\n   * @return {Uint8Array} the track box\n   */\n\n\n  trak = function (track) {\n    track.duration = track.duration || 0xffffffff;\n    return box(types.trak, tkhd(track), mdia(track));\n  };\n\n  trex = function (track) {\n    var result = new Uint8Array([0x00, // version 0\n    0x00, 0x00, 0x00, // flags\n    (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n    0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n    0x00, 0x00, 0x00, 0x00, // default_sample_duration\n    0x00, 0x00, 0x00, 0x00, // default_sample_size\n    0x00, 0x01, 0x00, 0x01 // default_sample_flags\n    ]); // the last two bytes of default_sample_flags is the sample\n    // degradation priority, a hint about the importance of this sample\n    // relative to others. Lower the degradation priority for all sample\n    // types other than video.\n\n    if (track.type !== 'video') {\n      result[result.length - 1] = 0x00;\n    }\n\n    return box(types.trex, result);\n  };\n\n  (function () {\n    var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n    // duration is present for the first sample, it will be present for\n    // all subsequent samples.\n    // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n    trunHeader = function (samples, offset) {\n      var durationPresent = 0,\n          sizePresent = 0,\n          flagsPresent = 0,\n          compositionTimeOffset = 0; // trun flag constants\n\n      if (samples.length) {\n        if (samples[0].duration !== undefined) {\n          durationPresent = 0x1;\n        }\n\n        if (samples[0].size !== undefined) {\n          sizePresent = 0x2;\n        }\n\n        if (samples[0].flags !== undefined) {\n          flagsPresent = 0x4;\n        }\n\n        if (samples[0].compositionTimeOffset !== undefined) {\n          compositionTimeOffset = 0x8;\n        }\n      }\n\n      return [0x00, // version 0\n      0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01, // flags\n      (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF, // sample_count\n      (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n      ];\n    };\n\n    videoTrun = function (track, offset) {\n      var bytesOffest, bytes, header, samples, sample, i;\n      samples = track.samples || [];\n      offset += 8 + 12 + 16 * samples.length;\n      header = trunHeader(samples, offset);\n      bytes = new Uint8Array(header.length + samples.length * 16);\n      bytes.set(header);\n      bytesOffest = header.length;\n\n      for (i = 0; i < samples.length; i++) {\n        sample = samples[i];\n        bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n        bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n\n        bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;\n        bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;\n        bytes[bytesOffest++] = sample.flags.degradationPriority & 0xF0 << 8;\n        bytes[bytesOffest++] = sample.flags.degradationPriority & 0x0F; // sample_flags\n\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.compositionTimeOffset & 0xFF; // sample_composition_time_offset\n      }\n\n      return box(types.trun, bytes);\n    };\n\n    audioTrun = function (track, offset) {\n      var bytes, bytesOffest, header, samples, sample, i;\n      samples = track.samples || [];\n      offset += 8 + 12 + 8 * samples.length;\n      header = trunHeader(samples, offset);\n      bytes = new Uint8Array(header.length + samples.length * 8);\n      bytes.set(header);\n      bytesOffest = header.length;\n\n      for (i = 0; i < samples.length; i++) {\n        sample = samples[i];\n        bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n        bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n        bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n        bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n        bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n      }\n\n      return box(types.trun, bytes);\n    };\n\n    trun$1 = function (track, offset) {\n      if (track.type === 'audio') {\n        return audioTrun(track, offset);\n      }\n\n      return videoTrun(track, offset);\n    };\n  })();\n\n  var mp4Generator = {\n    ftyp: ftyp,\n    mdat: mdat,\n    moof: moof,\n    moov: moov,\n    initSegment: function (tracks) {\n      var fileType = ftyp(),\n          movie = moov(tracks),\n          result;\n      result = new Uint8Array(fileType.byteLength + movie.byteLength);\n      result.set(fileType);\n      result.set(movie, fileType.byteLength);\n      return result;\n    }\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n  // composed of the nal units that make up that frame\n  // Also keep track of cummulative data about the frame from the nal units such\n  // as the frame duration, starting pts, etc.\n\n  var groupNalsIntoFrames = function (nalUnits) {\n    var i,\n        currentNal,\n        currentFrame = [],\n        frames = []; // TODO added for LHLS, make sure this is OK\n\n    frames.byteLength = 0;\n    frames.nalCount = 0;\n    frames.duration = 0;\n    currentFrame.byteLength = 0;\n\n    for (i = 0; i < nalUnits.length; i++) {\n      currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n      if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n        // Since the very first nal unit is expected to be an AUD\n        // only push to the frames array when currentFrame is not empty\n        if (currentFrame.length) {\n          currentFrame.duration = currentNal.dts - currentFrame.dts; // TODO added for LHLS, make sure this is OK\n\n          frames.byteLength += currentFrame.byteLength;\n          frames.nalCount += currentFrame.length;\n          frames.duration += currentFrame.duration;\n          frames.push(currentFrame);\n        }\n\n        currentFrame = [currentNal];\n        currentFrame.byteLength = currentNal.data.byteLength;\n        currentFrame.pts = currentNal.pts;\n        currentFrame.dts = currentNal.dts;\n      } else {\n        // Specifically flag key frames for ease of use later\n        if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n          currentFrame.keyFrame = true;\n        }\n\n        currentFrame.duration = currentNal.dts - currentFrame.dts;\n        currentFrame.byteLength += currentNal.data.byteLength;\n        currentFrame.push(currentNal);\n      }\n    } // For the last frame, use the duration of the previous frame if we\n    // have nothing better to go on\n\n\n    if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n      currentFrame.duration = frames[frames.length - 1].duration;\n    } // Push the final frame\n    // TODO added for LHLS, make sure this is OK\n\n\n    frames.byteLength += currentFrame.byteLength;\n    frames.nalCount += currentFrame.length;\n    frames.duration += currentFrame.duration;\n    frames.push(currentFrame);\n    return frames;\n  }; // Convert an array of frames into an array of Gop with each Gop being composed\n  // of the frames that make up that Gop\n  // Also keep track of cummulative data about the Gop from the frames such as the\n  // Gop duration, starting pts, etc.\n\n\n  var groupFramesIntoGops = function (frames) {\n    var i,\n        currentFrame,\n        currentGop = [],\n        gops = []; // We must pre-set some of the values on the Gop since we\n    // keep running totals of these values\n\n    currentGop.byteLength = 0;\n    currentGop.nalCount = 0;\n    currentGop.duration = 0;\n    currentGop.pts = frames[0].pts;\n    currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n    gops.byteLength = 0;\n    gops.nalCount = 0;\n    gops.duration = 0;\n    gops.pts = frames[0].pts;\n    gops.dts = frames[0].dts;\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n\n      if (currentFrame.keyFrame) {\n        // Since the very first frame is expected to be an keyframe\n        // only push to the gops array when currentGop is not empty\n        if (currentGop.length) {\n          gops.push(currentGop);\n          gops.byteLength += currentGop.byteLength;\n          gops.nalCount += currentGop.nalCount;\n          gops.duration += currentGop.duration;\n        }\n\n        currentGop = [currentFrame];\n        currentGop.nalCount = currentFrame.length;\n        currentGop.byteLength = currentFrame.byteLength;\n        currentGop.pts = currentFrame.pts;\n        currentGop.dts = currentFrame.dts;\n        currentGop.duration = currentFrame.duration;\n      } else {\n        currentGop.duration += currentFrame.duration;\n        currentGop.nalCount += currentFrame.length;\n        currentGop.byteLength += currentFrame.byteLength;\n        currentGop.push(currentFrame);\n      }\n    }\n\n    if (gops.length && currentGop.duration <= 0) {\n      currentGop.duration = gops[gops.length - 1].duration;\n    }\n\n    gops.byteLength += currentGop.byteLength;\n    gops.nalCount += currentGop.nalCount;\n    gops.duration += currentGop.duration; // push the final Gop\n\n    gops.push(currentGop);\n    return gops;\n  };\n  /*\n   * Search for the first keyframe in the GOPs and throw away all frames\n   * until that keyframe. Then extend the duration of the pulled keyframe\n   * and pull the PTS and DTS of the keyframe so that it covers the time\n   * range of the frames that were disposed.\n   *\n   * @param {Array} gops video GOPs\n   * @returns {Array} modified video GOPs\n   */\n\n\n  var extendFirstKeyFrame = function (gops) {\n    var currentGop;\n\n    if (!gops[0][0].keyFrame && gops.length > 1) {\n      // Remove the first GOP\n      currentGop = gops.shift();\n      gops.byteLength -= currentGop.byteLength;\n      gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n      // first gop to cover the time period of the\n      // frames we just removed\n\n      gops[0][0].dts = currentGop.dts;\n      gops[0][0].pts = currentGop.pts;\n      gops[0][0].duration += currentGop.duration;\n    }\n\n    return gops;\n  };\n  /**\n   * Default sample object\n   * see ISO/IEC 14496-12:2012, section 8.6.4.3\n   */\n\n\n  var createDefaultSample = function () {\n    return {\n      size: 0,\n      flags: {\n        isLeading: 0,\n        dependsOn: 1,\n        isDependedOn: 0,\n        hasRedundancy: 0,\n        degradationPriority: 0,\n        isNonSyncSample: 1\n      }\n    };\n  };\n  /*\n   * Collates information from a video frame into an object for eventual\n   * entry into an MP4 sample table.\n   *\n   * @param {Object} frame the video frame\n   * @param {Number} dataOffset the byte offset to position the sample\n   * @return {Object} object containing sample table info for a frame\n   */\n\n\n  var sampleForFrame = function (frame, dataOffset) {\n    var sample = createDefaultSample();\n    sample.dataOffset = dataOffset;\n    sample.compositionTimeOffset = frame.pts - frame.dts;\n    sample.duration = frame.duration;\n    sample.size = 4 * frame.length; // Space for nal unit size\n\n    sample.size += frame.byteLength;\n\n    if (frame.keyFrame) {\n      sample.flags.dependsOn = 2;\n      sample.flags.isNonSyncSample = 0;\n    }\n\n    return sample;\n  }; // generate the track's sample table from an array of gops\n\n\n  var generateSampleTable$1 = function (gops, baseDataOffset) {\n    var h,\n        i,\n        sample,\n        currentGop,\n        currentFrame,\n        dataOffset = baseDataOffset || 0,\n        samples = [];\n\n    for (h = 0; h < gops.length; h++) {\n      currentGop = gops[h];\n\n      for (i = 0; i < currentGop.length; i++) {\n        currentFrame = currentGop[i];\n        sample = sampleForFrame(currentFrame, dataOffset);\n        dataOffset += sample.size;\n        samples.push(sample);\n      }\n    }\n\n    return samples;\n  }; // generate the track's raw mdat data from an array of gops\n\n\n  var concatenateNalData = function (gops) {\n    var h,\n        i,\n        j,\n        currentGop,\n        currentFrame,\n        currentNal,\n        dataOffset = 0,\n        nalsByteLength = gops.byteLength,\n        numberOfNals = gops.nalCount,\n        totalByteLength = nalsByteLength + 4 * numberOfNals,\n        data = new Uint8Array(totalByteLength),\n        view = new DataView(data.buffer); // For each Gop..\n\n    for (h = 0; h < gops.length; h++) {\n      currentGop = gops[h]; // For each Frame..\n\n      for (i = 0; i < currentGop.length; i++) {\n        currentFrame = currentGop[i]; // For each NAL..\n\n        for (j = 0; j < currentFrame.length; j++) {\n          currentNal = currentFrame[j];\n          view.setUint32(dataOffset, currentNal.data.byteLength);\n          dataOffset += 4;\n          data.set(currentNal.data, dataOffset);\n          dataOffset += currentNal.data.byteLength;\n        }\n      }\n    }\n\n    return data;\n  }; // generate the track's sample table from a frame\n\n\n  var generateSampleTableForFrame = function (frame, baseDataOffset) {\n    var sample,\n        dataOffset = baseDataOffset || 0,\n        samples = [];\n    sample = sampleForFrame(frame, dataOffset);\n    samples.push(sample);\n    return samples;\n  }; // generate the track's raw mdat data from a frame\n\n\n  var concatenateNalDataForFrame = function (frame) {\n    var i,\n        currentNal,\n        dataOffset = 0,\n        nalsByteLength = frame.byteLength,\n        numberOfNals = frame.length,\n        totalByteLength = nalsByteLength + 4 * numberOfNals,\n        data = new Uint8Array(totalByteLength),\n        view = new DataView(data.buffer); // For each NAL..\n\n    for (i = 0; i < frame.length; i++) {\n      currentNal = frame[i];\n      view.setUint32(dataOffset, currentNal.data.byteLength);\n      dataOffset += 4;\n      data.set(currentNal.data, dataOffset);\n      dataOffset += currentNal.data.byteLength;\n    }\n\n    return data;\n  };\n\n  var frameUtils$1 = {\n    groupNalsIntoFrames: groupNalsIntoFrames,\n    groupFramesIntoGops: groupFramesIntoGops,\n    extendFirstKeyFrame: extendFirstKeyFrame,\n    generateSampleTable: generateSampleTable$1,\n    concatenateNalData: concatenateNalData,\n    generateSampleTableForFrame: generateSampleTableForFrame,\n    concatenateNalDataForFrame: concatenateNalDataForFrame\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var highPrefix = [33, 16, 5, 32, 164, 27];\n  var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n\n  var zeroFill = function (count) {\n    var a = [];\n\n    while (count--) {\n      a.push(0);\n    }\n\n    return a;\n  };\n\n  var makeTable = function (metaTable) {\n    return Object.keys(metaTable).reduce(function (obj, key) {\n      obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n        return arr.concat(part);\n      }, []));\n      return obj;\n    }, {});\n  };\n\n  var silence;\n\n  var silence_1 = function () {\n    if (!silence) {\n      // Frames-of-silence to use for filling in missing AAC frames\n      var coneOfSilence = {\n        96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n        88200: [highPrefix, [231], zeroFill(170), [56]],\n        64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n        48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n        44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n        32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n        24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n        16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n        12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n        11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n        8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n      };\n      silence = makeTable(coneOfSilence);\n    }\n\n    return silence;\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n\n  var ONE_SECOND_IN_TS$4 = 90000,\n      // 90kHz clock\n  secondsToVideoTs,\n      secondsToAudioTs,\n      videoTsToSeconds,\n      audioTsToSeconds,\n      audioTsToVideoTs,\n      videoTsToAudioTs,\n      metadataTsToSeconds;\n\n  secondsToVideoTs = function (seconds) {\n    return seconds * ONE_SECOND_IN_TS$4;\n  };\n\n  secondsToAudioTs = function (seconds, sampleRate) {\n    return seconds * sampleRate;\n  };\n\n  videoTsToSeconds = function (timestamp) {\n    return timestamp / ONE_SECOND_IN_TS$4;\n  };\n\n  audioTsToSeconds = function (timestamp, sampleRate) {\n    return timestamp / sampleRate;\n  };\n\n  audioTsToVideoTs = function (timestamp, sampleRate) {\n    return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n  };\n\n  videoTsToAudioTs = function (timestamp, sampleRate) {\n    return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n  };\n  /**\n   * Adjust ID3 tag or caption timing information by the timeline pts values\n   * (if keepOriginalTimestamps is false) and convert to seconds\n   */\n\n\n  metadataTsToSeconds = function (timestamp, timelineStartPts, keepOriginalTimestamps) {\n    return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n  };\n\n  var clock$2 = {\n    ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,\n    secondsToVideoTs: secondsToVideoTs,\n    secondsToAudioTs: secondsToAudioTs,\n    videoTsToSeconds: videoTsToSeconds,\n    audioTsToSeconds: audioTsToSeconds,\n    audioTsToVideoTs: audioTsToVideoTs,\n    videoTsToAudioTs: videoTsToAudioTs,\n    metadataTsToSeconds: metadataTsToSeconds\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var coneOfSilence = silence_1;\n  var clock$1 = clock$2;\n  /**\n   * Sum the `byteLength` properties of the data in each AAC frame\n   */\n\n  var sumFrameByteLengths = function (array) {\n    var i,\n        currentObj,\n        sum = 0; // sum the byteLength's all each nal unit in the frame\n\n    for (i = 0; i < array.length; i++) {\n      currentObj = array[i];\n      sum += currentObj.data.byteLength;\n    }\n\n    return sum;\n  }; // Possibly pad (prefix) the audio track with silence if appending this track\n  // would lead to the introduction of a gap in the audio buffer\n\n\n  var prefixWithSilence = function (track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n    var baseMediaDecodeTimeTs,\n        frameDuration = 0,\n        audioGapDuration = 0,\n        audioFillFrameCount = 0,\n        audioFillDuration = 0,\n        silentFrame,\n        i,\n        firstFrame;\n\n    if (!frames.length) {\n      return;\n    }\n\n    baseMediaDecodeTimeTs = clock$1.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n    frameDuration = Math.ceil(clock$1.ONE_SECOND_IN_TS / (track.samplerate / 1024));\n\n    if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n      // insert the shortest possible amount (audio gap or audio to video gap)\n      audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n      audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n      audioFillDuration = audioFillFrameCount * frameDuration;\n    } // don't attempt to fill gaps smaller than a single frame or larger\n    // than a half second\n\n\n    if (audioFillFrameCount < 1 || audioFillDuration > clock$1.ONE_SECOND_IN_TS / 2) {\n      return;\n    }\n\n    silentFrame = coneOfSilence()[track.samplerate];\n\n    if (!silentFrame) {\n      // we don't have a silent frame pregenerated for the sample rate, so use a frame\n      // from the content instead\n      silentFrame = frames[0].data;\n    }\n\n    for (i = 0; i < audioFillFrameCount; i++) {\n      firstFrame = frames[0];\n      frames.splice(0, 0, {\n        data: silentFrame,\n        dts: firstFrame.dts - frameDuration,\n        pts: firstFrame.pts - frameDuration\n      });\n    }\n\n    track.baseMediaDecodeTime -= Math.floor(clock$1.videoTsToAudioTs(audioFillDuration, track.samplerate));\n    return audioFillDuration;\n  }; // If the audio segment extends before the earliest allowed dts\n  // value, remove AAC frames until starts at or after the earliest\n  // allowed DTS so that we don't end up with a negative baseMedia-\n  // DecodeTime for the audio track\n\n\n  var trimAdtsFramesByEarliestDts = function (adtsFrames, track, earliestAllowedDts) {\n    if (track.minSegmentDts >= earliestAllowedDts) {\n      return adtsFrames;\n    } // We will need to recalculate the earliest segment Dts\n\n\n    track.minSegmentDts = Infinity;\n    return adtsFrames.filter(function (currentFrame) {\n      // If this is an allowed frame, keep it and record it's Dts\n      if (currentFrame.dts >= earliestAllowedDts) {\n        track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n        track.minSegmentPts = track.minSegmentDts;\n        return true;\n      } // Otherwise, discard it\n\n\n      return false;\n    });\n  }; // generate the track's raw mdat data from an array of frames\n\n\n  var generateSampleTable = function (frames) {\n    var i,\n        currentFrame,\n        samples = [];\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n      samples.push({\n        size: currentFrame.data.byteLength,\n        duration: 1024 // For AAC audio, all samples contain 1024 samples\n\n      });\n    }\n\n    return samples;\n  }; // generate the track's sample table from an array of frames\n\n\n  var concatenateFrameData = function (frames) {\n    var i,\n        currentFrame,\n        dataOffset = 0,\n        data = new Uint8Array(sumFrameByteLengths(frames));\n\n    for (i = 0; i < frames.length; i++) {\n      currentFrame = frames[i];\n      data.set(currentFrame.data, dataOffset);\n      dataOffset += currentFrame.data.byteLength;\n    }\n\n    return data;\n  };\n\n  var audioFrameUtils$1 = {\n    prefixWithSilence: prefixWithSilence,\n    trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n    generateSampleTable: generateSampleTable,\n    concatenateFrameData: concatenateFrameData\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var ONE_SECOND_IN_TS$3 = clock$2.ONE_SECOND_IN_TS;\n  /**\n   * Store information about the start and end of the track and the\n   * duration for each frame/sample we process in order to calculate\n   * the baseMediaDecodeTime\n   */\n\n  var collectDtsInfo = function (track, data) {\n    if (typeof data.pts === 'number') {\n      if (track.timelineStartInfo.pts === undefined) {\n        track.timelineStartInfo.pts = data.pts;\n      }\n\n      if (track.minSegmentPts === undefined) {\n        track.minSegmentPts = data.pts;\n      } else {\n        track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n      }\n\n      if (track.maxSegmentPts === undefined) {\n        track.maxSegmentPts = data.pts;\n      } else {\n        track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n      }\n    }\n\n    if (typeof data.dts === 'number') {\n      if (track.timelineStartInfo.dts === undefined) {\n        track.timelineStartInfo.dts = data.dts;\n      }\n\n      if (track.minSegmentDts === undefined) {\n        track.minSegmentDts = data.dts;\n      } else {\n        track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n      }\n\n      if (track.maxSegmentDts === undefined) {\n        track.maxSegmentDts = data.dts;\n      } else {\n        track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n      }\n    }\n  };\n  /**\n   * Clear values used to calculate the baseMediaDecodeTime between\n   * tracks\n   */\n\n\n  var clearDtsInfo = function (track) {\n    delete track.minSegmentDts;\n    delete track.maxSegmentDts;\n    delete track.minSegmentPts;\n    delete track.maxSegmentPts;\n  };\n  /**\n   * Calculate the track's baseMediaDecodeTime based on the earliest\n   * DTS the transmuxer has ever seen and the minimum DTS for the\n   * current track\n   * @param track {object} track metadata configuration\n   * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n\n  var calculateTrackBaseMediaDecodeTime = function (track, keepOriginalTimestamps) {\n    var baseMediaDecodeTime,\n        scale,\n        minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n    if (!keepOriginalTimestamps) {\n      minSegmentDts -= track.timelineStartInfo.dts;\n    } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n    // we want the start of the first segment to be placed\n\n\n    baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n    baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n    baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n    if (track.type === 'audio') {\n      // Audio has a different clock equal to the sampling_rate so we need to\n      // scale the PTS values into the clock rate of the track\n      scale = track.samplerate / ONE_SECOND_IN_TS$3;\n      baseMediaDecodeTime *= scale;\n      baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n    }\n\n    return baseMediaDecodeTime;\n  };\n\n  var trackDecodeInfo$1 = {\n    clearDtsInfo: clearDtsInfo,\n    calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n    collectDtsInfo: collectDtsInfo\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Reads in-band caption information from a video elementary\n   * stream. Captions must follow the CEA-708 standard for injection\n   * into an MPEG-2 transport streams.\n   * @see https://en.wikipedia.org/wiki/CEA-708\n   * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n   */\n  // payload type field to indicate how they are to be\n  // interpreted. CEAS-708 caption content is always transmitted with\n  // payload type 0x04.\n\n  var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n      RBSP_TRAILING_BITS = 128;\n  /**\n    * Parse a supplemental enhancement information (SEI) NAL unit.\n    * Stops parsing once a message of type ITU T T35 has been found.\n    *\n    * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n    * @return {object} the parsed SEI payload\n    * @see Rec. ITU-T H.264, 7.3.2.3.1\n    */\n\n  var parseSei = function (bytes) {\n    var i = 0,\n        result = {\n      payloadType: -1,\n      payloadSize: 0\n    },\n        payloadType = 0,\n        payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n    while (i < bytes.byteLength) {\n      // stop once we have hit the end of the sei_rbsp\n      if (bytes[i] === RBSP_TRAILING_BITS) {\n        break;\n      } // Parse payload type\n\n\n      while (bytes[i] === 0xFF) {\n        payloadType += 255;\n        i++;\n      }\n\n      payloadType += bytes[i++]; // Parse payload size\n\n      while (bytes[i] === 0xFF) {\n        payloadSize += 255;\n        i++;\n      }\n\n      payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n      // there can only ever be one caption message in a frame's sei\n\n      if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n        var userIdentifier = String.fromCharCode(bytes[i + 3], bytes[i + 4], bytes[i + 5], bytes[i + 6]);\n\n        if (userIdentifier === 'GA94') {\n          result.payloadType = payloadType;\n          result.payloadSize = payloadSize;\n          result.payload = bytes.subarray(i, i + payloadSize);\n          break;\n        } else {\n          result.payload = void 0;\n        }\n      } // skip the payload and parse the next message\n\n\n      i += payloadSize;\n      payloadType = 0;\n      payloadSize = 0;\n    }\n\n    return result;\n  }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n\n  var parseUserData = function (sei) {\n    // itu_t_t35_contry_code must be 181 (United States) for\n    // captions\n    if (sei.payload[0] !== 181) {\n      return null;\n    } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n\n    if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n      return null;\n    } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n\n    if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n      return null;\n    } // finally, user_data_type_code should be 0x03 for caption data\n\n\n    if (sei.payload[7] !== 0x03) {\n      return null;\n    } // return the user_data_type_structure and strip the trailing\n    // marker bits\n\n\n    return sei.payload.subarray(8, sei.payload.length - 1);\n  }; // see CEA-708-D, section 4.4\n\n\n  var parseCaptionPackets = function (pts, userData) {\n    var results = [],\n        i,\n        count,\n        offset,\n        data; // if this is just filler, return immediately\n\n    if (!(userData[0] & 0x40)) {\n      return results;\n    } // parse out the cc_data_1 and cc_data_2 fields\n\n\n    count = userData[0] & 0x1f;\n\n    for (i = 0; i < count; i++) {\n      offset = i * 3;\n      data = {\n        type: userData[offset + 2] & 0x03,\n        pts: pts\n      }; // capture cc data when cc_valid is 1\n\n      if (userData[offset + 2] & 0x04) {\n        data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n        results.push(data);\n      }\n    }\n\n    return results;\n  };\n\n  var discardEmulationPreventionBytes$1 = function (data) {\n    var length = data.byteLength,\n        emulationPreventionBytesPositions = [],\n        i = 1,\n        newLength,\n        newData; // Find all `Emulation Prevention Bytes`\n\n    while (i < length - 2) {\n      if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n        emulationPreventionBytesPositions.push(i + 2);\n        i += 2;\n      } else {\n        i++;\n      }\n    } // If no Emulation Prevention Bytes were found just return the original\n    // array\n\n\n    if (emulationPreventionBytesPositions.length === 0) {\n      return data;\n    } // Create a new array to hold the NAL unit data\n\n\n    newLength = length - emulationPreventionBytesPositions.length;\n    newData = new Uint8Array(newLength);\n    var sourceIndex = 0;\n\n    for (i = 0; i < newLength; sourceIndex++, i++) {\n      if (sourceIndex === emulationPreventionBytesPositions[0]) {\n        // Skip this byte\n        sourceIndex++; // Remove this position index\n\n        emulationPreventionBytesPositions.shift();\n      }\n\n      newData[i] = data[sourceIndex];\n    }\n\n    return newData;\n  }; // exports\n\n\n  var captionPacketParser = {\n    parseSei: parseSei,\n    parseUserData: parseUserData,\n    parseCaptionPackets: parseCaptionPackets,\n    discardEmulationPreventionBytes: discardEmulationPreventionBytes$1,\n    USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Reads in-band caption information from a video elementary\n   * stream. Captions must follow the CEA-708 standard for injection\n   * into an MPEG-2 transport streams.\n   * @see https://en.wikipedia.org/wiki/CEA-708\n   * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n   */\n  // Link To Transport\n  // -----------------\n\n  var Stream$7 = stream;\n  var cea708Parser = captionPacketParser;\n\n  var CaptionStream$2 = function (options) {\n    options = options || {};\n    CaptionStream$2.prototype.init.call(this); // parse708captions flag, default to true\n\n    this.parse708captions_ = typeof options.parse708captions === 'boolean' ? options.parse708captions : true;\n    this.captionPackets_ = [];\n    this.ccStreams_ = [new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n    new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n    new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n    new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n    ];\n\n    if (this.parse708captions_) {\n      this.cc708Stream_ = new Cea708Stream({\n        captionServices: options.captionServices\n      }); // eslint-disable-line no-use-before-define\n    }\n\n    this.reset(); // forward data and done events from CCs to this CaptionStream\n\n    this.ccStreams_.forEach(function (cc) {\n      cc.on('data', this.trigger.bind(this, 'data'));\n      cc.on('partialdone', this.trigger.bind(this, 'partialdone'));\n      cc.on('done', this.trigger.bind(this, 'done'));\n    }, this);\n\n    if (this.parse708captions_) {\n      this.cc708Stream_.on('data', this.trigger.bind(this, 'data'));\n      this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone'));\n      this.cc708Stream_.on('done', this.trigger.bind(this, 'done'));\n    }\n  };\n\n  CaptionStream$2.prototype = new Stream$7();\n\n  CaptionStream$2.prototype.push = function (event) {\n    var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n    if (event.nalUnitType !== 'sei_rbsp') {\n      return;\n    } // parse the sei\n\n\n    sei = cea708Parser.parseSei(event.escapedRBSP); // no payload data, skip\n\n    if (!sei.payload) {\n      return;\n    } // ignore everything but user_data_registered_itu_t_t35\n\n\n    if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {\n      return;\n    } // parse out the user data payload\n\n\n    userData = cea708Parser.parseUserData(sei); // ignore unrecognized userData\n\n    if (!userData) {\n      return;\n    } // Sometimes, the same segment # will be downloaded twice. To stop the\n    // caption data from being processed twice, we track the latest dts we've\n    // received and ignore everything with a dts before that. However, since\n    // data for a specific dts can be split across packets on either side of\n    // a segment boundary, we need to make sure we *don't* ignore the packets\n    // from the *next* segment that have dts === this.latestDts_. By constantly\n    // tracking the number of packets received with dts === this.latestDts_, we\n    // know how many should be ignored once we start receiving duplicates.\n\n\n    if (event.dts < this.latestDts_) {\n      // We've started getting older data, so set the flag.\n      this.ignoreNextEqualDts_ = true;\n      return;\n    } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n      this.numSameDts_--;\n\n      if (!this.numSameDts_) {\n        // We've received the last duplicate packet, time to start processing again\n        this.ignoreNextEqualDts_ = false;\n      }\n\n      return;\n    } // parse out CC data packets and save them for later\n\n\n    newCaptionPackets = cea708Parser.parseCaptionPackets(event.pts, userData);\n    this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n\n    if (this.latestDts_ !== event.dts) {\n      this.numSameDts_ = 0;\n    }\n\n    this.numSameDts_++;\n    this.latestDts_ = event.dts;\n  };\n\n  CaptionStream$2.prototype.flushCCStreams = function (flushType) {\n    this.ccStreams_.forEach(function (cc) {\n      return flushType === 'flush' ? cc.flush() : cc.partialFlush();\n    }, this);\n  };\n\n  CaptionStream$2.prototype.flushStream = function (flushType) {\n    // make sure we actually parsed captions before proceeding\n    if (!this.captionPackets_.length) {\n      this.flushCCStreams(flushType);\n      return;\n    } // In Chrome, the Array#sort function is not stable so add a\n    // presortIndex that we can use to ensure we get a stable-sort\n\n\n    this.captionPackets_.forEach(function (elem, idx) {\n      elem.presortIndex = idx;\n    }); // sort caption byte-pairs based on their PTS values\n\n    this.captionPackets_.sort(function (a, b) {\n      if (a.pts === b.pts) {\n        return a.presortIndex - b.presortIndex;\n      }\n\n      return a.pts - b.pts;\n    });\n    this.captionPackets_.forEach(function (packet) {\n      if (packet.type < 2) {\n        // Dispatch packet to the right Cea608Stream\n        this.dispatchCea608Packet(packet);\n      } else {\n        // Dispatch packet to the Cea708Stream\n        this.dispatchCea708Packet(packet);\n      }\n    }, this);\n    this.captionPackets_.length = 0;\n    this.flushCCStreams(flushType);\n  };\n\n  CaptionStream$2.prototype.flush = function () {\n    return this.flushStream('flush');\n  }; // Only called if handling partial data\n\n\n  CaptionStream$2.prototype.partialFlush = function () {\n    return this.flushStream('partialFlush');\n  };\n\n  CaptionStream$2.prototype.reset = function () {\n    this.latestDts_ = null;\n    this.ignoreNextEqualDts_ = false;\n    this.numSameDts_ = 0;\n    this.activeCea608Channel_ = [null, null];\n    this.ccStreams_.forEach(function (ccStream) {\n      ccStream.reset();\n    });\n  }; // From the CEA-608 spec:\n\n  /*\n   * When XDS sub-packets are interleaved with other services, the end of each sub-packet shall be followed\n   * by a control pair to change to a different service. When any of the control codes from 0x10 to 0x1F is\n   * used to begin a control code pair, it indicates the return to captioning or Text data. The control code pair\n   * and subsequent data should then be processed according to the FCC rules. It may be necessary for the\n   * line 21 data encoder to automatically insert a control code pair (i.e. RCL, RU2, RU3, RU4, RDC, or RTD)\n   * to switch to captioning or Text.\n  */\n  // With that in mind, we ignore any data between an XDS control code and a\n  // subsequent closed-captioning control code.\n\n\n  CaptionStream$2.prototype.dispatchCea608Packet = function (packet) {\n    // NOTE: packet.type is the CEA608 field\n    if (this.setsTextOrXDSActive(packet)) {\n      this.activeCea608Channel_[packet.type] = null;\n    } else if (this.setsChannel1Active(packet)) {\n      this.activeCea608Channel_[packet.type] = 0;\n    } else if (this.setsChannel2Active(packet)) {\n      this.activeCea608Channel_[packet.type] = 1;\n    }\n\n    if (this.activeCea608Channel_[packet.type] === null) {\n      // If we haven't received anything to set the active channel, or the\n      // packets are Text/XDS data, discard the data; we don't want jumbled\n      // captions\n      return;\n    }\n\n    this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n  };\n\n  CaptionStream$2.prototype.setsChannel1Active = function (packet) {\n    return (packet.ccData & 0x7800) === 0x1000;\n  };\n\n  CaptionStream$2.prototype.setsChannel2Active = function (packet) {\n    return (packet.ccData & 0x7800) === 0x1800;\n  };\n\n  CaptionStream$2.prototype.setsTextOrXDSActive = function (packet) {\n    return (packet.ccData & 0x7100) === 0x0100 || (packet.ccData & 0x78fe) === 0x102a || (packet.ccData & 0x78fe) === 0x182a;\n  };\n\n  CaptionStream$2.prototype.dispatchCea708Packet = function (packet) {\n    if (this.parse708captions_) {\n      this.cc708Stream_.push(packet);\n    }\n  }; // ----------------------\n  // Session to Application\n  // ----------------------\n  // This hash maps special and extended character codes to their\n  // proper Unicode equivalent. The first one-byte key is just a\n  // non-standard character code. The two-byte keys that follow are\n  // the extended CEA708 character codes, along with the preceding\n  // 0x10 extended character byte to distinguish these codes from\n  // non-extended character codes. Every CEA708 character code that\n  // is not in this object maps directly to a standard unicode\n  // character code.\n  // The transparent space and non-breaking transparent space are\n  // technically not fully supported since there is no code to\n  // make them transparent, so they have normal non-transparent\n  // stand-ins.\n  // The special closed caption (CC) character isn't a standard\n  // unicode character, so a fairly similar unicode character was\n  // chosen in it's place.\n\n\n  var CHARACTER_TRANSLATION_708 = {\n    0x7f: 0x266a,\n    // ♪\n    0x1020: 0x20,\n    // Transparent Space\n    0x1021: 0xa0,\n    // Nob-breaking Transparent Space\n    0x1025: 0x2026,\n    // …\n    0x102a: 0x0160,\n    // Š\n    0x102c: 0x0152,\n    // Œ\n    0x1030: 0x2588,\n    // █\n    0x1031: 0x2018,\n    // ‘\n    0x1032: 0x2019,\n    // ’\n    0x1033: 0x201c,\n    // “\n    0x1034: 0x201d,\n    // ”\n    0x1035: 0x2022,\n    // •\n    0x1039: 0x2122,\n    // ™\n    0x103a: 0x0161,\n    // š\n    0x103c: 0x0153,\n    // œ\n    0x103d: 0x2120,\n    // ℠\n    0x103f: 0x0178,\n    // Ÿ\n    0x1076: 0x215b,\n    // ⅛\n    0x1077: 0x215c,\n    // ⅜\n    0x1078: 0x215d,\n    // ⅝\n    0x1079: 0x215e,\n    // ⅞\n    0x107a: 0x23d0,\n    // ⏐\n    0x107b: 0x23a4,\n    // ⎤\n    0x107c: 0x23a3,\n    // ⎣\n    0x107d: 0x23af,\n    // ⎯\n    0x107e: 0x23a6,\n    // ⎦\n    0x107f: 0x23a1,\n    // ⎡\n    0x10a0: 0x3138 // ㄸ (CC char)\n\n  };\n\n  var get708CharFromCode = function (code) {\n    var newCode = CHARACTER_TRANSLATION_708[code] || code;\n\n    if (code & 0x1000 && code === newCode) {\n      // Invalid extended code\n      return '';\n    }\n\n    return String.fromCharCode(newCode);\n  };\n\n  var within708TextBlock = function (b) {\n    return 0x20 <= b && b <= 0x7f || 0xa0 <= b && b <= 0xff;\n  };\n\n  var Cea708Window = function (windowNum) {\n    this.windowNum = windowNum;\n    this.reset();\n  };\n\n  Cea708Window.prototype.reset = function () {\n    this.clearText();\n    this.pendingNewLine = false;\n    this.winAttr = {};\n    this.penAttr = {};\n    this.penLoc = {};\n    this.penColor = {}; // These default values are arbitrary,\n    // defineWindow will usually override them\n\n    this.visible = 0;\n    this.rowLock = 0;\n    this.columnLock = 0;\n    this.priority = 0;\n    this.relativePositioning = 0;\n    this.anchorVertical = 0;\n    this.anchorHorizontal = 0;\n    this.anchorPoint = 0;\n    this.rowCount = 1;\n    this.virtualRowCount = this.rowCount + 1;\n    this.columnCount = 41;\n    this.windowStyle = 0;\n    this.penStyle = 0;\n  };\n\n  Cea708Window.prototype.getText = function () {\n    return this.rows.join('\\n');\n  };\n\n  Cea708Window.prototype.clearText = function () {\n    this.rows = [''];\n    this.rowIdx = 0;\n  };\n\n  Cea708Window.prototype.newLine = function (pts) {\n    if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === 'function') {\n      this.beforeRowOverflow(pts);\n    }\n\n    if (this.rows.length > 0) {\n      this.rows.push('');\n      this.rowIdx++;\n    } // Show all virtual rows since there's no visible scrolling\n\n\n    while (this.rows.length > this.virtualRowCount) {\n      this.rows.shift();\n      this.rowIdx--;\n    }\n  };\n\n  Cea708Window.prototype.isEmpty = function () {\n    if (this.rows.length === 0) {\n      return true;\n    } else if (this.rows.length === 1) {\n      return this.rows[0] === '';\n    }\n\n    return false;\n  };\n\n  Cea708Window.prototype.addText = function (text) {\n    this.rows[this.rowIdx] += text;\n  };\n\n  Cea708Window.prototype.backspace = function () {\n    if (!this.isEmpty()) {\n      var row = this.rows[this.rowIdx];\n      this.rows[this.rowIdx] = row.substr(0, row.length - 1);\n    }\n  };\n\n  var Cea708Service = function (serviceNum, encoding, stream) {\n    this.serviceNum = serviceNum;\n    this.text = '';\n    this.currentWindow = new Cea708Window(-1);\n    this.windows = [];\n    this.stream = stream; // Try to setup a TextDecoder if an `encoding` value was provided\n\n    if (typeof encoding === 'string') {\n      this.createTextDecoder(encoding);\n    }\n  };\n  /**\n   * Initialize service windows\n   * Must be run before service use\n   *\n   * @param  {Integer}  pts               PTS value\n   * @param  {Function} beforeRowOverflow Function to execute before row overflow of a window\n   */\n\n\n  Cea708Service.prototype.init = function (pts, beforeRowOverflow) {\n    this.startPts = pts;\n\n    for (var win = 0; win < 8; win++) {\n      this.windows[win] = new Cea708Window(win);\n\n      if (typeof beforeRowOverflow === 'function') {\n        this.windows[win].beforeRowOverflow = beforeRowOverflow;\n      }\n    }\n  };\n  /**\n   * Set current window of service to be affected by commands\n   *\n   * @param  {Integer} windowNum Window number\n   */\n\n\n  Cea708Service.prototype.setCurrentWindow = function (windowNum) {\n    this.currentWindow = this.windows[windowNum];\n  };\n  /**\n   * Try to create a TextDecoder if it is natively supported\n   */\n\n\n  Cea708Service.prototype.createTextDecoder = function (encoding) {\n    if (typeof TextDecoder === 'undefined') {\n      this.stream.trigger('log', {\n        level: 'warn',\n        message: 'The `encoding` option is unsupported without TextDecoder support'\n      });\n    } else {\n      try {\n        this.textDecoder_ = new TextDecoder(encoding);\n      } catch (error) {\n        this.stream.trigger('log', {\n          level: 'warn',\n          message: 'TextDecoder could not be created with ' + encoding + ' encoding. ' + error\n        });\n      }\n    }\n  };\n\n  var Cea708Stream = function (options) {\n    options = options || {};\n    Cea708Stream.prototype.init.call(this);\n    var self = this;\n    var captionServices = options.captionServices || {};\n    var captionServiceEncodings = {};\n    var serviceProps; // Get service encodings from captionServices option block\n\n    Object.keys(captionServices).forEach(serviceName => {\n      serviceProps = captionServices[serviceName];\n\n      if (/^SERVICE/.test(serviceName)) {\n        captionServiceEncodings[serviceName] = serviceProps.encoding;\n      }\n    });\n    this.serviceEncodings = captionServiceEncodings;\n    this.current708Packet = null;\n    this.services = {};\n\n    this.push = function (packet) {\n      if (packet.type === 3) {\n        // 708 packet start\n        self.new708Packet();\n        self.add708Bytes(packet);\n      } else {\n        if (self.current708Packet === null) {\n          // This should only happen at the start of a file if there's no packet start.\n          self.new708Packet();\n        }\n\n        self.add708Bytes(packet);\n      }\n    };\n  };\n\n  Cea708Stream.prototype = new Stream$7();\n  /**\n   * Push current 708 packet, create new 708 packet.\n   */\n\n  Cea708Stream.prototype.new708Packet = function () {\n    if (this.current708Packet !== null) {\n      this.push708Packet();\n    }\n\n    this.current708Packet = {\n      data: [],\n      ptsVals: []\n    };\n  };\n  /**\n   * Add pts and both bytes from packet into current 708 packet.\n   */\n\n\n  Cea708Stream.prototype.add708Bytes = function (packet) {\n    var data = packet.ccData;\n    var byte0 = data >>> 8;\n    var byte1 = data & 0xff; // I would just keep a list of packets instead of bytes, but it isn't clear in the spec\n    // that service blocks will always line up with byte pairs.\n\n    this.current708Packet.ptsVals.push(packet.pts);\n    this.current708Packet.data.push(byte0);\n    this.current708Packet.data.push(byte1);\n  };\n  /**\n   * Parse completed 708 packet into service blocks and push each service block.\n   */\n\n\n  Cea708Stream.prototype.push708Packet = function () {\n    var packet708 = this.current708Packet;\n    var packetData = packet708.data;\n    var serviceNum = null;\n    var blockSize = null;\n    var i = 0;\n    var b = packetData[i++];\n    packet708.seq = b >> 6;\n    packet708.sizeCode = b & 0x3f; // 0b00111111;\n\n    for (; i < packetData.length; i++) {\n      b = packetData[i++];\n      serviceNum = b >> 5;\n      blockSize = b & 0x1f; // 0b00011111\n\n      if (serviceNum === 7 && blockSize > 0) {\n        // Extended service num\n        b = packetData[i++];\n        serviceNum = b;\n      }\n\n      this.pushServiceBlock(serviceNum, i, blockSize);\n\n      if (blockSize > 0) {\n        i += blockSize - 1;\n      }\n    }\n  };\n  /**\n   * Parse service block, execute commands, read text.\n   *\n   * Note: While many of these commands serve important purposes,\n   * many others just parse out the parameters or attributes, but\n   * nothing is done with them because this is not a full and complete\n   * implementation of the entire 708 spec.\n   *\n   * @param  {Integer} serviceNum Service number\n   * @param  {Integer} start      Start index of the 708 packet data\n   * @param  {Integer} size       Block size\n   */\n\n\n  Cea708Stream.prototype.pushServiceBlock = function (serviceNum, start, size) {\n    var b;\n    var i = start;\n    var packetData = this.current708Packet.data;\n    var service = this.services[serviceNum];\n\n    if (!service) {\n      service = this.initService(serviceNum, i);\n    }\n\n    for (; i < start + size && i < packetData.length; i++) {\n      b = packetData[i];\n\n      if (within708TextBlock(b)) {\n        i = this.handleText(i, service);\n      } else if (b === 0x18) {\n        i = this.multiByteCharacter(i, service);\n      } else if (b === 0x10) {\n        i = this.extendedCommands(i, service);\n      } else if (0x80 <= b && b <= 0x87) {\n        i = this.setCurrentWindow(i, service);\n      } else if (0x98 <= b && b <= 0x9f) {\n        i = this.defineWindow(i, service);\n      } else if (b === 0x88) {\n        i = this.clearWindows(i, service);\n      } else if (b === 0x8c) {\n        i = this.deleteWindows(i, service);\n      } else if (b === 0x89) {\n        i = this.displayWindows(i, service);\n      } else if (b === 0x8a) {\n        i = this.hideWindows(i, service);\n      } else if (b === 0x8b) {\n        i = this.toggleWindows(i, service);\n      } else if (b === 0x97) {\n        i = this.setWindowAttributes(i, service);\n      } else if (b === 0x90) {\n        i = this.setPenAttributes(i, service);\n      } else if (b === 0x91) {\n        i = this.setPenColor(i, service);\n      } else if (b === 0x92) {\n        i = this.setPenLocation(i, service);\n      } else if (b === 0x8f) {\n        service = this.reset(i, service);\n      } else if (b === 0x08) {\n        // BS: Backspace\n        service.currentWindow.backspace();\n      } else if (b === 0x0c) {\n        // FF: Form feed\n        service.currentWindow.clearText();\n      } else if (b === 0x0d) {\n        // CR: Carriage return\n        service.currentWindow.pendingNewLine = true;\n      } else if (b === 0x0e) {\n        // HCR: Horizontal carriage return\n        service.currentWindow.clearText();\n      } else if (b === 0x8d) {\n        // DLY: Delay, nothing to do\n        i++;\n      } else ;\n    }\n  };\n  /**\n   * Execute an extended command\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.extendedCommands = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n\n    if (within708TextBlock(b)) {\n      i = this.handleText(i, service, {\n        isExtended: true\n      });\n    }\n\n    return i;\n  };\n  /**\n   * Get PTS value of a given byte index\n   *\n   * @param  {Integer} byteIndex  Index of the byte\n   * @return {Integer}            PTS\n   */\n\n\n  Cea708Stream.prototype.getPts = function (byteIndex) {\n    // There's 1 pts value per 2 bytes\n    return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];\n  };\n  /**\n   * Initializes a service\n   *\n   * @param  {Integer} serviceNum Service number\n   * @return {Service}            Initialized service object\n   */\n\n\n  Cea708Stream.prototype.initService = function (serviceNum, i) {\n    var serviceName = 'SERVICE' + serviceNum;\n    var self = this;\n    var serviceName;\n    var encoding;\n\n    if (serviceName in this.serviceEncodings) {\n      encoding = this.serviceEncodings[serviceName];\n    }\n\n    this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self);\n    this.services[serviceNum].init(this.getPts(i), function (pts) {\n      self.flushDisplayed(pts, self.services[serviceNum]);\n    });\n    return this.services[serviceNum];\n  };\n  /**\n   * Execute text writing to current window\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.handleText = function (i, service, options) {\n    var isExtended = options && options.isExtended;\n    var isMultiByte = options && options.isMultiByte;\n    var packetData = this.current708Packet.data;\n    var extended = isExtended ? 0x1000 : 0x0000;\n    var currentByte = packetData[i];\n    var nextByte = packetData[i + 1];\n    var win = service.currentWindow;\n    var char;\n    var charCodeArray; // Converts an array of bytes to a unicode hex string.\n\n    function toHexString(byteArray) {\n      return byteArray.map(byte => {\n        return ('0' + (byte & 0xFF).toString(16)).slice(-2);\n      }).join('');\n    }\n\n    if (isMultiByte) {\n      charCodeArray = [currentByte, nextByte];\n      i++;\n    } else {\n      charCodeArray = [currentByte];\n    } // Use the TextDecoder if one was created for this service\n\n\n    if (service.textDecoder_ && !isExtended) {\n      char = service.textDecoder_.decode(new Uint8Array(charCodeArray));\n    } else {\n      // We assume any multi-byte char without a decoder is unicode.\n      if (isMultiByte) {\n        const unicode = toHexString(charCodeArray); // Takes a unicode hex string and creates a single character.\n\n        char = String.fromCharCode(parseInt(unicode, 16));\n      } else {\n        char = get708CharFromCode(extended | currentByte);\n      }\n    }\n\n    if (win.pendingNewLine && !win.isEmpty()) {\n      win.newLine(this.getPts(i));\n    }\n\n    win.pendingNewLine = false;\n    win.addText(char);\n    return i;\n  };\n  /**\n   * Handle decoding of multibyte character\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.multiByteCharacter = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var firstByte = packetData[i + 1];\n    var secondByte = packetData[i + 2];\n\n    if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {\n      i = this.handleText(++i, service, {\n        isMultiByte: true\n      });\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the CW# command.\n   *\n   * Set the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setCurrentWindow = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var windowNum = b & 0x07;\n    service.setCurrentWindow(windowNum);\n    return i;\n  };\n  /**\n   * Parse and execute the DF# command.\n   *\n   * Define a window and set it as the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.defineWindow = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var windowNum = b & 0x07;\n    service.setCurrentWindow(windowNum);\n    var win = service.currentWindow;\n    b = packetData[++i];\n    win.visible = (b & 0x20) >> 5; // v\n\n    win.rowLock = (b & 0x10) >> 4; // rl\n\n    win.columnLock = (b & 0x08) >> 3; // cl\n\n    win.priority = b & 0x07; // p\n\n    b = packetData[++i];\n    win.relativePositioning = (b & 0x80) >> 7; // rp\n\n    win.anchorVertical = b & 0x7f; // av\n\n    b = packetData[++i];\n    win.anchorHorizontal = b; // ah\n\n    b = packetData[++i];\n    win.anchorPoint = (b & 0xf0) >> 4; // ap\n\n    win.rowCount = b & 0x0f; // rc\n\n    b = packetData[++i];\n    win.columnCount = b & 0x3f; // cc\n\n    b = packetData[++i];\n    win.windowStyle = (b & 0x38) >> 3; // ws\n\n    win.penStyle = b & 0x07; // ps\n    // The spec says there are (rowCount+1) \"virtual rows\"\n\n    win.virtualRowCount = win.rowCount + 1;\n    return i;\n  };\n  /**\n   * Parse and execute the SWA command.\n   *\n   * Set attributes of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setWindowAttributes = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var winAttr = service.currentWindow.winAttr;\n    b = packetData[++i];\n    winAttr.fillOpacity = (b & 0xc0) >> 6; // fo\n\n    winAttr.fillRed = (b & 0x30) >> 4; // fr\n\n    winAttr.fillGreen = (b & 0x0c) >> 2; // fg\n\n    winAttr.fillBlue = b & 0x03; // fb\n\n    b = packetData[++i];\n    winAttr.borderType = (b & 0xc0) >> 6; // bt\n\n    winAttr.borderRed = (b & 0x30) >> 4; // br\n\n    winAttr.borderGreen = (b & 0x0c) >> 2; // bg\n\n    winAttr.borderBlue = b & 0x03; // bb\n\n    b = packetData[++i];\n    winAttr.borderType += (b & 0x80) >> 5; // bt\n\n    winAttr.wordWrap = (b & 0x40) >> 6; // ww\n\n    winAttr.printDirection = (b & 0x30) >> 4; // pd\n\n    winAttr.scrollDirection = (b & 0x0c) >> 2; // sd\n\n    winAttr.justify = b & 0x03; // j\n\n    b = packetData[++i];\n    winAttr.effectSpeed = (b & 0xf0) >> 4; // es\n\n    winAttr.effectDirection = (b & 0x0c) >> 2; // ed\n\n    winAttr.displayEffect = b & 0x03; // de\n\n    return i;\n  };\n  /**\n   * Gather text from all displayed windows and push a caption to output.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   */\n\n\n  Cea708Stream.prototype.flushDisplayed = function (pts, service) {\n    var displayedText = []; // TODO: Positioning not supported, displaying multiple windows will not necessarily\n    // display text in the correct order, but sample files so far have not shown any issue.\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {\n        displayedText.push(service.windows[winId].getText());\n      }\n    }\n\n    service.endPts = pts;\n    service.text = displayedText.join('\\n\\n');\n    this.pushCaption(service);\n    service.startPts = pts;\n  };\n  /**\n   * Push a caption to output if the caption contains text.\n   *\n   * @param  {Service} service  The service object to be affected\n   */\n\n\n  Cea708Stream.prototype.pushCaption = function (service) {\n    if (service.text !== '') {\n      this.trigger('data', {\n        startPts: service.startPts,\n        endPts: service.endPts,\n        text: service.text,\n        stream: 'cc708_' + service.serviceNum\n      });\n      service.text = '';\n      service.startPts = service.endPts;\n    }\n  };\n  /**\n   * Parse and execute the DSW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.displayWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible = 1;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the HDW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.hideWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible = 0;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the TGW command.\n   *\n   * Set visible property of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.toggleWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].visible ^= 1;\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the CLW command.\n   *\n   * Clear text of windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.clearWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].clearText();\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the DLW command.\n   *\n   * Re-initialize windows based on the parsed bitmask.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.deleteWindows = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[++i];\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n\n    for (var winId = 0; winId < 8; winId++) {\n      if (b & 0x01 << winId) {\n        service.windows[winId].reset();\n      }\n    }\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPA command.\n   *\n   * Set pen attributes of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenAttributes = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penAttr = service.currentWindow.penAttr;\n    b = packetData[++i];\n    penAttr.textTag = (b & 0xf0) >> 4; // tt\n\n    penAttr.offset = (b & 0x0c) >> 2; // o\n\n    penAttr.penSize = b & 0x03; // s\n\n    b = packetData[++i];\n    penAttr.italics = (b & 0x80) >> 7; // i\n\n    penAttr.underline = (b & 0x40) >> 6; // u\n\n    penAttr.edgeType = (b & 0x38) >> 3; // et\n\n    penAttr.fontStyle = b & 0x07; // fs\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPC command.\n   *\n   * Set pen color of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenColor = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penColor = service.currentWindow.penColor;\n    b = packetData[++i];\n    penColor.fgOpacity = (b & 0xc0) >> 6; // fo\n\n    penColor.fgRed = (b & 0x30) >> 4; // fr\n\n    penColor.fgGreen = (b & 0x0c) >> 2; // fg\n\n    penColor.fgBlue = b & 0x03; // fb\n\n    b = packetData[++i];\n    penColor.bgOpacity = (b & 0xc0) >> 6; // bo\n\n    penColor.bgRed = (b & 0x30) >> 4; // br\n\n    penColor.bgGreen = (b & 0x0c) >> 2; // bg\n\n    penColor.bgBlue = b & 0x03; // bb\n\n    b = packetData[++i];\n    penColor.edgeRed = (b & 0x30) >> 4; // er\n\n    penColor.edgeGreen = (b & 0x0c) >> 2; // eg\n\n    penColor.edgeBlue = b & 0x03; // eb\n\n    return i;\n  };\n  /**\n   * Parse and execute the SPL command.\n   *\n   * Set pen location of the current window.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Integer}          New index after parsing\n   */\n\n\n  Cea708Stream.prototype.setPenLocation = function (i, service) {\n    var packetData = this.current708Packet.data;\n    var b = packetData[i];\n    var penLoc = service.currentWindow.penLoc; // Positioning isn't really supported at the moment, so this essentially just inserts a linebreak\n\n    service.currentWindow.pendingNewLine = true;\n    b = packetData[++i];\n    penLoc.row = b & 0x0f; // r\n\n    b = packetData[++i];\n    penLoc.column = b & 0x3f; // c\n\n    return i;\n  };\n  /**\n   * Execute the RST command.\n   *\n   * Reset service to a clean slate. Re-initialize.\n   *\n   * @param  {Integer} i        Current index in the 708 packet\n   * @param  {Service} service  The service object to be affected\n   * @return {Service}          Re-initialized service\n   */\n\n\n  Cea708Stream.prototype.reset = function (i, service) {\n    var pts = this.getPts(i);\n    this.flushDisplayed(pts, service);\n    return this.initService(service.serviceNum, i);\n  }; // This hash maps non-ASCII, special, and extended character codes to their\n  // proper Unicode equivalent. The first keys that are only a single byte\n  // are the non-standard ASCII characters, which simply map the CEA608 byte\n  // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n  // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n  // can be performed regardless of the field and data channel on which the\n  // character code was received.\n\n\n  var CHARACTER_TRANSLATION = {\n    0x2a: 0xe1,\n    // á\n    0x5c: 0xe9,\n    // é\n    0x5e: 0xed,\n    // í\n    0x5f: 0xf3,\n    // ó\n    0x60: 0xfa,\n    // ú\n    0x7b: 0xe7,\n    // ç\n    0x7c: 0xf7,\n    // ÷\n    0x7d: 0xd1,\n    // Ñ\n    0x7e: 0xf1,\n    // ñ\n    0x7f: 0x2588,\n    // █\n    0x0130: 0xae,\n    // ®\n    0x0131: 0xb0,\n    // °\n    0x0132: 0xbd,\n    // ½\n    0x0133: 0xbf,\n    // ¿\n    0x0134: 0x2122,\n    // ™\n    0x0135: 0xa2,\n    // ¢\n    0x0136: 0xa3,\n    // £\n    0x0137: 0x266a,\n    // ♪\n    0x0138: 0xe0,\n    // à\n    0x0139: 0xa0,\n    //\n    0x013a: 0xe8,\n    // è\n    0x013b: 0xe2,\n    // â\n    0x013c: 0xea,\n    // ê\n    0x013d: 0xee,\n    // î\n    0x013e: 0xf4,\n    // ô\n    0x013f: 0xfb,\n    // û\n    0x0220: 0xc1,\n    // Á\n    0x0221: 0xc9,\n    // É\n    0x0222: 0xd3,\n    // Ó\n    0x0223: 0xda,\n    // Ú\n    0x0224: 0xdc,\n    // Ü\n    0x0225: 0xfc,\n    // ü\n    0x0226: 0x2018,\n    // ‘\n    0x0227: 0xa1,\n    // ¡\n    0x0228: 0x2a,\n    // *\n    0x0229: 0x27,\n    // '\n    0x022a: 0x2014,\n    // —\n    0x022b: 0xa9,\n    // ©\n    0x022c: 0x2120,\n    // ℠\n    0x022d: 0x2022,\n    // •\n    0x022e: 0x201c,\n    // “\n    0x022f: 0x201d,\n    // ”\n    0x0230: 0xc0,\n    // À\n    0x0231: 0xc2,\n    // Â\n    0x0232: 0xc7,\n    // Ç\n    0x0233: 0xc8,\n    // È\n    0x0234: 0xca,\n    // Ê\n    0x0235: 0xcb,\n    // Ë\n    0x0236: 0xeb,\n    // ë\n    0x0237: 0xce,\n    // Î\n    0x0238: 0xcf,\n    // Ï\n    0x0239: 0xef,\n    // ï\n    0x023a: 0xd4,\n    // Ô\n    0x023b: 0xd9,\n    // Ù\n    0x023c: 0xf9,\n    // ù\n    0x023d: 0xdb,\n    // Û\n    0x023e: 0xab,\n    // «\n    0x023f: 0xbb,\n    // »\n    0x0320: 0xc3,\n    // Ã\n    0x0321: 0xe3,\n    // ã\n    0x0322: 0xcd,\n    // Í\n    0x0323: 0xcc,\n    // Ì\n    0x0324: 0xec,\n    // ì\n    0x0325: 0xd2,\n    // Ò\n    0x0326: 0xf2,\n    // ò\n    0x0327: 0xd5,\n    // Õ\n    0x0328: 0xf5,\n    // õ\n    0x0329: 0x7b,\n    // {\n    0x032a: 0x7d,\n    // }\n    0x032b: 0x5c,\n    // \\\n    0x032c: 0x5e,\n    // ^\n    0x032d: 0x5f,\n    // _\n    0x032e: 0x7c,\n    // |\n    0x032f: 0x7e,\n    // ~\n    0x0330: 0xc4,\n    // Ä\n    0x0331: 0xe4,\n    // ä\n    0x0332: 0xd6,\n    // Ö\n    0x0333: 0xf6,\n    // ö\n    0x0334: 0xdf,\n    // ß\n    0x0335: 0xa5,\n    // ¥\n    0x0336: 0xa4,\n    // ¤\n    0x0337: 0x2502,\n    // │\n    0x0338: 0xc5,\n    // Å\n    0x0339: 0xe5,\n    // å\n    0x033a: 0xd8,\n    // Ø\n    0x033b: 0xf8,\n    // ø\n    0x033c: 0x250c,\n    // ┌\n    0x033d: 0x2510,\n    // ┐\n    0x033e: 0x2514,\n    // └\n    0x033f: 0x2518 // ┘\n\n  };\n\n  var getCharFromCode = function (code) {\n    if (code === null) {\n      return '';\n    }\n\n    code = CHARACTER_TRANSLATION[code] || code;\n    return String.fromCharCode(code);\n  }; // the index of the last row in a CEA-608 display buffer\n\n\n  var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n  // getting it through bit logic.\n\n  var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n  // cells. The \"bottom\" row is the last element in the outer array.\n  // We keep track of positioning information as we go by storing the\n  // number of indentations and the tab offset in this buffer.\n\n  var createDisplayBuffer = function () {\n    var result = [],\n        i = BOTTOM_ROW + 1;\n\n    while (i--) {\n      result.push({\n        text: '',\n        indent: 0,\n        offset: 0\n      });\n    }\n\n    return result;\n  };\n\n  var Cea608Stream = function (field, dataChannel) {\n    Cea608Stream.prototype.init.call(this);\n    this.field_ = field || 0;\n    this.dataChannel_ = dataChannel || 0;\n    this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n    this.setConstants();\n    this.reset();\n\n    this.push = function (packet) {\n      var data, swap, char0, char1, text; // remove the parity bits\n\n      data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n      if (data === this.lastControlCode_) {\n        this.lastControlCode_ = null;\n        return;\n      } // Store control codes\n\n\n      if ((data & 0xf000) === 0x1000) {\n        this.lastControlCode_ = data;\n      } else if (data !== this.PADDING_) {\n        this.lastControlCode_ = null;\n      }\n\n      char0 = data >>> 8;\n      char1 = data & 0xff;\n\n      if (data === this.PADDING_) {\n        return;\n      } else if (data === this.RESUME_CAPTION_LOADING_) {\n        this.mode_ = 'popOn';\n      } else if (data === this.END_OF_CAPTION_) {\n        // If an EOC is received while in paint-on mode, the displayed caption\n        // text should be swapped to non-displayed memory as if it was a pop-on\n        // caption. Because of that, we should explicitly switch back to pop-on\n        // mode\n        this.mode_ = 'popOn';\n        this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n        this.flushDisplayed(packet.pts); // flip memory\n\n        swap = this.displayed_;\n        this.displayed_ = this.nonDisplayed_;\n        this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n        this.startPts_ = packet.pts;\n      } else if (data === this.ROLL_UP_2_ROWS_) {\n        this.rollUpRows_ = 2;\n        this.setRollUp(packet.pts);\n      } else if (data === this.ROLL_UP_3_ROWS_) {\n        this.rollUpRows_ = 3;\n        this.setRollUp(packet.pts);\n      } else if (data === this.ROLL_UP_4_ROWS_) {\n        this.rollUpRows_ = 4;\n        this.setRollUp(packet.pts);\n      } else if (data === this.CARRIAGE_RETURN_) {\n        this.clearFormatting(packet.pts);\n        this.flushDisplayed(packet.pts);\n        this.shiftRowsUp_();\n        this.startPts_ = packet.pts;\n      } else if (data === this.BACKSPACE_) {\n        if (this.mode_ === 'popOn') {\n          this.nonDisplayed_[this.row_].text = this.nonDisplayed_[this.row_].text.slice(0, -1);\n        } else {\n          this.displayed_[this.row_].text = this.displayed_[this.row_].text.slice(0, -1);\n        }\n      } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n        this.flushDisplayed(packet.pts);\n        this.displayed_ = createDisplayBuffer();\n      } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n        this.nonDisplayed_ = createDisplayBuffer();\n      } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n        if (this.mode_ !== 'paintOn') {\n          // NOTE: This should be removed when proper caption positioning is\n          // implemented\n          this.flushDisplayed(packet.pts);\n          this.displayed_ = createDisplayBuffer();\n        }\n\n        this.mode_ = 'paintOn';\n        this.startPts_ = packet.pts; // Append special characters to caption text\n      } else if (this.isSpecialCharacter(char0, char1)) {\n        // Bitmask char0 so that we can apply character transformations\n        // regardless of field and data channel.\n        // Then byte-shift to the left and OR with char1 so we can pass the\n        // entire character code to `getCharFromCode`.\n        char0 = (char0 & 0x03) << 8;\n        text = getCharFromCode(char0 | char1);\n        this[this.mode_](packet.pts, text);\n        this.column_++; // Append extended characters to caption text\n      } else if (this.isExtCharacter(char0, char1)) {\n        // Extended characters always follow their \"non-extended\" equivalents.\n        // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n        // decoders are supposed to drop the \"è\", while compliant decoders\n        // backspace the \"e\" and insert \"è\".\n        // Delete the previous character\n        if (this.mode_ === 'popOn') {\n          this.nonDisplayed_[this.row_].text = this.nonDisplayed_[this.row_].text.slice(0, -1);\n        } else {\n          this.displayed_[this.row_].text = this.displayed_[this.row_].text.slice(0, -1);\n        } // Bitmask char0 so that we can apply character transformations\n        // regardless of field and data channel.\n        // Then byte-shift to the left and OR with char1 so we can pass the\n        // entire character code to `getCharFromCode`.\n\n\n        char0 = (char0 & 0x03) << 8;\n        text = getCharFromCode(char0 | char1);\n        this[this.mode_](packet.pts, text);\n        this.column_++; // Process mid-row codes\n      } else if (this.isMidRowCode(char0, char1)) {\n        // Attributes are not additive, so clear all formatting\n        this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n        // should be replaced with spaces, so add one now\n\n        this[this.mode_](packet.pts, ' ');\n        this.column_++;\n\n        if ((char1 & 0xe) === 0xe) {\n          this.addFormatting(packet.pts, ['i']);\n        }\n\n        if ((char1 & 0x1) === 0x1) {\n          this.addFormatting(packet.pts, ['u']);\n        } // Detect offset control codes and adjust cursor\n\n      } else if (this.isOffsetControlCode(char0, char1)) {\n        // Cursor position is set by indent PAC (see below) in 4-column\n        // increments, with an additional offset code of 1-3 to reach any\n        // of the 32 columns specified by CEA-608. So all we need to do\n        // here is increment the column cursor by the given offset.\n        const offset = char1 & 0x03; // For an offest value 1-3, set the offset for that caption\n        // in the non-displayed array.\n\n        this.nonDisplayed_[this.row_].offset = offset;\n        this.column_ += offset; // Detect PACs (Preamble Address Codes)\n      } else if (this.isPAC(char0, char1)) {\n        // There's no logic for PAC -> row mapping, so we have to just\n        // find the row code in an array and use its index :(\n        var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n        if (this.mode_ === 'rollUp') {\n          // This implies that the base row is incorrectly set.\n          // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n          // of roll-up rows set.\n          if (row - this.rollUpRows_ + 1 < 0) {\n            row = this.rollUpRows_ - 1;\n          }\n\n          this.setRollUp(packet.pts, row);\n        }\n\n        if (row !== this.row_) {\n          // formatting is only persistent for current row\n          this.clearFormatting(packet.pts);\n          this.row_ = row;\n        } // All PACs can apply underline, so detect and apply\n        // (All odd-numbered second bytes set underline)\n\n\n        if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n          this.addFormatting(packet.pts, ['u']);\n        }\n\n        if ((data & 0x10) === 0x10) {\n          // We've got an indent level code. Each successive even number\n          // increments the column cursor by 4, so we can get the desired\n          // column position by bit-shifting to the right (to get n/2)\n          // and multiplying by 4.\n          const indentations = (data & 0xe) >> 1;\n          this.column_ = indentations * 4; // add to the number of indentations for positioning\n\n          this.nonDisplayed_[this.row_].indent += indentations;\n        }\n\n        if (this.isColorPAC(char1)) {\n          // it's a color code, though we only support white, which\n          // can be either normal or italicized. white italics can be\n          // either 0x4e or 0x6e depending on the row, so we just\n          // bitwise-and with 0xe to see if italics should be turned on\n          if ((char1 & 0xe) === 0xe) {\n            this.addFormatting(packet.pts, ['i']);\n          }\n        } // We have a normal character in char0, and possibly one in char1\n\n      } else if (this.isNormalChar(char0)) {\n        if (char1 === 0x00) {\n          char1 = null;\n        }\n\n        text = getCharFromCode(char0);\n        text += getCharFromCode(char1);\n        this[this.mode_](packet.pts, text);\n        this.column_ += text.length;\n      } // finish data processing\n\n    };\n  };\n\n  Cea608Stream.prototype = new Stream$7(); // Trigger a cue point that captures the current state of the\n  // display buffer\n\n  Cea608Stream.prototype.flushDisplayed = function (pts) {\n    const logWarning = index => {\n      this.trigger('log', {\n        level: 'warn',\n        message: 'Skipping a malformed 608 caption at index ' + index + '.'\n      });\n    };\n\n    const content = [];\n    this.displayed_.forEach((row, i) => {\n      if (row && row.text && row.text.length) {\n        try {\n          // remove spaces from the start and end of the string\n          row.text = row.text.trim();\n        } catch (e) {\n          // Ordinarily, this shouldn't happen. However, caption\n          // parsing errors should not throw exceptions and\n          // break playback.\n          logWarning(i);\n        } // See the below link for more details on the following fields:\n        // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-608\n\n\n        if (row.text.length) {\n          content.push({\n            // The text to be displayed in the caption from this specific row, with whitespace removed.\n            text: row.text,\n            // Value between 1 and 15 representing the PAC row used to calculate line height.\n            line: i + 1,\n            // A number representing the indent position by percentage (CEA-608 PAC indent code).\n            // The value will be a number between 10 and 80. Offset is used to add an aditional\n            // value to the position if necessary.\n            position: 10 + Math.min(70, row.indent * 10) + row.offset * 2.5\n          });\n        }\n      } else if (row === undefined || row === null) {\n        logWarning(i);\n      }\n    });\n\n    if (content.length) {\n      this.trigger('data', {\n        startPts: this.startPts_,\n        endPts: pts,\n        content,\n        stream: this.name_\n      });\n    }\n  };\n  /**\n   * Zero out the data, used for startup and on seek\n   */\n\n\n  Cea608Stream.prototype.reset = function () {\n    this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n    // actually display captions. If a caption is shifted to a row\n    // with a lower index than this, it is cleared from the display\n    // buffer\n\n    this.topRow_ = 0;\n    this.startPts_ = 0;\n    this.displayed_ = createDisplayBuffer();\n    this.nonDisplayed_ = createDisplayBuffer();\n    this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n    this.column_ = 0;\n    this.row_ = BOTTOM_ROW;\n    this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n    this.formatting_ = [];\n  };\n  /**\n   * Sets up control code and related constants for this instance\n   */\n\n\n  Cea608Stream.prototype.setConstants = function () {\n    // The following attributes have these uses:\n    // ext_ :    char0 for mid-row codes, and the base for extended\n    //           chars (ext_+0, ext_+1, and ext_+2 are char0s for\n    //           extended codes)\n    // control_: char0 for control codes, except byte-shifted to the\n    //           left so that we can do this.control_ | CONTROL_CODE\n    // offset_:  char0 for tab offset codes\n    //\n    // It's also worth noting that control codes, and _only_ control codes,\n    // differ between field 1 and field2. Field 2 control codes are always\n    // their field 1 value plus 1. That's why there's the \"| field\" on the\n    // control value.\n    if (this.dataChannel_ === 0) {\n      this.BASE_ = 0x10;\n      this.EXT_ = 0x11;\n      this.CONTROL_ = (0x14 | this.field_) << 8;\n      this.OFFSET_ = 0x17;\n    } else if (this.dataChannel_ === 1) {\n      this.BASE_ = 0x18;\n      this.EXT_ = 0x19;\n      this.CONTROL_ = (0x1c | this.field_) << 8;\n      this.OFFSET_ = 0x1f;\n    } // Constants for the LSByte command codes recognized by Cea608Stream. This\n    // list is not exhaustive. For a more comprehensive listing and semantics see\n    // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n    // Padding\n\n\n    this.PADDING_ = 0x0000; // Pop-on Mode\n\n    this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n    this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n    this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n    this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n    this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n    this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n    this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n    this.BACKSPACE_ = this.CONTROL_ | 0x21;\n    this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n    this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n  };\n  /**\n   * Detects if the 2-byte packet data is a special character\n   *\n   * Special characters have a second byte in the range 0x30 to 0x3f,\n   * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n   * data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an special character\n   */\n\n\n  Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n    return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n  };\n  /**\n   * Detects if the 2-byte packet data is an extended character\n   *\n   * Extended characters have a second byte in the range 0x20 to 0x3f,\n   * with the first byte being 0x12 or 0x13 (for data channel 1) or\n   * 0x1a or 0x1b (for data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an extended character\n   */\n\n\n  Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n    return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n  };\n  /**\n   * Detects if the 2-byte packet is a mid-row code\n   *\n   * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n   * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n   * channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are a mid-row code\n   */\n\n\n  Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n    return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n  };\n  /**\n   * Detects if the 2-byte packet is an offset control code\n   *\n   * Offset control codes have a second byte in the range 0x21 to 0x23,\n   * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n   * data channel 2).\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are an offset control code\n   */\n\n\n  Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n    return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n  };\n  /**\n   * Detects if the 2-byte packet is a Preamble Address Code\n   *\n   * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n   * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n   * range 0x40 to 0x7f.\n   *\n   * @param  {Integer} char0 The first byte\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the 2 bytes are a PAC\n   */\n\n\n  Cea608Stream.prototype.isPAC = function (char0, char1) {\n    return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n  };\n  /**\n   * Detects if a packet's second byte is in the range of a PAC color code\n   *\n   * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n   * 0x60 to 0x6f.\n   *\n   * @param  {Integer} char1 The second byte\n   * @return {Boolean}       Whether the byte is a color PAC\n   */\n\n\n  Cea608Stream.prototype.isColorPAC = function (char1) {\n    return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n  };\n  /**\n   * Detects if a single byte is in the range of a normal character\n   *\n   * Normal text bytes are in the range 0x20 to 0x7f.\n   *\n   * @param  {Integer} char  The byte\n   * @return {Boolean}       Whether the byte is a normal character\n   */\n\n\n  Cea608Stream.prototype.isNormalChar = function (char) {\n    return char >= 0x20 && char <= 0x7f;\n  };\n  /**\n   * Configures roll-up\n   *\n   * @param  {Integer} pts         Current PTS\n   * @param  {Integer} newBaseRow  Used by PACs to slide the current window to\n   *                               a new position\n   */\n\n\n  Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n    // Reset the base row to the bottom row when switching modes\n    if (this.mode_ !== 'rollUp') {\n      this.row_ = BOTTOM_ROW;\n      this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n      this.flushDisplayed(pts);\n      this.nonDisplayed_ = createDisplayBuffer();\n      this.displayed_ = createDisplayBuffer();\n    }\n\n    if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n      // move currently displayed captions (up or down) to the new base row\n      for (var i = 0; i < this.rollUpRows_; i++) {\n        this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n        this.displayed_[this.row_ - i] = {\n          text: '',\n          indent: 0,\n          offset: 0\n        };\n      }\n    }\n\n    if (newBaseRow === undefined) {\n      newBaseRow = this.row_;\n    }\n\n    this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n  }; // Adds the opening HTML tag for the passed character to the caption text,\n  // and keeps track of it for later closing\n\n\n  Cea608Stream.prototype.addFormatting = function (pts, format) {\n    this.formatting_ = this.formatting_.concat(format);\n    var text = format.reduce(function (text, format) {\n      return text + '<' + format + '>';\n    }, '');\n    this[this.mode_](pts, text);\n  }; // Adds HTML closing tags for current formatting to caption text and\n  // clears remembered formatting\n\n\n  Cea608Stream.prototype.clearFormatting = function (pts) {\n    if (!this.formatting_.length) {\n      return;\n    }\n\n    var text = this.formatting_.reverse().reduce(function (text, format) {\n      return text + '</' + format + '>';\n    }, '');\n    this.formatting_ = [];\n    this[this.mode_](pts, text);\n  }; // Mode Implementations\n\n\n  Cea608Stream.prototype.popOn = function (pts, text) {\n    var baseRow = this.nonDisplayed_[this.row_].text; // buffer characters\n\n    baseRow += text;\n    this.nonDisplayed_[this.row_].text = baseRow;\n  };\n\n  Cea608Stream.prototype.rollUp = function (pts, text) {\n    var baseRow = this.displayed_[this.row_].text;\n    baseRow += text;\n    this.displayed_[this.row_].text = baseRow;\n  };\n\n  Cea608Stream.prototype.shiftRowsUp_ = function () {\n    var i; // clear out inactive rows\n\n    for (i = 0; i < this.topRow_; i++) {\n      this.displayed_[i] = {\n        text: '',\n        indent: 0,\n        offset: 0\n      };\n    }\n\n    for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n      this.displayed_[i] = {\n        text: '',\n        indent: 0,\n        offset: 0\n      };\n    } // shift displayed rows up\n\n\n    for (i = this.topRow_; i < this.row_; i++) {\n      this.displayed_[i] = this.displayed_[i + 1];\n    } // clear out the bottom row\n\n\n    this.displayed_[this.row_] = {\n      text: '',\n      indent: 0,\n      offset: 0\n    };\n  };\n\n  Cea608Stream.prototype.paintOn = function (pts, text) {\n    var baseRow = this.displayed_[this.row_].text;\n    baseRow += text;\n    this.displayed_[this.row_].text = baseRow;\n  }; // exports\n\n\n  var captionStream = {\n    CaptionStream: CaptionStream$2,\n    Cea608Stream: Cea608Stream,\n    Cea708Stream: Cea708Stream\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var streamTypes = {\n    H264_STREAM_TYPE: 0x1B,\n    ADTS_STREAM_TYPE: 0x0F,\n    METADATA_STREAM_TYPE: 0x15\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Accepts program elementary stream (PES) data events and corrects\n   * decode and presentation time stamps to account for a rollover\n   * of the 33 bit value.\n   */\n\n  var Stream$6 = stream;\n  var MAX_TS = 8589934592;\n  var RO_THRESH = 4294967296;\n  var TYPE_SHARED = 'shared';\n\n  var handleRollover$1 = function (value, reference) {\n    var direction = 1;\n\n    if (value > reference) {\n      // If the current timestamp value is greater than our reference timestamp and we detect a\n      // timestamp rollover, this means the roll over is happening in the opposite direction.\n      // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n      // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n      // rollover point. In loading this segment, the timestamp values will be very large,\n      // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n      // the time stamp to be `value - 2^33`.\n      direction = -1;\n    } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n    // cause an incorrect adjustment.\n\n\n    while (Math.abs(reference - value) > RO_THRESH) {\n      value += direction * MAX_TS;\n    }\n\n    return value;\n  };\n\n  var TimestampRolloverStream$1 = function (type) {\n    var lastDTS, referenceDTS;\n    TimestampRolloverStream$1.prototype.init.call(this); // The \"shared\" type is used in cases where a stream will contain muxed\n    // video and audio. We could use `undefined` here, but having a string\n    // makes debugging a little clearer.\n\n    this.type_ = type || TYPE_SHARED;\n\n    this.push = function (data) {\n      /**\n       * Rollover stream expects data from elementary stream.\n       * Elementary stream can push forward 2 types of data\n       * - Parsed Video/Audio/Timed-metadata PES (packetized elementary stream) packets\n       * - Tracks metadata from PMT (Program Map Table)\n       * Rollover stream expects pts/dts info to be available, since it stores lastDTS\n       * We should ignore non-PES packets since they may override lastDTS to undefined.\n       * lastDTS is important to signal the next segments\n       * about rollover from the previous segments.\n       */\n      if (data.type === 'metadata') {\n        this.trigger('data', data);\n        return;\n      } // Any \"shared\" rollover streams will accept _all_ data. Otherwise,\n      // streams will only accept data that matches their type.\n\n\n      if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {\n        return;\n      }\n\n      if (referenceDTS === undefined) {\n        referenceDTS = data.dts;\n      }\n\n      data.dts = handleRollover$1(data.dts, referenceDTS);\n      data.pts = handleRollover$1(data.pts, referenceDTS);\n      lastDTS = data.dts;\n      this.trigger('data', data);\n    };\n\n    this.flush = function () {\n      referenceDTS = lastDTS;\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n\n    this.discontinuity = function () {\n      referenceDTS = void 0;\n      lastDTS = void 0;\n    };\n\n    this.reset = function () {\n      this.discontinuity();\n      this.trigger('reset');\n    };\n  };\n\n  TimestampRolloverStream$1.prototype = new Stream$6();\n  var timestampRolloverStream = {\n    TimestampRolloverStream: TimestampRolloverStream$1,\n    handleRollover: handleRollover$1\n  }; // Once IE11 support is dropped, this function should be removed.\n\n  var typedArrayIndexOf$1 = (typedArray, element, fromIndex) => {\n    if (!typedArray) {\n      return -1;\n    }\n\n    var currentIndex = fromIndex;\n\n    for (; currentIndex < typedArray.length; currentIndex++) {\n      if (typedArray[currentIndex] === element) {\n        return currentIndex;\n      }\n    }\n\n    return -1;\n  };\n\n  var typedArray = {\n    typedArrayIndexOf: typedArrayIndexOf$1\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Tools for parsing ID3 frame data\n   * @see http://id3.org/id3v2.3.0\n   */\n\n  var typedArrayIndexOf = typedArray.typedArrayIndexOf,\n      // Frames that allow different types of text encoding contain a text\n  // encoding description byte [ID3v2.4.0 section 4.]\n  textEncodingDescriptionByte = {\n    Iso88591: 0x00,\n    // ISO-8859-1, terminated with \\0.\n    Utf16: 0x01,\n    // UTF-16 encoded Unicode BOM, terminated with \\0\\0\n    Utf16be: 0x02,\n    // UTF-16BE encoded Unicode, without BOM, terminated with \\0\\0\n    Utf8: 0x03 // UTF-8 encoded Unicode, terminated with \\0\n\n  },\n      // return a percent-encoded representation of the specified byte range\n  // @see http://en.wikipedia.org/wiki/Percent-encoding \n  percentEncode$1 = function (bytes, start, end) {\n    var i,\n        result = '';\n\n    for (i = start; i < end; i++) {\n      result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n    }\n\n    return result;\n  },\n      // return the string representation of the specified byte range,\n  // interpreted as UTf-8.\n  parseUtf8 = function (bytes, start, end) {\n    return decodeURIComponent(percentEncode$1(bytes, start, end));\n  },\n      // return the string representation of the specified byte range,\n  // interpreted as ISO-8859-1.\n  parseIso88591$1 = function (bytes, start, end) {\n    return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n  },\n      parseSyncSafeInteger$1 = function (data) {\n    return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n  },\n      frameParsers = {\n    'APIC': function (frame) {\n      var i = 1,\n          mimeTypeEndIndex,\n          descriptionEndIndex,\n          LINK_MIME_TYPE = '-->';\n\n      if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n        // ignore frames with unrecognized character encodings\n        return;\n      } // parsing fields [ID3v2.4.0 section 4.14.]\n\n\n      mimeTypeEndIndex = typedArrayIndexOf(frame.data, 0, i);\n\n      if (mimeTypeEndIndex < 0) {\n        // malformed frame\n        return;\n      } // parsing Mime type field (terminated with \\0)\n\n\n      frame.mimeType = parseIso88591$1(frame.data, i, mimeTypeEndIndex);\n      i = mimeTypeEndIndex + 1; // parsing 1-byte Picture Type field\n\n      frame.pictureType = frame.data[i];\n      i++;\n      descriptionEndIndex = typedArrayIndexOf(frame.data, 0, i);\n\n      if (descriptionEndIndex < 0) {\n        // malformed frame\n        return;\n      } // parsing Description field (terminated with \\0)\n\n\n      frame.description = parseUtf8(frame.data, i, descriptionEndIndex);\n      i = descriptionEndIndex + 1;\n\n      if (frame.mimeType === LINK_MIME_TYPE) {\n        // parsing Picture Data field as URL (always represented as ISO-8859-1 [ID3v2.4.0 section 4.])\n        frame.url = parseIso88591$1(frame.data, i, frame.data.length);\n      } else {\n        // parsing Picture Data field as binary data\n        frame.pictureData = frame.data.subarray(i, frame.data.length);\n      }\n    },\n    'T*': function (frame) {\n      if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n        // ignore frames with unrecognized character encodings\n        return;\n      } // parse text field, do not include null terminator in the frame value\n      // frames that allow different types of encoding contain terminated text [ID3v2.4.0 section 4.]\n\n\n      frame.value = parseUtf8(frame.data, 1, frame.data.length).replace(/\\0*$/, ''); // text information frames supports multiple strings, stored as a terminator separated list [ID3v2.4.0 section 4.2.]\n\n      frame.values = frame.value.split('\\0');\n    },\n    'TXXX': function (frame) {\n      var descriptionEndIndex;\n\n      if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n        // ignore frames with unrecognized character encodings\n        return;\n      }\n\n      descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);\n\n      if (descriptionEndIndex === -1) {\n        return;\n      } // parse the text fields\n\n\n      frame.description = parseUtf8(frame.data, 1, descriptionEndIndex); // do not include the null terminator in the tag value\n      // frames that allow different types of encoding contain terminated text\n      // [ID3v2.4.0 section 4.]\n\n      frame.value = parseUtf8(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\\0*$/, '');\n      frame.data = frame.value;\n    },\n    'W*': function (frame) {\n      // parse URL field; URL fields are always represented as ISO-8859-1 [ID3v2.4.0 section 4.]\n      // if the value is followed by a string termination all the following information should be ignored [ID3v2.4.0 section 4.3]\n      frame.url = parseIso88591$1(frame.data, 0, frame.data.length).replace(/\\0.*$/, '');\n    },\n    'WXXX': function (frame) {\n      var descriptionEndIndex;\n\n      if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {\n        // ignore frames with unrecognized character encodings\n        return;\n      }\n\n      descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);\n\n      if (descriptionEndIndex === -1) {\n        return;\n      } // parse the description and URL fields\n\n\n      frame.description = parseUtf8(frame.data, 1, descriptionEndIndex); // URL fields are always represented as ISO-8859-1 [ID3v2.4.0 section 4.]\n      // if the value is followed by a string termination all the following information\n      // should be ignored [ID3v2.4.0 section 4.3]\n\n      frame.url = parseIso88591$1(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\\0.*$/, '');\n    },\n    'PRIV': function (frame) {\n      var i;\n\n      for (i = 0; i < frame.data.length; i++) {\n        if (frame.data[i] === 0) {\n          // parse the description and URL fields\n          frame.owner = parseIso88591$1(frame.data, 0, i);\n          break;\n        }\n      }\n\n      frame.privateData = frame.data.subarray(i + 1);\n      frame.data = frame.privateData;\n    }\n  };\n\n  var parseId3Frames$1 = function (data) {\n    var frameSize,\n        frameHeader,\n        frameStart = 10,\n        tagSize = 0,\n        frames = []; // If we don't have enough data for a header, 10 bytes, \n    // or 'ID3' in the first 3 bytes this is not a valid ID3 tag.\n\n    if (data.length < 10 || data[0] !== 'I'.charCodeAt(0) || data[1] !== 'D'.charCodeAt(0) || data[2] !== '3'.charCodeAt(0)) {\n      return;\n    } // the frame size is transmitted as a 28-bit integer in the\n    // last four bytes of the ID3 header.\n    // The most significant bit of each byte is dropped and the\n    // results concatenated to recover the actual value.\n\n\n    tagSize = parseSyncSafeInteger$1(data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n    // convenient for our comparisons to include it\n\n    tagSize += 10; // check bit 6 of byte 5 for the extended header flag.\n\n    var hasExtendedHeader = data[5] & 0x40;\n\n    if (hasExtendedHeader) {\n      // advance the frame start past the extended header\n      frameStart += 4; // header size field\n\n      frameStart += parseSyncSafeInteger$1(data.subarray(10, 14));\n      tagSize -= parseSyncSafeInteger$1(data.subarray(16, 20)); // clip any padding off the end\n    } // parse one or more ID3 frames\n    // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n    do {\n      // determine the number of bytes in this frame\n      frameSize = parseSyncSafeInteger$1(data.subarray(frameStart + 4, frameStart + 8));\n\n      if (frameSize < 1) {\n        break;\n      }\n\n      frameHeader = String.fromCharCode(data[frameStart], data[frameStart + 1], data[frameStart + 2], data[frameStart + 3]);\n      var frame = {\n        id: frameHeader,\n        data: data.subarray(frameStart + 10, frameStart + frameSize + 10)\n      };\n      frame.key = frame.id; // parse frame values\n\n      if (frameParsers[frame.id]) {\n        // use frame specific parser\n        frameParsers[frame.id](frame);\n      } else if (frame.id[0] === 'T') {\n        // use text frame generic parser\n        frameParsers['T*'](frame);\n      } else if (frame.id[0] === 'W') {\n        // use URL link frame generic parser\n        frameParsers['W*'](frame);\n      }\n\n      frames.push(frame);\n      frameStart += 10; // advance past the frame header\n\n      frameStart += frameSize; // advance past the frame body\n    } while (frameStart < tagSize);\n\n    return frames;\n  };\n\n  var parseId3 = {\n    parseId3Frames: parseId3Frames$1,\n    parseSyncSafeInteger: parseSyncSafeInteger$1,\n    frameParsers: frameParsers\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Accepts program elementary stream (PES) data events and parses out\n   * ID3 metadata from them, if present.\n   * @see http://id3.org/id3v2.3.0\n   */\n\n  var Stream$5 = stream,\n      StreamTypes$3 = streamTypes,\n      id3 = parseId3,\n      MetadataStream;\n\n  MetadataStream = function (options) {\n    var settings = {\n      // the bytes of the program-level descriptor field in MP2T\n      // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n      // program element descriptors\"\n      descriptor: options && options.descriptor\n    },\n        // the total size in bytes of the ID3 tag being parsed\n    tagSize = 0,\n        // tag data that is not complete enough to be parsed\n    buffer = [],\n        // the total number of bytes currently in the buffer\n    bufferSize = 0,\n        i;\n    MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n    // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n    this.dispatchType = StreamTypes$3.METADATA_STREAM_TYPE.toString(16);\n\n    if (settings.descriptor) {\n      for (i = 0; i < settings.descriptor.length; i++) {\n        this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n      }\n    }\n\n    this.push = function (chunk) {\n      var tag, frameStart, frameSize, frame, i, frameHeader;\n\n      if (chunk.type !== 'timed-metadata') {\n        return;\n      } // if data_alignment_indicator is set in the PES header,\n      // we must have the start of a new ID3 tag. Assume anything\n      // remaining in the buffer was malformed and throw it out\n\n\n      if (chunk.dataAlignmentIndicator) {\n        bufferSize = 0;\n        buffer.length = 0;\n      } // ignore events that don't look like ID3 data\n\n\n      if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n        this.trigger('log', {\n          level: 'warn',\n          message: 'Skipping unrecognized metadata packet'\n        });\n        return;\n      } // add this chunk to the data we've collected so far\n\n\n      buffer.push(chunk);\n      bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n      if (buffer.length === 1) {\n        // the frame size is transmitted as a 28-bit integer in the\n        // last four bytes of the ID3 header.\n        // The most significant bit of each byte is dropped and the\n        // results concatenated to recover the actual value.\n        tagSize = id3.parseSyncSafeInteger(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n        // convenient for our comparisons to include it\n\n        tagSize += 10;\n      } // if the entire frame has not arrived, wait for more data\n\n\n      if (bufferSize < tagSize) {\n        return;\n      } // collect the entire frame so it can be parsed\n\n\n      tag = {\n        data: new Uint8Array(tagSize),\n        frames: [],\n        pts: buffer[0].pts,\n        dts: buffer[0].dts\n      };\n\n      for (i = 0; i < tagSize;) {\n        tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n        i += buffer[0].data.byteLength;\n        bufferSize -= buffer[0].data.byteLength;\n        buffer.shift();\n      } // find the start of the first frame and the end of the tag\n\n\n      frameStart = 10;\n\n      if (tag.data[5] & 0x40) {\n        // advance the frame start past the extended header\n        frameStart += 4; // header size field\n\n        frameStart += id3.parseSyncSafeInteger(tag.data.subarray(10, 14)); // clip any padding off the end\n\n        tagSize -= id3.parseSyncSafeInteger(tag.data.subarray(16, 20));\n      } // parse one or more ID3 frames\n      // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n      do {\n        // determine the number of bytes in this frame\n        frameSize = id3.parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n\n        if (frameSize < 1) {\n          this.trigger('log', {\n            level: 'warn',\n            message: 'Malformed ID3 frame encountered. Skipping remaining metadata parsing.'\n          }); // If the frame is malformed, don't parse any further frames but allow previous valid parsed frames\n          // to be sent along.\n\n          break;\n        }\n\n        frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n        frame = {\n          id: frameHeader,\n          data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n        };\n        frame.key = frame.id; // parse frame values\n\n        if (id3.frameParsers[frame.id]) {\n          // use frame specific parser\n          id3.frameParsers[frame.id](frame);\n        } else if (frame.id[0] === 'T') {\n          // use text frame generic parser\n          id3.frameParsers['T*'](frame);\n        } else if (frame.id[0] === 'W') {\n          // use URL link frame generic parser\n          id3.frameParsers['W*'](frame);\n        } // handle the special PRIV frame used to indicate the start\n        // time for raw AAC data\n\n\n        if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n          var d = frame.data,\n              size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n          size *= 4;\n          size += d[7] & 0x03;\n          frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n          // on the value of this frame\n          // we couldn't have known the appropriate pts and dts before\n          // parsing this ID3 tag so set those values now\n\n          if (tag.pts === undefined && tag.dts === undefined) {\n            tag.pts = frame.timeStamp;\n            tag.dts = frame.timeStamp;\n          }\n\n          this.trigger('timestamp', frame);\n        }\n\n        tag.frames.push(frame);\n        frameStart += 10; // advance past the frame header\n\n        frameStart += frameSize; // advance past the frame body\n      } while (frameStart < tagSize);\n\n      this.trigger('data', tag);\n    };\n  };\n\n  MetadataStream.prototype = new Stream$5();\n  var metadataStream = MetadataStream;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * A stream-based mp2t to mp4 converter. This utility can be used to\n   * deliver mp4s to a SourceBuffer on platforms that support native\n   * Media Source Extensions.\n   */\n\n  var Stream$4 = stream,\n      CaptionStream$1 = captionStream,\n      StreamTypes$2 = streamTypes,\n      TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream; // object types\n\n  var TransportPacketStream, TransportParseStream, ElementaryStream; // constants\n\n  var MP2T_PACKET_LENGTH$1 = 188,\n      // bytes\n  SYNC_BYTE$1 = 0x47;\n  /**\n   * Splits an incoming stream of binary data into MPEG-2 Transport\n   * Stream packets.\n   */\n\n  TransportPacketStream = function () {\n    var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1),\n        bytesInBuffer = 0;\n    TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n    /**\n     * Split a stream of data into M2TS packets\n    **/\n\n    this.push = function (bytes) {\n      var startIndex = 0,\n          endIndex = MP2T_PACKET_LENGTH$1,\n          everything; // If there are bytes remaining from the last segment, prepend them to the\n      // bytes that were pushed in\n\n      if (bytesInBuffer) {\n        everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n        everything.set(buffer.subarray(0, bytesInBuffer));\n        everything.set(bytes, bytesInBuffer);\n        bytesInBuffer = 0;\n      } else {\n        everything = bytes;\n      } // While we have enough data for a packet\n\n\n      while (endIndex < everything.byteLength) {\n        // Look for a pair of start and end sync bytes in the data..\n        if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {\n          // We found a packet so emit it and jump one whole packet forward in\n          // the stream\n          this.trigger('data', everything.subarray(startIndex, endIndex));\n          startIndex += MP2T_PACKET_LENGTH$1;\n          endIndex += MP2T_PACKET_LENGTH$1;\n          continue;\n        } // If we get here, we have somehow become de-synchronized and we need to step\n        // forward one byte at a time until we find a pair of sync bytes that denote\n        // a packet\n\n\n        startIndex++;\n        endIndex++;\n      } // If there was some data left over at the end of the segment that couldn't\n      // possibly be a whole packet, keep it because it might be the start of a packet\n      // that continues in the next segment\n\n\n      if (startIndex < everything.byteLength) {\n        buffer.set(everything.subarray(startIndex), 0);\n        bytesInBuffer = everything.byteLength - startIndex;\n      }\n    };\n    /**\n     * Passes identified M2TS packets to the TransportParseStream to be parsed\n    **/\n\n\n    this.flush = function () {\n      // If the buffer contains a whole packet when we are being flushed, emit it\n      // and empty the buffer. Otherwise hold onto the data because it may be\n      // important for decoding the next segment\n      if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {\n        this.trigger('data', buffer);\n        bytesInBuffer = 0;\n      }\n\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n\n    this.reset = function () {\n      bytesInBuffer = 0;\n      this.trigger('reset');\n    };\n  };\n\n  TransportPacketStream.prototype = new Stream$4();\n  /**\n   * Accepts an MP2T TransportPacketStream and emits data events with parsed\n   * forms of the individual transport stream packets.\n   */\n\n  TransportParseStream = function () {\n    var parsePsi, parsePat, parsePmt, self;\n    TransportParseStream.prototype.init.call(this);\n    self = this;\n    this.packetsWaitingForPmt = [];\n    this.programMapTable = undefined;\n\n    parsePsi = function (payload, psi) {\n      var offset = 0; // PSI packets may be split into multiple sections and those\n      // sections may be split into multiple packets. If a PSI\n      // section starts in this packet, the payload_unit_start_indicator\n      // will be true and the first byte of the payload will indicate\n      // the offset from the current position to the start of the\n      // section.\n\n      if (psi.payloadUnitStartIndicator) {\n        offset += payload[offset] + 1;\n      }\n\n      if (psi.type === 'pat') {\n        parsePat(payload.subarray(offset), psi);\n      } else {\n        parsePmt(payload.subarray(offset), psi);\n      }\n    };\n\n    parsePat = function (payload, pat) {\n      pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n      pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n      // skip the PSI header and parse the first PMT entry\n\n      self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n      pat.pmtPid = self.pmtPid;\n    };\n    /**\n     * Parse out the relevant fields of a Program Map Table (PMT).\n     * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n     * packet. The first byte in this array should be the table_id\n     * field.\n     * @param pmt {object} the object that should be decorated with\n     * fields parsed from the PMT.\n     */\n\n\n    parsePmt = function (payload, pmt) {\n      var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n      // take effect. We don't believe this should ever be the case\n      // for HLS but we'll ignore \"forward\" PMT declarations if we see\n      // them. Future PMT declarations have the current_next_indicator\n      // set to zero.\n\n      if (!(payload[5] & 0x01)) {\n        return;\n      } // overwrite any existing program map table\n\n\n      self.programMapTable = {\n        video: null,\n        audio: null,\n        'timed-metadata': {}\n      }; // the mapping table ends at the end of the current section\n\n      sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n      tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n      // long the program info descriptors are\n\n      programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n      offset = 12 + programInfoLength;\n\n      while (offset < tableEnd) {\n        var streamType = payload[offset];\n        var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n        // TODO: should this be done for metadata too? for now maintain behavior of\n        //       multiple metadata streams\n\n        if (streamType === StreamTypes$2.H264_STREAM_TYPE && self.programMapTable.video === null) {\n          self.programMapTable.video = pid;\n        } else if (streamType === StreamTypes$2.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n          self.programMapTable.audio = pid;\n        } else if (streamType === StreamTypes$2.METADATA_STREAM_TYPE) {\n          // map pid to stream type for metadata streams\n          self.programMapTable['timed-metadata'][pid] = streamType;\n        } // move to the next table entry\n        // skip past the elementary stream descriptors, if present\n\n\n        offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n      } // record the map on the packet as well\n\n\n      pmt.programMapTable = self.programMapTable;\n    };\n    /**\n     * Deliver a new MP2T packet to the next stream in the pipeline.\n     */\n\n\n    this.push = function (packet) {\n      var result = {},\n          offset = 4;\n      result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n      result.pid = packet[1] & 0x1f;\n      result.pid <<= 8;\n      result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n      // fifth byte of the TS packet header. The adaptation field is\n      // used to add stuffing to PES packets that don't fill a complete\n      // TS packet, and to specify some forms of timing and control data\n      // that we do not currently use.\n\n      if ((packet[3] & 0x30) >>> 4 > 0x01) {\n        offset += packet[offset] + 1;\n      } // parse the rest of the packet based on the type\n\n\n      if (result.pid === 0) {\n        result.type = 'pat';\n        parsePsi(packet.subarray(offset), result);\n        this.trigger('data', result);\n      } else if (result.pid === this.pmtPid) {\n        result.type = 'pmt';\n        parsePsi(packet.subarray(offset), result);\n        this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n        while (this.packetsWaitingForPmt.length) {\n          this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n        }\n      } else if (this.programMapTable === undefined) {\n        // When we have not seen a PMT yet, defer further processing of\n        // PES packets until one has been parsed\n        this.packetsWaitingForPmt.push([packet, offset, result]);\n      } else {\n        this.processPes_(packet, offset, result);\n      }\n    };\n\n    this.processPes_ = function (packet, offset, result) {\n      // set the appropriate stream type\n      if (result.pid === this.programMapTable.video) {\n        result.streamType = StreamTypes$2.H264_STREAM_TYPE;\n      } else if (result.pid === this.programMapTable.audio) {\n        result.streamType = StreamTypes$2.ADTS_STREAM_TYPE;\n      } else {\n        // if not video or audio, it is timed-metadata or unknown\n        // if unknown, streamType will be undefined\n        result.streamType = this.programMapTable['timed-metadata'][result.pid];\n      }\n\n      result.type = 'pes';\n      result.data = packet.subarray(offset);\n      this.trigger('data', result);\n    };\n  };\n\n  TransportParseStream.prototype = new Stream$4();\n  TransportParseStream.STREAM_TYPES = {\n    h264: 0x1b,\n    adts: 0x0f\n  };\n  /**\n   * Reconsistutes program elementary stream (PES) packets from parsed\n   * transport stream packets. That is, if you pipe an\n   * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n   * events will be events which capture the bytes for individual PES\n   * packets plus relevant metadata that has been extracted from the\n   * container.\n   */\n\n  ElementaryStream = function () {\n    var self = this,\n        segmentHadPmt = false,\n        // PES packet fragments\n    video = {\n      data: [],\n      size: 0\n    },\n        audio = {\n      data: [],\n      size: 0\n    },\n        timedMetadata = {\n      data: [],\n      size: 0\n    },\n        programMapTable,\n        parsePes = function (payload, pes) {\n      var ptsDtsFlags;\n      const startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2]; // default to an empty array\n\n      pes.data = new Uint8Array(); // In certain live streams, the start of a TS fragment has ts packets\n      // that are frame data that is continuing from the previous fragment. This\n      // is to check that the pes data is the start of a new pes payload\n\n      if (startPrefix !== 1) {\n        return;\n      } // get the packet length, this will be 0 for video\n\n\n      pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n      pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n      // and a DTS value. Determine what combination of values is\n      // available to work with.\n\n      ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number.  Javascript\n      // performs all bitwise operations on 32-bit integers but javascript\n      // supports a much greater range (52-bits) of integer using standard\n      // mathematical operations.\n      // We construct a 31-bit value using bitwise operators over the 31\n      // most significant bits and then multiply by 4 (equal to a left-shift\n      // of 2) before we add the final 2 least significant bits of the\n      // timestamp (equal to an OR.)\n\n      if (ptsDtsFlags & 0xC0) {\n        // the PTS and DTS are not written out directly. For information\n        // on how they are encoded, see\n        // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n        pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n        pes.pts *= 4; // Left shift by 2\n\n        pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n        pes.dts = pes.pts;\n\n        if (ptsDtsFlags & 0x40) {\n          pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n          pes.dts *= 4; // Left shift by 2\n\n          pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n        }\n      } // the data section starts immediately after the PES header.\n      // pes_header_data_length specifies the number of header bytes\n      // that follow the last byte of the field.\n\n\n      pes.data = payload.subarray(9 + payload[8]);\n    },\n\n    /**\n      * Pass completely parsed PES packets to the next stream in the pipeline\n     **/\n    flushStream = function (stream, type, forceFlush) {\n      var packetData = new Uint8Array(stream.size),\n          event = {\n        type: type\n      },\n          i = 0,\n          offset = 0,\n          packetFlushable = false,\n          fragment; // do nothing if there is not enough buffered data for a complete\n      // PES header\n\n      if (!stream.data.length || stream.size < 9) {\n        return;\n      }\n\n      event.trackId = stream.data[0].pid; // reassemble the packet\n\n      for (i = 0; i < stream.data.length; i++) {\n        fragment = stream.data[i];\n        packetData.set(fragment.data, offset);\n        offset += fragment.data.byteLength;\n      } // parse assembled packet's PES header\n\n\n      parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n      // check that there is enough stream data to fill the packet\n\n      packetFlushable = type === 'video' || event.packetLength <= stream.size; // flush pending packets if the conditions are right\n\n      if (forceFlush || packetFlushable) {\n        stream.size = 0;\n        stream.data.length = 0;\n      } // only emit packets that are complete. this is to avoid assembling\n      // incomplete PES packets due to poor segmentation\n\n\n      if (packetFlushable) {\n        self.trigger('data', event);\n      }\n    };\n\n    ElementaryStream.prototype.init.call(this);\n    /**\n     * Identifies M2TS packet types and parses PES packets using metadata\n     * parsed from the PMT\n     **/\n\n    this.push = function (data) {\n      ({\n        pat: function () {// we have to wait for the PMT to arrive as well before we\n          // have any meaningful metadata\n        },\n        pes: function () {\n          var stream, streamType;\n\n          switch (data.streamType) {\n            case StreamTypes$2.H264_STREAM_TYPE:\n              stream = video;\n              streamType = 'video';\n              break;\n\n            case StreamTypes$2.ADTS_STREAM_TYPE:\n              stream = audio;\n              streamType = 'audio';\n              break;\n\n            case StreamTypes$2.METADATA_STREAM_TYPE:\n              stream = timedMetadata;\n              streamType = 'timed-metadata';\n              break;\n\n            default:\n              // ignore unknown stream types\n              return;\n          } // if a new packet is starting, we can flush the completed\n          // packet\n\n\n          if (data.payloadUnitStartIndicator) {\n            flushStream(stream, streamType, true);\n          } // buffer this fragment until we are sure we've received the\n          // complete payload\n\n\n          stream.data.push(data);\n          stream.size += data.data.byteLength;\n        },\n        pmt: function () {\n          var event = {\n            type: 'metadata',\n            tracks: []\n          };\n          programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n          if (programMapTable.video !== null) {\n            event.tracks.push({\n              timelineStartInfo: {\n                baseMediaDecodeTime: 0\n              },\n              id: +programMapTable.video,\n              codec: 'avc',\n              type: 'video'\n            });\n          }\n\n          if (programMapTable.audio !== null) {\n            event.tracks.push({\n              timelineStartInfo: {\n                baseMediaDecodeTime: 0\n              },\n              id: +programMapTable.audio,\n              codec: 'adts',\n              type: 'audio'\n            });\n          }\n\n          segmentHadPmt = true;\n          self.trigger('data', event);\n        }\n      })[data.type]();\n    };\n\n    this.reset = function () {\n      video.size = 0;\n      video.data.length = 0;\n      audio.size = 0;\n      audio.data.length = 0;\n      this.trigger('reset');\n    };\n    /**\n     * Flush any remaining input. Video PES packets may be of variable\n     * length. Normally, the start of a new video packet can trigger the\n     * finalization of the previous packet. That is not possible if no\n     * more video is forthcoming, however. In that case, some other\n     * mechanism (like the end of the file) has to be employed. When it is\n     * clear that no additional data is forthcoming, calling this method\n     * will flush the buffered packets.\n     */\n\n\n    this.flushStreams_ = function () {\n      // !!THIS ORDER IS IMPORTANT!!\n      // video first then audio\n      flushStream(video, 'video');\n      flushStream(audio, 'audio');\n      flushStream(timedMetadata, 'timed-metadata');\n    };\n\n    this.flush = function () {\n      // if on flush we haven't had a pmt emitted\n      // and we have a pmt to emit. emit the pmt\n      // so that we trigger a trackinfo downstream.\n      if (!segmentHadPmt && programMapTable) {\n        var pmt = {\n          type: 'metadata',\n          tracks: []\n        }; // translate audio and video streams to tracks\n\n        if (programMapTable.video !== null) {\n          pmt.tracks.push({\n            timelineStartInfo: {\n              baseMediaDecodeTime: 0\n            },\n            id: +programMapTable.video,\n            codec: 'avc',\n            type: 'video'\n          });\n        }\n\n        if (programMapTable.audio !== null) {\n          pmt.tracks.push({\n            timelineStartInfo: {\n              baseMediaDecodeTime: 0\n            },\n            id: +programMapTable.audio,\n            codec: 'adts',\n            type: 'audio'\n          });\n        }\n\n        self.trigger('data', pmt);\n      }\n\n      segmentHadPmt = false;\n      this.flushStreams_();\n      this.trigger('done');\n    };\n  };\n\n  ElementaryStream.prototype = new Stream$4();\n  var m2ts$1 = {\n    PAT_PID: 0x0000,\n    MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,\n    TransportPacketStream: TransportPacketStream,\n    TransportParseStream: TransportParseStream,\n    ElementaryStream: ElementaryStream,\n    TimestampRolloverStream: TimestampRolloverStream,\n    CaptionStream: CaptionStream$1.CaptionStream,\n    Cea608Stream: CaptionStream$1.Cea608Stream,\n    Cea708Stream: CaptionStream$1.Cea708Stream,\n    MetadataStream: metadataStream\n  };\n\n  for (var type in StreamTypes$2) {\n    if (StreamTypes$2.hasOwnProperty(type)) {\n      m2ts$1[type] = StreamTypes$2[type];\n    }\n  }\n\n  var m2ts_1 = m2ts$1;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var Stream$3 = stream;\n  var ONE_SECOND_IN_TS$2 = clock$2.ONE_SECOND_IN_TS;\n  var AdtsStream$1;\n  var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n  /*\n   * Accepts a ElementaryStream and emits data events with parsed\n   * AAC Audio Frames of the individual packets. Input audio in ADTS\n   * format is unpacked and re-emitted as AAC frames.\n   *\n   * @see http://wiki.multimedia.cx/index.php?title=ADTS\n   * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n   */\n\n  AdtsStream$1 = function (handlePartialSegments) {\n    var buffer,\n        frameNum = 0;\n    AdtsStream$1.prototype.init.call(this);\n\n    this.skipWarn_ = function (start, end) {\n      this.trigger('log', {\n        level: 'warn',\n        message: `adts skiping bytes ${start} to ${end} in frame ${frameNum} outside syncword`\n      });\n    };\n\n    this.push = function (packet) {\n      var i = 0,\n          frameLength,\n          protectionSkipBytes,\n          oldBuffer,\n          sampleCount,\n          adtsFrameDuration;\n\n      if (!handlePartialSegments) {\n        frameNum = 0;\n      }\n\n      if (packet.type !== 'audio') {\n        // ignore non-audio data\n        return;\n      } // Prepend any data in the buffer to the input data so that we can parse\n      // aac frames the cross a PES packet boundary\n\n\n      if (buffer && buffer.length) {\n        oldBuffer = buffer;\n        buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n        buffer.set(oldBuffer);\n        buffer.set(packet.data, oldBuffer.byteLength);\n      } else {\n        buffer = packet.data;\n      } // unpack any ADTS frames which have been fully received\n      // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n\n      var skip; // We use i + 7 here because we want to be able to parse the entire header.\n      // If we don't have enough bytes to do that, then we definitely won't have a full frame.\n\n      while (i + 7 < buffer.length) {\n        // Look for the start of an ADTS header..\n        if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n          if (typeof skip !== 'number') {\n            skip = i;\n          } // If a valid header was not found,  jump one forward and attempt to\n          // find a valid ADTS header starting at the next byte\n\n\n          i++;\n          continue;\n        }\n\n        if (typeof skip === 'number') {\n          this.skipWarn_(skip, i);\n          skip = null;\n        } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n        // end of the ADTS header\n\n\n        protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n        // end of the sync sequence\n        // NOTE: frame length includes the size of the header\n\n        frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n        sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n        adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2]; // If we don't have enough data to actually finish this ADTS frame,\n        // then we have to wait for more data\n\n        if (buffer.byteLength - i < frameLength) {\n          break;\n        } // Otherwise, deliver the complete AAC frame\n\n\n        this.trigger('data', {\n          pts: packet.pts + frameNum * adtsFrameDuration,\n          dts: packet.dts + frameNum * adtsFrameDuration,\n          sampleCount: sampleCount,\n          audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n          channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n          samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2],\n          samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n          // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n          samplesize: 16,\n          // data is the frame without it's header\n          data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength)\n        });\n        frameNum++;\n        i += frameLength;\n      }\n\n      if (typeof skip === 'number') {\n        this.skipWarn_(skip, i);\n        skip = null;\n      } // remove processed bytes from the buffer.\n\n\n      buffer = buffer.subarray(i);\n    };\n\n    this.flush = function () {\n      frameNum = 0;\n      this.trigger('done');\n    };\n\n    this.reset = function () {\n      buffer = void 0;\n      this.trigger('reset');\n    };\n\n    this.endTimeline = function () {\n      buffer = void 0;\n      this.trigger('endedtimeline');\n    };\n  };\n\n  AdtsStream$1.prototype = new Stream$3();\n  var adts = AdtsStream$1;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var ExpGolomb$1;\n  /**\n   * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n   * scheme used by h264.\n   */\n\n  ExpGolomb$1 = function (workingData) {\n    var // the number of bytes left to examine in workingData\n    workingBytesAvailable = workingData.byteLength,\n        // the current word being examined\n    workingWord = 0,\n        // :uint\n    // the number of bits left to examine in the current word\n    workingBitsAvailable = 0; // :uint;\n    // ():uint\n\n    this.length = function () {\n      return 8 * workingBytesAvailable;\n    }; // ():uint\n\n\n    this.bitsAvailable = function () {\n      return 8 * workingBytesAvailable + workingBitsAvailable;\n    }; // ():void\n\n\n    this.loadWord = function () {\n      var position = workingData.byteLength - workingBytesAvailable,\n          workingBytes = new Uint8Array(4),\n          availableBytes = Math.min(4, workingBytesAvailable);\n\n      if (availableBytes === 0) {\n        throw new Error('no bytes available');\n      }\n\n      workingBytes.set(workingData.subarray(position, position + availableBytes));\n      workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n      workingBitsAvailable = availableBytes * 8;\n      workingBytesAvailable -= availableBytes;\n    }; // (count:int):void\n\n\n    this.skipBits = function (count) {\n      var skipBytes; // :int\n\n      if (workingBitsAvailable > count) {\n        workingWord <<= count;\n        workingBitsAvailable -= count;\n      } else {\n        count -= workingBitsAvailable;\n        skipBytes = Math.floor(count / 8);\n        count -= skipBytes * 8;\n        workingBytesAvailable -= skipBytes;\n        this.loadWord();\n        workingWord <<= count;\n        workingBitsAvailable -= count;\n      }\n    }; // (size:int):uint\n\n\n    this.readBits = function (size) {\n      var bits = Math.min(workingBitsAvailable, size),\n          // :uint\n      valu = workingWord >>> 32 - bits; // :uint\n      // if size > 31, handle error\n\n      workingBitsAvailable -= bits;\n\n      if (workingBitsAvailable > 0) {\n        workingWord <<= bits;\n      } else if (workingBytesAvailable > 0) {\n        this.loadWord();\n      }\n\n      bits = size - bits;\n\n      if (bits > 0) {\n        return valu << bits | this.readBits(bits);\n      }\n\n      return valu;\n    }; // ():uint\n\n\n    this.skipLeadingZeros = function () {\n      var leadingZeroCount; // :uint\n\n      for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n        if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n          // the first bit of working word is 1\n          workingWord <<= leadingZeroCount;\n          workingBitsAvailable -= leadingZeroCount;\n          return leadingZeroCount;\n        }\n      } // we exhausted workingWord and still have not found a 1\n\n\n      this.loadWord();\n      return leadingZeroCount + this.skipLeadingZeros();\n    }; // ():void\n\n\n    this.skipUnsignedExpGolomb = function () {\n      this.skipBits(1 + this.skipLeadingZeros());\n    }; // ():void\n\n\n    this.skipExpGolomb = function () {\n      this.skipBits(1 + this.skipLeadingZeros());\n    }; // ():uint\n\n\n    this.readUnsignedExpGolomb = function () {\n      var clz = this.skipLeadingZeros(); // :uint\n\n      return this.readBits(clz + 1) - 1;\n    }; // ():int\n\n\n    this.readExpGolomb = function () {\n      var valu = this.readUnsignedExpGolomb(); // :int\n\n      if (0x01 & valu) {\n        // the number is odd if the low order bit is set\n        return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n      }\n\n      return -1 * (valu >>> 1); // divide by two then make it negative\n    }; // Some convenience functions\n    // :Boolean\n\n\n    this.readBoolean = function () {\n      return this.readBits(1) === 1;\n    }; // ():int\n\n\n    this.readUnsignedByte = function () {\n      return this.readBits(8);\n    };\n\n    this.loadWord();\n  };\n\n  var expGolomb = ExpGolomb$1;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var Stream$2 = stream;\n  var ExpGolomb = expGolomb;\n  var H264Stream$1, NalByteStream;\n  var PROFILES_WITH_OPTIONAL_SPS_DATA;\n  /**\n   * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n   */\n\n  NalByteStream = function () {\n    var syncPoint = 0,\n        i,\n        buffer;\n    NalByteStream.prototype.init.call(this);\n    /*\n     * Scans a byte stream and triggers a data event with the NAL units found.\n     * @param {Object} data Event received from H264Stream\n     * @param {Uint8Array} data.data The h264 byte stream to be scanned\n     *\n     * @see H264Stream.push\n     */\n\n    this.push = function (data) {\n      var swapBuffer;\n\n      if (!buffer) {\n        buffer = data.data;\n      } else {\n        swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n        swapBuffer.set(buffer);\n        swapBuffer.set(data.data, buffer.byteLength);\n        buffer = swapBuffer;\n      }\n\n      var len = buffer.byteLength; // Rec. ITU-T H.264, Annex B\n      // scan for NAL unit boundaries\n      // a match looks like this:\n      // 0 0 1 .. NAL .. 0 0 1\n      // ^ sync point        ^ i\n      // or this:\n      // 0 0 1 .. NAL .. 0 0 0\n      // ^ sync point        ^ i\n      // advance the sync point to a NAL start, if necessary\n\n      for (; syncPoint < len - 3; syncPoint++) {\n        if (buffer[syncPoint + 2] === 1) {\n          // the sync point is properly aligned\n          i = syncPoint + 5;\n          break;\n        }\n      }\n\n      while (i < len) {\n        // look at the current byte to determine if we've hit the end of\n        // a NAL unit boundary\n        switch (buffer[i]) {\n          case 0:\n            // skip past non-sync sequences\n            if (buffer[i - 1] !== 0) {\n              i += 2;\n              break;\n            } else if (buffer[i - 2] !== 0) {\n              i++;\n              break;\n            } // deliver the NAL unit if it isn't empty\n\n\n            if (syncPoint + 3 !== i - 2) {\n              this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n            } // drop trailing zeroes\n\n\n            do {\n              i++;\n            } while (buffer[i] !== 1 && i < len);\n\n            syncPoint = i - 2;\n            i += 3;\n            break;\n\n          case 1:\n            // skip past non-sync sequences\n            if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n              i += 3;\n              break;\n            } // deliver the NAL unit\n\n\n            this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n            syncPoint = i - 2;\n            i += 3;\n            break;\n\n          default:\n            // the current byte isn't a one or zero, so it cannot be part\n            // of a sync sequence\n            i += 3;\n            break;\n        }\n      } // filter out the NAL units that were delivered\n\n\n      buffer = buffer.subarray(syncPoint);\n      i -= syncPoint;\n      syncPoint = 0;\n    };\n\n    this.reset = function () {\n      buffer = null;\n      syncPoint = 0;\n      this.trigger('reset');\n    };\n\n    this.flush = function () {\n      // deliver the last buffered NAL unit\n      if (buffer && buffer.byteLength > 3) {\n        this.trigger('data', buffer.subarray(syncPoint + 3));\n      } // reset the stream state\n\n\n      buffer = null;\n      syncPoint = 0;\n      this.trigger('done');\n    };\n\n    this.endTimeline = function () {\n      this.flush();\n      this.trigger('endedtimeline');\n    };\n  };\n\n  NalByteStream.prototype = new Stream$2(); // values of profile_idc that indicate additional fields are included in the SPS\n  // see Recommendation ITU-T H.264 (4/2013),\n  // 7.3.2.1.1 Sequence parameter set data syntax\n\n  PROFILES_WITH_OPTIONAL_SPS_DATA = {\n    100: true,\n    110: true,\n    122: true,\n    244: true,\n    44: true,\n    83: true,\n    86: true,\n    118: true,\n    128: true,\n    // TODO: the three profiles below don't\n    // appear to have sps data in the specificiation anymore?\n    138: true,\n    139: true,\n    134: true\n  };\n  /**\n   * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n   * events.\n   */\n\n  H264Stream$1 = function () {\n    var nalByteStream = new NalByteStream(),\n        self,\n        trackId,\n        currentPts,\n        currentDts,\n        discardEmulationPreventionBytes,\n        readSequenceParameterSet,\n        skipScalingList;\n    H264Stream$1.prototype.init.call(this);\n    self = this;\n    /*\n     * Pushes a packet from a stream onto the NalByteStream\n     *\n     * @param {Object} packet - A packet received from a stream\n     * @param {Uint8Array} packet.data - The raw bytes of the packet\n     * @param {Number} packet.dts - Decode timestamp of the packet\n     * @param {Number} packet.pts - Presentation timestamp of the packet\n     * @param {Number} packet.trackId - The id of the h264 track this packet came from\n     * @param {('video'|'audio')} packet.type - The type of packet\n     *\n     */\n\n    this.push = function (packet) {\n      if (packet.type !== 'video') {\n        return;\n      }\n\n      trackId = packet.trackId;\n      currentPts = packet.pts;\n      currentDts = packet.dts;\n      nalByteStream.push(packet);\n    };\n    /*\n     * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n     * for the NALUs to the next stream component.\n     * Also, preprocess caption and sequence parameter NALUs.\n     *\n     * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n     * @see NalByteStream.push\n     */\n\n\n    nalByteStream.on('data', function (data) {\n      var event = {\n        trackId: trackId,\n        pts: currentPts,\n        dts: currentDts,\n        data: data,\n        nalUnitTypeCode: data[0] & 0x1f\n      };\n\n      switch (event.nalUnitTypeCode) {\n        case 0x05:\n          event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n          break;\n\n        case 0x06:\n          event.nalUnitType = 'sei_rbsp';\n          event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n          break;\n\n        case 0x07:\n          event.nalUnitType = 'seq_parameter_set_rbsp';\n          event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n          event.config = readSequenceParameterSet(event.escapedRBSP);\n          break;\n\n        case 0x08:\n          event.nalUnitType = 'pic_parameter_set_rbsp';\n          break;\n\n        case 0x09:\n          event.nalUnitType = 'access_unit_delimiter_rbsp';\n          break;\n      } // This triggers data on the H264Stream\n\n\n      self.trigger('data', event);\n    });\n    nalByteStream.on('done', function () {\n      self.trigger('done');\n    });\n    nalByteStream.on('partialdone', function () {\n      self.trigger('partialdone');\n    });\n    nalByteStream.on('reset', function () {\n      self.trigger('reset');\n    });\n    nalByteStream.on('endedtimeline', function () {\n      self.trigger('endedtimeline');\n    });\n\n    this.flush = function () {\n      nalByteStream.flush();\n    };\n\n    this.partialFlush = function () {\n      nalByteStream.partialFlush();\n    };\n\n    this.reset = function () {\n      nalByteStream.reset();\n    };\n\n    this.endTimeline = function () {\n      nalByteStream.endTimeline();\n    };\n    /**\n     * Advance the ExpGolomb decoder past a scaling list. The scaling\n     * list is optionally transmitted as part of a sequence parameter\n     * set and is not relevant to transmuxing.\n     * @param count {number} the number of entries in this scaling list\n     * @param expGolombDecoder {object} an ExpGolomb pointed to the\n     * start of a scaling list\n     * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n     */\n\n\n    skipScalingList = function (count, expGolombDecoder) {\n      var lastScale = 8,\n          nextScale = 8,\n          j,\n          deltaScale;\n\n      for (j = 0; j < count; j++) {\n        if (nextScale !== 0) {\n          deltaScale = expGolombDecoder.readExpGolomb();\n          nextScale = (lastScale + deltaScale + 256) % 256;\n        }\n\n        lastScale = nextScale === 0 ? lastScale : nextScale;\n      }\n    };\n    /**\n     * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n     * Sequence Payload\"\n     * @param data {Uint8Array} the bytes of a RBSP from a NAL\n     * unit\n     * @return {Uint8Array} the RBSP without any Emulation\n     * Prevention Bytes\n     */\n\n\n    discardEmulationPreventionBytes = function (data) {\n      var length = data.byteLength,\n          emulationPreventionBytesPositions = [],\n          i = 1,\n          newLength,\n          newData; // Find all `Emulation Prevention Bytes`\n\n      while (i < length - 2) {\n        if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n          emulationPreventionBytesPositions.push(i + 2);\n          i += 2;\n        } else {\n          i++;\n        }\n      } // If no Emulation Prevention Bytes were found just return the original\n      // array\n\n\n      if (emulationPreventionBytesPositions.length === 0) {\n        return data;\n      } // Create a new array to hold the NAL unit data\n\n\n      newLength = length - emulationPreventionBytesPositions.length;\n      newData = new Uint8Array(newLength);\n      var sourceIndex = 0;\n\n      for (i = 0; i < newLength; sourceIndex++, i++) {\n        if (sourceIndex === emulationPreventionBytesPositions[0]) {\n          // Skip this byte\n          sourceIndex++; // Remove this position index\n\n          emulationPreventionBytesPositions.shift();\n        }\n\n        newData[i] = data[sourceIndex];\n      }\n\n      return newData;\n    };\n    /**\n     * Read a sequence parameter set and return some interesting video\n     * properties. A sequence parameter set is the H264 metadata that\n     * describes the properties of upcoming video frames.\n     * @param data {Uint8Array} the bytes of a sequence parameter set\n     * @return {object} an object with configuration parsed from the\n     * sequence parameter set, including the dimensions of the\n     * associated video frames.\n     */\n\n\n    readSequenceParameterSet = function (data) {\n      var frameCropLeftOffset = 0,\n          frameCropRightOffset = 0,\n          frameCropTopOffset = 0,\n          frameCropBottomOffset = 0,\n          expGolombDecoder,\n          profileIdc,\n          levelIdc,\n          profileCompatibility,\n          chromaFormatIdc,\n          picOrderCntType,\n          numRefFramesInPicOrderCntCycle,\n          picWidthInMbsMinus1,\n          picHeightInMapUnitsMinus1,\n          frameMbsOnlyFlag,\n          scalingListCount,\n          sarRatio = [1, 1],\n          aspectRatioIdc,\n          i;\n      expGolombDecoder = new ExpGolomb(data);\n      profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n      profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n      levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n      // some profiles have more optional data we don't need\n\n      if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n        chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n\n        if (chromaFormatIdc === 3) {\n          expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n        }\n\n        expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n        expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n        expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n        if (expGolombDecoder.readBoolean()) {\n          // seq_scaling_matrix_present_flag\n          scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\n          for (i = 0; i < scalingListCount; i++) {\n            if (expGolombDecoder.readBoolean()) {\n              // seq_scaling_list_present_flag[ i ]\n              if (i < 6) {\n                skipScalingList(16, expGolombDecoder);\n              } else {\n                skipScalingList(64, expGolombDecoder);\n              }\n            }\n          }\n        }\n      }\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n      picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n      if (picOrderCntType === 0) {\n        expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n      } else if (picOrderCntType === 1) {\n        expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n        expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n        expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n        numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n\n        for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n          expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n        }\n      }\n\n      expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n      expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n      picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n      picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n      frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n\n      if (frameMbsOnlyFlag === 0) {\n        expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n      }\n\n      expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n      if (expGolombDecoder.readBoolean()) {\n        // frame_cropping_flag\n        frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n        frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n      }\n\n      if (expGolombDecoder.readBoolean()) {\n        // vui_parameters_present_flag\n        if (expGolombDecoder.readBoolean()) {\n          // aspect_ratio_info_present_flag\n          aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n\n          switch (aspectRatioIdc) {\n            case 1:\n              sarRatio = [1, 1];\n              break;\n\n            case 2:\n              sarRatio = [12, 11];\n              break;\n\n            case 3:\n              sarRatio = [10, 11];\n              break;\n\n            case 4:\n              sarRatio = [16, 11];\n              break;\n\n            case 5:\n              sarRatio = [40, 33];\n              break;\n\n            case 6:\n              sarRatio = [24, 11];\n              break;\n\n            case 7:\n              sarRatio = [20, 11];\n              break;\n\n            case 8:\n              sarRatio = [32, 11];\n              break;\n\n            case 9:\n              sarRatio = [80, 33];\n              break;\n\n            case 10:\n              sarRatio = [18, 11];\n              break;\n\n            case 11:\n              sarRatio = [15, 11];\n              break;\n\n            case 12:\n              sarRatio = [64, 33];\n              break;\n\n            case 13:\n              sarRatio = [160, 99];\n              break;\n\n            case 14:\n              sarRatio = [4, 3];\n              break;\n\n            case 15:\n              sarRatio = [3, 2];\n              break;\n\n            case 16:\n              sarRatio = [2, 1];\n              break;\n\n            case 255:\n              {\n                sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n                break;\n              }\n          }\n\n          if (sarRatio) {\n            sarRatio[0] / sarRatio[1];\n          }\n        }\n      }\n\n      return {\n        profileIdc: profileIdc,\n        levelIdc: levelIdc,\n        profileCompatibility: profileCompatibility,\n        width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,\n        height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,\n        // sar is sample aspect ratio\n        sarRatio: sarRatio\n      };\n    };\n  };\n\n  H264Stream$1.prototype = new Stream$2();\n  var h264 = {\n    H264Stream: H264Stream$1,\n    NalByteStream: NalByteStream\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Utilities to detect basic properties and metadata about Aac data.\n   */\n\n  var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n  var parseId3TagSize = function (header, byteIndex) {\n    var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n        flags = header[byteIndex + 5],\n        footerPresent = (flags & 16) >> 4; // if we get a negative returnSize clamp it to 0\n\n    returnSize = returnSize >= 0 ? returnSize : 0;\n\n    if (footerPresent) {\n      return returnSize + 20;\n    }\n\n    return returnSize + 10;\n  };\n\n  var getId3Offset = function (data, offset) {\n    if (data.length - offset < 10 || data[offset] !== 'I'.charCodeAt(0) || data[offset + 1] !== 'D'.charCodeAt(0) || data[offset + 2] !== '3'.charCodeAt(0)) {\n      return offset;\n    }\n\n    offset += parseId3TagSize(data, offset);\n    return getId3Offset(data, offset);\n  }; // TODO: use vhs-utils\n\n\n  var isLikelyAacData$1 = function (data) {\n    var offset = getId3Offset(data, 0);\n    return data.length >= offset + 2 && (data[offset] & 0xFF) === 0xFF && (data[offset + 1] & 0xF0) === 0xF0 && // verify that the 2 layer bits are 0, aka this\n    // is not mp3 data but aac data.\n    (data[offset + 1] & 0x16) === 0x10;\n  };\n\n  var parseSyncSafeInteger = function (data) {\n    return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n  }; // return a percent-encoded representation of the specified byte range\n  // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n\n  var percentEncode = function (bytes, start, end) {\n    var i,\n        result = '';\n\n    for (i = start; i < end; i++) {\n      result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n    }\n\n    return result;\n  }; // return the string representation of the specified byte range,\n  // interpreted as ISO-8859-1.\n\n\n  var parseIso88591 = function (bytes, start, end) {\n    return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n  };\n\n  var parseAdtsSize = function (header, byteIndex) {\n    var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n        middle = header[byteIndex + 4] << 3,\n        highTwo = header[byteIndex + 3] & 0x3 << 11;\n    return highTwo | middle | lowThree;\n  };\n\n  var parseType$4 = function (header, byteIndex) {\n    if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n      return 'timed-metadata';\n    } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n      return 'audio';\n    }\n\n    return null;\n  };\n\n  var parseSampleRate = function (packet) {\n    var i = 0;\n\n    while (i + 5 < packet.length) {\n      if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n        // If a valid header was not found,  jump one forward and attempt to\n        // find a valid ADTS header starting at the next byte\n        i++;\n        continue;\n      }\n\n      return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n    }\n\n    return null;\n  };\n\n  var parseAacTimestamp = function (packet) {\n    var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n    frameStart = 10;\n\n    if (packet[5] & 0x40) {\n      // advance the frame start past the extended header\n      frameStart += 4; // header size field\n\n      frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n    } // parse one or more ID3 frames\n    // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n    do {\n      // determine the number of bytes in this frame\n      frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n\n      if (frameSize < 1) {\n        return null;\n      }\n\n      frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n\n      if (frameHeader === 'PRIV') {\n        frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n        for (var i = 0; i < frame.byteLength; i++) {\n          if (frame[i] === 0) {\n            var owner = parseIso88591(frame, 0, i);\n\n            if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n              var d = frame.subarray(i + 1);\n              var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n              size *= 4;\n              size += d[7] & 0x03;\n              return size;\n            }\n\n            break;\n          }\n        }\n      }\n\n      frameStart += 10; // advance past the frame header\n\n      frameStart += frameSize; // advance past the frame body\n    } while (frameStart < packet.byteLength);\n\n    return null;\n  };\n\n  var utils = {\n    isLikelyAacData: isLikelyAacData$1,\n    parseId3TagSize: parseId3TagSize,\n    parseAdtsSize: parseAdtsSize,\n    parseType: parseType$4,\n    parseSampleRate: parseSampleRate,\n    parseAacTimestamp: parseAacTimestamp\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * A stream-based aac to mp4 converter. This utility can be used to\n   * deliver mp4s to a SourceBuffer on platforms that support native\n   * Media Source Extensions.\n   */\n\n  var Stream$1 = stream;\n  var aacUtils = utils; // Constants\n\n  var AacStream$1;\n  /**\n   * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n   */\n\n  AacStream$1 = function () {\n    var everything = new Uint8Array(),\n        timeStamp = 0;\n    AacStream$1.prototype.init.call(this);\n\n    this.setTimestamp = function (timestamp) {\n      timeStamp = timestamp;\n    };\n\n    this.push = function (bytes) {\n      var frameSize = 0,\n          byteIndex = 0,\n          bytesLeft,\n          chunk,\n          packet,\n          tempLength; // If there are bytes remaining from the last segment, prepend them to the\n      // bytes that were pushed in\n\n      if (everything.length) {\n        tempLength = everything.length;\n        everything = new Uint8Array(bytes.byteLength + tempLength);\n        everything.set(everything.subarray(0, tempLength));\n        everything.set(bytes, tempLength);\n      } else {\n        everything = bytes;\n      }\n\n      while (everything.length - byteIndex >= 3) {\n        if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n          // Exit early because we don't have enough to parse\n          // the ID3 tag header\n          if (everything.length - byteIndex < 10) {\n            break;\n          } // check framesize\n\n\n          frameSize = aacUtils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n          // Add to byteIndex to support multiple ID3 tags in sequence\n\n          if (byteIndex + frameSize > everything.length) {\n            break;\n          }\n\n          chunk = {\n            type: 'timed-metadata',\n            data: everything.subarray(byteIndex, byteIndex + frameSize)\n          };\n          this.trigger('data', chunk);\n          byteIndex += frameSize;\n          continue;\n        } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n          // Exit early because we don't have enough to parse\n          // the ADTS frame header\n          if (everything.length - byteIndex < 7) {\n            break;\n          }\n\n          frameSize = aacUtils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (byteIndex + frameSize > everything.length) {\n            break;\n          }\n\n          packet = {\n            type: 'audio',\n            data: everything.subarray(byteIndex, byteIndex + frameSize),\n            pts: timeStamp,\n            dts: timeStamp\n          };\n          this.trigger('data', packet);\n          byteIndex += frameSize;\n          continue;\n        }\n\n        byteIndex++;\n      }\n\n      bytesLeft = everything.length - byteIndex;\n\n      if (bytesLeft > 0) {\n        everything = everything.subarray(byteIndex);\n      } else {\n        everything = new Uint8Array();\n      }\n    };\n\n    this.reset = function () {\n      everything = new Uint8Array();\n      this.trigger('reset');\n    };\n\n    this.endTimeline = function () {\n      everything = new Uint8Array();\n      this.trigger('endedtimeline');\n    };\n  };\n\n  AacStream$1.prototype = new Stream$1();\n  var aac = AacStream$1;\n  var AUDIO_PROPERTIES$1 = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n  var audioProperties = AUDIO_PROPERTIES$1;\n  var VIDEO_PROPERTIES$1 = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'];\n  var videoProperties = VIDEO_PROPERTIES$1;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * A stream-based mp2t to mp4 converter. This utility can be used to\n   * deliver mp4s to a SourceBuffer on platforms that support native\n   * Media Source Extensions.\n   */\n\n  var Stream = stream;\n  var mp4 = mp4Generator;\n  var frameUtils = frameUtils$1;\n  var audioFrameUtils = audioFrameUtils$1;\n  var trackDecodeInfo = trackDecodeInfo$1;\n  var m2ts = m2ts_1;\n  var clock = clock$2;\n  var AdtsStream = adts;\n  var H264Stream = h264.H264Stream;\n  var AacStream = aac;\n  var isLikelyAacData = utils.isLikelyAacData;\n  var ONE_SECOND_IN_TS$1 = clock$2.ONE_SECOND_IN_TS;\n  var AUDIO_PROPERTIES = audioProperties;\n  var VIDEO_PROPERTIES = videoProperties; // object types\n\n  var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;\n\n  var retriggerForStream = function (key, event) {\n    event.stream = key;\n    this.trigger('log', event);\n  };\n\n  var addPipelineLogRetriggers = function (transmuxer, pipeline) {\n    var keys = Object.keys(pipeline);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]; // skip non-stream keys and headOfPipeline\n      // which is just a duplicate\n\n      if (key === 'headOfPipeline' || !pipeline[key].on) {\n        continue;\n      }\n\n      pipeline[key].on('log', retriggerForStream.bind(transmuxer, key));\n    }\n  };\n  /**\n   * Compare two arrays (even typed) for same-ness\n   */\n\n\n  var arrayEquals = function (a, b) {\n    var i;\n\n    if (a.length !== b.length) {\n      return false;\n    } // compare the value of each element in the array\n\n\n    for (i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n  var generateSegmentTimingInfo = function (baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {\n    var ptsOffsetFromDts = startPts - startDts,\n        decodeDuration = endDts - startDts,\n        presentationDuration = endPts - startPts; // The PTS and DTS values are based on the actual stream times from the segment,\n    // however, the player time values will reflect a start from the baseMediaDecodeTime.\n    // In order to provide relevant values for the player times, base timing info on the\n    // baseMediaDecodeTime and the DTS and PTS durations of the segment.\n\n    return {\n      start: {\n        dts: baseMediaDecodeTime,\n        pts: baseMediaDecodeTime + ptsOffsetFromDts\n      },\n      end: {\n        dts: baseMediaDecodeTime + decodeDuration,\n        pts: baseMediaDecodeTime + presentationDuration\n      },\n      prependedContentDuration: prependedContentDuration,\n      baseMediaDecodeTime: baseMediaDecodeTime\n    };\n  };\n  /**\n   * Constructs a single-track, ISO BMFF media segment from AAC data\n   * events. The output of this stream can be fed to a SourceBuffer\n   * configured with a suitable initialization segment.\n   * @param track {object} track metadata configuration\n   * @param options {object} transmuxer options object\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n\n  AudioSegmentStream = function (track, options) {\n    var adtsFrames = [],\n        sequenceNumber,\n        earliestAllowedDts = 0,\n        audioAppendStartTs = 0,\n        videoBaseMediaDecodeTime = Infinity;\n    options = options || {};\n    sequenceNumber = options.firstSequenceNumber || 0;\n    AudioSegmentStream.prototype.init.call(this);\n\n    this.push = function (data) {\n      trackDecodeInfo.collectDtsInfo(track, data);\n\n      if (track) {\n        AUDIO_PROPERTIES.forEach(function (prop) {\n          track[prop] = data[prop];\n        });\n      } // buffer audio data until end() is called\n\n\n      adtsFrames.push(data);\n    };\n\n    this.setEarliestDts = function (earliestDts) {\n      earliestAllowedDts = earliestDts;\n    };\n\n    this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n      videoBaseMediaDecodeTime = baseMediaDecodeTime;\n    };\n\n    this.setAudioAppendStart = function (timestamp) {\n      audioAppendStartTs = timestamp;\n    };\n\n    this.flush = function () {\n      var frames, moof, mdat, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed; // return early if no audio data has been observed\n\n      if (adtsFrames.length === 0) {\n        this.trigger('done', 'AudioSegmentStream');\n        return;\n      }\n\n      frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n      track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps); // amount of audio filled but the value is in video clock rather than audio clock\n\n      videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n      // samples (that is, adts frames) in the audio data\n\n      track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n      mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames));\n      adtsFrames = [];\n      moof = mp4.moof(sequenceNumber, [track]);\n      boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n      sequenceNumber++;\n      boxes.set(moof);\n      boxes.set(mdat, moof.byteLength);\n      trackDecodeInfo.clearDtsInfo(track);\n      frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 * 1024 / track.samplerate); // TODO this check was added to maintain backwards compatibility (particularly with\n      // tests) on adding the timingInfo event. However, it seems unlikely that there's a\n      // valid use-case where an init segment/data should be triggered without associated\n      // frames. Leaving for now, but should be looked into.\n\n      if (frames.length) {\n        segmentDuration = frames.length * frameDuration;\n        this.trigger('segmentTimingInfo', generateSegmentTimingInfo( // The audio track's baseMediaDecodeTime is in audio clock cycles, but the\n        // frame info is in video clock cycles. Convert to match expectation of\n        // listeners (that all timestamps will be based on video clock cycles).\n        clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), // frame times are already in video clock, as is segment duration\n        frames[0].dts, frames[0].pts, frames[0].dts + segmentDuration, frames[0].pts + segmentDuration, videoClockCyclesOfSilencePrefixed || 0));\n        this.trigger('timingInfo', {\n          start: frames[0].pts,\n          end: frames[0].pts + segmentDuration\n        });\n      }\n\n      this.trigger('data', {\n        track: track,\n        boxes: boxes\n      });\n      this.trigger('done', 'AudioSegmentStream');\n    };\n\n    this.reset = function () {\n      trackDecodeInfo.clearDtsInfo(track);\n      adtsFrames = [];\n      this.trigger('reset');\n    };\n  };\n\n  AudioSegmentStream.prototype = new Stream();\n  /**\n   * Constructs a single-track, ISO BMFF media segment from H264 data\n   * events. The output of this stream can be fed to a SourceBuffer\n   * configured with a suitable initialization segment.\n   * @param track {object} track metadata configuration\n   * @param options {object} transmuxer options object\n   * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n   *        gopsToAlignWith list when attempting to align gop pts\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at 0.\n   */\n\n  VideoSegmentStream = function (track, options) {\n    var sequenceNumber,\n        nalUnits = [],\n        gopsToAlignWith = [],\n        config,\n        pps;\n    options = options || {};\n    sequenceNumber = options.firstSequenceNumber || 0;\n    VideoSegmentStream.prototype.init.call(this);\n    delete track.minPTS;\n    this.gopCache_ = [];\n    /**\n      * Constructs a ISO BMFF segment given H264 nalUnits\n      * @param {Object} nalUnit A data event representing a nalUnit\n      * @param {String} nalUnit.nalUnitType\n      * @param {Object} nalUnit.config Properties for a mp4 track\n      * @param {Uint8Array} nalUnit.data The nalUnit bytes\n      * @see lib/codecs/h264.js\n     **/\n\n    this.push = function (nalUnit) {\n      trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n      if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n        config = nalUnit.config;\n        track.sps = [nalUnit.data];\n        VIDEO_PROPERTIES.forEach(function (prop) {\n          track[prop] = config[prop];\n        }, this);\n      }\n\n      if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n        pps = nalUnit.data;\n        track.pps = [nalUnit.data];\n      } // buffer video until flush() is called\n\n\n      nalUnits.push(nalUnit);\n    };\n    /**\n      * Pass constructed ISO BMFF track and boxes on to the\n      * next stream in the pipeline\n     **/\n\n\n    this.flush = function () {\n      var frames,\n          gopForFusion,\n          gops,\n          moof,\n          mdat,\n          boxes,\n          prependedContentDuration = 0,\n          firstGop,\n          lastGop; // Throw away nalUnits at the start of the byte stream until\n      // we find the first AUD\n\n      while (nalUnits.length) {\n        if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n          break;\n        }\n\n        nalUnits.shift();\n      } // Return early if no video data has been observed\n\n\n      if (nalUnits.length === 0) {\n        this.resetStream_();\n        this.trigger('done', 'VideoSegmentStream');\n        return;\n      } // Organize the raw nal-units into arrays that represent\n      // higher-level constructs such as frames and gops\n      // (group-of-pictures)\n\n\n      frames = frameUtils.groupNalsIntoFrames(nalUnits);\n      gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n      // a problem since MSE (on Chrome) requires a leading keyframe.\n      //\n      // We have two approaches to repairing this situation:\n      // 1) GOP-FUSION:\n      //    This is where we keep track of the GOPS (group-of-pictures)\n      //    from previous fragments and attempt to find one that we can\n      //    prepend to the current fragment in order to create a valid\n      //    fragment.\n      // 2) KEYFRAME-PULLING:\n      //    Here we search for the first keyframe in the fragment and\n      //    throw away all the frames between the start of the fragment\n      //    and that keyframe. We then extend the duration and pull the\n      //    PTS of the keyframe forward so that it covers the time range\n      //    of the frames that were disposed of.\n      //\n      // #1 is far prefereable over #2 which can cause \"stuttering\" but\n      // requires more things to be just right.\n\n      if (!gops[0][0].keyFrame) {\n        // Search for a gop for fusion from our gopCache\n        gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n        if (gopForFusion) {\n          // in order to provide more accurate timing information about the segment, save\n          // the number of seconds prepended to the original segment due to GOP fusion\n          prependedContentDuration = gopForFusion.duration;\n          gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n          // new gop at the beginning\n\n          gops.byteLength += gopForFusion.byteLength;\n          gops.nalCount += gopForFusion.nalCount;\n          gops.pts = gopForFusion.pts;\n          gops.dts = gopForFusion.dts;\n          gops.duration += gopForFusion.duration;\n        } else {\n          // If we didn't find a candidate gop fall back to keyframe-pulling\n          gops = frameUtils.extendFirstKeyFrame(gops);\n        }\n      } // Trim gops to align with gopsToAlignWith\n\n\n      if (gopsToAlignWith.length) {\n        var alignedGops;\n\n        if (options.alignGopsAtEnd) {\n          alignedGops = this.alignGopsAtEnd_(gops);\n        } else {\n          alignedGops = this.alignGopsAtStart_(gops);\n        }\n\n        if (!alignedGops) {\n          // save all the nals in the last GOP into the gop cache\n          this.gopCache_.unshift({\n            gop: gops.pop(),\n            pps: track.pps,\n            sps: track.sps\n          }); // Keep a maximum of 6 GOPs in the cache\n\n          this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n          nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n          this.resetStream_();\n          this.trigger('done', 'VideoSegmentStream');\n          return;\n        } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n        // when recalculated before sending off to CoalesceStream\n\n\n        trackDecodeInfo.clearDtsInfo(track);\n        gops = alignedGops;\n      }\n\n      trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n      // samples (that is, frames) in the video data\n\n      track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n      mdat = mp4.mdat(frameUtils.concatenateNalData(gops));\n      track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n      this.trigger('processedGopsInfo', gops.map(function (gop) {\n        return {\n          pts: gop.pts,\n          dts: gop.dts,\n          byteLength: gop.byteLength\n        };\n      }));\n      firstGop = gops[0];\n      lastGop = gops[gops.length - 1];\n      this.trigger('segmentTimingInfo', generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));\n      this.trigger('timingInfo', {\n        start: gops[0].pts,\n        end: gops[gops.length - 1].pts + gops[gops.length - 1].duration\n      }); // save all the nals in the last GOP into the gop cache\n\n      this.gopCache_.unshift({\n        gop: gops.pop(),\n        pps: track.pps,\n        sps: track.sps\n      }); // Keep a maximum of 6 GOPs in the cache\n\n      this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n      nalUnits = [];\n      this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n      this.trigger('timelineStartInfo', track.timelineStartInfo);\n      moof = mp4.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n      // throwing away hundreds of media segment fragments\n\n      boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n      sequenceNumber++;\n      boxes.set(moof);\n      boxes.set(mdat, moof.byteLength);\n      this.trigger('data', {\n        track: track,\n        boxes: boxes\n      });\n      this.resetStream_(); // Continue with the flush process now\n\n      this.trigger('done', 'VideoSegmentStream');\n    };\n\n    this.reset = function () {\n      this.resetStream_();\n      nalUnits = [];\n      this.gopCache_.length = 0;\n      gopsToAlignWith.length = 0;\n      this.trigger('reset');\n    };\n\n    this.resetStream_ = function () {\n      trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n      // for instance, when we are rendition switching\n\n      config = undefined;\n      pps = undefined;\n    }; // Search for a candidate Gop for gop-fusion from the gop cache and\n    // return it or return null if no good candidate was found\n\n\n    this.getGopForFusion_ = function (nalUnit) {\n      var halfSecond = 45000,\n          // Half-a-second in a 90khz clock\n      allowableOverlap = 10000,\n          // About 3 frames @ 30fps\n      nearestDistance = Infinity,\n          dtsDistance,\n          nearestGopObj,\n          currentGop,\n          currentGopObj,\n          i; // Search for the GOP nearest to the beginning of this nal unit\n\n      for (i = 0; i < this.gopCache_.length; i++) {\n        currentGopObj = this.gopCache_[i];\n        currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n        if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n          continue;\n        } // Reject Gops that would require a negative baseMediaDecodeTime\n\n\n        if (currentGop.dts < track.timelineStartInfo.dts) {\n          continue;\n        } // The distance between the end of the gop and the start of the nalUnit\n\n\n        dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n        // a half-second of the nal unit\n\n        if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n          // Always use the closest GOP we found if there is more than\n          // one candidate\n          if (!nearestGopObj || nearestDistance > dtsDistance) {\n            nearestGopObj = currentGopObj;\n            nearestDistance = dtsDistance;\n          }\n        }\n      }\n\n      if (nearestGopObj) {\n        return nearestGopObj.gop;\n      }\n\n      return null;\n    }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n    // of gopsToAlignWith starting from the START of the list\n\n\n    this.alignGopsAtStart_ = function (gops) {\n      var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n      byteLength = gops.byteLength;\n      nalCount = gops.nalCount;\n      duration = gops.duration;\n      alignIndex = gopIndex = 0;\n\n      while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n        align = gopsToAlignWith[alignIndex];\n        gop = gops[gopIndex];\n\n        if (align.pts === gop.pts) {\n          break;\n        }\n\n        if (gop.pts > align.pts) {\n          // this current gop starts after the current gop we want to align on, so increment\n          // align index\n          alignIndex++;\n          continue;\n        } // current gop starts before the current gop we want to align on. so increment gop\n        // index\n\n\n        gopIndex++;\n        byteLength -= gop.byteLength;\n        nalCount -= gop.nalCount;\n        duration -= gop.duration;\n      }\n\n      if (gopIndex === 0) {\n        // no gops to trim\n        return gops;\n      }\n\n      if (gopIndex === gops.length) {\n        // all gops trimmed, skip appending all gops\n        return null;\n      }\n\n      alignedGops = gops.slice(gopIndex);\n      alignedGops.byteLength = byteLength;\n      alignedGops.duration = duration;\n      alignedGops.nalCount = nalCount;\n      alignedGops.pts = alignedGops[0].pts;\n      alignedGops.dts = alignedGops[0].dts;\n      return alignedGops;\n    }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n    // of gopsToAlignWith starting from the END of the list\n\n\n    this.alignGopsAtEnd_ = function (gops) {\n      var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n      alignIndex = gopsToAlignWith.length - 1;\n      gopIndex = gops.length - 1;\n      alignEndIndex = null;\n      matchFound = false;\n\n      while (alignIndex >= 0 && gopIndex >= 0) {\n        align = gopsToAlignWith[alignIndex];\n        gop = gops[gopIndex];\n\n        if (align.pts === gop.pts) {\n          matchFound = true;\n          break;\n        }\n\n        if (align.pts > gop.pts) {\n          alignIndex--;\n          continue;\n        }\n\n        if (alignIndex === gopsToAlignWith.length - 1) {\n          // gop.pts is greater than the last alignment candidate. If no match is found\n          // by the end of this loop, we still want to append gops that come after this\n          // point\n          alignEndIndex = gopIndex;\n        }\n\n        gopIndex--;\n      }\n\n      if (!matchFound && alignEndIndex === null) {\n        return null;\n      }\n\n      var trimIndex;\n\n      if (matchFound) {\n        trimIndex = gopIndex;\n      } else {\n        trimIndex = alignEndIndex;\n      }\n\n      if (trimIndex === 0) {\n        return gops;\n      }\n\n      var alignedGops = gops.slice(trimIndex);\n      var metadata = alignedGops.reduce(function (total, gop) {\n        total.byteLength += gop.byteLength;\n        total.duration += gop.duration;\n        total.nalCount += gop.nalCount;\n        return total;\n      }, {\n        byteLength: 0,\n        duration: 0,\n        nalCount: 0\n      });\n      alignedGops.byteLength = metadata.byteLength;\n      alignedGops.duration = metadata.duration;\n      alignedGops.nalCount = metadata.nalCount;\n      alignedGops.pts = alignedGops[0].pts;\n      alignedGops.dts = alignedGops[0].dts;\n      return alignedGops;\n    };\n\n    this.alignGopsWith = function (newGopsToAlignWith) {\n      gopsToAlignWith = newGopsToAlignWith;\n    };\n  };\n\n  VideoSegmentStream.prototype = new Stream();\n  /**\n   * A Stream that can combine multiple streams (ie. audio & video)\n   * into a single output segment for MSE. Also supports audio-only\n   * and video-only streams.\n   * @param options {object} transmuxer options object\n   * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n   *        in the source; false to adjust the first segment to start at media timeline start.\n   */\n\n  CoalesceStream = function (options, metadataStream) {\n    // Number of Tracks per output segment\n    // If greater than 1, we combine multiple\n    // tracks into a single segment\n    this.numberOfTracks = 0;\n    this.metadataStream = metadataStream;\n    options = options || {};\n\n    if (typeof options.remux !== 'undefined') {\n      this.remuxTracks = !!options.remux;\n    } else {\n      this.remuxTracks = true;\n    }\n\n    if (typeof options.keepOriginalTimestamps === 'boolean') {\n      this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n    } else {\n      this.keepOriginalTimestamps = false;\n    }\n\n    this.pendingTracks = [];\n    this.videoTrack = null;\n    this.pendingBoxes = [];\n    this.pendingCaptions = [];\n    this.pendingMetadata = [];\n    this.pendingBytes = 0;\n    this.emittedTracks = 0;\n    CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n    this.push = function (output) {\n      // buffer incoming captions until the associated video segment\n      // finishes\n      if (output.content || output.text) {\n        return this.pendingCaptions.push(output);\n      } // buffer incoming id3 tags until the final flush\n\n\n      if (output.frames) {\n        return this.pendingMetadata.push(output);\n      } // Add this track to the list of pending tracks and store\n      // important information required for the construction of\n      // the final segment\n\n\n      this.pendingTracks.push(output.track);\n      this.pendingBytes += output.boxes.byteLength; // TODO: is there an issue for this against chrome?\n      // We unshift audio and push video because\n      // as of Chrome 75 when switching from\n      // one init segment to another if the video\n      // mdat does not appear after the audio mdat\n      // only audio will play for the duration of our transmux.\n\n      if (output.track.type === 'video') {\n        this.videoTrack = output.track;\n        this.pendingBoxes.push(output.boxes);\n      }\n\n      if (output.track.type === 'audio') {\n        this.audioTrack = output.track;\n        this.pendingBoxes.unshift(output.boxes);\n      }\n    };\n  };\n\n  CoalesceStream.prototype = new Stream();\n\n  CoalesceStream.prototype.flush = function (flushSource) {\n    var offset = 0,\n        event = {\n      captions: [],\n      captionStreams: {},\n      metadata: [],\n      info: {}\n    },\n        caption,\n        id3,\n        initSegment,\n        timelineStartPts = 0,\n        i;\n\n    if (this.pendingTracks.length < this.numberOfTracks) {\n      if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n        // Return because we haven't received a flush from a data-generating\n        // portion of the segment (meaning that we have only recieved meta-data\n        // or captions.)\n        return;\n      } else if (this.remuxTracks) {\n        // Return until we have enough tracks from the pipeline to remux (if we\n        // are remuxing audio and video into a single MP4)\n        return;\n      } else if (this.pendingTracks.length === 0) {\n        // In the case where we receive a flush without any data having been\n        // received we consider it an emitted track for the purposes of coalescing\n        // `done` events.\n        // We do this for the case where there is an audio and video track in the\n        // segment but no audio data. (seen in several playlists with alternate\n        // audio tracks and no audio present in the main TS segments.)\n        this.emittedTracks++;\n\n        if (this.emittedTracks >= this.numberOfTracks) {\n          this.trigger('done');\n          this.emittedTracks = 0;\n        }\n\n        return;\n      }\n    }\n\n    if (this.videoTrack) {\n      timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n      VIDEO_PROPERTIES.forEach(function (prop) {\n        event.info[prop] = this.videoTrack[prop];\n      }, this);\n    } else if (this.audioTrack) {\n      timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n      AUDIO_PROPERTIES.forEach(function (prop) {\n        event.info[prop] = this.audioTrack[prop];\n      }, this);\n    }\n\n    if (this.videoTrack || this.audioTrack) {\n      if (this.pendingTracks.length === 1) {\n        event.type = this.pendingTracks[0].type;\n      } else {\n        event.type = 'combined';\n      }\n\n      this.emittedTracks += this.pendingTracks.length;\n      initSegment = mp4.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n      event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n      // and track definitions\n\n      event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n      event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n      for (i = 0; i < this.pendingBoxes.length; i++) {\n        event.data.set(this.pendingBoxes[i], offset);\n        offset += this.pendingBoxes[i].byteLength;\n      } // Translate caption PTS times into second offsets to match the\n      // video timeline for the segment, and add track info\n\n\n      for (i = 0; i < this.pendingCaptions.length; i++) {\n        caption = this.pendingCaptions[i];\n        caption.startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);\n        caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);\n        event.captionStreams[caption.stream] = true;\n        event.captions.push(caption);\n      } // Translate ID3 frame PTS times into second offsets to match the\n      // video timeline for the segment\n\n\n      for (i = 0; i < this.pendingMetadata.length; i++) {\n        id3 = this.pendingMetadata[i];\n        id3.cueTime = clock.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);\n        event.metadata.push(id3);\n      } // We add this to every single emitted segment even though we only need\n      // it for the first\n\n\n      event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n      this.pendingTracks.length = 0;\n      this.videoTrack = null;\n      this.pendingBoxes.length = 0;\n      this.pendingCaptions.length = 0;\n      this.pendingBytes = 0;\n      this.pendingMetadata.length = 0; // Emit the built segment\n      // We include captions and ID3 tags for backwards compatibility,\n      // ideally we should send only video and audio in the data event\n\n      this.trigger('data', event); // Emit each caption to the outside world\n      // Ideally, this would happen immediately on parsing captions,\n      // but we need to ensure that video data is sent back first\n      // so that caption timing can be adjusted to match video timing\n\n      for (i = 0; i < event.captions.length; i++) {\n        caption = event.captions[i];\n        this.trigger('caption', caption);\n      } // Emit each id3 tag to the outside world\n      // Ideally, this would happen immediately on parsing the tag,\n      // but we need to ensure that video data is sent back first\n      // so that ID3 frame timing can be adjusted to match video timing\n\n\n      for (i = 0; i < event.metadata.length; i++) {\n        id3 = event.metadata[i];\n        this.trigger('id3Frame', id3);\n      }\n    } // Only emit `done` if all tracks have been flushed and emitted\n\n\n    if (this.emittedTracks >= this.numberOfTracks) {\n      this.trigger('done');\n      this.emittedTracks = 0;\n    }\n  };\n\n  CoalesceStream.prototype.setRemux = function (val) {\n    this.remuxTracks = val;\n  };\n  /**\n   * A Stream that expects MP2T binary data as input and produces\n   * corresponding media segments, suitable for use with Media Source\n   * Extension (MSE) implementations that support the ISO BMFF byte\n   * stream format, like Chrome.\n   */\n\n\n  Transmuxer = function (options) {\n    var self = this,\n        hasFlushed = true,\n        videoTrack,\n        audioTrack;\n    Transmuxer.prototype.init.call(this);\n    options = options || {};\n    this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n    this.transmuxPipeline_ = {};\n\n    this.setupAacPipeline = function () {\n      var pipeline = {};\n      this.transmuxPipeline_ = pipeline;\n      pipeline.type = 'aac';\n      pipeline.metadataStream = new m2ts.MetadataStream(); // set up the parsing pipeline\n\n      pipeline.aacStream = new AacStream();\n      pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n      pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n      pipeline.adtsStream = new AdtsStream();\n      pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n      pipeline.headOfPipeline = pipeline.aacStream;\n      pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n      pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n      pipeline.metadataStream.on('timestamp', function (frame) {\n        pipeline.aacStream.setTimestamp(frame.timeStamp);\n      });\n      pipeline.aacStream.on('data', function (data) {\n        if (data.type !== 'timed-metadata' && data.type !== 'audio' || pipeline.audioSegmentStream) {\n          return;\n        }\n\n        audioTrack = audioTrack || {\n          timelineStartInfo: {\n            baseMediaDecodeTime: self.baseMediaDecodeTime\n          },\n          codec: 'adts',\n          type: 'audio'\n        }; // hook up the audio segment stream to the first track with aac data\n\n        pipeline.coalesceStream.numberOfTracks++;\n        pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n        pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n        pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo')); // Set up the final part of the audio pipeline\n\n        pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream); // emit pmt info\n\n        self.trigger('trackinfo', {\n          hasAudio: !!audioTrack,\n          hasVideo: !!videoTrack\n        });\n      }); // Re-emit any data coming from the coalesce stream to the outside world\n\n      pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n      pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n      addPipelineLogRetriggers(this, pipeline);\n    };\n\n    this.setupTsPipeline = function () {\n      var pipeline = {};\n      this.transmuxPipeline_ = pipeline;\n      pipeline.type = 'ts';\n      pipeline.metadataStream = new m2ts.MetadataStream(); // set up the parsing pipeline\n\n      pipeline.packetStream = new m2ts.TransportPacketStream();\n      pipeline.parseStream = new m2ts.TransportParseStream();\n      pipeline.elementaryStream = new m2ts.ElementaryStream();\n      pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream();\n      pipeline.adtsStream = new AdtsStream();\n      pipeline.h264Stream = new H264Stream();\n      pipeline.captionStream = new m2ts.CaptionStream(options);\n      pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n      pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n      pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream); // !!THIS ORDER IS IMPORTANT!!\n      // demux the streams\n\n      pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);\n      pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);\n      pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n      pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n      pipeline.elementaryStream.on('data', function (data) {\n        var i;\n\n        if (data.type === 'metadata') {\n          i = data.tracks.length; // scan the tracks listed in the metadata\n\n          while (i--) {\n            if (!videoTrack && data.tracks[i].type === 'video') {\n              videoTrack = data.tracks[i];\n              videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n            } else if (!audioTrack && data.tracks[i].type === 'audio') {\n              audioTrack = data.tracks[i];\n              audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n            }\n          } // hook up the video segment stream to the first track with h264 data\n\n\n          if (videoTrack && !pipeline.videoSegmentStream) {\n            pipeline.coalesceStream.numberOfTracks++;\n            pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options);\n            pipeline.videoSegmentStream.on('log', self.getLogTrigger_('videoSegmentStream'));\n            pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n              // When video emits timelineStartInfo data after a flush, we forward that\n              // info to the AudioSegmentStream, if it exists, because video timeline\n              // data takes precedence.  Do not do this if keepOriginalTimestamps is set,\n              // because this is a particularly subtle form of timestamp alteration.\n              if (audioTrack && !options.keepOriginalTimestamps) {\n                audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n                // very earliest DTS we have seen in video because Chrome will\n                // interpret any video track with a baseMediaDecodeTime that is\n                // non-zero as a gap.\n\n                pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self.baseMediaDecodeTime);\n              }\n            });\n            pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n            pipeline.videoSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'videoSegmentTimingInfo'));\n            pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n              if (audioTrack) {\n                pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n              }\n            });\n            pipeline.videoSegmentStream.on('timingInfo', self.trigger.bind(self, 'videoTimingInfo')); // Set up the final part of the video pipeline\n\n            pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n          }\n\n          if (audioTrack && !pipeline.audioSegmentStream) {\n            // hook up the audio segment stream to the first track with aac data\n            pipeline.coalesceStream.numberOfTracks++;\n            pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n            pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n            pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo'));\n            pipeline.audioSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'audioSegmentTimingInfo')); // Set up the final part of the audio pipeline\n\n            pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n          } // emit pmt info\n\n\n          self.trigger('trackinfo', {\n            hasAudio: !!audioTrack,\n            hasVideo: !!videoTrack\n          });\n        }\n      }); // Re-emit any data coming from the coalesce stream to the outside world\n\n      pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n      pipeline.coalesceStream.on('id3Frame', function (id3Frame) {\n        id3Frame.dispatchType = pipeline.metadataStream.dispatchType;\n        self.trigger('id3Frame', id3Frame);\n      });\n      pipeline.coalesceStream.on('caption', this.trigger.bind(this, 'caption')); // Let the consumer know we have finished flushing the entire pipeline\n\n      pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n      addPipelineLogRetriggers(this, pipeline);\n    }; // hook up the segment streams once track metadata is delivered\n\n\n    this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n      var pipeline = this.transmuxPipeline_;\n\n      if (!options.keepOriginalTimestamps) {\n        this.baseMediaDecodeTime = baseMediaDecodeTime;\n      }\n\n      if (audioTrack) {\n        audioTrack.timelineStartInfo.dts = undefined;\n        audioTrack.timelineStartInfo.pts = undefined;\n        trackDecodeInfo.clearDtsInfo(audioTrack);\n\n        if (pipeline.audioTimestampRolloverStream) {\n          pipeline.audioTimestampRolloverStream.discontinuity();\n        }\n      }\n\n      if (videoTrack) {\n        if (pipeline.videoSegmentStream) {\n          pipeline.videoSegmentStream.gopCache_ = [];\n        }\n\n        videoTrack.timelineStartInfo.dts = undefined;\n        videoTrack.timelineStartInfo.pts = undefined;\n        trackDecodeInfo.clearDtsInfo(videoTrack);\n        pipeline.captionStream.reset();\n      }\n\n      if (pipeline.timestampRolloverStream) {\n        pipeline.timestampRolloverStream.discontinuity();\n      }\n    };\n\n    this.setAudioAppendStart = function (timestamp) {\n      if (audioTrack) {\n        this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n      }\n    };\n\n    this.setRemux = function (val) {\n      var pipeline = this.transmuxPipeline_;\n      options.remux = val;\n\n      if (pipeline && pipeline.coalesceStream) {\n        pipeline.coalesceStream.setRemux(val);\n      }\n    };\n\n    this.alignGopsWith = function (gopsToAlignWith) {\n      if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n        this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n      }\n    };\n\n    this.getLogTrigger_ = function (key) {\n      var self = this;\n      return function (event) {\n        event.stream = key;\n        self.trigger('log', event);\n      };\n    }; // feed incoming data to the front of the parsing pipeline\n\n\n    this.push = function (data) {\n      if (hasFlushed) {\n        var isAac = isLikelyAacData(data);\n\n        if (isAac && this.transmuxPipeline_.type !== 'aac') {\n          this.setupAacPipeline();\n        } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n          this.setupTsPipeline();\n        }\n\n        hasFlushed = false;\n      }\n\n      this.transmuxPipeline_.headOfPipeline.push(data);\n    }; // flush any buffered data\n\n\n    this.flush = function () {\n      hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n      this.transmuxPipeline_.headOfPipeline.flush();\n    };\n\n    this.endTimeline = function () {\n      this.transmuxPipeline_.headOfPipeline.endTimeline();\n    };\n\n    this.reset = function () {\n      if (this.transmuxPipeline_.headOfPipeline) {\n        this.transmuxPipeline_.headOfPipeline.reset();\n      }\n    }; // Caption data has to be reset when seeking outside buffered range\n\n\n    this.resetCaptions = function () {\n      if (this.transmuxPipeline_.captionStream) {\n        this.transmuxPipeline_.captionStream.reset();\n      }\n    };\n  };\n\n  Transmuxer.prototype = new Stream();\n  var transmuxer = {\n    Transmuxer: Transmuxer,\n    VideoSegmentStream: VideoSegmentStream,\n    AudioSegmentStream: AudioSegmentStream,\n    AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n    VIDEO_PROPERTIES: VIDEO_PROPERTIES,\n    // exported for testing\n    generateSegmentTimingInfo: generateSegmentTimingInfo\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   */\n\n  var toUnsigned$3 = function (value) {\n    return value >>> 0;\n  };\n\n  var toHexString$1 = function (value) {\n    return ('00' + value.toString(16)).slice(-2);\n  };\n\n  var bin = {\n    toUnsigned: toUnsigned$3,\n    toHexString: toHexString$1\n  };\n\n  var parseType$3 = function (buffer) {\n    var result = '';\n    result += String.fromCharCode(buffer[0]);\n    result += String.fromCharCode(buffer[1]);\n    result += String.fromCharCode(buffer[2]);\n    result += String.fromCharCode(buffer[3]);\n    return result;\n  };\n\n  var parseType_1 = parseType$3;\n  var toUnsigned$2 = bin.toUnsigned;\n  var parseType$2 = parseType_1;\n\n  var findBox$2 = function (data, path) {\n    var results = [],\n        i,\n        size,\n        type,\n        end,\n        subresults;\n\n    if (!path.length) {\n      // short-circuit the search for empty paths\n      return null;\n    }\n\n    for (i = 0; i < data.byteLength;) {\n      size = toUnsigned$2(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n      type = parseType$2(data.subarray(i + 4, i + 8));\n      end = size > 1 ? i + size : data.byteLength;\n\n      if (type === path[0]) {\n        if (path.length === 1) {\n          // this is the end of the path and we've found the box we were\n          // looking for\n          results.push(data.subarray(i + 8, end));\n        } else {\n          // recursively search for the next box along the path\n          subresults = findBox$2(data.subarray(i + 8, end), path.slice(1));\n\n          if (subresults.length) {\n            results = results.concat(subresults);\n          }\n        }\n      }\n\n      i = end;\n    } // we've finished searching all of data\n\n\n    return results;\n  };\n\n  var findBox_1 = findBox$2;\n  var toUnsigned$1 = bin.toUnsigned;\n  var getUint64$2 = numbers.getUint64;\n\n  var tfdt = function (data) {\n    var result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4))\n    };\n\n    if (result.version === 1) {\n      result.baseMediaDecodeTime = getUint64$2(data.subarray(4));\n    } else {\n      result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);\n    }\n\n    return result;\n  };\n\n  var parseTfdt$2 = tfdt;\n\n  var parseSampleFlags$1 = function (flags) {\n    return {\n      isLeading: (flags[0] & 0x0c) >>> 2,\n      dependsOn: flags[0] & 0x03,\n      isDependedOn: (flags[1] & 0xc0) >>> 6,\n      hasRedundancy: (flags[1] & 0x30) >>> 4,\n      paddingValue: (flags[1] & 0x0e) >>> 1,\n      isNonSyncSample: flags[1] & 0x01,\n      degradationPriority: flags[2] << 8 | flags[3]\n    };\n  };\n\n  var parseSampleFlags_1 = parseSampleFlags$1;\n  var parseSampleFlags = parseSampleFlags_1;\n\n  var trun = function (data) {\n    var result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4)),\n      samples: []\n    },\n        view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n        // Flag interpretation\n    dataOffsetPresent = result.flags[2] & 0x01,\n        // compare with 2nd byte of 0x1\n    firstSampleFlagsPresent = result.flags[2] & 0x04,\n        // compare with 2nd byte of 0x4\n    sampleDurationPresent = result.flags[1] & 0x01,\n        // compare with 2nd byte of 0x100\n    sampleSizePresent = result.flags[1] & 0x02,\n        // compare with 2nd byte of 0x200\n    sampleFlagsPresent = result.flags[1] & 0x04,\n        // compare with 2nd byte of 0x400\n    sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n        // compare with 2nd byte of 0x800\n    sampleCount = view.getUint32(4),\n        offset = 8,\n        sample;\n\n    if (dataOffsetPresent) {\n      // 32 bit signed integer\n      result.dataOffset = view.getInt32(offset);\n      offset += 4;\n    } // Overrides the flags for the first sample only. The order of\n    // optional values will be: duration, size, compositionTimeOffset\n\n\n    if (firstSampleFlagsPresent && sampleCount) {\n      sample = {\n        flags: parseSampleFlags(data.subarray(offset, offset + 4))\n      };\n      offset += 4;\n\n      if (sampleDurationPresent) {\n        sample.duration = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleSizePresent) {\n        sample.size = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleCompositionTimeOffsetPresent) {\n        if (result.version === 1) {\n          sample.compositionTimeOffset = view.getInt32(offset);\n        } else {\n          sample.compositionTimeOffset = view.getUint32(offset);\n        }\n\n        offset += 4;\n      }\n\n      result.samples.push(sample);\n      sampleCount--;\n    }\n\n    while (sampleCount--) {\n      sample = {};\n\n      if (sampleDurationPresent) {\n        sample.duration = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleSizePresent) {\n        sample.size = view.getUint32(offset);\n        offset += 4;\n      }\n\n      if (sampleFlagsPresent) {\n        sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n        offset += 4;\n      }\n\n      if (sampleCompositionTimeOffsetPresent) {\n        if (result.version === 1) {\n          sample.compositionTimeOffset = view.getInt32(offset);\n        } else {\n          sample.compositionTimeOffset = view.getUint32(offset);\n        }\n\n        offset += 4;\n      }\n\n      result.samples.push(sample);\n    }\n\n    return result;\n  };\n\n  var parseTrun$2 = trun;\n\n  var tfhd = function (data) {\n    var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n        result = {\n      version: data[0],\n      flags: new Uint8Array(data.subarray(1, 4)),\n      trackId: view.getUint32(4)\n    },\n        baseDataOffsetPresent = result.flags[2] & 0x01,\n        sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n        defaultSampleDurationPresent = result.flags[2] & 0x08,\n        defaultSampleSizePresent = result.flags[2] & 0x10,\n        defaultSampleFlagsPresent = result.flags[2] & 0x20,\n        durationIsEmpty = result.flags[0] & 0x010000,\n        defaultBaseIsMoof = result.flags[0] & 0x020000,\n        i;\n    i = 8;\n\n    if (baseDataOffsetPresent) {\n      i += 4; // truncate top 4 bytes\n      // FIXME: should we read the full 64 bits?\n\n      result.baseDataOffset = view.getUint32(12);\n      i += 4;\n    }\n\n    if (sampleDescriptionIndexPresent) {\n      result.sampleDescriptionIndex = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleDurationPresent) {\n      result.defaultSampleDuration = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleSizePresent) {\n      result.defaultSampleSize = view.getUint32(i);\n      i += 4;\n    }\n\n    if (defaultSampleFlagsPresent) {\n      result.defaultSampleFlags = view.getUint32(i);\n    }\n\n    if (durationIsEmpty) {\n      result.durationIsEmpty = true;\n    }\n\n    if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n      result.baseDataOffsetIsMoof = true;\n    }\n\n    return result;\n  };\n\n  var parseTfhd$2 = tfhd;\n  var win;\n\n  if (typeof window !== \"undefined\") {\n    win = window;\n  } else if (typeof commonjsGlobal !== \"undefined\") {\n    win = commonjsGlobal;\n  } else if (typeof self !== \"undefined\") {\n    win = self;\n  } else {\n    win = {};\n  }\n\n  var window_1 = win;\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Reads in-band CEA-708 captions out of FMP4 segments.\n   * @see https://en.wikipedia.org/wiki/CEA-708\n   */\n\n  var discardEmulationPreventionBytes = captionPacketParser.discardEmulationPreventionBytes;\n  var CaptionStream = captionStream.CaptionStream;\n  var findBox$1 = findBox_1;\n  var parseTfdt$1 = parseTfdt$2;\n  var parseTrun$1 = parseTrun$2;\n  var parseTfhd$1 = parseTfhd$2;\n  var window$2 = window_1;\n  /**\n    * Maps an offset in the mdat to a sample based on the the size of the samples.\n    * Assumes that `parseSamples` has been called first.\n    *\n    * @param {Number} offset - The offset into the mdat\n    * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n    * @return {?Object} The matching sample, or null if no match was found.\n    *\n    * @see ISO-BMFF-12/2015, Section 8.8.8\n   **/\n\n  var mapToSample = function (offset, samples) {\n    var approximateOffset = offset;\n\n    for (var i = 0; i < samples.length; i++) {\n      var sample = samples[i];\n\n      if (approximateOffset < sample.size) {\n        return sample;\n      }\n\n      approximateOffset -= sample.size;\n    }\n\n    return null;\n  };\n  /**\n    * Finds SEI nal units contained in a Media Data Box.\n    * Assumes that `parseSamples` has been called first.\n    *\n    * @param {Uint8Array} avcStream - The bytes of the mdat\n    * @param {Object[]} samples - The samples parsed out by `parseSamples`\n    * @param {Number} trackId - The trackId of this video track\n    * @return {Object[]} seiNals - the parsed SEI NALUs found.\n    *   The contents of the seiNal should match what is expected by\n    *   CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n    *\n    * @see ISO-BMFF-12/2015, Section 8.1.1\n    * @see Rec. ITU-T H.264, 7.3.2.3.1\n   **/\n\n\n  var findSeiNals = function (avcStream, samples, trackId) {\n    var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n        result = {\n      logs: [],\n      seiNals: []\n    },\n        seiNal,\n        i,\n        length,\n        lastMatchedSample;\n\n    for (i = 0; i + 4 < avcStream.length; i += length) {\n      length = avcView.getUint32(i);\n      i += 4; // Bail if this doesn't appear to be an H264 stream\n\n      if (length <= 0) {\n        continue;\n      }\n\n      switch (avcStream[i] & 0x1F) {\n        case 0x06:\n          var data = avcStream.subarray(i + 1, i + 1 + length);\n          var matchingSample = mapToSample(i, samples);\n          seiNal = {\n            nalUnitType: 'sei_rbsp',\n            size: length,\n            data: data,\n            escapedRBSP: discardEmulationPreventionBytes(data),\n            trackId: trackId\n          };\n\n          if (matchingSample) {\n            seiNal.pts = matchingSample.pts;\n            seiNal.dts = matchingSample.dts;\n            lastMatchedSample = matchingSample;\n          } else if (lastMatchedSample) {\n            // If a matching sample cannot be found, use the last\n            // sample's values as they should be as close as possible\n            seiNal.pts = lastMatchedSample.pts;\n            seiNal.dts = lastMatchedSample.dts;\n          } else {\n            result.logs.push({\n              level: 'warn',\n              message: 'We\\'ve encountered a nal unit without data at ' + i + ' for trackId ' + trackId + '. See mux.js#223.'\n            });\n            break;\n          }\n\n          result.seiNals.push(seiNal);\n          break;\n      }\n    }\n\n    return result;\n  };\n  /**\n    * Parses sample information out of Track Run Boxes and calculates\n    * the absolute presentation and decode timestamps of each sample.\n    *\n    * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n    * @param {Number|BigInt} baseMediaDecodeTime - base media decode time from tfdt\n        @see ISO-BMFF-12/2015, Section 8.8.12\n    * @param {Object} tfhd - The parsed Track Fragment Header\n    *   @see inspect.parseTfhd\n    * @return {Object[]} the parsed samples\n    *\n    * @see ISO-BMFF-12/2015, Section 8.8.8\n   **/\n\n\n  var parseSamples = function (truns, baseMediaDecodeTime, tfhd) {\n    var currentDts = baseMediaDecodeTime;\n    var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n    var defaultSampleSize = tfhd.defaultSampleSize || 0;\n    var trackId = tfhd.trackId;\n    var allSamples = [];\n    truns.forEach(function (trun) {\n      // Note: We currently do not parse the sample table as well\n      // as the trun. It's possible some sources will require this.\n      // moov > trak > mdia > minf > stbl\n      var trackRun = parseTrun$1(trun);\n      var samples = trackRun.samples;\n      samples.forEach(function (sample) {\n        if (sample.duration === undefined) {\n          sample.duration = defaultSampleDuration;\n        }\n\n        if (sample.size === undefined) {\n          sample.size = defaultSampleSize;\n        }\n\n        sample.trackId = trackId;\n        sample.dts = currentDts;\n\n        if (sample.compositionTimeOffset === undefined) {\n          sample.compositionTimeOffset = 0;\n        }\n\n        if (typeof currentDts === 'bigint') {\n          sample.pts = currentDts + window$2.BigInt(sample.compositionTimeOffset);\n          currentDts += window$2.BigInt(sample.duration);\n        } else {\n          sample.pts = currentDts + sample.compositionTimeOffset;\n          currentDts += sample.duration;\n        }\n      });\n      allSamples = allSamples.concat(samples);\n    });\n    return allSamples;\n  };\n  /**\n    * Parses out caption nals from an FMP4 segment's video tracks.\n    *\n    * @param {Uint8Array} segment - The bytes of a single segment\n    * @param {Number} videoTrackId - The trackId of a video track in the segment\n    * @return {Object.<Number, Object[]>} A mapping of video trackId to\n    *   a list of seiNals found in that track\n   **/\n\n\n  var parseCaptionNals = function (segment, videoTrackId) {\n    // To get the samples\n    var trafs = findBox$1(segment, ['moof', 'traf']); // To get SEI NAL units\n\n    var mdats = findBox$1(segment, ['mdat']);\n    var captionNals = {};\n    var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n    mdats.forEach(function (mdat, index) {\n      var matchingTraf = trafs[index];\n      mdatTrafPairs.push({\n        mdat: mdat,\n        traf: matchingTraf\n      });\n    });\n    mdatTrafPairs.forEach(function (pair) {\n      var mdat = pair.mdat;\n      var traf = pair.traf;\n      var tfhd = findBox$1(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n      var headerInfo = parseTfhd$1(tfhd[0]);\n      var trackId = headerInfo.trackId;\n      var tfdt = findBox$1(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n      var baseMediaDecodeTime = tfdt.length > 0 ? parseTfdt$1(tfdt[0]).baseMediaDecodeTime : 0;\n      var truns = findBox$1(traf, ['trun']);\n      var samples;\n      var result; // Only parse video data for the chosen video track\n\n      if (videoTrackId === trackId && truns.length > 0) {\n        samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n        result = findSeiNals(mdat, samples, trackId);\n\n        if (!captionNals[trackId]) {\n          captionNals[trackId] = {\n            seiNals: [],\n            logs: []\n          };\n        }\n\n        captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);\n        captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);\n      }\n    });\n    return captionNals;\n  };\n  /**\n    * Parses out inband captions from an MP4 container and returns\n    * caption objects that can be used by WebVTT and the TextTrack API.\n    * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n    * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n    * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n    *\n    * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n    * @param {Number} trackId - The id of the video track to parse\n    * @param {Number} timescale - The timescale for the video track from the init segment\n    *\n    * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n    * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n    * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n    * @return {Object[]} parsedCaptions[].content - A list of individual caption segments\n    * @return {String} parsedCaptions[].content.text - The visible content of the caption segment\n    * @return {Number} parsedCaptions[].content.line - The line height from 1-15 for positioning of the caption segment\n    * @return {Number} parsedCaptions[].content.position - The column indent percentage for cue positioning from 10-80\n   **/\n\n\n  var parseEmbeddedCaptions = function (segment, trackId, timescale) {\n    var captionNals; // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n\n    if (trackId === null) {\n      return null;\n    }\n\n    captionNals = parseCaptionNals(segment, trackId);\n    var trackNals = captionNals[trackId] || {};\n    return {\n      seiNals: trackNals.seiNals,\n      logs: trackNals.logs,\n      timescale: timescale\n    };\n  };\n  /**\n    * Converts SEI NALUs into captions that can be used by video.js\n   **/\n\n\n  var CaptionParser = function () {\n    var isInitialized = false;\n    var captionStream; // Stores segments seen before trackId and timescale are set\n\n    var segmentCache; // Stores video track ID of the track being parsed\n\n    var trackId; // Stores the timescale of the track being parsed\n\n    var timescale; // Stores captions parsed so far\n\n    var parsedCaptions; // Stores whether we are receiving partial data or not\n\n    var parsingPartial;\n    /**\n      * A method to indicate whether a CaptionParser has been initalized\n      * @returns {Boolean}\n     **/\n\n    this.isInitialized = function () {\n      return isInitialized;\n    };\n    /**\n      * Initializes the underlying CaptionStream, SEI NAL parsing\n      * and management, and caption collection\n     **/\n\n\n    this.init = function (options) {\n      captionStream = new CaptionStream();\n      isInitialized = true;\n      parsingPartial = options ? options.isPartial : false; // Collect dispatched captions\n\n      captionStream.on('data', function (event) {\n        // Convert to seconds in the source's timescale\n        event.startTime = event.startPts / timescale;\n        event.endTime = event.endPts / timescale;\n        parsedCaptions.captions.push(event);\n        parsedCaptions.captionStreams[event.stream] = true;\n      });\n      captionStream.on('log', function (log) {\n        parsedCaptions.logs.push(log);\n      });\n    };\n    /**\n      * Determines if a new video track will be selected\n      * or if the timescale changed\n      * @return {Boolean}\n     **/\n\n\n    this.isNewInit = function (videoTrackIds, timescales) {\n      if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n        return false;\n      }\n\n      return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n    };\n    /**\n      * Parses out SEI captions and interacts with underlying\n      * CaptionStream to return dispatched captions\n      *\n      * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n      * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n      * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n      * @see parseEmbeddedCaptions\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.parse = function (segment, videoTrackIds, timescales) {\n      var parsedData;\n\n      if (!this.isInitialized()) {\n        return null; // This is not likely to be a video segment\n      } else if (!videoTrackIds || !timescales) {\n        return null;\n      } else if (this.isNewInit(videoTrackIds, timescales)) {\n        // Use the first video track only as there is no\n        // mechanism to switch to other video tracks\n        trackId = videoTrackIds[0];\n        timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n        // data until we have one.\n        // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n      } else if (trackId === null || !timescale) {\n        segmentCache.push(segment);\n        return null;\n      } // Now that a timescale and trackId is set, parse cached segments\n\n\n      while (segmentCache.length > 0) {\n        var cachedSegment = segmentCache.shift();\n        this.parse(cachedSegment, videoTrackIds, timescales);\n      }\n\n      parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n      if (parsedData && parsedData.logs) {\n        parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);\n      }\n\n      if (parsedData === null || !parsedData.seiNals) {\n        if (parsedCaptions.logs.length) {\n          return {\n            logs: parsedCaptions.logs,\n            captions: [],\n            captionStreams: []\n          };\n        }\n\n        return null;\n      }\n\n      this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n      this.flushStream();\n      return parsedCaptions;\n    };\n    /**\n      * Pushes SEI NALUs onto CaptionStream\n      * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n      * Assumes that `parseCaptionNals` has been called first\n      * @see m2ts/caption-stream.js\n      **/\n\n\n    this.pushNals = function (nals) {\n      if (!this.isInitialized() || !nals || nals.length === 0) {\n        return null;\n      }\n\n      nals.forEach(function (nal) {\n        captionStream.push(nal);\n      });\n    };\n    /**\n      * Flushes underlying CaptionStream to dispatch processed, displayable captions\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.flushStream = function () {\n      if (!this.isInitialized()) {\n        return null;\n      }\n\n      if (!parsingPartial) {\n        captionStream.flush();\n      } else {\n        captionStream.partialFlush();\n      }\n    };\n    /**\n      * Reset caption buckets for new data\n     **/\n\n\n    this.clearParsedCaptions = function () {\n      parsedCaptions.captions = [];\n      parsedCaptions.captionStreams = {};\n      parsedCaptions.logs = [];\n    };\n    /**\n      * Resets underlying CaptionStream\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.resetCaptionStream = function () {\n      if (!this.isInitialized()) {\n        return null;\n      }\n\n      captionStream.reset();\n    };\n    /**\n      * Convenience method to clear all captions flushed from the\n      * CaptionStream and still being parsed\n      * @see m2ts/caption-stream.js\n     **/\n\n\n    this.clearAllCaptions = function () {\n      this.clearParsedCaptions();\n      this.resetCaptionStream();\n    };\n    /**\n      * Reset caption parser\n     **/\n\n\n    this.reset = function () {\n      segmentCache = [];\n      trackId = null;\n      timescale = null;\n\n      if (!parsedCaptions) {\n        parsedCaptions = {\n          captions: [],\n          // CC1, CC2, CC3, CC4\n          captionStreams: {},\n          logs: []\n        };\n      } else {\n        this.clearParsedCaptions();\n      }\n\n      this.resetCaptionStream();\n    };\n\n    this.reset();\n  };\n\n  var captionParser = CaptionParser;\n  /**\n   * Returns the first string in the data array ending with a null char '\\0'\n   * @param {UInt8} data \n   * @returns the string with the null char\n   */\n\n  var uint8ToCString$1 = function (data) {\n    var index = 0;\n    var curChar = String.fromCharCode(data[index]);\n    var retString = '';\n\n    while (curChar !== '\\0') {\n      retString += curChar;\n      index++;\n      curChar = String.fromCharCode(data[index]);\n    } // Add nullChar\n\n\n    retString += curChar;\n    return retString;\n  };\n\n  var string = {\n    uint8ToCString: uint8ToCString$1\n  };\n  var uint8ToCString = string.uint8ToCString;\n  var getUint64$1 = numbers.getUint64;\n  /**\n   * Based on: ISO/IEC 23009 Section: 5.10.3.3\n   * References:\n   * https://dashif-documents.azurewebsites.net/Events/master/event.html#emsg-format\n   * https://aomediacodec.github.io/id3-emsg/\n   * \n   * Takes emsg box data as a uint8 array and returns a emsg box object\n   * @param {UInt8Array} boxData data from emsg box\n   * @returns A parsed emsg box object\n   */\n\n  var parseEmsgBox = function (boxData) {\n    // version + flags\n    var offset = 4;\n    var version = boxData[0];\n    var scheme_id_uri, value, timescale, presentation_time, presentation_time_delta, event_duration, id, message_data;\n\n    if (version === 0) {\n      scheme_id_uri = uint8ToCString(boxData.subarray(offset));\n      offset += scheme_id_uri.length;\n      value = uint8ToCString(boxData.subarray(offset));\n      offset += value.length;\n      var dv = new DataView(boxData.buffer);\n      timescale = dv.getUint32(offset);\n      offset += 4;\n      presentation_time_delta = dv.getUint32(offset);\n      offset += 4;\n      event_duration = dv.getUint32(offset);\n      offset += 4;\n      id = dv.getUint32(offset);\n      offset += 4;\n    } else if (version === 1) {\n      var dv = new DataView(boxData.buffer);\n      timescale = dv.getUint32(offset);\n      offset += 4;\n      presentation_time = getUint64$1(boxData.subarray(offset));\n      offset += 8;\n      event_duration = dv.getUint32(offset);\n      offset += 4;\n      id = dv.getUint32(offset);\n      offset += 4;\n      scheme_id_uri = uint8ToCString(boxData.subarray(offset));\n      offset += scheme_id_uri.length;\n      value = uint8ToCString(boxData.subarray(offset));\n      offset += value.length;\n    }\n\n    message_data = new Uint8Array(boxData.subarray(offset, boxData.byteLength));\n    var emsgBox = {\n      scheme_id_uri,\n      value,\n      // if timescale is undefined or 0 set to 1 \n      timescale: timescale ? timescale : 1,\n      presentation_time,\n      presentation_time_delta,\n      event_duration,\n      id,\n      message_data\n    };\n    return isValidEmsgBox(version, emsgBox) ? emsgBox : undefined;\n  };\n  /**\n   * Scales a presentation time or time delta with an offset with a provided timescale\n   * @param {number} presentationTime \n   * @param {number} timescale \n   * @param {number} timeDelta \n   * @param {number} offset \n   * @returns the scaled time as a number\n   */\n\n\n  var scaleTime = function (presentationTime, timescale, timeDelta, offset) {\n    return presentationTime || presentationTime === 0 ? presentationTime / timescale : offset + timeDelta / timescale;\n  };\n  /**\n   * Checks the emsg box data for validity based on the version\n   * @param {number} version of the emsg box to validate\n   * @param {Object} emsg the emsg data to validate\n   * @returns if the box is valid as a boolean\n   */\n\n\n  var isValidEmsgBox = function (version, emsg) {\n    var hasScheme = emsg.scheme_id_uri !== '\\0';\n    var isValidV0Box = version === 0 && isDefined(emsg.presentation_time_delta) && hasScheme;\n    var isValidV1Box = version === 1 && isDefined(emsg.presentation_time) && hasScheme; // Only valid versions of emsg are 0 and 1\n\n    return !(version > 1) && isValidV0Box || isValidV1Box;\n  }; // Utility function to check if an object is defined\n\n\n  var isDefined = function (data) {\n    return data !== undefined || data !== null;\n  };\n\n  var emsg$1 = {\n    parseEmsgBox: parseEmsgBox,\n    scaleTime: scaleTime\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Utilities to detect basic properties and metadata about MP4s.\n   */\n\n  var toUnsigned = bin.toUnsigned;\n  var toHexString = bin.toHexString;\n  var findBox = findBox_1;\n  var parseType$1 = parseType_1;\n  var emsg = emsg$1;\n  var parseTfhd = parseTfhd$2;\n  var parseTrun = parseTrun$2;\n  var parseTfdt = parseTfdt$2;\n  var getUint64 = numbers.getUint64;\n  var timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, getEmsgID3;\n  var window$1 = window_1;\n  var parseId3Frames = parseId3.parseId3Frames;\n  /**\n   * Parses an MP4 initialization segment and extracts the timescale\n   * values for any declared tracks. Timescale values indicate the\n   * number of clock ticks per second to assume for time-based values\n   * elsewhere in the MP4.\n   *\n   * To determine the start time of an MP4, you need two pieces of\n   * information: the timescale unit and the earliest base media decode\n   * time. Multiple timescales can be specified within an MP4 but the\n   * base media decode time is always expressed in the timescale from\n   * the media header box for the track:\n   * ```\n   * moov > trak > mdia > mdhd.timescale\n   * ```\n   * @param init {Uint8Array} the bytes of the init segment\n   * @return {object} a hash of track ids to timescale values or null if\n   * the init segment is malformed.\n   */\n\n  timescale = function (init) {\n    var result = {},\n        traks = findBox(init, ['moov', 'trak']); // mdhd timescale\n\n    return traks.reduce(function (result, trak) {\n      var tkhd, version, index, id, mdhd;\n      tkhd = findBox(trak, ['tkhd'])[0];\n\n      if (!tkhd) {\n        return null;\n      }\n\n      version = tkhd[0];\n      index = version === 0 ? 12 : 20;\n      id = toUnsigned(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n      mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n\n      if (!mdhd) {\n        return null;\n      }\n\n      version = mdhd[0];\n      index = version === 0 ? 12 : 20;\n      result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n      return result;\n    }, result);\n  };\n  /**\n   * Determine the base media decode start time, in seconds, for an MP4\n   * fragment. If multiple fragments are specified, the earliest time is\n   * returned.\n   *\n   * The base media decode time can be parsed from track fragment\n   * metadata:\n   * ```\n   * moof > traf > tfdt.baseMediaDecodeTime\n   * ```\n   * It requires the timescale value from the mdhd to interpret.\n   *\n   * @param timescale {object} a hash of track ids to timescale values.\n   * @return {number} the earliest base media decode start time for the\n   * fragment, in seconds\n   */\n\n\n  startTime = function (timescale, fragment) {\n    var trafs; // we need info from two childrend of each track fragment box\n\n    trafs = findBox(fragment, ['moof', 'traf']); // determine the start times for each track\n\n    var lowestTime = trafs.reduce(function (acc, traf) {\n      var tfhd = findBox(traf, ['tfhd'])[0]; // get the track id from the tfhd\n\n      var id = toUnsigned(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n      var scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n      var tfdt = findBox(traf, ['tfdt'])[0];\n      var dv = new DataView(tfdt.buffer, tfdt.byteOffset, tfdt.byteLength);\n      var baseTime; // version 1 is 64 bit\n\n      if (tfdt[0] === 1) {\n        baseTime = getUint64(tfdt.subarray(4, 12));\n      } else {\n        baseTime = dv.getUint32(4);\n      } // convert base time to seconds if it is a valid number.\n\n\n      let seconds;\n\n      if (typeof baseTime === 'bigint') {\n        seconds = baseTime / window$1.BigInt(scale);\n      } else if (typeof baseTime === 'number' && !isNaN(baseTime)) {\n        seconds = baseTime / scale;\n      }\n\n      if (seconds < Number.MAX_SAFE_INTEGER) {\n        seconds = Number(seconds);\n      }\n\n      if (seconds < acc) {\n        acc = seconds;\n      }\n\n      return acc;\n    }, Infinity);\n    return typeof lowestTime === 'bigint' || isFinite(lowestTime) ? lowestTime : 0;\n  };\n  /**\n   * Determine the composition start, in seconds, for an MP4\n   * fragment.\n   *\n   * The composition start time of a fragment can be calculated using the base\n   * media decode time, composition time offset, and timescale, as follows:\n   *\n   * compositionStartTime = (baseMediaDecodeTime + compositionTimeOffset) / timescale\n   *\n   * All of the aforementioned information is contained within a media fragment's\n   * `traf` box, except for timescale info, which comes from the initialization\n   * segment, so a track id (also contained within a `traf`) is also necessary to\n   * associate it with a timescale\n   *\n   *\n   * @param timescales {object} - a hash of track ids to timescale values.\n   * @param fragment {Unit8Array} - the bytes of a media segment\n   * @return {number} the composition start time for the fragment, in seconds\n   **/\n\n\n  compositionStartTime = function (timescales, fragment) {\n    var trafBoxes = findBox(fragment, ['moof', 'traf']);\n    var baseMediaDecodeTime = 0;\n    var compositionTimeOffset = 0;\n    var trackId;\n\n    if (trafBoxes && trafBoxes.length) {\n      // The spec states that track run samples contained within a `traf` box are contiguous, but\n      // it does not explicitly state whether the `traf` boxes themselves are contiguous.\n      // We will assume that they are, so we only need the first to calculate start time.\n      var tfhd = findBox(trafBoxes[0], ['tfhd'])[0];\n      var trun = findBox(trafBoxes[0], ['trun'])[0];\n      var tfdt = findBox(trafBoxes[0], ['tfdt'])[0];\n\n      if (tfhd) {\n        var parsedTfhd = parseTfhd(tfhd);\n        trackId = parsedTfhd.trackId;\n      }\n\n      if (tfdt) {\n        var parsedTfdt = parseTfdt(tfdt);\n        baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;\n      }\n\n      if (trun) {\n        var parsedTrun = parseTrun(trun);\n\n        if (parsedTrun.samples && parsedTrun.samples.length) {\n          compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;\n        }\n      }\n    } // Get timescale for this specific track. Assume a 90kHz clock if no timescale was\n    // specified.\n\n\n    var timescale = timescales[trackId] || 90e3; // return the composition start time, in seconds\n\n    if (typeof baseMediaDecodeTime === 'bigint') {\n      compositionTimeOffset = window$1.BigInt(compositionTimeOffset);\n      timescale = window$1.BigInt(timescale);\n    }\n\n    var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale;\n\n    if (typeof result === 'bigint' && result < Number.MAX_SAFE_INTEGER) {\n      result = Number(result);\n    }\n\n    return result;\n  };\n  /**\n    * Find the trackIds of the video tracks in this source.\n    * Found by parsing the Handler Reference and Track Header Boxes:\n    *   moov > trak > mdia > hdlr\n    *   moov > trak > tkhd\n    *\n    * @param {Uint8Array} init - The bytes of the init segment for this source\n    * @return {Number[]} A list of trackIds\n    *\n    * @see ISO-BMFF-12/2015, Section 8.4.3\n   **/\n\n\n  getVideoTrackIds = function (init) {\n    var traks = findBox(init, ['moov', 'trak']);\n    var videoTrackIds = [];\n    traks.forEach(function (trak) {\n      var hdlrs = findBox(trak, ['mdia', 'hdlr']);\n      var tkhds = findBox(trak, ['tkhd']);\n      hdlrs.forEach(function (hdlr, index) {\n        var handlerType = parseType$1(hdlr.subarray(8, 12));\n        var tkhd = tkhds[index];\n        var view;\n        var version;\n        var trackId;\n\n        if (handlerType === 'vide') {\n          view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n          version = view.getUint8(0);\n          trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n          videoTrackIds.push(trackId);\n        }\n      });\n    });\n    return videoTrackIds;\n  };\n\n  getTimescaleFromMediaHeader = function (mdhd) {\n    // mdhd is a FullBox, meaning it will have its own version as the first byte\n    var version = mdhd[0];\n    var index = version === 0 ? 12 : 20;\n    return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n  };\n  /**\n   * Get all the video, audio, and hint tracks from a non fragmented\n   * mp4 segment\n   */\n\n\n  getTracks = function (init) {\n    var traks = findBox(init, ['moov', 'trak']);\n    var tracks = [];\n    traks.forEach(function (trak) {\n      var track = {};\n      var tkhd = findBox(trak, ['tkhd'])[0];\n      var view, tkhdVersion; // id\n\n      if (tkhd) {\n        view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n        tkhdVersion = view.getUint8(0);\n        track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n      }\n\n      var hdlr = findBox(trak, ['mdia', 'hdlr'])[0]; // type\n\n      if (hdlr) {\n        var type = parseType$1(hdlr.subarray(8, 12));\n\n        if (type === 'vide') {\n          track.type = 'video';\n        } else if (type === 'soun') {\n          track.type = 'audio';\n        } else {\n          track.type = type;\n        }\n      } // codec\n\n\n      var stsd = findBox(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n\n      if (stsd) {\n        var sampleDescriptions = stsd.subarray(8); // gives the codec type string\n\n        track.codec = parseType$1(sampleDescriptions.subarray(4, 8));\n        var codecBox = findBox(sampleDescriptions, [track.codec])[0];\n        var codecConfig, codecConfigType;\n\n        if (codecBox) {\n          // https://tools.ietf.org/html/rfc6381#section-3.3\n          if (/^[asm]vc[1-9]$/i.test(track.codec)) {\n            // we don't need anything but the \"config\" parameter of the\n            // avc1 codecBox\n            codecConfig = codecBox.subarray(78);\n            codecConfigType = parseType$1(codecConfig.subarray(4, 8));\n\n            if (codecConfigType === 'avcC' && codecConfig.length > 11) {\n              track.codec += '.'; // left padded with zeroes for single digit hex\n              // profile idc\n\n              track.codec += toHexString(codecConfig[9]); // the byte containing the constraint_set flags\n\n              track.codec += toHexString(codecConfig[10]); // level idc\n\n              track.codec += toHexString(codecConfig[11]);\n            } else {\n              // TODO: show a warning that we couldn't parse the codec\n              // and are using the default\n              track.codec = 'avc1.4d400d';\n            }\n          } else if (/^mp4[a,v]$/i.test(track.codec)) {\n            // we do not need anything but the streamDescriptor of the mp4a codecBox\n            codecConfig = codecBox.subarray(28);\n            codecConfigType = parseType$1(codecConfig.subarray(4, 8));\n\n            if (codecConfigType === 'esds' && codecConfig.length > 20 && codecConfig[19] !== 0) {\n              track.codec += '.' + toHexString(codecConfig[19]); // this value is only a single digit\n\n              track.codec += '.' + toHexString(codecConfig[20] >>> 2 & 0x3f).replace(/^0/, '');\n            } else {\n              // TODO: show a warning that we couldn't parse the codec\n              // and are using the default\n              track.codec = 'mp4a.40.2';\n            }\n          } else {\n            // flac, opus, etc\n            track.codec = track.codec.toLowerCase();\n          }\n        }\n      }\n\n      var mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n\n      if (mdhd) {\n        track.timescale = getTimescaleFromMediaHeader(mdhd);\n      }\n\n      tracks.push(track);\n    });\n    return tracks;\n  };\n  /**\n   * Returns an array of emsg ID3 data from the provided segmentData.\n   * An offset can also be provided as the Latest Arrival Time to calculate \n   * the Event Start Time of v0 EMSG boxes. \n   * See: https://dashif-documents.azurewebsites.net/Events/master/event.html#Inband-event-timing\n   * \n   * @param {Uint8Array} segmentData the segment byte array.\n   * @param {number} offset the segment start time or Latest Arrival Time, \n   * @return {Object[]} an array of ID3 parsed from EMSG boxes\n   */\n\n\n  getEmsgID3 = function (segmentData, offset = 0) {\n    var emsgBoxes = findBox(segmentData, ['emsg']);\n    return emsgBoxes.map(data => {\n      var parsedBox = emsg.parseEmsgBox(new Uint8Array(data));\n      var parsedId3Frames = parseId3Frames(parsedBox.message_data);\n      return {\n        cueTime: emsg.scaleTime(parsedBox.presentation_time, parsedBox.timescale, parsedBox.presentation_time_delta, offset),\n        duration: emsg.scaleTime(parsedBox.event_duration, parsedBox.timescale),\n        frames: parsedId3Frames\n      };\n    });\n  };\n\n  var probe$2 = {\n    // export mp4 inspector's findBox and parseType for backwards compatibility\n    findBox: findBox,\n    parseType: parseType$1,\n    timescale: timescale,\n    startTime: startTime,\n    compositionStartTime: compositionStartTime,\n    videoTrackIds: getVideoTrackIds,\n    tracks: getTracks,\n    getTimescaleFromMediaHeader: getTimescaleFromMediaHeader,\n    getEmsgID3: getEmsgID3\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Utilities to detect basic properties and metadata about TS Segments.\n   */\n\n  var StreamTypes$1 = streamTypes;\n\n  var parsePid = function (packet) {\n    var pid = packet[1] & 0x1f;\n    pid <<= 8;\n    pid |= packet[2];\n    return pid;\n  };\n\n  var parsePayloadUnitStartIndicator = function (packet) {\n    return !!(packet[1] & 0x40);\n  };\n\n  var parseAdaptionField = function (packet) {\n    var offset = 0; // if an adaption field is present, its length is specified by the\n    // fifth byte of the TS packet header. The adaptation field is\n    // used to add stuffing to PES packets that don't fill a complete\n    // TS packet, and to specify some forms of timing and control data\n    // that we do not currently use.\n\n    if ((packet[3] & 0x30) >>> 4 > 0x01) {\n      offset += packet[4] + 1;\n    }\n\n    return offset;\n  };\n\n  var parseType = function (packet, pmtPid) {\n    var pid = parsePid(packet);\n\n    if (pid === 0) {\n      return 'pat';\n    } else if (pid === pmtPid) {\n      return 'pmt';\n    } else if (pmtPid) {\n      return 'pes';\n    }\n\n    return null;\n  };\n\n  var parsePat = function (packet) {\n    var pusi = parsePayloadUnitStartIndicator(packet);\n    var offset = 4 + parseAdaptionField(packet);\n\n    if (pusi) {\n      offset += packet[offset] + 1;\n    }\n\n    return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n  };\n\n  var parsePmt = function (packet) {\n    var programMapTable = {};\n    var pusi = parsePayloadUnitStartIndicator(packet);\n    var payloadOffset = 4 + parseAdaptionField(packet);\n\n    if (pusi) {\n      payloadOffset += packet[payloadOffset] + 1;\n    } // PMTs can be sent ahead of the time when they should actually\n    // take effect. We don't believe this should ever be the case\n    // for HLS but we'll ignore \"forward\" PMT declarations if we see\n    // them. Future PMT declarations have the current_next_indicator\n    // set to zero.\n\n\n    if (!(packet[payloadOffset + 5] & 0x01)) {\n      return;\n    }\n\n    var sectionLength, tableEnd, programInfoLength; // the mapping table ends at the end of the current section\n\n    sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n    tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n    // long the program info descriptors are\n\n    programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11]; // advance the offset to the first entry in the mapping table\n\n    var offset = 12 + programInfoLength;\n\n    while (offset < tableEnd) {\n      var i = payloadOffset + offset; // add an entry that maps the elementary_pid to the stream_type\n\n      programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i]; // move to the next table entry\n      // skip past the elementary stream descriptors, if present\n\n      offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n    }\n\n    return programMapTable;\n  };\n\n  var parsePesType = function (packet, programMapTable) {\n    var pid = parsePid(packet);\n    var type = programMapTable[pid];\n\n    switch (type) {\n      case StreamTypes$1.H264_STREAM_TYPE:\n        return 'video';\n\n      case StreamTypes$1.ADTS_STREAM_TYPE:\n        return 'audio';\n\n      case StreamTypes$1.METADATA_STREAM_TYPE:\n        return 'timed-metadata';\n\n      default:\n        return null;\n    }\n  };\n\n  var parsePesTime = function (packet) {\n    var pusi = parsePayloadUnitStartIndicator(packet);\n\n    if (!pusi) {\n      return null;\n    }\n\n    var offset = 4 + parseAdaptionField(packet);\n\n    if (offset >= packet.byteLength) {\n      // From the H 222.0 MPEG-TS spec\n      // \"For transport stream packets carrying PES packets, stuffing is needed when there\n      //  is insufficient PES packet data to completely fill the transport stream packet\n      //  payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n      //  the sum of the lengths of the data elements in it, so that the payload bytes\n      //  remaining after the adaptation field exactly accommodates the available PES packet\n      //  data.\"\n      //\n      // If the offset is >= the length of the packet, then the packet contains no data\n      // and instead is just adaption field stuffing bytes\n      return null;\n    }\n\n    var pes = null;\n    var ptsDtsFlags; // PES packets may be annotated with a PTS value, or a PTS value\n    // and a DTS value. Determine what combination of values is\n    // available to work with.\n\n    ptsDtsFlags = packet[offset + 7]; // PTS and DTS are normally stored as a 33-bit number.  Javascript\n    // performs all bitwise operations on 32-bit integers but javascript\n    // supports a much greater range (52-bits) of integer using standard\n    // mathematical operations.\n    // We construct a 31-bit value using bitwise operators over the 31\n    // most significant bits and then multiply by 4 (equal to a left-shift\n    // of 2) before we add the final 2 least significant bits of the\n    // timestamp (equal to an OR.)\n\n    if (ptsDtsFlags & 0xC0) {\n      pes = {}; // the PTS and DTS are not written out directly. For information\n      // on how they are encoded, see\n      // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n\n      pes.pts = (packet[offset + 9] & 0x0E) << 27 | (packet[offset + 10] & 0xFF) << 20 | (packet[offset + 11] & 0xFE) << 12 | (packet[offset + 12] & 0xFF) << 5 | (packet[offset + 13] & 0xFE) >>> 3;\n      pes.pts *= 4; // Left shift by 2\n\n      pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n\n      pes.dts = pes.pts;\n\n      if (ptsDtsFlags & 0x40) {\n        pes.dts = (packet[offset + 14] & 0x0E) << 27 | (packet[offset + 15] & 0xFF) << 20 | (packet[offset + 16] & 0xFE) << 12 | (packet[offset + 17] & 0xFF) << 5 | (packet[offset + 18] & 0xFE) >>> 3;\n        pes.dts *= 4; // Left shift by 2\n\n        pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n      }\n    }\n\n    return pes;\n  };\n\n  var parseNalUnitType = function (type) {\n    switch (type) {\n      case 0x05:\n        return 'slice_layer_without_partitioning_rbsp_idr';\n\n      case 0x06:\n        return 'sei_rbsp';\n\n      case 0x07:\n        return 'seq_parameter_set_rbsp';\n\n      case 0x08:\n        return 'pic_parameter_set_rbsp';\n\n      case 0x09:\n        return 'access_unit_delimiter_rbsp';\n\n      default:\n        return null;\n    }\n  };\n\n  var videoPacketContainsKeyFrame = function (packet) {\n    var offset = 4 + parseAdaptionField(packet);\n    var frameBuffer = packet.subarray(offset);\n    var frameI = 0;\n    var frameSyncPoint = 0;\n    var foundKeyFrame = false;\n    var nalType; // advance the sync point to a NAL start, if necessary\n\n    for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n      if (frameBuffer[frameSyncPoint + 2] === 1) {\n        // the sync point is properly aligned\n        frameI = frameSyncPoint + 5;\n        break;\n      }\n    }\n\n    while (frameI < frameBuffer.byteLength) {\n      // look at the current byte to determine if we've hit the end of\n      // a NAL unit boundary\n      switch (frameBuffer[frameI]) {\n        case 0:\n          // skip past non-sync sequences\n          if (frameBuffer[frameI - 1] !== 0) {\n            frameI += 2;\n            break;\n          } else if (frameBuffer[frameI - 2] !== 0) {\n            frameI++;\n            break;\n          }\n\n          if (frameSyncPoint + 3 !== frameI - 2) {\n            nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n            if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n              foundKeyFrame = true;\n            }\n          } // drop trailing zeroes\n\n\n          do {\n            frameI++;\n          } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n\n          frameSyncPoint = frameI - 2;\n          frameI += 3;\n          break;\n\n        case 1:\n          // skip past non-sync sequences\n          if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {\n            frameI += 3;\n            break;\n          }\n\n          nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n          if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n            foundKeyFrame = true;\n          }\n\n          frameSyncPoint = frameI - 2;\n          frameI += 3;\n          break;\n\n        default:\n          // the current byte isn't a one or zero, so it cannot be part\n          // of a sync sequence\n          frameI += 3;\n          break;\n      }\n    }\n\n    frameBuffer = frameBuffer.subarray(frameSyncPoint);\n    frameI -= frameSyncPoint;\n    frameSyncPoint = 0; // parse the final nal\n\n    if (frameBuffer && frameBuffer.byteLength > 3) {\n      nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n      if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n        foundKeyFrame = true;\n      }\n    }\n\n    return foundKeyFrame;\n  };\n\n  var probe$1 = {\n    parseType: parseType,\n    parsePat: parsePat,\n    parsePmt: parsePmt,\n    parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n    parsePesType: parsePesType,\n    parsePesTime: parsePesTime,\n    videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n  };\n  /**\n   * mux.js\n   *\n   * Copyright (c) Brightcove\n   * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n   *\n   * Parse mpeg2 transport stream packets to extract basic timing information\n   */\n\n  var StreamTypes = streamTypes;\n  var handleRollover = timestampRolloverStream.handleRollover;\n  var probe = {};\n  probe.ts = probe$1;\n  probe.aac = utils;\n  var ONE_SECOND_IN_TS = clock$2.ONE_SECOND_IN_TS;\n  var MP2T_PACKET_LENGTH = 188,\n      // bytes\n  SYNC_BYTE = 0x47;\n  /**\n   * walks through segment data looking for pat and pmt packets to parse out\n   * program map table information\n   */\n\n  var parsePsi_ = function (bytes, pmt) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type;\n\n    while (endIndex < bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pat':\n            pmt.pid = probe.ts.parsePat(packet);\n            break;\n\n          case 'pmt':\n            var table = probe.ts.parsePmt(packet);\n            pmt.table = pmt.table || {};\n            Object.keys(table).forEach(function (key) {\n              pmt.table[key] = table[key];\n            });\n            break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    }\n  };\n  /**\n   * walks through the segment data from the start and end to get timing information\n   * for the first and last audio pes packets\n   */\n\n\n  var parseAudioPes_ = function (bytes, pmt, result) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type,\n        pesType,\n        pusi,\n        parsed;\n    var endLoop = false; // Start walking from start of segment to get first audio packet\n\n    while (endIndex <= bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'audio' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'audio';\n                result.audio.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    } // Start walking from end of segment to get last audio packet\n\n\n    endIndex = bytes.byteLength;\n    startIndex = endIndex - MP2T_PACKET_LENGTH;\n    endLoop = false;\n\n    while (startIndex >= 0) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'audio' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'audio';\n                result.audio.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex -= MP2T_PACKET_LENGTH;\n        endIndex -= MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex--;\n      endIndex--;\n    }\n  };\n  /**\n   * walks through the segment data from the start and end to get timing information\n   * for the first and last video pes packets as well as timing information for the first\n   * key frame.\n   */\n\n\n  var parseVideoPes_ = function (bytes, pmt, result) {\n    var startIndex = 0,\n        endIndex = MP2T_PACKET_LENGTH,\n        packet,\n        type,\n        pesType,\n        pusi,\n        parsed,\n        frame,\n        i,\n        pes;\n    var endLoop = false;\n    var currentFrame = {\n      data: [],\n      size: 0\n    }; // Start walking from start of segment to get first video packet\n\n    while (endIndex < bytes.byteLength) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'video') {\n              if (pusi && !endLoop) {\n                parsed = probe.ts.parsePesTime(packet);\n\n                if (parsed) {\n                  parsed.type = 'video';\n                  result.video.push(parsed);\n                  endLoop = true;\n                }\n              }\n\n              if (!result.firstKeyFrame) {\n                if (pusi) {\n                  if (currentFrame.size !== 0) {\n                    frame = new Uint8Array(currentFrame.size);\n                    i = 0;\n\n                    while (currentFrame.data.length) {\n                      pes = currentFrame.data.shift();\n                      frame.set(pes, i);\n                      i += pes.byteLength;\n                    }\n\n                    if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n                      var firstKeyFrame = probe.ts.parsePesTime(frame); // PTS/DTS may not be available. Simply *not* setting\n                      // the keyframe seems to work fine with HLS playback\n                      // and definitely preferable to a crash with TypeError...\n\n                      if (firstKeyFrame) {\n                        result.firstKeyFrame = firstKeyFrame;\n                        result.firstKeyFrame.type = 'video';\n                      } else {\n                        // eslint-disable-next-line\n                        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.');\n                      }\n                    }\n\n                    currentFrame.size = 0;\n                  }\n                }\n\n                currentFrame.data.push(packet);\n                currentFrame.size += packet.byteLength;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop && result.firstKeyFrame) {\n          break;\n        }\n\n        startIndex += MP2T_PACKET_LENGTH;\n        endIndex += MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex++;\n      endIndex++;\n    } // Start walking from end of segment to get last video packet\n\n\n    endIndex = bytes.byteLength;\n    startIndex = endIndex - MP2T_PACKET_LENGTH;\n    endLoop = false;\n\n    while (startIndex >= 0) {\n      // Look for a pair of start and end sync bytes in the data..\n      if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n        // We found a packet\n        packet = bytes.subarray(startIndex, endIndex);\n        type = probe.ts.parseType(packet, pmt.pid);\n\n        switch (type) {\n          case 'pes':\n            pesType = probe.ts.parsePesType(packet, pmt.table);\n            pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n            if (pesType === 'video' && pusi) {\n              parsed = probe.ts.parsePesTime(packet);\n\n              if (parsed) {\n                parsed.type = 'video';\n                result.video.push(parsed);\n                endLoop = true;\n              }\n            }\n\n            break;\n        }\n\n        if (endLoop) {\n          break;\n        }\n\n        startIndex -= MP2T_PACKET_LENGTH;\n        endIndex -= MP2T_PACKET_LENGTH;\n        continue;\n      } // If we get here, we have somehow become de-synchronized and we need to step\n      // forward one byte at a time until we find a pair of sync bytes that denote\n      // a packet\n\n\n      startIndex--;\n      endIndex--;\n    }\n  };\n  /**\n   * Adjusts the timestamp information for the segment to account for\n   * rollover and convert to seconds based on pes packet timescale (90khz clock)\n   */\n\n\n  var adjustTimestamp_ = function (segmentInfo, baseTimestamp) {\n    if (segmentInfo.audio && segmentInfo.audio.length) {\n      var audioBaseTimestamp = baseTimestamp;\n\n      if (typeof audioBaseTimestamp === 'undefined' || isNaN(audioBaseTimestamp)) {\n        audioBaseTimestamp = segmentInfo.audio[0].dts;\n      }\n\n      segmentInfo.audio.forEach(function (info) {\n        info.dts = handleRollover(info.dts, audioBaseTimestamp);\n        info.pts = handleRollover(info.pts, audioBaseTimestamp); // time in seconds\n\n        info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n        info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n      });\n    }\n\n    if (segmentInfo.video && segmentInfo.video.length) {\n      var videoBaseTimestamp = baseTimestamp;\n\n      if (typeof videoBaseTimestamp === 'undefined' || isNaN(videoBaseTimestamp)) {\n        videoBaseTimestamp = segmentInfo.video[0].dts;\n      }\n\n      segmentInfo.video.forEach(function (info) {\n        info.dts = handleRollover(info.dts, videoBaseTimestamp);\n        info.pts = handleRollover(info.pts, videoBaseTimestamp); // time in seconds\n\n        info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n        info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n      });\n\n      if (segmentInfo.firstKeyFrame) {\n        var frame = segmentInfo.firstKeyFrame;\n        frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n        frame.pts = handleRollover(frame.pts, videoBaseTimestamp); // time in seconds\n\n        frame.dtsTime = frame.dts / ONE_SECOND_IN_TS;\n        frame.ptsTime = frame.pts / ONE_SECOND_IN_TS;\n      }\n    }\n  };\n  /**\n   * inspects the aac data stream for start and end time information\n   */\n\n\n  var inspectAac_ = function (bytes) {\n    var endLoop = false,\n        audioCount = 0,\n        sampleRate = null,\n        timestamp = null,\n        frameSize = 0,\n        byteIndex = 0,\n        packet;\n\n    while (bytes.length - byteIndex >= 3) {\n      var type = probe.aac.parseType(bytes, byteIndex);\n\n      switch (type) {\n        case 'timed-metadata':\n          // Exit early because we don't have enough to parse\n          // the ID3 tag header\n          if (bytes.length - byteIndex < 10) {\n            endLoop = true;\n            break;\n          }\n\n          frameSize = probe.aac.parseId3TagSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (frameSize > bytes.length) {\n            endLoop = true;\n            break;\n          }\n\n          if (timestamp === null) {\n            packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n            timestamp = probe.aac.parseAacTimestamp(packet);\n          }\n\n          byteIndex += frameSize;\n          break;\n\n        case 'audio':\n          // Exit early because we don't have enough to parse\n          // the ADTS frame header\n          if (bytes.length - byteIndex < 7) {\n            endLoop = true;\n            break;\n          }\n\n          frameSize = probe.aac.parseAdtsSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n          // to emit a full packet\n\n          if (frameSize > bytes.length) {\n            endLoop = true;\n            break;\n          }\n\n          if (sampleRate === null) {\n            packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n            sampleRate = probe.aac.parseSampleRate(packet);\n          }\n\n          audioCount++;\n          byteIndex += frameSize;\n          break;\n\n        default:\n          byteIndex++;\n          break;\n      }\n\n      if (endLoop) {\n        return null;\n      }\n    }\n\n    if (sampleRate === null || timestamp === null) {\n      return null;\n    }\n\n    var audioTimescale = ONE_SECOND_IN_TS / sampleRate;\n    var result = {\n      audio: [{\n        type: 'audio',\n        dts: timestamp,\n        pts: timestamp\n      }, {\n        type: 'audio',\n        dts: timestamp + audioCount * 1024 * audioTimescale,\n        pts: timestamp + audioCount * 1024 * audioTimescale\n      }]\n    };\n    return result;\n  };\n  /**\n   * inspects the transport stream segment data for start and end time information\n   * of the audio and video tracks (when present) as well as the first key frame's\n   * start time.\n   */\n\n\n  var inspectTs_ = function (bytes) {\n    var pmt = {\n      pid: null,\n      table: null\n    };\n    var result = {};\n    parsePsi_(bytes, pmt);\n\n    for (var pid in pmt.table) {\n      if (pmt.table.hasOwnProperty(pid)) {\n        var type = pmt.table[pid];\n\n        switch (type) {\n          case StreamTypes.H264_STREAM_TYPE:\n            result.video = [];\n            parseVideoPes_(bytes, pmt, result);\n\n            if (result.video.length === 0) {\n              delete result.video;\n            }\n\n            break;\n\n          case StreamTypes.ADTS_STREAM_TYPE:\n            result.audio = [];\n            parseAudioPes_(bytes, pmt, result);\n\n            if (result.audio.length === 0) {\n              delete result.audio;\n            }\n\n            break;\n        }\n      }\n    }\n\n    return result;\n  };\n  /**\n   * Inspects segment byte data and returns an object with start and end timing information\n   *\n   * @param {Uint8Array} bytes The segment byte data\n   * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n   *  timestamps for rollover. This value must be in 90khz clock.\n   * @return {Object} Object containing start and end frame timing info of segment.\n   */\n\n\n  var inspect = function (bytes, baseTimestamp) {\n    var isAacData = probe.aac.isLikelyAacData(bytes);\n    var result;\n\n    if (isAacData) {\n      result = inspectAac_(bytes);\n    } else {\n      result = inspectTs_(bytes);\n    }\n\n    if (!result || !result.audio && !result.video) {\n      return null;\n    }\n\n    adjustTimestamp_(result, baseTimestamp);\n    return result;\n  };\n\n  var tsInspector = {\n    inspect: inspect,\n    parseAudioPes_: parseAudioPes_\n  };\n  /* global self */\n\n  /**\n   * Re-emits transmuxer events by converting them into messages to the\n   * world outside the worker.\n   *\n   * @param {Object} transmuxer the transmuxer to wire events on\n   * @private\n   */\n\n  const wireTransmuxerEvents = function (self, transmuxer) {\n    transmuxer.on('data', function (segment) {\n      // transfer ownership of the underlying ArrayBuffer\n      // instead of doing a copy to save memory\n      // ArrayBuffers are transferable but generic TypedArrays are not\n      // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n      const initArray = segment.initSegment;\n      segment.initSegment = {\n        data: initArray.buffer,\n        byteOffset: initArray.byteOffset,\n        byteLength: initArray.byteLength\n      };\n      const typedArray = segment.data;\n      segment.data = typedArray.buffer;\n      self.postMessage({\n        action: 'data',\n        segment,\n        byteOffset: typedArray.byteOffset,\n        byteLength: typedArray.byteLength\n      }, [segment.data]);\n    });\n    transmuxer.on('done', function (data) {\n      self.postMessage({\n        action: 'done'\n      });\n    });\n    transmuxer.on('gopInfo', function (gopInfo) {\n      self.postMessage({\n        action: 'gopInfo',\n        gopInfo\n      });\n    });\n    transmuxer.on('videoSegmentTimingInfo', function (timingInfo) {\n      const videoSegmentTimingInfo = {\n        start: {\n          decode: clock$2.videoTsToSeconds(timingInfo.start.dts),\n          presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)\n        },\n        end: {\n          decode: clock$2.videoTsToSeconds(timingInfo.end.dts),\n          presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)\n        },\n        baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n      };\n\n      if (timingInfo.prependedContentDuration) {\n        videoSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);\n      }\n\n      self.postMessage({\n        action: 'videoSegmentTimingInfo',\n        videoSegmentTimingInfo\n      });\n    });\n    transmuxer.on('audioSegmentTimingInfo', function (timingInfo) {\n      // Note that all times for [audio/video]SegmentTimingInfo events are in video clock\n      const audioSegmentTimingInfo = {\n        start: {\n          decode: clock$2.videoTsToSeconds(timingInfo.start.dts),\n          presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)\n        },\n        end: {\n          decode: clock$2.videoTsToSeconds(timingInfo.end.dts),\n          presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)\n        },\n        baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n      };\n\n      if (timingInfo.prependedContentDuration) {\n        audioSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);\n      }\n\n      self.postMessage({\n        action: 'audioSegmentTimingInfo',\n        audioSegmentTimingInfo\n      });\n    });\n    transmuxer.on('id3Frame', function (id3Frame) {\n      self.postMessage({\n        action: 'id3Frame',\n        id3Frame\n      });\n    });\n    transmuxer.on('caption', function (caption) {\n      self.postMessage({\n        action: 'caption',\n        caption\n      });\n    });\n    transmuxer.on('trackinfo', function (trackInfo) {\n      self.postMessage({\n        action: 'trackinfo',\n        trackInfo\n      });\n    });\n    transmuxer.on('audioTimingInfo', function (audioTimingInfo) {\n      // convert to video TS since we prioritize video time over audio\n      self.postMessage({\n        action: 'audioTimingInfo',\n        audioTimingInfo: {\n          start: clock$2.videoTsToSeconds(audioTimingInfo.start),\n          end: clock$2.videoTsToSeconds(audioTimingInfo.end)\n        }\n      });\n    });\n    transmuxer.on('videoTimingInfo', function (videoTimingInfo) {\n      self.postMessage({\n        action: 'videoTimingInfo',\n        videoTimingInfo: {\n          start: clock$2.videoTsToSeconds(videoTimingInfo.start),\n          end: clock$2.videoTsToSeconds(videoTimingInfo.end)\n        }\n      });\n    });\n    transmuxer.on('log', function (log) {\n      self.postMessage({\n        action: 'log',\n        log\n      });\n    });\n  };\n  /**\n   * All incoming messages route through this hash. If no function exists\n   * to handle an incoming message, then we ignore the message.\n   *\n   * @class MessageHandlers\n   * @param {Object} options the options to initialize with\n   */\n\n\n  class MessageHandlers {\n    constructor(self, options) {\n      this.options = options || {};\n      this.self = self;\n      this.init();\n    }\n    /**\n     * initialize our web worker and wire all the events.\n     */\n\n\n    init() {\n      if (this.transmuxer) {\n        this.transmuxer.dispose();\n      }\n\n      this.transmuxer = new transmuxer.Transmuxer(this.options);\n      wireTransmuxerEvents(this.self, this.transmuxer);\n    }\n\n    pushMp4Captions(data) {\n      if (!this.captionParser) {\n        this.captionParser = new captionParser();\n        this.captionParser.init();\n      }\n\n      const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n      const parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);\n      this.self.postMessage({\n        action: 'mp4Captions',\n        captions: parsed && parsed.captions || [],\n        logs: parsed && parsed.logs || [],\n        data: segment.buffer\n      }, [segment.buffer]);\n    }\n\n    probeMp4StartTime({\n      timescales,\n      data\n    }) {\n      const startTime = probe$2.startTime(timescales, data);\n      this.self.postMessage({\n        action: 'probeMp4StartTime',\n        startTime,\n        data\n      }, [data.buffer]);\n    }\n\n    probeMp4Tracks({\n      data\n    }) {\n      const tracks = probe$2.tracks(data);\n      this.self.postMessage({\n        action: 'probeMp4Tracks',\n        tracks,\n        data\n      }, [data.buffer]);\n    }\n    /**\n     * Probes an mp4 segment for EMSG boxes containing ID3 data.\n     * https://aomediacodec.github.io/id3-emsg/\n     *\n     * @param {Uint8Array} data segment data\n     * @param {number} offset segment start time\n     * @return {Object[]} an array of ID3 frames\n     */\n\n\n    probeEmsgID3({\n      data,\n      offset\n    }) {\n      const id3Frames = probe$2.getEmsgID3(data, offset);\n      this.self.postMessage({\n        action: 'probeEmsgID3',\n        id3Frames,\n        emsgData: data\n      }, [data.buffer]);\n    }\n    /**\n     * Probe an mpeg2-ts segment to determine the start time of the segment in it's\n     * internal \"media time,\" as well as whether it contains video and/or audio.\n     *\n     * @private\n     * @param {Uint8Array} bytes - segment bytes\n     * @param {number} baseStartTime\n     *        Relative reference timestamp used when adjusting frame timestamps for rollover.\n     *        This value should be in seconds, as it's converted to a 90khz clock within the\n     *        function body.\n     * @return {Object} The start time of the current segment in \"media time\" as well as\n     *                  whether it contains video and/or audio\n     */\n\n\n    probeTs({\n      data,\n      baseStartTime\n    }) {\n      const tsStartTime = typeof baseStartTime === 'number' && !isNaN(baseStartTime) ? baseStartTime * clock$2.ONE_SECOND_IN_TS : void 0;\n      const timeInfo = tsInspector.inspect(data, tsStartTime);\n      let result = null;\n\n      if (timeInfo) {\n        result = {\n          // each type's time info comes back as an array of 2 times, start and end\n          hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,\n          hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false\n        };\n\n        if (result.hasVideo) {\n          result.videoStart = timeInfo.video[0].ptsTime;\n        }\n\n        if (result.hasAudio) {\n          result.audioStart = timeInfo.audio[0].ptsTime;\n        }\n      }\n\n      this.self.postMessage({\n        action: 'probeTs',\n        result,\n        data\n      }, [data.buffer]);\n    }\n\n    clearAllMp4Captions() {\n      if (this.captionParser) {\n        this.captionParser.clearAllCaptions();\n      }\n    }\n\n    clearParsedMp4Captions() {\n      if (this.captionParser) {\n        this.captionParser.clearParsedCaptions();\n      }\n    }\n    /**\n     * Adds data (a ts segment) to the start of the transmuxer pipeline for\n     * processing.\n     *\n     * @param {ArrayBuffer} data data to push into the muxer\n     */\n\n\n    push(data) {\n      // Cast array buffer to correct type for transmuxer\n      const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n      this.transmuxer.push(segment);\n    }\n    /**\n     * Recreate the transmuxer so that the next segment added via `push`\n     * start with a fresh transmuxer.\n     */\n\n\n    reset() {\n      this.transmuxer.reset();\n    }\n    /**\n     * Set the value that will be used as the `baseMediaDecodeTime` time for the\n     * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n     * set relative to the first based on the PTS values.\n     *\n     * @param {Object} data used to set the timestamp offset in the muxer\n     */\n\n\n    setTimestampOffset(data) {\n      const timestampOffset = data.timestampOffset || 0;\n      this.transmuxer.setBaseMediaDecodeTime(Math.round(clock$2.secondsToVideoTs(timestampOffset)));\n    }\n\n    setAudioAppendStart(data) {\n      this.transmuxer.setAudioAppendStart(Math.ceil(clock$2.secondsToVideoTs(data.appendStart)));\n    }\n\n    setRemux(data) {\n      this.transmuxer.setRemux(data.remux);\n    }\n    /**\n     * Forces the pipeline to finish processing the last segment and emit it's\n     * results.\n     *\n     * @param {Object} data event data, not really used\n     */\n\n\n    flush(data) {\n      this.transmuxer.flush(); // transmuxed done action is fired after both audio/video pipelines are flushed\n\n      self.postMessage({\n        action: 'done',\n        type: 'transmuxed'\n      });\n    }\n\n    endTimeline() {\n      this.transmuxer.endTimeline(); // transmuxed endedtimeline action is fired after both audio/video pipelines end their\n      // timelines\n\n      self.postMessage({\n        action: 'endedtimeline',\n        type: 'transmuxed'\n      });\n    }\n\n    alignGopsWith(data) {\n      this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n    }\n\n  }\n  /**\n   * Our web worker interface so that things can talk to mux.js\n   * that will be running in a web worker. the scope is passed to this by\n   * webworkify.\n   *\n   * @param {Object} self the scope for the web worker\n   */\n\n\n  self.onmessage = function (event) {\n    if (event.data.action === 'init' && event.data.options) {\n      this.messageHandlers = new MessageHandlers(self, event.data.options);\n      return;\n    }\n\n    if (!this.messageHandlers) {\n      this.messageHandlers = new MessageHandlers(self);\n    }\n\n    if (event.data && event.data.action && event.data.action !== 'init') {\n      if (this.messageHandlers[event.data.action]) {\n        this.messageHandlers[event.data.action](event.data);\n      }\n    }\n  };\n}));\nvar TransmuxWorker = factory(workerCode$1);\n/* rollup-plugin-worker-factory end for worker!/home/runner/work/http-streaming/http-streaming/src/transmuxer-worker.js */\n\nconst handleData_ = (event, transmuxedData, callback) => {\n  const {\n    type,\n    initSegment,\n    captions,\n    captionStreams,\n    metadata,\n    videoFrameDtsTime,\n    videoFramePtsTime\n  } = event.data.segment;\n  transmuxedData.buffer.push({\n    captions,\n    captionStreams,\n    metadata\n  });\n  const boxes = event.data.segment.boxes || {\n    data: event.data.segment.data\n  };\n  const result = {\n    type,\n    // cast ArrayBuffer to TypedArray\n    data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),\n    initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)\n  };\n\n  if (typeof videoFrameDtsTime !== 'undefined') {\n    result.videoFrameDtsTime = videoFrameDtsTime;\n  }\n\n  if (typeof videoFramePtsTime !== 'undefined') {\n    result.videoFramePtsTime = videoFramePtsTime;\n  }\n\n  callback(result);\n};\nconst handleDone_ = ({\n  transmuxedData,\n  callback\n}) => {\n  // Previously we only returned data on data events,\n  // not on done events. Clear out the buffer to keep that consistent.\n  transmuxedData.buffer = []; // all buffers should have been flushed from the muxer, so start processing anything we\n  // have received\n\n  callback(transmuxedData);\n};\nconst handleGopInfo_ = (event, transmuxedData) => {\n  transmuxedData.gopInfo = event.data.gopInfo;\n};\nconst processTransmux = options => {\n  const {\n    transmuxer,\n    bytes,\n    audioAppendStart,\n    gopsToAlignWith,\n    remux,\n    onData,\n    onTrackInfo,\n    onAudioTimingInfo,\n    onVideoTimingInfo,\n    onVideoSegmentTimingInfo,\n    onAudioSegmentTimingInfo,\n    onId3,\n    onCaptions,\n    onDone,\n    onEndedTimeline,\n    onTransmuxerLog,\n    isEndOfTimeline\n  } = options;\n  const transmuxedData = {\n    buffer: []\n  };\n  let waitForEndedTimelineEvent = isEndOfTimeline;\n\n  const handleMessage = event => {\n    if (transmuxer.currentTransmux !== options) {\n      // disposed\n      return;\n    }\n\n    if (event.data.action === 'data') {\n      handleData_(event, transmuxedData, onData);\n    }\n\n    if (event.data.action === 'trackinfo') {\n      onTrackInfo(event.data.trackInfo);\n    }\n\n    if (event.data.action === 'gopInfo') {\n      handleGopInfo_(event, transmuxedData);\n    }\n\n    if (event.data.action === 'audioTimingInfo') {\n      onAudioTimingInfo(event.data.audioTimingInfo);\n    }\n\n    if (event.data.action === 'videoTimingInfo') {\n      onVideoTimingInfo(event.data.videoTimingInfo);\n    }\n\n    if (event.data.action === 'videoSegmentTimingInfo') {\n      onVideoSegmentTimingInfo(event.data.videoSegmentTimingInfo);\n    }\n\n    if (event.data.action === 'audioSegmentTimingInfo') {\n      onAudioSegmentTimingInfo(event.data.audioSegmentTimingInfo);\n    }\n\n    if (event.data.action === 'id3Frame') {\n      onId3([event.data.id3Frame], event.data.id3Frame.dispatchType);\n    }\n\n    if (event.data.action === 'caption') {\n      onCaptions(event.data.caption);\n    }\n\n    if (event.data.action === 'endedtimeline') {\n      waitForEndedTimelineEvent = false;\n      onEndedTimeline();\n    }\n\n    if (event.data.action === 'log') {\n      onTransmuxerLog(event.data.log);\n    } // wait for the transmuxed event since we may have audio and video\n\n\n    if (event.data.type !== 'transmuxed') {\n      return;\n    } // If the \"endedtimeline\" event has not yet fired, and this segment represents the end\n    // of a timeline, that means there may still be data events before the segment\n    // processing can be considerred complete. In that case, the final event should be\n    // an \"endedtimeline\" event with the type \"transmuxed.\"\n\n\n    if (waitForEndedTimelineEvent) {\n      return;\n    }\n\n    transmuxer.onmessage = null;\n    handleDone_({\n      transmuxedData,\n      callback: onDone\n    });\n    /* eslint-disable no-use-before-define */\n\n    dequeue(transmuxer);\n    /* eslint-enable */\n  };\n\n  transmuxer.onmessage = handleMessage;\n\n  if (audioAppendStart) {\n    transmuxer.postMessage({\n      action: 'setAudioAppendStart',\n      appendStart: audioAppendStart\n    });\n  } // allow empty arrays to be passed to clear out GOPs\n\n\n  if (Array.isArray(gopsToAlignWith)) {\n    transmuxer.postMessage({\n      action: 'alignGopsWith',\n      gopsToAlignWith\n    });\n  }\n\n  if (typeof remux !== 'undefined') {\n    transmuxer.postMessage({\n      action: 'setRemux',\n      remux\n    });\n  }\n\n  if (bytes.byteLength) {\n    const buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;\n    const byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;\n    transmuxer.postMessage({\n      action: 'push',\n      // Send the typed-array of data as an ArrayBuffer so that\n      // it can be sent as a \"Transferable\" and avoid the costly\n      // memory copy\n      data: buffer,\n      // To recreate the original typed-array, we need information\n      // about what portion of the ArrayBuffer it was a view into\n      byteOffset,\n      byteLength: bytes.byteLength\n    }, [buffer]);\n  }\n\n  if (isEndOfTimeline) {\n    transmuxer.postMessage({\n      action: 'endTimeline'\n    });\n  } // even if we didn't push any bytes, we have to make sure we flush in case we reached\n  // the end of the segment\n\n\n  transmuxer.postMessage({\n    action: 'flush'\n  });\n};\nconst dequeue = transmuxer => {\n  transmuxer.currentTransmux = null;\n\n  if (transmuxer.transmuxQueue.length) {\n    transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();\n\n    if (typeof transmuxer.currentTransmux === 'function') {\n      transmuxer.currentTransmux();\n    } else {\n      processTransmux(transmuxer.currentTransmux);\n    }\n  }\n};\nconst processAction = (transmuxer, action) => {\n  transmuxer.postMessage({\n    action\n  });\n  dequeue(transmuxer);\n};\nconst enqueueAction = (action, transmuxer) => {\n  if (!transmuxer.currentTransmux) {\n    transmuxer.currentTransmux = action;\n    processAction(transmuxer, action);\n    return;\n  }\n\n  transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));\n};\nconst reset = transmuxer => {\n  enqueueAction('reset', transmuxer);\n};\nconst endTimeline = transmuxer => {\n  enqueueAction('endTimeline', transmuxer);\n};\nconst transmux = options => {\n  if (!options.transmuxer.currentTransmux) {\n    options.transmuxer.currentTransmux = options;\n    processTransmux(options);\n    return;\n  }\n\n  options.transmuxer.transmuxQueue.push(options);\n};\nconst createTransmuxer = options => {\n  const transmuxer = new TransmuxWorker();\n  transmuxer.currentTransmux = null;\n  transmuxer.transmuxQueue = [];\n  const term = transmuxer.terminate;\n\n  transmuxer.terminate = () => {\n    transmuxer.currentTransmux = null;\n    transmuxer.transmuxQueue.length = 0;\n    return term.call(transmuxer);\n  };\n\n  transmuxer.postMessage({\n    action: 'init',\n    options\n  });\n  return transmuxer;\n};\nvar segmentTransmuxer = {\n  reset,\n  endTimeline,\n  transmux,\n  createTransmuxer\n};\n\nconst workerCallback = function (options) {\n  const transmuxer = options.transmuxer;\n  const endAction = options.endAction || options.action;\n  const callback = options.callback;\n\n  const message = _extends({}, options, {\n    endAction: null,\n    transmuxer: null,\n    callback: null\n  });\n\n  const listenForEndEvent = event => {\n    if (event.data.action !== endAction) {\n      return;\n    }\n\n    transmuxer.removeEventListener('message', listenForEndEvent); // transfer ownership of bytes back to us.\n\n    if (event.data.data) {\n      event.data.data = new Uint8Array(event.data.data, options.byteOffset || 0, options.byteLength || event.data.data.byteLength);\n\n      if (options.data) {\n        options.data = event.data.data;\n      }\n    }\n\n    callback(event.data);\n  };\n\n  transmuxer.addEventListener('message', listenForEndEvent);\n\n  if (options.data) {\n    const isArrayBuffer = options.data instanceof ArrayBuffer;\n    message.byteOffset = isArrayBuffer ? 0 : options.data.byteOffset;\n    message.byteLength = options.data.byteLength;\n    const transfers = [isArrayBuffer ? options.data : options.data.buffer];\n    transmuxer.postMessage(message, transfers);\n  } else {\n    transmuxer.postMessage(message);\n  }\n};\n\nconst REQUEST_ERRORS = {\n  FAILURE: 2,\n  TIMEOUT: -101,\n  ABORTED: -102\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\nconst abortAll = activeXhrs => {\n  activeXhrs.forEach(xhr => {\n    xhr.abort();\n  });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\n\nconst getRequestStats = request => {\n  return {\n    bandwidth: request.bandwidth,\n    bytesReceived: request.bytesReceived || 0,\n    roundTripTime: request.roundTripTime || 0\n  };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\n\nconst getProgressStats = progressEvent => {\n  const request = progressEvent.target;\n  const roundTripTime = Date.now() - request.requestTime;\n  const stats = {\n    bandwidth: Infinity,\n    bytesReceived: 0,\n    roundTripTime: roundTripTime || 0\n  };\n  stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n  // because we should only use bandwidth stats on progress to determine when\n  // abort a request early due to insufficient bandwidth\n\n  stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n  return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request -  the XHR request that possibly generated the error\n */\n\n\nconst handleErrors = (error, request) => {\n  if (request.timedout) {\n    return {\n      status: request.status,\n      message: 'HLS request timed-out at URL: ' + request.uri,\n      code: REQUEST_ERRORS.TIMEOUT,\n      xhr: request\n    };\n  }\n\n  if (request.aborted) {\n    return {\n      status: request.status,\n      message: 'HLS request aborted at URL: ' + request.uri,\n      code: REQUEST_ERRORS.ABORTED,\n      xhr: request\n    };\n  }\n\n  if (error) {\n    return {\n      status: request.status,\n      message: 'HLS request errored at URL: ' + request.uri,\n      code: REQUEST_ERRORS.FAILURE,\n      xhr: request\n    };\n  }\n\n  if (request.responseType === 'arraybuffer' && request.response.byteLength === 0) {\n    return {\n      status: request.status,\n      message: 'Empty HLS response at URL: ' + request.uri,\n      code: REQUEST_ERRORS.FAILURE,\n      xhr: request\n    };\n  }\n\n  return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Array} objects - objects to add the key bytes to.\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nconst handleKeyResponse = (segment, objects, finishProcessingFn) => (error, request) => {\n  const response = request.response;\n  const errorObj = handleErrors(error, request);\n\n  if (errorObj) {\n    return finishProcessingFn(errorObj, segment);\n  }\n\n  if (response.byteLength !== 16) {\n    return finishProcessingFn({\n      status: request.status,\n      message: 'Invalid HLS key at URL: ' + request.uri,\n      code: REQUEST_ERRORS.FAILURE,\n      xhr: request\n    }, segment);\n  }\n\n  const view = new DataView(response);\n  const bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\n  for (let i = 0; i < objects.length; i++) {\n    objects[i].bytes = bytes;\n  }\n\n  return finishProcessingFn(null, segment);\n};\n\nconst parseInitSegment = (segment, callback) => {\n  const type = detectContainerForBytes(segment.map.bytes); // TODO: We should also handle ts init segments here, but we\n  // only know how to parse mp4 init segments at the moment\n\n  if (type !== 'mp4') {\n    const uri = segment.map.resolvedUri || segment.map.uri;\n    return callback({\n      internal: true,\n      message: `Found unsupported ${type || 'unknown'} container for initialization segment at URL: ${uri}`,\n      code: REQUEST_ERRORS.FAILURE\n    });\n  }\n\n  workerCallback({\n    action: 'probeMp4Tracks',\n    data: segment.map.bytes,\n    transmuxer: segment.transmuxer,\n    callback: ({\n      tracks,\n      data\n    }) => {\n      // transfer bytes back to us\n      segment.map.bytes = data;\n      tracks.forEach(function (track) {\n        segment.map.tracks = segment.map.tracks || {}; // only support one track of each type for now\n\n        if (segment.map.tracks[track.type]) {\n          return;\n        }\n\n        segment.map.tracks[track.type] = track;\n\n        if (typeof track.id === 'number' && track.timescale) {\n          segment.map.timescales = segment.map.timescales || {};\n          segment.map.timescales[track.id] = track.timescale;\n        }\n      });\n      return callback(null);\n    }\n  });\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nconst handleInitSegmentResponse = ({\n  segment,\n  finishProcessingFn\n}) => (error, request) => {\n  const errorObj = handleErrors(error, request);\n\n  if (errorObj) {\n    return finishProcessingFn(errorObj, segment);\n  }\n\n  const bytes = new Uint8Array(request.response); // init segment is encypted, we will have to wait\n  // until the key request is done to decrypt.\n\n  if (segment.map.key) {\n    segment.map.encryptedBytes = bytes;\n    return finishProcessingFn(null, segment);\n  }\n\n  segment.map.bytes = bytes;\n  parseInitSegment(segment, function (parseError) {\n    if (parseError) {\n      parseError.xhr = request;\n      parseError.status = request.status;\n      return finishProcessingFn(parseError, segment);\n    }\n\n    finishProcessingFn(null, segment);\n  });\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n *                                        this request\n */\n\n\nconst handleSegmentResponse = ({\n  segment,\n  finishProcessingFn,\n  responseType\n}) => (error, request) => {\n  const errorObj = handleErrors(error, request);\n\n  if (errorObj) {\n    return finishProcessingFn(errorObj, segment);\n  }\n\n  const newBytes = // although responseText \"should\" exist, this guard serves to prevent an error being\n  // thrown for two primary cases:\n  // 1. the mime type override stops working, or is not implemented for a specific\n  //    browser\n  // 2. when using mock XHR libraries like sinon that do not allow the override behavior\n  responseType === 'arraybuffer' || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));\n  segment.stats = getRequestStats(request);\n\n  if (segment.key) {\n    segment.encryptedBytes = new Uint8Array(newBytes);\n  } else {\n    segment.bytes = new Uint8Array(newBytes);\n  }\n\n  return finishProcessingFn(null, segment);\n};\n\nconst transmuxAndNotify = ({\n  segment,\n  bytes,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn,\n  doneFn,\n  onTransmuxerLog\n}) => {\n  const fmp4Tracks = segment.map && segment.map.tracks || {};\n  const isMuxed = Boolean(fmp4Tracks.audio && fmp4Tracks.video); // Keep references to each function so we can null them out after we're done with them.\n  // One reason for this is that in the case of full segments, we want to trust start\n  // times from the probe, rather than the transmuxer.\n\n  let audioStartFn = timingInfoFn.bind(null, segment, 'audio', 'start');\n  const audioEndFn = timingInfoFn.bind(null, segment, 'audio', 'end');\n  let videoStartFn = timingInfoFn.bind(null, segment, 'video', 'start');\n  const videoEndFn = timingInfoFn.bind(null, segment, 'video', 'end');\n\n  const finish = () => transmux({\n    bytes,\n    transmuxer: segment.transmuxer,\n    audioAppendStart: segment.audioAppendStart,\n    gopsToAlignWith: segment.gopsToAlignWith,\n    remux: isMuxed,\n    onData: result => {\n      result.type = result.type === 'combined' ? 'video' : result.type;\n      dataFn(segment, result);\n    },\n    onTrackInfo: trackInfo => {\n      if (trackInfoFn) {\n        if (isMuxed) {\n          trackInfo.isMuxed = true;\n        }\n\n        trackInfoFn(segment, trackInfo);\n      }\n    },\n    onAudioTimingInfo: audioTimingInfo => {\n      // we only want the first start value we encounter\n      if (audioStartFn && typeof audioTimingInfo.start !== 'undefined') {\n        audioStartFn(audioTimingInfo.start);\n        audioStartFn = null;\n      } // we want to continually update the end time\n\n\n      if (audioEndFn && typeof audioTimingInfo.end !== 'undefined') {\n        audioEndFn(audioTimingInfo.end);\n      }\n    },\n    onVideoTimingInfo: videoTimingInfo => {\n      // we only want the first start value we encounter\n      if (videoStartFn && typeof videoTimingInfo.start !== 'undefined') {\n        videoStartFn(videoTimingInfo.start);\n        videoStartFn = null;\n      } // we want to continually update the end time\n\n\n      if (videoEndFn && typeof videoTimingInfo.end !== 'undefined') {\n        videoEndFn(videoTimingInfo.end);\n      }\n    },\n    onVideoSegmentTimingInfo: videoSegmentTimingInfo => {\n      videoSegmentTimingInfoFn(videoSegmentTimingInfo);\n    },\n    onAudioSegmentTimingInfo: audioSegmentTimingInfo => {\n      audioSegmentTimingInfoFn(audioSegmentTimingInfo);\n    },\n    onId3: (id3Frames, dispatchType) => {\n      id3Fn(segment, id3Frames, dispatchType);\n    },\n    onCaptions: captions => {\n      captionsFn(segment, [captions]);\n    },\n    isEndOfTimeline,\n    onEndedTimeline: () => {\n      endedTimelineFn();\n    },\n    onTransmuxerLog,\n    onDone: result => {\n      if (!doneFn) {\n        return;\n      }\n\n      result.type = result.type === 'combined' ? 'video' : result.type;\n      doneFn(null, segment, result);\n    }\n  }); // In the transmuxer, we don't yet have the ability to extract a \"proper\" start time.\n  // Meaning cached frame data may corrupt our notion of where this segment\n  // really starts. To get around this, probe for the info needed.\n\n\n  workerCallback({\n    action: 'probeTs',\n    transmuxer: segment.transmuxer,\n    data: bytes,\n    baseStartTime: segment.baseStartTime,\n    callback: data => {\n      segment.bytes = bytes = data.data;\n      const probeResult = data.result;\n\n      if (probeResult) {\n        trackInfoFn(segment, {\n          hasAudio: probeResult.hasAudio,\n          hasVideo: probeResult.hasVideo,\n          isMuxed\n        });\n        trackInfoFn = null;\n      }\n\n      finish();\n    }\n  });\n};\n\nconst handleSegmentBytes = ({\n  segment,\n  bytes,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn,\n  doneFn,\n  onTransmuxerLog\n}) => {\n  let bytesAsUint8Array = new Uint8Array(bytes); // TODO:\n  // We should have a handler that fetches the number of bytes required\n  // to check if something is fmp4. This will allow us to save bandwidth\n  // because we can only exclude a playlist and abort requests\n  // by codec after trackinfo triggers.\n\n  if (isLikelyFmp4MediaSegment(bytesAsUint8Array)) {\n    segment.isFmp4 = true;\n    const {\n      tracks\n    } = segment.map;\n    const trackInfo = {\n      isFmp4: true,\n      hasVideo: !!tracks.video,\n      hasAudio: !!tracks.audio\n    }; // if we have a audio track, with a codec that is not set to\n    // encrypted audio\n\n    if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== 'enca') {\n      trackInfo.audioCodec = tracks.audio.codec;\n    } // if we have a video track, with a codec that is not set to\n    // encrypted video\n\n\n    if (tracks.video && tracks.video.codec && tracks.video.codec !== 'encv') {\n      trackInfo.videoCodec = tracks.video.codec;\n    }\n\n    if (tracks.video && tracks.audio) {\n      trackInfo.isMuxed = true;\n    } // since we don't support appending fmp4 data on progress, we know we have the full\n    // segment here\n\n\n    trackInfoFn(segment, trackInfo); // The probe doesn't provide the segment end time, so only callback with the start\n    // time. The end time can be roughly calculated by the receiver using the duration.\n    //\n    // Note that the start time returned by the probe reflects the baseMediaDecodeTime, as\n    // that is the true start of the segment (where the playback engine should begin\n    // decoding).\n\n    const finishLoading = (captions, id3Frames) => {\n      // if the track still has audio at this point it is only possible\n      // for it to be audio only. See `tracks.video && tracks.audio` if statement\n      // above.\n      // we make sure to use segment.bytes here as that\n      dataFn(segment, {\n        data: bytesAsUint8Array,\n        type: trackInfo.hasAudio && !trackInfo.isMuxed ? 'audio' : 'video'\n      });\n\n      if (id3Frames && id3Frames.length) {\n        id3Fn(segment, id3Frames);\n      }\n\n      if (captions && captions.length) {\n        captionsFn(segment, captions);\n      }\n\n      doneFn(null, segment, {});\n    };\n\n    workerCallback({\n      action: 'probeMp4StartTime',\n      timescales: segment.map.timescales,\n      data: bytesAsUint8Array,\n      transmuxer: segment.transmuxer,\n      callback: ({\n        data,\n        startTime\n      }) => {\n        // transfer bytes back to us\n        bytes = data.buffer;\n        segment.bytes = bytesAsUint8Array = data;\n\n        if (trackInfo.hasAudio && !trackInfo.isMuxed) {\n          timingInfoFn(segment, 'audio', 'start', startTime);\n        }\n\n        if (trackInfo.hasVideo) {\n          timingInfoFn(segment, 'video', 'start', startTime);\n        }\n\n        workerCallback({\n          action: 'probeEmsgID3',\n          data: bytesAsUint8Array,\n          transmuxer: segment.transmuxer,\n          offset: startTime,\n          callback: ({\n            emsgData,\n            id3Frames\n          }) => {\n            // transfer bytes back to us\n            bytes = emsgData.buffer;\n            segment.bytes = bytesAsUint8Array = emsgData; // Run through the CaptionParser in case there are captions.\n            // Initialize CaptionParser if it hasn't been yet\n\n            if (!tracks.video || !emsgData.byteLength || !segment.transmuxer) {\n              finishLoading(undefined, id3Frames);\n              return;\n            }\n\n            workerCallback({\n              action: 'pushMp4Captions',\n              endAction: 'mp4Captions',\n              transmuxer: segment.transmuxer,\n              data: bytesAsUint8Array,\n              timescales: segment.map.timescales,\n              trackIds: [tracks.video.id],\n              callback: message => {\n                // transfer bytes back to us\n                bytes = message.data.buffer;\n                segment.bytes = bytesAsUint8Array = message.data;\n                message.logs.forEach(function (log) {\n                  onTransmuxerLog(merge(log, {\n                    stream: 'mp4CaptionParser'\n                  }));\n                });\n                finishLoading(message.captions, id3Frames);\n              }\n            });\n          }\n        });\n      }\n    });\n    return;\n  } // VTT or other segments that don't need processing\n\n\n  if (!segment.transmuxer) {\n    doneFn(null, segment, {});\n    return;\n  }\n\n  if (typeof segment.container === 'undefined') {\n    segment.container = detectContainerForBytes(bytesAsUint8Array);\n  }\n\n  if (segment.container !== 'ts' && segment.container !== 'aac') {\n    trackInfoFn(segment, {\n      hasAudio: false,\n      hasVideo: false\n    });\n    doneFn(null, segment, {});\n    return;\n  } // ts or aac\n\n\n  transmuxAndNotify({\n    segment,\n    bytes,\n    trackInfoFn,\n    timingInfoFn,\n    videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn,\n    id3Fn,\n    captionsFn,\n    isEndOfTimeline,\n    endedTimelineFn,\n    dataFn,\n    doneFn,\n    onTransmuxerLog\n  });\n};\n\nconst decrypt = function ({\n  id,\n  key,\n  encryptedBytes,\n  decryptionWorker\n}, callback) {\n  const decryptionHandler = event => {\n    if (event.data.source === id) {\n      decryptionWorker.removeEventListener('message', decryptionHandler);\n      const decrypted = event.data.decrypted;\n      callback(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));\n    }\n  };\n\n  decryptionWorker.addEventListener('message', decryptionHandler);\n  let keyBytes;\n\n  if (key.bytes.slice) {\n    keyBytes = key.bytes.slice();\n  } else {\n    keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));\n  } // incrementally decrypt the bytes\n\n\n  decryptionWorker.postMessage(createTransferableMessage({\n    source: id,\n    encrypted: encryptedBytes,\n    key: keyBytes,\n    iv: key.iv\n  }), [encryptedBytes.buffer, keyBytes.buffer]);\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n *                                       routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\n\nconst decryptSegment = ({\n  decryptionWorker,\n  segment,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn,\n  doneFn,\n  onTransmuxerLog\n}) => {\n  decrypt({\n    id: segment.requestId,\n    key: segment.key,\n    encryptedBytes: segment.encryptedBytes,\n    decryptionWorker\n  }, decryptedBytes => {\n    segment.bytes = decryptedBytes;\n    handleSegmentBytes({\n      segment,\n      bytes: segment.bytes,\n      trackInfoFn,\n      timingInfoFn,\n      videoSegmentTimingInfoFn,\n      audioSegmentTimingInfoFn,\n      id3Fn,\n      captionsFn,\n      isEndOfTimeline,\n      endedTimelineFn,\n      dataFn,\n      doneFn,\n      onTransmuxerLog\n    });\n  });\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n *                                       routines\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Function} doneFn - a callback that is executed after all resources have been\n *                            downloaded and any decryption completed\n */\n\n\nconst waitForCompletion = ({\n  activeXhrs,\n  decryptionWorker,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn,\n  doneFn,\n  onTransmuxerLog\n}) => {\n  let count = 0;\n  let didError = false;\n  return (error, segment) => {\n    if (didError) {\n      return;\n    }\n\n    if (error) {\n      didError = true; // If there are errors, we have to abort any outstanding requests\n\n      abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n      // handle the aborted events from those requests, there are some cases where we may\n      // never get an aborted event. For instance, if the network connection is lost and\n      // there were two requests, the first may have triggered an error immediately, while\n      // the second request remains unsent. In that case, the aborted algorithm will not\n      // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n      //\n      // We also can't rely on the ready state of the XHR, since the request that\n      // triggered the connection error may also show as a ready state of 0 (unsent).\n      // Therefore, we have to finish this group of requests immediately after the first\n      // seen error.\n\n      return doneFn(error, segment);\n    }\n\n    count += 1;\n\n    if (count === activeXhrs.length) {\n      const segmentFinish = function () {\n        if (segment.encryptedBytes) {\n          return decryptSegment({\n            decryptionWorker,\n            segment,\n            trackInfoFn,\n            timingInfoFn,\n            videoSegmentTimingInfoFn,\n            audioSegmentTimingInfoFn,\n            id3Fn,\n            captionsFn,\n            isEndOfTimeline,\n            endedTimelineFn,\n            dataFn,\n            doneFn,\n            onTransmuxerLog\n          });\n        } // Otherwise, everything is ready just continue\n\n\n        handleSegmentBytes({\n          segment,\n          bytes: segment.bytes,\n          trackInfoFn,\n          timingInfoFn,\n          videoSegmentTimingInfoFn,\n          audioSegmentTimingInfoFn,\n          id3Fn,\n          captionsFn,\n          isEndOfTimeline,\n          endedTimelineFn,\n          dataFn,\n          doneFn,\n          onTransmuxerLog\n        });\n      }; // Keep track of when *all* of the requests have completed\n\n\n      segment.endOfAllRequests = Date.now();\n\n      if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {\n        return decrypt({\n          decryptionWorker,\n          // add -init to the \"id\" to differentiate between segment\n          // and init segment decryption, just in case they happen\n          // at the same time at some point in the future.\n          id: segment.requestId + '-init',\n          encryptedBytes: segment.map.encryptedBytes,\n          key: segment.map.key\n        }, decryptedBytes => {\n          segment.map.bytes = decryptedBytes;\n          parseInitSegment(segment, parseError => {\n            if (parseError) {\n              abortAll(activeXhrs);\n              return doneFn(parseError, segment);\n            }\n\n            segmentFinish();\n          });\n        });\n      }\n\n      segmentFinish();\n    }\n  };\n};\n/**\n * Calls the abort callback if any request within the batch was aborted. Will only call\n * the callback once per batch of requests, even if multiple were aborted.\n *\n * @param {Object} loadendState - state to check to see if the abort function was called\n * @param {Function} abortFn - callback to call for abort\n */\n\n\nconst handleLoadEnd = ({\n  loadendState,\n  abortFn\n}) => event => {\n  const request = event.target;\n\n  if (request.aborted && abortFn && !loadendState.calledAbortFn) {\n    abortFn();\n    loadendState.calledAbortFn = true;\n  }\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n *                                is received\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n *                            and ready to use\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\n\nconst handleProgress = ({\n  segment,\n  progressFn,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn\n}) => event => {\n  const request = event.target;\n\n  if (request.aborted) {\n    return;\n  }\n\n  segment.stats = merge(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n  if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n    segment.stats.firstBytesReceivedAt = Date.now();\n  }\n\n  return progressFn(event, segment);\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n *   decrypts the media-segment if it has a key uri and an iv\n *   aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n *   resolvedUri: String,\n *   [transmuxer]: Object,\n *   [byterange]: {\n *     offset: Number,\n *     length: Number\n *   },\n *   [key]: {\n *     resolvedUri: String\n *     [byterange]: {\n *       offset: Number,\n *       length: Number\n *     },\n *     iv: {\n *       bytes: Uint32Array\n *     }\n *   },\n *   [map]: {\n *     resolvedUri: String,\n *     [byterange]: {\n *       offset: Number,\n *       length: Number\n *     },\n *     [bytes]: Uint8Array\n *   }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n *                                       decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n *                           from SegmentLoader\n * @param {Function} abortFn - a callback called (only once) if any piece of a request was\n *                             aborted\n * @param {Function} progressFn - a callback that receives progress events from the main\n *                                segment's xhr request\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n *                   a callback that receives video timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n *                   a callback that receives audio timing info based on media times and\n *                   any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean}  isEndOfTimeline\n *                   true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n *                   a callback made when a timeline is ended, will only be called if\n *                   isEndOfTimeline is true\n * @param {Function} dataFn - a callback that receives data from the main segment's xhr\n *                            request, transmuxed if needed\n * @param {Function} doneFn - a callback that is executed only once all requests have\n *                            succeeded or failed\n * @return {Function} a function that, when invoked, immediately aborts all\n *                     outstanding requests\n */\n\n\nconst mediaSegmentRequest = ({\n  xhr,\n  xhrOptions,\n  decryptionWorker,\n  segment,\n  abortFn,\n  progressFn,\n  trackInfoFn,\n  timingInfoFn,\n  videoSegmentTimingInfoFn,\n  audioSegmentTimingInfoFn,\n  id3Fn,\n  captionsFn,\n  isEndOfTimeline,\n  endedTimelineFn,\n  dataFn,\n  doneFn,\n  onTransmuxerLog\n}) => {\n  const activeXhrs = [];\n  const finishProcessingFn = waitForCompletion({\n    activeXhrs,\n    decryptionWorker,\n    trackInfoFn,\n    timingInfoFn,\n    videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn,\n    id3Fn,\n    captionsFn,\n    isEndOfTimeline,\n    endedTimelineFn,\n    dataFn,\n    doneFn,\n    onTransmuxerLog\n  }); // optionally, request the decryption key\n\n  if (segment.key && !segment.key.bytes) {\n    const objects = [segment.key];\n\n    if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {\n      objects.push(segment.map.key);\n    }\n\n    const keyRequestOptions = merge(xhrOptions, {\n      uri: segment.key.resolvedUri,\n      responseType: 'arraybuffer'\n    });\n    const keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);\n    const keyXhr = xhr(keyRequestOptions, keyRequestCallback);\n    activeXhrs.push(keyXhr);\n  } // optionally, request the associated media init segment\n\n\n  if (segment.map && !segment.map.bytes) {\n    const differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);\n\n    if (differentMapKey) {\n      const mapKeyRequestOptions = merge(xhrOptions, {\n        uri: segment.map.key.resolvedUri,\n        responseType: 'arraybuffer'\n      });\n      const mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);\n      const mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);\n      activeXhrs.push(mapKeyXhr);\n    }\n\n    const initSegmentOptions = merge(xhrOptions, {\n      uri: segment.map.resolvedUri,\n      responseType: 'arraybuffer',\n      headers: segmentXhrHeaders(segment.map)\n    });\n    const initSegmentRequestCallback = handleInitSegmentResponse({\n      segment,\n      finishProcessingFn\n    });\n    const initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);\n    activeXhrs.push(initSegmentXhr);\n  }\n\n  const segmentRequestOptions = merge(xhrOptions, {\n    uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,\n    responseType: 'arraybuffer',\n    headers: segmentXhrHeaders(segment)\n  });\n  const segmentRequestCallback = handleSegmentResponse({\n    segment,\n    finishProcessingFn,\n    responseType: segmentRequestOptions.responseType\n  });\n  const segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);\n  segmentXhr.addEventListener('progress', handleProgress({\n    segment,\n    progressFn,\n    trackInfoFn,\n    timingInfoFn,\n    videoSegmentTimingInfoFn,\n    audioSegmentTimingInfoFn,\n    id3Fn,\n    captionsFn,\n    isEndOfTimeline,\n    endedTimelineFn,\n    dataFn\n  }));\n  activeXhrs.push(segmentXhr); // since all parts of the request must be considered, but should not make callbacks\n  // multiple times, provide a shared state object\n\n  const loadendState = {};\n  activeXhrs.forEach(activeXhr => {\n    activeXhr.addEventListener('loadend', handleLoadEnd({\n      loadendState,\n      abortFn\n    }));\n  });\n  return () => abortAll(activeXhrs);\n};\n\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\nconst logFn$1 = logger('CodecUtils');\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n *\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\nconst getCodecs = function (media) {\n  // if the codecs were explicitly specified, use them instead of the\n  // defaults\n  const mediaAttributes = media.attributes || {};\n\n  if (mediaAttributes.CODECS) {\n    return parseCodecs(mediaAttributes.CODECS);\n  }\n};\n\nconst isMaat = (main, media) => {\n  const mediaAttributes = media.attributes || {};\n  return main && main.mediaGroups && main.mediaGroups.AUDIO && mediaAttributes.AUDIO && main.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n};\nconst isMuxed = (main, media) => {\n  if (!isMaat(main, media)) {\n    return true;\n  }\n\n  const mediaAttributes = media.attributes || {};\n  const audioGroup = main.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n\n  for (const groupId in audioGroup) {\n    // If an audio group has a URI (the case for HLS, as HLS will use external playlists),\n    // or there are listed playlists (the case for DASH, as the manifest will have already\n    // provided all of the details necessary to generate the audio playlist, as opposed to\n    // HLS' externally requested playlists), then the content is demuxed.\n    if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n      return true;\n    }\n  }\n\n  return false;\n};\nconst unwrapCodecList = function (codecList) {\n  const codecs = {};\n  codecList.forEach(({\n    mediaType,\n    type,\n    details\n  }) => {\n    codecs[mediaType] = codecs[mediaType] || [];\n    codecs[mediaType].push(translateLegacyCodec(`${type}${details}`));\n  });\n  Object.keys(codecs).forEach(function (mediaType) {\n    if (codecs[mediaType].length > 1) {\n      logFn$1(`multiple ${mediaType} codecs found as attributes: ${codecs[mediaType].join(', ')}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);\n      codecs[mediaType] = null;\n      return;\n    }\n\n    codecs[mediaType] = codecs[mediaType][0];\n  });\n  return codecs;\n};\nconst codecCount = function (codecObj) {\n  let count = 0;\n\n  if (codecObj.audio) {\n    count++;\n  }\n\n  if (codecObj.video) {\n    count++;\n  }\n\n  return count;\n};\n/**\n * Calculates the codec strings for a working configuration of\n * SourceBuffers to play variant streams in a main playlist. If\n * there is no possible working configuration, an empty object will be\n * returned.\n *\n * @param main {Object} the m3u8 object for the main playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Object} the codec strings.\n *\n * @private\n */\n\nconst codecsForPlaylist = function (main, media) {\n  const mediaAttributes = media.attributes || {};\n  const codecInfo = unwrapCodecList(getCodecs(media) || []); // HLS with multiple-audio tracks must always get an audio codec.\n  // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n  if (isMaat(main, media) && !codecInfo.audio) {\n    if (!isMuxed(main, media)) {\n      // It is possible for codecs to be specified on the audio media group playlist but\n      // not on the rendition playlist. This is mostly the case for DASH, where audio and\n      // video are always separate (and separately specified).\n      const defaultCodecs = unwrapCodecList(codecsFromDefault(main, mediaAttributes.AUDIO) || []);\n\n      if (defaultCodecs.audio) {\n        codecInfo.audio = defaultCodecs.audio;\n      }\n    }\n  }\n\n  return codecInfo;\n};\n\nconst logFn = logger('PlaylistSelector');\n\nconst representationToString = function (representation) {\n  if (!representation || !representation.playlist) {\n    return;\n  }\n\n  const playlist = representation.playlist;\n  return JSON.stringify({\n    id: playlist.id,\n    bandwidth: representation.bandwidth,\n    width: representation.width,\n    height: representation.height,\n    codecs: playlist.attributes && playlist.attributes.CODECS || ''\n  });\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\n\nconst safeGetComputedStyle = function (el, property) {\n  if (!el) {\n    return '';\n  }\n\n  const result = window$1.getComputedStyle(el);\n\n  if (!result) {\n    return '';\n  }\n\n  return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\n\nconst stableSort = function (array, sortFn) {\n  const newArray = array.slice();\n  array.sort(function (left, right) {\n    const cmp = sortFn(left, right);\n\n    if (cmp === 0) {\n      return newArray.indexOf(left) - newArray.indexOf(right);\n    }\n\n    return cmp;\n  });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nconst comparePlaylistBandwidth = function (left, right) {\n  let leftBandwidth;\n  let rightBandwidth;\n\n  if (left.attributes.BANDWIDTH) {\n    leftBandwidth = left.attributes.BANDWIDTH;\n  }\n\n  leftBandwidth = leftBandwidth || window$1.Number.MAX_VALUE;\n\n  if (right.attributes.BANDWIDTH) {\n    rightBandwidth = right.attributes.BANDWIDTH;\n  }\n\n  rightBandwidth = rightBandwidth || window$1.Number.MAX_VALUE;\n  return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\nconst comparePlaylistResolution = function (left, right) {\n  let leftWidth;\n  let rightWidth;\n\n  if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n    leftWidth = left.attributes.RESOLUTION.width;\n  }\n\n  leftWidth = leftWidth || window$1.Number.MAX_VALUE;\n\n  if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n    rightWidth = right.attributes.RESOLUTION.width;\n  }\n\n  rightWidth = rightWidth || window$1.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n  // have the same media dimensions/ resolution\n\n  if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n    return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n  }\n\n  return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} main\n *        Object representation of the main manifest\n * @param {number} playerBandwidth\n *        Current calculated bandwidth of the player\n * @param {number} playerWidth\n *        Current width of the player element (should account for the device pixel ratio)\n * @param {number} playerHeight\n *        Current height of the player element (should account for the device pixel ratio)\n * @param {boolean} limitRenditionByPlayerDimensions\n *        True if the player width and height should be used during the selection, false otherwise\n * @param {Object} playlistController\n *        the current playlistController object\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\nlet simpleSelector = function (main, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, playlistController) {\n  // If we end up getting called before `main` is available, exit early\n  if (!main) {\n    return;\n  }\n\n  const options = {\n    bandwidth: playerBandwidth,\n    width: playerWidth,\n    height: playerHeight,\n    limitRenditionByPlayerDimensions\n  };\n  let playlists = main.playlists; // if playlist is audio only, select between currently active audio group playlists.\n\n  if (Playlist.isAudioOnly(main)) {\n    playlists = playlistController.getAudioTrackPlaylists_(); // add audioOnly to options so that we log audioOnly: true\n    // at the buttom of this function for debugging.\n\n    options.audioOnly = true;\n  } // convert the playlists to an intermediary representation to make comparisons easier\n\n\n  let sortedPlaylistReps = playlists.map(playlist => {\n    let bandwidth;\n    const width = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n    const height = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n    bandwidth = playlist.attributes && playlist.attributes.BANDWIDTH;\n    bandwidth = bandwidth || window$1.Number.MAX_VALUE;\n    return {\n      bandwidth,\n      width,\n      height,\n      playlist\n    };\n  });\n  stableSort(sortedPlaylistReps, (left, right) => left.bandwidth - right.bandwidth); // filter out any playlists that have been excluded due to\n  // incompatible configurations\n\n  sortedPlaylistReps = sortedPlaylistReps.filter(rep => !Playlist.isIncompatible(rep.playlist)); // filter out any playlists that have been disabled manually through the representations\n  // api or excluded temporarily due to playback errors.\n\n  let enabledPlaylistReps = sortedPlaylistReps.filter(rep => Playlist.isEnabled(rep.playlist));\n\n  if (!enabledPlaylistReps.length) {\n    // if there are no enabled playlists, then they have all been excluded or disabled\n    // by the user through the representations api. In this case, ignore exclusion and\n    // fallback to what the user wants by using playlists the user has not disabled.\n    enabledPlaylistReps = sortedPlaylistReps.filter(rep => !Playlist.isDisabled(rep.playlist));\n  } // filter out any variant that has greater effective bitrate\n  // than the current estimated bandwidth\n\n\n  const bandwidthPlaylistReps = enabledPlaylistReps.filter(rep => rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth);\n  let highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n  // and then taking the very first element\n\n  const bandwidthBestRep = bandwidthPlaylistReps.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n  if (limitRenditionByPlayerDimensions === false) {\n    const chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n    if (chosenRep && chosenRep.playlist) {\n      let type = 'sortedPlaylistReps';\n\n      if (bandwidthBestRep) {\n        type = 'bandwidthBestRep';\n      }\n\n      if (enabledPlaylistReps[0]) {\n        type = 'enabledPlaylistReps';\n      }\n\n      logFn(`choosing ${representationToString(chosenRep)} using ${type} with options`, options);\n      return chosenRep.playlist;\n    }\n\n    logFn('could not choose a playlist with options', options);\n    return null;\n  } // filter out playlists without resolution information\n\n\n  const haveResolution = bandwidthPlaylistReps.filter(rep => rep.width && rep.height); // sort variants by resolution\n\n  stableSort(haveResolution, (left, right) => left.width - right.width); // if we have the exact resolution as the player use it\n\n  const resolutionBestRepList = haveResolution.filter(rep => rep.width === playerWidth && rep.height === playerHeight);\n  highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n  const resolutionBestRep = resolutionBestRepList.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];\n  let resolutionPlusOneList;\n  let resolutionPlusOneSmallest;\n  let resolutionPlusOneRep; // find the smallest variant that is larger than the player\n  // if there is no match of exact resolution\n\n  if (!resolutionBestRep) {\n    resolutionPlusOneList = haveResolution.filter(rep => rep.width > playerWidth || rep.height > playerHeight); // find all the variants have the same smallest resolution\n\n    resolutionPlusOneSmallest = resolutionPlusOneList.filter(rep => rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height); // ensure that we also pick the highest bandwidth variant that\n    // is just-larger-than the video player\n\n    highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n    resolutionPlusOneRep = resolutionPlusOneSmallest.filter(rep => rep.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];\n  }\n\n  let leastPixelDiffRep; // If this selector proves to be better than others,\n  // resolutionPlusOneRep and resolutionBestRep and all\n  // the code involving them should be removed.\n\n  if (playlistController.leastPixelDiffSelector) {\n    // find the variant that is closest to the player's pixel size\n    const leastPixelDiffList = haveResolution.map(rep => {\n      rep.pixelDiff = Math.abs(rep.width - playerWidth) + Math.abs(rep.height - playerHeight);\n      return rep;\n    }); // get the highest bandwidth, closest resolution playlist\n\n    stableSort(leastPixelDiffList, (left, right) => {\n      // sort by highest bandwidth if pixelDiff is the same\n      if (left.pixelDiff === right.pixelDiff) {\n        return right.bandwidth - left.bandwidth;\n      }\n\n      return left.pixelDiff - right.pixelDiff;\n    });\n    leastPixelDiffRep = leastPixelDiffList[0];\n  } // fallback chain of variants\n\n\n  const chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n  if (chosenRep && chosenRep.playlist) {\n    let type = 'sortedPlaylistReps';\n\n    if (leastPixelDiffRep) {\n      type = 'leastPixelDiffRep';\n    } else if (resolutionPlusOneRep) {\n      type = 'resolutionPlusOneRep';\n    } else if (resolutionBestRep) {\n      type = 'resolutionBestRep';\n    } else if (bandwidthBestRep) {\n      type = 'bandwidthBestRep';\n    } else if (enabledPlaylistReps[0]) {\n      type = 'enabledPlaylistReps';\n    }\n\n    logFn(`choosing ${representationToString(chosenRep)} using ${type} with options`, options);\n    return chosenRep.playlist;\n  }\n\n  logFn('could not choose a playlist with options', options);\n  return null;\n};\n\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\nconst lastBandwidthSelector = function () {\n  const pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n  return simpleSelector(this.playlists.main, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);\n};\n/**\n * Chooses the appropriate media playlist based on an\n * exponential-weighted moving average of the bandwidth after\n * filtering for player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @param {number} decay - a number between 0 and 1. Higher values of\n * this parameter will cause previous bandwidth estimates to lose\n * significance more quickly.\n * @return {Function} a function which can be invoked to create a new\n * playlist selector function.\n * @see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n */\n\nconst movingAverageBandwidthSelector = function (decay) {\n  let average = -1;\n  let lastSystemBandwidth = -1;\n\n  if (decay < 0 || decay > 1) {\n    throw new Error('Moving average bandwidth decay must be between 0 and 1.');\n  }\n\n  return function () {\n    const pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;\n\n    if (average < 0) {\n      average = this.systemBandwidth;\n      lastSystemBandwidth = this.systemBandwidth;\n    } // stop the average value from decaying for every 250ms\n    // when the systemBandwidth is constant\n    // and\n    // stop average from setting to a very low value when the\n    // systemBandwidth becomes 0 in case of chunk cancellation\n\n\n    if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {\n      average = decay * this.systemBandwidth + (1 - decay) * average;\n      lastSystemBandwidth = this.systemBandwidth;\n    }\n\n    return simpleSelector(this.playlists.main, average, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);\n  };\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n *        Object of information required to use this selector\n * @param {Object} settings.main\n *        Object representation of the main manifest\n * @param {number} settings.currentTime\n *        The current time of the player\n * @param {number} settings.bandwidth\n *        Current measured bandwidth\n * @param {number} settings.duration\n *        Duration of the media\n * @param {number} settings.segmentDuration\n *        Segment duration to be used in round trip time calculations\n * @param {number} settings.timeUntilRebuffer\n *        Time left in seconds until the player has to rebuffer\n * @param {number} settings.currentTimeline\n *        The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n *        SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n *         {Object} return.playlist\n *         The highest bandwidth playlist with the least amount of rebuffering\n *         {Number} return.rebufferingImpact\n *         The amount of time in seconds switching to this playlist will rebuffer. A\n *         negative value means that switching will cause zero rebuffering.\n */\n\nconst minRebufferMaxBandwidthSelector = function (settings) {\n  const {\n    main,\n    currentTime,\n    bandwidth,\n    duration,\n    segmentDuration,\n    timeUntilRebuffer,\n    currentTimeline,\n    syncController\n  } = settings; // filter out any playlists that have been excluded due to\n  // incompatible configurations\n\n  const compatiblePlaylists = main.playlists.filter(playlist => !Playlist.isIncompatible(playlist)); // filter out any playlists that have been disabled manually through the representations\n  // api or excluded temporarily due to playback errors.\n\n  let enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n\n  if (!enabledPlaylists.length) {\n    // if there are no enabled playlists, then they have all been excluded or disabled\n    // by the user through the representations api. In this case, ignore exclusion and\n    // fallback to what the user wants by using playlists the user has not disabled.\n    enabledPlaylists = compatiblePlaylists.filter(playlist => !Playlist.isDisabled(playlist));\n  }\n\n  const bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n  const rebufferingEstimates = bandwidthPlaylists.map(playlist => {\n    const syncPoint = syncController.getSyncPoint(playlist, duration, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n    // sync request first. This will double the request time\n\n    const numRequests = syncPoint ? 1 : 2;\n    const requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n    const rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n    return {\n      playlist,\n      rebufferingImpact\n    };\n  });\n  const noRebufferingPlaylists = rebufferingEstimates.filter(estimate => estimate.rebufferingImpact <= 0); // Sort by bandwidth DESC\n\n  stableSort(noRebufferingPlaylists, (a, b) => comparePlaylistBandwidth(b.playlist, a.playlist));\n\n  if (noRebufferingPlaylists.length) {\n    return noRebufferingPlaylists[0];\n  }\n\n  stableSort(rebufferingEstimates, (a, b) => a.rebufferingImpact - b.rebufferingImpact);\n  return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video.  If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Object|null}\n *         {Object} return.playlist\n *         The lowest bitrate playlist that contains a video codec.  If no such rendition\n *         exists pick the lowest audio rendition.\n */\n\nconst lowestBitrateCompatibleVariantSelector = function () {\n  // filter out any playlists that have been excluded due to\n  // incompatible configurations or playback errors\n  const playlists = this.playlists.main.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n  stableSort(playlists, (a, b) => comparePlaylistBandwidth(a, b)); // Parse and assume that playlists with no video codec have no video\n  // (this is not necessarily true, although it is generally true).\n  //\n  // If an entire manifest has no valid videos everything will get filtered\n  // out.\n\n  const playlistsWithVideo = playlists.filter(playlist => !!codecsForPlaylist(this.playlists.main, playlist).video);\n  return playlistsWithVideo[0] || null;\n};\n\n/**\n * Combine all segments into a single Uint8Array\n *\n * @param {Object} segmentObj\n * @return {Uint8Array} concatenated bytes\n * @private\n */\nconst concatSegments = segmentObj => {\n  let offset = 0;\n  let tempBuffer;\n\n  if (segmentObj.bytes) {\n    tempBuffer = new Uint8Array(segmentObj.bytes); // combine the individual segments into one large typed-array\n\n    segmentObj.segments.forEach(segment => {\n      tempBuffer.set(segment, offset);\n      offset += segment.byteLength;\n    });\n  }\n\n  return tempBuffer;\n};\n\n/**\n * @file text-tracks.js\n */\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStream the caption stream to create\n * @private\n */\n\nconst createCaptionsTrackIfNotExists = function (inbandTextTracks, tech, captionStream) {\n  if (!inbandTextTracks[captionStream]) {\n    tech.trigger({\n      type: 'usage',\n      name: 'vhs-608'\n    });\n    let instreamId = captionStream; // we need to translate SERVICEn for 708 to how mux.js currently labels them\n\n    if (/^cc708_/.test(captionStream)) {\n      instreamId = 'SERVICE' + captionStream.split('_')[1];\n    }\n\n    const track = tech.textTracks().getTrackById(instreamId);\n\n    if (track) {\n      // Resuse an existing track with a CC# id because this was\n      // very likely created by videojs-contrib-hls from information\n      // in the m3u8 for us to use\n      inbandTextTracks[captionStream] = track;\n    } else {\n      // This section gets called when we have caption services that aren't specified in the manifest.\n      // Manifest level caption services are handled in media-groups.js under CLOSED-CAPTIONS.\n      const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n      let label = captionStream;\n      let language = captionStream;\n      let def = false;\n      const captionService = captionServices[instreamId];\n\n      if (captionService) {\n        label = captionService.label;\n        language = captionService.language;\n        def = captionService.default;\n      } // Otherwise, create a track with the default `CC#` label and\n      // without a language\n\n\n      inbandTextTracks[captionStream] = tech.addRemoteTextTrack({\n        kind: 'captions',\n        id: instreamId,\n        // TODO: investigate why this doesn't seem to turn the caption on by default\n        default: def,\n        label,\n        language\n      }, false).track;\n    }\n  }\n};\n/**\n * Add caption text track data to a source handler given an array of captions\n *\n * @param {Object}\n *   @param {Object} inbandTextTracks the inband text tracks\n *   @param {number} timestampOffset the timestamp offset of the source buffer\n *   @param {Array} captionArray an array of caption data\n * @private\n */\n\nconst addCaptionData = function ({\n  inbandTextTracks,\n  captionArray,\n  timestampOffset\n}) {\n  if (!captionArray) {\n    return;\n  }\n\n  const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n  captionArray.forEach(caption => {\n    const track = caption.stream; // in CEA 608 captions, video.js/mux.js sends a content array\n    // with positioning data\n\n    if (caption.content) {\n      caption.content.forEach(value => {\n        const cue = new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, value.text);\n        cue.line = value.line;\n        cue.align = 'left';\n        cue.position = value.position;\n        cue.positionAlign = 'line-left';\n        inbandTextTracks[track].addCue(cue);\n      });\n    } else {\n      // otherwise, a text value with combined captions is sent\n      inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, caption.text));\n    }\n  });\n};\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\nconst deprecateOldCue = function (cue) {\n  Object.defineProperties(cue.frame, {\n    id: {\n      get() {\n        videojs.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n        return cue.value.key;\n      }\n\n    },\n    value: {\n      get() {\n        videojs.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n        return cue.value.data;\n      }\n\n    },\n    privateData: {\n      get() {\n        videojs.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n        return cue.value.data;\n      }\n\n    }\n  });\n};\n/**\n * Add metadata text track data to a source handler given an array of metadata\n *\n * @param {Object}\n *   @param {Object} inbandTextTracks the inband text tracks\n *   @param {Array} metadataArray an array of meta data\n *   @param {number} timestampOffset the timestamp offset of the source buffer\n *   @param {number} videoDuration the duration of the video\n * @private\n */\n\n\nconst addMetadata = ({\n  inbandTextTracks,\n  metadataArray,\n  timestampOffset,\n  videoDuration\n}) => {\n  if (!metadataArray) {\n    return;\n  }\n\n  const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n  const metadataTrack = inbandTextTracks.metadataTrack_;\n\n  if (!metadataTrack) {\n    return;\n  }\n\n  metadataArray.forEach(metadata => {\n    const time = metadata.cueTime + timestampOffset; // if time isn't a finite number between 0 and Infinity, like NaN,\n    // ignore this bit of metadata.\n    // This likely occurs when you have an non-timed ID3 tag like TIT2,\n    // which is the \"Title/Songname/Content description\" frame\n\n    if (typeof time !== 'number' || window$1.isNaN(time) || time < 0 || !(time < Infinity)) {\n      return;\n    } // If we have no frames, we can't create a cue.\n\n\n    if (!metadata.frames || !metadata.frames.length) {\n      return;\n    }\n\n    metadata.frames.forEach(frame => {\n      const cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n      cue.frame = frame;\n      cue.value = frame;\n      deprecateOldCue(cue);\n      metadataTrack.addCue(cue);\n    });\n  });\n\n  if (!metadataTrack.cues || !metadataTrack.cues.length) {\n    return;\n  } // Updating the metadeta cues so that\n  // the endTime of each cue is the startTime of the next cue\n  // the endTime of last cue is the duration of the video\n\n\n  const cues = metadataTrack.cues;\n  const cuesArray = []; // Create a copy of the TextTrackCueList...\n  // ...disregarding cues with a falsey value\n\n  for (let i = 0; i < cues.length; i++) {\n    if (cues[i]) {\n      cuesArray.push(cues[i]);\n    }\n  } // Group cues by their startTime value\n\n\n  const cuesGroupedByStartTime = cuesArray.reduce((obj, cue) => {\n    const timeSlot = obj[cue.startTime] || [];\n    timeSlot.push(cue);\n    obj[cue.startTime] = timeSlot;\n    return obj;\n  }, {}); // Sort startTimes by ascending order\n\n  const sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort((a, b) => Number(a) - Number(b)); // Map each cue group's endTime to the next group's startTime\n\n  sortedStartTimes.forEach((startTime, idx) => {\n    const cueGroup = cuesGroupedByStartTime[startTime];\n    const finiteDuration = isFinite(videoDuration) ? videoDuration : startTime;\n    const nextTime = Number(sortedStartTimes[idx + 1]) || finiteDuration; // Map each cue's endTime the next group's startTime\n\n    cueGroup.forEach(cue => {\n      cue.endTime = nextTime;\n    });\n  });\n}; // object for mapping daterange attributes\n\nconst dateRangeAttr = {\n  id: 'ID',\n  class: 'CLASS',\n  startDate: 'START-DATE',\n  duration: 'DURATION',\n  endDate: 'END-DATE',\n  endOnNext: 'END-ON-NEXT',\n  plannedDuration: 'PLANNED-DURATION',\n  scte35Out: 'SCTE35-OUT',\n  scte35In: 'SCTE35-IN'\n};\nconst dateRangeKeysToOmit = new Set(['id', 'class', 'startDate', 'duration', 'endDate', 'endOnNext', 'startTime', 'endTime', 'processDateRange']);\n/**\n * Add DateRange metadata text track to a source handler given an array of metadata\n *\n * @param {Object}\n *   @param {Object} inbandTextTracks the inband text tracks\n *   @param {Array} dateRanges parsed media playlist\n * @private\n */\n\nconst addDateRangeMetadata = ({\n  inbandTextTracks,\n  dateRanges\n}) => {\n  const metadataTrack = inbandTextTracks.metadataTrack_;\n\n  if (!metadataTrack) {\n    return;\n  }\n\n  const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n  dateRanges.forEach(dateRange => {\n    // we generate multiple cues for each date range with different attributes\n    for (const key of Object.keys(dateRange)) {\n      if (dateRangeKeysToOmit.has(key)) {\n        continue;\n      }\n\n      const cue = new Cue(dateRange.startTime, dateRange.endTime, '');\n      cue.id = dateRange.id;\n      cue.type = 'com.apple.quicktime.HLS';\n      cue.value = {\n        key: dateRangeAttr[key],\n        data: dateRange[key]\n      };\n\n      if (key === 'scte35Out' || key === 'scte35In') {\n        cue.value.data = new Uint8Array(cue.value.data.match(/[\\da-f]{2}/gi)).buffer;\n      }\n\n      metadataTrack.addCue(cue);\n    }\n\n    dateRange.processDateRange();\n  });\n};\n/**\n * Create metadata text track on video.js if it does not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {string} dispatchType the inband metadata track dispatch type\n * @param {Object} tech the video.js tech\n * @private\n */\n\nconst createMetadataTrackIfNotExists = (inbandTextTracks, dispatchType, tech) => {\n  if (inbandTextTracks.metadataTrack_) {\n    return;\n  }\n\n  inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({\n    kind: 'metadata',\n    label: 'Timed Metadata'\n  }, false).track;\n\n  if (!videojs.browser.IS_ANY_SAFARI) {\n    inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;\n  }\n};\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\nconst removeCuesFromTrack = function (start, end, track) {\n  let i;\n  let cue;\n\n  if (!track) {\n    return;\n  }\n\n  if (!track.cues) {\n    return;\n  }\n\n  i = track.cues.length;\n\n  while (i--) {\n    cue = track.cues[i]; // Remove any cue within the provided start and end time\n\n    if (cue.startTime >= start && cue.endTime <= end) {\n      track.removeCue(cue);\n    }\n  }\n};\n/**\n * Remove duplicate cues from a track on video.js (a cue is considered a\n * duplicate if it has the same time interval and text as another)\n *\n * @param {Object} track the text track to remove the duplicate cues from\n * @private\n */\n\nconst removeDuplicateCuesFromTrack = function (track) {\n  const cues = track.cues;\n\n  if (!cues) {\n    return;\n  }\n\n  const uniqueCues = {};\n\n  for (let i = cues.length - 1; i >= 0; i--) {\n    const cue = cues[i];\n    const cueKey = `${cue.startTime}-${cue.endTime}-${cue.text}`;\n\n    if (uniqueCues[cueKey]) {\n      track.removeCue(cue);\n    } else {\n      uniqueCues[cueKey] = cue;\n    }\n  }\n};\n\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {number} currentTime\n *        The current time\n * @param {Double} mapping\n *        Offset to map display time to stream presentation time\n * @return {Array}\n *         List of gops considered safe to append over\n */\n\nconst gopsSafeToAlignWith = (buffer, currentTime, mapping) => {\n  if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n    return [];\n  } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n\n  const currentTimePts = Math.ceil((currentTime - mapping + 3) * ONE_SECOND_IN_TS);\n  let i;\n\n  for (i = 0; i < buffer.length; i++) {\n    if (buffer[i].pts > currentTimePts) {\n      break;\n    }\n  }\n\n  return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {Array} gops\n *        List of new gop information\n * @param {boolean} replace\n *        If true, replace the buffer with the new gop information. If false, append the\n *        new gop information to the buffer in the right location of time.\n * @return {Array}\n *         Updated list of gop information\n */\n\nconst updateGopBuffer = (buffer, gops, replace) => {\n  if (!gops.length) {\n    return buffer;\n  }\n\n  if (replace) {\n    // If we are in safe append mode, then completely overwrite the gop buffer\n    // with the most recent appeneded data. This will make sure that when appending\n    // future segments, we only try to align with gops that are both ahead of current\n    // time and in the last segment appended.\n    return gops.slice();\n  }\n\n  const start = gops[0].pts;\n  let i = 0;\n\n  for (i; i < buffer.length; i++) {\n    if (buffer[i].pts >= start) {\n      break;\n    }\n  }\n\n  return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n *        The current buffer of gop information\n * @param {Double} start\n *        position to start the remove at\n * @param {Double} end\n *        position to end the remove at\n * @param {Double} mapping\n *        Offset to map display time to stream presentation time\n */\n\nconst removeGopBuffer = (buffer, start, end, mapping) => {\n  const startPts = Math.ceil((start - mapping) * ONE_SECOND_IN_TS);\n  const endPts = Math.ceil((end - mapping) * ONE_SECOND_IN_TS);\n  const updatedBuffer = buffer.slice();\n  let i = buffer.length;\n\n  while (i--) {\n    if (buffer[i].pts <= endPts) {\n      break;\n    }\n  }\n\n  if (i === -1) {\n    // no removal because end of remove range is before start of buffer\n    return updatedBuffer;\n  }\n\n  let j = i + 1;\n\n  while (j--) {\n    if (buffer[j].pts <= startPts) {\n      break;\n    }\n  } // clamp remove range start to 0 index\n\n\n  j = Math.max(j, 0);\n  updatedBuffer.splice(j, i - j + 1);\n  return updatedBuffer;\n};\n\nconst shallowEqual = function (a, b) {\n  // if both are undefined\n  // or one or the other is undefined\n  // they are not equal\n  if (!a && !b || !a && b || a && !b) {\n    return false;\n  } // they are the same object and thus, equal\n\n\n  if (a === b) {\n    return true;\n  } // sort keys so we can make sure they have\n  // all the same keys later.\n\n\n  const akeys = Object.keys(a).sort();\n  const bkeys = Object.keys(b).sort(); // different number of keys, not equal\n\n  if (akeys.length !== bkeys.length) {\n    return false;\n  }\n\n  for (let i = 0; i < akeys.length; i++) {\n    const key = akeys[i]; // different sorted keys, not equal\n\n    if (key !== bkeys[i]) {\n      return false;\n    } // different values, not equal\n\n\n    if (a[key] !== b[key]) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\n// https://www.w3.org/TR/WebIDL-1/#quotaexceedederror\nconst QUOTA_EXCEEDED_ERR = 22;\n\n/**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Array} segments - the segments array from a playlist.\n * @return {number} An index of a segment from the playlist to load\n */\n\nconst getSyncSegmentCandidate = function (currentTimeline, segments, targetTime) {\n  segments = segments || [];\n  const timelineSegments = [];\n  let time = 0;\n\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n\n    if (currentTimeline === segment.timeline) {\n      timelineSegments.push(i);\n      time += segment.duration;\n\n      if (time > targetTime) {\n        return i;\n      }\n    }\n  }\n\n  if (timelineSegments.length === 0) {\n    return 0;\n  } // default to the last timeline segment\n\n\n  return timelineSegments[timelineSegments.length - 1];\n}; // In the event of a quota exceeded error, keep at least one second of back buffer. This\n// number was arbitrarily chosen and may be updated in the future, but seemed reasonable\n// as a start to prevent any potential issues with removing content too close to the\n// playhead.\n\nconst MIN_BACK_BUFFER = 1; // in ms\n\nconst CHECK_BUFFER_DELAY = 500;\n\nconst finite = num => typeof num === 'number' && isFinite(num); // With most content hovering around 30fps, if a segment has a duration less than a half\n// frame at 30fps or one frame at 60fps, the bandwidth and throughput calculations will\n// not accurately reflect the rest of the content.\n\n\nconst MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;\nconst illegalMediaSwitch = (loaderType, startingMedia, trackInfo) => {\n  // Although these checks should most likely cover non 'main' types, for now it narrows\n  // the scope of our checks.\n  if (loaderType !== 'main' || !startingMedia || !trackInfo) {\n    return null;\n  }\n\n  if (!trackInfo.hasAudio && !trackInfo.hasVideo) {\n    return 'Neither audio nor video found in segment.';\n  }\n\n  if (startingMedia.hasVideo && !trackInfo.hasVideo) {\n    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.';\n  }\n\n  if (!startingMedia.hasVideo && trackInfo.hasVideo) {\n    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.';\n  }\n\n  return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interrupting\n * playback.\n *\n * @param {TimeRange} seekable\n *        The current seekable range\n * @param {number} currentTime\n *        The current time of the player\n * @param {number} targetDuration\n *        The target duration of the current playlist\n * @return {number}\n *         Time that is safe to remove from the back buffer without interrupting playback\n */\n\nconst safeBackBufferTrimTime = (seekable, currentTime, targetDuration) => {\n  // 30 seconds before the playhead provides a safe default for trimming.\n  //\n  // Choosing a reasonable default is particularly important for high bitrate content and\n  // VOD videos/live streams with large windows, as the buffer may end up overfilled and\n  // throw an APPEND_BUFFER_ERR.\n  let trimTime = currentTime - Config.BACK_BUFFER_LENGTH;\n\n  if (seekable.length) {\n    // Some live playlists may have a shorter window of content than the full allowed back\n    // buffer. For these playlists, don't save content that's no longer within the window.\n    trimTime = Math.max(trimTime, seekable.start(0));\n  } // Don't remove within target duration of the current time to avoid the possibility of\n  // removing the GOP currently being played, as removing it can cause playback stalls.\n\n\n  const maxTrimTime = currentTime - targetDuration;\n  return Math.min(maxTrimTime, trimTime);\n};\nconst segmentInfoString = segmentInfo => {\n  const {\n    startOfSegment,\n    duration,\n    segment,\n    part,\n    playlist: {\n      mediaSequence: seq,\n      id,\n      segments = []\n    },\n    mediaIndex: index,\n    partIndex,\n    timeline\n  } = segmentInfo;\n  const segmentLen = segments.length - 1;\n  let selection = 'mediaIndex/partIndex increment';\n\n  if (segmentInfo.getMediaInfoForTime) {\n    selection = `getMediaInfoForTime (${segmentInfo.getMediaInfoForTime})`;\n  } else if (segmentInfo.isSyncRequest) {\n    selection = 'getSyncSegmentCandidate (isSyncRequest)';\n  }\n\n  if (segmentInfo.independent) {\n    selection += ` with independent ${segmentInfo.independent}`;\n  }\n\n  const hasPartIndex = typeof partIndex === 'number';\n  const name = segmentInfo.segment.uri ? 'segment' : 'pre-segment';\n  const zeroBasedPartCount = hasPartIndex ? getKnownPartCount({\n    preloadSegment: segment\n  }) - 1 : 0;\n  return `${name} [${seq + index}/${seq + segmentLen}]` + (hasPartIndex ? ` part [${partIndex}/${zeroBasedPartCount}]` : '') + ` segment start/end [${segment.start} => ${segment.end}]` + (hasPartIndex ? ` part start/end [${part.start} => ${part.end}]` : '') + ` startOfSegment [${startOfSegment}]` + ` duration [${duration}]` + ` timeline [${timeline}]` + ` selected by [${selection}]` + ` playlist [${id}]`;\n};\n\nconst timingInfoPropertyForMedia = mediaType => `${mediaType}TimingInfo`;\n/**\n * Returns the timestamp offset to use for the segment.\n *\n * @param {number} segmentTimeline\n *        The timeline of the segment\n * @param {number} currentTimeline\n *        The timeline currently being followed by the loader\n * @param {number} startOfSegment\n *        The estimated segment start\n * @param {TimeRange[]} buffered\n *        The loader's buffer\n * @param {boolean} overrideCheck\n *        If true, no checks are made to see if the timestamp offset value should be set,\n *        but sets it directly to a value.\n *\n * @return {number|null}\n *         Either a number representing a new timestamp offset, or null if the segment is\n *         part of the same timeline\n */\n\n\nconst timestampOffsetForSegment = ({\n  segmentTimeline,\n  currentTimeline,\n  startOfSegment,\n  buffered,\n  overrideCheck\n}) => {\n  // Check to see if we are crossing a discontinuity to see if we need to set the\n  // timestamp offset on the transmuxer and source buffer.\n  //\n  // Previously, we changed the timestampOffset if the start of this segment was less than\n  // the currently set timestampOffset, but this isn't desirable as it can produce bad\n  // behavior, especially around long running live streams.\n  if (!overrideCheck && segmentTimeline === currentTimeline) {\n    return null;\n  } // When changing renditions, it's possible to request a segment on an older timeline. For\n  // instance, given two renditions with the following:\n  //\n  // #EXTINF:10\n  // segment1\n  // #EXT-X-DISCONTINUITY\n  // #EXTINF:10\n  // segment2\n  // #EXTINF:10\n  // segment3\n  //\n  // And the current player state:\n  //\n  // current time: 8\n  // buffer: 0 => 20\n  //\n  // The next segment on the current rendition would be segment3, filling the buffer from\n  // 20s onwards. However, if a rendition switch happens after segment2 was requested,\n  // then the next segment to be requested will be segment1 from the new rendition in\n  // order to fill time 8 and onwards. Using the buffered end would result in repeated\n  // content (since it would position segment1 of the new rendition starting at 20s). This\n  // case can be identified when the new segment's timeline is a prior value. Instead of\n  // using the buffered end, the startOfSegment can be used, which, hopefully, will be\n  // more accurate to the actual start time of the segment.\n\n\n  if (segmentTimeline < currentTimeline) {\n    return startOfSegment;\n  } // segmentInfo.startOfSegment used to be used as the timestamp offset, however, that\n  // value uses the end of the last segment if it is available. While this value\n  // should often be correct, it's better to rely on the buffered end, as the new\n  // content post discontinuity should line up with the buffered end as if it were\n  // time 0 for the new content.\n\n\n  return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;\n};\n/**\n * Returns whether or not the loader should wait for a timeline change from the timeline\n * change controller before processing the segment.\n *\n * Primary timing in VHS goes by video. This is different from most media players, as\n * audio is more often used as the primary timing source. For the foreseeable future, VHS\n * will continue to use video as the primary timing source, due to the current logic and\n * expectations built around it.\n\n * Since the timing follows video, in order to maintain sync, the video loader is\n * responsible for setting both audio and video source buffer timestamp offsets.\n *\n * Setting different values for audio and video source buffers could lead to\n * desyncing. The following examples demonstrate some of the situations where this\n * distinction is important. Note that all of these cases involve demuxed content. When\n * content is muxed, the audio and video are packaged together, therefore syncing\n * separate media playlists is not an issue.\n *\n * CASE 1: Audio prepares to load a new timeline before video:\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:                     ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader              ^\n *\n * In the above example, the audio loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the video loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the audio loader goes ahead and loads and appends the 6th segment before the video\n * loader crosses the discontinuity, then when appended, the 6th audio segment will use\n * the timestamp offset from timeline 0. This will likely lead to desyncing. In addition,\n * the audio loader must provide the audioAppendStart value to trim the content in the\n * transmuxer, and that value relies on the audio timestamp offset. Since the audio\n * timestamp offset is set by the video (main) loader, the audio loader shouldn't load the\n * segment until that value is provided.\n *\n * CASE 2: Video prepares to load a new timeline before audio:\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:             ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader                      ^\n *\n * In the above example, the video loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the audio loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the video loader goes ahead and loads and appends the 6th segment, then once the\n * segment is loaded and processed, both the video and audio timestamp offsets will be\n * set, since video is used as the primary timing source. This is to ensure content lines\n * up appropriately, as any modifications to the video timing are reflected by audio when\n * the video loader sets the audio and video timestamp offsets to the same value. However,\n * setting the timestamp offset for audio before audio has had a chance to change\n * timelines will likely lead to desyncing, as the audio loader will append segment 5 with\n * a timestamp intended to apply to segments from timeline 1 rather than timeline 0.\n *\n * CASE 3: When seeking, audio prepares to load a new timeline before video\n *\n * Timeline:       0                 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader:           ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader            ^\n *\n * In the above example, both audio and video loaders are loading segments from timeline\n * 0, but imagine that the seek originated from timeline 1.\n *\n * When seeking to a new timeline, the timestamp offset will be set based on the expected\n * segment start of the loaded video segment. In order to maintain sync, the audio loader\n * must wait for the video loader to load its segment and update both the audio and video\n * timestamp offsets before it may load and append its own segment. This is the case\n * whether the seek results in a mismatched segment request (e.g., the audio loader\n * chooses to load segment 3 and the video loader chooses to load segment 4) or the\n * loaders choose to load the same segment index from each playlist, as the segments may\n * not be aligned perfectly, even for matching segment indexes.\n *\n * @param {Object} timelinechangeController\n * @param {number} currentTimeline\n *        The timeline currently being followed by the loader\n * @param {number} segmentTimeline\n *        The timeline of the segment being loaded\n * @param {('main'|'audio')} loaderType\n *        The loader type\n * @param {boolean} audioDisabled\n *        Whether the audio is disabled for the loader. This should only be true when the\n *        loader may have muxed audio in its segment, but should not append it, e.g., for\n *        the main loader when an alternate audio playlist is active.\n *\n * @return {boolean}\n *         Whether the loader should wait for a timeline change from the timeline change\n *         controller before processing the segment\n */\n\nconst shouldWaitForTimelineChange = ({\n  timelineChangeController,\n  currentTimeline,\n  segmentTimeline,\n  loaderType,\n  audioDisabled\n}) => {\n  if (currentTimeline === segmentTimeline) {\n    return false;\n  }\n\n  if (loaderType === 'audio') {\n    const lastMainTimelineChange = timelineChangeController.lastTimelineChange({\n      type: 'main'\n    }); // Audio loader should wait if:\n    //\n    // * main hasn't had a timeline change yet (thus has not loaded its first segment)\n    // * main hasn't yet changed to the timeline audio is looking to load\n\n    return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;\n  } // The main loader only needs to wait for timeline changes if there's demuxed audio.\n  // Otherwise, there's nothing to wait for, since audio would be muxed into the main\n  // loader's segments (or the content is audio/video only and handled by the main\n  // loader).\n\n\n  if (loaderType === 'main' && audioDisabled) {\n    const pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({\n      type: 'audio'\n    }); // Main loader should wait for the audio loader if audio is not pending a timeline\n    // change to the current timeline.\n    //\n    // Since the main loader is responsible for setting the timestamp offset for both\n    // audio and video, the main loader must wait for audio to be about to change to its\n    // timeline before setting the offset, otherwise, if audio is behind in loading,\n    // segments from the previous timeline would be adjusted by the new timestamp offset.\n    //\n    // This requirement means that video will not cross a timeline until the audio is\n    // about to cross to it, so that way audio and video will always cross the timeline\n    // together.\n    //\n    // In addition to normal timeline changes, these rules also apply to the start of a\n    // stream (going from a non-existent timeline, -1, to timeline 0). It's important\n    // that these rules apply to the first timeline change because if they did not, it's\n    // possible that the main loader will cross two timelines before the audio loader has\n    // crossed one. Logic may be implemented to handle the startup as a special case, but\n    // it's easier to simply treat all timeline changes the same.\n\n    if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {\n      return false;\n    }\n\n    return true;\n  }\n\n  return false;\n};\nconst mediaDuration = timingInfos => {\n  let maxDuration = 0;\n  ['video', 'audio'].forEach(function (type) {\n    const typeTimingInfo = timingInfos[`${type}TimingInfo`];\n\n    if (!typeTimingInfo) {\n      return;\n    }\n\n    const {\n      start,\n      end\n    } = typeTimingInfo;\n    let duration;\n\n    if (typeof start === 'bigint' || typeof end === 'bigint') {\n      duration = window$1.BigInt(end) - window$1.BigInt(start);\n    } else if (typeof start === 'number' && typeof end === 'number') {\n      duration = end - start;\n    }\n\n    if (typeof duration !== 'undefined' && duration > maxDuration) {\n      maxDuration = duration;\n    }\n  }); // convert back to a number if it is lower than MAX_SAFE_INTEGER\n  // as we only need BigInt when we are above that.\n\n  if (typeof maxDuration === 'bigint' && maxDuration < Number.MAX_SAFE_INTEGER) {\n    maxDuration = Number(maxDuration);\n  }\n\n  return maxDuration;\n};\nconst segmentTooLong = ({\n  segmentDuration,\n  maxDuration\n}) => {\n  // 0 duration segments are most likely due to metadata only segments or a lack of\n  // information.\n  if (!segmentDuration) {\n    return false;\n  } // For HLS:\n  //\n  // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1\n  // The EXTINF duration of each Media Segment in the Playlist\n  // file, when rounded to the nearest integer, MUST be less than or equal\n  // to the target duration; longer segments can trigger playback stalls\n  // or other errors.\n  //\n  // For DASH, the mpd-parser uses the largest reported segment duration as the target\n  // duration. Although that reported duration is occasionally approximate (i.e., not\n  // exact), a strict check may report that a segment is too long more often in DASH.\n\n\n  return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;\n};\nconst getTroublesomeSegmentDurationMessage = (segmentInfo, sourceType) => {\n  // Right now we aren't following DASH's timing model exactly, so only perform\n  // this check for HLS content.\n  if (sourceType !== 'hls') {\n    return null;\n  }\n\n  const segmentDuration = mediaDuration({\n    audioTimingInfo: segmentInfo.audioTimingInfo,\n    videoTimingInfo: segmentInfo.videoTimingInfo\n  }); // Don't report if we lack information.\n  //\n  // If the segment has a duration of 0 it is either a lack of information or a\n  // metadata only segment and shouldn't be reported here.\n\n  if (!segmentDuration) {\n    return null;\n  }\n\n  const targetDuration = segmentInfo.playlist.targetDuration;\n  const isSegmentWayTooLong = segmentTooLong({\n    segmentDuration,\n    maxDuration: targetDuration * 2\n  });\n  const isSegmentSlightlyTooLong = segmentTooLong({\n    segmentDuration,\n    maxDuration: targetDuration\n  });\n  const segmentTooLongMessage = `Segment with index ${segmentInfo.mediaIndex} ` + `from playlist ${segmentInfo.playlist.id} ` + `has a duration of ${segmentDuration} ` + `when the reported duration is ${segmentInfo.duration} ` + `and the target duration is ${targetDuration}. ` + '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';\n\n  if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {\n    return {\n      severity: isSegmentWayTooLong ? 'warn' : 'info',\n      message: segmentTooLongMessage\n    };\n  }\n\n  return null;\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nclass SegmentLoader extends videojs.EventTarget {\n  constructor(settings, options = {}) {\n    super(); // check pre-conditions\n\n    if (!settings) {\n      throw new TypeError('Initialization settings are required');\n    }\n\n    if (typeof settings.currentTime !== 'function') {\n      throw new TypeError('No currentTime getter specified');\n    }\n\n    if (!settings.mediaSource) {\n      throw new TypeError('No MediaSource specified');\n    } // public properties\n\n\n    this.bandwidth = settings.bandwidth;\n    this.throughput = {\n      rate: 0,\n      count: 0\n    };\n    this.roundTrip = NaN;\n    this.resetStats_();\n    this.mediaIndex = null;\n    this.partIndex = null; // private settings\n\n    this.hasPlayed_ = settings.hasPlayed;\n    this.currentTime_ = settings.currentTime;\n    this.seekable_ = settings.seekable;\n    this.seeking_ = settings.seeking;\n    this.duration_ = settings.duration;\n    this.mediaSource_ = settings.mediaSource;\n    this.vhs_ = settings.vhs;\n    this.loaderType_ = settings.loaderType;\n    this.currentMediaInfo_ = void 0;\n    this.startingMediaInfo_ = void 0;\n    this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n    this.goalBufferLength_ = settings.goalBufferLength;\n    this.sourceType_ = settings.sourceType;\n    this.sourceUpdater_ = settings.sourceUpdater;\n    this.inbandTextTracks_ = settings.inbandTextTracks;\n    this.state_ = 'INIT';\n    this.timelineChangeController_ = settings.timelineChangeController;\n    this.shouldSaveSegmentTimingInfo_ = true;\n    this.parse708captions_ = settings.parse708captions;\n    this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;\n    this.captionServices_ = settings.captionServices;\n    this.exactManifestTimings = settings.exactManifestTimings;\n    this.addMetadataToTextTrack = settings.addMetadataToTextTrack; // private instance variables\n\n    this.checkBufferTimeout_ = null;\n    this.error_ = void 0;\n    this.currentTimeline_ = -1;\n    this.shouldForceTimestampOffsetAfterResync_ = false;\n    this.pendingSegment_ = null;\n    this.xhrOptions_ = null;\n    this.pendingSegments_ = [];\n    this.audioDisabled_ = false;\n    this.isPendingTimestampOffset_ = false; // TODO possibly move gopBuffer and timeMapping info to a separate controller\n\n    this.gopBuffer_ = [];\n    this.timeMapping_ = 0;\n    this.safeAppend_ = false;\n    this.appendInitSegment_ = {\n      audio: true,\n      video: true\n    };\n    this.playlistOfLastInitSegment_ = {\n      audio: null,\n      video: null\n    };\n    this.callQueue_ = []; // If the segment loader prepares to load a segment, but does not have enough\n    // information yet to start the loading process (e.g., if the audio loader wants to\n    // load a segment from the next timeline but the main loader hasn't yet crossed that\n    // timeline), then the load call will be added to the queue until it is ready to be\n    // processed.\n\n    this.loadQueue_ = [];\n    this.metadataQueue_ = {\n      id3: [],\n      caption: []\n    };\n    this.waitingOnRemove_ = false;\n    this.quotaExceededErrorRetryTimeout_ = null; // Fragmented mp4 playback\n\n    this.activeInitSegmentId_ = null;\n    this.initSegments_ = {}; // HLSe playback\n\n    this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;\n    this.keyCache_ = {};\n    this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n    // between a time in the display time and a segment index within\n    // a playlist\n\n    this.syncController_ = settings.syncController;\n    this.syncPoint_ = {\n      segmentIndex: 0,\n      time: 0\n    };\n    this.transmuxer_ = this.createTransmuxer_();\n\n    this.triggerSyncInfoUpdate_ = () => this.trigger('syncinfoupdate');\n\n    this.syncController_.on('syncinfoupdate', this.triggerSyncInfoUpdate_);\n    this.mediaSource_.addEventListener('sourceopen', () => {\n      if (!this.isEndOfStream_()) {\n        this.ended_ = false;\n      }\n    }); // ...for determining the fetch location\n\n    this.fetchAtBuffer_ = false;\n    this.logger_ = logger(`SegmentLoader[${this.loaderType_}]`);\n    Object.defineProperty(this, 'state', {\n      get() {\n        return this.state_;\n      },\n\n      set(newState) {\n        if (newState !== this.state_) {\n          this.logger_(`${this.state_} -> ${newState}`);\n          this.state_ = newState;\n          this.trigger('statechange');\n        }\n      }\n\n    });\n    this.sourceUpdater_.on('ready', () => {\n      if (this.hasEnoughInfoToAppend_()) {\n        this.processCallQueue_();\n      }\n    }); // Only the main loader needs to listen for pending timeline changes, as the main\n    // loader should wait for audio to be ready to change its timeline so that both main\n    // and audio timelines change together. For more details, see the\n    // shouldWaitForTimelineChange function.\n\n    if (this.loaderType_ === 'main') {\n      this.timelineChangeController_.on('pendingtimelinechange', () => {\n        if (this.hasEnoughInfoToAppend_()) {\n          this.processCallQueue_();\n        }\n      });\n    } // The main loader only listens on pending timeline changes, but the audio loader,\n    // since its loads follow main, needs to listen on timeline changes. For more details,\n    // see the shouldWaitForTimelineChange function.\n\n\n    if (this.loaderType_ === 'audio') {\n      this.timelineChangeController_.on('timelinechange', () => {\n        if (this.hasEnoughInfoToLoad_()) {\n          this.processLoadQueue_();\n        }\n\n        if (this.hasEnoughInfoToAppend_()) {\n          this.processCallQueue_();\n        }\n      });\n    }\n  }\n\n  createTransmuxer_() {\n    return segmentTransmuxer.createTransmuxer({\n      remux: false,\n      alignGopsAtEnd: this.safeAppend_,\n      keepOriginalTimestamps: true,\n      parse708captions: this.parse708captions_,\n      captionServices: this.captionServices_\n    });\n  }\n  /**\n   * reset all of our media stats\n   *\n   * @private\n   */\n\n\n  resetStats_() {\n    this.mediaBytesTransferred = 0;\n    this.mediaRequests = 0;\n    this.mediaRequestsAborted = 0;\n    this.mediaRequestsTimedout = 0;\n    this.mediaRequestsErrored = 0;\n    this.mediaTransferDuration = 0;\n    this.mediaSecondsLoaded = 0;\n    this.mediaAppends = 0;\n  }\n  /**\n   * dispose of the SegmentLoader and reset to the default state\n   */\n\n\n  dispose() {\n    this.trigger('dispose');\n    this.state = 'DISPOSED';\n    this.pause();\n    this.abort_();\n\n    if (this.transmuxer_) {\n      this.transmuxer_.terminate();\n    }\n\n    this.resetStats_();\n\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    if (this.syncController_ && this.triggerSyncInfoUpdate_) {\n      this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_);\n    }\n\n    this.off();\n  }\n\n  setAudio(enable) {\n    this.audioDisabled_ = !enable;\n\n    if (enable) {\n      this.appendInitSegment_.audio = true;\n    } else {\n      // remove current track audio if it gets disabled\n      this.sourceUpdater_.removeAudio(0, this.duration_());\n    }\n  }\n  /**\n   * abort anything that is currently doing on with the SegmentLoader\n   * and reset to a default state\n   */\n\n\n  abort() {\n    if (this.state !== 'WAITING') {\n      if (this.pendingSegment_) {\n        this.pendingSegment_ = null;\n      }\n\n      return;\n    }\n\n    this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n    // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n    // when the request is aborted. This will prevent the loader from being stuck in the\n    // WAITING state indefinitely.\n\n    this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n    // next segment\n\n    if (!this.paused()) {\n      this.monitorBuffer_();\n    }\n  }\n  /**\n   * abort all pending xhr requests and null any pending segements\n   *\n   * @private\n   */\n\n\n  abort_() {\n    if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {\n      this.pendingSegment_.abortRequests();\n    } // clear out the segment being processed\n\n\n    this.pendingSegment_ = null;\n    this.callQueue_ = [];\n    this.loadQueue_ = [];\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n    this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);\n    this.waitingOnRemove_ = false;\n    window$1.clearTimeout(this.quotaExceededErrorRetryTimeout_);\n    this.quotaExceededErrorRetryTimeout_ = null;\n  }\n\n  checkForAbort_(requestId) {\n    // If the state is APPENDING, then aborts will not modify the state, meaning the first\n    // callback that happens should reset the state to READY so that loading can continue.\n    if (this.state === 'APPENDING' && !this.pendingSegment_) {\n      this.state = 'READY';\n      return true;\n    }\n\n    if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * set an error on the segment loader and null out any pending segements\n   *\n   * @param {Error} error the error to set on the SegmentLoader\n   * @return {Error} the error that was set or that is currently set\n   */\n\n\n  error(error) {\n    if (typeof error !== 'undefined') {\n      this.logger_('error occurred:', error);\n      this.error_ = error;\n    }\n\n    this.pendingSegment_ = null;\n    return this.error_;\n  }\n\n  endOfStream() {\n    this.ended_ = true;\n\n    if (this.transmuxer_) {\n      // need to clear out any cached data to prepare for the new segment\n      segmentTransmuxer.reset(this.transmuxer_);\n    }\n\n    this.gopBuffer_.length = 0;\n    this.pause();\n    this.trigger('ended');\n  }\n  /**\n   * Indicates which time ranges are buffered\n   *\n   * @return {TimeRange}\n   *         TimeRange object representing the current buffered ranges\n   */\n\n\n  buffered_() {\n    const trackInfo = this.getMediaInfo_();\n\n    if (!this.sourceUpdater_ || !trackInfo) {\n      return createTimeRanges();\n    }\n\n    if (this.loaderType_ === 'main') {\n      const {\n        hasAudio,\n        hasVideo,\n        isMuxed\n      } = trackInfo;\n\n      if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed) {\n        return this.sourceUpdater_.buffered();\n      }\n\n      if (hasVideo) {\n        return this.sourceUpdater_.videoBuffered();\n      }\n    } // One case that can be ignored for now is audio only with alt audio,\n    // as we don't yet have proper support for that.\n\n\n    return this.sourceUpdater_.audioBuffered();\n  }\n  /**\n   * Gets and sets init segment for the provided map\n   *\n   * @param {Object} map\n   *        The map object representing the init segment to get or set\n   * @param {boolean=} set\n   *        If true, the init segment for the provided map should be saved\n   * @return {Object}\n   *         map object for desired init segment\n   */\n\n\n  initSegmentForMap(map, set = false) {\n    if (!map) {\n      return null;\n    }\n\n    const id = initSegmentId(map);\n    let storedMap = this.initSegments_[id];\n\n    if (set && !storedMap && map.bytes) {\n      this.initSegments_[id] = storedMap = {\n        resolvedUri: map.resolvedUri,\n        byterange: map.byterange,\n        bytes: map.bytes,\n        tracks: map.tracks,\n        timescales: map.timescales\n      };\n    }\n\n    return storedMap || map;\n  }\n  /**\n   * Gets and sets key for the provided key\n   *\n   * @param {Object} key\n   *        The key object representing the key to get or set\n   * @param {boolean=} set\n   *        If true, the key for the provided key should be saved\n   * @return {Object}\n   *         Key object for desired key\n   */\n\n\n  segmentKey(key, set = false) {\n    if (!key) {\n      return null;\n    }\n\n    const id = segmentKeyId(key);\n    let storedKey = this.keyCache_[id]; // TODO: We should use the HTTP Expires header to invalidate our cache per\n    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-6.2.3\n\n    if (this.cacheEncryptionKeys_ && set && !storedKey && key.bytes) {\n      this.keyCache_[id] = storedKey = {\n        resolvedUri: key.resolvedUri,\n        bytes: key.bytes\n      };\n    }\n\n    const result = {\n      resolvedUri: (storedKey || key).resolvedUri\n    };\n\n    if (storedKey) {\n      result.bytes = storedKey.bytes;\n    }\n\n    return result;\n  }\n  /**\n   * Returns true if all configuration required for loading is present, otherwise false.\n   *\n   * @return {boolean} True if the all configuration is ready for loading\n   * @private\n   */\n\n\n  couldBeginLoading_() {\n    return this.playlist_ && !this.paused();\n  }\n  /**\n   * load a playlist and start to fill the buffer\n   */\n\n\n  load() {\n    // un-pause\n    this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n    // specified\n\n    if (!this.playlist_) {\n      return;\n    } // if all the configuration is ready, initialize and begin loading\n\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      return this.init_();\n    } // if we're in the middle of processing a segment already, don't\n    // kick off an additional segment request\n\n\n    if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n      return;\n    }\n\n    this.state = 'READY';\n  }\n  /**\n   * Once all the starting parameters have been specified, begin\n   * operation. This method should only be invoked from the INIT\n   * state.\n   *\n   * @private\n   */\n\n\n  init_() {\n    this.state = 'READY'; // if this is the audio segment loader, and it hasn't been inited before, then any old\n    // audio data from the muxed content should be removed\n\n    this.resetEverything();\n    return this.monitorBuffer_();\n  }\n  /**\n   * set a playlist on the segment loader\n   *\n   * @param {PlaylistLoader} media the playlist to set on the segment loader\n   */\n\n\n  playlist(newPlaylist, options = {}) {\n    if (!newPlaylist) {\n      return;\n    }\n\n    const oldPlaylist = this.playlist_;\n    const segmentInfo = this.pendingSegment_;\n    this.playlist_ = newPlaylist;\n    this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n    // is always our zero-time so force a sync update each time the playlist\n    // is refreshed from the server\n    //\n    // Use the INIT state to determine if playback has started, as the playlist sync info\n    // should be fixed once requests begin (as sync points are generated based on sync\n    // info), but not before then.\n\n    if (this.state === 'INIT') {\n      newPlaylist.syncInfo = {\n        mediaSequence: newPlaylist.mediaSequence,\n        time: 0\n      }; // Setting the date time mapping means mapping the program date time (if available)\n      // to time 0 on the player's timeline. The playlist's syncInfo serves a similar\n      // purpose, mapping the initial mediaSequence to time zero. Since the syncInfo can\n      // be updated as the playlist is refreshed before the loader starts loading, the\n      // program date time mapping needs to be updated as well.\n      //\n      // This mapping is only done for the main loader because a program date time should\n      // map equivalently between playlists.\n\n      if (this.loaderType_ === 'main') {\n        this.syncController_.setDateTimeMappingForStart(newPlaylist);\n      }\n    }\n\n    let oldId = null;\n\n    if (oldPlaylist) {\n      if (oldPlaylist.id) {\n        oldId = oldPlaylist.id;\n      } else if (oldPlaylist.uri) {\n        oldId = oldPlaylist.uri;\n      }\n    }\n\n    this.logger_(`playlist update [${oldId} => ${newPlaylist.id || newPlaylist.uri}]`);\n    this.syncController_.updateMediaSequenceMap(newPlaylist, this.currentTime_(), this.loaderType_); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n    // in LIVE, we always want to update with new playlists (including refreshes)\n\n    this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n    // buffering now\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      return this.init_();\n    }\n\n    if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n      if (this.mediaIndex !== null) {\n        // we must reset/resync the segment loader when we switch renditions and\n        // the segment loader is already synced to the previous rendition\n        // We only want to reset the loader here for LLHLS playback, as resetLoader sets fetchAtBuffer_\n        // to false, resulting in fetching segments at currentTime and causing repeated\n        // same-segment requests on playlist change. This erroneously drives up the playback watcher\n        // stalled segment count, as re-requesting segments at the currentTime or browser cached segments\n        // will not change the buffer.\n        // Reference for LLHLS fixes: https://github.com/videojs/http-streaming/pull/1201\n        const isLLHLS = !newPlaylist.endList && typeof newPlaylist.partTargetDuration === 'number';\n\n        if (isLLHLS) {\n          this.resetLoader();\n        } else {\n          this.resyncLoader();\n        }\n      }\n\n      this.currentMediaInfo_ = void 0;\n      this.trigger('playlistupdate'); // the rest of this function depends on `oldPlaylist` being defined\n\n      return;\n    } // we reloaded the same playlist so we are in a live scenario\n    // and we will likely need to adjust the mediaIndex\n\n\n    const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n    this.logger_(`live window shift [${mediaSequenceDiff}]`); // update the mediaIndex on the SegmentLoader\n    // this is important because we can abort a request and this value must be\n    // equal to the last appended mediaIndex\n\n    if (this.mediaIndex !== null) {\n      this.mediaIndex -= mediaSequenceDiff; // this can happen if we are going to load the first segment, but get a playlist\n      // update during that. mediaIndex would go from 0 to -1 if mediaSequence in the\n      // new playlist was incremented by 1.\n\n      if (this.mediaIndex < 0) {\n        this.mediaIndex = null;\n        this.partIndex = null;\n      } else {\n        const segment = this.playlist_.segments[this.mediaIndex]; // partIndex should remain the same for the same segment\n        // unless parts fell off of the playlist for this segment.\n        // In that case we need to reset partIndex and resync\n\n        if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {\n          const mediaIndex = this.mediaIndex;\n          this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);\n          this.resetLoader(); // We want to throw away the partIndex and the data associated with it,\n          // as the part was dropped from our current playlists segment.\n          // The mediaIndex will still be valid so keep that around.\n\n          this.mediaIndex = mediaIndex;\n        }\n      }\n    } // update the mediaIndex on the SegmentInfo object\n    // this is important because we will update this.mediaIndex with this value\n    // in `handleAppendsDone_` after the segment has been successfully appended\n\n\n    if (segmentInfo) {\n      segmentInfo.mediaIndex -= mediaSequenceDiff;\n\n      if (segmentInfo.mediaIndex < 0) {\n        segmentInfo.mediaIndex = null;\n        segmentInfo.partIndex = null;\n      } else {\n        // we need to update the referenced segment so that timing information is\n        // saved for the new playlist's segment, however, if the segment fell off the\n        // playlist, we can leave the old reference and just lose the timing info\n        if (segmentInfo.mediaIndex >= 0) {\n          segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n        }\n\n        if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {\n          segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];\n        }\n      }\n    }\n\n    this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n  }\n  /**\n   * Prevent the loader from fetching additional segments. If there\n   * is a segment request outstanding, it will finish processing\n   * before the loader halts. A segment loader can be unpaused by\n   * calling load().\n   */\n\n\n  pause() {\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n      this.checkBufferTimeout_ = null;\n    }\n  }\n  /**\n   * Returns whether the segment loader is fetching additional\n   * segments when given the opportunity. This property can be\n   * modified through calls to pause() and load().\n   */\n\n\n  paused() {\n    return this.checkBufferTimeout_ === null;\n  }\n  /**\n   * Delete all the buffered data and reset the SegmentLoader\n   *\n   * @param {Function} [done] an optional callback to be executed when the remove\n   * operation is complete\n   */\n\n\n  resetEverything(done) {\n    this.ended_ = false;\n    this.activeInitSegmentId_ = null;\n    this.appendInitSegment_ = {\n      audio: true,\n      video: true\n    };\n    this.resetLoader(); // remove from 0, the earliest point, to Infinity, to signify removal of everything.\n    // VTT Segment Loader doesn't need to do anything but in the regular SegmentLoader,\n    // we then clamp the value to duration if necessary.\n\n    this.remove(0, Infinity, done); // clears fmp4 captions\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearAllMp4Captions'\n      }); // reset the cache in the transmuxer\n\n      this.transmuxer_.postMessage({\n        action: 'reset'\n      });\n    }\n  }\n  /**\n   * Force the SegmentLoader to resync and start loading around the currentTime instead\n   * of starting at the end of the buffer\n   *\n   * Useful for fast quality changes\n   */\n\n\n  resetLoader() {\n    this.fetchAtBuffer_ = false;\n    this.resyncLoader();\n  }\n  /**\n   * Force the SegmentLoader to restart synchronization and make a conservative guess\n   * before returning to the simple walk-forward method\n   */\n\n\n  resyncLoader() {\n    if (this.transmuxer_) {\n      // need to clear out any cached data to prepare for the new segment\n      segmentTransmuxer.reset(this.transmuxer_);\n    }\n\n    this.mediaIndex = null;\n    this.partIndex = null;\n    this.syncPoint_ = null;\n    this.isPendingTimestampOffset_ = false;\n    this.shouldForceTimestampOffsetAfterResync_ = true;\n    this.callQueue_ = [];\n    this.loadQueue_ = [];\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n    this.abort();\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearParsedMp4Captions'\n      });\n    }\n  }\n  /**\n   * Remove any data in the source buffer between start and end times\n   *\n   * @param {number} start - the start time of the region to remove from the buffer\n   * @param {number} end - the end time of the region to remove from the buffer\n   * @param {Function} [done] - an optional callback to be executed when the remove\n   * @param {boolean} force - force all remove operations to happen\n   * operation is complete\n   */\n\n\n  remove(start, end, done = () => {}, force = false) {\n    // clamp end to duration if we need to remove everything.\n    // This is due to a browser bug that causes issues if we remove to Infinity.\n    // videojs/videojs-contrib-hls#1225\n    if (end === Infinity) {\n      end = this.duration_();\n    } // skip removes that would throw an error\n    // commonly happens during a rendition switch at the start of a video\n    // from start 0 to end 0\n\n\n    if (end <= start) {\n      this.logger_('skipping remove because end ${end} is <= start ${start}');\n      return;\n    }\n\n    if (!this.sourceUpdater_ || !this.getMediaInfo_()) {\n      this.logger_('skipping remove because no source updater or starting media info'); // nothing to remove if we haven't processed any media\n\n      return;\n    } // set it to one to complete this function's removes\n\n\n    let removesRemaining = 1;\n\n    const removeFinished = () => {\n      removesRemaining--;\n\n      if (removesRemaining === 0) {\n        done();\n      }\n    };\n\n    if (force || !this.audioDisabled_) {\n      removesRemaining++;\n      this.sourceUpdater_.removeAudio(start, end, removeFinished);\n    } // While it would be better to only remove video if the main loader has video, this\n    // should be safe with audio only as removeVideo will call back even if there's no\n    // video buffer.\n    //\n    // In theory we can check to see if there's video before calling the remove, but in\n    // the event that we're switching between renditions and from video to audio only\n    // (when we add support for that), we may need to clear the video contents despite\n    // what the new media will contain.\n\n\n    if (force || this.loaderType_ === 'main') {\n      this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n      removesRemaining++;\n      this.sourceUpdater_.removeVideo(start, end, removeFinished);\n    } // remove any captions and ID3 tags\n\n\n    for (const track in this.inbandTextTracks_) {\n      removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n    }\n\n    removeCuesFromTrack(start, end, this.segmentMetadataTrack_); // finished this function's removes\n\n    removeFinished();\n  }\n  /**\n   * (re-)schedule monitorBufferTick_ to run as soon as possible\n   *\n   * @private\n   */\n\n\n  monitorBuffer_() {\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), 1);\n  }\n  /**\n   * As long as the SegmentLoader is in the READY state, periodically\n   * invoke fillBuffer_().\n   *\n   * @private\n   */\n\n\n  monitorBufferTick_() {\n    if (this.state === 'READY') {\n      this.fillBuffer_();\n    }\n\n    if (this.checkBufferTimeout_) {\n      window$1.clearTimeout(this.checkBufferTimeout_);\n    }\n\n    this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n  }\n  /**\n   * fill the buffer with segements unless the sourceBuffers are\n   * currently updating\n   *\n   * Note: this function should only ever be called by monitorBuffer_\n   * and never directly\n   *\n   * @private\n   */\n\n\n  fillBuffer_() {\n    // TODO since the source buffer maintains a queue, and we shouldn't call this function\n    // except when we're ready for the next segment, this check can most likely be removed\n    if (this.sourceUpdater_.updating()) {\n      return;\n    } // see if we need to begin loading immediately\n\n\n    const segmentInfo = this.chooseNextRequest_();\n\n    if (!segmentInfo) {\n      return;\n    }\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      this.isPendingTimestampOffset_ = false;\n      this.timelineChangeController_.pendingTimelineChange({\n        type: this.loaderType_,\n        from: this.currentTimeline_,\n        to: segmentInfo.timeline\n      });\n    }\n\n    this.loadSegment_(segmentInfo);\n  }\n  /**\n   * Determines if we should call endOfStream on the media source based\n   * on the state of the buffer or if appened segment was the final\n   * segment in the playlist.\n   *\n   * @param {number} [mediaIndex] the media index of segment we last appended\n   * @param {Object} [playlist] a media playlist object\n   * @return {boolean} do we need to call endOfStream on the MediaSource\n   */\n\n\n  isEndOfStream_(mediaIndex = this.mediaIndex, playlist = this.playlist_, partIndex = this.partIndex) {\n    if (!playlist || !this.mediaSource_) {\n      return false;\n    }\n\n    const segment = typeof mediaIndex === 'number' && playlist.segments[mediaIndex]; // mediaIndex is zero based but length is 1 based\n\n    const appendedLastSegment = mediaIndex + 1 === playlist.segments.length; // true if there are no parts, or this is the last part.\n\n    const appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length; // if we've buffered to the end of the video, we need to call endOfStream\n    // so that MediaSources can trigger the `ended` event when it runs out of\n    // buffered data instead of waiting for me\n\n    return playlist.endList && this.mediaSource_.readyState === 'open' && appendedLastSegment && appendedLastPart;\n  }\n  /**\n   * Determines what request should be made given current segment loader state.\n   *\n   * @return {Object} a request object that describes the segment/part to load\n   */\n\n\n  chooseNextRequest_() {\n    const buffered = this.buffered_();\n    const bufferedEnd = lastBufferedEnd(buffered) || 0;\n    const bufferedTime = timeAheadOf(buffered, this.currentTime_());\n    const preloaded = !this.hasPlayed_() && bufferedTime >= 1;\n    const haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();\n    const segments = this.playlist_.segments; // return no segment if:\n    // 1. we don't have segments\n    // 2. The video has not yet played and we already downloaded a segment\n    // 3. we already have enough buffered time\n\n    if (!segments.length || preloaded || haveEnoughBuffer) {\n      return null;\n    }\n\n    this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_(), this.loaderType_);\n    const next = {\n      partIndex: null,\n      mediaIndex: null,\n      startOfSegment: null,\n      playlist: this.playlist_,\n      isSyncRequest: Boolean(!this.syncPoint_)\n    };\n\n    if (next.isSyncRequest) {\n      next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);\n      this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${next.mediaIndex}`);\n    } else if (this.mediaIndex !== null) {\n      const segment = segments[this.mediaIndex];\n      const partIndex = typeof this.partIndex === 'number' ? this.partIndex : -1;\n      next.startOfSegment = segment.end ? segment.end : bufferedEnd;\n\n      if (segment.parts && segment.parts[partIndex + 1]) {\n        next.mediaIndex = this.mediaIndex;\n        next.partIndex = partIndex + 1;\n      } else {\n        next.mediaIndex = this.mediaIndex + 1;\n      }\n    } else {\n      // Find the segment containing the end of the buffer or current time.\n      const {\n        segmentIndex,\n        startTime,\n        partIndex\n      } = Playlist.getMediaInfoForTime({\n        exactManifestTimings: this.exactManifestTimings,\n        playlist: this.playlist_,\n        currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),\n        startingPartIndex: this.syncPoint_.partIndex,\n        startingSegmentIndex: this.syncPoint_.segmentIndex,\n        startTime: this.syncPoint_.time\n      });\n      next.getMediaInfoForTime = this.fetchAtBuffer_ ? `bufferedEnd ${bufferedEnd}` : `currentTime ${this.currentTime_()}`;\n      next.mediaIndex = segmentIndex;\n      next.startOfSegment = startTime;\n      next.partIndex = partIndex;\n      this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${next.mediaIndex} `);\n    }\n\n    const nextSegment = segments[next.mediaIndex];\n    let nextPart = nextSegment && typeof next.partIndex === 'number' && nextSegment.parts && nextSegment.parts[next.partIndex]; // if the next segment index is invalid or\n    // the next partIndex is invalid do not choose a next segment.\n\n    if (!nextSegment || typeof next.partIndex === 'number' && !nextPart) {\n      return null;\n    } // if the next segment has parts, and we don't have a partIndex.\n    // Set partIndex to 0\n\n\n    if (typeof next.partIndex !== 'number' && nextSegment.parts) {\n      next.partIndex = 0;\n      nextPart = nextSegment.parts[0];\n    } // independentSegments applies to every segment in a playlist. If independentSegments appears in a main playlist,\n    // it applies to each segment in each media playlist.\n    // https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-23#section-4.3.5.1\n\n\n    const hasIndependentSegments = this.vhs_.playlists && this.vhs_.playlists.main && this.vhs_.playlists.main.independentSegments || this.playlist_.independentSegments; // if we have no buffered data then we need to make sure\n    // that the next part we append is \"independent\" if possible.\n    // So we check if the previous part is independent, and request\n    // it if it is.\n\n    if (!bufferedTime && nextPart && !hasIndependentSegments && !nextPart.independent) {\n      if (next.partIndex === 0) {\n        const lastSegment = segments[next.mediaIndex - 1];\n        const lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];\n\n        if (lastSegmentLastPart && lastSegmentLastPart.independent) {\n          next.mediaIndex -= 1;\n          next.partIndex = lastSegment.parts.length - 1;\n          next.independent = 'previous segment';\n        }\n      } else if (nextSegment.parts[next.partIndex - 1].independent) {\n        next.partIndex -= 1;\n        next.independent = 'previous part';\n      }\n    }\n\n    const ended = this.mediaSource_ && this.mediaSource_.readyState === 'ended'; // do not choose a next segment if all of the following:\n    // 1. this is the last segment in the playlist\n    // 2. end of stream has been called on the media source already\n    // 3. the player is not seeking\n\n    if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {\n      return null;\n    }\n\n    if (this.shouldForceTimestampOffsetAfterResync_) {\n      this.shouldForceTimestampOffsetAfterResync_ = false;\n      next.forceTimestampOffset = true;\n      this.logger_('choose next request. Force timestamp offset after loader resync');\n    }\n\n    return this.generateSegmentInfo_(next);\n  }\n\n  generateSegmentInfo_(options) {\n    const {\n      independent,\n      playlist,\n      mediaIndex,\n      startOfSegment,\n      isSyncRequest,\n      partIndex,\n      forceTimestampOffset,\n      getMediaInfoForTime\n    } = options;\n    const segment = playlist.segments[mediaIndex];\n    const part = typeof partIndex === 'number' && segment.parts[partIndex];\n    const segmentInfo = {\n      requestId: 'segment-loader-' + Math.random(),\n      // resolve the segment URL relative to the playlist\n      uri: part && part.resolvedUri || segment.resolvedUri,\n      // the segment's mediaIndex at the time it was requested\n      mediaIndex,\n      partIndex: part ? partIndex : null,\n      // whether or not to update the SegmentLoader's state with this\n      // segment's mediaIndex\n      isSyncRequest,\n      startOfSegment,\n      // the segment's playlist\n      playlist,\n      // unencrypted bytes of the segment\n      bytes: null,\n      // when a key is defined for this segment, the encrypted bytes\n      encryptedBytes: null,\n      // The target timestampOffset for this segment when we append it\n      // to the source buffer\n      timestampOffset: null,\n      // The timeline that the segment is in\n      timeline: segment.timeline,\n      // The expected duration of the segment in seconds\n      duration: part && part.duration || segment.duration,\n      // retain the segment in case the playlist updates while doing an async process\n      segment,\n      part,\n      byteLength: 0,\n      transmuxer: this.transmuxer_,\n      // type of getMediaInfoForTime that was used to get this segment\n      getMediaInfoForTime,\n      independent\n    };\n    const overrideCheck = typeof forceTimestampOffset !== 'undefined' ? forceTimestampOffset : this.isPendingTimestampOffset_;\n    segmentInfo.timestampOffset = this.timestampOffsetForSegment_({\n      segmentTimeline: segment.timeline,\n      currentTimeline: this.currentTimeline_,\n      startOfSegment,\n      buffered: this.buffered_(),\n      overrideCheck\n    });\n    const audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());\n\n    if (typeof audioBufferedEnd === 'number') {\n      // since the transmuxer is using the actual timing values, but the buffer is\n      // adjusted by the timestamp offset, we must adjust the value here\n      segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();\n    }\n\n    if (this.sourceUpdater_.videoBuffered().length) {\n      segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(this.gopBuffer_, // since the transmuxer is using the actual timing values, but the time is\n      // adjusted by the timestmap offset, we must adjust the value here\n      this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_);\n    }\n\n    return segmentInfo;\n  } // get the timestampoffset for a segment,\n  // added so that vtt segment loader can override and prevent\n  // adding timestamp offsets.\n\n\n  timestampOffsetForSegment_(options) {\n    return timestampOffsetForSegment(options);\n  }\n  /**\n   * Determines if the network has enough bandwidth to complete the current segment\n   * request in a timely manner. If not, the request will be aborted early and bandwidth\n   * updated to trigger a playlist switch.\n   *\n   * @param {Object} stats\n   *        Object containing stats about the request timing and size\n   * @private\n   */\n\n\n  earlyAbortWhenNeeded_(stats) {\n    if (this.vhs_.tech_.paused() || // Don't abort if the current playlist is on the lowestEnabledRendition\n    // TODO: Replace using timeout with a boolean indicating whether this playlist is\n    //       the lowestEnabledRendition.\n    !this.xhrOptions_.timeout || // Don't abort if we have no bandwidth information to estimate segment sizes\n    !this.playlist_.attributes.BANDWIDTH) {\n      return;\n    } // Wait at least 1 second since the first byte of data has been received before\n    // using the calculated bandwidth from the progress event to allow the bitrate\n    // to stabilize\n\n\n    if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n      return;\n    }\n\n    const currentTime = this.currentTime_();\n    const measuredBandwidth = stats.bandwidth;\n    const segmentDuration = this.pendingSegment_.duration;\n    const requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n    // if we are only left with less than 1 second when the request completes.\n    // A negative timeUntilRebuffering indicates we are already rebuffering\n\n    const timeUntilRebuffer$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n    // is larger than the estimated time until the player runs out of forward buffer\n\n    if (requestTimeRemaining <= timeUntilRebuffer$1) {\n      return;\n    }\n\n    const switchCandidate = minRebufferMaxBandwidthSelector({\n      main: this.vhs_.playlists.main,\n      currentTime,\n      bandwidth: measuredBandwidth,\n      duration: this.duration_(),\n      segmentDuration,\n      timeUntilRebuffer: timeUntilRebuffer$1,\n      currentTimeline: this.currentTimeline_,\n      syncController: this.syncController_\n    });\n\n    if (!switchCandidate) {\n      return;\n    }\n\n    const rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1;\n    const timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n    let minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n    // potential round trip time of the new request so that we are not too aggressive\n    // with switching to a playlist that might save us a fraction of a second.\n\n    if (timeUntilRebuffer$1 <= TIME_FUDGE_FACTOR) {\n      minimumTimeSaving = 1;\n    }\n\n    if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n      return;\n    } // set the bandwidth to that of the desired playlist being sure to scale by\n    // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n    // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n\n    this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n    this.trigger('earlyabort');\n  }\n\n  handleAbort_(segmentInfo) {\n    this.logger_(`Aborting ${segmentInfoString(segmentInfo)}`);\n    this.mediaRequestsAborted += 1;\n  }\n  /**\n   * XHR `progress` event handler\n   *\n   * @param {Event}\n   *        The XHR `progress` event\n   * @param {Object} simpleSegment\n   *        A simplified segment object copy\n   * @private\n   */\n\n\n  handleProgress_(event, simpleSegment) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    this.trigger('progress');\n  }\n\n  handleTrackInfo_(simpleSegment, trackInfo) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    if (this.checkForIllegalMediaSwitch(trackInfo)) {\n      return;\n    }\n\n    trackInfo = trackInfo || {}; // When we have track info, determine what media types this loader is dealing with.\n    // Guard against cases where we're not getting track info at all until we are\n    // certain that all streams will provide it.\n\n    if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {\n      this.appendInitSegment_ = {\n        audio: true,\n        video: true\n      };\n      this.startingMediaInfo_ = trackInfo;\n      this.currentMediaInfo_ = trackInfo;\n      this.logger_('trackinfo update', trackInfo);\n      this.trigger('trackinfo');\n    } // trackinfo may cause an abort if the trackinfo\n    // causes a codec change to an unsupported codec.\n\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // set trackinfo on the pending segment so that\n    // it can append.\n\n\n    this.pendingSegment_.trackInfo = trackInfo; // check if any calls were waiting on the track info\n\n    if (this.hasEnoughInfoToAppend_()) {\n      this.processCallQueue_();\n    }\n  }\n\n  handleTimingInfo_(simpleSegment, mediaType, timeType, time) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_;\n    const timingInfoProperty = timingInfoPropertyForMedia(mediaType);\n    segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};\n    segmentInfo[timingInfoProperty][timeType] = time;\n    this.logger_(`timinginfo: ${mediaType} - ${timeType} - ${time}`); // check if any calls were waiting on the timing info\n\n    if (this.hasEnoughInfoToAppend_()) {\n      this.processCallQueue_();\n    }\n  }\n\n  handleCaptions_(simpleSegment, captionData) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // This could only happen with fmp4 segments, but\n    // should still not happen in general\n\n\n    if (captionData.length === 0) {\n      this.logger_('SegmentLoader received no captions from a caption event');\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // Wait until we have some video data so that caption timing\n    // can be adjusted by the timestamp offset\n\n    if (!segmentInfo.hasAppendedData_) {\n      this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));\n      return;\n    }\n\n    const timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();\n    const captionTracks = {}; // get total start/end and captions for each track/stream\n\n    captionData.forEach(caption => {\n      // caption.stream is actually a track name...\n      // set to the existing values in tracks or default values\n      captionTracks[caption.stream] = captionTracks[caption.stream] || {\n        // Infinity, as any other value will be less than this\n        startTime: Infinity,\n        captions: [],\n        // 0 as an other value will be more than this\n        endTime: 0\n      };\n      const captionTrack = captionTracks[caption.stream];\n      captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset);\n      captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset);\n      captionTrack.captions.push(caption);\n    });\n    Object.keys(captionTracks).forEach(trackName => {\n      const {\n        startTime,\n        endTime,\n        captions\n      } = captionTracks[trackName];\n      const inbandTextTracks = this.inbandTextTracks_;\n      this.logger_(`adding cues from ${startTime} -> ${endTime} for ${trackName}`);\n      createCaptionsTrackIfNotExists(inbandTextTracks, this.vhs_.tech_, trackName); // clear out any cues that start and end at the same time period for the same track.\n      // We do this because a rendition change that also changes the timescale for captions\n      // will result in captions being re-parsed for certain segments. If we add them again\n      // without clearing we will have two of the same captions visible.\n\n      removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);\n      addCaptionData({\n        captionArray: captions,\n        inbandTextTracks,\n        timestampOffset\n      });\n    }); // Reset stored captions since we added parsed\n    // captions to a text track at this point\n\n    if (this.transmuxer_) {\n      this.transmuxer_.postMessage({\n        action: 'clearParsedMp4Captions'\n      });\n    }\n  }\n\n  handleId3_(simpleSegment, id3Frames, dispatchType) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // we need to have appended data in order for the timestamp offset to be set\n\n    if (!segmentInfo.hasAppendedData_) {\n      this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));\n      return;\n    }\n\n    this.addMetadataToTextTrack(dispatchType, id3Frames, this.duration_());\n  }\n\n  processMetadataQueue_() {\n    this.metadataQueue_.id3.forEach(fn => fn());\n    this.metadataQueue_.caption.forEach(fn => fn());\n    this.metadataQueue_.id3 = [];\n    this.metadataQueue_.caption = [];\n  }\n\n  processCallQueue_() {\n    const callQueue = this.callQueue_; // Clear out the queue before the queued functions are run, since some of the\n    // functions may check the length of the load queue and default to pushing themselves\n    // back onto the queue.\n\n    this.callQueue_ = [];\n    callQueue.forEach(fun => fun());\n  }\n\n  processLoadQueue_() {\n    const loadQueue = this.loadQueue_; // Clear out the queue before the queued functions are run, since some of the\n    // functions may check the length of the load queue and default to pushing themselves\n    // back onto the queue.\n\n    this.loadQueue_ = [];\n    loadQueue.forEach(fun => fun());\n  }\n  /**\n   * Determines whether the loader has enough info to load the next segment.\n   *\n   * @return {boolean}\n   *         Whether or not the loader has enough info to load the next segment\n   */\n\n\n  hasEnoughInfoToLoad_() {\n    // Since primary timing goes by video, only the audio loader potentially needs to wait\n    // to load.\n    if (this.loaderType_ !== 'audio') {\n      return true;\n    }\n\n    const segmentInfo = this.pendingSegment_; // A fill buffer must have already run to establish a pending segment before there's\n    // enough info to load.\n\n    if (!segmentInfo) {\n      return false;\n    } // The first segment can and should be loaded immediately so that source buffers are\n    // created together (before appending). Source buffer creation uses the presence of\n    // audio and video data to determine whether to create audio/video source buffers, and\n    // uses processed (transmuxed or parsed) media to determine the types required.\n\n\n    if (!this.getCurrentMediaInfo_()) {\n      return true;\n    }\n\n    if ( // Technically, instead of waiting to load a segment on timeline changes, a segment\n    // can be requested and downloaded and only wait before it is transmuxed or parsed.\n    // But in practice, there are a few reasons why it is better to wait until a loader\n    // is ready to append that segment before requesting and downloading:\n    //\n    // 1. Because audio and main loaders cross discontinuities together, if this loader\n    //    is waiting for the other to catch up, then instead of requesting another\n    //    segment and using up more bandwidth, by not yet loading, more bandwidth is\n    //    allotted to the loader currently behind.\n    // 2. media-segment-request doesn't have to have logic to consider whether a segment\n    // is ready to be processed or not, isolating the queueing behavior to the loader.\n    // 3. The audio loader bases some of its segment properties on timing information\n    //    provided by the main loader, meaning that, if the logic for waiting on\n    //    processing was in media-segment-request, then it would also need to know how\n    //    to re-generate the segment information after the main loader caught up.\n    shouldWaitForTimelineChange({\n      timelineChangeController: this.timelineChangeController_,\n      currentTimeline: this.currentTimeline_,\n      segmentTimeline: segmentInfo.timeline,\n      loaderType: this.loaderType_,\n      audioDisabled: this.audioDisabled_\n    })) {\n      return false;\n    }\n\n    return true;\n  }\n\n  getCurrentMediaInfo_(segmentInfo = this.pendingSegment_) {\n    return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;\n  }\n\n  getMediaInfo_(segmentInfo = this.pendingSegment_) {\n    return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;\n  }\n\n  getPendingSegmentPlaylist() {\n    return this.pendingSegment_ ? this.pendingSegment_.playlist : null;\n  }\n\n  hasEnoughInfoToAppend_() {\n    if (!this.sourceUpdater_.ready()) {\n      return false;\n    } // If content needs to be removed or the loader is waiting on an append reattempt,\n    // then no additional content should be appended until the prior append is resolved.\n\n\n    if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {\n      return false;\n    }\n\n    const segmentInfo = this.pendingSegment_;\n    const trackInfo = this.getCurrentMediaInfo_(); // no segment to append any data for or\n    // we do not have information on this specific\n    // segment yet\n\n    if (!segmentInfo || !trackInfo) {\n      return false;\n    }\n\n    const {\n      hasAudio,\n      hasVideo,\n      isMuxed\n    } = trackInfo;\n\n    if (hasVideo && !segmentInfo.videoTimingInfo) {\n      return false;\n    } // muxed content only relies on video timing information for now.\n\n\n    if (hasAudio && !this.audioDisabled_ && !isMuxed && !segmentInfo.audioTimingInfo) {\n      return false;\n    }\n\n    if (shouldWaitForTimelineChange({\n      timelineChangeController: this.timelineChangeController_,\n      currentTimeline: this.currentTimeline_,\n      segmentTimeline: segmentInfo.timeline,\n      loaderType: this.loaderType_,\n      audioDisabled: this.audioDisabled_\n    })) {\n      return false;\n    }\n\n    return true;\n  }\n\n  handleData_(simpleSegment, result) {\n    this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n    if (this.checkForAbort_(simpleSegment.requestId)) {\n      return;\n    } // If there's anything in the call queue, then this data came later and should be\n    // executed after the calls currently queued.\n\n\n    if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {\n      this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // update the time mapping so we can translate from display time to media time\n\n    this.setTimeMapping_(segmentInfo.timeline); // for tracking overall stats\n\n    this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment); // Note that the state isn't changed from loading to appending. This is because abort\n    // logic may change behavior depending on the state, and changing state too early may\n    // inflate our estimates of bandwidth. In the future this should be re-examined to\n    // note more granular states.\n    // don't process and append data if the mediaSource is closed\n\n    if (this.mediaSource_.readyState === 'closed') {\n      return;\n    } // if this request included an initialization segment, save that data\n    // to the initSegment cache\n\n\n    if (simpleSegment.map) {\n      simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true); // move over init segment properties to media request\n\n      segmentInfo.segment.map = simpleSegment.map;\n    } // if this request included a segment key, save that data in the cache\n\n\n    if (simpleSegment.key) {\n      this.segmentKey(simpleSegment.key, true);\n    }\n\n    segmentInfo.isFmp4 = simpleSegment.isFmp4;\n    segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n\n    if (segmentInfo.isFmp4) {\n      this.trigger('fmp4');\n      segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;\n    } else {\n      const trackInfo = this.getCurrentMediaInfo_();\n      const useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n      let firstVideoFrameTimeForData;\n\n      if (useVideoTimingInfo) {\n        firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;\n      } // Segment loader knows more about segment timing than the transmuxer (in certain\n      // aspects), so make any changes required for a more accurate start time.\n      // Don't set the end time yet, as the segment may not be finished processing.\n\n\n      segmentInfo.timingInfo.start = this.trueSegmentStart_({\n        currentStart: segmentInfo.timingInfo.start,\n        playlist: segmentInfo.playlist,\n        mediaIndex: segmentInfo.mediaIndex,\n        currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),\n        useVideoTimingInfo,\n        firstVideoFrameTimeForData,\n        videoTimingInfo: segmentInfo.videoTimingInfo,\n        audioTimingInfo: segmentInfo.audioTimingInfo\n      });\n    } // Init segments for audio and video only need to be appended in certain cases. Now\n    // that data is about to be appended, we can check the final cases to determine\n    // whether we should append an init segment.\n\n\n    this.updateAppendInitSegmentStatus(segmentInfo, result.type); // Timestamp offset should be updated once we get new data and have its timing info,\n    // as we use the start of the segment to offset the best guess (playlist provided)\n    // timestamp offset.\n\n    this.updateSourceBufferTimestampOffset_(segmentInfo); // if this is a sync request we need to determine whether it should\n    // be appended or not.\n\n    if (segmentInfo.isSyncRequest) {\n      // first save/update our timing info for this segment.\n      // this is what allows us to choose an accurate segment\n      // and the main reason we make a sync request.\n      this.updateTimingInfoEnd_(segmentInfo);\n      this.syncController_.saveSegmentTimingInfo({\n        segmentInfo,\n        shouldSaveTimelineMapping: this.loaderType_ === 'main'\n      });\n      const next = this.chooseNextRequest_(); // If the sync request isn't the segment that would be requested next\n      // after taking into account its timing info, do not append it.\n\n      if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {\n        this.logger_('sync segment was incorrect, not appending');\n        return;\n      } // otherwise append it like any other segment as our guess was correct.\n\n\n      this.logger_('sync segment was correct, appending');\n    } // Save some state so that in the future anything waiting on first append (and/or\n    // timestamp offset(s)) can process immediately. While the extra state isn't optimal,\n    // we need some notion of whether the timestamp offset or other relevant information\n    // has had a chance to be set.\n\n\n    segmentInfo.hasAppendedData_ = true; // Now that the timestamp offset should be set, we can append any waiting ID3 tags.\n\n    this.processMetadataQueue_();\n    this.appendData_(segmentInfo, result);\n  }\n\n  updateAppendInitSegmentStatus(segmentInfo, type) {\n    // alt audio doesn't manage timestamp offset\n    if (this.loaderType_ === 'main' && typeof segmentInfo.timestampOffset === 'number' && // in the case that we're handling partial data, we don't want to append an init\n    // segment for each chunk\n    !segmentInfo.changedTimestampOffset) {\n      // if the timestamp offset changed, the timeline may have changed, so we have to re-\n      // append init segments\n      this.appendInitSegment_ = {\n        audio: true,\n        video: true\n      };\n    }\n\n    if (this.playlistOfLastInitSegment_[type] !== segmentInfo.playlist) {\n      // make sure we append init segment on playlist changes, in case the media config\n      // changed\n      this.appendInitSegment_[type] = true;\n    }\n  }\n\n  getInitSegmentAndUpdateState_({\n    type,\n    initSegment,\n    map,\n    playlist\n  }) {\n    // \"The EXT-X-MAP tag specifies how to obtain the Media Initialization Section\n    // (Section 3) required to parse the applicable Media Segments.  It applies to every\n    // Media Segment that appears after it in the Playlist until the next EXT-X-MAP tag\n    // or until the end of the playlist.\"\n    // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.5\n    if (map) {\n      const id = initSegmentId(map);\n\n      if (this.activeInitSegmentId_ === id) {\n        // don't need to re-append the init segment if the ID matches\n        return null;\n      } // a map-specified init segment takes priority over any transmuxed (or otherwise\n      // obtained) init segment\n      //\n      // this also caches the init segment for later use\n\n\n      initSegment = this.initSegmentForMap(map, true).bytes;\n      this.activeInitSegmentId_ = id;\n    } // We used to always prepend init segments for video, however, that shouldn't be\n    // necessary. Instead, we should only append on changes, similar to what we've always\n    // done for audio. This is more important (though may not be that important) for\n    // frame-by-frame appending for LHLS, simply because of the increased quantity of\n    // appends.\n\n\n    if (initSegment && this.appendInitSegment_[type]) {\n      // Make sure we track the playlist that we last used for the init segment, so that\n      // we can re-append the init segment in the event that we get data from a new\n      // playlist. Discontinuities and track changes are handled in other sections.\n      this.playlistOfLastInitSegment_[type] = playlist; // Disable future init segment appends for this type. Until a change is necessary.\n\n      this.appendInitSegment_[type] = false; // we need to clear out the fmp4 active init segment id, since\n      // we are appending the muxer init segment\n\n      this.activeInitSegmentId_ = null;\n      return initSegment;\n    }\n\n    return null;\n  }\n\n  handleQuotaExceededError_({\n    segmentInfo,\n    type,\n    bytes\n  }, error) {\n    const audioBuffered = this.sourceUpdater_.audioBuffered();\n    const videoBuffered = this.sourceUpdater_.videoBuffered(); // For now we're ignoring any notion of gaps in the buffer, but they, in theory,\n    // should be cleared out during the buffer removals. However, log in case it helps\n    // debug.\n\n    if (audioBuffered.length > 1) {\n      this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + timeRangesToArray(audioBuffered).join(', '));\n    }\n\n    if (videoBuffered.length > 1) {\n      this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + timeRangesToArray(videoBuffered).join(', '));\n    }\n\n    const audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;\n    const audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;\n    const videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;\n    const videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;\n\n    if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {\n      // Can't remove enough buffer to make room for new segment (or the browser doesn't\n      // allow for appends of segments this size). In the future, it may be possible to\n      // split up the segment and append in pieces, but for now, error out this playlist\n      // in an attempt to switch to a more manageable rendition.\n      this.logger_('On QUOTA_EXCEEDED_ERR, single segment too large to append to ' + 'buffer, triggering an error. ' + `Appended byte length: ${bytes.byteLength}, ` + `audio buffer: ${timeRangesToArray(audioBuffered).join(', ')}, ` + `video buffer: ${timeRangesToArray(videoBuffered).join(', ')}, `);\n      this.error({\n        message: 'Quota exceeded error with append of a single segment of content',\n        excludeUntil: Infinity\n      });\n      this.trigger('error');\n      return;\n    } // To try to resolve the quota exceeded error, clear back buffer and retry. This means\n    // that the segment-loader should block on future events until this one is handled, so\n    // that it doesn't keep moving onto further segments. Adding the call to the call\n    // queue will prevent further appends until waitingOnRemove_ and\n    // quotaExceededErrorRetryTimeout_ are cleared.\n    //\n    // Note that this will only block the current loader. In the case of demuxed content,\n    // the other load may keep filling as fast as possible. In practice, this should be\n    // OK, as it is a rare case when either audio has a high enough bitrate to fill up a\n    // source buffer, or video fills without enough room for audio to append (and without\n    // the availability of clearing out seconds of back buffer to make room for audio).\n    // But it might still be good to handle this case in the future as a TODO.\n\n\n    this.waitingOnRemove_ = true;\n    this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {\n      segmentInfo,\n      type,\n      bytes\n    }));\n    const currentTime = this.currentTime_(); // Try to remove as much audio and video as possible to make room for new content\n    // before retrying.\n\n    const timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;\n    this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${timeToRemoveUntil}`);\n    this.remove(0, timeToRemoveUntil, () => {\n      this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${MIN_BACK_BUFFER}s`);\n      this.waitingOnRemove_ = false; // wait the length of time alotted in the back buffer to prevent wasted\n      // attempts (since we can't clear less than the minimum)\n\n      this.quotaExceededErrorRetryTimeout_ = window$1.setTimeout(() => {\n        this.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue');\n        this.quotaExceededErrorRetryTimeout_ = null;\n        this.processCallQueue_();\n      }, MIN_BACK_BUFFER * 1000);\n    }, true);\n  }\n\n  handleAppendError_({\n    segmentInfo,\n    type,\n    bytes\n  }, error) {\n    // if there's no error, nothing to do\n    if (!error) {\n      return;\n    }\n\n    if (error.code === QUOTA_EXCEEDED_ERR) {\n      this.handleQuotaExceededError_({\n        segmentInfo,\n        type,\n        bytes\n      }); // A quota exceeded error should be recoverable with a future re-append, so no need\n      // to trigger an append error.\n\n      return;\n    }\n\n    this.logger_('Received non QUOTA_EXCEEDED_ERR on append', error);\n    this.error(`${type} append of ${bytes.length}b failed for segment ` + `#${segmentInfo.mediaIndex} in playlist ${segmentInfo.playlist.id}`); // If an append errors, we often can't recover.\n    // (see https://w3c.github.io/media-source/#sourcebuffer-append-error).\n    //\n    // Trigger a special error so that it can be handled separately from normal,\n    // recoverable errors.\n\n    this.trigger('appenderror');\n  }\n\n  appendToSourceBuffer_({\n    segmentInfo,\n    type,\n    initSegment,\n    data,\n    bytes\n  }) {\n    // If this is a re-append, bytes were already created and don't need to be recreated\n    if (!bytes) {\n      const segments = [data];\n      let byteLength = data.byteLength;\n\n      if (initSegment) {\n        // if the media initialization segment is changing, append it before the content\n        // segment\n        segments.unshift(initSegment);\n        byteLength += initSegment.byteLength;\n      } // Technically we should be OK appending the init segment separately, however, we\n      // haven't yet tested that, and prepending is how we have always done things.\n\n\n      bytes = concatSegments({\n        bytes: byteLength,\n        segments\n      });\n    }\n\n    this.sourceUpdater_.appendBuffer({\n      segmentInfo,\n      type,\n      bytes\n    }, this.handleAppendError_.bind(this, {\n      segmentInfo,\n      type,\n      bytes\n    }));\n  }\n\n  handleSegmentTimingInfo_(type, requestId, segmentTimingInfo) {\n    if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {\n      return;\n    }\n\n    const segment = this.pendingSegment_.segment;\n    const timingInfoProperty = `${type}TimingInfo`;\n\n    if (!segment[timingInfoProperty]) {\n      segment[timingInfoProperty] = {};\n    }\n\n    segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;\n    segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;\n    segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;\n    segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;\n    segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode; // mainly used as a reference for debugging\n\n    segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;\n  }\n\n  appendData_(segmentInfo, result) {\n    const {\n      type,\n      data\n    } = result;\n\n    if (!data || !data.byteLength) {\n      return;\n    }\n\n    if (type === 'audio' && this.audioDisabled_) {\n      return;\n    }\n\n    const initSegment = this.getInitSegmentAndUpdateState_({\n      type,\n      initSegment: result.initSegment,\n      playlist: segmentInfo.playlist,\n      map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null\n    });\n    this.appendToSourceBuffer_({\n      segmentInfo,\n      type,\n      initSegment,\n      data\n    });\n  }\n  /**\n   * load a specific segment from a request into the buffer\n   *\n   * @private\n   */\n\n\n  loadSegment_(segmentInfo) {\n    this.state = 'WAITING';\n    this.pendingSegment_ = segmentInfo;\n    this.trimBackBuffer_(segmentInfo);\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      if (this.transmuxer_) {\n        this.transmuxer_.postMessage({\n          action: 'clearAllMp4Captions'\n        });\n      }\n    }\n\n    if (!this.hasEnoughInfoToLoad_()) {\n      this.loadQueue_.push(() => {\n        // regenerate the audioAppendStart, timestampOffset, etc as they\n        // may have changed since this function was added to the queue.\n        const options = _extends({}, segmentInfo, {\n          forceTimestampOffset: true\n        });\n\n        _extends(segmentInfo, this.generateSegmentInfo_(options));\n\n        this.isPendingTimestampOffset_ = false;\n        this.updateTransmuxerAndRequestSegment_(segmentInfo);\n      });\n      return;\n    }\n\n    this.updateTransmuxerAndRequestSegment_(segmentInfo);\n  }\n\n  updateTransmuxerAndRequestSegment_(segmentInfo) {\n    // We'll update the source buffer's timestamp offset once we have transmuxed data, but\n    // the transmuxer still needs to be updated before then.\n    //\n    // Even though keepOriginalTimestamps is set to true for the transmuxer, timestamp\n    // offset must be passed to the transmuxer for stream correcting adjustments.\n    if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {\n      this.gopBuffer_.length = 0; // gopsToAlignWith was set before the GOP buffer was cleared\n\n      segmentInfo.gopsToAlignWith = [];\n      this.timeMapping_ = 0; // reset values in the transmuxer since a discontinuity should start fresh\n\n      this.transmuxer_.postMessage({\n        action: 'reset'\n      });\n      this.transmuxer_.postMessage({\n        action: 'setTimestampOffset',\n        timestampOffset: segmentInfo.timestampOffset\n      });\n    }\n\n    const simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);\n    const isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);\n    const isWalkingForward = this.mediaIndex !== null;\n    const isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && // currentTimeline starts at -1, so we shouldn't end the timeline switching to 0,\n    // the first timeline\n    segmentInfo.timeline > 0;\n    const isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;\n    this.logger_(`Requesting ${segmentInfoString(segmentInfo)}`); // If there's an init segment associated with this segment, but it is not cached (identified by a lack of bytes),\n    // then this init segment has never been seen before and should be appended.\n    //\n    // At this point the content type (audio/video or both) is not yet known, but it should be safe to set\n    // both to true and leave the decision of whether to append the init segment to append time.\n\n    if (simpleSegment.map && !simpleSegment.map.bytes) {\n      this.logger_('going to request init segment.');\n      this.appendInitSegment_ = {\n        video: true,\n        audio: true\n      };\n    }\n\n    segmentInfo.abortRequests = mediaSegmentRequest({\n      xhr: this.vhs_.xhr,\n      xhrOptions: this.xhrOptions_,\n      decryptionWorker: this.decrypter_,\n      segment: simpleSegment,\n      abortFn: this.handleAbort_.bind(this, segmentInfo),\n      progressFn: this.handleProgress_.bind(this),\n      trackInfoFn: this.handleTrackInfo_.bind(this),\n      timingInfoFn: this.handleTimingInfo_.bind(this),\n      videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', segmentInfo.requestId),\n      audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', segmentInfo.requestId),\n      captionsFn: this.handleCaptions_.bind(this),\n      isEndOfTimeline,\n      endedTimelineFn: () => {\n        this.logger_('received endedtimeline callback');\n      },\n      id3Fn: this.handleId3_.bind(this),\n      dataFn: this.handleData_.bind(this),\n      doneFn: this.segmentRequestFinished_.bind(this),\n      onTransmuxerLog: ({\n        message,\n        level,\n        stream\n      }) => {\n        this.logger_(`${segmentInfoString(segmentInfo)} logged from transmuxer stream ${stream} as a ${level}: ${message}`);\n      }\n    });\n  }\n  /**\n   * trim the back buffer so that we don't have too much data\n   * in the source buffer\n   *\n   * @private\n   *\n   * @param {Object} segmentInfo - the current segment\n   */\n\n\n  trimBackBuffer_(segmentInfo) {\n    const removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n    // buffer and a very conservative \"garbage collector\"\n    // We manually clear out the old buffer to ensure\n    // we don't trigger the QuotaExceeded error\n    // on the source buffer during subsequent appends\n\n    if (removeToTime > 0) {\n      this.remove(0, removeToTime);\n    }\n  }\n  /**\n   * created a simplified copy of the segment object with just the\n   * information necessary to perform the XHR and decryption\n   *\n   * @private\n   *\n   * @param {Object} segmentInfo - the current segment\n   * @return {Object} a simplified segment object copy\n   */\n\n\n  createSimplifiedSegmentObj_(segmentInfo) {\n    const segment = segmentInfo.segment;\n    const part = segmentInfo.part;\n    const simpleSegment = {\n      resolvedUri: part ? part.resolvedUri : segment.resolvedUri,\n      byterange: part ? part.byterange : segment.byterange,\n      requestId: segmentInfo.requestId,\n      transmuxer: segmentInfo.transmuxer,\n      audioAppendStart: segmentInfo.audioAppendStart,\n      gopsToAlignWith: segmentInfo.gopsToAlignWith,\n      part: segmentInfo.part\n    };\n    const previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];\n\n    if (previousSegment && previousSegment.timeline === segment.timeline) {\n      // The baseStartTime of a segment is used to handle rollover when probing the TS\n      // segment to retrieve timing information. Since the probe only looks at the media's\n      // times (e.g., PTS and DTS values of the segment), and doesn't consider the\n      // player's time (e.g., player.currentTime()), baseStartTime should reflect the\n      // media time as well. transmuxedDecodeEnd represents the end time of a segment, in\n      // seconds of media time, so should be used here. The previous segment is used since\n      // the end of the previous segment should represent the beginning of the current\n      // segment, so long as they are on the same timeline.\n      if (previousSegment.videoTimingInfo) {\n        simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;\n      } else if (previousSegment.audioTimingInfo) {\n        simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;\n      }\n    }\n\n    if (segment.key) {\n      // if the media sequence is greater than 2^32, the IV will be incorrect\n      // assuming 10s segments, that would be about 1300 years\n      const iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n      simpleSegment.key = this.segmentKey(segment.key);\n      simpleSegment.key.iv = iv;\n    }\n\n    if (segment.map) {\n      simpleSegment.map = this.initSegmentForMap(segment.map);\n    }\n\n    return simpleSegment;\n  }\n\n  saveTransferStats_(stats) {\n    // every request counts as a media request even if it has been aborted\n    // or canceled due to a timeout\n    this.mediaRequests += 1;\n\n    if (stats) {\n      this.mediaBytesTransferred += stats.bytesReceived;\n      this.mediaTransferDuration += stats.roundTripTime;\n    }\n  }\n\n  saveBandwidthRelatedStats_(duration, stats) {\n    // byteLength will be used for throughput, and should be based on bytes receieved,\n    // which we only know at the end of the request and should reflect total bytes\n    // downloaded rather than just bytes processed from components of the segment\n    this.pendingSegment_.byteLength = stats.bytesReceived;\n\n    if (duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n      this.logger_(`Ignoring segment's bandwidth because its duration of ${duration}` + ` is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS}`);\n      return;\n    }\n\n    this.bandwidth = stats.bandwidth;\n    this.roundTrip = stats.roundTripTime;\n  }\n\n  handleTimeout_() {\n    // although the VTT segment loader bandwidth isn't really used, it's good to\n    // maintain functinality between segment loaders\n    this.mediaRequestsTimedout += 1;\n    this.bandwidth = 1;\n    this.roundTrip = NaN;\n    this.trigger('bandwidthupdate');\n    this.trigger('timeout');\n  }\n  /**\n   * Handle the callback from the segmentRequest function and set the\n   * associated SegmentLoader state and errors if necessary\n   *\n   * @private\n   */\n\n\n  segmentRequestFinished_(error, simpleSegment, result) {\n    // TODO handle special cases, e.g., muxed audio/video but only audio in the segment\n    // check the call queue directly since this function doesn't need to deal with any\n    // data, and can continue even if the source buffers are not set up and we didn't get\n    // any data from the segment\n    if (this.callQueue_.length) {\n      this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));\n      return;\n    }\n\n    this.saveTransferStats_(simpleSegment.stats); // The request was aborted and the SegmentLoader has already been reset\n\n    if (!this.pendingSegment_) {\n      return;\n    } // the request was aborted and the SegmentLoader has already started\n    // another request. this can happen when the timeout for an aborted\n    // request triggers due to a limitation in the XHR library\n    // do not count this as any sort of request or we risk double-counting\n\n\n    if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n      return;\n    } // an error occurred from the active pendingSegment_ so reset everything\n\n\n    if (error) {\n      this.pendingSegment_ = null;\n      this.state = 'READY'; // aborts are not a true error condition and nothing corrective needs to be done\n\n      if (error.code === REQUEST_ERRORS.ABORTED) {\n        return;\n      }\n\n      this.pause(); // the error is really just that at least one of the requests timed-out\n      // set the bandwidth to a very low value and trigger an ABR switch to\n      // take emergency action\n\n      if (error.code === REQUEST_ERRORS.TIMEOUT) {\n        this.handleTimeout_();\n        return;\n      } // if control-flow has arrived here, then the error is real\n      // emit an error event to exclude the current playlist\n\n\n      this.mediaRequestsErrored += 1;\n      this.error(error);\n      this.trigger('error');\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // the response was a success so set any bandwidth stats the request\n    // generated for ABR purposes\n\n    this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);\n    segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;\n\n    if (result.gopInfo) {\n      this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);\n    } // Although we may have already started appending on progress, we shouldn't switch the\n    // state away from loading until we are officially done loading the segment data.\n\n\n    this.state = 'APPENDING'; // used for testing\n\n    this.trigger('appending');\n    this.waitForAppendsToComplete_(segmentInfo);\n  }\n\n  setTimeMapping_(timeline) {\n    const timelineMapping = this.syncController_.mappingForTimeline(timeline);\n\n    if (timelineMapping !== null) {\n      this.timeMapping_ = timelineMapping;\n    }\n  }\n\n  updateMediaSecondsLoaded_(segment) {\n    if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n      this.mediaSecondsLoaded += segment.end - segment.start;\n    } else {\n      this.mediaSecondsLoaded += segment.duration;\n    }\n  }\n\n  shouldUpdateTransmuxerTimestampOffset_(timestampOffset) {\n    if (timestampOffset === null) {\n      return false;\n    } // note that we're potentially using the same timestamp offset for both video and\n    // audio\n\n\n    if (this.loaderType_ === 'main' && timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n      return true;\n    }\n\n    if (!this.audioDisabled_ && timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n      return true;\n    }\n\n    return false;\n  }\n\n  trueSegmentStart_({\n    currentStart,\n    playlist,\n    mediaIndex,\n    firstVideoFrameTimeForData,\n    currentVideoTimestampOffset,\n    useVideoTimingInfo,\n    videoTimingInfo,\n    audioTimingInfo\n  }) {\n    if (typeof currentStart !== 'undefined') {\n      // if start was set once, keep using it\n      return currentStart;\n    }\n\n    if (!useVideoTimingInfo) {\n      return audioTimingInfo.start;\n    }\n\n    const previousSegment = playlist.segments[mediaIndex - 1]; // The start of a segment should be the start of the first full frame contained\n    // within that segment. Since the transmuxer maintains a cache of incomplete data\n    // from and/or the last frame seen, the start time may reflect a frame that starts\n    // in the previous segment. Check for that case and ensure the start time is\n    // accurate for the segment.\n\n    if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === 'undefined' || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {\n      return firstVideoFrameTimeForData;\n    }\n\n    return videoTimingInfo.start;\n  }\n\n  waitForAppendsToComplete_(segmentInfo) {\n    const trackInfo = this.getCurrentMediaInfo_(segmentInfo);\n\n    if (!trackInfo) {\n      this.error({\n        message: 'No starting media returned, likely due to an unsupported media format.',\n        playlistExclusionDuration: Infinity\n      });\n      this.trigger('error');\n      return;\n    } // Although transmuxing is done, appends may not yet be finished. Throw a marker\n    // on each queue this loader is responsible for to ensure that the appends are\n    // complete.\n\n\n    const {\n      hasAudio,\n      hasVideo,\n      isMuxed\n    } = trackInfo;\n    const waitForVideo = this.loaderType_ === 'main' && hasVideo;\n    const waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed;\n    segmentInfo.waitingOnAppends = 0; // segments with no data\n\n    if (!segmentInfo.hasAppendedData_) {\n      if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === 'number') {\n        // When there's no audio or video data in the segment, there's no audio or video\n        // timing information.\n        //\n        // If there's no audio or video timing information, then the timestamp offset\n        // can't be adjusted to the appropriate value for the transmuxer and source\n        // buffers.\n        //\n        // Therefore, the next segment should be used to set the timestamp offset.\n        this.isPendingTimestampOffset_ = true;\n      } // override settings for metadata only segments\n\n\n      segmentInfo.timingInfo = {\n        start: 0\n      };\n      segmentInfo.waitingOnAppends++;\n\n      if (!this.isPendingTimestampOffset_) {\n        // update the timestampoffset\n        this.updateSourceBufferTimestampOffset_(segmentInfo); // make sure the metadata queue is processed even though we have\n        // no video/audio data.\n\n        this.processMetadataQueue_();\n      } // append is \"done\" instantly with no data.\n\n\n      this.checkAppendsDone_(segmentInfo);\n      return;\n    } // Since source updater could call back synchronously, do the increments first.\n\n\n    if (waitForVideo) {\n      segmentInfo.waitingOnAppends++;\n    }\n\n    if (waitForAudio) {\n      segmentInfo.waitingOnAppends++;\n    }\n\n    if (waitForVideo) {\n      this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n    }\n\n    if (waitForAudio) {\n      this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n    }\n  }\n\n  checkAppendsDone_(segmentInfo) {\n    if (this.checkForAbort_(segmentInfo.requestId)) {\n      return;\n    }\n\n    segmentInfo.waitingOnAppends--;\n\n    if (segmentInfo.waitingOnAppends === 0) {\n      this.handleAppendsDone_();\n    }\n  }\n\n  checkForIllegalMediaSwitch(trackInfo) {\n    const illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);\n\n    if (illegalMediaSwitchError) {\n      this.error({\n        message: illegalMediaSwitchError,\n        playlistExclusionDuration: Infinity\n      });\n      this.trigger('error');\n      return true;\n    }\n\n    return false;\n  }\n\n  updateSourceBufferTimestampOffset_(segmentInfo) {\n    if (segmentInfo.timestampOffset === null || // we don't yet have the start for whatever media type (video or audio) has\n    // priority, timing-wise, so we must wait\n    typeof segmentInfo.timingInfo.start !== 'number' || // already updated the timestamp offset for this segment\n    segmentInfo.changedTimestampOffset || // the alt audio loader should not be responsible for setting the timestamp offset\n    this.loaderType_ !== 'main') {\n      return;\n    }\n\n    let didChange = false; // Primary timing goes by video, and audio is trimmed in the transmuxer, meaning that\n    // the timing info here comes from video. In the event that the audio is longer than\n    // the video, this will trim the start of the audio.\n    // This also trims any offset from 0 at the beginning of the media\n\n    segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({\n      videoTimingInfo: segmentInfo.segment.videoTimingInfo,\n      audioTimingInfo: segmentInfo.segment.audioTimingInfo,\n      timingInfo: segmentInfo.timingInfo\n    }); // In the event that there are part segment downloads, each will try to update the\n    // timestamp offset. Retaining this bit of state prevents us from updating in the\n    // future (within the same segment), however, there may be a better way to handle it.\n\n    segmentInfo.changedTimestampOffset = true;\n\n    if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n      this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);\n      didChange = true;\n    }\n\n    if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n      this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);\n      didChange = true;\n    }\n\n    if (didChange) {\n      this.trigger('timestampoffset');\n    }\n  }\n\n  getSegmentStartTimeForTimestampOffsetCalculation_({\n    videoTimingInfo,\n    audioTimingInfo,\n    timingInfo\n  }) {\n    if (!this.useDtsForTimestampOffset_) {\n      return timingInfo.start;\n    }\n\n    if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === 'number') {\n      return videoTimingInfo.transmuxedDecodeStart;\n    } // handle audio only\n\n\n    if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === 'number') {\n      return audioTimingInfo.transmuxedDecodeStart;\n    } // handle content not transmuxed (e.g., MP4)\n\n\n    return timingInfo.start;\n  }\n\n  updateTimingInfoEnd_(segmentInfo) {\n    segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n    const trackInfo = this.getMediaInfo_();\n    const useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n    const prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;\n\n    if (!prioritizedTimingInfo) {\n      return;\n    }\n\n    segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === 'number' ? // End time may not exist in a case where we aren't parsing the full segment (one\n    // current example is the case of fmp4), so use the rough duration to calculate an\n    // end time.\n    prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;\n  }\n  /**\n   * callback to run when appendBuffer is finished. detects if we are\n   * in a good state to do things with the data we got, or if we need\n   * to wait for more\n   *\n   * @private\n   */\n\n\n  handleAppendsDone_() {\n    // appendsdone can cause an abort\n    if (this.pendingSegment_) {\n      this.trigger('appendsdone');\n    }\n\n    if (!this.pendingSegment_) {\n      this.state = 'READY'; // TODO should this move into this.checkForAbort to speed up requests post abort in\n      // all appending cases?\n\n      if (!this.paused()) {\n        this.monitorBuffer_();\n      }\n\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // Now that the end of the segment has been reached, we can set the end time. It's\n    // best to wait until all appends are done so we're sure that the primary media is\n    // finished (and we have its end time).\n\n    this.updateTimingInfoEnd_(segmentInfo);\n\n    if (this.shouldSaveSegmentTimingInfo_) {\n      // Timeline mappings should only be saved for the main loader. This is for multiple\n      // reasons:\n      //\n      // 1) Only one mapping is saved per timeline, meaning that if both the audio loader\n      //    and the main loader try to save the timeline mapping, whichever comes later\n      //    will overwrite the first. In theory this is OK, as the mappings should be the\n      //    same, however, it breaks for (2)\n      // 2) In the event of a live stream, the initial live point will make for a somewhat\n      //    arbitrary mapping. If audio and video streams are not perfectly in-sync, then\n      //    the mapping will be off for one of the streams, dependent on which one was\n      //    first saved (see (1)).\n      // 3) Primary timing goes by video in VHS, so the mapping should be video.\n      //\n      // Since the audio loader will wait for the main loader to load the first segment,\n      // the main loader will save the first timeline mapping, and ensure that there won't\n      // be a case where audio loads two segments without saving a mapping (thus leading\n      // to missing segment timing info).\n      this.syncController_.saveSegmentTimingInfo({\n        segmentInfo,\n        shouldSaveTimelineMapping: this.loaderType_ === 'main'\n      });\n    }\n\n    const segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);\n\n    if (segmentDurationMessage) {\n      if (segmentDurationMessage.severity === 'warn') {\n        videojs.log.warn(segmentDurationMessage.message);\n      } else {\n        this.logger_(segmentDurationMessage.message);\n      }\n    }\n\n    this.recordThroughput_(segmentInfo);\n    this.pendingSegment_ = null;\n    this.state = 'READY';\n\n    if (segmentInfo.isSyncRequest) {\n      this.trigger('syncinfoupdate'); // if the sync request was not appended\n      // then it was not the correct segment.\n      // throw it away and use the data it gave us\n      // to get the correct one.\n\n      if (!segmentInfo.hasAppendedData_) {\n        this.logger_(`Throwing away un-appended sync request ${segmentInfoString(segmentInfo)}`);\n        return;\n      }\n    }\n\n    this.logger_(`Appended ${segmentInfoString(segmentInfo)}`);\n    this.addSegmentMetadataCue_(segmentInfo);\n    this.fetchAtBuffer_ = true;\n\n    if (this.currentTimeline_ !== segmentInfo.timeline) {\n      this.timelineChangeController_.lastTimelineChange({\n        type: this.loaderType_,\n        from: this.currentTimeline_,\n        to: segmentInfo.timeline\n      }); // If audio is not disabled, the main segment loader is responsible for updating\n      // the audio timeline as well. If the content is video only, this won't have any\n      // impact.\n\n      if (this.loaderType_ === 'main' && !this.audioDisabled_) {\n        this.timelineChangeController_.lastTimelineChange({\n          type: 'audio',\n          from: this.currentTimeline_,\n          to: segmentInfo.timeline\n        });\n      }\n    }\n\n    this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n    // the following conditional otherwise it may consider this a bad \"guess\"\n    // and attempt to resync when the post-update seekable window and live\n    // point would mean that this was the perfect segment to fetch\n\n    this.trigger('syncinfoupdate');\n    const segment = segmentInfo.segment;\n    const part = segmentInfo.part;\n    const badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;\n    const badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3; // If we previously appended a segment/part that ends more than 3 part/targetDurations before\n    // the currentTime_ that means that our conservative guess was too conservative.\n    // In that case, reset the loader state so that we try to use any information gained\n    // from the previous request to create a new, more accurate, sync-point.\n\n    if (badSegmentGuess || badPartGuess) {\n      this.logger_(`bad ${badSegmentGuess ? 'segment' : 'part'} ${segmentInfoString(segmentInfo)}`);\n      this.resetEverything();\n      return;\n    }\n\n    const isWalkingForward = this.mediaIndex !== null; // Don't do a rendition switch unless we have enough time to get a sync segment\n    // and conservatively guess\n\n    if (isWalkingForward) {\n      this.trigger('bandwidthupdate');\n    }\n\n    this.trigger('progress');\n    this.mediaIndex = segmentInfo.mediaIndex;\n    this.partIndex = segmentInfo.partIndex; // any time an update finishes and the last segment is in the\n    // buffer, end the stream. this ensures the \"ended\" event will\n    // fire if playback reaches that point.\n\n    if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {\n      this.endOfStream();\n    } // used for testing\n\n\n    this.trigger('appended');\n\n    if (segmentInfo.hasAppendedData_) {\n      this.mediaAppends++;\n    }\n\n    if (!this.paused()) {\n      this.monitorBuffer_();\n    }\n  }\n  /**\n   * Records the current throughput of the decrypt, transmux, and append\n   * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n   * moving average of the throughput. `throughput.count` is the number of\n   * data points in the average.\n   *\n   * @private\n   * @param {Object} segmentInfo the object returned by loadSegment\n   */\n\n\n  recordThroughput_(segmentInfo) {\n    if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n      this.logger_(`Ignoring segment's throughput because its duration of ${segmentInfo.duration}` + ` is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS}`);\n      return;\n    }\n\n    const rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n    // by zero in the case where the throughput is ridiculously high\n\n    const segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n    const segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n    //   newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n    this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n  }\n  /**\n   * Adds a cue to the segment-metadata track with some metadata information about the\n   * segment\n   *\n   * @private\n   * @param {Object} segmentInfo\n   *        the object returned by loadSegment\n   * @method addSegmentMetadataCue_\n   */\n\n\n  addSegmentMetadataCue_(segmentInfo) {\n    if (!this.segmentMetadataTrack_) {\n      return;\n    }\n\n    const segment = segmentInfo.segment;\n    const start = segment.start;\n    const end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n    if (!finite(start) || !finite(end)) {\n      return;\n    }\n\n    removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n    const Cue = window$1.WebKitDataCue || window$1.VTTCue;\n    const value = {\n      custom: segment.custom,\n      dateTimeObject: segment.dateTimeObject,\n      dateTimeString: segment.dateTimeString,\n      programDateTime: segment.programDateTime,\n      bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n      resolution: segmentInfo.playlist.attributes.RESOLUTION,\n      codecs: segmentInfo.playlist.attributes.CODECS,\n      byteLength: segmentInfo.byteLength,\n      uri: segmentInfo.uri,\n      timeline: segmentInfo.timeline,\n      playlist: segmentInfo.playlist.id,\n      start,\n      end\n    };\n    const data = JSON.stringify(value);\n    const cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n    // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n    cue.value = value;\n    this.segmentMetadataTrack_.addCue(cue);\n  }\n\n}\n\nfunction noop() {}\n\nconst toTitleCase = function (string) {\n  if (typeof string !== 'string') {\n    return string;\n  }\n\n  return string.replace(/./, w => w.toUpperCase());\n};\n\n/**\n * @file source-updater.js\n */\nconst bufferTypes = ['video', 'audio'];\n\nconst updating = (type, sourceUpdater) => {\n  const sourceBuffer = sourceUpdater[`${type}Buffer`];\n  return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type];\n};\n\nconst nextQueueIndexOfType = (type, queue) => {\n  for (let i = 0; i < queue.length; i++) {\n    const queueEntry = queue[i];\n\n    if (queueEntry.type === 'mediaSource') {\n      // If the next entry is a media source entry (uses multiple source buffers), block\n      // processing to allow it to go through first.\n      return null;\n    }\n\n    if (queueEntry.type === type) {\n      return i;\n    }\n  }\n\n  return null;\n};\n\nconst shiftQueue = (type, sourceUpdater) => {\n  if (sourceUpdater.queue.length === 0) {\n    return;\n  }\n\n  let queueIndex = 0;\n  let queueEntry = sourceUpdater.queue[queueIndex];\n\n  if (queueEntry.type === 'mediaSource') {\n    if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== 'closed') {\n      sourceUpdater.queue.shift();\n      queueEntry.action(sourceUpdater);\n\n      if (queueEntry.doneFn) {\n        queueEntry.doneFn();\n      } // Only specific source buffer actions must wait for async updateend events. Media\n      // Source actions process synchronously. Therefore, both audio and video source\n      // buffers are now clear to process the next queue entries.\n\n\n      shiftQueue('audio', sourceUpdater);\n      shiftQueue('video', sourceUpdater);\n    } // Media Source actions require both source buffers, so if the media source action\n    // couldn't process yet (because one or both source buffers are busy), block other\n    // queue actions until both are available and the media source action can process.\n\n\n    return;\n  }\n\n  if (type === 'mediaSource') {\n    // If the queue was shifted by a media source action (this happens when pushing a\n    // media source action onto the queue), then it wasn't from an updateend event from an\n    // audio or video source buffer, so there's no change from previous state, and no\n    // processing should be done.\n    return;\n  } // Media source queue entries don't need to consider whether the source updater is\n  // started (i.e., source buffers are created) as they don't need the source buffers, but\n  // source buffer queue entries do.\n\n\n  if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === 'closed' || updating(type, sourceUpdater)) {\n    return;\n  }\n\n  if (queueEntry.type !== type) {\n    queueIndex = nextQueueIndexOfType(type, sourceUpdater.queue);\n\n    if (queueIndex === null) {\n      // Either there's no queue entry that uses this source buffer type in the queue, or\n      // there's a media source queue entry before the next entry of this type, in which\n      // case wait for that action to process first.\n      return;\n    }\n\n    queueEntry = sourceUpdater.queue[queueIndex];\n  }\n\n  sourceUpdater.queue.splice(queueIndex, 1); // Keep a record that this source buffer type is in use.\n  //\n  // The queue pending operation must be set before the action is performed in the event\n  // that the action results in a synchronous event that is acted upon. For instance, if\n  // an exception is thrown that can be handled, it's possible that new actions will be\n  // appended to an empty queue and immediately executed, but would not have the correct\n  // pending information if this property was set after the action was performed.\n\n  sourceUpdater.queuePending[type] = queueEntry;\n  queueEntry.action(type, sourceUpdater);\n\n  if (!queueEntry.doneFn) {\n    // synchronous operation, process next entry\n    sourceUpdater.queuePending[type] = null;\n    shiftQueue(type, sourceUpdater);\n    return;\n  }\n};\n\nconst cleanupBuffer = (type, sourceUpdater) => {\n  const buffer = sourceUpdater[`${type}Buffer`];\n  const titleType = toTitleCase(type);\n\n  if (!buffer) {\n    return;\n  }\n\n  buffer.removeEventListener('updateend', sourceUpdater[`on${titleType}UpdateEnd_`]);\n  buffer.removeEventListener('error', sourceUpdater[`on${titleType}Error_`]);\n  sourceUpdater.codecs[type] = null;\n  sourceUpdater[`${type}Buffer`] = null;\n};\n\nconst inSourceBuffers = (mediaSource, sourceBuffer) => mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;\n\nconst actions = {\n  appendBuffer: (bytes, segmentInfo, onError) => (type, sourceUpdater) => {\n    const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    }\n\n    sourceUpdater.logger_(`Appending segment ${segmentInfo.mediaIndex}'s ${bytes.length} bytes to ${type}Buffer`);\n\n    try {\n      sourceBuffer.appendBuffer(bytes);\n    } catch (e) {\n      sourceUpdater.logger_(`Error with code ${e.code} ` + (e.code === QUOTA_EXCEEDED_ERR ? '(QUOTA_EXCEEDED_ERR) ' : '') + `when appending segment ${segmentInfo.mediaIndex} to ${type}Buffer`);\n      sourceUpdater.queuePending[type] = null;\n      onError(e);\n    }\n  },\n  remove: (start, end) => (type, sourceUpdater) => {\n    const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    }\n\n    sourceUpdater.logger_(`Removing ${start} to ${end} from ${type}Buffer`);\n\n    try {\n      sourceBuffer.remove(start, end);\n    } catch (e) {\n      sourceUpdater.logger_(`Remove ${start} to ${end} from ${type}Buffer failed`);\n    }\n  },\n  timestampOffset: offset => (type, sourceUpdater) => {\n    const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    }\n\n    sourceUpdater.logger_(`Setting ${type}timestampOffset to ${offset}`);\n    sourceBuffer.timestampOffset = offset;\n  },\n  callback: callback => (type, sourceUpdater) => {\n    callback();\n  },\n  endOfStream: error => sourceUpdater => {\n    if (sourceUpdater.mediaSource.readyState !== 'open') {\n      return;\n    }\n\n    sourceUpdater.logger_(`Calling mediaSource endOfStream(${error || ''})`);\n\n    try {\n      sourceUpdater.mediaSource.endOfStream(error);\n    } catch (e) {\n      videojs.log.warn('Failed to call media source endOfStream', e);\n    }\n  },\n  duration: duration => sourceUpdater => {\n    sourceUpdater.logger_(`Setting mediaSource duration to ${duration}`);\n\n    try {\n      sourceUpdater.mediaSource.duration = duration;\n    } catch (e) {\n      videojs.log.warn('Failed to set media source duration', e);\n    }\n  },\n  abort: () => (type, sourceUpdater) => {\n    if (sourceUpdater.mediaSource.readyState !== 'open') {\n      return;\n    }\n\n    const sourceBuffer = sourceUpdater[`${type}Buffer`]; // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    }\n\n    sourceUpdater.logger_(`calling abort on ${type}Buffer`);\n\n    try {\n      sourceBuffer.abort();\n    } catch (e) {\n      videojs.log.warn(`Failed to abort on ${type}Buffer`, e);\n    }\n  },\n  addSourceBuffer: (type, codec) => sourceUpdater => {\n    const titleType = toTitleCase(type);\n    const mime = getMimeForCodec(codec);\n    sourceUpdater.logger_(`Adding ${type}Buffer with codec ${codec} to mediaSource`);\n    const sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);\n    sourceBuffer.addEventListener('updateend', sourceUpdater[`on${titleType}UpdateEnd_`]);\n    sourceBuffer.addEventListener('error', sourceUpdater[`on${titleType}Error_`]);\n    sourceUpdater.codecs[type] = codec;\n    sourceUpdater[`${type}Buffer`] = sourceBuffer;\n  },\n  removeSourceBuffer: type => sourceUpdater => {\n    const sourceBuffer = sourceUpdater[`${type}Buffer`];\n    cleanupBuffer(type, sourceUpdater); // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    }\n\n    sourceUpdater.logger_(`Removing ${type}Buffer with codec ${sourceUpdater.codecs[type]} from mediaSource`);\n\n    try {\n      sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);\n    } catch (e) {\n      videojs.log.warn(`Failed to removeSourceBuffer ${type}Buffer`, e);\n    }\n  },\n  changeType: codec => (type, sourceUpdater) => {\n    const sourceBuffer = sourceUpdater[`${type}Buffer`];\n    const mime = getMimeForCodec(codec); // can't do anything if the media source / source buffer is null\n    // or the media source does not contain this source buffer.\n\n    if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n      return;\n    } // do not update codec if we don't need to.\n\n\n    if (sourceUpdater.codecs[type] === codec) {\n      return;\n    }\n\n    sourceUpdater.logger_(`changing ${type}Buffer codec from ${sourceUpdater.codecs[type]} to ${codec}`); // check if change to the provided type is supported\n\n    try {\n      sourceBuffer.changeType(mime);\n      sourceUpdater.codecs[type] = codec;\n    } catch (e) {\n      videojs.log.warn(`Failed to changeType on ${type}Buffer`, e);\n    }\n  }\n};\n\nconst pushQueue = ({\n  type,\n  sourceUpdater,\n  action,\n  doneFn,\n  name\n}) => {\n  sourceUpdater.queue.push({\n    type,\n    action,\n    doneFn,\n    name\n  });\n  shiftQueue(type, sourceUpdater);\n};\n\nconst onUpdateend = (type, sourceUpdater) => e => {\n  // Although there should, in theory, be a pending action for any updateend receieved,\n  // there are some actions that may trigger updateend events without set definitions in\n  // the w3c spec. For instance, setting the duration on the media source may trigger\n  // updateend events on source buffers. This does not appear to be in the spec. As such,\n  // if we encounter an updateend without a corresponding pending action from our queue\n  // for that source buffer type, process the next action.\n  if (sourceUpdater.queuePending[type]) {\n    const doneFn = sourceUpdater.queuePending[type].doneFn;\n    sourceUpdater.queuePending[type] = null;\n\n    if (doneFn) {\n      // if there's an error, report it\n      doneFn(sourceUpdater[`${type}Error_`]);\n    }\n  }\n\n  shiftQueue(type, sourceUpdater);\n};\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the SourceBuffer from\n * @param {string} mimeType the desired MIME type of the underlying SourceBuffer\n */\n\n\nclass SourceUpdater extends videojs.EventTarget {\n  constructor(mediaSource) {\n    super();\n    this.mediaSource = mediaSource;\n\n    this.sourceopenListener_ = () => shiftQueue('mediaSource', this);\n\n    this.mediaSource.addEventListener('sourceopen', this.sourceopenListener_);\n    this.logger_ = logger('SourceUpdater'); // initial timestamp offset is 0\n\n    this.audioTimestampOffset_ = 0;\n    this.videoTimestampOffset_ = 0;\n    this.queue = [];\n    this.queuePending = {\n      audio: null,\n      video: null\n    };\n    this.delayedAudioAppendQueue_ = [];\n    this.videoAppendQueued_ = false;\n    this.codecs = {};\n    this.onVideoUpdateEnd_ = onUpdateend('video', this);\n    this.onAudioUpdateEnd_ = onUpdateend('audio', this);\n\n    this.onVideoError_ = e => {\n      // used for debugging\n      this.videoError_ = e;\n    };\n\n    this.onAudioError_ = e => {\n      // used for debugging\n      this.audioError_ = e;\n    };\n\n    this.createdSourceBuffers_ = false;\n    this.initializedEme_ = false;\n    this.triggeredReady_ = false;\n  }\n\n  initializedEme() {\n    this.initializedEme_ = true;\n    this.triggerReady();\n  }\n\n  hasCreatedSourceBuffers() {\n    // if false, likely waiting on one of the segment loaders to get enough data to create\n    // source buffers\n    return this.createdSourceBuffers_;\n  }\n\n  hasInitializedAnyEme() {\n    return this.initializedEme_;\n  }\n\n  ready() {\n    return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();\n  }\n\n  createSourceBuffers(codecs) {\n    if (this.hasCreatedSourceBuffers()) {\n      // already created them before\n      return;\n    } // the intial addOrChangeSourceBuffers will always be\n    // two add buffers.\n\n\n    this.addOrChangeSourceBuffers(codecs);\n    this.createdSourceBuffers_ = true;\n    this.trigger('createdsourcebuffers');\n    this.triggerReady();\n  }\n\n  triggerReady() {\n    // only allow ready to be triggered once, this prevents the case\n    // where:\n    // 1. we trigger createdsourcebuffers\n    // 2. ie 11 synchronously initializates eme\n    // 3. the synchronous initialization causes us to trigger ready\n    // 4. We go back to the ready check in createSourceBuffers and ready is triggered again.\n    if (this.ready() && !this.triggeredReady_) {\n      this.triggeredReady_ = true;\n      this.trigger('ready');\n    }\n  }\n  /**\n   * Add a type of source buffer to the media source.\n   *\n   * @param {string} type\n   *        The type of source buffer to add.\n   *\n   * @param {string} codec\n   *        The codec to add the source buffer with.\n   */\n\n\n  addSourceBuffer(type, codec) {\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.addSourceBuffer(type, codec),\n      name: 'addSourceBuffer'\n    });\n  }\n  /**\n   * call abort on a source buffer.\n   *\n   * @param {string} type\n   *        The type of source buffer to call abort on.\n   */\n\n\n  abort(type) {\n    pushQueue({\n      type,\n      sourceUpdater: this,\n      action: actions.abort(type),\n      name: 'abort'\n    });\n  }\n  /**\n   * Call removeSourceBuffer and remove a specific type\n   * of source buffer on the mediaSource.\n   *\n   * @param {string} type\n   *        The type of source buffer to remove.\n   */\n\n\n  removeSourceBuffer(type) {\n    if (!this.canRemoveSourceBuffer()) {\n      videojs.log.error('removeSourceBuffer is not supported!');\n      return;\n    }\n\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.removeSourceBuffer(type),\n      name: 'removeSourceBuffer'\n    });\n  }\n  /**\n   * Whether or not the removeSourceBuffer function is supported\n   * on the mediaSource.\n   *\n   * @return {boolean}\n   *          if removeSourceBuffer can be called.\n   */\n\n\n  canRemoveSourceBuffer() {\n    // As of Firefox 83 removeSourceBuffer\n    // throws errors, so we report that it does not support this.\n    return !videojs.browser.IS_FIREFOX && window$1.MediaSource && window$1.MediaSource.prototype && typeof window$1.MediaSource.prototype.removeSourceBuffer === 'function';\n  }\n  /**\n   * Whether or not the changeType function is supported\n   * on our SourceBuffers.\n   *\n   * @return {boolean}\n   *         if changeType can be called.\n   */\n\n\n  static canChangeType() {\n    return window$1.SourceBuffer && window$1.SourceBuffer.prototype && typeof window$1.SourceBuffer.prototype.changeType === 'function';\n  }\n  /**\n   * Whether or not the changeType function is supported\n   * on our SourceBuffers.\n   *\n   * @return {boolean}\n   *         if changeType can be called.\n   */\n\n\n  canChangeType() {\n    return this.constructor.canChangeType();\n  }\n  /**\n   * Call the changeType function on a source buffer, given the code and type.\n   *\n   * @param {string} type\n   *        The type of source buffer to call changeType on.\n   *\n   * @param {string} codec\n   *        The codec string to change type with on the source buffer.\n   */\n\n\n  changeType(type, codec) {\n    if (!this.canChangeType()) {\n      videojs.log.error('changeType is not supported!');\n      return;\n    }\n\n    pushQueue({\n      type,\n      sourceUpdater: this,\n      action: actions.changeType(codec),\n      name: 'changeType'\n    });\n  }\n  /**\n   * Add source buffers with a codec or, if they are already created,\n   * call changeType on source buffers using changeType.\n   *\n   * @param {Object} codecs\n   *        Codecs to switch to\n   */\n\n\n  addOrChangeSourceBuffers(codecs) {\n    if (!codecs || typeof codecs !== 'object' || Object.keys(codecs).length === 0) {\n      throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs');\n    }\n\n    Object.keys(codecs).forEach(type => {\n      const codec = codecs[type];\n\n      if (!this.hasCreatedSourceBuffers()) {\n        return this.addSourceBuffer(type, codec);\n      }\n\n      if (this.canChangeType()) {\n        this.changeType(type, codec);\n      }\n    });\n  }\n  /**\n   * Queue an update to append an ArrayBuffer.\n   *\n   * @param {MediaObject} object containing audioBytes and/or videoBytes\n   * @param {Function} done the function to call when done\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n   */\n\n\n  appendBuffer(options, doneFn) {\n    const {\n      segmentInfo,\n      type,\n      bytes\n    } = options;\n    this.processedAppend_ = true;\n\n    if (type === 'audio' && this.videoBuffer && !this.videoAppendQueued_) {\n      this.delayedAudioAppendQueue_.push([options, doneFn]);\n      this.logger_(`delayed audio append of ${bytes.length} until video append`);\n      return;\n    } // In the case of certain errors, for instance, QUOTA_EXCEEDED_ERR, updateend will\n    // not be fired. This means that the queue will be blocked until the next action\n    // taken by the segment-loader. Provide a mechanism for segment-loader to handle\n    // these errors by calling the doneFn with the specific error.\n\n\n    const onError = doneFn;\n    pushQueue({\n      type,\n      sourceUpdater: this,\n      action: actions.appendBuffer(bytes, segmentInfo || {\n        mediaIndex: -1\n      }, onError),\n      doneFn,\n      name: 'appendBuffer'\n    });\n\n    if (type === 'video') {\n      this.videoAppendQueued_ = true;\n\n      if (!this.delayedAudioAppendQueue_.length) {\n        return;\n      }\n\n      const queue = this.delayedAudioAppendQueue_.slice();\n      this.logger_(`queuing delayed audio ${queue.length} appendBuffers`);\n      this.delayedAudioAppendQueue_.length = 0;\n      queue.forEach(que => {\n        this.appendBuffer.apply(this, que);\n      });\n    }\n  }\n  /**\n   * Get the audio buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         The audio buffer's buffered time range\n   */\n\n\n  audioBuffered() {\n    // no media source/source buffer or it isn't in the media sources\n    // source buffer list\n    if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {\n      return createTimeRanges();\n    }\n\n    return this.audioBuffer.buffered ? this.audioBuffer.buffered : createTimeRanges();\n  }\n  /**\n   * Get the video buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         The video buffer's buffered time range\n   */\n\n\n  videoBuffered() {\n    // no media source/source buffer or it isn't in the media sources\n    // source buffer list\n    if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {\n      return createTimeRanges();\n    }\n\n    return this.videoBuffer.buffered ? this.videoBuffer.buffered : createTimeRanges();\n  }\n  /**\n   * Get a combined video/audio buffer's buffered timerange.\n   *\n   * @return {TimeRange}\n   *         the combined time range\n   */\n\n\n  buffered() {\n    const video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;\n    const audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;\n\n    if (audio && !video) {\n      return this.audioBuffered();\n    }\n\n    if (video && !audio) {\n      return this.videoBuffered();\n    }\n\n    return bufferIntersection(this.audioBuffered(), this.videoBuffered());\n  }\n  /**\n   * Add a callback to the queue that will set duration on the mediaSource.\n   *\n   * @param {number} duration\n   *        The duration to set\n   *\n   * @param {Function} [doneFn]\n   *        function to run after duration has been set.\n   */\n\n\n  setDuration(duration, doneFn = noop) {\n    // In order to set the duration on the media source, it's necessary to wait for all\n    // source buffers to no longer be updating. \"If the updating attribute equals true on\n    // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n    // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.duration(duration),\n      name: 'duration',\n      doneFn\n    });\n  }\n  /**\n   * Add a mediaSource endOfStream call to the queue\n   *\n   * @param {Error} [error]\n   *        Call endOfStream with an error\n   *\n   * @param {Function} [doneFn]\n   *        A function that should be called when the\n   *        endOfStream call has finished.\n   */\n\n\n  endOfStream(error = null, doneFn = noop) {\n    if (typeof error !== 'string') {\n      error = undefined;\n    } // In order to set the duration on the media source, it's necessary to wait for all\n    // source buffers to no longer be updating. \"If the updating attribute equals true on\n    // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n    // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n\n    pushQueue({\n      type: 'mediaSource',\n      sourceUpdater: this,\n      action: actions.endOfStream(error),\n      name: 'endOfStream',\n      doneFn\n    });\n  }\n  /**\n   * Queue an update to remove a time range from the buffer.\n   *\n   * @param {number} start where to start the removal\n   * @param {number} end where to end the removal\n   * @param {Function} [done=noop] optional callback to be executed when the remove\n   * operation is complete\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n   */\n\n\n  removeAudio(start, end, done = noop) {\n    if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {\n      done();\n      return;\n    }\n\n    pushQueue({\n      type: 'audio',\n      sourceUpdater: this,\n      action: actions.remove(start, end),\n      doneFn: done,\n      name: 'remove'\n    });\n  }\n  /**\n   * Queue an update to remove a time range from the buffer.\n   *\n   * @param {number} start where to start the removal\n   * @param {number} end where to end the removal\n   * @param {Function} [done=noop] optional callback to be executed when the remove\n   * operation is complete\n   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n   */\n\n\n  removeVideo(start, end, done = noop) {\n    if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {\n      done();\n      return;\n    }\n\n    pushQueue({\n      type: 'video',\n      sourceUpdater: this,\n      action: actions.remove(start, end),\n      doneFn: done,\n      name: 'remove'\n    });\n  }\n  /**\n   * Whether the underlying sourceBuffer is updating or not\n   *\n   * @return {boolean} the updating status of the SourceBuffer\n   */\n\n\n  updating() {\n    // the audio/video source buffer is updating\n    if (updating('audio', this) || updating('video', this)) {\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * Set/get the timestampoffset on the audio SourceBuffer\n   *\n   * @return {number} the timestamp offset\n   */\n\n\n  audioTimestampOffset(offset) {\n    if (typeof offset !== 'undefined' && this.audioBuffer && // no point in updating if it's the same\n    this.audioTimestampOffset_ !== offset) {\n      pushQueue({\n        type: 'audio',\n        sourceUpdater: this,\n        action: actions.timestampOffset(offset),\n        name: 'timestampOffset'\n      });\n      this.audioTimestampOffset_ = offset;\n    }\n\n    return this.audioTimestampOffset_;\n  }\n  /**\n   * Set/get the timestampoffset on the video SourceBuffer\n   *\n   * @return {number} the timestamp offset\n   */\n\n\n  videoTimestampOffset(offset) {\n    if (typeof offset !== 'undefined' && this.videoBuffer && // no point in updating if it's the same\n    this.videoTimestampOffset !== offset) {\n      pushQueue({\n        type: 'video',\n        sourceUpdater: this,\n        action: actions.timestampOffset(offset),\n        name: 'timestampOffset'\n      });\n      this.videoTimestampOffset_ = offset;\n    }\n\n    return this.videoTimestampOffset_;\n  }\n  /**\n   * Add a function to the queue that will be called\n   * when it is its turn to run in the audio queue.\n   *\n   * @param {Function} callback\n   *        The callback to queue.\n   */\n\n\n  audioQueueCallback(callback) {\n    if (!this.audioBuffer) {\n      return;\n    }\n\n    pushQueue({\n      type: 'audio',\n      sourceUpdater: this,\n      action: actions.callback(callback),\n      name: 'callback'\n    });\n  }\n  /**\n   * Add a function to the queue that will be called\n   * when it is its turn to run in the video queue.\n   *\n   * @param {Function} callback\n   *        The callback to queue.\n   */\n\n\n  videoQueueCallback(callback) {\n    if (!this.videoBuffer) {\n      return;\n    }\n\n    pushQueue({\n      type: 'video',\n      sourceUpdater: this,\n      action: actions.callback(callback),\n      name: 'callback'\n    });\n  }\n  /**\n   * dispose of the source updater and the underlying sourceBuffer\n   */\n\n\n  dispose() {\n    this.trigger('dispose');\n    bufferTypes.forEach(type => {\n      this.abort(type);\n\n      if (this.canRemoveSourceBuffer()) {\n        this.removeSourceBuffer(type);\n      } else {\n        this[`${type}QueueCallback`](() => cleanupBuffer(type, this));\n      }\n    });\n    this.videoAppendQueued_ = false;\n    this.delayedAudioAppendQueue_.length = 0;\n\n    if (this.sourceopenListener_) {\n      this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_);\n    }\n\n    this.off();\n  }\n\n}\n\nconst uint8ToUtf8 = uintArray => decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\nconst bufferToHexString = buffer => {\n  const uInt8Buffer = new Uint8Array(buffer);\n  return Array.from(uInt8Buffer).map(byte => byte.toString(16).padStart(2, '0')).join('');\n};\n\n/**\n * @file vtt-segment-loader.js\n */\nconst VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(char => char.charCodeAt(0)));\n\nclass NoVttJsError extends Error {\n  constructor() {\n    super('Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.');\n  }\n\n}\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\n\nclass VTTSegmentLoader extends SegmentLoader {\n  constructor(settings, options = {}) {\n    super(settings, options); // SegmentLoader requires a MediaSource be specified or it will throw an error;\n    // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n    this.mediaSource_ = null;\n    this.subtitlesTrack_ = null;\n    this.loaderType_ = 'subtitle';\n    this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;\n    this.loadVttJs = settings.loadVttJs; // The VTT segment will have its own time mappings. Saving VTT segment timing info in\n    // the sync controller leads to improper behavior.\n\n    this.shouldSaveSegmentTimingInfo_ = false;\n  }\n\n  createTransmuxer_() {\n    // don't need to transmux any subtitles\n    return null;\n  }\n  /**\n   * Indicates which time ranges are buffered\n   *\n   * @return {TimeRange}\n   *         TimeRange object representing the current buffered ranges\n   */\n\n\n  buffered_() {\n    if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {\n      return createTimeRanges();\n    }\n\n    const cues = this.subtitlesTrack_.cues;\n    const start = cues[0].startTime;\n    const end = cues[cues.length - 1].startTime;\n    return createTimeRanges([[start, end]]);\n  }\n  /**\n   * Gets and sets init segment for the provided map\n   *\n   * @param {Object} map\n   *        The map object representing the init segment to get or set\n   * @param {boolean=} set\n   *        If true, the init segment for the provided map should be saved\n   * @return {Object}\n   *         map object for desired init segment\n   */\n\n\n  initSegmentForMap(map, set = false) {\n    if (!map) {\n      return null;\n    }\n\n    const id = initSegmentId(map);\n    let storedMap = this.initSegments_[id];\n\n    if (set && !storedMap && map.bytes) {\n      // append WebVTT line terminators to the media initialization segment if it exists\n      // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n      // requires two or more WebVTT line terminators between the WebVTT header and the\n      // rest of the file\n      const combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n      const combinedSegment = new Uint8Array(combinedByteLength);\n      combinedSegment.set(map.bytes);\n      combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n      this.initSegments_[id] = storedMap = {\n        resolvedUri: map.resolvedUri,\n        byterange: map.byterange,\n        bytes: combinedSegment\n      };\n    }\n\n    return storedMap || map;\n  }\n  /**\n   * Returns true if all configuration required for loading is present, otherwise false.\n   *\n   * @return {boolean} True if the all configuration is ready for loading\n   * @private\n   */\n\n\n  couldBeginLoading_() {\n    return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n  }\n  /**\n   * Once all the starting parameters have been specified, begin\n   * operation. This method should only be invoked from the INIT\n   * state.\n   *\n   * @private\n   */\n\n\n  init_() {\n    this.state = 'READY';\n    this.resetEverything();\n    return this.monitorBuffer_();\n  }\n  /**\n   * Set a subtitle track on the segment loader to add subtitles to\n   *\n   * @param {TextTrack=} track\n   *        The text track to add loaded subtitles to\n   * @return {TextTrack}\n   *        Returns the subtitles track\n   */\n\n\n  track(track) {\n    if (typeof track === 'undefined') {\n      return this.subtitlesTrack_;\n    }\n\n    this.subtitlesTrack_ = track; // if we were unpaused but waiting for a sourceUpdater, start\n    // buffering now\n\n    if (this.state === 'INIT' && this.couldBeginLoading_()) {\n      this.init_();\n    }\n\n    return this.subtitlesTrack_;\n  }\n  /**\n   * Remove any data in the source buffer between start and end times\n   *\n   * @param {number} start - the start time of the region to remove from the buffer\n   * @param {number} end - the end time of the region to remove from the buffer\n   */\n\n\n  remove(start, end) {\n    removeCuesFromTrack(start, end, this.subtitlesTrack_);\n  }\n  /**\n   * fill the buffer with segements unless the sourceBuffers are\n   * currently updating\n   *\n   * Note: this function should only ever be called by monitorBuffer_\n   * and never directly\n   *\n   * @private\n   */\n\n\n  fillBuffer_() {\n    // see if we need to begin loading immediately\n    const segmentInfo = this.chooseNextRequest_();\n\n    if (!segmentInfo) {\n      return;\n    }\n\n    if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n      // We don't have the timestamp offset that we need to sync subtitles.\n      // Rerun on a timestamp offset or user interaction.\n      const checkTimestampOffset = () => {\n        this.state = 'READY';\n\n        if (!this.paused()) {\n          // if not paused, queue a buffer check as soon as possible\n          this.monitorBuffer_();\n        }\n      };\n\n      this.syncController_.one('timestampoffset', checkTimestampOffset);\n      this.state = 'WAITING_ON_TIMELINE';\n      return;\n    }\n\n    this.loadSegment_(segmentInfo);\n  } // never set a timestamp offset for vtt segments.\n\n\n  timestampOffsetForSegment_() {\n    return null;\n  }\n\n  chooseNextRequest_() {\n    return this.skipEmptySegments_(super.chooseNextRequest_());\n  }\n  /**\n   * Prevents the segment loader from requesting segments we know contain no subtitles\n   * by walking forward until we find the next segment that we don't know whether it is\n   * empty or not.\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @return {Object}\n   *         a segment info object that describes the current segment\n   */\n\n\n  skipEmptySegments_(segmentInfo) {\n    while (segmentInfo && segmentInfo.segment.empty) {\n      // stop at the last possible segmentInfo\n      if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {\n        segmentInfo = null;\n        break;\n      }\n\n      segmentInfo = this.generateSegmentInfo_({\n        playlist: segmentInfo.playlist,\n        mediaIndex: segmentInfo.mediaIndex + 1,\n        startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,\n        isSyncRequest: segmentInfo.isSyncRequest\n      });\n    }\n\n    return segmentInfo;\n  }\n\n  stopForError(error) {\n    this.error(error);\n    this.state = 'READY';\n    this.pause();\n    this.trigger('error');\n  }\n  /**\n   * append a decrypted segement to the SourceBuffer through a SourceUpdater\n   *\n   * @private\n   */\n\n\n  segmentRequestFinished_(error, simpleSegment, result) {\n    if (!this.subtitlesTrack_) {\n      this.state = 'READY';\n      return;\n    }\n\n    this.saveTransferStats_(simpleSegment.stats); // the request was aborted\n\n    if (!this.pendingSegment_) {\n      this.state = 'READY';\n      this.mediaRequestsAborted += 1;\n      return;\n    }\n\n    if (error) {\n      if (error.code === REQUEST_ERRORS.TIMEOUT) {\n        this.handleTimeout_();\n      }\n\n      if (error.code === REQUEST_ERRORS.ABORTED) {\n        this.mediaRequestsAborted += 1;\n      } else {\n        this.mediaRequestsErrored += 1;\n      }\n\n      this.stopForError(error);\n      return;\n    }\n\n    const segmentInfo = this.pendingSegment_; // although the VTT segment loader bandwidth isn't really used, it's good to\n    // maintain functionality between segment loaders\n\n    this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats); // if this request included a segment key, save that data in the cache\n\n    if (simpleSegment.key) {\n      this.segmentKey(simpleSegment.key, true);\n    }\n\n    this.state = 'APPENDING'; // used for tests\n\n    this.trigger('appending');\n    const segment = segmentInfo.segment;\n\n    if (segment.map) {\n      segment.map.bytes = simpleSegment.map.bytes;\n    }\n\n    segmentInfo.bytes = simpleSegment.bytes; // Make sure that vttjs has loaded, otherwise, load it and wait till it finished loading\n\n    if (typeof window$1.WebVTT !== 'function' && typeof this.loadVttJs === 'function') {\n      this.state = 'WAITING_ON_VTTJS'; // should be fine to call multiple times\n      // script will be loaded once but multiple listeners will be added to the queue, which is expected.\n\n      this.loadVttJs().then(() => this.segmentRequestFinished_(error, simpleSegment, result), () => this.stopForError({\n        message: 'Error loading vtt.js'\n      }));\n      return;\n    }\n\n    segment.requested = true;\n\n    try {\n      this.parseVTTCues_(segmentInfo);\n    } catch (e) {\n      this.stopForError({\n        message: e.message\n      });\n      return;\n    }\n\n    this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n\n    if (segmentInfo.cues.length) {\n      segmentInfo.timingInfo = {\n        start: segmentInfo.cues[0].startTime,\n        end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime\n      };\n    } else {\n      segmentInfo.timingInfo = {\n        start: segmentInfo.startOfSegment,\n        end: segmentInfo.startOfSegment + segmentInfo.duration\n      };\n    }\n\n    if (segmentInfo.isSyncRequest) {\n      this.trigger('syncinfoupdate');\n      this.pendingSegment_ = null;\n      this.state = 'READY';\n      return;\n    }\n\n    segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n    this.mediaSecondsLoaded += segment.duration; // Create VTTCue instances for each cue in the new segment and add them to\n    // the subtitle track\n\n    segmentInfo.cues.forEach(cue => {\n      this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_ ? new window$1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);\n    }); // Remove any duplicate cues from the subtitle track. The WebVTT spec allows\n    // cues to have identical time-intervals, but if the text is also identical\n    // we can safely assume it is a duplicate that can be removed (ex. when a cue\n    // \"overlaps\" VTT segments)\n\n    removeDuplicateCuesFromTrack(this.subtitlesTrack_);\n    this.handleAppendsDone_();\n  }\n\n  handleData_() {// noop as we shouldn't be getting video/audio data captions\n    // that we do not support here.\n  }\n\n  updateTimingInfoEnd_() {// noop\n  }\n  /**\n   * Uses the WebVTT parser to parse the segment response\n   *\n   * @throws NoVttJsError\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @private\n   */\n\n\n  parseVTTCues_(segmentInfo) {\n    let decoder;\n    let decodeBytesToString = false;\n\n    if (typeof window$1.WebVTT !== 'function') {\n      // caller is responsible for exception handling.\n      throw new NoVttJsError();\n    }\n\n    if (typeof window$1.TextDecoder === 'function') {\n      decoder = new window$1.TextDecoder('utf8');\n    } else {\n      decoder = window$1.WebVTT.StringDecoder();\n      decodeBytesToString = true;\n    }\n\n    const parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, decoder);\n    segmentInfo.cues = [];\n    segmentInfo.timestampmap = {\n      MPEGTS: 0,\n      LOCAL: 0\n    };\n    parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n\n    parser.ontimestampmap = map => {\n      segmentInfo.timestampmap = map;\n    };\n\n    parser.onparsingerror = error => {\n      videojs.log.warn('Error encountered when parsing cues: ' + error.message);\n    };\n\n    if (segmentInfo.segment.map) {\n      let mapData = segmentInfo.segment.map.bytes;\n\n      if (decodeBytesToString) {\n        mapData = uint8ToUtf8(mapData);\n      }\n\n      parser.parse(mapData);\n    }\n\n    let segmentData = segmentInfo.bytes;\n\n    if (decodeBytesToString) {\n      segmentData = uint8ToUtf8(segmentData);\n    }\n\n    parser.parse(segmentData);\n    parser.flush();\n  }\n  /**\n   * Updates the start and end times of any cues parsed by the WebVTT parser using\n   * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n   * from the SyncController\n   *\n   * @param {Object} segmentInfo\n   *        a segment info object that describes the current segment\n   * @param {Object} mappingObj\n   *        object containing a mapping from TS to media time\n   * @param {Object} playlist\n   *        the playlist object containing the segment\n   * @private\n   */\n\n\n  updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n    const segment = segmentInfo.segment;\n\n    if (!mappingObj) {\n      // If the sync controller does not have a mapping of TS to Media Time for the\n      // timeline, then we don't have enough information to update the cue\n      // start/end times\n      return;\n    }\n\n    if (!segmentInfo.cues.length) {\n      // If there are no cues, we also do not have enough information to figure out\n      // segment timing. Mark that the segment contains no cues so we don't re-request\n      // an empty segment.\n      segment.empty = true;\n      return;\n    }\n\n    const {\n      MPEGTS,\n      LOCAL\n    } = segmentInfo.timestampmap;\n    /**\n     * From the spec:\n     * The MPEGTS media timestamp MUST use a 90KHz timescale,\n     * even when non-WebVTT Media Segments use a different timescale.\n     */\n\n    const mpegTsInSeconds = MPEGTS / ONE_SECOND_IN_TS;\n    const diff = mpegTsInSeconds - LOCAL + mappingObj.mapping;\n    segmentInfo.cues.forEach(cue => {\n      const duration = cue.endTime - cue.startTime;\n      const startTime = MPEGTS === 0 ? cue.startTime + diff : this.handleRollover_(cue.startTime + diff, mappingObj.time);\n      cue.startTime = Math.max(startTime, 0);\n      cue.endTime = Math.max(startTime + duration, 0);\n    });\n\n    if (!playlist.syncInfo) {\n      const firstStart = segmentInfo.cues[0].startTime;\n      const lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n      playlist.syncInfo = {\n        mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n        time: Math.min(firstStart, lastStart - segment.duration)\n      };\n    }\n  }\n  /**\n   * MPEG-TS PES timestamps are limited to 2^33.\n   * Once they reach 2^33, they roll over to 0.\n   * mux.js handles PES timestamp rollover for the following scenarios:\n   * [forward rollover(right)] ->\n   *    PES timestamps monotonically increase, and once they reach 2^33, they roll over to 0\n   * [backward rollover(left)] -->\n   *    we seek back to position before rollover.\n   *\n   * According to the HLS SPEC:\n   * When synchronizing WebVTT with PES timestamps, clients SHOULD account\n   * for cases where the 33-bit PES timestamps have wrapped and the WebVTT\n   * cue times have not.  When the PES timestamp wraps, the WebVTT Segment\n   * SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT\n   * time to the new (low valued) PES timestamp.\n   *\n   * So we want to handle rollover here and align VTT Cue start/end time to the player's time.\n   */\n\n\n  handleRollover_(value, reference) {\n    if (reference === null) {\n      return value;\n    }\n\n    let valueIn90khz = value * ONE_SECOND_IN_TS;\n    const referenceIn90khz = reference * ONE_SECOND_IN_TS;\n    let offset;\n\n    if (referenceIn90khz < valueIn90khz) {\n      // - 2^33\n      offset = -8589934592;\n    } else {\n      // + 2^33\n      offset = 8589934592;\n    } // distance(value - reference) > 2^32\n\n\n    while (Math.abs(valueIn90khz - referenceIn90khz) > 4294967296) {\n      valueIn90khz += offset;\n    }\n\n    return valueIn90khz / ONE_SECOND_IN_TS;\n  }\n\n}\n\n/**\n * @file ad-cue-tags.js\n */\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n *\n * @param {Object} track\n *        the track to find the cue for\n *\n * @param {number} mediaTime\n *        the time to find the cue at\n *\n * @return {Object|null}\n *         the found cue or null\n */\n\nconst findAdCue = function (track, mediaTime) {\n  const cues = track.cues;\n\n  for (let i = 0; i < cues.length; i++) {\n    const cue = cues[i];\n\n    if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n      return cue;\n    }\n  }\n\n  return null;\n};\nconst updateAdCues = function (media, track, offset = 0) {\n  if (!media.segments) {\n    return;\n  }\n\n  let mediaTime = offset;\n  let cue;\n\n  for (let i = 0; i < media.segments.length; i++) {\n    const segment = media.segments[i];\n\n    if (!cue) {\n      // Since the cues will span for at least the segment duration, adding a fudge\n      // factor of half segment duration will prevent duplicate cues from being\n      // created when timing info is not exact (e.g. cue start time initialized\n      // at 10.006677, but next call mediaTime is 10.003332 )\n      cue = findAdCue(track, mediaTime + segment.duration / 2);\n    }\n\n    if (cue) {\n      if ('cueIn' in segment) {\n        // Found a CUE-IN so end the cue\n        cue.endTime = mediaTime;\n        cue.adEndTime = mediaTime;\n        mediaTime += segment.duration;\n        cue = null;\n        continue;\n      }\n\n      if (mediaTime < cue.endTime) {\n        // Already processed this mediaTime for this cue\n        mediaTime += segment.duration;\n        continue;\n      } // otherwise extend cue until a CUE-IN is found\n\n\n      cue.endTime += segment.duration;\n    } else {\n      if ('cueOut' in segment) {\n        cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n        cue.adStartTime = mediaTime; // Assumes tag format to be\n        // #EXT-X-CUE-OUT:30\n\n        cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n        track.addCue(cue);\n      }\n\n      if ('cueOutCont' in segment) {\n        // Entered into the middle of an ad cue\n        // Assumes tag formate to be\n        // #EXT-X-CUE-OUT-CONT:10/30\n        const [adOffset, adTotal] = segment.cueOutCont.split('/').map(parseFloat);\n        cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, '');\n        cue.adStartTime = mediaTime - adOffset;\n        cue.adEndTime = cue.adStartTime + adTotal;\n        track.addCue(cue);\n      }\n    }\n\n    mediaTime += segment.duration;\n  }\n};\n\n/**\n * @file sync-controller.js\n */\n// synchronize expired playlist segments.\n// the max media sequence diff is 48 hours of live stream\n// content with two second segments. Anything larger than that\n// will likely be invalid.\n\nconst MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;\nconst syncPointStrategies = [// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n//                the equivalence display-time 0 === segment-index 0\n{\n  name: 'VOD',\n  run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n    if (duration !== Infinity) {\n      const syncPoint = {\n        time: 0,\n        segmentIndex: 0,\n        partIndex: null\n      };\n      return syncPoint;\n    }\n\n    return null;\n  }\n}, {\n  name: 'MediaSequence',\n\n  /**\n   * run media sequence strategy\n   *\n   * @param {SyncController} syncController\n   * @param {Object} playlist\n   * @param {number} duration\n   * @param {number} currentTimeline\n   * @param {number} currentTime\n   * @param {string} type\n   */\n  run: (syncController, playlist, duration, currentTimeline, currentTime, type) => {\n    if (!type) {\n      return null;\n    }\n\n    const mediaSequenceMap = syncController.getMediaSequenceMap(type);\n\n    if (!mediaSequenceMap || mediaSequenceMap.size === 0) {\n      return null;\n    }\n\n    if (playlist.mediaSequence === undefined || !Array.isArray(playlist.segments) || !playlist.segments.length) {\n      return null;\n    }\n\n    let currentMediaSequence = playlist.mediaSequence;\n    let segmentIndex = 0;\n\n    for (const segment of playlist.segments) {\n      const range = mediaSequenceMap.get(currentMediaSequence);\n\n      if (!range) {\n        // unexpected case\n        // we expect this playlist to be the same playlist in the map\n        // just break from the loop and move forward to the next strategy\n        break;\n      }\n\n      if (currentTime >= range.start && currentTime < range.end) {\n        // we found segment\n        if (Array.isArray(segment.parts) && segment.parts.length) {\n          let currentPartStart = range.start;\n          let partIndex = 0;\n\n          for (const part of segment.parts) {\n            const start = currentPartStart;\n            const end = start + part.duration;\n\n            if (currentTime >= start && currentTime < end) {\n              return {\n                time: range.start,\n                segmentIndex,\n                partIndex\n              };\n            }\n\n            partIndex++;\n            currentPartStart = end;\n          }\n        } // no parts found, return sync point for segment\n\n\n        return {\n          time: range.start,\n          segmentIndex,\n          partIndex: null\n        };\n      }\n\n      segmentIndex++;\n      currentMediaSequence++;\n    } // we didn't find any segments for provided current time\n\n\n    return null;\n  }\n}, // Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n  name: 'ProgramDateTime',\n  run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n    if (!Object.keys(syncController.timelineToDatetimeMappings).length) {\n      return null;\n    }\n\n    let syncPoint = null;\n    let lastDistance = null;\n    const partsAndSegments = getPartsAndSegments(playlist);\n    currentTime = currentTime || 0;\n\n    for (let i = 0; i < partsAndSegments.length; i++) {\n      // start from the end and loop backwards for live\n      // or start from the front and loop forwards for non-live\n      const index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n      const partAndSegment = partsAndSegments[index];\n      const segment = partAndSegment.segment;\n      const datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];\n\n      if (!datetimeMapping || !segment.dateTimeObject) {\n        continue;\n      }\n\n      const segmentTime = segment.dateTimeObject.getTime() / 1000;\n      let start = segmentTime + datetimeMapping; // take part duration into account.\n\n      if (segment.parts && typeof partAndSegment.partIndex === 'number') {\n        for (let z = 0; z < partAndSegment.partIndex; z++) {\n          start += segment.parts[z].duration;\n        }\n      }\n\n      const distance = Math.abs(currentTime - start); // Once the distance begins to increase, or if distance is 0, we have passed\n      // currentTime and can stop looking for better candidates\n\n      if (lastDistance !== null && (distance === 0 || lastDistance < distance)) {\n        break;\n      }\n\n      lastDistance = distance;\n      syncPoint = {\n        time: start,\n        segmentIndex: partAndSegment.segmentIndex,\n        partIndex: partAndSegment.partIndex\n      };\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Segment\": We have a known time mapping for a timeline and a\n//                    segment in the current timeline with timing data\n{\n  name: 'Segment',\n  run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n    let syncPoint = null;\n    let lastDistance = null;\n    currentTime = currentTime || 0;\n    const partsAndSegments = getPartsAndSegments(playlist);\n\n    for (let i = 0; i < partsAndSegments.length; i++) {\n      // start from the end and loop backwards for live\n      // or start from the front and loop forwards for non-live\n      const index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n      const partAndSegment = partsAndSegments[index];\n      const segment = partAndSegment.segment;\n      const start = partAndSegment.part && partAndSegment.part.start || segment && segment.start;\n\n      if (segment.timeline === currentTimeline && typeof start !== 'undefined') {\n        const distance = Math.abs(currentTime - start); // Once the distance begins to increase, we have passed\n        // currentTime and can stop looking for better candidates\n\n        if (lastDistance !== null && lastDistance < distance) {\n          break;\n        }\n\n        if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n          lastDistance = distance;\n          syncPoint = {\n            time: start,\n            segmentIndex: partAndSegment.segmentIndex,\n            partIndex: partAndSegment.partIndex\n          };\n        }\n      }\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Discontinuity\": We have a discontinuity with a known\n//                          display-time\n{\n  name: 'Discontinuity',\n  run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n    let syncPoint = null;\n    currentTime = currentTime || 0;\n\n    if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n      let lastDistance = null;\n\n      for (let i = 0; i < playlist.discontinuityStarts.length; i++) {\n        const segmentIndex = playlist.discontinuityStarts[i];\n        const discontinuity = playlist.discontinuitySequence + i + 1;\n        const discontinuitySync = syncController.discontinuities[discontinuity];\n\n        if (discontinuitySync) {\n          const distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n          // currentTime and can stop looking for better candidates\n\n          if (lastDistance !== null && lastDistance < distance) {\n            break;\n          }\n\n          if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n            lastDistance = distance;\n            syncPoint = {\n              time: discontinuitySync.time,\n              segmentIndex,\n              partIndex: null\n            };\n          }\n        }\n      }\n    }\n\n    return syncPoint;\n  }\n}, // Stategy \"Playlist\": We have a playlist with a known mapping of\n//                     segment index to display time\n{\n  name: 'Playlist',\n  run: (syncController, playlist, duration, currentTimeline, currentTime) => {\n    if (playlist.syncInfo) {\n      const syncPoint = {\n        time: playlist.syncInfo.time,\n        segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,\n        partIndex: null\n      };\n      return syncPoint;\n    }\n\n    return null;\n  }\n}];\nclass SyncController extends videojs.EventTarget {\n  constructor(options = {}) {\n    super(); // ...for synching across variants\n\n    this.timelines = [];\n    this.discontinuities = [];\n    this.timelineToDatetimeMappings = {};\n    /**\n     * @type {Map<string, Map<number, { start: number, end: number }>>}\n     * @private\n     */\n\n    this.mediaSequenceStorage_ = new Map();\n    this.logger_ = logger('SyncController');\n  }\n  /**\n   * Get media sequence map by type\n   *\n   * @param {string} type - segment loader type\n   * @return {Map<number, { start: number, end: number }> | undefined}\n   */\n\n\n  getMediaSequenceMap(type) {\n    return this.mediaSequenceStorage_.get(type);\n  }\n  /**\n   * Update Media Sequence Map -> <MediaSequence, Range>\n   *\n   * @param {Object} playlist - parsed playlist\n   * @param {number} currentTime - current player's time\n   * @param {string} type - segment loader type\n   * @return {void}\n   */\n\n\n  updateMediaSequenceMap(playlist, currentTime, type) {\n    // we should not process this playlist if it does not have mediaSequence or segments\n    if (playlist.mediaSequence === undefined || !Array.isArray(playlist.segments) || !playlist.segments.length) {\n      return;\n    }\n\n    const currentMap = this.getMediaSequenceMap(type);\n    const result = new Map();\n    let currentMediaSequence = playlist.mediaSequence;\n    let currentBaseTime;\n\n    if (!currentMap) {\n      // first playlist setup:\n      currentBaseTime = 0;\n    } else if (currentMap.has(playlist.mediaSequence)) {\n      // further playlists setup:\n      currentBaseTime = currentMap.get(playlist.mediaSequence).start;\n    } else {\n      // it seems like we have a gap between playlists, use current time as a fallback:\n      this.logger_(`MediaSequence sync for ${type} segment loader - received a gap between playlists.\nFallback base time to: ${currentTime}.\nReceived media sequence: ${currentMediaSequence}.\nCurrent map: `, currentMap);\n      currentBaseTime = currentTime;\n    }\n\n    this.logger_(`MediaSequence sync for ${type} segment loader.\nReceived media sequence: ${currentMediaSequence}.\nbase time is ${currentBaseTime}\nCurrent map: `, currentMap);\n    playlist.segments.forEach(segment => {\n      const start = currentBaseTime;\n      const end = start + segment.duration;\n      const range = {\n        start,\n        end\n      };\n      result.set(currentMediaSequence, range);\n      currentMediaSequence++;\n      currentBaseTime = end;\n    });\n    this.mediaSequenceStorage_.set(type, result);\n  }\n  /**\n   * Find a sync-point for the playlist specified\n   *\n   * A sync-point is defined as a known mapping from display-time to\n   * a segment-index in the current playlist.\n   *\n   * @param {Playlist} playlist\n   *        The playlist that needs a sync-point\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinite if playing a live source)\n   * @param {number} currentTimeline\n   *        The last timeline from which a segment was loaded\n   * @param {number} currentTime\n   *        Current player's time\n   * @param {string} type\n   *        Segment loader type\n   * @return {Object}\n   *          A sync-point object\n   */\n\n\n  getSyncPoint(playlist, duration, currentTimeline, currentTime, type) {\n    // Always use VOD sync point for VOD\n    if (duration !== Infinity) {\n      const vodSyncPointStrategy = syncPointStrategies.find(({\n        name\n      }) => name === 'VOD');\n      return vodSyncPointStrategy.run(this, playlist, duration);\n    }\n\n    const syncPoints = this.runStrategies_(playlist, duration, currentTimeline, currentTime, type);\n\n    if (!syncPoints.length) {\n      // Signal that we need to attempt to get a sync-point manually\n      // by fetching a segment in the playlist and constructing\n      // a sync-point from that information\n      return null;\n    } // If we have exact match just return it instead of finding the nearest distance\n\n\n    for (const syncPointInfo of syncPoints) {\n      const {\n        syncPoint,\n        strategy\n      } = syncPointInfo;\n      const {\n        segmentIndex,\n        time\n      } = syncPoint;\n\n      if (segmentIndex < 0) {\n        continue;\n      }\n\n      const selectedSegment = playlist.segments[segmentIndex];\n      const start = time;\n      const end = start + selectedSegment.duration;\n      this.logger_(`Strategy: ${strategy}. Current time: ${currentTime}. selected segment: ${segmentIndex}. Time: [${start} -> ${end}]}`);\n\n      if (currentTime >= start && currentTime < end) {\n        this.logger_('Found sync point with exact match: ', syncPoint);\n        return syncPoint;\n      }\n    } // Now find the sync-point that is closest to the currentTime because\n    // that should result in the most accurate guess about which segment\n    // to fetch\n\n\n    return this.selectSyncPoint_(syncPoints, {\n      key: 'time',\n      value: currentTime\n    });\n  }\n  /**\n   * Calculate the amount of time that has expired off the playlist during playback\n   *\n   * @param {Playlist} playlist\n   *        Playlist object to calculate expired from\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinity if playling a live source)\n   * @return {number|null}\n   *          The amount of time that has expired off the playlist during playback. Null\n   *          if no sync-points for the playlist can be found.\n   */\n\n\n  getExpiredTime(playlist, duration) {\n    if (!playlist || !playlist.segments) {\n      return null;\n    }\n\n    const syncPoints = this.runStrategies_(playlist, duration, playlist.discontinuitySequence, 0, 'main'); // Without sync-points, there is not enough information to determine the expired time\n\n    if (!syncPoints.length) {\n      return null;\n    }\n\n    const syncPoint = this.selectSyncPoint_(syncPoints, {\n      key: 'segmentIndex',\n      value: 0\n    }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n    // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n    if (syncPoint.segmentIndex > 0) {\n      syncPoint.time *= -1;\n    }\n\n    return Math.abs(syncPoint.time + sumDurations({\n      defaultDuration: playlist.targetDuration,\n      durationList: playlist.segments,\n      startIndex: syncPoint.segmentIndex,\n      endIndex: 0\n    }));\n  }\n  /**\n   * Runs each sync-point strategy and returns a list of sync-points returned by the\n   * strategies\n   *\n   * @private\n   * @param {Playlist} playlist\n   *        The playlist that needs a sync-point\n   * @param {number} duration\n   *        Duration of the MediaSource (Infinity if playing a live source)\n   * @param {number} currentTimeline\n   *        The last timeline from which a segment was loaded\n   * @param {number} currentTime\n   *        Current player's time\n   * @param {string} type\n   *        Segment loader type\n   * @return {Array}\n   *          A list of sync-point objects\n   */\n\n\n  runStrategies_(playlist, duration, currentTimeline, currentTime, type) {\n    const syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n    for (let i = 0; i < syncPointStrategies.length; i++) {\n      const strategy = syncPointStrategies[i];\n      const syncPoint = strategy.run(this, playlist, duration, currentTimeline, currentTime, type);\n\n      if (syncPoint) {\n        syncPoint.strategy = strategy.name;\n        syncPoints.push({\n          strategy: strategy.name,\n          syncPoint\n        });\n      }\n    }\n\n    return syncPoints;\n  }\n  /**\n   * Selects the sync-point nearest the specified target\n   *\n   * @private\n   * @param {Array} syncPoints\n   *        List of sync-points to select from\n   * @param {Object} target\n   *        Object specifying the property and value we are targeting\n   * @param {string} target.key\n   *        Specifies the property to target. Must be either 'time' or 'segmentIndex'\n   * @param {number} target.value\n   *        The value to target for the specified key.\n   * @return {Object}\n   *          The sync-point nearest the target\n   */\n\n\n  selectSyncPoint_(syncPoints, target) {\n    let bestSyncPoint = syncPoints[0].syncPoint;\n    let bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n    let bestStrategy = syncPoints[0].strategy;\n\n    for (let i = 1; i < syncPoints.length; i++) {\n      const newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n\n      if (newDistance < bestDistance) {\n        bestDistance = newDistance;\n        bestSyncPoint = syncPoints[i].syncPoint;\n        bestStrategy = syncPoints[i].strategy;\n      }\n    }\n\n    this.logger_(`syncPoint for [${target.key}: ${target.value}] chosen with strategy` + ` [${bestStrategy}]: [time:${bestSyncPoint.time},` + ` segmentIndex:${bestSyncPoint.segmentIndex}` + (typeof bestSyncPoint.partIndex === 'number' ? `,partIndex:${bestSyncPoint.partIndex}` : '') + ']');\n    return bestSyncPoint;\n  }\n  /**\n   * Save any meta-data present on the segments when segments leave\n   * the live window to the playlist to allow for synchronization at the\n   * playlist level later.\n   *\n   * @param {Playlist} oldPlaylist - The previous active playlist\n   * @param {Playlist} newPlaylist - The updated and most current playlist\n   */\n\n\n  saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n    const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // Ignore large media sequence gaps\n\n    if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {\n      videojs.log.warn(`Not saving expired segment info. Media sequence gap ${mediaSequenceDiff} is too large.`);\n      return;\n    } // When a segment expires from the playlist and it has a start time\n    // save that information as a possible sync-point reference in future\n\n\n    for (let i = mediaSequenceDiff - 1; i >= 0; i--) {\n      const lastRemovedSegment = oldPlaylist.segments[i];\n\n      if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n        newPlaylist.syncInfo = {\n          mediaSequence: oldPlaylist.mediaSequence + i,\n          time: lastRemovedSegment.start\n        };\n        this.logger_(`playlist refresh sync: [time:${newPlaylist.syncInfo.time},` + ` mediaSequence: ${newPlaylist.syncInfo.mediaSequence}]`);\n        this.trigger('syncinfoupdate');\n        break;\n      }\n    }\n  }\n  /**\n   * Save the mapping from playlist's ProgramDateTime to display. This should only happen\n   * before segments start to load.\n   *\n   * @param {Playlist} playlist - The currently active playlist\n   */\n\n\n  setDateTimeMappingForStart(playlist) {\n    // It's possible for the playlist to be updated before playback starts, meaning time\n    // zero is not yet set. If, during these playlist refreshes, a discontinuity is\n    // crossed, then the old time zero mapping (for the prior timeline) would be retained\n    // unless the mappings are cleared.\n    this.timelineToDatetimeMappings = {};\n\n    if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n      const firstSegment = playlist.segments[0];\n      const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000;\n      this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;\n    }\n  }\n  /**\n   * Calculates and saves timeline mappings, playlist sync info, and segment timing values\n   * based on the latest timing information.\n   *\n   * @param {Object} options\n   *        Options object\n   * @param {SegmentInfo} options.segmentInfo\n   *        The current active request information\n   * @param {boolean} options.shouldSaveTimelineMapping\n   *        If there's a timeline change, determines if the timeline mapping should be\n   *        saved for timeline mapping and program date time mappings.\n   */\n\n\n  saveSegmentTimingInfo({\n    segmentInfo,\n    shouldSaveTimelineMapping\n  }) {\n    const didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);\n    const segment = segmentInfo.segment;\n\n    if (didCalculateSegmentTimeMapping) {\n      this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n      // now with segment timing information\n\n      if (!segmentInfo.playlist.syncInfo) {\n        segmentInfo.playlist.syncInfo = {\n          mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,\n          time: segment.start\n        };\n      }\n    }\n\n    const dateTime = segment.dateTimeObject;\n\n    if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {\n      this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1000);\n    }\n  }\n\n  timestampOffsetForTimeline(timeline) {\n    if (typeof this.timelines[timeline] === 'undefined') {\n      return null;\n    }\n\n    return this.timelines[timeline].time;\n  }\n\n  mappingForTimeline(timeline) {\n    if (typeof this.timelines[timeline] === 'undefined') {\n      return null;\n    }\n\n    return this.timelines[timeline].mapping;\n  }\n  /**\n   * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n   * save that display time to the segment.\n   *\n   * @private\n   * @param {SegmentInfo} segmentInfo\n   *        The current active request information\n   * @param {Object} timingInfo\n   *        The start and end time of the current segment in \"media time\"\n   * @param {boolean} shouldSaveTimelineMapping\n   *        If there's a timeline change, determines if the timeline mapping should be\n   *        saved in timelines.\n   * @return {boolean}\n   *          Returns false if segment time mapping could not be calculated\n   */\n\n\n  calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {\n    // TODO: remove side effects\n    const segment = segmentInfo.segment;\n    const part = segmentInfo.part;\n    let mappingObj = this.timelines[segmentInfo.timeline];\n    let start;\n    let end;\n\n    if (typeof segmentInfo.timestampOffset === 'number') {\n      mappingObj = {\n        time: segmentInfo.startOfSegment,\n        mapping: segmentInfo.startOfSegment - timingInfo.start\n      };\n\n      if (shouldSaveTimelineMapping) {\n        this.timelines[segmentInfo.timeline] = mappingObj;\n        this.trigger('timestampoffset');\n        this.logger_(`time mapping for timeline ${segmentInfo.timeline}: ` + `[time: ${mappingObj.time}] [mapping: ${mappingObj.mapping}]`);\n      }\n\n      start = segmentInfo.startOfSegment;\n      end = timingInfo.end + mappingObj.mapping;\n    } else if (mappingObj) {\n      start = timingInfo.start + mappingObj.mapping;\n      end = timingInfo.end + mappingObj.mapping;\n    } else {\n      return false;\n    }\n\n    if (part) {\n      part.start = start;\n      part.end = end;\n    } // If we don't have a segment start yet or the start value we got\n    // is less than our current segment.start value, save a new start value.\n    // We have to do this because parts will have segment timing info saved\n    // multiple times and we want segment start to be the earliest part start\n    // value for that segment.\n\n\n    if (!segment.start || start < segment.start) {\n      segment.start = start;\n    }\n\n    segment.end = end;\n    return true;\n  }\n  /**\n   * Each time we have discontinuity in the playlist, attempt to calculate the location\n   * in display of the start of the discontinuity and save that. We also save an accuracy\n   * value so that we save values with the most accuracy (closest to 0.)\n   *\n   * @private\n   * @param {SegmentInfo} segmentInfo - The current active request information\n   */\n\n\n  saveDiscontinuitySyncInfo_(segmentInfo) {\n    const playlist = segmentInfo.playlist;\n    const segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n    // the start of the range and it's accuracy is 0 (greater accuracy values\n    // mean more approximation)\n\n    if (segment.discontinuity) {\n      this.discontinuities[segment.timeline] = {\n        time: segment.start,\n        accuracy: 0\n      };\n    } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n      // Search for future discontinuities that we can provide better timing\n      // information for and save that information for sync purposes\n      for (let i = 0; i < playlist.discontinuityStarts.length; i++) {\n        const segmentIndex = playlist.discontinuityStarts[i];\n        const discontinuity = playlist.discontinuitySequence + i + 1;\n        const mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n        const accuracy = Math.abs(mediaIndexDiff);\n\n        if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n          let time;\n\n          if (mediaIndexDiff < 0) {\n            time = segment.start - sumDurations({\n              defaultDuration: playlist.targetDuration,\n              durationList: playlist.segments,\n              startIndex: segmentInfo.mediaIndex,\n              endIndex: segmentIndex\n            });\n          } else {\n            time = segment.end + sumDurations({\n              defaultDuration: playlist.targetDuration,\n              durationList: playlist.segments,\n              startIndex: segmentInfo.mediaIndex + 1,\n              endIndex: segmentIndex\n            });\n          }\n\n          this.discontinuities[discontinuity] = {\n            time,\n            accuracy\n          };\n        }\n      }\n    }\n  }\n\n  dispose() {\n    this.trigger('dispose');\n    this.off();\n  }\n\n}\n\n/**\n * The TimelineChangeController acts as a source for segment loaders to listen for and\n * keep track of latest and pending timeline changes. This is useful to ensure proper\n * sync, as each loader may need to make a consideration for what timeline the other\n * loader is on before making changes which could impact the other loader's media.\n *\n * @class TimelineChangeController\n * @extends videojs.EventTarget\n */\n\nclass TimelineChangeController extends videojs.EventTarget {\n  constructor() {\n    super();\n    this.pendingTimelineChanges_ = {};\n    this.lastTimelineChanges_ = {};\n  }\n\n  clearPendingTimelineChange(type) {\n    this.pendingTimelineChanges_[type] = null;\n    this.trigger('pendingtimelinechange');\n  }\n\n  pendingTimelineChange({\n    type,\n    from,\n    to\n  }) {\n    if (typeof from === 'number' && typeof to === 'number') {\n      this.pendingTimelineChanges_[type] = {\n        type,\n        from,\n        to\n      };\n      this.trigger('pendingtimelinechange');\n    }\n\n    return this.pendingTimelineChanges_[type];\n  }\n\n  lastTimelineChange({\n    type,\n    from,\n    to\n  }) {\n    if (typeof from === 'number' && typeof to === 'number') {\n      this.lastTimelineChanges_[type] = {\n        type,\n        from,\n        to\n      };\n      delete this.pendingTimelineChanges_[type];\n      this.trigger('timelinechange');\n    }\n\n    return this.lastTimelineChanges_[type];\n  }\n\n  dispose() {\n    this.trigger('dispose');\n    this.pendingTimelineChanges_ = {};\n    this.lastTimelineChanges_ = {};\n    this.off();\n  }\n\n}\n\n/* rollup-plugin-worker-factory start for worker!/home/runner/work/http-streaming/http-streaming/src/decrypter-worker.js */\nconst workerCode = transform(getWorkerString(function () {\n  /**\n   * @file stream.js\n   */\n\n  /**\n   * A lightweight readable stream implemention that handles event dispatching.\n   *\n   * @class Stream\n   */\n\n  var Stream = /*#__PURE__*/function () {\n    function Stream() {\n      this.listeners = {};\n    }\n    /**\n     * Add a listener for a specified event type.\n     *\n     * @param {string} type the event name\n     * @param {Function} listener the callback to be invoked when an event of\n     * the specified type occurs\n     */\n\n\n    var _proto = Stream.prototype;\n\n    _proto.on = function on(type, listener) {\n      if (!this.listeners[type]) {\n        this.listeners[type] = [];\n      }\n\n      this.listeners[type].push(listener);\n    }\n    /**\n     * Remove a listener for a specified event type.\n     *\n     * @param {string} type the event name\n     * @param {Function} listener  a function previously registered for this\n     * type of event through `on`\n     * @return {boolean} if we could turn it off or not\n     */\n    ;\n\n    _proto.off = function off(type, listener) {\n      if (!this.listeners[type]) {\n        return false;\n      }\n\n      var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n      // In Video.js we slice listener functions\n      // on trigger so that it does not mess up the order\n      // while we loop through.\n      //\n      // Here we slice on off so that the loop in trigger\n      // can continue using it's old reference to loop without\n      // messing up the order.\n\n      this.listeners[type] = this.listeners[type].slice(0);\n      this.listeners[type].splice(index, 1);\n      return index > -1;\n    }\n    /**\n     * Trigger an event of the specified type on this stream. Any additional\n     * arguments to this function are passed as parameters to event listeners.\n     *\n     * @param {string} type the event name\n     */\n    ;\n\n    _proto.trigger = function trigger(type) {\n      var callbacks = this.listeners[type];\n\n      if (!callbacks) {\n        return;\n      } // Slicing the arguments on every invocation of this method\n      // can add a significant amount of overhead. Avoid the\n      // intermediate object creation for the common case of a\n      // single callback argument\n\n\n      if (arguments.length === 2) {\n        var length = callbacks.length;\n\n        for (var i = 0; i < length; ++i) {\n          callbacks[i].call(this, arguments[1]);\n        }\n      } else {\n        var args = Array.prototype.slice.call(arguments, 1);\n        var _length = callbacks.length;\n\n        for (var _i = 0; _i < _length; ++_i) {\n          callbacks[_i].apply(this, args);\n        }\n      }\n    }\n    /**\n     * Destroys the stream and cleans up.\n     */\n    ;\n\n    _proto.dispose = function dispose() {\n      this.listeners = {};\n    }\n    /**\n     * Forwards all `data` events on this stream to the destination stream. The\n     * destination stream should provide a method `push` to receive the data\n     * events as they arrive.\n     *\n     * @param {Stream} destination the stream that will receive all `data` events\n     * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n     */\n    ;\n\n    _proto.pipe = function pipe(destination) {\n      this.on('data', function (data) {\n        destination.push(data);\n      });\n    };\n\n    return Stream;\n  }();\n  /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */\n\n  /**\n   * Returns the subarray of a Uint8Array without PKCS#7 padding.\n   *\n   * @param padded {Uint8Array} unencrypted bytes that have been padded\n   * @return {Uint8Array} the unpadded bytes\n   * @see http://tools.ietf.org/html/rfc5652\n   */\n\n\n  function unpad(padded) {\n    return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n  }\n  /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */\n\n  /**\n   * @file aes.js\n   *\n   * This file contains an adaptation of the AES decryption algorithm\n   * from the Standford Javascript Cryptography Library. That work is\n   * covered by the following copyright and permissions notice:\n   *\n   * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n   * All rights reserved.\n   *\n   * Redistribution and use in source and binary forms, with or without\n   * modification, are permitted provided that the following conditions are\n   * met:\n   *\n   * 1. Redistributions of source code must retain the above copyright\n   *    notice, this list of conditions and the following disclaimer.\n   *\n   * 2. Redistributions in binary form must reproduce the above\n   *    copyright notice, this list of conditions and the following\n   *    disclaimer in the documentation and/or other materials provided\n   *    with the distribution.\n   *\n   * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n   * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n   * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n   * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n   * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n   * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n   *\n   * The views and conclusions contained in the software and documentation\n   * are those of the authors and should not be interpreted as representing\n   * official policies, either expressed or implied, of the authors.\n   */\n\n  /**\n   * Expand the S-box tables.\n   *\n   * @private\n   */\n\n\n  const precompute = function () {\n    const tables = [[[], [], [], [], []], [[], [], [], [], []]];\n    const encTable = tables[0];\n    const decTable = tables[1];\n    const sbox = encTable[4];\n    const sboxInv = decTable[4];\n    let i;\n    let x;\n    let xInv;\n    const d = [];\n    const th = [];\n    let x2;\n    let x4;\n    let x8;\n    let s;\n    let tEnc;\n    let tDec; // Compute double and third tables\n\n    for (i = 0; i < 256; i++) {\n      th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n    }\n\n    for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n      // Compute sbox\n      s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n      s = s >> 8 ^ s & 255 ^ 99;\n      sbox[x] = s;\n      sboxInv[s] = x; // Compute MixColumns\n\n      x8 = d[x4 = d[x2 = d[x]]];\n      tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n      tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n      for (i = 0; i < 4; i++) {\n        encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n        decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n      }\n    } // Compactify. Considerable speedup on Firefox.\n\n\n    for (i = 0; i < 5; i++) {\n      encTable[i] = encTable[i].slice(0);\n      decTable[i] = decTable[i].slice(0);\n    }\n\n    return tables;\n  };\n\n  let aesTables = null;\n  /**\n   * Schedule out an AES key for both encryption and decryption. This\n   * is a low-level class. Use a cipher mode to do bulk encryption.\n   *\n   * @class AES\n   * @param key {Array} The key as an array of 4, 6 or 8 words.\n   */\n\n  class AES {\n    constructor(key) {\n      /**\n      * The expanded S-box and inverse S-box tables. These will be computed\n      * on the client so that we don't have to send them down the wire.\n      *\n      * There are two tables, _tables[0] is for encryption and\n      * _tables[1] is for decryption.\n      *\n      * The first 4 sub-tables are the expanded S-box with MixColumns. The\n      * last (_tables[01][4]) is the S-box itself.\n      *\n      * @private\n      */\n      // if we have yet to precompute the S-box tables\n      // do so now\n      if (!aesTables) {\n        aesTables = precompute();\n      } // then make a copy of that object for use\n\n\n      this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n      let i;\n      let j;\n      let tmp;\n      const sbox = this._tables[0][4];\n      const decTable = this._tables[1];\n      const keyLen = key.length;\n      let rcon = 1;\n\n      if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n        throw new Error('Invalid aes key size');\n      }\n\n      const encKey = key.slice(0);\n      const decKey = [];\n      this._key = [encKey, decKey]; // schedule encryption keys\n\n      for (i = keyLen; i < 4 * keyLen + 28; i++) {\n        tmp = encKey[i - 1]; // apply sbox\n\n        if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n          tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n          if (i % keyLen === 0) {\n            tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n            rcon = rcon << 1 ^ (rcon >> 7) * 283;\n          }\n        }\n\n        encKey[i] = encKey[i - keyLen] ^ tmp;\n      } // schedule decryption keys\n\n\n      for (j = 0; i; j++, i--) {\n        tmp = encKey[j & 3 ? i : i - 4];\n\n        if (i <= 4 || j < 4) {\n          decKey[j] = tmp;\n        } else {\n          decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n        }\n      }\n    }\n    /**\n     * Decrypt 16 bytes, specified as four 32-bit words.\n     *\n     * @param {number} encrypted0 the first word to decrypt\n     * @param {number} encrypted1 the second word to decrypt\n     * @param {number} encrypted2 the third word to decrypt\n     * @param {number} encrypted3 the fourth word to decrypt\n     * @param {Int32Array} out the array to write the decrypted words\n     * into\n     * @param {number} offset the offset into the output array to start\n     * writing results\n     * @return {Array} The plaintext.\n     */\n\n\n    decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n      const key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n      let a = encrypted0 ^ key[0];\n      let b = encrypted3 ^ key[1];\n      let c = encrypted2 ^ key[2];\n      let d = encrypted1 ^ key[3];\n      let a2;\n      let b2;\n      let c2; // key.length === 2 ?\n\n      const nInnerRounds = key.length / 4 - 2;\n      let i;\n      let kIndex = 4;\n      const table = this._tables[1]; // load up the tables\n\n      const table0 = table[0];\n      const table1 = table[1];\n      const table2 = table[2];\n      const table3 = table[3];\n      const sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n      for (i = 0; i < nInnerRounds; i++) {\n        a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n        b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n        c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n        d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n        kIndex += 4;\n        a = a2;\n        b = b2;\n        c = c2;\n      } // Last round.\n\n\n      for (i = 0; i < 4; i++) {\n        out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n        a2 = a;\n        a = b;\n        b = c;\n        c = d;\n        d = a2;\n      }\n    }\n\n  }\n  /**\n   * @file async-stream.js\n   */\n\n  /**\n   * A wrapper around the Stream class to use setTimeout\n   * and run stream \"jobs\" Asynchronously\n   *\n   * @class AsyncStream\n   * @extends Stream\n   */\n\n\n  class AsyncStream extends Stream {\n    constructor() {\n      super(Stream);\n      this.jobs = [];\n      this.delay = 1;\n      this.timeout_ = null;\n    }\n    /**\n     * process an async job\n     *\n     * @private\n     */\n\n\n    processJob_() {\n      this.jobs.shift()();\n\n      if (this.jobs.length) {\n        this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n      } else {\n        this.timeout_ = null;\n      }\n    }\n    /**\n     * push a job into the stream\n     *\n     * @param {Function} job the job to push into the stream\n     */\n\n\n    push(job) {\n      this.jobs.push(job);\n\n      if (!this.timeout_) {\n        this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n      }\n    }\n\n  }\n  /**\n   * @file decrypter.js\n   *\n   * An asynchronous implementation of AES-128 CBC decryption with\n   * PKCS#7 padding.\n   */\n\n  /**\n   * Convert network-order (big-endian) bytes into their little-endian\n   * representation.\n   */\n\n\n  const ntoh = function (word) {\n    return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n  };\n  /**\n   * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n   *\n   * @param {Uint8Array} encrypted the encrypted bytes\n   * @param {Uint32Array} key the bytes of the decryption key\n   * @param {Uint32Array} initVector the initialization vector (IV) to\n   * use for the first round of CBC.\n   * @return {Uint8Array} the decrypted bytes\n   *\n   * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n   * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n   * @see https://tools.ietf.org/html/rfc2315\n   */\n\n\n  const decrypt = function (encrypted, key, initVector) {\n    // word-level access to the encrypted bytes\n    const encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n    const decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n    const decrypted = new Uint8Array(encrypted.byteLength);\n    const decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n    // decrypted data\n\n    let init0;\n    let init1;\n    let init2;\n    let init3;\n    let encrypted0;\n    let encrypted1;\n    let encrypted2;\n    let encrypted3; // iteration variable\n\n    let wordIx; // pull out the words of the IV to ensure we don't modify the\n    // passed-in reference and easier access\n\n    init0 = initVector[0];\n    init1 = initVector[1];\n    init2 = initVector[2];\n    init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n    // to each decrypted block\n\n    for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n      // convert big-endian (network order) words into little-endian\n      // (javascript order)\n      encrypted0 = ntoh(encrypted32[wordIx]);\n      encrypted1 = ntoh(encrypted32[wordIx + 1]);\n      encrypted2 = ntoh(encrypted32[wordIx + 2]);\n      encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n      decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n      // plaintext\n\n      decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n      decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n      decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n      decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n      init0 = encrypted0;\n      init1 = encrypted1;\n      init2 = encrypted2;\n      init3 = encrypted3;\n    }\n\n    return decrypted;\n  };\n  /**\n   * The `Decrypter` class that manages decryption of AES\n   * data through `AsyncStream` objects and the `decrypt`\n   * function\n   *\n   * @param {Uint8Array} encrypted the encrypted bytes\n   * @param {Uint32Array} key the bytes of the decryption key\n   * @param {Uint32Array} initVector the initialization vector (IV) to\n   * @param {Function} done the function to run when done\n   * @class Decrypter\n   */\n\n\n  class Decrypter {\n    constructor(encrypted, key, initVector, done) {\n      const step = Decrypter.STEP;\n      const encrypted32 = new Int32Array(encrypted.buffer);\n      const decrypted = new Uint8Array(encrypted.byteLength);\n      let i = 0;\n      this.asyncStream_ = new AsyncStream(); // split up the encryption job and do the individual chunks asynchronously\n\n      this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n\n      for (i = step; i < encrypted32.length; i += step) {\n        initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n        this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n      } // invoke the done() callback when everything is finished\n\n\n      this.asyncStream_.push(function () {\n        // remove pkcs#7 padding from the decrypted bytes\n        done(null, unpad(decrypted));\n      });\n    }\n    /**\n     * a getter for step the maximum number of bytes to process at one time\n     *\n     * @return {number} the value of step 32000\n     */\n\n\n    static get STEP() {\n      // 4 * 8000;\n      return 32000;\n    }\n    /**\n     * @private\n     */\n\n\n    decryptChunk_(encrypted, key, initVector, decrypted) {\n      return function () {\n        const bytes = decrypt(encrypted, key, initVector);\n        decrypted.set(bytes, encrypted.byteOffset);\n      };\n    }\n\n  }\n\n  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n  var win;\n\n  if (typeof window !== \"undefined\") {\n    win = window;\n  } else if (typeof commonjsGlobal !== \"undefined\") {\n    win = commonjsGlobal;\n  } else if (typeof self !== \"undefined\") {\n    win = self;\n  } else {\n    win = {};\n  }\n\n  var window_1 = win;\n\n  var isArrayBufferView = function isArrayBufferView(obj) {\n    if (ArrayBuffer.isView === 'function') {\n      return ArrayBuffer.isView(obj);\n    }\n\n    return obj && obj.buffer instanceof ArrayBuffer;\n  };\n\n  var BigInt = window_1.BigInt || Number;\n  [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\n\n  (function () {\n    var a = new Uint16Array([0xFFCC]);\n    var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n\n    if (b[0] === 0xFF) {\n      return 'big';\n    }\n\n    if (b[0] === 0xCC) {\n      return 'little';\n    }\n\n    return 'unknown';\n  })();\n  /**\n   * Creates an object for sending to a web worker modifying properties that are TypedArrays\n   * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n   *\n   * @param {Object} message\n   *        Object of properties and values to send to the web worker\n   * @return {Object}\n   *         Modified message with TypedArray values expanded\n   * @function createTransferableMessage\n   */\n\n\n  const createTransferableMessage = function (message) {\n    const transferable = {};\n    Object.keys(message).forEach(key => {\n      const value = message[key];\n\n      if (isArrayBufferView(value)) {\n        transferable[key] = {\n          bytes: value.buffer,\n          byteOffset: value.byteOffset,\n          byteLength: value.byteLength\n        };\n      } else {\n        transferable[key] = value;\n      }\n    });\n    return transferable;\n  };\n  /* global self */\n\n  /**\n   * Our web worker interface so that things can talk to aes-decrypter\n   * that will be running in a web worker. the scope is passed to this by\n   * webworkify.\n   */\n\n\n  self.onmessage = function (event) {\n    const data = event.data;\n    const encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n    const key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n    const iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n    /* eslint-disable no-new, handle-callback-err */\n\n    new Decrypter(encrypted, key, iv, function (err, bytes) {\n      self.postMessage(createTransferableMessage({\n        source: data.source,\n        decrypted: bytes\n      }), [bytes.buffer]);\n    });\n    /* eslint-enable */\n  };\n}));\nvar Decrypter = factory(workerCode);\n/* rollup-plugin-worker-factory end for worker!/home/runner/work/http-streaming/http-streaming/src/decrypter-worker.js */\n\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nconst audioTrackKind_ = properties => {\n  let kind = properties.default ? 'main' : 'alternative';\n\n  if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n    kind = 'main-desc';\n  }\n\n  return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n *        SegmentLoader to pause\n * @param {Object} mediaType\n *        Active media type\n * @function stopLoaders\n */\n\n\nconst stopLoaders = (segmentLoader, mediaType) => {\n  segmentLoader.abort();\n  segmentLoader.pause();\n\n  if (mediaType && mediaType.activePlaylistLoader) {\n    mediaType.activePlaylistLoader.pause();\n    mediaType.activePlaylistLoader = null;\n  }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n *        PlaylistLoader to start loading\n * @param {Object} mediaType\n *        Active media type\n * @function startLoaders\n */\n\nconst startLoaders = (playlistLoader, mediaType) => {\n  // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n  // playlist loader\n  mediaType.activePlaylistLoader = playlistLoader;\n  playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Handler for a non-destructive resync of SegmentLoader when the active media\n *         group changes.\n * @function onGroupChanged\n */\n\nconst onGroupChanged = (type, settings) => () => {\n  const {\n    segmentLoaders: {\n      [type]: segmentLoader,\n      main: mainSegmentLoader\n    },\n    mediaTypes: {\n      [type]: mediaType\n    }\n  } = settings;\n  const activeTrack = mediaType.activeTrack();\n  const activeGroup = mediaType.getActiveGroup();\n  const previousActiveLoader = mediaType.activePlaylistLoader;\n  const lastGroup = mediaType.lastGroup_; // the group did not change do nothing\n\n  if (activeGroup && lastGroup && activeGroup.id === lastGroup.id) {\n    return;\n  }\n\n  mediaType.lastGroup_ = activeGroup;\n  mediaType.lastTrack_ = activeTrack;\n  stopLoaders(segmentLoader, mediaType);\n\n  if (!activeGroup || activeGroup.isMainPlaylist) {\n    // there is no group active or active group is a main playlist and won't change\n    return;\n  }\n\n  if (!activeGroup.playlistLoader) {\n    if (previousActiveLoader) {\n      // The previous group had a playlist loader but the new active group does not\n      // this means we are switching from demuxed to muxed audio. In this case we want to\n      // do a destructive reset of the main segment loader and not restart the audio\n      // loaders.\n      mainSegmentLoader.resetEverything();\n    }\n\n    return;\n  } // Non-destructive resync\n\n\n  segmentLoader.resyncLoader();\n  startLoaders(activeGroup.playlistLoader, mediaType);\n};\nconst onGroupChanging = (type, settings) => () => {\n  const {\n    segmentLoaders: {\n      [type]: segmentLoader\n    },\n    mediaTypes: {\n      [type]: mediaType\n    }\n  } = settings;\n  mediaType.lastGroup_ = null;\n  segmentLoader.abort();\n  segmentLoader.pause();\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Handler for a destructive reset of SegmentLoader when the active media\n *         track changes.\n * @function onTrackChanged\n */\n\nconst onTrackChanged = (type, settings) => () => {\n  const {\n    mainPlaylistLoader,\n    segmentLoaders: {\n      [type]: segmentLoader,\n      main: mainSegmentLoader\n    },\n    mediaTypes: {\n      [type]: mediaType\n    }\n  } = settings;\n  const activeTrack = mediaType.activeTrack();\n  const activeGroup = mediaType.getActiveGroup();\n  const previousActiveLoader = mediaType.activePlaylistLoader;\n  const lastTrack = mediaType.lastTrack_; // track did not change, do nothing\n\n  if (lastTrack && activeTrack && lastTrack.id === activeTrack.id) {\n    return;\n  }\n\n  mediaType.lastGroup_ = activeGroup;\n  mediaType.lastTrack_ = activeTrack;\n  stopLoaders(segmentLoader, mediaType);\n\n  if (!activeGroup) {\n    // there is no group active so we do not want to restart loaders\n    return;\n  }\n\n  if (activeGroup.isMainPlaylist) {\n    // track did not change, do nothing\n    if (!activeTrack || !lastTrack || activeTrack.id === lastTrack.id) {\n      return;\n    }\n\n    const pc = settings.vhs.playlistController_;\n    const newPlaylist = pc.selectPlaylist(); // media will not change do nothing\n\n    if (pc.media() === newPlaylist) {\n      return;\n    }\n\n    mediaType.logger_(`track change. Switching main audio from ${lastTrack.id} to ${activeTrack.id}`);\n    mainPlaylistLoader.pause();\n    mainSegmentLoader.resetEverything();\n    pc.fastQualityChange_(newPlaylist);\n    return;\n  }\n\n  if (type === 'AUDIO') {\n    if (!activeGroup.playlistLoader) {\n      // when switching from demuxed audio/video to muxed audio/video (noted by no\n      // playlist loader for the audio group), we want to do a destructive reset of the\n      // main segment loader and not restart the audio loaders\n      mainSegmentLoader.setAudio(true); // don't have to worry about disabling the audio of the audio segment loader since\n      // it should be stopped\n\n      mainSegmentLoader.resetEverything();\n      return;\n    } // although the segment loader is an audio segment loader, call the setAudio\n    // function to ensure it is prepared to re-append the init segment (or handle other\n    // config changes)\n\n\n    segmentLoader.setAudio(true);\n    mainSegmentLoader.setAudio(false);\n  }\n\n  if (previousActiveLoader === activeGroup.playlistLoader) {\n    // Nothing has actually changed. This can happen because track change events can fire\n    // multiple times for a \"single\" change. One for enabling the new active track, and\n    // one for disabling the track that was active\n    startLoaders(activeGroup.playlistLoader, mediaType);\n    return;\n  }\n\n  if (segmentLoader.track) {\n    // For WebVTT, set the new text track in the segmentloader\n    segmentLoader.track(activeTrack);\n  } // destructive reset\n\n\n  segmentLoader.resetEverything();\n  startLoaders(activeGroup.playlistLoader, mediaType);\n};\nconst onError = {\n  /**\n   * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n   * an error.\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Error handler. Logs warning (or error if the playlist is excluded) to\n   *         console and switches back to default audio track.\n   * @function onError.AUDIO\n   */\n  AUDIO: (type, settings) => () => {\n    const {\n      mediaTypes: {\n        [type]: mediaType\n      },\n      excludePlaylist\n    } = settings; // switch back to default audio track\n\n    const activeTrack = mediaType.activeTrack();\n    const activeGroup = mediaType.activeGroup();\n    const id = (activeGroup.filter(group => group.default)[0] || activeGroup[0]).id;\n    const defaultTrack = mediaType.tracks[id];\n\n    if (activeTrack === defaultTrack) {\n      // Default track encountered an error. All we can do now is exclude the current\n      // rendition and hope another will switch audio groups\n      excludePlaylist({\n        error: {\n          message: 'Problem encountered loading the default audio track.'\n        }\n      });\n      return;\n    }\n\n    videojs.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n\n    for (const trackId in mediaType.tracks) {\n      mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n    }\n\n    mediaType.onTrackChanged();\n  },\n\n  /**\n   * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n   * an error.\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Error handler. Logs warning to console and disables the active subtitle track\n   * @function onError.SUBTITLES\n   */\n  SUBTITLES: (type, settings) => () => {\n    const {\n      mediaTypes: {\n        [type]: mediaType\n      }\n    } = settings;\n    videojs.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n    const track = mediaType.activeTrack();\n\n    if (track) {\n      track.mode = 'disabled';\n    }\n\n    mediaType.onTrackChanged();\n  }\n};\nconst setupListeners = {\n  /**\n   * Setup event listeners for audio playlist loader\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {PlaylistLoader|null} playlistLoader\n   *        PlaylistLoader to register listeners on\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function setupListeners.AUDIO\n   */\n  AUDIO: (type, playlistLoader, settings) => {\n    if (!playlistLoader) {\n      // no playlist loader means audio will be muxed with the video\n      return;\n    }\n\n    const {\n      tech,\n      requestOptions,\n      segmentLoaders: {\n        [type]: segmentLoader\n      }\n    } = settings;\n    playlistLoader.on('loadedmetadata', () => {\n      const media = playlistLoader.media();\n      segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n      // permits, start downloading segments\n\n      if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('loadedplaylist', () => {\n      segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n      if (!tech.paused()) {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup event listeners for subtitle playlist loader\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {PlaylistLoader|null} playlistLoader\n   *        PlaylistLoader to register listeners on\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function setupListeners.SUBTITLES\n   */\n  SUBTITLES: (type, playlistLoader, settings) => {\n    const {\n      tech,\n      requestOptions,\n      segmentLoaders: {\n        [type]: segmentLoader\n      },\n      mediaTypes: {\n        [type]: mediaType\n      }\n    } = settings;\n    playlistLoader.on('loadedmetadata', () => {\n      const media = playlistLoader.media();\n      segmentLoader.playlist(media, requestOptions);\n      segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n      // permits, start downloading segments\n\n      if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('loadedplaylist', () => {\n      segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n      if (!tech.paused()) {\n        segmentLoader.load();\n      }\n    });\n    playlistLoader.on('error', onError[type](type, settings));\n  }\n};\nconst initialize = {\n  /**\n   * Setup PlaylistLoaders and AudioTracks for the audio groups\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize.AUDIO\n   */\n  'AUDIO': (type, settings) => {\n    const {\n      vhs,\n      sourceType,\n      segmentLoaders: {\n        [type]: segmentLoader\n      },\n      requestOptions,\n      main: {\n        mediaGroups\n      },\n      mediaTypes: {\n        [type]: {\n          groups,\n          tracks,\n          logger_\n        }\n      },\n      mainPlaylistLoader\n    } = settings;\n    const audioOnlyMain = isAudioOnly(mainPlaylistLoader.main); // force a default if we have none\n\n    if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n      mediaGroups[type] = {\n        main: {\n          default: {\n            default: true\n          }\n        }\n      };\n\n      if (audioOnlyMain) {\n        mediaGroups[type].main.default.playlists = mainPlaylistLoader.main.playlists;\n      }\n    }\n\n    for (const groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (const variantLabel in mediaGroups[type][groupId]) {\n        let properties = mediaGroups[type][groupId][variantLabel];\n        let playlistLoader;\n\n        if (audioOnlyMain) {\n          logger_(`AUDIO group '${groupId}' label '${variantLabel}' is a main playlist`);\n          properties.isMainPlaylist = true;\n          playlistLoader = null; // if vhs-json was provided as the source, and the media playlist was resolved,\n          // use the resolved media playlist object\n        } else if (sourceType === 'vhs-json' && properties.playlists) {\n          playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);\n        } else if (properties.resolvedUri) {\n          playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions); // TODO: dash isn't the only type with properties.playlists\n          // should we even have properties.playlists in this check.\n        } else if (properties.playlists && sourceType === 'dash') {\n          playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);\n        } else {\n          // no resolvedUri means the audio is muxed with the video when using this\n          // audio track\n          playlistLoader = null;\n        }\n\n        properties = merge({\n          id: variantLabel,\n          playlistLoader\n        }, properties);\n        setupListeners[type](type, properties.playlistLoader, settings);\n        groups[groupId].push(properties);\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          const track = new videojs.AudioTrack({\n            id: variantLabel,\n            kind: audioTrackKind_(properties),\n            enabled: false,\n            language: properties.language,\n            default: properties.default,\n            label: variantLabel\n          });\n          tracks[variantLabel] = track;\n        }\n      }\n    } // setup single error event handler for the segment loader\n\n\n    segmentLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup PlaylistLoaders and TextTracks for the subtitle groups\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize.SUBTITLES\n   */\n  'SUBTITLES': (type, settings) => {\n    const {\n      tech,\n      vhs,\n      sourceType,\n      segmentLoaders: {\n        [type]: segmentLoader\n      },\n      requestOptions,\n      main: {\n        mediaGroups\n      },\n      mediaTypes: {\n        [type]: {\n          groups,\n          tracks\n        }\n      },\n      mainPlaylistLoader\n    } = settings;\n\n    for (const groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (const variantLabel in mediaGroups[type][groupId]) {\n        if (!vhs.options_.useForcedSubtitles && mediaGroups[type][groupId][variantLabel].forced) {\n          // Subtitle playlists with the forced attribute are not selectable in Safari.\n          // According to Apple's HLS Authoring Specification:\n          //   If content has forced subtitles and regular subtitles in a given language,\n          //   the regular subtitles track in that language MUST contain both the forced\n          //   subtitles and the regular subtitles for that language.\n          // Because of this requirement and that Safari does not add forced subtitles,\n          // forced subtitles are skipped here to maintain consistent experience across\n          // all platforms\n          continue;\n        }\n\n        let properties = mediaGroups[type][groupId][variantLabel];\n        let playlistLoader;\n\n        if (sourceType === 'hls') {\n          playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);\n        } else if (sourceType === 'dash') {\n          const playlists = properties.playlists.filter(p => p.excludeUntil !== Infinity);\n\n          if (!playlists.length) {\n            return;\n          }\n\n          playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);\n        } else if (sourceType === 'vhs-json') {\n          playlistLoader = new PlaylistLoader( // if the vhs-json object included the media playlist, use the media playlist\n          // as provided, otherwise use the resolved URI to load the playlist\n          properties.playlists ? properties.playlists[0] : properties.resolvedUri, vhs, requestOptions);\n        }\n\n        properties = merge({\n          id: variantLabel,\n          playlistLoader\n        }, properties);\n        setupListeners[type](type, properties.playlistLoader, settings);\n        groups[groupId].push(properties);\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          const track = tech.addRemoteTextTrack({\n            id: variantLabel,\n            kind: 'subtitles',\n            default: properties.default && properties.autoselect,\n            language: properties.language,\n            label: variantLabel\n          }, false).track;\n          tracks[variantLabel] = track;\n        }\n      }\n    } // setup single error event handler for the segment loader\n\n\n    segmentLoader.on('error', onError[type](type, settings));\n  },\n\n  /**\n   * Setup TextTracks for the closed-caption groups\n   *\n   * @param {String} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @function initialize['CLOSED-CAPTIONS']\n   */\n  'CLOSED-CAPTIONS': (type, settings) => {\n    const {\n      tech,\n      main: {\n        mediaGroups\n      },\n      mediaTypes: {\n        [type]: {\n          groups,\n          tracks\n        }\n      }\n    } = settings;\n\n    for (const groupId in mediaGroups[type]) {\n      if (!groups[groupId]) {\n        groups[groupId] = [];\n      }\n\n      for (const variantLabel in mediaGroups[type][groupId]) {\n        const properties = mediaGroups[type][groupId][variantLabel]; // Look for either 608 (CCn) or 708 (SERVICEn) caption services\n\n        if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {\n          continue;\n        }\n\n        const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n        let newProps = {\n          label: variantLabel,\n          language: properties.language,\n          instreamId: properties.instreamId,\n          default: properties.default && properties.autoselect\n        };\n\n        if (captionServices[newProps.instreamId]) {\n          newProps = merge(newProps, captionServices[newProps.instreamId]);\n        }\n\n        if (newProps.default === undefined) {\n          delete newProps.default;\n        } // No PlaylistLoader is required for Closed-Captions because the captions are\n        // embedded within the video stream\n\n\n        groups[groupId].push(merge({\n          id: variantLabel\n        }, properties));\n\n        if (typeof tracks[variantLabel] === 'undefined') {\n          const track = tech.addRemoteTextTrack({\n            id: newProps.instreamId,\n            kind: 'captions',\n            default: newProps.default,\n            language: newProps.language,\n            label: newProps.label\n          }, false).track;\n          tracks[variantLabel] = track;\n        }\n      }\n    }\n  }\n};\n\nconst groupMatch = (list, media) => {\n  for (let i = 0; i < list.length; i++) {\n    if (playlistMatch(media, list[i])) {\n      return true;\n    }\n\n    if (list[i].playlists && groupMatch(list[i].playlists, media)) {\n      return true;\n    }\n  }\n\n  return false;\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {string} type\n *        MediaGroup type\n * @param {Object} settings\n *        Object containing required information for media groups\n * @return {Function}\n *         Function that returns the active media group for the provided type. Takes an\n *         optional parameter {TextTrack} track. If no track is provided, a list of all\n *         variants in the group, otherwise the variant corresponding to the provided\n *         track is returned.\n * @function activeGroup\n */\n\n\nconst activeGroup = (type, settings) => track => {\n  const {\n    mainPlaylistLoader,\n    mediaTypes: {\n      [type]: {\n        groups\n      }\n    }\n  } = settings;\n  const media = mainPlaylistLoader.media();\n\n  if (!media) {\n    return null;\n  }\n\n  let variants = null; // set to variants to main media active group\n\n  if (media.attributes[type]) {\n    variants = groups[media.attributes[type]];\n  }\n\n  const groupKeys = Object.keys(groups);\n\n  if (!variants) {\n    // find the mainPlaylistLoader media\n    // that is in a media group if we are dealing\n    // with audio only\n    if (type === 'AUDIO' && groupKeys.length > 1 && isAudioOnly(settings.main)) {\n      for (let i = 0; i < groupKeys.length; i++) {\n        const groupPropertyList = groups[groupKeys[i]];\n\n        if (groupMatch(groupPropertyList, media)) {\n          variants = groupPropertyList;\n          break;\n        }\n      } // use the main group if it exists\n\n    } else if (groups.main) {\n      variants = groups.main; // only one group, use that one\n    } else if (groupKeys.length === 1) {\n      variants = groups[groupKeys[0]];\n    }\n  }\n\n  if (typeof track === 'undefined') {\n    return variants;\n  }\n\n  if (track === null || !variants) {\n    // An active track was specified so a corresponding group is expected. track === null\n    // means no track is currently active so there is no corresponding group\n    return null;\n  }\n\n  return variants.filter(props => props.id === track.id)[0] || null;\n};\nconst activeTrack = {\n  /**\n   * Returns a function used to get the active track of type provided\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Function that returns the active media track for the provided type. Returns\n   *         null if no track is active\n   * @function activeTrack.AUDIO\n   */\n  AUDIO: (type, settings) => () => {\n    const {\n      mediaTypes: {\n        [type]: {\n          tracks\n        }\n      }\n    } = settings;\n\n    for (const id in tracks) {\n      if (tracks[id].enabled) {\n        return tracks[id];\n      }\n    }\n\n    return null;\n  },\n\n  /**\n   * Returns a function used to get the active track of type provided\n   *\n   * @param {string} type\n   *        MediaGroup type\n   * @param {Object} settings\n   *        Object containing required information for media groups\n   * @return {Function}\n   *         Function that returns the active media track for the provided type. Returns\n   *         null if no track is active\n   * @function activeTrack.SUBTITLES\n   */\n  SUBTITLES: (type, settings) => () => {\n    const {\n      mediaTypes: {\n        [type]: {\n          tracks\n        }\n      }\n    } = settings;\n\n    for (const id in tracks) {\n      if (tracks[id].mode === 'showing' || tracks[id].mode === 'hidden') {\n        return tracks[id];\n      }\n    }\n\n    return null;\n  }\n};\nconst getActiveGroup = (type, {\n  mediaTypes\n}) => () => {\n  const activeTrack_ = mediaTypes[type].activeTrack();\n\n  if (!activeTrack_) {\n    return null;\n  }\n\n  return mediaTypes[type].activeGroup(activeTrack_);\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the main manifest.\n *\n * @param {Object} settings\n *        Object containing required information for setting up the media groups\n * @param {Tech} settings.tech\n *        The tech of the player\n * @param {Object} settings.requestOptions\n *        XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.mainPlaylistLoader\n *        PlaylistLoader for the main source\n * @param {VhsHandler} settings.vhs\n *        VHS SourceHandler\n * @param {Object} settings.main\n *        The parsed main manifest\n * @param {Object} settings.mediaTypes\n *        Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.excludePlaylist\n *        Excludes the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\nconst setupMediaGroups = settings => {\n  ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n    initialize[type](type, settings);\n  });\n  const {\n    mediaTypes,\n    mainPlaylistLoader,\n    tech,\n    vhs,\n    segmentLoaders: {\n      ['AUDIO']: audioSegmentLoader,\n      main: mainSegmentLoader\n    }\n  } = settings; // setup active group and track getters and change event handlers\n\n  ['AUDIO', 'SUBTITLES'].forEach(type => {\n    mediaTypes[type].activeGroup = activeGroup(type, settings);\n    mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n    mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n    mediaTypes[type].onGroupChanging = onGroupChanging(type, settings);\n    mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n    mediaTypes[type].getActiveGroup = getActiveGroup(type, settings);\n  }); // DO NOT enable the default subtitle or caption track.\n  // DO enable the default audio track\n\n  const audioGroup = mediaTypes.AUDIO.activeGroup();\n\n  if (audioGroup) {\n    const groupId = (audioGroup.filter(group => group.default)[0] || audioGroup[0]).id;\n    mediaTypes.AUDIO.tracks[groupId].enabled = true;\n    mediaTypes.AUDIO.onGroupChanged();\n    mediaTypes.AUDIO.onTrackChanged();\n    const activeAudioGroup = mediaTypes.AUDIO.getActiveGroup(); // a similar check for handling setAudio on each loader is run again each time the\n    // track is changed, but needs to be handled here since the track may not be considered\n    // changed on the first call to onTrackChanged\n\n    if (!activeAudioGroup.playlistLoader) {\n      // either audio is muxed with video or the stream is audio only\n      mainSegmentLoader.setAudio(true);\n    } else {\n      // audio is demuxed\n      mainSegmentLoader.setAudio(false);\n      audioSegmentLoader.setAudio(true);\n    }\n  }\n\n  mainPlaylistLoader.on('mediachange', () => {\n    ['AUDIO', 'SUBTITLES'].forEach(type => mediaTypes[type].onGroupChanged());\n  });\n  mainPlaylistLoader.on('mediachanging', () => {\n    ['AUDIO', 'SUBTITLES'].forEach(type => mediaTypes[type].onGroupChanging());\n  }); // custom audio track change event handler for usage event\n\n  const onAudioTrackChanged = () => {\n    mediaTypes.AUDIO.onTrackChanged();\n    tech.trigger({\n      type: 'usage',\n      name: 'vhs-audio-change'\n    });\n  };\n\n  tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n  tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n  vhs.on('dispose', () => {\n    tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n    tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n  }); // clear existing audio tracks and add the ones we just created\n\n  tech.clearTracks('audio');\n\n  for (const id in mediaTypes.AUDIO.tracks) {\n    tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n  }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n *         Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\nconst createMediaTypes = () => {\n  const mediaTypes = {};\n  ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n    mediaTypes[type] = {\n      groups: {},\n      tracks: {},\n      activePlaylistLoader: null,\n      activeGroup: noop,\n      activeTrack: noop,\n      getActiveGroup: noop,\n      onGroupChanged: noop,\n      onTrackChanged: noop,\n      lastTrack_: null,\n      logger_: logger(`MediaGroups[${type}]`)\n    };\n  });\n  return mediaTypes;\n};\n\n/**\n * A utility class for setting properties and maintaining the state of the content steering manifest.\n *\n * Content Steering manifest format:\n * VERSION: number (required) currently only version 1 is supported.\n * TTL: number in seconds (optional) until the next content steering manifest reload.\n * RELOAD-URI: string (optional) uri to fetch the next content steering manifest.\n * SERVICE-LOCATION-PRIORITY or PATHWAY-PRIORITY a non empty array of unique string values.\n * PATHWAY-CLONES: array (optional) (HLS only) pathway clone objects to copy from other playlists.\n */\n\nclass SteeringManifest {\n  constructor() {\n    this.priority_ = [];\n    this.pathwayClones_ = new Map();\n  }\n\n  set version(number) {\n    // Only version 1 is currently supported for both DASH and HLS.\n    if (number === 1) {\n      this.version_ = number;\n    }\n  }\n\n  set ttl(seconds) {\n    // TTL = time-to-live, default = 300 seconds.\n    this.ttl_ = seconds || 300;\n  }\n\n  set reloadUri(uri) {\n    if (uri) {\n      // reload URI can be relative to the previous reloadUri.\n      this.reloadUri_ = resolveUrl(this.reloadUri_, uri);\n    }\n  }\n\n  set priority(array) {\n    // priority must be non-empty and unique values.\n    if (array && array.length) {\n      this.priority_ = array;\n    }\n  }\n\n  set pathwayClones(array) {\n    // pathwayClones must be non-empty.\n    if (array && array.length) {\n      this.pathwayClones_ = new Map(array.map(clone => [clone.ID, clone]));\n    }\n  }\n\n  get version() {\n    return this.version_;\n  }\n\n  get ttl() {\n    return this.ttl_;\n  }\n\n  get reloadUri() {\n    return this.reloadUri_;\n  }\n\n  get priority() {\n    return this.priority_;\n  }\n\n  get pathwayClones() {\n    return this.pathwayClones_;\n  }\n\n}\n/**\n * This class represents a content steering manifest and associated state. See both HLS and DASH specifications.\n * HLS: https://developer.apple.com/streaming/HLSContentSteeringSpecification.pdf and\n * https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/ section 4.4.6.6.\n * DASH: https://dashif.org/docs/DASH-IF-CTS-00XX-Content-Steering-Community-Review.pdf\n *\n * @param {function} xhr for making a network request from the browser.\n * @param {function} bandwidth for fetching the current bandwidth from the main segment loader.\n */\n\n\nclass ContentSteeringController extends videojs.EventTarget {\n  constructor(xhr, bandwidth) {\n    super();\n    this.currentPathway = null;\n    this.defaultPathway = null;\n    this.queryBeforeStart = false;\n    this.availablePathways_ = new Set();\n    this.steeringManifest = new SteeringManifest();\n    this.proxyServerUrl_ = null;\n    this.manifestType_ = null;\n    this.ttlTimeout_ = null;\n    this.request_ = null;\n    this.currentPathwayClones = new Map();\n    this.nextPathwayClones = new Map();\n    this.excludedSteeringManifestURLs = new Set();\n    this.logger_ = logger('Content Steering');\n    this.xhr_ = xhr;\n    this.getBandwidth_ = bandwidth;\n  }\n  /**\n   * Assigns the content steering tag properties to the steering controller\n   *\n   * @param {string} baseUrl the baseURL from the main manifest for resolving the steering manifest url\n   * @param {Object} steeringTag the content steering tag from the main manifest\n   */\n\n\n  assignTagProperties(baseUrl, steeringTag) {\n    this.manifestType_ = steeringTag.serverUri ? 'HLS' : 'DASH'; // serverUri is HLS serverURL is DASH\n\n    const steeringUri = steeringTag.serverUri || steeringTag.serverURL;\n\n    if (!steeringUri) {\n      this.logger_(`steering manifest URL is ${steeringUri}, cannot request steering manifest.`);\n      this.trigger('error');\n      return;\n    } // Content steering manifests can be encoded as a data URI. We can decode, parse and return early if that's the case.\n\n\n    if (steeringUri.startsWith('data:')) {\n      this.decodeDataUriManifest_(steeringUri.substring(steeringUri.indexOf(',') + 1));\n      return;\n    } // reloadUri is the resolution of the main manifest URL and steering URL.\n\n\n    this.steeringManifest.reloadUri = resolveUrl(baseUrl, steeringUri); // pathwayId is HLS defaultServiceLocation is DASH\n\n    this.defaultPathway = steeringTag.pathwayId || steeringTag.defaultServiceLocation; // currently only DASH supports the following properties on <ContentSteering> tags.\n\n    this.queryBeforeStart = steeringTag.queryBeforeStart;\n    this.proxyServerUrl_ = steeringTag.proxyServerURL; // trigger a steering event if we have a pathway from the content steering tag.\n    // this tells VHS which segment pathway to start with.\n    // If queryBeforeStart is true we need to wait for the steering manifest response.\n\n    if (this.defaultPathway && !this.queryBeforeStart) {\n      this.trigger('content-steering');\n    }\n  }\n  /**\n   * Requests the content steering manifest and parse the response. This should only be called after\n   * assignTagProperties was called with a content steering tag.\n   *\n   * @param {string} initialUri The optional uri to make the request with.\n   *    If set, the request should be made with exactly what is passed in this variable.\n   *    This scenario should only happen once on initalization.\n   */\n\n\n  requestSteeringManifest(initial) {\n    const reloadUri = this.steeringManifest.reloadUri;\n\n    if (!reloadUri) {\n      return;\n    } // We currently don't support passing MPD query parameters directly to the content steering URL as this requires\n    // ExtUrlQueryInfo tag support. See the DASH content steering spec section 8.1.\n    // This request URI accounts for manifest URIs that have been excluded.\n\n\n    const uri = initial ? reloadUri : this.getRequestURI(reloadUri); // If there are no valid manifest URIs, we should stop content steering.\n\n    if (!uri) {\n      this.logger_('No valid content steering manifest URIs. Stopping content steering.');\n      this.trigger('error');\n      this.dispose();\n      return;\n    }\n\n    this.request_ = this.xhr_({\n      uri\n    }, (error, errorInfo) => {\n      if (error) {\n        // If the client receives HTTP 410 Gone in response to a manifest request,\n        // it MUST NOT issue another request for that URI for the remainder of the\n        // playback session. It MAY continue to use the most-recently obtained set\n        // of Pathways.\n        if (errorInfo.status === 410) {\n          this.logger_(`manifest request 410 ${error}.`);\n          this.logger_(`There will be no more content steering requests to ${uri} this session.`);\n          this.excludedSteeringManifestURLs.add(uri);\n          return;\n        } // If the client receives HTTP 429 Too Many Requests with a Retry-After\n        // header in response to a manifest request, it SHOULD wait until the time\n        // specified by the Retry-After header to reissue the request.\n\n\n        if (errorInfo.status === 429) {\n          const retrySeconds = errorInfo.responseHeaders['retry-after'];\n          this.logger_(`manifest request 429 ${error}.`);\n          this.logger_(`content steering will retry in ${retrySeconds} seconds.`);\n          this.startTTLTimeout_(parseInt(retrySeconds, 10));\n          return;\n        } // If the Steering Manifest cannot be loaded and parsed correctly, the\n        // client SHOULD continue to use the previous values and attempt to reload\n        // it after waiting for the previously-specified TTL (or 5 minutes if\n        // none).\n\n\n        this.logger_(`manifest failed to load ${error}.`);\n        this.startTTLTimeout_();\n        return;\n      }\n\n      const steeringManifestJson = JSON.parse(this.request_.responseText);\n      this.assignSteeringProperties_(steeringManifestJson);\n      this.startTTLTimeout_();\n    });\n  }\n  /**\n   * Set the proxy server URL and add the steering manifest url as a URI encoded parameter.\n   *\n   * @param {string} steeringUrl the steering manifest url\n   * @return the steering manifest url to a proxy server with all parameters set\n   */\n\n\n  setProxyServerUrl_(steeringUrl) {\n    const steeringUrlObject = new window$1.URL(steeringUrl);\n    const proxyServerUrlObject = new window$1.URL(this.proxyServerUrl_);\n    proxyServerUrlObject.searchParams.set('url', encodeURI(steeringUrlObject.toString()));\n    return this.setSteeringParams_(proxyServerUrlObject.toString());\n  }\n  /**\n   * Decodes and parses the data uri encoded steering manifest\n   *\n   * @param {string} dataUri the data uri to be decoded and parsed.\n   */\n\n\n  decodeDataUriManifest_(dataUri) {\n    const steeringManifestJson = JSON.parse(window$1.atob(dataUri));\n    this.assignSteeringProperties_(steeringManifestJson);\n  }\n  /**\n   * Set the HLS or DASH content steering manifest request query parameters. For example:\n   * _HLS_pathway=\"<CURRENT-PATHWAY-ID>\" and _HLS_throughput=<THROUGHPUT>\n   * _DASH_pathway and _DASH_throughput\n   *\n   * @param {string} uri to add content steering server parameters to.\n   * @return a new uri as a string with the added steering query parameters.\n   */\n\n\n  setSteeringParams_(url) {\n    const urlObject = new window$1.URL(url);\n    const path = this.getPathway();\n    const networkThroughput = this.getBandwidth_();\n\n    if (path) {\n      const pathwayKey = `_${this.manifestType_}_pathway`;\n      urlObject.searchParams.set(pathwayKey, path);\n    }\n\n    if (networkThroughput) {\n      const throughputKey = `_${this.manifestType_}_throughput`;\n      urlObject.searchParams.set(throughputKey, networkThroughput);\n    }\n\n    return urlObject.toString();\n  }\n  /**\n   * Assigns the current steering manifest properties and to the SteeringManifest object\n   *\n   * @param {Object} steeringJson the raw JSON steering manifest\n   */\n\n\n  assignSteeringProperties_(steeringJson) {\n    this.steeringManifest.version = steeringJson.VERSION;\n\n    if (!this.steeringManifest.version) {\n      this.logger_(`manifest version is ${steeringJson.VERSION}, which is not supported.`);\n      this.trigger('error');\n      return;\n    }\n\n    this.steeringManifest.ttl = steeringJson.TTL;\n    this.steeringManifest.reloadUri = steeringJson['RELOAD-URI']; // HLS = PATHWAY-PRIORITY required. DASH = SERVICE-LOCATION-PRIORITY optional\n\n    this.steeringManifest.priority = steeringJson['PATHWAY-PRIORITY'] || steeringJson['SERVICE-LOCATION-PRIORITY']; // Pathway clones to be created/updated in HLS.\n    // See section 7.2 https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/\n\n    this.steeringManifest.pathwayClones = steeringJson['PATHWAY-CLONES'];\n    this.nextPathwayClones = this.steeringManifest.pathwayClones; // 1. apply first pathway from the array.\n    // 2. if first pathway doesn't exist in manifest, try next pathway.\n    //    a. if all pathways are exhausted, ignore the steering manifest priority.\n    // 3. if segments fail from an established pathway, try all variants/renditions, then exclude the failed pathway.\n    //    a. exclude a pathway for a minimum of the last TTL duration. Meaning, from the next steering response,\n    //       the excluded pathway will be ignored.\n    //       See excludePathway usage in excludePlaylist().\n    // If there are no available pathways, we need to stop content steering.\n\n    if (!this.availablePathways_.size) {\n      this.logger_('There are no available pathways for content steering. Ending content steering.');\n      this.trigger('error');\n      this.dispose();\n    }\n\n    const chooseNextPathway = pathwaysByPriority => {\n      for (const path of pathwaysByPriority) {\n        if (this.availablePathways_.has(path)) {\n          return path;\n        }\n      } // If no pathway matches, ignore the manifest and choose the first available.\n\n\n      return [...this.availablePathways_][0];\n    };\n\n    const nextPathway = chooseNextPathway(this.steeringManifest.priority);\n\n    if (this.currentPathway !== nextPathway) {\n      this.currentPathway = nextPathway;\n      this.trigger('content-steering');\n    }\n  }\n  /**\n   * Returns the pathway to use for steering decisions\n   *\n   * @return {string} returns the current pathway or the default\n   */\n\n\n  getPathway() {\n    return this.currentPathway || this.defaultPathway;\n  }\n  /**\n   * Chooses the manifest request URI based on proxy URIs and server URLs.\n   * Also accounts for exclusion on certain manifest URIs.\n   *\n   * @param {string} reloadUri the base uri before parameters\n   *\n   * @return {string} the final URI for the request to the manifest server.\n   */\n\n\n  getRequestURI(reloadUri) {\n    if (!reloadUri) {\n      return null;\n    }\n\n    const isExcluded = uri => this.excludedSteeringManifestURLs.has(uri);\n\n    if (this.proxyServerUrl_) {\n      const proxyURI = this.setProxyServerUrl_(reloadUri);\n\n      if (!isExcluded(proxyURI)) {\n        return proxyURI;\n      }\n    }\n\n    const steeringURI = this.setSteeringParams_(reloadUri);\n\n    if (!isExcluded(steeringURI)) {\n      return steeringURI;\n    } // Return nothing if all valid manifest URIs are excluded.\n\n\n    return null;\n  }\n  /**\n   * Start the timeout for re-requesting the steering manifest at the TTL interval.\n   *\n   * @param {number} ttl time in seconds of the timeout. Defaults to the\n   *        ttl interval in the steering manifest\n   */\n\n\n  startTTLTimeout_(ttl = this.steeringManifest.ttl) {\n    // 300 (5 minutes) is the default value.\n    const ttlMS = ttl * 1000;\n    this.ttlTimeout_ = window$1.setTimeout(() => {\n      this.requestSteeringManifest();\n    }, ttlMS);\n  }\n  /**\n   * Clear the TTL timeout if necessary.\n   */\n\n\n  clearTTLTimeout_() {\n    window$1.clearTimeout(this.ttlTimeout_);\n    this.ttlTimeout_ = null;\n  }\n  /**\n   * aborts any current steering xhr and sets the current request object to null\n   */\n\n\n  abort() {\n    if (this.request_) {\n      this.request_.abort();\n    }\n\n    this.request_ = null;\n  }\n  /**\n   * aborts steering requests clears the ttl timeout and resets all properties.\n   */\n\n\n  dispose() {\n    this.off('content-steering');\n    this.off('error');\n    this.abort();\n    this.clearTTLTimeout_();\n    this.currentPathway = null;\n    this.defaultPathway = null;\n    this.queryBeforeStart = null;\n    this.proxyServerUrl_ = null;\n    this.manifestType_ = null;\n    this.ttlTimeout_ = null;\n    this.request_ = null;\n    this.excludedSteeringManifestURLs = new Set();\n    this.availablePathways_ = new Set();\n    this.steeringManifest = new SteeringManifest();\n  }\n  /**\n   * adds a pathway to the available pathways set\n   *\n   * @param {string} pathway the pathway string to add\n   */\n\n\n  addAvailablePathway(pathway) {\n    if (pathway) {\n      this.availablePathways_.add(pathway);\n    }\n  }\n  /**\n   * Clears all pathways from the available pathways set\n   */\n\n\n  clearAvailablePathways() {\n    this.availablePathways_.clear();\n  }\n  /**\n   * Removes a pathway from the available pathways set.\n   */\n\n\n  excludePathway(pathway) {\n    return this.availablePathways_.delete(pathway);\n  }\n  /**\n   * Checks the refreshed DASH manifest content steering tag for changes.\n   *\n   * @param {string} baseURL new steering tag on DASH manifest refresh\n   * @param {Object} newTag the new tag to check for changes\n   * @return a true or false whether the new tag has different values\n   */\n\n\n  didDASHTagChange(baseURL, newTag) {\n    return !newTag && this.steeringManifest.reloadUri || newTag && (resolveUrl(baseURL, newTag.serverURL) !== this.steeringManifest.reloadUri || newTag.defaultServiceLocation !== this.defaultPathway || newTag.queryBeforeStart !== this.queryBeforeStart || newTag.proxyServerURL !== this.proxyServerUrl_);\n  }\n\n  getAvailablePathways() {\n    return this.availablePathways_;\n  }\n\n}\n\n/**\n * @file playlist-controller.js\n */\nconst ABORT_EARLY_EXCLUSION_SECONDS = 10;\nlet Vhs$1; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nconst loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred', 'mediaAppends'];\n\nconst sumLoaderStat = function (stat) {\n  return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\n\nconst shouldSwitchToMedia = function ({\n  currentPlaylist,\n  buffered,\n  currentTime,\n  nextPlaylist,\n  bufferLowWaterLine,\n  bufferHighWaterLine,\n  duration,\n  bufferBasedABR,\n  log\n}) {\n  // we have no other playlist to switch to\n  if (!nextPlaylist) {\n    videojs.log.warn('We received no playlist to switch to. Please check your stream.');\n    return false;\n  }\n\n  const sharedLogLine = `allowing switch ${currentPlaylist && currentPlaylist.id || 'null'} -> ${nextPlaylist.id}`;\n\n  if (!currentPlaylist) {\n    log(`${sharedLogLine} as current playlist is not set`);\n    return true;\n  } // no need to switch if playlist is the same\n\n\n  if (nextPlaylist.id === currentPlaylist.id) {\n    return false;\n  } // determine if current time is in a buffered range.\n\n\n  const isBuffered = Boolean(findRange(buffered, currentTime).length); // If the playlist is live, then we want to not take low water line into account.\n  // This is because in LIVE, the player plays 3 segments from the end of the\n  // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n  // in those segments, a viewer will never experience a rendition upswitch.\n\n  if (!currentPlaylist.endList) {\n    // For LLHLS live streams, don't switch renditions before playback has started, as it almost\n    // doubles the time to first playback.\n    if (!isBuffered && typeof currentPlaylist.partTargetDuration === 'number') {\n      log(`not ${sharedLogLine} as current playlist is live llhls, but currentTime isn't in buffered.`);\n      return false;\n    }\n\n    log(`${sharedLogLine} as current playlist is live`);\n    return true;\n  }\n\n  const forwardBuffer = timeAheadOf(buffered, currentTime);\n  const maxBufferLowWaterLine = bufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE; // For the same reason as LIVE, we ignore the low water line when the VOD\n  // duration is below the max potential low water line\n\n  if (duration < maxBufferLowWaterLine) {\n    log(`${sharedLogLine} as duration < max low water line (${duration} < ${maxBufferLowWaterLine})`);\n    return true;\n  }\n\n  const nextBandwidth = nextPlaylist.attributes.BANDWIDTH;\n  const currBandwidth = currentPlaylist.attributes.BANDWIDTH; // when switching down, if our buffer is lower than the high water line,\n  // we can switch down\n\n  if (nextBandwidth < currBandwidth && (!bufferBasedABR || forwardBuffer < bufferHighWaterLine)) {\n    let logLine = `${sharedLogLine} as next bandwidth < current bandwidth (${nextBandwidth} < ${currBandwidth})`;\n\n    if (bufferBasedABR) {\n      logLine += ` and forwardBuffer < bufferHighWaterLine (${forwardBuffer} < ${bufferHighWaterLine})`;\n    }\n\n    log(logLine);\n    return true;\n  } // and if our buffer is higher than the low water line,\n  // we can switch up\n\n\n  if ((!bufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {\n    let logLine = `${sharedLogLine} as forwardBuffer >= bufferLowWaterLine (${forwardBuffer} >= ${bufferLowWaterLine})`;\n\n    if (bufferBasedABR) {\n      logLine += ` and next bandwidth > current bandwidth (${nextBandwidth} > ${currBandwidth})`;\n    }\n\n    log(logLine);\n    return true;\n  }\n\n  log(`not ${sharedLogLine} as no switching criteria met`);\n  return false;\n};\n/**\n * the main playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a main playlist and a series of audio playlists\n * if they are available\n *\n * @class PlaylistController\n * @extends videojs.EventTarget\n */\n\n\nclass PlaylistController extends videojs.EventTarget {\n  constructor(options) {\n    super();\n    const {\n      src,\n      withCredentials,\n      tech,\n      bandwidth,\n      externVhs,\n      useCueTags,\n      playlistExclusionDuration,\n      enableLowInitialPlaylist,\n      sourceType,\n      cacheEncryptionKeys,\n      bufferBasedABR,\n      leastPixelDiffSelector,\n      captionServices\n    } = options;\n\n    if (!src) {\n      throw new Error('A non-empty playlist URL or JSON manifest string is required');\n    }\n\n    let {\n      maxPlaylistRetries\n    } = options;\n\n    if (maxPlaylistRetries === null || typeof maxPlaylistRetries === 'undefined') {\n      maxPlaylistRetries = Infinity;\n    }\n\n    Vhs$1 = externVhs;\n    this.bufferBasedABR = Boolean(bufferBasedABR);\n    this.leastPixelDiffSelector = Boolean(leastPixelDiffSelector);\n    this.withCredentials = withCredentials;\n    this.tech_ = tech;\n    this.vhs_ = tech.vhs;\n    this.sourceType_ = sourceType;\n    this.useCueTags_ = useCueTags;\n    this.playlistExclusionDuration = playlistExclusionDuration;\n    this.maxPlaylistRetries = maxPlaylistRetries;\n    this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n\n    if (this.useCueTags_) {\n      this.cueTagsTrack_ = this.tech_.addTextTrack('metadata', 'ad-cues');\n      this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n    }\n\n    this.requestOptions_ = {\n      withCredentials,\n      maxPlaylistRetries,\n      timeout: null\n    };\n    this.on('error', this.pauseLoading);\n    this.mediaTypes_ = createMediaTypes();\n    this.mediaSource = new window$1.MediaSource();\n    this.handleDurationChange_ = this.handleDurationChange_.bind(this);\n    this.handleSourceOpen_ = this.handleSourceOpen_.bind(this);\n    this.handleSourceEnded_ = this.handleSourceEnded_.bind(this);\n    this.mediaSource.addEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n    this.mediaSource.addEventListener('sourceopen', this.handleSourceOpen_);\n    this.mediaSource.addEventListener('sourceended', this.handleSourceEnded_); // we don't have to handle sourceclose since dispose will handle termination of\n    // everything, and the MediaSource should not be detached without a proper disposal\n\n    this.seekable_ = createTimeRanges();\n    this.hasPlayed_ = false;\n    this.syncController_ = new SyncController(options);\n    this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n      kind: 'metadata',\n      label: 'segment-metadata'\n    }, false).track;\n    this.decrypter_ = new Decrypter();\n    this.sourceUpdater_ = new SourceUpdater(this.mediaSource);\n    this.inbandTextTracks_ = {};\n    this.timelineChangeController_ = new TimelineChangeController();\n    this.keyStatusMap_ = new Map();\n    const segmentLoaderSettings = {\n      vhs: this.vhs_,\n      parse708captions: options.parse708captions,\n      useDtsForTimestampOffset: options.useDtsForTimestampOffset,\n      captionServices,\n      mediaSource: this.mediaSource,\n      currentTime: this.tech_.currentTime.bind(this.tech_),\n      seekable: () => this.seekable(),\n      seeking: () => this.tech_.seeking(),\n      duration: () => this.duration(),\n      hasPlayed: () => this.hasPlayed_,\n      goalBufferLength: () => this.goalBufferLength(),\n      bandwidth,\n      syncController: this.syncController_,\n      decrypter: this.decrypter_,\n      sourceType: this.sourceType_,\n      inbandTextTracks: this.inbandTextTracks_,\n      cacheEncryptionKeys,\n      sourceUpdater: this.sourceUpdater_,\n      timelineChangeController: this.timelineChangeController_,\n      exactManifestTimings: options.exactManifestTimings,\n      addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this)\n    }; // The source type check not only determines whether a special DASH playlist loader\n    // should be used, but also covers the case where the provided src is a vhs-json\n    // manifest object (instead of a URL). In the case of vhs-json, the default\n    // PlaylistLoader should be used.\n\n    this.mainPlaylistLoader_ = this.sourceType_ === 'dash' ? new DashPlaylistLoader(src, this.vhs_, merge(this.requestOptions_, {\n      addMetadataToTextTrack: this.addMetadataToTextTrack.bind(this)\n    })) : new PlaylistLoader(src, this.vhs_, merge(this.requestOptions_, {\n      addDateRangesToTextTrack: this.addDateRangesToTextTrack_.bind(this)\n    }));\n    this.setupMainPlaylistLoaderListeners_(); // setup segment loaders\n    // combined audio/video or just video when alternate audio track is selected\n\n    this.mainSegmentLoader_ = new SegmentLoader(merge(segmentLoaderSettings, {\n      segmentMetadataTrack: this.segmentMetadataTrack_,\n      loaderType: 'main'\n    }), options); // alternate audio track\n\n    this.audioSegmentLoader_ = new SegmentLoader(merge(segmentLoaderSettings, {\n      loaderType: 'audio'\n    }), options);\n    this.subtitleSegmentLoader_ = new VTTSegmentLoader(merge(segmentLoaderSettings, {\n      loaderType: 'vtt',\n      featuresNativeTextTracks: this.tech_.featuresNativeTextTracks,\n      loadVttJs: () => new Promise((resolve, reject) => {\n        function onLoad() {\n          tech.off('vttjserror', onError);\n          resolve();\n        }\n\n        function onError() {\n          tech.off('vttjsloaded', onLoad);\n          reject();\n        }\n\n        tech.one('vttjsloaded', onLoad);\n        tech.one('vttjserror', onError); // safe to call multiple times, script will be loaded only once:\n\n        tech.addWebVttScript_();\n      })\n    }), options);\n\n    const getBandwidth = () => {\n      return this.mainSegmentLoader_.bandwidth;\n    };\n\n    this.contentSteeringController_ = new ContentSteeringController(this.vhs_.xhr, getBandwidth);\n    this.setupSegmentLoaderListeners_();\n\n    if (this.bufferBasedABR) {\n      this.mainPlaylistLoader_.one('loadedplaylist', () => this.startABRTimer_());\n      this.tech_.on('pause', () => this.stopABRTimer_());\n      this.tech_.on('play', () => this.startABRTimer_());\n    } // Create SegmentLoader stat-getters\n    // mediaRequests_\n    // mediaRequestsAborted_\n    // mediaRequestsTimedout_\n    // mediaRequestsErrored_\n    // mediaTransferDuration_\n    // mediaBytesTransferred_\n    // mediaAppends_\n\n\n    loaderStats.forEach(stat => {\n      this[stat + '_'] = sumLoaderStat.bind(this, stat);\n    });\n    this.logger_ = logger('pc');\n    this.triggeredFmp4Usage = false;\n\n    if (this.tech_.preload() === 'none') {\n      this.loadOnPlay_ = () => {\n        this.loadOnPlay_ = null;\n        this.mainPlaylistLoader_.load();\n      };\n\n      this.tech_.one('play', this.loadOnPlay_);\n    } else {\n      this.mainPlaylistLoader_.load();\n    }\n\n    this.timeToLoadedData__ = -1;\n    this.mainAppendsToLoadedData__ = -1;\n    this.audioAppendsToLoadedData__ = -1;\n    const event = this.tech_.preload() === 'none' ? 'play' : 'loadstart'; // start the first frame timer on loadstart or play (for preload none)\n\n    this.tech_.one(event, () => {\n      const timeToLoadedDataStart = Date.now();\n      this.tech_.one('loadeddata', () => {\n        this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;\n        this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends;\n        this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends;\n      });\n    });\n  }\n\n  mainAppendsToLoadedData_() {\n    return this.mainAppendsToLoadedData__;\n  }\n\n  audioAppendsToLoadedData_() {\n    return this.audioAppendsToLoadedData__;\n  }\n\n  appendsToLoadedData_() {\n    const main = this.mainAppendsToLoadedData_();\n    const audio = this.audioAppendsToLoadedData_();\n\n    if (main === -1 || audio === -1) {\n      return -1;\n    }\n\n    return main + audio;\n  }\n\n  timeToLoadedData_() {\n    return this.timeToLoadedData__;\n  }\n  /**\n   * Run selectPlaylist and switch to the new playlist if we should\n   *\n   * @param {string} [reason=abr] a reason for why the ABR check is made\n   * @private\n   */\n\n\n  checkABR_(reason = 'abr') {\n    const nextPlaylist = this.selectPlaylist();\n\n    if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {\n      this.switchMedia_(nextPlaylist, reason);\n    }\n  }\n\n  switchMedia_(playlist, cause, delay) {\n    const oldMedia = this.media();\n    const oldId = oldMedia && (oldMedia.id || oldMedia.uri);\n    const newId = playlist && (playlist.id || playlist.uri);\n\n    if (oldId && oldId !== newId) {\n      this.logger_(`switch media ${oldId} -> ${newId} from ${cause}`);\n      this.tech_.trigger({\n        type: 'usage',\n        name: `vhs-rendition-change-${cause}`\n      });\n    }\n\n    this.mainPlaylistLoader_.media(playlist, delay);\n  }\n  /**\n   * A function that ensures we switch our playlists inside of `mediaTypes`\n   * to match the current `serviceLocation` provided by the contentSteering controller.\n   * We want to check media types of `AUDIO`, `SUBTITLES`, and `CLOSED-CAPTIONS`.\n   *\n   * This should only be called on a DASH playback scenario while using content steering.\n   * This is necessary due to differences in how media in HLS manifests are generally tied to\n   * a video playlist, where in DASH that is not always the case.\n   */\n\n\n  switchMediaForDASHContentSteering_() {\n    ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(type => {\n      const mediaType = this.mediaTypes_[type];\n      const activeGroup = mediaType ? mediaType.activeGroup() : null;\n      const pathway = this.contentSteeringController_.getPathway();\n\n      if (activeGroup && pathway) {\n        // activeGroup can be an array or a single group\n        const mediaPlaylists = activeGroup.length ? activeGroup[0].playlists : activeGroup.playlists;\n        const dashMediaPlaylists = mediaPlaylists.filter(p => p.attributes.serviceLocation === pathway); // Switch the current active playlist to the correct CDN\n\n        if (dashMediaPlaylists.length) {\n          this.mediaTypes_[type].activePlaylistLoader.media(dashMediaPlaylists[0]);\n        }\n      }\n    });\n  }\n  /**\n   * Start a timer that periodically calls checkABR_\n   *\n   * @private\n   */\n\n\n  startABRTimer_() {\n    this.stopABRTimer_();\n    this.abrTimer_ = window$1.setInterval(() => this.checkABR_(), 250);\n  }\n  /**\n   * Stop the timer that periodically calls checkABR_\n   *\n   * @private\n   */\n\n\n  stopABRTimer_() {\n    // if we're scrubbing, we don't need to pause.\n    // This getter will be added to Video.js in version 7.11.\n    if (this.tech_.scrubbing && this.tech_.scrubbing()) {\n      return;\n    }\n\n    window$1.clearInterval(this.abrTimer_);\n    this.abrTimer_ = null;\n  }\n  /**\n   * Get a list of playlists for the currently selected audio playlist\n   *\n   * @return {Array} the array of audio playlists\n   */\n\n\n  getAudioTrackPlaylists_() {\n    const main = this.main();\n    const defaultPlaylists = main && main.playlists || []; // if we don't have any audio groups then we can only\n    // assume that the audio tracks are contained in main\n    // playlist array, use that or an empty array.\n\n    if (!main || !main.mediaGroups || !main.mediaGroups.AUDIO) {\n      return defaultPlaylists;\n    }\n\n    const AUDIO = main.mediaGroups.AUDIO;\n    const groupKeys = Object.keys(AUDIO);\n    let track; // get the current active track\n\n    if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {\n      track = this.mediaTypes_.AUDIO.activeTrack(); // or get the default track from main if mediaTypes_ isn't setup yet\n    } else {\n      // default group is `main` or just the first group.\n      const defaultGroup = AUDIO.main || groupKeys.length && AUDIO[groupKeys[0]];\n\n      for (const label in defaultGroup) {\n        if (defaultGroup[label].default) {\n          track = {\n            label\n          };\n          break;\n        }\n      }\n    } // no active track no playlists.\n\n\n    if (!track) {\n      return defaultPlaylists;\n    }\n\n    const playlists = []; // get all of the playlists that are possible for the\n    // active track.\n\n    for (const group in AUDIO) {\n      if (AUDIO[group][track.label]) {\n        const properties = AUDIO[group][track.label];\n\n        if (properties.playlists && properties.playlists.length) {\n          playlists.push.apply(playlists, properties.playlists);\n        } else if (properties.uri) {\n          playlists.push(properties);\n        } else if (main.playlists.length) {\n          // if an audio group does not have a uri\n          // see if we have main playlists that use it as a group.\n          // if we do then add those to the playlists list.\n          for (let i = 0; i < main.playlists.length; i++) {\n            const playlist = main.playlists[i];\n\n            if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {\n              playlists.push(playlist);\n            }\n          }\n        }\n      }\n    }\n\n    if (!playlists.length) {\n      return defaultPlaylists;\n    }\n\n    return playlists;\n  }\n  /**\n   * Register event handlers on the main playlist loader. A helper\n   * function for construction time.\n   *\n   * @private\n   */\n\n\n  setupMainPlaylistLoaderListeners_() {\n    this.mainPlaylistLoader_.on('loadedmetadata', () => {\n      const media = this.mainPlaylistLoader_.media();\n      const requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n      // timeout the request.\n\n      if (isLowestEnabledRendition(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {\n        this.requestOptions_.timeout = 0;\n      } else {\n        this.requestOptions_.timeout = requestTimeout;\n      } // if this isn't a live video and preload permits, start\n      // downloading segments\n\n\n      if (media.endList && this.tech_.preload() !== 'none') {\n        this.mainSegmentLoader_.playlist(media, this.requestOptions_);\n        this.mainSegmentLoader_.load();\n      }\n\n      setupMediaGroups({\n        sourceType: this.sourceType_,\n        segmentLoaders: {\n          AUDIO: this.audioSegmentLoader_,\n          SUBTITLES: this.subtitleSegmentLoader_,\n          main: this.mainSegmentLoader_\n        },\n        tech: this.tech_,\n        requestOptions: this.requestOptions_,\n        mainPlaylistLoader: this.mainPlaylistLoader_,\n        vhs: this.vhs_,\n        main: this.main(),\n        mediaTypes: this.mediaTypes_,\n        excludePlaylist: this.excludePlaylist.bind(this)\n      });\n      this.triggerPresenceUsage_(this.main(), media);\n      this.setupFirstPlay();\n\n      if (!this.mediaTypes_.AUDIO.activePlaylistLoader || this.mediaTypes_.AUDIO.activePlaylistLoader.media()) {\n        this.trigger('selectedinitialmedia');\n      } else {\n        // We must wait for the active audio playlist loader to\n        // finish setting up before triggering this event so the\n        // representations API and EME setup is correct\n        this.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', () => {\n          this.trigger('selectedinitialmedia');\n        });\n      }\n    });\n    this.mainPlaylistLoader_.on('loadedplaylist', () => {\n      if (this.loadOnPlay_) {\n        this.tech_.off('play', this.loadOnPlay_);\n      }\n\n      let updatedPlaylist = this.mainPlaylistLoader_.media();\n\n      if (!updatedPlaylist) {\n        // Add content steering listeners on first load and init.\n        this.attachContentSteeringListeners_();\n        this.initContentSteeringController_(); // exclude any variants that are not supported by the browser before selecting\n        // an initial media as the playlist selectors do not consider browser support\n\n        this.excludeUnsupportedVariants_();\n        let selectedMedia;\n\n        if (this.enableLowInitialPlaylist) {\n          selectedMedia = this.selectInitialPlaylist();\n        }\n\n        if (!selectedMedia) {\n          selectedMedia = this.selectPlaylist();\n        }\n\n        if (!selectedMedia || !this.shouldSwitchToMedia_(selectedMedia)) {\n          return;\n        }\n\n        this.initialMedia_ = selectedMedia;\n        this.switchMedia_(this.initialMedia_, 'initial'); // Under the standard case where a source URL is provided, loadedplaylist will\n        // fire again since the playlist will be requested. In the case of vhs-json\n        // (where the manifest object is provided as the source), when the media\n        // playlist's `segments` list is already available, a media playlist won't be\n        // requested, and loadedplaylist won't fire again, so the playlist handler must be\n        // called on its own here.\n\n        const haveJsonSource = this.sourceType_ === 'vhs-json' && this.initialMedia_.segments;\n\n        if (!haveJsonSource) {\n          return;\n        }\n\n        updatedPlaylist = this.initialMedia_;\n      }\n\n      this.handleUpdatedMediaPlaylist(updatedPlaylist);\n    });\n    this.mainPlaylistLoader_.on('error', () => {\n      const error = this.mainPlaylistLoader_.error;\n      this.excludePlaylist({\n        playlistToExclude: error.playlist,\n        error\n      });\n    });\n    this.mainPlaylistLoader_.on('mediachanging', () => {\n      this.mainSegmentLoader_.abort();\n      this.mainSegmentLoader_.pause();\n    });\n    this.mainPlaylistLoader_.on('mediachange', () => {\n      const media = this.mainPlaylistLoader_.media();\n      const requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n      // timeout the request.\n\n      if (isLowestEnabledRendition(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {\n        this.requestOptions_.timeout = 0;\n      } else {\n        this.requestOptions_.timeout = requestTimeout;\n      }\n\n      if (this.sourceType_ === 'dash') {\n        // we don't want to re-request the same hls playlist right after it was changed\n        this.mainPlaylistLoader_.load();\n      } // TODO: Create a new event on the PlaylistLoader that signals\n      // that the segments have changed in some way and use that to\n      // update the SegmentLoader instead of doing it twice here and\n      // on `loadedplaylist`\n\n\n      this.mainSegmentLoader_.pause();\n      this.mainSegmentLoader_.playlist(media, this.requestOptions_);\n\n      if (this.waitingForFastQualityPlaylistReceived_) {\n        this.runFastQualitySwitch_();\n      } else {\n        this.mainSegmentLoader_.load();\n      }\n\n      this.tech_.trigger({\n        type: 'mediachange',\n        bubbles: true\n      });\n    });\n    this.mainPlaylistLoader_.on('playlistunchanged', () => {\n      const updatedPlaylist = this.mainPlaylistLoader_.media(); // ignore unchanged playlists that have already been\n      // excluded for not-changing. We likely just have a really slowly updating\n      // playlist.\n\n      if (updatedPlaylist.lastExcludeReason_ === 'playlist-unchanged') {\n        return;\n      }\n\n      const playlistOutdated = this.stuckAtPlaylistEnd_(updatedPlaylist);\n\n      if (playlistOutdated) {\n        // Playlist has stopped updating and we're stuck at its end. Try to\n        // exclude it and switch to another playlist in the hope that that\n        // one is updating (and give the player a chance to re-adjust to the\n        // safe live point).\n        this.excludePlaylist({\n          error: {\n            message: 'Playlist no longer updating.',\n            reason: 'playlist-unchanged'\n          }\n        }); // useful for monitoring QoS\n\n        this.tech_.trigger('playliststuck');\n      }\n    });\n    this.mainPlaylistLoader_.on('renditiondisabled', () => {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-rendition-disabled'\n      });\n    });\n    this.mainPlaylistLoader_.on('renditionenabled', () => {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-rendition-enabled'\n      });\n    });\n  }\n  /**\n   * Given an updated media playlist (whether it was loaded for the first time, or\n   * refreshed for live playlists), update any relevant properties and state to reflect\n   * changes in the media that should be accounted for (e.g., cues and duration).\n   *\n   * @param {Object} updatedPlaylist the updated media playlist object\n   *\n   * @private\n   */\n\n\n  handleUpdatedMediaPlaylist(updatedPlaylist) {\n    if (this.useCueTags_) {\n      this.updateAdCues_(updatedPlaylist);\n    } // TODO: Create a new event on the PlaylistLoader that signals\n    // that the segments have changed in some way and use that to\n    // update the SegmentLoader instead of doing it twice here and\n    // on `mediachange`\n\n\n    this.mainSegmentLoader_.pause();\n    this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);\n\n    if (this.waitingForFastQualityPlaylistReceived_) {\n      this.runFastQualitySwitch_();\n    }\n\n    this.updateDuration(!updatedPlaylist.endList); // If the player isn't paused, ensure that the segment loader is running,\n    // as it is possible that it was temporarily stopped while waiting for\n    // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n    if (!this.tech_.paused()) {\n      this.mainSegmentLoader_.load();\n\n      if (this.audioSegmentLoader_) {\n        this.audioSegmentLoader_.load();\n      }\n    }\n  }\n  /**\n   * A helper function for triggerring presence usage events once per source\n   *\n   * @private\n   */\n\n\n  triggerPresenceUsage_(main, media) {\n    const mediaGroups = main.mediaGroups || {};\n    let defaultDemuxed = true;\n    const audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n\n    for (const mediaGroup in mediaGroups.AUDIO) {\n      for (const label in mediaGroups.AUDIO[mediaGroup]) {\n        const properties = mediaGroups.AUDIO[mediaGroup][label];\n\n        if (!properties.uri) {\n          defaultDemuxed = false;\n        }\n      }\n    }\n\n    if (defaultDemuxed) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-demuxed'\n      });\n    }\n\n    if (Object.keys(mediaGroups.SUBTITLES).length) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-webvtt'\n      });\n    }\n\n    if (Vhs$1.Playlist.isAes(media)) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-aes'\n      });\n    }\n\n    if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-alternate-audio'\n      });\n    }\n\n    if (this.useCueTags_) {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-playlist-cue-tags'\n      });\n    }\n  }\n\n  shouldSwitchToMedia_(nextPlaylist) {\n    const currentPlaylist = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pendingMedia_;\n    const currentTime = this.tech_.currentTime();\n    const bufferLowWaterLine = this.bufferLowWaterLine();\n    const bufferHighWaterLine = this.bufferHighWaterLine();\n    const buffered = this.tech_.buffered();\n    return shouldSwitchToMedia({\n      buffered,\n      currentTime,\n      currentPlaylist,\n      nextPlaylist,\n      bufferLowWaterLine,\n      bufferHighWaterLine,\n      duration: this.duration(),\n      bufferBasedABR: this.bufferBasedABR,\n      log: this.logger_\n    });\n  }\n  /**\n   * Register event handlers on the segment loaders. A helper function\n   * for construction time.\n   *\n   * @private\n   */\n\n\n  setupSegmentLoaderListeners_() {\n    this.mainSegmentLoader_.on('bandwidthupdate', () => {\n      // Whether or not buffer based ABR or another ABR is used, on a bandwidth change it's\n      // useful to check to see if a rendition switch should be made.\n      this.checkABR_('bandwidthupdate');\n      this.tech_.trigger('bandwidthupdate');\n    });\n    this.mainSegmentLoader_.on('timeout', () => {\n      if (this.bufferBasedABR) {\n        // If a rendition change is needed, then it would've be done on `bandwidthupdate`.\n        // Here the only consideration is that for buffer based ABR there's no guarantee\n        // of an immediate switch (since the bandwidth is averaged with a timeout\n        // bandwidth value of 1), so force a load on the segment loader to keep it going.\n        this.mainSegmentLoader_.load();\n      }\n    }); // `progress` events are not reliable enough of a bandwidth measure to trigger buffer\n    // based ABR.\n\n    if (!this.bufferBasedABR) {\n      this.mainSegmentLoader_.on('progress', () => {\n        this.trigger('progress');\n      });\n    }\n\n    this.mainSegmentLoader_.on('error', () => {\n      const error = this.mainSegmentLoader_.error();\n      this.excludePlaylist({\n        playlistToExclude: error.playlist,\n        error\n      });\n    });\n    this.mainSegmentLoader_.on('appenderror', () => {\n      this.error = this.mainSegmentLoader_.error_;\n      this.trigger('error');\n    });\n    this.mainSegmentLoader_.on('syncinfoupdate', () => {\n      this.onSyncInfoUpdate_();\n    });\n    this.mainSegmentLoader_.on('timestampoffset', () => {\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-timestamp-offset'\n      });\n    });\n    this.audioSegmentLoader_.on('syncinfoupdate', () => {\n      this.onSyncInfoUpdate_();\n    });\n    this.audioSegmentLoader_.on('appenderror', () => {\n      this.error = this.audioSegmentLoader_.error_;\n      this.trigger('error');\n    });\n    this.mainSegmentLoader_.on('ended', () => {\n      this.logger_('main segment loader ended');\n      this.onEndOfStream();\n    });\n    this.mainSegmentLoader_.on('earlyabort', event => {\n      // never try to early abort with the new ABR algorithm\n      if (this.bufferBasedABR) {\n        return;\n      }\n\n      this.delegateLoaders_('all', ['abort']);\n      this.excludePlaylist({\n        error: {\n          message: 'Aborted early because there isn\\'t enough bandwidth to complete ' + 'the request without rebuffering.'\n        },\n        playlistExclusionDuration: ABORT_EARLY_EXCLUSION_SECONDS\n      });\n    });\n\n    const updateCodecs = () => {\n      if (!this.sourceUpdater_.hasCreatedSourceBuffers()) {\n        return this.tryToCreateSourceBuffers_();\n      }\n\n      const codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n      if (!codecs) {\n        return;\n      }\n\n      this.sourceUpdater_.addOrChangeSourceBuffers(codecs);\n    };\n\n    this.mainSegmentLoader_.on('trackinfo', updateCodecs);\n    this.audioSegmentLoader_.on('trackinfo', updateCodecs);\n    this.mainSegmentLoader_.on('fmp4', () => {\n      if (!this.triggeredFmp4Usage) {\n        this.tech_.trigger({\n          type: 'usage',\n          name: 'vhs-fmp4'\n        });\n        this.triggeredFmp4Usage = true;\n      }\n    });\n    this.audioSegmentLoader_.on('fmp4', () => {\n      if (!this.triggeredFmp4Usage) {\n        this.tech_.trigger({\n          type: 'usage',\n          name: 'vhs-fmp4'\n        });\n        this.triggeredFmp4Usage = true;\n      }\n    });\n    this.audioSegmentLoader_.on('ended', () => {\n      this.logger_('audioSegmentLoader ended');\n      this.onEndOfStream();\n    });\n  }\n\n  mediaSecondsLoaded_() {\n    return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n  }\n  /**\n   * Call load on our SegmentLoaders\n   */\n\n\n  load() {\n    this.mainSegmentLoader_.load();\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      this.audioSegmentLoader_.load();\n    }\n\n    if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n      this.subtitleSegmentLoader_.load();\n    }\n  }\n  /**\n   * Re-tune playback quality level for the current player\n   * conditions. This method will perform destructive actions like removing\n   * already buffered content in order to readjust the currently active\n   * playlist quickly. This is good for manual quality changes\n   *\n   * @private\n   */\n\n\n  fastQualityChange_(media = this.selectPlaylist()) {\n    if (media && media === this.mainPlaylistLoader_.media()) {\n      this.logger_('skipping fastQualityChange because new media is same as old');\n      return;\n    }\n\n    this.switchMedia_(media, 'fast-quality'); // we would like to avoid race condition when we call fastQuality,\n    // reset everything and start loading segments from prev segments instead of new because new playlist is not received yet\n\n    this.waitingForFastQualityPlaylistReceived_ = true;\n  }\n\n  runFastQualitySwitch_() {\n    this.waitingForFastQualityPlaylistReceived_ = false; // Delete all buffered data to allow an immediate quality switch, then seek to give\n    // the browser a kick to remove any cached frames from the previous rendtion (.04 seconds\n    // ahead was roughly the minimum that will accomplish this across a variety of content\n    // in IE and Edge, but seeking in place is sufficient on all other browsers)\n    // Edge/IE bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14600375/\n    // Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=651904\n\n    this.mainSegmentLoader_.pause();\n    this.mainSegmentLoader_.resetEverything(() => {\n      this.tech_.setCurrentTime(this.tech_.currentTime());\n    }); // don't need to reset audio as it is reset when media changes\n  }\n  /**\n   * Begin playback.\n   */\n\n\n  play() {\n    if (this.setupFirstPlay()) {\n      return;\n    }\n\n    if (this.tech_.ended()) {\n      this.tech_.setCurrentTime(0);\n    }\n\n    if (this.hasPlayed_) {\n      this.load();\n    }\n\n    const seekable = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n    // seek forward to the live point\n\n    if (this.tech_.duration() === Infinity) {\n      if (this.tech_.currentTime() < seekable.start(0)) {\n        return this.tech_.setCurrentTime(seekable.end(seekable.length - 1));\n      }\n    }\n  }\n  /**\n   * Seek to the latest media position if this is a live video and the\n   * player and video are loaded and initialized.\n   */\n\n\n  setupFirstPlay() {\n    const media = this.mainPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n    //  If 1) there is no active media\n    //     2) the player is paused\n    //     3) the first play has already been setup\n    // then exit early\n\n    if (!media || this.tech_.paused() || this.hasPlayed_) {\n      return false;\n    } // when the video is a live stream and/or has a start time\n\n\n    if (!media.endList || media.start) {\n      const seekable = this.seekable();\n\n      if (!seekable.length) {\n        // without a seekable range, the player cannot seek to begin buffering at the\n        // live or start point\n        return false;\n      }\n\n      const seekableEnd = seekable.end(0);\n      let startPoint = seekableEnd;\n\n      if (media.start) {\n        const offset = media.start.timeOffset;\n\n        if (offset < 0) {\n          startPoint = Math.max(seekableEnd + offset, seekable.start(0));\n        } else {\n          startPoint = Math.min(seekableEnd, offset);\n        }\n      } // trigger firstplay to inform the source handler to ignore the next seek event\n\n\n      this.trigger('firstplay'); // seek to the live point\n\n      this.tech_.setCurrentTime(startPoint);\n    }\n\n    this.hasPlayed_ = true; // we can begin loading now that everything is ready\n\n    this.load();\n    return true;\n  }\n  /**\n   * handle the sourceopen event on the MediaSource\n   *\n   * @private\n   */\n\n\n  handleSourceOpen_() {\n    // Only attempt to create the source buffer if none already exist.\n    // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n    // after `endOfStream` has been called (in response to a seek for instance)\n    this.tryToCreateSourceBuffers_(); // if autoplay is enabled, begin playback. This is duplicative of\n    // code in video.js but is required because play() must be invoked\n    // *after* the media source has opened.\n\n    if (this.tech_.autoplay()) {\n      const playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n      // on browsers which return a promise\n\n      if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n        playPromise.then(null, e => {});\n      }\n    }\n\n    this.trigger('sourceopen');\n  }\n  /**\n   * handle the sourceended event on the MediaSource\n   *\n   * @private\n   */\n\n\n  handleSourceEnded_() {\n    if (!this.inbandTextTracks_.metadataTrack_) {\n      return;\n    }\n\n    const cues = this.inbandTextTracks_.metadataTrack_.cues;\n\n    if (!cues || !cues.length) {\n      return;\n    }\n\n    const duration = this.duration();\n    cues[cues.length - 1].endTime = isNaN(duration) || Math.abs(duration) === Infinity ? Number.MAX_VALUE : duration;\n  }\n  /**\n   * handle the durationchange event on the MediaSource\n   *\n   * @private\n   */\n\n\n  handleDurationChange_() {\n    this.tech_.trigger('durationchange');\n  }\n  /**\n   * Calls endOfStream on the media source when all active stream types have called\n   * endOfStream\n   *\n   * @param {string} streamType\n   *        Stream type of the segment loader that called endOfStream\n   * @private\n   */\n\n\n  onEndOfStream() {\n    let isEndOfStream = this.mainSegmentLoader_.ended_;\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      const mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_(); // if the audio playlist loader exists, then alternate audio is active\n\n      if (!mainMediaInfo || mainMediaInfo.hasVideo) {\n        // if we do not know if the main segment loader contains video yet or if we\n        // definitively know the main segment loader contains video, then we need to wait\n        // for both main and audio segment loaders to call endOfStream\n        isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n      } else {\n        // otherwise just rely on the audio loader\n        isEndOfStream = this.audioSegmentLoader_.ended_;\n      }\n    }\n\n    if (!isEndOfStream) {\n      return;\n    }\n\n    this.stopABRTimer_();\n    this.sourceUpdater_.endOfStream();\n  }\n  /**\n   * Check if a playlist has stopped being updated\n   *\n   * @param {Object} playlist the media playlist object\n   * @return {boolean} whether the playlist has stopped being updated or not\n   */\n\n\n  stuckAtPlaylistEnd_(playlist) {\n    const seekable = this.seekable();\n\n    if (!seekable.length) {\n      // playlist doesn't have enough information to determine whether we are stuck\n      return false;\n    }\n\n    const expired = this.syncController_.getExpiredTime(playlist, this.duration());\n\n    if (expired === null) {\n      return false;\n    } // does not use the safe live end to calculate playlist end, since we\n    // don't want to say we are stuck while there is still content\n\n\n    const absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);\n    const currentTime = this.tech_.currentTime();\n    const buffered = this.tech_.buffered();\n\n    if (!buffered.length) {\n      // return true if the playhead reached the absolute end of the playlist\n      return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n    }\n\n    const bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n    // end of playlist\n\n    return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n  }\n  /**\n   * Exclude a playlist for a set amount of time, making it unavailable for selection by\n   * the rendition selection algorithm, then force a new playlist (rendition) selection.\n   *\n   * @param {Object=} playlistToExclude\n   *                  the playlist to exclude, defaults to the currently selected playlist\n   * @param {Object=} error\n   *                  an optional error\n   * @param {number=} playlistExclusionDuration\n   *                  an optional number of seconds to exclude the playlist\n   */\n\n\n  excludePlaylist({\n    playlistToExclude = this.mainPlaylistLoader_.media(),\n    error = {},\n    playlistExclusionDuration\n  }) {\n    // If the `error` was generated by the playlist loader, it will contain\n    // the playlist we were trying to load (but failed) and that should be\n    // excluded instead of the currently selected playlist which is likely\n    // out-of-date in this scenario\n    playlistToExclude = playlistToExclude || this.mainPlaylistLoader_.media();\n    playlistExclusionDuration = playlistExclusionDuration || error.playlistExclusionDuration || this.playlistExclusionDuration; // If there is no current playlist, then an error occurred while we were\n    // trying to load the main OR while we were disposing of the tech\n\n    if (!playlistToExclude) {\n      this.error = error;\n\n      if (this.mediaSource.readyState !== 'open') {\n        this.trigger('error');\n      } else {\n        this.sourceUpdater_.endOfStream('network');\n      }\n\n      return;\n    }\n\n    playlistToExclude.playlistErrors_++;\n    const playlists = this.mainPlaylistLoader_.main.playlists;\n    const enabledPlaylists = playlists.filter(isEnabled);\n    const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude; // Don't exclude the only playlist unless it was excluded\n    // forever\n\n    if (playlists.length === 1 && playlistExclusionDuration !== Infinity) {\n      videojs.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. ` + 'Trying again since it is the only playlist.');\n      this.tech_.trigger('retryplaylist'); // if this is a final rendition, we should delay\n\n      return this.mainPlaylistLoader_.load(isFinalRendition);\n    }\n\n    if (isFinalRendition) {\n      // If we're content steering, try other pathways.\n      if (this.main().contentSteering) {\n        const pathway = this.pathwayAttribute_(playlistToExclude); // Ignore at least 1 steering manifest refresh.\n\n        const reIncludeDelay = this.contentSteeringController_.steeringManifest.ttl * 1000;\n        this.contentSteeringController_.excludePathway(pathway);\n        this.excludeThenChangePathway_();\n        setTimeout(() => {\n          this.contentSteeringController_.addAvailablePathway(pathway);\n        }, reIncludeDelay);\n        return;\n      } // Since we're on the final non-excluded playlist, and we're about to exclude\n      // it, instead of erring the player or retrying this playlist, clear out the current\n      // exclusion list. This allows other playlists to be attempted in case any have been\n      // fixed.\n\n\n      let reincluded = false;\n      playlists.forEach(playlist => {\n        // skip current playlist which is about to be excluded\n        if (playlist === playlistToExclude) {\n          return;\n        }\n\n        const excludeUntil = playlist.excludeUntil; // a playlist cannot be reincluded if it wasn't excluded to begin with.\n\n        if (typeof excludeUntil !== 'undefined' && excludeUntil !== Infinity) {\n          reincluded = true;\n          delete playlist.excludeUntil;\n        }\n      });\n\n      if (reincluded) {\n        videojs.log.warn('Removing other playlists from the exclusion list because the last ' + 'rendition is about to be excluded.'); // Technically we are retrying a playlist, in that we are simply retrying a previous\n        // playlist. This is needed for users relying on the retryplaylist event to catch a\n        // case where the player might be stuck and looping through \"dead\" playlists.\n\n        this.tech_.trigger('retryplaylist');\n      }\n    } // Exclude this playlist\n\n\n    let excludeUntil;\n\n    if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) {\n      excludeUntil = Infinity;\n    } else {\n      excludeUntil = Date.now() + playlistExclusionDuration * 1000;\n    }\n\n    playlistToExclude.excludeUntil = excludeUntil;\n\n    if (error.reason) {\n      playlistToExclude.lastExcludeReason_ = error.reason;\n    }\n\n    this.tech_.trigger('excludeplaylist');\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'vhs-rendition-excluded'\n    }); // TODO: only load a new playlist if we're excluding the current playlist\n    // If this function was called with a playlist that's not the current active playlist\n    // (e.g., media().id !== playlistToExclude.id),\n    // then a new playlist should not be selected and loaded, as there's nothing wrong with the current playlist.\n\n    const nextPlaylist = this.selectPlaylist();\n\n    if (!nextPlaylist) {\n      this.error = 'Playback cannot continue. No available working or supported playlists.';\n      this.trigger('error');\n      return;\n    }\n\n    const logFn = error.internal ? this.logger_ : videojs.log.warn;\n    const errorMessage = error.message ? ' ' + error.message : '';\n    logFn(`${error.internal ? 'Internal problem' : 'Problem'} encountered with playlist ${playlistToExclude.id}.` + `${errorMessage} Switching to playlist ${nextPlaylist.id}.`); // if audio group changed reset audio loaders\n\n    if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) {\n      this.delegateLoaders_('audio', ['abort', 'pause']);\n    } // if subtitle group changed reset subtitle loaders\n\n\n    if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) {\n      this.delegateLoaders_('subtitle', ['abort', 'pause']);\n    }\n\n    this.delegateLoaders_('main', ['abort', 'pause']);\n    const delayDuration = nextPlaylist.targetDuration / 2 * 1000 || 5 * 1000;\n    const shouldDelay = typeof nextPlaylist.lastRequest === 'number' && Date.now() - nextPlaylist.lastRequest <= delayDuration; // delay if it's a final rendition or if the last refresh is sooner than half targetDuration\n\n    return this.switchMedia_(nextPlaylist, 'exclude', isFinalRendition || shouldDelay);\n  }\n  /**\n   * Pause all segment/playlist loaders\n   */\n\n\n  pauseLoading() {\n    this.delegateLoaders_('all', ['abort', 'pause']);\n    this.stopABRTimer_();\n  }\n  /**\n   * Call a set of functions in order on playlist loaders, segment loaders,\n   * or both types of loaders.\n   *\n   * @param {string} filter\n   *        Filter loaders that should call fnNames using a string. Can be:\n   *        * all - run on all loaders\n   *        * audio - run on all audio loaders\n   *        * subtitle - run on all subtitle loaders\n   *        * main - run on the main loaders\n   *\n   * @param {Array|string} fnNames\n   *        A string or array of function names to call.\n   */\n\n\n  delegateLoaders_(filter, fnNames) {\n    const loaders = [];\n    const dontFilterPlaylist = filter === 'all';\n\n    if (dontFilterPlaylist || filter === 'main') {\n      loaders.push(this.mainPlaylistLoader_);\n    }\n\n    const mediaTypes = [];\n\n    if (dontFilterPlaylist || filter === 'audio') {\n      mediaTypes.push('AUDIO');\n    }\n\n    if (dontFilterPlaylist || filter === 'subtitle') {\n      mediaTypes.push('CLOSED-CAPTIONS');\n      mediaTypes.push('SUBTITLES');\n    }\n\n    mediaTypes.forEach(mediaType => {\n      const loader = this.mediaTypes_[mediaType] && this.mediaTypes_[mediaType].activePlaylistLoader;\n\n      if (loader) {\n        loaders.push(loader);\n      }\n    });\n    ['main', 'audio', 'subtitle'].forEach(name => {\n      const loader = this[`${name}SegmentLoader_`];\n\n      if (loader && (filter === name || filter === 'all')) {\n        loaders.push(loader);\n      }\n    });\n    loaders.forEach(loader => fnNames.forEach(fnName => {\n      if (typeof loader[fnName] === 'function') {\n        loader[fnName]();\n      }\n    }));\n  }\n  /**\n   * set the current time on all segment loaders\n   *\n   * @param {TimeRange} currentTime the current time to set\n   * @return {TimeRange} the current time\n   */\n\n\n  setCurrentTime(currentTime) {\n    const buffered = findRange(this.tech_.buffered(), currentTime);\n\n    if (!(this.mainPlaylistLoader_ && this.mainPlaylistLoader_.media())) {\n      // return immediately if the metadata is not ready yet\n      return 0;\n    } // it's clearly an edge-case but don't thrown an error if asked to\n    // seek within an empty playlist\n\n\n    if (!this.mainPlaylistLoader_.media().segments) {\n      return 0;\n    } // if the seek location is already buffered, continue buffering as usual\n\n\n    if (buffered && buffered.length) {\n      return currentTime;\n    } // cancel outstanding requests so we begin buffering at the new\n    // location\n\n\n    this.mainSegmentLoader_.pause();\n    this.mainSegmentLoader_.resetEverything();\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      this.audioSegmentLoader_.pause();\n      this.audioSegmentLoader_.resetEverything();\n    }\n\n    if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n      this.subtitleSegmentLoader_.pause();\n      this.subtitleSegmentLoader_.resetEverything();\n    } // start segment loader loading in case they are paused\n\n\n    this.load();\n  }\n  /**\n   * get the current duration\n   *\n   * @return {TimeRange} the duration\n   */\n\n\n  duration() {\n    if (!this.mainPlaylistLoader_) {\n      return 0;\n    }\n\n    const media = this.mainPlaylistLoader_.media();\n\n    if (!media) {\n      // no playlists loaded yet, so can't determine a duration\n      return 0;\n    } // Don't rely on the media source for duration in the case of a live playlist since\n    // setting the native MediaSource's duration to infinity ends up with consequences to\n    // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n    //\n    // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n    // however, few browsers have support for setLiveSeekableRange()\n    // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n    //\n    // Until a time when the duration of the media source can be set to infinity, and a\n    // seekable range specified across browsers, just return Infinity.\n\n\n    if (!media.endList) {\n      return Infinity;\n    } // Since this is a VOD video, it is safe to rely on the media source's duration (if\n    // available). If it's not available, fall back to a playlist-calculated estimate.\n\n\n    if (this.mediaSource) {\n      return this.mediaSource.duration;\n    }\n\n    return Vhs$1.Playlist.duration(media);\n  }\n  /**\n   * check the seekable range\n   *\n   * @return {TimeRange} the seekable range\n   */\n\n\n  seekable() {\n    return this.seekable_;\n  }\n\n  onSyncInfoUpdate_() {\n    let audioSeekable; // TODO check for creation of both source buffers before updating seekable\n    //\n    // A fix was made to this function where a check for\n    // this.sourceUpdater_.hasCreatedSourceBuffers\n    // was added to ensure that both source buffers were created before seekable was\n    // updated. However, it originally had a bug where it was checking for a true and\n    // returning early instead of checking for false. Setting it to check for false to\n    // return early though created other issues. A call to play() would check for seekable\n    // end without verifying that a seekable range was present. In addition, even checking\n    // for that didn't solve some issues, as handleFirstPlay is sometimes worked around\n    // due to a media update calling load on the segment loaders, skipping a seek to live,\n    // thereby starting live streams at the beginning of the stream rather than at the end.\n    //\n    // This conditional should be fixed to wait for the creation of two source buffers at\n    // the same time as the other sections of code are fixed to properly seek to live and\n    // not throw an error due to checking for a seekable end when no seekable range exists.\n    //\n    // For now, fall back to the older behavior, with the understanding that the seekable\n    // range may not be completely correct, leading to a suboptimal initial live point.\n\n    if (!this.mainPlaylistLoader_) {\n      return;\n    }\n\n    let media = this.mainPlaylistLoader_.media();\n\n    if (!media) {\n      return;\n    }\n\n    let expired = this.syncController_.getExpiredTime(media, this.duration());\n\n    if (expired === null) {\n      // not enough information to update seekable\n      return;\n    }\n\n    const main = this.mainPlaylistLoader_.main;\n    const mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(main, media));\n\n    if (mainSeekable.length === 0) {\n      return;\n    }\n\n    if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n      media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n      expired = this.syncController_.getExpiredTime(media, this.duration());\n\n      if (expired === null) {\n        return;\n      }\n\n      audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(main, media));\n\n      if (audioSeekable.length === 0) {\n        return;\n      }\n    }\n\n    let oldEnd;\n    let oldStart;\n\n    if (this.seekable_ && this.seekable_.length) {\n      oldEnd = this.seekable_.end(0);\n      oldStart = this.seekable_.start(0);\n    }\n\n    if (!audioSeekable) {\n      // seekable has been calculated based on buffering video data so it\n      // can be returned directly\n      this.seekable_ = mainSeekable;\n    } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n      // seekables are pretty far off, rely on main\n      this.seekable_ = mainSeekable;\n    } else {\n      this.seekable_ = createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n    } // seekable is the same as last time\n\n\n    if (this.seekable_ && this.seekable_.length) {\n      if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {\n        return;\n      }\n    }\n\n    this.logger_(`seekable updated [${printableRange(this.seekable_)}]`);\n    this.tech_.trigger('seekablechanged');\n  }\n  /**\n   * Update the player duration\n   */\n\n\n  updateDuration(isLive) {\n    if (this.updateDuration_) {\n      this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n      this.updateDuration_ = null;\n    }\n\n    if (this.mediaSource.readyState !== 'open') {\n      this.updateDuration_ = this.updateDuration.bind(this, isLive);\n      this.mediaSource.addEventListener('sourceopen', this.updateDuration_);\n      return;\n    }\n\n    if (isLive) {\n      const seekable = this.seekable();\n\n      if (!seekable.length) {\n        return;\n      } // Even in the case of a live playlist, the native MediaSource's duration should not\n      // be set to Infinity (even though this would be expected for a live playlist), since\n      // setting the native MediaSource's duration to infinity ends up with consequences to\n      // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n      //\n      // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n      // however, few browsers have support for setLiveSeekableRange()\n      // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n      //\n      // Until a time when the duration of the media source can be set to infinity, and a\n      // seekable range specified across browsers, the duration should be greater than or\n      // equal to the last possible seekable value.\n      // MediaSource duration starts as NaN\n      // It is possible (and probable) that this case will never be reached for many\n      // sources, since the MediaSource reports duration as the highest value without\n      // accounting for timestamp offset. For example, if the timestamp offset is -100 and\n      // we buffered times 0 to 100 with real times of 100 to 200, even though current\n      // time will be between 0 and 100, the native media source may report the duration\n      // as 200. However, since we report duration separate from the media source (as\n      // Infinity), and as long as the native media source duration value is greater than\n      // our reported seekable range, seeks will work as expected. The large number as\n      // duration for live is actually a strategy used by some players to work around the\n      // issue of live seekable ranges cited above.\n\n\n      if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable.end(seekable.length - 1)) {\n        this.sourceUpdater_.setDuration(seekable.end(seekable.length - 1));\n      }\n\n      return;\n    }\n\n    const buffered = this.tech_.buffered();\n    let duration = Vhs$1.Playlist.duration(this.mainPlaylistLoader_.media());\n\n    if (buffered.length > 0) {\n      duration = Math.max(duration, buffered.end(buffered.length - 1));\n    }\n\n    if (this.mediaSource.duration !== duration) {\n      this.sourceUpdater_.setDuration(duration);\n    }\n  }\n  /**\n   * dispose of the PlaylistController and everything\n   * that it controls\n   */\n\n\n  dispose() {\n    this.trigger('dispose');\n    this.decrypter_.terminate();\n    this.mainPlaylistLoader_.dispose();\n    this.mainSegmentLoader_.dispose();\n    this.contentSteeringController_.dispose();\n    this.keyStatusMap_.clear();\n\n    if (this.loadOnPlay_) {\n      this.tech_.off('play', this.loadOnPlay_);\n    }\n\n    ['AUDIO', 'SUBTITLES'].forEach(type => {\n      const groups = this.mediaTypes_[type].groups;\n\n      for (const id in groups) {\n        groups[id].forEach(group => {\n          if (group.playlistLoader) {\n            group.playlistLoader.dispose();\n          }\n        });\n      }\n    });\n    this.audioSegmentLoader_.dispose();\n    this.subtitleSegmentLoader_.dispose();\n    this.sourceUpdater_.dispose();\n    this.timelineChangeController_.dispose();\n    this.stopABRTimer_();\n\n    if (this.updateDuration_) {\n      this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n    }\n\n    this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n    this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_);\n    this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_);\n    this.off();\n  }\n  /**\n   * return the main playlist object if we have one\n   *\n   * @return {Object} the main playlist object that we parsed\n   */\n\n\n  main() {\n    return this.mainPlaylistLoader_.main;\n  }\n  /**\n   * return the currently selected playlist\n   *\n   * @return {Object} the currently selected playlist object that we parsed\n   */\n\n\n  media() {\n    // playlist loader will not return media if it has not been fully loaded\n    return this.mainPlaylistLoader_.media() || this.initialMedia_;\n  }\n\n  areMediaTypesKnown_() {\n    const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n    const hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_(); // if we are not using an audio loader, then we have audio media info\n    // otherwise check on the segment loader.\n\n    const hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_(); // one or both loaders has not loaded sufficently to get codecs\n\n    if (!hasMainMediaInfo || !hasAudioMediaInfo) {\n      return false;\n    }\n\n    return true;\n  }\n\n  getCodecsOrExclude_() {\n    const media = {\n      main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},\n      audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}\n    };\n    const playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media(); // set \"main\" media equal to video\n\n    media.video = media.main;\n    const playlistCodecs = codecsForPlaylist(this.main(), playlist);\n    const codecs = {};\n    const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n\n    if (media.main.hasVideo) {\n      codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;\n    }\n\n    if (media.main.isMuxed) {\n      codecs.video += `,${playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC}`;\n    }\n\n    if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {\n      codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC; // set audio isFmp4 so we use the correct \"supports\" function below\n\n      media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;\n    } // no codecs, no playback.\n\n\n    if (!codecs.audio && !codecs.video) {\n      this.excludePlaylist({\n        playlistToExclude: playlist,\n        error: {\n          message: 'Could not determine codecs for playlist.'\n        },\n        playlistExclusionDuration: Infinity\n      });\n      return;\n    } // fmp4 relies on browser support, while ts relies on muxer support\n\n\n    const supportFunction = (isFmp4, codec) => isFmp4 ? browserSupportsCodec(codec) : muxerSupportsCodec(codec);\n\n    const unsupportedCodecs = {};\n    let unsupportedAudio;\n    ['video', 'audio'].forEach(function (type) {\n      if (codecs.hasOwnProperty(type) && !supportFunction(media[type].isFmp4, codecs[type])) {\n        const supporter = media[type].isFmp4 ? 'browser' : 'muxer';\n        unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];\n        unsupportedCodecs[supporter].push(codecs[type]);\n\n        if (type === 'audio') {\n          unsupportedAudio = supporter;\n        }\n      }\n    });\n\n    if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {\n      const audioGroup = playlist.attributes.AUDIO;\n      this.main().playlists.forEach(variant => {\n        const variantAudioGroup = variant.attributes && variant.attributes.AUDIO;\n\n        if (variantAudioGroup === audioGroup && variant !== playlist) {\n          variant.excludeUntil = Infinity;\n        }\n      });\n      this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): \"${codecs.audio}\"`);\n    } // if we have any unsupported codecs exclude this playlist.\n\n\n    if (Object.keys(unsupportedCodecs).length) {\n      const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => {\n        if (acc) {\n          acc += ', ';\n        }\n\n        acc += `${supporter} does not support codec(s): \"${unsupportedCodecs[supporter].join(',')}\"`;\n        return acc;\n      }, '') + '.';\n      this.excludePlaylist({\n        playlistToExclude: playlist,\n        error: {\n          internal: true,\n          message\n        },\n        playlistExclusionDuration: Infinity\n      });\n      return;\n    } // check if codec switching is happening\n\n\n    if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {\n      const switchMessages = [];\n      ['video', 'audio'].forEach(type => {\n        const newCodec = (parseCodecs(this.sourceUpdater_.codecs[type] || '')[0] || {}).type;\n        const oldCodec = (parseCodecs(codecs[type] || '')[0] || {}).type;\n\n        if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {\n          switchMessages.push(`\"${this.sourceUpdater_.codecs[type]}\" -> \"${codecs[type]}\"`);\n        }\n      });\n\n      if (switchMessages.length) {\n        this.excludePlaylist({\n          playlistToExclude: playlist,\n          error: {\n            message: `Codec switching not supported: ${switchMessages.join(', ')}.`,\n            internal: true\n          },\n          playlistExclusionDuration: Infinity\n        });\n        return;\n      }\n    } // TODO: when using the muxer shouldn't we just return\n    // the codecs that the muxer outputs?\n\n\n    return codecs;\n  }\n  /**\n   * Create source buffers and exlude any incompatible renditions.\n   *\n   * @private\n   */\n\n\n  tryToCreateSourceBuffers_() {\n    // media source is not ready yet or sourceBuffers are already\n    // created.\n    if (this.mediaSource.readyState !== 'open' || this.sourceUpdater_.hasCreatedSourceBuffers()) {\n      return;\n    }\n\n    if (!this.areMediaTypesKnown_()) {\n      return;\n    }\n\n    const codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n    if (!codecs) {\n      return;\n    }\n\n    this.sourceUpdater_.createSourceBuffers(codecs);\n    const codecString = [codecs.video, codecs.audio].filter(Boolean).join(',');\n    this.excludeIncompatibleVariants_(codecString);\n  }\n  /**\n   * Excludes playlists with codecs that are unsupported by the muxer and browser.\n   */\n\n\n  excludeUnsupportedVariants_() {\n    const playlists = this.main().playlists;\n    const ids = []; // TODO: why don't we have a property to loop through all\n    // playlist? Why did we ever mix indexes and keys?\n\n    Object.keys(playlists).forEach(key => {\n      const variant = playlists[key]; // check if we already processed this playlist.\n\n      if (ids.indexOf(variant.id) !== -1) {\n        return;\n      }\n\n      ids.push(variant.id);\n      const codecs = codecsForPlaylist(this.main, variant);\n      const unsupported = [];\n\n      if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !browserSupportsCodec(codecs.audio)) {\n        unsupported.push(`audio codec ${codecs.audio}`);\n      }\n\n      if (codecs.video && !muxerSupportsCodec(codecs.video) && !browserSupportsCodec(codecs.video)) {\n        unsupported.push(`video codec ${codecs.video}`);\n      }\n\n      if (codecs.text && codecs.text === 'stpp.ttml.im1t') {\n        unsupported.push(`text codec ${codecs.text}`);\n      }\n\n      if (unsupported.length) {\n        variant.excludeUntil = Infinity;\n        this.logger_(`excluding ${variant.id} for unsupported: ${unsupported.join(', ')}`);\n      }\n    });\n  }\n  /**\n   * Exclude playlists that are known to be codec or\n   * stream-incompatible with the SourceBuffer configuration. For\n   * instance, Media Source Extensions would cause the video element to\n   * stall waiting for video data if you switched from a variant with\n   * video and audio to an audio-only one.\n   *\n   * @param {Object} media a media playlist compatible with the current\n   * set of SourceBuffers. Variants in the current main playlist that\n   * do not appear to have compatible codec or stream configurations\n   * will be excluded from the default playlist selection algorithm\n   * indefinitely.\n   * @private\n   */\n\n\n  excludeIncompatibleVariants_(codecString) {\n    const ids = [];\n    const playlists = this.main().playlists;\n    const codecs = unwrapCodecList(parseCodecs(codecString));\n    const codecCount_ = codecCount(codecs);\n    const videoDetails = codecs.video && parseCodecs(codecs.video)[0] || null;\n    const audioDetails = codecs.audio && parseCodecs(codecs.audio)[0] || null;\n    Object.keys(playlists).forEach(key => {\n      const variant = playlists[key]; // check if we already processed this playlist.\n      // or it if it is already excluded forever.\n\n      if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {\n        return;\n      }\n\n      ids.push(variant.id);\n      const exclusionReasons = []; // get codecs from the playlist for this variant\n\n      const variantCodecs = codecsForPlaylist(this.mainPlaylistLoader_.main, variant);\n      const variantCodecCount = codecCount(variantCodecs); // if no codecs are listed, we cannot determine that this\n      // variant is incompatible. Wait for mux.js to probe\n\n      if (!variantCodecs.audio && !variantCodecs.video) {\n        return;\n      } // TODO: we can support this by removing the\n      // old media source and creating a new one, but it will take some work.\n      // The number of streams cannot change\n\n\n      if (variantCodecCount !== codecCount_) {\n        exclusionReasons.push(`codec count \"${variantCodecCount}\" !== \"${codecCount_}\"`);\n      } // only exclude playlists by codec change, if codecs cannot switch\n      // during playback.\n\n\n      if (!this.sourceUpdater_.canChangeType()) {\n        const variantVideoDetails = variantCodecs.video && parseCodecs(variantCodecs.video)[0] || null;\n        const variantAudioDetails = variantCodecs.audio && parseCodecs(variantCodecs.audio)[0] || null; // the video codec cannot change\n\n        if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {\n          exclusionReasons.push(`video codec \"${variantVideoDetails.type}\" !== \"${videoDetails.type}\"`);\n        } // the audio codec cannot change\n\n\n        if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {\n          exclusionReasons.push(`audio codec \"${variantAudioDetails.type}\" !== \"${audioDetails.type}\"`);\n        }\n      }\n\n      if (exclusionReasons.length) {\n        variant.excludeUntil = Infinity;\n        this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(' && ')}`);\n      }\n    });\n  }\n\n  updateAdCues_(media) {\n    let offset = 0;\n    const seekable = this.seekable();\n\n    if (seekable.length) {\n      offset = seekable.start(0);\n    }\n\n    updateAdCues(media, this.cueTagsTrack_, offset);\n  }\n  /**\n   * Calculates the desired forward buffer length based on current time\n   *\n   * @return {number} Desired forward buffer length in seconds\n   */\n\n\n  goalBufferLength() {\n    const currentTime = this.tech_.currentTime();\n    const initial = Config.GOAL_BUFFER_LENGTH;\n    const rate = Config.GOAL_BUFFER_LENGTH_RATE;\n    const max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n    return Math.min(initial + currentTime * rate, max);\n  }\n  /**\n   * Calculates the desired buffer low water line based on current time\n   *\n   * @return {number} Desired buffer low water line in seconds\n   */\n\n\n  bufferLowWaterLine() {\n    const currentTime = this.tech_.currentTime();\n    const initial = Config.BUFFER_LOW_WATER_LINE;\n    const rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n    const max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n    const newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);\n    return Math.min(initial + currentTime * rate, this.bufferBasedABR ? newMax : max);\n  }\n\n  bufferHighWaterLine() {\n    return Config.BUFFER_HIGH_WATER_LINE;\n  }\n\n  addDateRangesToTextTrack_(dateRanges) {\n    createMetadataTrackIfNotExists(this.inbandTextTracks_, 'com.apple.streaming', this.tech_);\n    addDateRangeMetadata({\n      inbandTextTracks: this.inbandTextTracks_,\n      dateRanges\n    });\n  }\n\n  addMetadataToTextTrack(dispatchType, metadataArray, videoDuration) {\n    const timestampOffset = this.sourceUpdater_.videoBuffer ? this.sourceUpdater_.videoTimestampOffset() : this.sourceUpdater_.audioTimestampOffset(); // There's potentially an issue where we could double add metadata if there's a muxed\n    // audio/video source with a metadata track, and an alt audio with a metadata track.\n    // However, this probably won't happen, and if it does it can be handled then.\n\n    createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.tech_);\n    addMetadata({\n      inbandTextTracks: this.inbandTextTracks_,\n      metadataArray,\n      timestampOffset,\n      videoDuration\n    });\n  }\n  /**\n   * Utility for getting the pathway or service location from an HLS or DASH playlist.\n   *\n   * @param {Object} playlist for getting pathway from.\n   * @return the pathway attribute of a playlist\n   */\n\n\n  pathwayAttribute_(playlist) {\n    return playlist.attributes['PATHWAY-ID'] || playlist.attributes.serviceLocation;\n  }\n  /**\n   * Initialize available pathways and apply the tag properties.\n   */\n\n\n  initContentSteeringController_() {\n    const main = this.main();\n\n    if (!main.contentSteering) {\n      return;\n    }\n\n    for (const playlist of main.playlists) {\n      this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(playlist));\n    }\n\n    this.contentSteeringController_.assignTagProperties(main.uri, main.contentSteering); // request the steering manifest immediately if queryBeforeStart is set.\n\n    if (this.contentSteeringController_.queryBeforeStart) {\n      // When queryBeforeStart is true, initial request should omit steering parameters.\n      this.contentSteeringController_.requestSteeringManifest(true);\n      return;\n    } // otherwise start content steering after playback starts\n\n\n    this.tech_.one('canplay', () => {\n      this.contentSteeringController_.requestSteeringManifest();\n    });\n  }\n  /**\n   * Reset the content steering controller and re-init.\n   */\n\n\n  resetContentSteeringController_() {\n    this.contentSteeringController_.clearAvailablePathways();\n    this.contentSteeringController_.dispose();\n    this.initContentSteeringController_();\n  }\n  /**\n   * Attaches the listeners for content steering.\n   */\n\n\n  attachContentSteeringListeners_() {\n    this.contentSteeringController_.on('content-steering', this.excludeThenChangePathway_.bind(this));\n\n    if (this.sourceType_ === 'dash') {\n      this.mainPlaylistLoader_.on('loadedplaylist', () => {\n        const main = this.main(); // check if steering tag or pathways changed.\n\n        const didDashTagChange = this.contentSteeringController_.didDASHTagChange(main.uri, main.contentSteering);\n\n        const didPathwaysChange = () => {\n          const availablePathways = this.contentSteeringController_.getAvailablePathways();\n          const newPathways = [];\n\n          for (const playlist of main.playlists) {\n            const serviceLocation = playlist.attributes.serviceLocation;\n\n            if (serviceLocation) {\n              newPathways.push(serviceLocation);\n\n              if (!availablePathways.has(serviceLocation)) {\n                return true;\n              }\n            }\n          } // If we have no new serviceLocations and previously had availablePathways\n\n\n          if (!newPathways.length && availablePathways.size) {\n            return true;\n          }\n\n          return false;\n        };\n\n        if (didDashTagChange || didPathwaysChange()) {\n          this.resetContentSteeringController_();\n        }\n      });\n    }\n  }\n  /**\n   * Simple exclude and change playlist logic for content steering.\n   */\n\n\n  excludeThenChangePathway_() {\n    const currentPathway = this.contentSteeringController_.getPathway();\n\n    if (!currentPathway) {\n      return;\n    }\n\n    this.handlePathwayClones_();\n    const main = this.main();\n    const playlists = main.playlists;\n    const ids = new Set();\n    let didEnablePlaylists = false;\n    Object.keys(playlists).forEach(key => {\n      const variant = playlists[key];\n      const pathwayId = this.pathwayAttribute_(variant);\n      const differentPathwayId = pathwayId && currentPathway !== pathwayId;\n      const steeringExclusion = variant.excludeUntil === Infinity && variant.lastExcludeReason_ === 'content-steering';\n\n      if (steeringExclusion && !differentPathwayId) {\n        delete variant.excludeUntil;\n        delete variant.lastExcludeReason_;\n        didEnablePlaylists = true;\n      }\n\n      const noExcludeUntil = !variant.excludeUntil && variant.excludeUntil !== Infinity;\n      const shouldExclude = !ids.has(variant.id) && differentPathwayId && noExcludeUntil;\n\n      if (!shouldExclude) {\n        return;\n      }\n\n      ids.add(variant.id);\n      variant.excludeUntil = Infinity;\n      variant.lastExcludeReason_ = 'content-steering'; // TODO: kind of spammy, maybe move this.\n\n      this.logger_(`excluding ${variant.id} for ${variant.lastExcludeReason_}`);\n    });\n\n    if (this.contentSteeringController_.manifestType_ === 'DASH') {\n      Object.keys(this.mediaTypes_).forEach(key => {\n        const type = this.mediaTypes_[key];\n\n        if (type.activePlaylistLoader) {\n          const currentPlaylist = type.activePlaylistLoader.media_; // Check if the current media playlist matches the current CDN\n\n          if (currentPlaylist && currentPlaylist.attributes.serviceLocation !== currentPathway) {\n            didEnablePlaylists = true;\n          }\n        }\n      });\n    }\n\n    if (didEnablePlaylists) {\n      this.changeSegmentPathway_();\n    }\n  }\n  /**\n   * Add, update, or delete playlists and media groups for\n   * the pathway clones for HLS Content Steering.\n   *\n   * See https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/\n   *\n   * NOTE: Pathway cloning does not currently support the `PER_VARIANT_URIS` and\n   * `PER_RENDITION_URIS` as we do not handle `STABLE-VARIANT-ID` or\n   * `STABLE-RENDITION-ID` values.\n   */\n\n\n  handlePathwayClones_() {\n    const main = this.main();\n    const playlists = main.playlists;\n    const currentPathwayClones = this.contentSteeringController_.currentPathwayClones;\n    const nextPathwayClones = this.contentSteeringController_.nextPathwayClones;\n    const hasClones = currentPathwayClones && currentPathwayClones.size || nextPathwayClones && nextPathwayClones.size;\n\n    if (!hasClones) {\n      return;\n    }\n\n    for (const [id, clone] of currentPathwayClones.entries()) {\n      const newClone = nextPathwayClones.get(id); // Delete the old pathway clone.\n\n      if (!newClone) {\n        this.mainPlaylistLoader_.updateOrDeleteClone(clone);\n        this.contentSteeringController_.excludePathway(id);\n      }\n    }\n\n    for (const [id, clone] of nextPathwayClones.entries()) {\n      const oldClone = currentPathwayClones.get(id); // Create a new pathway if it is a new pathway clone object.\n\n      if (!oldClone) {\n        const playlistsToClone = playlists.filter(p => {\n          return p.attributes['PATHWAY-ID'] === clone['BASE-ID'];\n        });\n        playlistsToClone.forEach(p => {\n          this.mainPlaylistLoader_.addClonePathway(clone, p);\n        });\n        this.contentSteeringController_.addAvailablePathway(id);\n        continue;\n      } // There have not been changes to the pathway clone object, so skip.\n\n\n      if (this.equalPathwayClones_(oldClone, clone)) {\n        continue;\n      } // Update a preexisting cloned pathway.\n      // True is set for the update flag.\n\n\n      this.mainPlaylistLoader_.updateOrDeleteClone(clone, true);\n      this.contentSteeringController_.addAvailablePathway(id);\n    } // Deep copy contents of next to current pathways.\n\n\n    this.contentSteeringController_.currentPathwayClones = new Map(JSON.parse(JSON.stringify([...nextPathwayClones])));\n  }\n  /**\n   * Determines whether two pathway clone objects are equivalent.\n   *\n   * @param {Object} a The first pathway clone object.\n   * @param {Object} b The second pathway clone object.\n   * @return {boolean} True if the pathway clone objects are equal, false otherwise.\n   */\n\n\n  equalPathwayClones_(a, b) {\n    if (a['BASE-ID'] !== b['BASE-ID'] || a.ID !== b.ID || a['URI-REPLACEMENT'].HOST !== b['URI-REPLACEMENT'].HOST) {\n      return false;\n    }\n\n    const aParams = a['URI-REPLACEMENT'].PARAMS;\n    const bParams = b['URI-REPLACEMENT'].PARAMS; // We need to iterate through both lists of params because one could be\n    // missing a parameter that the other has.\n\n    for (const p in aParams) {\n      if (aParams[p] !== bParams[p]) {\n        return false;\n      }\n    }\n\n    for (const p in bParams) {\n      if (aParams[p] !== bParams[p]) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n  /**\n   * Changes the current playlists for audio, video and subtitles after a new pathway\n   * is chosen from content steering.\n   */\n\n\n  changeSegmentPathway_() {\n    const nextPlaylist = this.selectPlaylist();\n    this.pauseLoading(); // Switch audio and text track playlists if necessary in DASH\n\n    if (this.contentSteeringController_.manifestType_ === 'DASH') {\n      this.switchMediaForDASHContentSteering_();\n    }\n\n    this.switchMedia_(nextPlaylist, 'content-steering');\n  }\n  /**\n   * Iterates through playlists and check their keyId set and compare with the\n   * keyStatusMap, only enable playlists that have a usable key. If the playlist\n   * has no keyId leave it enabled by default.\n   */\n\n\n  excludeNonUsablePlaylistsByKeyId_() {\n    if (!this.mainPlaylistLoader_ || !this.mainPlaylistLoader_.main) {\n      return;\n    }\n\n    let nonUsableKeyStatusCount = 0;\n    const NON_USABLE = 'non-usable';\n    this.mainPlaylistLoader_.main.playlists.forEach(playlist => {\n      const keyIdSet = this.mainPlaylistLoader_.getKeyIdSet(playlist); // If the playlist doesn't have keyIDs lets not exclude it.\n\n      if (!keyIdSet || !keyIdSet.size) {\n        return;\n      }\n\n      keyIdSet.forEach(key => {\n        const USABLE = 'usable';\n        const hasUsableKeyStatus = this.keyStatusMap_.has(key) && this.keyStatusMap_.get(key) === USABLE;\n        const nonUsableExclusion = playlist.lastExcludeReason_ === NON_USABLE && playlist.excludeUntil === Infinity;\n\n        if (!hasUsableKeyStatus) {\n          // Only exclude playlists that haven't already been excluded as non-usable.\n          if (playlist.excludeUntil !== Infinity && playlist.lastExcludeReason_ !== NON_USABLE) {\n            playlist.excludeUntil = Infinity;\n            playlist.lastExcludeReason_ = NON_USABLE;\n            this.logger_(`excluding playlist ${playlist.id} because the key ID ${key} doesn't exist in the keyStatusMap or is not ${USABLE}`);\n          } // count all nonUsableKeyStatus\n\n\n          nonUsableKeyStatusCount++;\n        } else if (hasUsableKeyStatus && nonUsableExclusion) {\n          delete playlist.excludeUntil;\n          delete playlist.lastExcludeReason_;\n          this.logger_(`enabling playlist ${playlist.id} because key ID ${key} is ${USABLE}`);\n        }\n      });\n    }); // If for whatever reason every playlist has a non usable key status. Lets try re-including the SD renditions as a failsafe.\n\n    if (nonUsableKeyStatusCount >= this.mainPlaylistLoader_.main.playlists.length) {\n      this.mainPlaylistLoader_.main.playlists.forEach(playlist => {\n        const isNonHD = playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height < 720;\n        const excludedForNonUsableKey = playlist.excludeUntil === Infinity && playlist.lastExcludeReason_ === NON_USABLE;\n\n        if (isNonHD && excludedForNonUsableKey) {\n          // Only delete the excludeUntil so we don't try and re-exclude these playlists.\n          delete playlist.excludeUntil;\n          videojs.log.warn(`enabling non-HD playlist ${playlist.id} because all playlists were excluded due to ${NON_USABLE} key IDs`);\n        }\n      });\n    }\n  }\n  /**\n   * Adds a keystatus to the keystatus map, tries to convert to string if necessary.\n   *\n   * @param {any} keyId the keyId to add a status for\n   * @param {string} status the status of the keyId\n   */\n\n\n  addKeyStatus_(keyId, status) {\n    const isString = typeof keyId === 'string';\n    const keyIdHexString = isString ? keyId : bufferToHexString(keyId);\n    const formattedKeyIdString = keyIdHexString.slice(0, 32).toLowerCase();\n    this.logger_(`KeyStatus '${status}' with key ID ${formattedKeyIdString} added to the keyStatusMap`);\n    this.keyStatusMap_.set(formattedKeyIdString, status);\n  }\n  /**\n   * Utility function for adding key status to the keyStatusMap and filtering usable encrypted playlists.\n   *\n   * @param {any} keyId the keyId from the keystatuschange event\n   * @param {string} status the key status string\n   */\n\n\n  updatePlaylistByKeyStatus(keyId, status) {\n    this.addKeyStatus_(keyId, status);\n\n    if (!this.waitingForFastQualityPlaylistReceived_) {\n      this.excludeNonUsableThenChangePlaylist_();\n    } // Listen to loadedplaylist with a single listener and check for new contentProtection elements when a playlist is updated.\n\n\n    this.mainPlaylistLoader_.off('loadedplaylist', this.excludeNonUsableThenChangePlaylist_.bind(this));\n    this.mainPlaylistLoader_.on('loadedplaylist', this.excludeNonUsableThenChangePlaylist_.bind(this));\n  }\n\n  excludeNonUsableThenChangePlaylist_() {\n    this.excludeNonUsablePlaylistsByKeyId_();\n    this.fastQualityChange_();\n  }\n\n}\n\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The main playlist loader\n * @param {string} playlistID - id of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\nconst enableFunction = (loader, playlistID, changePlaylistFn) => enable => {\n  const playlist = loader.main.playlists[playlistID];\n  const incompatible = isIncompatible(playlist);\n  const currentlyEnabled = isEnabled(playlist);\n\n  if (typeof enable === 'undefined') {\n    return currentlyEnabled;\n  }\n\n  if (enable) {\n    delete playlist.disabled;\n  } else {\n    playlist.disabled = true;\n  }\n\n  if (enable !== currentlyEnabled && !incompatible) {\n    // Ensure the outside world knows about our changes\n    changePlaylistFn();\n\n    if (enable) {\n      loader.trigger('renditionenabled');\n    } else {\n      loader.trigger('renditiondisabled');\n    }\n  }\n\n  return enable;\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\n\nclass Representation {\n  constructor(vhsHandler, playlist, id) {\n    const {\n      playlistController_: pc\n    } = vhsHandler;\n    const qualityChangeFunction = pc.fastQualityChange_.bind(pc); // some playlist attributes are optional\n\n    if (playlist.attributes) {\n      const resolution = playlist.attributes.RESOLUTION;\n      this.width = resolution && resolution.width;\n      this.height = resolution && resolution.height;\n      this.bandwidth = playlist.attributes.BANDWIDTH;\n      this.frameRate = playlist.attributes['FRAME-RATE'];\n    }\n\n    this.codecs = codecsForPlaylist(pc.main(), playlist);\n    this.playlist = playlist; // The id is simply the ordinality of the media playlist\n    // within the main playlist\n\n    this.id = id; // Partially-apply the enableFunction to create a playlist-\n    // specific variant\n\n    this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);\n  }\n\n}\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the VhsHandler class\n *\n * @param {VhsHandler} vhsHandler - An instance of VhsHandler to add the\n * representation API into\n */\n\n\nconst renditionSelectionMixin = function (vhsHandler) {\n  // Add a single API-specific function to the VhsHandler instance\n  vhsHandler.representations = () => {\n    const main = vhsHandler.playlistController_.main();\n    const playlists = isAudioOnly(main) ? vhsHandler.playlistController_.getAudioTrackPlaylists_() : main.playlists;\n\n    if (!playlists) {\n      return [];\n    }\n\n    return playlists.filter(media => !isIncompatible(media)).map((e, i) => new Representation(vhsHandler, e, e.id));\n  };\n};\n\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n\nconst timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * @class PlaybackWatcher\n */\n\nclass PlaybackWatcher {\n  /**\n   * Represents an PlaybackWatcher object.\n   *\n   * @class\n   * @param {Object} options an object that includes the tech and settings\n   */\n  constructor(options) {\n    this.playlistController_ = options.playlistController;\n    this.tech_ = options.tech;\n    this.seekable = options.seekable;\n    this.allowSeeksWithinUnsafeLiveWindow = options.allowSeeksWithinUnsafeLiveWindow;\n    this.liveRangeSafeTimeDelta = options.liveRangeSafeTimeDelta;\n    this.media = options.media;\n    this.consecutiveUpdates = 0;\n    this.lastRecordedTime = null;\n    this.checkCurrentTimeTimeout_ = null;\n    this.logger_ = logger('PlaybackWatcher');\n    this.logger_('initialize');\n\n    const playHandler = () => this.monitorCurrentTime_();\n\n    const canPlayHandler = () => this.monitorCurrentTime_();\n\n    const waitingHandler = () => this.techWaiting_();\n\n    const cancelTimerHandler = () => this.resetTimeUpdate_();\n\n    const pc = this.playlistController_;\n    const loaderTypes = ['main', 'subtitle', 'audio'];\n    const loaderChecks = {};\n    loaderTypes.forEach(type => {\n      loaderChecks[type] = {\n        reset: () => this.resetSegmentDownloads_(type),\n        updateend: () => this.checkSegmentDownloads_(type)\n      };\n      pc[`${type}SegmentLoader_`].on('appendsdone', loaderChecks[type].updateend); // If a rendition switch happens during a playback stall where the buffer\n      // isn't changing we want to reset. We cannot assume that the new rendition\n      // will also be stalled, until after new appends.\n\n      pc[`${type}SegmentLoader_`].on('playlistupdate', loaderChecks[type].reset); // Playback stalls should not be detected right after seeking.\n      // This prevents one segment playlists (single vtt or single segment content)\n      // from being detected as stalling. As the buffer will not change in those cases, since\n      // the buffer is the entire video duration.\n\n      this.tech_.on(['seeked', 'seeking'], loaderChecks[type].reset);\n    });\n    /**\n     * We check if a seek was into a gap through the following steps:\n     * 1. We get a seeking event and we do not get a seeked event. This means that\n     *    a seek was attempted but not completed.\n     * 2. We run `fixesBadSeeks_` on segment loader appends. This means that we already\n     *    removed everything from our buffer and appended a segment, and should be ready\n     *    to check for gaps.\n     */\n\n    const setSeekingHandlers = fn => {\n      ['main', 'audio'].forEach(type => {\n        pc[`${type}SegmentLoader_`][fn]('appended', this.seekingAppendCheck_);\n      });\n    };\n\n    this.seekingAppendCheck_ = () => {\n      if (this.fixesBadSeeks_()) {\n        this.consecutiveUpdates = 0;\n        this.lastRecordedTime = this.tech_.currentTime();\n        setSeekingHandlers('off');\n      }\n    };\n\n    this.clearSeekingAppendCheck_ = () => setSeekingHandlers('off');\n\n    this.watchForBadSeeking_ = () => {\n      this.clearSeekingAppendCheck_();\n      setSeekingHandlers('on');\n    };\n\n    this.tech_.on('seeked', this.clearSeekingAppendCheck_);\n    this.tech_.on('seeking', this.watchForBadSeeking_);\n    this.tech_.on('waiting', waitingHandler);\n    this.tech_.on(timerCancelEvents, cancelTimerHandler);\n    this.tech_.on('canplay', canPlayHandler);\n    /*\n      An edge case exists that results in gaps not being skipped when they exist at the beginning of a stream. This case\n      is surfaced in one of two ways:\n       1)  The `waiting` event is fired before the player has buffered content, making it impossible\n          to find or skip the gap. The `waiting` event is followed by a `play` event. On first play\n          we can check if playback is stalled due to a gap, and skip the gap if necessary.\n      2)  A source with a gap at the beginning of the stream is loaded programatically while the player\n          is in a playing state. To catch this case, it's important that our one-time play listener is setup\n          even if the player is in a playing state\n    */\n\n    this.tech_.one('play', playHandler); // Define the dispose function to clean up our events\n\n    this.dispose = () => {\n      this.clearSeekingAppendCheck_();\n      this.logger_('dispose');\n      this.tech_.off('waiting', waitingHandler);\n      this.tech_.off(timerCancelEvents, cancelTimerHandler);\n      this.tech_.off('canplay', canPlayHandler);\n      this.tech_.off('play', playHandler);\n      this.tech_.off('seeking', this.watchForBadSeeking_);\n      this.tech_.off('seeked', this.clearSeekingAppendCheck_);\n      loaderTypes.forEach(type => {\n        pc[`${type}SegmentLoader_`].off('appendsdone', loaderChecks[type].updateend);\n        pc[`${type}SegmentLoader_`].off('playlistupdate', loaderChecks[type].reset);\n        this.tech_.off(['seeked', 'seeking'], loaderChecks[type].reset);\n      });\n\n      if (this.checkCurrentTimeTimeout_) {\n        window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n      }\n\n      this.resetTimeUpdate_();\n    };\n  }\n  /**\n   * Periodically check current time to see if playback stopped\n   *\n   * @private\n   */\n\n\n  monitorCurrentTime_() {\n    this.checkCurrentTime_();\n\n    if (this.checkCurrentTimeTimeout_) {\n      window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n    } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n\n    this.checkCurrentTimeTimeout_ = window$1.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n  }\n  /**\n   * Reset stalled download stats for a specific type of loader\n   *\n   * @param {string} type\n   *        The segment loader type to check.\n   *\n   * @listens SegmentLoader#playlistupdate\n   * @listens Tech#seeking\n   * @listens Tech#seeked\n   */\n\n\n  resetSegmentDownloads_(type) {\n    const loader = this.playlistController_[`${type}SegmentLoader_`];\n\n    if (this[`${type}StalledDownloads_`] > 0) {\n      this.logger_(`resetting possible stalled download count for ${type} loader`);\n    }\n\n    this[`${type}StalledDownloads_`] = 0;\n    this[`${type}Buffered_`] = loader.buffered_();\n  }\n  /**\n   * Checks on every segment `appendsdone` to see\n   * if segment appends are making progress. If they are not\n   * and we are still downloading bytes. We exclude the playlist.\n   *\n   * @param {string} type\n   *        The segment loader type to check.\n   *\n   * @listens SegmentLoader#appendsdone\n   */\n\n\n  checkSegmentDownloads_(type) {\n    const pc = this.playlistController_;\n    const loader = pc[`${type}SegmentLoader_`];\n    const buffered = loader.buffered_();\n    const isBufferedDifferent = isRangeDifferent(this[`${type}Buffered_`], buffered);\n    this[`${type}Buffered_`] = buffered; // if another watcher is going to fix the issue or\n    // the buffered value for this loader changed\n    // appends are working\n\n    if (isBufferedDifferent) {\n      this.resetSegmentDownloads_(type);\n      return;\n    }\n\n    this[`${type}StalledDownloads_`]++;\n    this.logger_(`found #${this[`${type}StalledDownloads_`]} ${type} appends that did not increase buffer (possible stalled download)`, {\n      playlistId: loader.playlist_ && loader.playlist_.id,\n      buffered: timeRangesToArray(buffered)\n    }); // after 10 possibly stalled appends with no reset, exclude\n\n    if (this[`${type}StalledDownloads_`] < 10) {\n      return;\n    }\n\n    this.logger_(`${type} loader stalled download exclusion`);\n    this.resetSegmentDownloads_(type);\n    this.tech_.trigger({\n      type: 'usage',\n      name: `vhs-${type}-download-exclusion`\n    });\n\n    if (type === 'subtitle') {\n      return;\n    } // TODO: should we exclude audio tracks rather than main tracks\n    // when type is audio?\n\n\n    pc.excludePlaylist({\n      error: {\n        message: `Excessive ${type} segment downloading detected.`\n      },\n      playlistExclusionDuration: Infinity\n    });\n  }\n  /**\n   * The purpose of this function is to emulate the \"waiting\" event on\n   * browsers that do not emit it when they are waiting for more\n   * data to continue playback\n   *\n   * @private\n   */\n\n\n  checkCurrentTime_() {\n    if (this.tech_.paused() || this.tech_.seeking()) {\n      return;\n    }\n\n    const currentTime = this.tech_.currentTime();\n    const buffered = this.tech_.buffered();\n\n    if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n      // If current time is at the end of the final buffered region, then any playback\n      // stall is most likely caused by buffering in a low bandwidth environment. The tech\n      // should fire a `waiting` event in this scenario, but due to browser and tech\n      // inconsistencies. Calling `techWaiting_` here allows us to simulate\n      // responding to a native `waiting` event when the tech fails to emit one.\n      return this.techWaiting_();\n    }\n\n    if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n      this.consecutiveUpdates++;\n      this.waiting_();\n    } else if (currentTime === this.lastRecordedTime) {\n      this.consecutiveUpdates++;\n    } else {\n      this.consecutiveUpdates = 0;\n      this.lastRecordedTime = currentTime;\n    }\n  }\n  /**\n   * Resets the 'timeupdate' mechanism designed to detect that we are stalled\n   *\n   * @private\n   */\n\n\n  resetTimeUpdate_() {\n    this.consecutiveUpdates = 0;\n  }\n  /**\n   * Fixes situations where there's a bad seek\n   *\n   * @return {boolean} whether an action was taken to fix the seek\n   * @private\n   */\n\n\n  fixesBadSeeks_() {\n    const seeking = this.tech_.seeking();\n\n    if (!seeking) {\n      return false;\n    } // TODO: It's possible that these seekable checks should be moved out of this function\n    // and into a function that runs on seekablechange. It's also possible that we only need\n    // afterSeekableWindow as the buffered check at the bottom is good enough to handle before\n    // seekable range.\n\n\n    const seekable = this.seekable();\n    const currentTime = this.tech_.currentTime();\n    const isAfterSeekableRange = this.afterSeekableWindow_(seekable, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);\n    let seekTo;\n\n    if (isAfterSeekableRange) {\n      const seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n      seekTo = seekableEnd;\n    }\n\n    if (this.beforeSeekableWindow_(seekable, currentTime)) {\n      const seekableStart = seekable.start(0); // sync to the beginning of the live window\n      // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n      seekTo = seekableStart + ( // if the playlist is too short and the seekable range is an exact time (can\n      // happen in live with a 3 segment playlist), then don't use a time delta\n      seekableStart === seekable.end(0) ? 0 : SAFE_TIME_DELTA);\n    }\n\n    if (typeof seekTo !== 'undefined') {\n      this.logger_(`Trying to seek outside of seekable at time ${currentTime} with ` + `seekable range ${printableRange(seekable)}. Seeking to ` + `${seekTo}.`);\n      this.tech_.setCurrentTime(seekTo);\n      return true;\n    }\n\n    const sourceUpdater = this.playlistController_.sourceUpdater_;\n    const buffered = this.tech_.buffered();\n    const audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;\n    const videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;\n    const media = this.media(); // verify that at least two segment durations or one part duration have been\n    // appended before checking for a gap.\n\n    const minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2; // verify that at least two segment durations have been\n    // appended before checking for a gap.\n\n    const bufferedToCheck = [audioBuffered, videoBuffered];\n\n    for (let i = 0; i < bufferedToCheck.length; i++) {\n      // skip null buffered\n      if (!bufferedToCheck[i]) {\n        continue;\n      }\n\n      const timeAhead = timeAheadOf(bufferedToCheck[i], currentTime); // if we are less than two video/audio segment durations or one part\n      // duration behind we haven't appended enough to call this a bad seek.\n\n      if (timeAhead < minAppendedDuration) {\n        return false;\n      }\n    }\n\n    const nextRange = findNextRange(buffered, currentTime); // we have appended enough content, but we don't have anything buffered\n    // to seek over the gap\n\n    if (nextRange.length === 0) {\n      return false;\n    }\n\n    seekTo = nextRange.start(0) + SAFE_TIME_DELTA;\n    this.logger_(`Buffered region starts (${nextRange.start(0)}) ` + ` just beyond seek point (${currentTime}). Seeking to ${seekTo}.`);\n    this.tech_.setCurrentTime(seekTo);\n    return true;\n  }\n  /**\n   * Handler for situations when we determine the player is waiting.\n   *\n   * @private\n   */\n\n\n  waiting_() {\n    if (this.techWaiting_()) {\n      return;\n    } // All tech waiting checks failed. Use last resort correction\n\n\n    const currentTime = this.tech_.currentTime();\n    const buffered = this.tech_.buffered();\n    const currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n    // region with no indication that anything is amiss (seen in Firefox). Seeking to\n    // currentTime is usually enough to kickstart the player. This checks that the player\n    // is currently within a buffered region before attempting a corrective seek.\n    // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n    // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n    // make sure there is ~3 seconds of forward buffer before taking any corrective action\n    // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n    if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n      this.resetTimeUpdate_();\n      this.tech_.setCurrentTime(currentTime);\n      this.logger_(`Stopped at ${currentTime} while inside a buffered region ` + `[${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume ` + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-unknown-waiting'\n      });\n      return;\n    }\n  }\n  /**\n   * Handler for situations when the tech fires a `waiting` event\n   *\n   * @return {boolean}\n   *         True if an action (or none) was needed to correct the waiting. False if no\n   *         checks passed\n   * @private\n   */\n\n\n  techWaiting_() {\n    const seekable = this.seekable();\n    const currentTime = this.tech_.currentTime();\n\n    if (this.tech_.seeking()) {\n      // Tech is seeking or already waiting on another action, no action needed\n      return true;\n    }\n\n    if (this.beforeSeekableWindow_(seekable, currentTime)) {\n      const livePoint = seekable.end(seekable.length - 1);\n      this.logger_(`Fell out of live window at time ${currentTime}. Seeking to ` + `live point (seekable end) ${livePoint}`);\n      this.resetTimeUpdate_();\n      this.tech_.setCurrentTime(livePoint); // live window resyncs may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-live-resync'\n      });\n      return true;\n    }\n\n    const sourceUpdater = this.tech_.vhs.playlistController_.sourceUpdater_;\n    const buffered = this.tech_.buffered();\n    const videoUnderflow = this.videoUnderflow_({\n      audioBuffered: sourceUpdater.audioBuffered(),\n      videoBuffered: sourceUpdater.videoBuffered(),\n      currentTime\n    });\n\n    if (videoUnderflow) {\n      // Even though the video underflowed and was stuck in a gap, the audio overplayed\n      // the gap, leading currentTime into a buffered range. Seeking to currentTime\n      // allows the video to catch up to the audio position without losing any audio\n      // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n      this.resetTimeUpdate_();\n      this.tech_.setCurrentTime(currentTime); // video underflow may be useful for monitoring QoS\n\n      this.tech_.trigger({\n        type: 'usage',\n        name: 'vhs-video-underflow'\n      });\n      return true;\n    }\n\n    const nextRange = findNextRange(buffered, currentTime); // check for gap\n\n    if (nextRange.length > 0) {\n      this.logger_(`Stopped at ${currentTime} and seeking to ${nextRange.start(0)}`);\n      this.resetTimeUpdate_();\n      this.skipTheGap_(currentTime);\n      return true;\n    } // All checks failed. Returning false to indicate failure to correct waiting\n\n\n    return false;\n  }\n\n  afterSeekableWindow_(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow = false) {\n    if (!seekable.length) {\n      // we can't make a solid case if there's no seekable, default to false\n      return false;\n    }\n\n    let allowedEnd = seekable.end(seekable.length - 1) + SAFE_TIME_DELTA;\n    const isLive = !playlist.endList;\n    const isLLHLS = typeof playlist.partTargetDuration === 'number';\n\n    if (isLive && (isLLHLS || allowSeeksWithinUnsafeLiveWindow)) {\n      allowedEnd = seekable.end(seekable.length - 1) + playlist.targetDuration * 3;\n    }\n\n    if (currentTime > allowedEnd) {\n      return true;\n    }\n\n    return false;\n  }\n\n  beforeSeekableWindow_(seekable, currentTime) {\n    if (seekable.length && // can't fall before 0 and 0 seekable start identifies VOD stream\n    seekable.start(0) > 0 && currentTime < seekable.start(0) - this.liveRangeSafeTimeDelta) {\n      return true;\n    }\n\n    return false;\n  }\n\n  videoUnderflow_({\n    videoBuffered,\n    audioBuffered,\n    currentTime\n  }) {\n    // audio only content will not have video underflow :)\n    if (!videoBuffered) {\n      return;\n    }\n\n    let gap; // find a gap in demuxed content.\n\n    if (videoBuffered.length && audioBuffered.length) {\n      // in Chrome audio will continue to play for ~3s when we run out of video\n      // so we have to check that the video buffer did have some buffer in the\n      // past.\n      const lastVideoRange = findRange(videoBuffered, currentTime - 3);\n      const videoRange = findRange(videoBuffered, currentTime);\n      const audioRange = findRange(audioBuffered, currentTime);\n\n      if (audioRange.length && !videoRange.length && lastVideoRange.length) {\n        gap = {\n          start: lastVideoRange.end(0),\n          end: audioRange.end(0)\n        };\n      } // find a gap in muxed content.\n\n    } else {\n      const nextRange = findNextRange(videoBuffered, currentTime); // Even if there is no available next range, there is still a possibility we are\n      // stuck in a gap due to video underflow.\n\n      if (!nextRange.length) {\n        gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);\n      }\n    }\n\n    if (gap) {\n      this.logger_(`Encountered a gap in video from ${gap.start} to ${gap.end}. ` + `Seeking to current time ${currentTime}`);\n      return true;\n    }\n\n    return false;\n  }\n  /**\n   * Timer callback. If playback still has not proceeded, then we seek\n   * to the start of the next buffered region.\n   *\n   * @private\n   */\n\n\n  skipTheGap_(scheduledCurrentTime) {\n    const buffered = this.tech_.buffered();\n    const currentTime = this.tech_.currentTime();\n    const nextRange = findNextRange(buffered, currentTime);\n    this.resetTimeUpdate_();\n\n    if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n      return;\n    }\n\n    this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n    this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);\n    this.tech_.trigger({\n      type: 'usage',\n      name: 'vhs-gap-skip'\n    });\n  }\n\n  gapFromVideoUnderflow_(buffered, currentTime) {\n    // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n    // playing for ~3 seconds after the video gap starts. This is done to account for\n    // video buffer underflow/underrun (note that this is not done when there is audio\n    // buffer underflow/underrun -- in that case the video will stop as soon as it\n    // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n    // video stalls). The player's time will reflect the playthrough of audio, so the\n    // time will appear as if we are in a buffered region, even if we are stuck in a\n    // \"gap.\"\n    //\n    // Example:\n    // video buffer:   0 => 10.1, 10.2 => 20\n    // audio buffer:   0 => 20\n    // overall buffer: 0 => 10.1, 10.2 => 20\n    // current time: 13\n    //\n    // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n    // however, the audio continued playing until it reached ~3 seconds past the gap\n    // (13 seconds), at which point it stops as well. Since current time is past the\n    // gap, findNextRange will return no ranges.\n    //\n    // To check for this issue, we see if there is a gap that starts somewhere within\n    // a 3 second range (3 seconds +/- 1 second) back from our current time.\n    const gaps = findGaps(buffered);\n\n    for (let i = 0; i < gaps.length; i++) {\n      const start = gaps.start(i);\n      const end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n      if (currentTime - start < 4 && currentTime - start > 2) {\n        return {\n          start,\n          end\n        };\n      }\n    }\n\n    return null;\n  }\n\n}\n\nconst defaultOptions = {\n  errorInterval: 30,\n\n  getSource(next) {\n    const tech = this.tech({\n      IWillNotUseThisInPlugins: true\n    });\n    const sourceObj = tech.currentSource_ || this.currentSource();\n    return next(sourceObj);\n  }\n\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nconst initPlugin = function (player, options) {\n  let lastCalled = 0;\n  let seekTo = 0;\n  const localOptions = merge(defaultOptions, options);\n  player.ready(() => {\n    player.trigger({\n      type: 'usage',\n      name: 'vhs-error-reload-initialized'\n    });\n  });\n  /**\n   * Player modifications to perform that must wait until `loadedmetadata`\n   * has been triggered\n   *\n   * @private\n   */\n\n  const loadedMetadataHandler = function () {\n    if (seekTo) {\n      player.currentTime(seekTo);\n    }\n  };\n  /**\n   * Set the source on the player element, play, and seek if necessary\n   *\n   * @param {Object} sourceObj An object specifying the source url and mime-type to play\n   * @private\n   */\n\n\n  const setSource = function (sourceObj) {\n    if (sourceObj === null || sourceObj === undefined) {\n      return;\n    }\n\n    seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n    player.one('loadedmetadata', loadedMetadataHandler);\n    player.src(sourceObj);\n    player.trigger({\n      type: 'usage',\n      name: 'vhs-error-reload'\n    });\n    player.play();\n  };\n  /**\n   * Attempt to get a source from either the built-in getSource function\n   * or a custom function provided via the options\n   *\n   * @private\n   */\n\n\n  const errorHandler = function () {\n    // Do not attempt to reload the source if a source-reload occurred before\n    // 'errorInterval' time has elapsed since the last source-reload\n    if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n      player.trigger({\n        type: 'usage',\n        name: 'vhs-error-reload-canceled'\n      });\n      return;\n    }\n\n    if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n      videojs.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n      return;\n    }\n\n    lastCalled = Date.now();\n    return localOptions.getSource.call(player, setSource);\n  };\n  /**\n   * Unbind any event handlers that were bound by the plugin\n   *\n   * @private\n   */\n\n\n  const cleanupEvents = function () {\n    player.off('loadedmetadata', loadedMetadataHandler);\n    player.off('error', errorHandler);\n    player.off('dispose', cleanupEvents);\n  };\n  /**\n   * Cleanup before re-initializing the plugin\n   *\n   * @param {Object} [newOptions] an object with plugin options\n   * @private\n   */\n\n\n  const reinitPlugin = function (newOptions) {\n    cleanupEvents();\n    initPlugin(player, newOptions);\n  };\n\n  player.on('error', errorHandler);\n  player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n  // initializing the plugin\n\n  player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\n\nconst reloadSourceOnError = function (options) {\n  initPlugin(this, options);\n};\n\nvar version$4 = \"3.10.0\";\n\nvar version$3 = \"7.0.2\";\n\nvar version$2 = \"1.3.0\";\n\nvar version$1 = \"7.1.0\";\n\nvar version = \"4.0.1\";\n\n/**\n * @file videojs-http-streaming.js\n *\n * The main file for the VHS project.\n * License: https://github.com/videojs/videojs-http-streaming/blob/main/LICENSE\n */\nconst Vhs = {\n  PlaylistLoader,\n  Playlist,\n  utils,\n  STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,\n  INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n  lastBandwidthSelector,\n  movingAverageBandwidthSelector,\n  comparePlaylistBandwidth,\n  comparePlaylistResolution,\n  xhr: xhrFactory()\n}; // Define getter/setters for config properties\n\nObject.keys(Config).forEach(prop => {\n  Object.defineProperty(Vhs, prop, {\n    get() {\n      videojs.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);\n      return Config[prop];\n    },\n\n    set(value) {\n      videojs.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);\n\n      if (typeof value !== 'number' || value < 0) {\n        videojs.log.warn(`value of Vhs.${prop} must be greater than or equal to 0`);\n        return;\n      }\n\n      Config[prop] = value;\n    }\n\n  });\n});\nconst LOCAL_STORAGE_KEY = 'videojs-vhs';\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in vhs.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleVhsMediaChange\n */\n\nconst handleVhsMediaChange = function (qualityLevels, playlistLoader) {\n  const newPlaylist = playlistLoader.media();\n  let selectedIndex = -1;\n\n  for (let i = 0; i < qualityLevels.length; i++) {\n    if (qualityLevels[i].id === newPlaylist.id) {\n      selectedIndex = i;\n      break;\n    }\n  }\n\n  qualityLevels.selectedIndex_ = selectedIndex;\n  qualityLevels.trigger({\n    selectedIndex,\n    type: 'change'\n  });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} vhs Vhs object to listen to for media events.\n * @function handleVhsLoadedMetadata\n */\n\n\nconst handleVhsLoadedMetadata = function (qualityLevels, vhs) {\n  vhs.representations().forEach(rep => {\n    qualityLevels.addQualityLevel(rep);\n  });\n  handleVhsMediaChange(qualityLevels, vhs.playlists);\n}; // VHS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\n\nVhs.canPlaySource = function () {\n  return videojs.log.warn('VHS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nconst emeKeySystems = (keySystemOptions, mainPlaylist, audioPlaylist) => {\n  if (!keySystemOptions) {\n    return keySystemOptions;\n  }\n\n  let codecs = {};\n\n  if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {\n    codecs = unwrapCodecList(parseCodecs(mainPlaylist.attributes.CODECS));\n  }\n\n  if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {\n    codecs.audio = audioPlaylist.attributes.CODECS;\n  }\n\n  const videoContentType = getMimeForCodec(codecs.video);\n  const audioContentType = getMimeForCodec(codecs.audio); // upsert the content types based on the selected playlist\n\n  const keySystemContentTypes = {};\n\n  for (const keySystem in keySystemOptions) {\n    keySystemContentTypes[keySystem] = {};\n\n    if (audioContentType) {\n      keySystemContentTypes[keySystem].audioContentType = audioContentType;\n    }\n\n    if (videoContentType) {\n      keySystemContentTypes[keySystem].videoContentType = videoContentType;\n    } // Default to using the video playlist's PSSH even though they may be different, as\n    // videojs-contrib-eme will only accept one in the options.\n    //\n    // This shouldn't be an issue for most cases as early intialization will handle all\n    // unique PSSH values, and if they aren't, then encrypted events should have the\n    // specific information needed for the unique license.\n\n\n    if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {\n      keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;\n    } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n    // so we need to prevent overwriting the URL entirely\n\n\n    if (typeof keySystemOptions[keySystem] === 'string') {\n      keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n    }\n  }\n\n  return merge(keySystemOptions, keySystemContentTypes);\n};\n/**\n * @typedef {Object} KeySystems\n *\n * keySystems configuration for https://github.com/videojs/videojs-contrib-eme\n * Note: not all options are listed here.\n *\n * @property {Uint8Array} [pssh]\n *           Protection System Specific Header\n */\n\n/**\n * Goes through all the playlists and collects an array of KeySystems options objects\n * containing each playlist's keySystems and their pssh values, if available.\n *\n * @param {Object[]} playlists\n *        The playlists to look through\n * @param {string[]} keySystems\n *        The keySystems to collect pssh values for\n *\n * @return {KeySystems[]}\n *         An array of KeySystems objects containing available key systems and their\n *         pssh values\n */\n\n\nconst getAllPsshKeySystemsOptions = (playlists, keySystems) => {\n  return playlists.reduce((keySystemsArr, playlist) => {\n    if (!playlist.contentProtection) {\n      return keySystemsArr;\n    }\n\n    const keySystemsOptions = keySystems.reduce((keySystemsObj, keySystem) => {\n      const keySystemOptions = playlist.contentProtection[keySystem];\n\n      if (keySystemOptions && keySystemOptions.pssh) {\n        keySystemsObj[keySystem] = {\n          pssh: keySystemOptions.pssh\n        };\n      }\n\n      return keySystemsObj;\n    }, {});\n\n    if (Object.keys(keySystemsOptions).length) {\n      keySystemsArr.push(keySystemsOptions);\n    }\n\n    return keySystemsArr;\n  }, []);\n};\n/**\n * Returns a promise that waits for the\n * [eme plugin](https://github.com/videojs/videojs-contrib-eme) to create a key session.\n *\n * Works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449 in non-IE11\n * browsers.\n *\n * As per the above ticket, this is particularly important for Chrome, where, if\n * unencrypted content is appended before encrypted content and the key session has not\n * been created, a MEDIA_ERR_DECODE will be thrown once the encrypted content is reached\n * during playback.\n *\n * @param {Object} player\n *        The player instance\n * @param {Object[]} sourceKeySystems\n *        The key systems options from the player source\n * @param {Object} [audioMedia]\n *        The active audio media playlist (optional)\n * @param {Object[]} mainPlaylists\n *        The playlists found on the main playlist object\n *\n * @return {Object}\n *         Promise that resolves when the key session has been created\n */\n\n\nconst waitForKeySessionCreation = ({\n  player,\n  sourceKeySystems,\n  audioMedia,\n  mainPlaylists\n}) => {\n  if (!player.eme.initializeMediaKeys) {\n    return Promise.resolve();\n  } // TODO should all audio PSSH values be initialized for DRM?\n  //\n  // All unique video rendition pssh values are initialized for DRM, but here only\n  // the initial audio playlist license is initialized. In theory, an encrypted\n  // event should be fired if the user switches to an alternative audio playlist\n  // where a license is required, but this case hasn't yet been tested. In addition, there\n  // may be many alternate audio playlists unlikely to be used (e.g., multiple different\n  // languages).\n\n\n  const playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;\n  const keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));\n  const initializationFinishedPromises = [];\n  const keySessionCreatedPromises = []; // Since PSSH values are interpreted as initData, EME will dedupe any duplicates. The\n  // only place where it should not be deduped is for ms-prefixed APIs, but\n  // the existence of modern EME APIs in addition to\n  // ms-prefixed APIs on Edge should prevent this from being a concern.\n  // initializeMediaKeys also won't use the webkit-prefixed APIs.\n\n  keySystemsOptionsArr.forEach(keySystemsOptions => {\n    keySessionCreatedPromises.push(new Promise((resolve, reject) => {\n      player.tech_.one('keysessioncreated', resolve);\n    }));\n    initializationFinishedPromises.push(new Promise((resolve, reject) => {\n      player.eme.initializeMediaKeys({\n        keySystems: keySystemsOptions\n      }, err => {\n        if (err) {\n          reject(err);\n          return;\n        }\n\n        resolve();\n      });\n    }));\n  }); // The reasons Promise.race is chosen over Promise.any:\n  //\n  // * Promise.any is only available in Safari 14+.\n  // * None of these promises are expected to reject. If they do reject, it might be\n  //   better here for the race to surface the rejection, rather than mask it by using\n  //   Promise.any.\n\n  return Promise.race([// If a session was previously created, these will all finish resolving without\n  // creating a new session, otherwise it will take until the end of all license\n  // requests, which is why the key session check is used (to make setup much faster).\n  Promise.all(initializationFinishedPromises), // Once a single session is created, the browser knows DRM will be used.\n  Promise.race(keySessionCreatedPromises)]);\n};\n/**\n * If the [eme](https://github.com/videojs/videojs-contrib-eme) plugin is available, and\n * there are keySystems on the source, sets up source options to prepare the source for\n * eme.\n *\n * @param {Object} player\n *        The player instance\n * @param {Object[]} sourceKeySystems\n *        The key systems options from the player source\n * @param {Object} media\n *        The active media playlist\n * @param {Object} [audioMedia]\n *        The active audio media playlist (optional)\n *\n * @return {boolean}\n *         Whether or not options were configured and EME is available\n */\n\nconst setupEmeOptions = ({\n  player,\n  sourceKeySystems,\n  media,\n  audioMedia\n}) => {\n  const sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);\n\n  if (!sourceOptions) {\n    return false;\n  }\n\n  player.currentSource().keySystems = sourceOptions; // eme handles the rest of the setup, so if it is missing\n  // do nothing.\n\n  if (sourceOptions && !player.eme) {\n    videojs.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin');\n    return false;\n  }\n\n  return true;\n};\n\nconst getVhsLocalStorage = () => {\n  if (!window$1.localStorage) {\n    return null;\n  }\n\n  const storedObject = window$1.localStorage.getItem(LOCAL_STORAGE_KEY);\n\n  if (!storedObject) {\n    return null;\n  }\n\n  try {\n    return JSON.parse(storedObject);\n  } catch (e) {\n    // someone may have tampered with the value\n    return null;\n  }\n};\n\nconst updateVhsLocalStorage = options => {\n  if (!window$1.localStorage) {\n    return false;\n  }\n\n  let objectToStore = getVhsLocalStorage();\n  objectToStore = objectToStore ? merge(objectToStore, options) : options;\n\n  try {\n    window$1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));\n  } catch (e) {\n    // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n    // storage is set to 0).\n    // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n    // No need to perform any operation.\n    return false;\n  }\n\n  return objectToStore;\n};\n/**\n * Parses VHS-supported media types from data URIs. See\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * for information on data URIs.\n *\n * @param {string} dataUri\n *        The data URI\n *\n * @return {string|Object}\n *         The parsed object/string, or the original string if no supported media type\n *         was found\n */\n\n\nconst expandDataUri = dataUri => {\n  if (dataUri.toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') === 0) {\n    return JSON.parse(dataUri.substring(dataUri.indexOf(',') + 1));\n  } // no known case for this data URI, return the string as-is\n\n\n  return dataUri;\n};\n/**\n * Adds a request hook to an xhr object\n *\n * @param {Object} xhr object to add the onRequest hook to\n * @param {function} callback hook function for an xhr request\n */\n\n\nconst addOnRequestHook = (xhr, callback) => {\n  if (!xhr._requestCallbackSet) {\n    xhr._requestCallbackSet = new Set();\n  }\n\n  xhr._requestCallbackSet.add(callback);\n};\n/**\n * Adds a response hook to an xhr object\n *\n * @param {Object} xhr object to add the onResponse hook to\n * @param {function} callback hook function for an xhr response\n */\n\n\nconst addOnResponseHook = (xhr, callback) => {\n  if (!xhr._responseCallbackSet) {\n    xhr._responseCallbackSet = new Set();\n  }\n\n  xhr._responseCallbackSet.add(callback);\n};\n/**\n * Removes a request hook on an xhr object, deletes the onRequest set if empty.\n *\n * @param {Object} xhr object to remove the onRequest hook from\n * @param {function} callback hook function to remove\n */\n\n\nconst removeOnRequestHook = (xhr, callback) => {\n  if (!xhr._requestCallbackSet) {\n    return;\n  }\n\n  xhr._requestCallbackSet.delete(callback);\n\n  if (!xhr._requestCallbackSet.size) {\n    delete xhr._requestCallbackSet;\n  }\n};\n/**\n * Removes a response hook on an xhr object, deletes the onResponse set if empty.\n *\n * @param {Object} xhr object to remove the onResponse hook from\n * @param {function} callback hook function to remove\n */\n\n\nconst removeOnResponseHook = (xhr, callback) => {\n  if (!xhr._responseCallbackSet) {\n    return;\n  }\n\n  xhr._responseCallbackSet.delete(callback);\n\n  if (!xhr._responseCallbackSet.size) {\n    delete xhr._responseCallbackSet;\n  }\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\n\nVhs.supportsNativeHls = function () {\n  if (!document || !document.createElement) {\n    return false;\n  }\n\n  const video = document.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n  if (!videojs.getTech('Html5').isSupported()) {\n    return false;\n  } // HLS manifests can go by many mime-types\n\n\n  const canPlay = [// Apple santioned\n  'application/vnd.apple.mpegurl', // Apple sanctioned for backwards compatibility\n  'audio/mpegurl', // Very common\n  'audio/x-mpegurl', // Very common\n  'application/x-mpegurl', // Included for completeness\n  'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n  return canPlay.some(function (canItPlay) {\n    return /maybe|probably/i.test(video.canPlayType(canItPlay));\n  });\n}();\n\nVhs.supportsNativeDash = function () {\n  if (!document || !document.createElement || !videojs.getTech('Html5').isSupported()) {\n    return false;\n  }\n\n  return /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'));\n}();\n\nVhs.supportsTypeNatively = type => {\n  if (type === 'hls') {\n    return Vhs.supportsNativeHls;\n  }\n\n  if (type === 'dash') {\n    return Vhs.supportsNativeDash;\n  }\n\n  return false;\n};\n/**\n * VHS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\n\nVhs.isSupported = function () {\n  return videojs.log.warn('VHS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n/**\n * A global function for setting an onRequest hook\n *\n * @param {function} callback for request modifiction\n */\n\n\nVhs.xhr.onRequest = function (callback) {\n  addOnRequestHook(Vhs.xhr, callback);\n};\n/**\n * A global function for setting an onResponse hook\n *\n * @param {callback} callback for response data retrieval\n */\n\n\nVhs.xhr.onResponse = function (callback) {\n  addOnResponseHook(Vhs.xhr, callback);\n};\n/**\n * Deletes a global onRequest callback if it exists\n *\n * @param {function} callback to delete from the global set\n */\n\n\nVhs.xhr.offRequest = function (callback) {\n  removeOnRequestHook(Vhs.xhr, callback);\n};\n/**\n * Deletes a global onResponse callback if it exists\n *\n * @param {function} callback to delete from the global set\n */\n\n\nVhs.xhr.offResponse = function (callback) {\n  removeOnResponseHook(Vhs.xhr, callback);\n};\n\nconst Component = videojs.getComponent('Component');\n/**\n * The Vhs Handler object, where we orchestrate all of the parts\n * of VHS to interact with video.js\n *\n * @class VhsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nclass VhsHandler extends Component {\n  constructor(source, tech, options) {\n    super(tech, options.vhs); // if a tech level `initialBandwidth` option was passed\n    // use that over the VHS level `bandwidth` option\n\n    if (typeof options.initialBandwidth === 'number') {\n      this.options_.bandwidth = options.initialBandwidth;\n    }\n\n    this.logger_ = logger('VhsHandler'); // we need access to the player in some cases,\n    // so, get it from Video.js via the `playerId`\n\n    if (tech.options_ && tech.options_.playerId) {\n      const _player = videojs.getPlayer(tech.options_.playerId);\n\n      this.player_ = _player;\n    }\n\n    this.tech_ = tech;\n    this.source_ = source;\n    this.stats = {};\n    this.ignoreNextSeekingEvent_ = false;\n    this.setOptions_();\n\n    if (this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n      tech.overrideNativeAudioTracks(true);\n      tech.overrideNativeVideoTracks(true);\n    } else if (this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n      // overriding native VHS only works if audio tracks have been emulated\n      // error early if we're misconfigured\n      throw new Error('Overriding native VHS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n    } // listen for fullscreenchange events for this player so that we\n    // can adjust our quality selection quickly\n\n\n    this.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], event => {\n      const fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n\n      if (fullscreenElement && fullscreenElement.contains(this.tech_.el())) {\n        this.playlistController_.fastQualityChange_();\n      } else {\n        // When leaving fullscreen, since the in page pixel dimensions should be smaller\n        // than full screen, see if there should be a rendition switch down to preserve\n        // bandwidth.\n        this.playlistController_.checkABR_();\n      }\n    });\n    this.on(this.tech_, 'seeking', function () {\n      if (this.ignoreNextSeekingEvent_) {\n        this.ignoreNextSeekingEvent_ = false;\n        return;\n      }\n\n      this.setCurrentTime(this.tech_.currentTime());\n    });\n    this.on(this.tech_, 'error', function () {\n      // verify that the error was real and we are loaded\n      // enough to have pc loaded.\n      if (this.tech_.error() && this.playlistController_) {\n        this.playlistController_.pauseLoading();\n      }\n    });\n    this.on(this.tech_, 'play', this.play);\n  }\n  /**\n   * Set VHS options based on options from configuration, as well as partial\n   * options to be passed at a later time.\n   *\n   * @param {Object} options A partial chunk of config options\n   */\n\n\n  setOptions_(options = {}) {\n    this.options_ = merge(this.options_, options); // defaults\n\n    this.options_.withCredentials = this.options_.withCredentials || false;\n    this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n    this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;\n    this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n    this.options_.useForcedSubtitles = this.options_.useForcedSubtitles || false;\n    this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;\n    this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;\n    this.options_.customTagParsers = this.options_.customTagParsers || [];\n    this.options_.customTagMappers = this.options_.customTagMappers || [];\n    this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;\n    this.options_.llhls = this.options_.llhls === false ? false : true;\n    this.options_.bufferBasedABR = this.options_.bufferBasedABR || false;\n\n    if (typeof this.options_.playlistExclusionDuration !== 'number') {\n      this.options_.playlistExclusionDuration = 60;\n    }\n\n    if (typeof this.options_.bandwidth !== 'number') {\n      if (this.options_.useBandwidthFromLocalStorage) {\n        const storedObject = getVhsLocalStorage();\n\n        if (storedObject && storedObject.bandwidth) {\n          this.options_.bandwidth = storedObject.bandwidth;\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'vhs-bandwidth-from-local-storage'\n          });\n        }\n\n        if (storedObject && storedObject.throughput) {\n          this.options_.throughput = storedObject.throughput;\n          this.tech_.trigger({\n            type: 'usage',\n            name: 'vhs-throughput-from-local-storage'\n          });\n        }\n      }\n    } // if bandwidth was not set by options or pulled from local storage, start playlist\n    // selection at a reasonable bandwidth\n\n\n    if (typeof this.options_.bandwidth !== 'number') {\n      this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n    } // If the bandwidth number is unchanged from the initial setting\n    // then this takes precedence over the enableLowInitialPlaylist option\n\n\n    this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n    ['withCredentials', 'useDevicePixelRatio', 'limitRenditionByPlayerDimensions', 'bandwidth', 'customTagParsers', 'customTagMappers', 'cacheEncryptionKeys', 'playlistSelector', 'initialPlaylistSelector', 'bufferBasedABR', 'liveRangeSafeTimeDelta', 'llhls', 'useForcedSubtitles', 'useNetworkInformationApi', 'useDtsForTimestampOffset', 'exactManifestTimings', 'leastPixelDiffSelector'].forEach(option => {\n      if (typeof this.source_[option] !== 'undefined') {\n        this.options_[option] = this.source_[option];\n      }\n    });\n    this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n    this.useDevicePixelRatio = this.options_.useDevicePixelRatio;\n  } // alias for public method to set options\n\n\n  setOptions(options = {}) {\n    this.setOptions_(options);\n  }\n  /**\n   * called when player.src gets called, handle a new source\n   *\n   * @param {Object} src the source object to handle\n   */\n\n\n  src(src, type) {\n    // do nothing if the src is falsey\n    if (!src) {\n      return;\n    }\n\n    this.setOptions_(); // add main playlist controller options\n\n    this.options_.src = expandDataUri(this.source_.src);\n    this.options_.tech = this.tech_;\n    this.options_.externVhs = Vhs;\n    this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update the tech\n\n    this.options_.seekTo = time => {\n      this.tech_.setCurrentTime(time);\n    };\n\n    this.playlistController_ = new PlaylistController(this.options_);\n    const playbackWatcherOptions = merge({\n      liveRangeSafeTimeDelta: SAFE_TIME_DELTA\n    }, this.options_, {\n      seekable: () => this.seekable(),\n      media: () => this.playlistController_.media(),\n      playlistController: this.playlistController_\n    });\n    this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);\n    this.playlistController_.on('error', () => {\n      const player = videojs.players[this.tech_.options_.playerId];\n      let error = this.playlistController_.error;\n\n      if (typeof error === 'object' && !error.code) {\n        error.code = 3;\n      } else if (typeof error === 'string') {\n        error = {\n          message: error,\n          code: 3\n        };\n      }\n\n      player.error(error);\n    });\n    const defaultSelector = this.options_.bufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR; // `this` in selectPlaylist should be the VhsHandler for backwards\n    // compatibility with < v2\n\n    this.playlistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);\n    this.playlistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n    this.playlists = this.playlistController_.mainPlaylistLoader_;\n    this.mediaSource = this.playlistController_.mediaSource; // Proxy assignment of some properties to the main playlist\n    // controller. Using a custom property for backwards compatibility\n    // with < v2\n\n    Object.defineProperties(this, {\n      selectPlaylist: {\n        get() {\n          return this.playlistController_.selectPlaylist;\n        },\n\n        set(selectPlaylist) {\n          this.playlistController_.selectPlaylist = selectPlaylist.bind(this);\n        }\n\n      },\n      throughput: {\n        get() {\n          return this.playlistController_.mainSegmentLoader_.throughput.rate;\n        },\n\n        set(throughput) {\n          this.playlistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n          // for the cumulative average\n\n          this.playlistController_.mainSegmentLoader_.throughput.count = 1;\n        }\n\n      },\n      bandwidth: {\n        get() {\n          let playerBandwidthEst = this.playlistController_.mainSegmentLoader_.bandwidth;\n          const networkInformation = window$1.navigator.connection || window$1.navigator.mozConnection || window$1.navigator.webkitConnection;\n          const tenMbpsAsBitsPerSecond = 10e6;\n\n          if (this.options_.useNetworkInformationApi && networkInformation) {\n            // downlink returns Mbps\n            // https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink\n            const networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1000 * 1000; // downlink maxes out at 10 Mbps. In the event that both networkInformationApi and the player\n            // estimate a bandwidth greater than 10 Mbps, use the larger of the two estimates to ensure that\n            // high quality streams are not filtered out.\n\n            if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {\n              playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);\n            } else {\n              playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;\n            }\n          }\n\n          return playerBandwidthEst;\n        },\n\n        set(bandwidth) {\n          this.playlistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n          // `count` is set to zero that current value of `rate` isn't included\n          // in the cumulative average\n\n          this.playlistController_.mainSegmentLoader_.throughput = {\n            rate: 0,\n            count: 0\n          };\n        }\n\n      },\n\n      /**\n       * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n       * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n       * the entire process after that - decryption, transmuxing, and appending - provided\n       * by `throughput`.\n       *\n       * Since the two process are serial, the overall system bandwidth is given by:\n       *   sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n       */\n      systemBandwidth: {\n        get() {\n          const invBandwidth = 1 / (this.bandwidth || 1);\n          let invThroughput;\n\n          if (this.throughput > 0) {\n            invThroughput = 1 / this.throughput;\n          } else {\n            invThroughput = 0;\n          }\n\n          const systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n          return systemBitrate;\n        },\n\n        set() {\n          videojs.log.error('The \"systemBandwidth\" property is read-only');\n        }\n\n      }\n    });\n\n    if (this.options_.bandwidth) {\n      this.bandwidth = this.options_.bandwidth;\n    }\n\n    if (this.options_.throughput) {\n      this.throughput = this.options_.throughput;\n    }\n\n    Object.defineProperties(this.stats, {\n      bandwidth: {\n        get: () => this.bandwidth || 0,\n        enumerable: true\n      },\n      mediaRequests: {\n        get: () => this.playlistController_.mediaRequests_() || 0,\n        enumerable: true\n      },\n      mediaRequestsAborted: {\n        get: () => this.playlistController_.mediaRequestsAborted_() || 0,\n        enumerable: true\n      },\n      mediaRequestsTimedout: {\n        get: () => this.playlistController_.mediaRequestsTimedout_() || 0,\n        enumerable: true\n      },\n      mediaRequestsErrored: {\n        get: () => this.playlistController_.mediaRequestsErrored_() || 0,\n        enumerable: true\n      },\n      mediaTransferDuration: {\n        get: () => this.playlistController_.mediaTransferDuration_() || 0,\n        enumerable: true\n      },\n      mediaBytesTransferred: {\n        get: () => this.playlistController_.mediaBytesTransferred_() || 0,\n        enumerable: true\n      },\n      mediaSecondsLoaded: {\n        get: () => this.playlistController_.mediaSecondsLoaded_() || 0,\n        enumerable: true\n      },\n      mediaAppends: {\n        get: () => this.playlistController_.mediaAppends_() || 0,\n        enumerable: true\n      },\n      mainAppendsToLoadedData: {\n        get: () => this.playlistController_.mainAppendsToLoadedData_() || 0,\n        enumerable: true\n      },\n      audioAppendsToLoadedData: {\n        get: () => this.playlistController_.audioAppendsToLoadedData_() || 0,\n        enumerable: true\n      },\n      appendsToLoadedData: {\n        get: () => this.playlistController_.appendsToLoadedData_() || 0,\n        enumerable: true\n      },\n      timeToLoadedData: {\n        get: () => this.playlistController_.timeToLoadedData_() || 0,\n        enumerable: true\n      },\n      buffered: {\n        get: () => timeRangesToArray(this.tech_.buffered()),\n        enumerable: true\n      },\n      currentTime: {\n        get: () => this.tech_.currentTime(),\n        enumerable: true\n      },\n      currentSource: {\n        get: () => this.tech_.currentSource_,\n        enumerable: true\n      },\n      currentTech: {\n        get: () => this.tech_.name_,\n        enumerable: true\n      },\n      duration: {\n        get: () => this.tech_.duration(),\n        enumerable: true\n      },\n      main: {\n        get: () => this.playlists.main,\n        enumerable: true\n      },\n      playerDimensions: {\n        get: () => this.tech_.currentDimensions(),\n        enumerable: true\n      },\n      seekable: {\n        get: () => timeRangesToArray(this.tech_.seekable()),\n        enumerable: true\n      },\n      timestamp: {\n        get: () => Date.now(),\n        enumerable: true\n      },\n      videoPlaybackQuality: {\n        get: () => this.tech_.getVideoPlaybackQuality(),\n        enumerable: true\n      }\n    });\n    this.tech_.one('canplay', this.playlistController_.setupFirstPlay.bind(this.playlistController_));\n    this.tech_.on('bandwidthupdate', () => {\n      if (this.options_.useBandwidthFromLocalStorage) {\n        updateVhsLocalStorage({\n          bandwidth: this.bandwidth,\n          throughput: Math.round(this.throughput)\n        });\n      }\n    });\n    this.playlistController_.on('selectedinitialmedia', () => {\n      // Add the manual rendition mix-in to VhsHandler\n      renditionSelectionMixin(this);\n    });\n    this.playlistController_.sourceUpdater_.on('createdsourcebuffers', () => {\n      this.setupEme_();\n    }); // the bandwidth of the primary segment loader is our best\n    // estimate of overall bandwidth\n\n    this.on(this.playlistController_, 'progress', function () {\n      this.tech_.trigger('progress');\n    }); // In the live case, we need to ignore the very first `seeking` event since\n    // that will be the result of the seek-to-live behavior\n\n    this.on(this.playlistController_, 'firstplay', function () {\n      this.ignoreNextSeekingEvent_ = true;\n    });\n    this.setupQualityLevels_(); // do nothing if the tech has been disposed already\n    // this can occur if someone sets the src in player.ready(), for instance\n\n    if (!this.tech_.el()) {\n      return;\n    }\n\n    this.mediaSourceUrl_ = window$1.URL.createObjectURL(this.playlistController_.mediaSource);\n    this.tech_.src(this.mediaSourceUrl_);\n  }\n\n  createKeySessions_() {\n    const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n    this.logger_('waiting for EME key session creation');\n    waitForKeySessionCreation({\n      player: this.player_,\n      sourceKeySystems: this.source_.keySystems,\n      audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),\n      mainPlaylists: this.playlists.main.playlists\n    }).then(() => {\n      this.logger_('created EME key session');\n      this.playlistController_.sourceUpdater_.initializedEme();\n    }).catch(err => {\n      this.logger_('error while creating EME key session', err);\n      this.player_.error({\n        message: 'Failed to initialize media keys for EME',\n        code: 3\n      });\n    });\n  }\n\n  handleWaitingForKey_() {\n    // If waitingforkey is fired, it's possible that the data that's necessary to retrieve\n    // the key is in the manifest. While this should've happened on initial source load, it\n    // may happen again in live streams where the keys change, and the manifest info\n    // reflects the update.\n    //\n    // Because videojs-contrib-eme compares the PSSH data we send to that of PSSH data it's\n    // already requested keys for, we don't have to worry about this generating extraneous\n    // requests.\n    this.logger_('waitingforkey fired, attempting to create any new key sessions');\n    this.createKeySessions_();\n  }\n  /**\n   * If necessary and EME is available, sets up EME options and waits for key session\n   * creation.\n   *\n   * This function also updates the source updater so taht it can be used, as for some\n   * browsers, EME must be configured before content is appended (if appending unencrypted\n   * content before encrypted content).\n   */\n\n\n  setupEme_() {\n    const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n    const didSetupEmeOptions = setupEmeOptions({\n      player: this.player_,\n      sourceKeySystems: this.source_.keySystems,\n      media: this.playlists.media(),\n      audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()\n    });\n    this.player_.tech_.on('keystatuschange', e => {\n      this.playlistController_.updatePlaylistByKeyStatus(e.keyId, e.status);\n    });\n    this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);\n    this.player_.tech_.on('waitingforkey', this.handleWaitingForKey_);\n\n    if (!didSetupEmeOptions) {\n      // If EME options were not set up, we've done all we could to initialize EME.\n      this.playlistController_.sourceUpdater_.initializedEme();\n      return;\n    }\n\n    this.createKeySessions_();\n  }\n  /**\n   * Initializes the quality levels and sets listeners to update them.\n   *\n   * @method setupQualityLevels_\n   * @private\n   */\n\n\n  setupQualityLevels_() {\n    const player = videojs.players[this.tech_.options_.playerId]; // if there isn't a player or there isn't a qualityLevels plugin\n    // or qualityLevels_ listeners have already been setup, do nothing.\n\n    if (!player || !player.qualityLevels || this.qualityLevels_) {\n      return;\n    }\n\n    this.qualityLevels_ = player.qualityLevels();\n    this.playlistController_.on('selectedinitialmedia', () => {\n      handleVhsLoadedMetadata(this.qualityLevels_, this);\n    });\n    this.playlists.on('mediachange', () => {\n      handleVhsMediaChange(this.qualityLevels_, this.playlists);\n    });\n  }\n  /**\n   * return the version\n   */\n\n\n  static version() {\n    return {\n      '@videojs/http-streaming': version$4,\n      'mux.js': version$3,\n      'mpd-parser': version$2,\n      'm3u8-parser': version$1,\n      'aes-decrypter': version\n    };\n  }\n  /**\n   * return the version\n   */\n\n\n  version() {\n    return this.constructor.version();\n  }\n\n  canChangeType() {\n    return SourceUpdater.canChangeType();\n  }\n  /**\n   * Begin playing the video.\n   */\n\n\n  play() {\n    this.playlistController_.play();\n  }\n  /**\n   * a wrapper around the function in PlaylistController\n   */\n\n\n  setCurrentTime(currentTime) {\n    this.playlistController_.setCurrentTime(currentTime);\n  }\n  /**\n   * a wrapper around the function in PlaylistController\n   */\n\n\n  duration() {\n    return this.playlistController_.duration();\n  }\n  /**\n   * a wrapper around the function in PlaylistController\n   */\n\n\n  seekable() {\n    return this.playlistController_.seekable();\n  }\n  /**\n   * Abort all outstanding work and cleanup.\n   */\n\n\n  dispose() {\n    if (this.playbackWatcher_) {\n      this.playbackWatcher_.dispose();\n    }\n\n    if (this.playlistController_) {\n      this.playlistController_.dispose();\n    }\n\n    if (this.qualityLevels_) {\n      this.qualityLevels_.dispose();\n    }\n\n    if (this.tech_ && this.tech_.vhs) {\n      delete this.tech_.vhs;\n    }\n\n    if (this.mediaSourceUrl_ && window$1.URL.revokeObjectURL) {\n      window$1.URL.revokeObjectURL(this.mediaSourceUrl_);\n      this.mediaSourceUrl_ = null;\n    }\n\n    if (this.tech_) {\n      this.tech_.off('waitingforkey', this.handleWaitingForKey_);\n    }\n\n    super.dispose();\n  }\n\n  convertToProgramTime(time, callback) {\n    return getProgramTime({\n      playlist: this.playlistController_.media(),\n      time,\n      callback\n    });\n  } // the player must be playing before calling this\n\n\n  seekToProgramTime(programTime, callback, pauseAfterSeek = true, retryCount = 2) {\n    return seekToProgramTime({\n      programTime,\n      playlist: this.playlistController_.media(),\n      retryCount,\n      pauseAfterSeek,\n      seekTo: this.options_.seekTo,\n      tech: this.options_.tech,\n      callback\n    });\n  }\n  /**\n   * Adds the onRequest, onResponse, offRequest and offResponse functions\n   * to the VhsHandler xhr Object.\n   */\n\n\n  setupXhrHooks_() {\n    /**\n     * A player function for setting an onRequest hook\n     *\n     * @param {function} callback for request modifiction\n     */\n    this.xhr.onRequest = callback => {\n      addOnRequestHook(this.xhr, callback);\n    };\n    /**\n     * A player function for setting an onResponse hook\n     *\n     * @param {callback} callback for response data retrieval\n     */\n\n\n    this.xhr.onResponse = callback => {\n      addOnResponseHook(this.xhr, callback);\n    };\n    /**\n     * Deletes a player onRequest callback if it exists\n     *\n     * @param {function} callback to delete from the player set\n     */\n\n\n    this.xhr.offRequest = callback => {\n      removeOnRequestHook(this.xhr, callback);\n    };\n    /**\n     * Deletes a player onResponse callback if it exists\n     *\n     * @param {function} callback to delete from the player set\n     */\n\n\n    this.xhr.offResponse = callback => {\n      removeOnResponseHook(this.xhr, callback);\n    }; // Trigger an event on the player to notify the user that vhs is ready to set xhr hooks.\n    // This allows hooks to be set before the source is set to vhs when handleSource is called.\n\n\n    this.player_.trigger('xhr-hooks-ready');\n  }\n\n}\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\n\nconst VhsSourceHandler = {\n  name: 'videojs-http-streaming',\n  VERSION: version$4,\n\n  canHandleSource(srcObj, options = {}) {\n    const localOptions = merge(videojs.options, options);\n    return VhsSourceHandler.canPlayType(srcObj.type, localOptions);\n  },\n\n  handleSource(source, tech, options = {}) {\n    const localOptions = merge(videojs.options, options);\n    tech.vhs = new VhsHandler(source, tech, localOptions);\n    tech.vhs.xhr = xhrFactory();\n    tech.vhs.setupXhrHooks_();\n    tech.vhs.src(source.src, source.type);\n    return tech.vhs;\n  },\n\n  canPlayType(type, options) {\n    const simpleType = simpleTypeFromSourceType(type);\n\n    if (!simpleType) {\n      return '';\n    }\n\n    const overrideNative = VhsSourceHandler.getOverrideNative(options);\n    const supportsTypeNatively = Vhs.supportsTypeNatively(simpleType);\n    const canUseMsePlayback = !supportsTypeNatively || overrideNative;\n    return canUseMsePlayback ? 'maybe' : '';\n  },\n\n  getOverrideNative(options = {}) {\n    const {\n      vhs = {}\n    } = options;\n    const defaultOverrideNative = !(videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS);\n    const {\n      overrideNative = defaultOverrideNative\n    } = vhs;\n    return overrideNative;\n  }\n\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {boolean} if  native media sources are supported\n */\n\nconst supportsNativeMediaSources = () => {\n  return browserSupportsCodec('avc1.4d400d,mp4a.40.2');\n}; // register source handlers with the appropriate techs\n\n\nif (supportsNativeMediaSources()) {\n  videojs.getTech('Html5').registerSourceHandler(VhsSourceHandler, 0);\n}\n\nvideojs.VhsHandler = VhsHandler;\nvideojs.VhsSourceHandler = VhsSourceHandler;\nvideojs.Vhs = Vhs;\n\nif (!videojs.use) {\n  videojs.registerComponent('Vhs', Vhs);\n}\n\nvideojs.options.vhs = videojs.options.vhs || {};\n\nif (!videojs.getPlugin || !videojs.getPlugin('reloadSourceOnError')) {\n  videojs.registerPlugin('reloadSourceOnError', reloadSourceOnError);\n}\n\nexport { LOCAL_STORAGE_KEY, Vhs, VhsHandler, VhsSourceHandler, emeKeySystems, expandDataUri, getAllPsshKeySystemsOptions, setupEmeOptions, waitForKeySessionCreation };\n","import { setupAdBlock } from './adblock';\n\nconst loadIMA = async (callback) => {\n  const url = '//imasdk.googleapis.com/js/sdkloader/ima3.js';\n  const hasIma = window.google && window.google.ima;\n  const adBlock = await setupAdBlock();\n\n  if (adBlock || hasIma) {\n    callback();\n    return false;\n  }\n\n  const script = document.createElement('script');\n  script.src = url;\n  script.onload = callback;\n  script.onerror = callback;\n\n  document.head.appendChild(script);\n  return true;\n};\n\nexport default loadIMA;\n","/* eslint func-names: 0 */\nimport videojs from 'video.js';\nimport { getAdPlacement, isLiveVideo } from '../helpers/helpers';\nimport { getParams } from '../start-player-extras';\nimport getMetadatas from '../utils/get-metadatas';\n\n/**\n * Consrtructor for the strategy. This is what gets passed to the SDK via:\n * window['_cbv_strategies'].push(R7PlayerStrategy);\n * @param {Object} player A pointer to the player being tracked. The player\n * is where all the video data is derived from\n */\nexport default function R7PlayerStrategy(player) {\n  // Your constructor code goes here\n  this._player = player;\n  this._isReady = true;\n  this._currentPlayTime = undefined;\n  this._startedAt = undefined;\n  this._currentContentType = R7PlayerStrategy.ContentType.CONTENT;\n  this._state = R7PlayerStrategy.VideoState.UNPLAYED;\n  this._displayingAd = false;\n  this._playTime = 0;\n  this._playTimeMilestone = null;\n  this._adPlayTime = 0;\n  this._playAdTimeMilestone = null;\n\n  this._player.on('tracking:adStart', () => {\n    this._currentContentType = R7PlayerStrategy.ContentType.AD;\n    const adType = getAdPlacement(this._player);\n    if (adType === 'pre-roll') {\n      this._playAdTimeMilestone = setInterval(() => {\n        this._adPlayTime += 10;\n      }, 10);\n    }\n    this._displayingAd = true;\n  });\n\n  this._player.on('tracking:adEnd', () => {\n    this._currentContentType = R7PlayerStrategy.ContentType.CONTENT;\n    this._displayingAd = false;\n    if (this._adPlayTime) {\n      clearInterval(this._adPlayTime);\n    }\n  });\n\n  this._player.on('tracking:adSkip', () => {\n    this._currentContentType = R7PlayerStrategy.ContentType.CONTENT;\n    this._displayingAd = false;\n    if (this._adPlayTime) {\n      clearInterval(this._adPlayTime);\n    }\n  });\n\n  this._player.on('tracking:start', () => {\n    this._state = R7PlayerStrategy.VideoState.PLAYED;\n  });\n\n  this._player.on('pause', () => {\n    this._state = R7PlayerStrategy.VideoState.STOPPED;\n    clearInterval(this._playTimeMilestone);\n  });\n\n  this._player.on('tracking:end', () => {\n    this._state = R7PlayerStrategy.VideoState.COMPLETED;\n    if (this._adPlayTime) {\n      clearInterval(this._adPlayTime);\n    }\n    if (this._playTime) {\n      clearInterval(this._playTime);\n    }\n  });\n\n  this._player.on('playing', () => {\n    this._state = R7PlayerStrategy.VideoState.PLAYED;\n    this._playTimeMilestone = setInterval(() => {\n      this._playTime += 10;\n    }, 10);\n  });\n\n  this._player.on('play', () => {\n    if (this._startedAt === undefined) {\n      this._startedAt = Date.now();\n    }\n  });\n}\n\n/**\n * Enum for the content type. One of these values should be returned from\n * the \"getContentType\" function.\n * @enum {string}\n */\nR7PlayerStrategy.ContentType = {\n  AD: 'ad',\n  CONTENT: 'ct',\n};\n\n/**\n * Enum for the ad position. One of these values should be returned from\n * the \"getAdPosition\" function.\n * @enum {string}\n */\nR7PlayerStrategy.AdPosition = {\n  'pre-roll': 'a1',\n  'mid-roll': 'a2',\n  'post-roll': 'a3',\n  OVERLAY: 'a4',\n  SPECIAL: 'a5',\n};\n\n/**\n * Enum for the video state. One of these values should be returned from\n * the \"getState\" function.\n * @enum {string}\n */\nR7PlayerStrategy.VideoState = {\n  UNPLAYED: 's1',\n  PLAYED: 's2',\n  STOPPED: 's3',\n  COMPLETED: 's4',\n};\n\n/**\n * Indicates if the video strategy is ready for pinging.\n * Typically this is called when all path and title metadata\n * is available\n * Note: Pings should only be sent after this reads true.\n * @return {boolean} The ready state of the strategy.\n */\nR7PlayerStrategy.prototype.isReady = function () {\n  return this._isReady;\n  // As an example, this could just be a call to a similar\n  // method in your _player object\n  // this._player.isready();\n};\n\n/**\n * Gets the human readable video title.\n * This is returned in the i key of the ping.\n * @return {string} The video title.\n */\nR7PlayerStrategy.prototype.getTitle = function () {\n  const metadata = getMetadatas(this._player);\n  return metadata.title;\n};\n\n/**\n * Gets the video path.\n * This is returned in the p key of the ping.\n * Note: this should be the playable video path if available.\n * @return {string} The video path.\n * https://entretenimento.r7.com/player/60fcc6af-eaf4-4aa2-8ab4-191829feeb77/\n */\nR7PlayerStrategy.prototype.getVideoPath = function () {\n  const metadata = getMetadatas(this._player);\n  return metadata.playerUrl;\n};\n\n/**\n * Gets the type of video playing. Returns value from the ContentType enum.\n * This is returned in the _vt key of the ping.\n * @return {R7PlayerStrategy.ContentType} The type of content (ad or ct).\n */\nR7PlayerStrategy.prototype.getContentType = function () {\n  return this._currentContentType;\n};\n\n/**\n * Gets the ad position. Returns value from the AdPosition enum.\n * This is returned in the _vap key of the ping.\n * @return {R7PlayerStrategy.AdPosition|string} The ad position\n * from a1 (pre-roll), a2 (mid-roll), a3 (post-roll),\n * a4 (overlay), or a5 (special).\n */\nR7PlayerStrategy.prototype.getAdPosition = function () {\n  if (!getParams(this._player).ads) {\n    return '';\n  }\n  if (!this._displayingAd) {\n    return '';\n  }\n  const adType = getAdPlacement(this._player);\n  return R7PlayerStrategy.AdPosition[adType];\n};\n\n/**\n * Gets the total duration of the video.\n * This is returned in the _vd key of the ping.\n * @return {number} The total duration time in milliseconds.\n */\nR7PlayerStrategy.prototype.getTotalDuration = function () {\n  const metadata = getMetadatas(this._player);\n  return metadata.duration;\n};\n\n/**\n * Gets the current state of the video. Returns value from the VideoState enum.\n * This is returned in the _vs key of the ping.\n * @return {string} The current video state. {@link R7PlayerStrategy.VideoState}\n */\nR7PlayerStrategy.prototype.getState = function () {\n  return this._state;\n};\n\n/**\n * Gets the current play time of the video (where the playhead is).\n * This is returned in the _vpt key of the ping.\n * @return {number} The current play time in milliseconds.\n */\nR7PlayerStrategy.prototype.getCurrentPlayTime = function () {\n  return this._player.currentTime().toFixed(0) * 1000;\n};\n\n/**\n * Gets the current bitrate of the video.\n * This is returned in the _vbr key of the ping.\n * @return {number} The current bitrate in kbps.\n */\nR7PlayerStrategy.prototype.getBitrate = function () {\n  const qualityLevels = this._player.qualityLevels();\n  let currentQuality = '360p';\n  const hasHeight =\n    qualityLevels[qualityLevels.selectedIndex] !== undefined &&\n    qualityLevels[qualityLevels.selectedIndex].height !== undefined;\n\n  if (hasHeight) {\n    currentQuality = `${qualityLevels[qualityLevels.selectedIndex].height}p`;\n  }\n\n  const quality = {\n    '1080p': 8000,\n    '720p': 5000,\n    '480p': 2500,\n    '360p': 1000,\n  }[currentQuality];\n\n  return quality;\n};\n\n/**\n * Gets the thumbnail of the video.\n * This is returned in the _vtn key of the ping.\n * @return {string} The [absolute] path to the thumbnail.\n */\nR7PlayerStrategy.prototype.getThumbnailPath = function () {\n  return this._player.poster();\n};\n\n/**\n * Gets the video player type.\n * This is returned in the _vplt key of the ping.\n * @return {string} The player type (user defined).\n */\nR7PlayerStrategy.prototype.getPlayerType = function () {\n  const isLive = isLiveVideo(this._player.duration());\n  return isLive ? 'live' : 'video';\n};\n\n/**\n * Gets the time since start of viewing.\n * This is returned in the _vvs key of the ping.\n * @return {number} The time since viewing started in milliseconds.\n */\nR7PlayerStrategy.prototype.getViewStartTime = function () {\n  return Date.now() - this._startedAt;\n};\n\n/**\n * Gets the time since start of viewing for users in a play state -- regardless of current state.\n * This is returned in the _vvsp key of the ping.\n * @return {number} The time since viewing started in milliseconds.\n */\nR7PlayerStrategy.prototype.getViewPlayTime = function () {\n  return this._playTime;\n};\n\n/**\n * Gets the time since play start for users who saw a preroll ad -- regardless of current state.\n * The timer continues after the ad completes as well.\n * This is returned in the _vasp key of the ping.\n * @return {number} The time since viewing started in milliseconds.\n */\nR7PlayerStrategy.prototype.getViewAdPlayTime = function () {\n  return this._adPlayTime;\n};\n\nR7PlayerStrategy.prototype.getStrategyName = function () {\n  return 'R7';\n};\n\n/**\n * Verifies that the given player belongs to this strategy. Used for a\n * greedy search of the matching strategy for a given element or object.\n * @param {Object} player A pointer to the player being tracked.\n * @return {boolean} If the strategy can handle this type of object.\n */\nR7PlayerStrategy.verify = function (player) {\n  try {\n    videojs(player.el_);\n    return true;\n  } catch {\n    return false;\n  }\n};\n","import { isArcEnviroment } from './helpers/helpers';\nimport { showErrorMsg, TYPE_OF_MSG } from './helpers/messages';\n\nlet videojs;\nlet langPt;\nlet getParams;\nlet getMetadatas;\nlet configParams;\nlet initPlugins;\nlet eventTracking;\nlet googleAnalytics;\nlet initAds;\nlet vjsYoubora;\nlet initComscore;\nlet kibana;\n\nwindow.R7Players = [];\n\nconst initR7Player = async () => {\n  const options = {\n    autoSetup: false,\n    controls: true,\n    muted: true,\n    fill: true,\n    language: 'pt-br',\n    playbackRates: [0.5, 1, 1.5, 2],\n    responsive: true,\n    languages: langPt,\n    withCredentials: true,\n    liveui: true,\n    playsinline: true,\n    fullscreen: {\n      navigationUI: 'show',\n    },\n    html5: {\n      vhs: {\n        overrideNative: !videojs.browser.IS_ANY_SAFARI,\n      },\n      nativeAudioTracks: false,\n      nativeVideoTracks: false,\n      nativeTextTracks: false,\n      preloadTextTracks: true,\n    },\n    controlBar: {\n      volumePanel: { inline: false },\n      fullscreenToggle: true,\n    },\n    techOrder: ['chromecast', 'html5'],\n  };\n\n  const checkPlayerReady = (element) =>\n    new Promise((resolve) => {\n      const timer = setInterval(() => {\n        if (!element || !element.dataset) return;\n\n        const arcGeoblocked = element.querySelector('[data-arc-geoblocked=\"true\"]');\n\n        if (isArcEnviroment() && arcGeoblocked) {\n          clearInterval(timer);\n          resolve(arcGeoblocked);\n          return;\n        }\n\n        const player = element.querySelector('.video-js');\n\n        if (player) {\n          clearInterval(timer);\n          resolve(player);\n        }\n      }, 100);\n    });\n\n  const initializePlayer = (player) => {\n    const r7player = videojs(player, options);\n    if (isArcEnviroment()) {\n      window.R7Players.push({ id: player.dataset.arcId, instance: r7player });\n    }\n\n    r7player.addClass('vjs-r7-skin');\n    try {\n      const params = getParams(r7player);\n      const metadatas = getMetadatas(r7player);\n      initPlugins(r7player, params);\n      configParams(r7player, params);\n      googleAnalytics(r7player, metadatas);\n      eventTracking(r7player);\n      vjsYoubora(r7player, metadatas);\n      initComscore(r7player);\n      initAds(videojs, r7player, params, metadatas);\n      kibana(r7player);\n    } catch (error) {\n      window.console.log('[player]', 'error', error);\n      showErrorMsg(r7player, TYPE_OF_MSG.ERROR);\n    }\n  };\n\n  const initializePlayers = async () => {\n    const wrapClassName = isArcEnviroment() ? '.wrapper-video' : '.r7-player-iframe';\n\n    const wrapPlayers = document.querySelectorAll(wrapClassName);\n    const readyPromises = Array.from(wrapPlayers).map(async (wrap) => {\n      const player = await checkPlayerReady(wrap);\n\n      if (player) {\n        initializePlayer(player, options);\n        return player;\n      }\n\n      return null;\n    });\n\n    return Promise.all(readyPromises);\n  };\n\n  initializePlayers();\n};\n\nconst startR7Player = () => {\n  import('video.js').then((vjs) => {\n    videojs = vjs.default;\n\n    import('./start-player-extras').then((resp) => {\n      langPt = resp.langPt;\n      getParams = resp.getParams;\n      getMetadatas = resp.getMetadatas;\n      configParams = resp.configParams;\n      initPlugins = resp.initPlugins;\n      googleAnalytics = resp.googleAnalytics;\n      eventTracking = resp.eventTracking;\n      initAds = resp.initAds;\n      vjsYoubora = resp.vjsYoubora;\n      initComscore = resp.initComscore;\n      kibana = resp.kibana;\n\n      initR7Player().then(() => {\n        window.r7player = true;\n      });\n      window.videojs = videojs;\n    });\n  });\n};\n\nexport default startR7Player;\n","import { hasAdBlock } from './ads/adblock';\nimport loadIMA from './ads/ima';\nimport R7PlayerStrategy from './analytics/chartbeat';\nimport { disableDefaultAutoplay } from './helpers/helpers';\nimport startR7Player from './start-player';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  disableDefaultAutoplay();\n  loadIMA(() => {\n    const timer = setInterval(() => {\n      const hasIma = window.google && window.google.ima;\n\n      if (hasAdBlock() || hasIma) {\n        clearInterval(timer);\n        startR7Player();\n      }\n    }, 100);\n  });\n  window.R7PlayerStrategy = R7PlayerStrategy;\n});\n"],"names":["ChromecastSessionManager","constructor","player","this","_sessionListener","_onSessionStateChange","bind","_castListener","_onCastStateChange","_addCastContextEventListeners","on","_removeCastContextEventListeners","_notifyPlayerOfDevicesAvailabilityChange","getCastContext","getCastState","remotePlayer","cast","framework","RemotePlayer","remotePlayerController","RemotePlayerController","static","sessionStateChangedEvt","CastContextEventType","SESSION_STATE_CHANGED","castStateChangedEvt","CAST_STATE_CHANGED","addEventListener","removeEventListener","event","sessionState","SessionState","SESSION_ENDED","trigger","_reloadTech","castState","hasAvailableDevices","CastState","NOT_CONNECTED","CONNECTING","CONNECTED","openCastMenu","onSessionSuccess","currentSource","hasConnected","requestSession","then","currentTime","wasPaused","paused","sources","currentSources","src","ready","pause","play","CastContext","getInstance","getRemotePlayer","getRemotePlayerController","isChromecastAPIAvailable","window","chrome","isChromecastConnected","module","exports","videojs","ButtonComponent","getComponent","registerComponent","options","super","_onChromecastConnected","_onChromecastDisconnected","_onChromecastDevicesAvailable","_onChromecastDevicesUnavailable","chromecastSessionManager","addCastLabelToButton","el","classList","add","_labelEl","document","createElement","_updateCastLabelText","appendChild","controlText","buildCSSClass","_isChromecastConnected","options_","prototype","handleClick","_reloadCSSClasses","show","hide","el_","className","textContent","localize","onChromecastRequested","enableChromecast","setOptions","receiverApplicationId","receiverAppID","media","DEFAULT_MEDIA_RECEIVER_APP_ID","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","configureCastContext","createSessionManager","indexOpt","addButtonToControlBar","controlBar","getChild","children","length","buttonPositionIndex","addChild","setUpChromecastButton","registerPlugin","pluginOptions","Object","assign","intervalID","tries","setInterval","CHECK_AVAILABILITY_TIMEOUT","clearInterval","waitUntilChromecastAPIsAreAvailable","preloadWebComponents","createChromecastButton","createChromecastTech","userOpts","doesUserAgentContainString","str","navigator","userAgent","indexOf","needsWebComponents","registerElement","iosChrome","presentation","ChromecastTechUI","Tech","ChromecastTech","featuresVolumeControl","featuresPlaybackRate","movingMediaElementInDOM","featuresFullscreenResize","featuresTimeupdateEvents","featuresProgressEvents","featuresNativeTextTracks","featuresNativeAudioTracks","featuresNativeVideoTracks","_eventListeners","videojsPlayer","playerId","_chromecastSessionManager","_ui","updatePoster","poster","_remotePlayer","_remotePlayerController","_listenToPlayerControllerEvents","_removeAllEventListeners","_hasPlayedAnyItem","_requestTitle","requestTitleFn","_requestSubtitle","requestSubtitleFn","_requestCustomData","requestCustomDataFn","_modifyLoadRequestFn","modifyLoadRequestFn","request","_initialStartTime","startTime","_playSource","source","setMuted","muted","createEl","getDOMElement","ended","_isMediaLoading","playOrPause","canPause","isPaused","playerState","setSource","_currentSource","type","castSession","_getCastSession","mediaInfo","MediaInfo","title","subtitle","customData","_clearSessionTimeout","metadata","GenericMediaMetadata","metadataType","MetadataType","GENERIC","streamType","liveTracker","isLive","StreamType","LIVE","BUFFERED","images","url","updateTitle","updateSubtitle","LoadRequest","autoplay","_hasPlayedCurrentItem","loadMedia","triggerReady","_getMediaSession","addUpdateListener","_onMediaSessionStatusChanged","_triggerErrorEvent","setCurrentTime","time","duration","canSeek","Math","min","seek","_triggerTimeUpdateEvent","mediaSession","_hasMediaSessionEnded","idleReason","IdleReason","FINISHED","volume","volumeLevel","setVolume","setVolumeLevel","_triggerVolumeChangeEvent","isMuted","muteOrUnmute","getPoster","setPoster","buffered","seekable","createTimeRange","controls","playsinline","supportsFullScreen","setAutoplay","playbackRate","setPlaybackRate","preload","load","readyState","eventTypes","RemotePlayerEventType","_addEventListener","PLAYER_STATE_CHANGED","_onPlayerStateChanged","VOLUME_LEVEL_CHANGED","IS_MUTED_CHANGED","CURRENT_TIME_CHANGED","DURATION_CHANGED","_triggerDurationChangeEvent","target","callback","context","listener","push","_removeEventListener","i","index","splice","states","PlayerState","PLAYING","PAUSED","IDLE","_closeSessionOnTimeout","BUFFERING","isAlive","_sessionTimeoutID","setTimeout","endSession","clearTimeout","_getCastContext","getCurrentSession","getMediaSession","canPlaySource","isSupported","registerTech","_el","_createDOMElement","_createElement","posterContainerEl","posterImageEl","titleEl","subtitleEl","titleContainer","_findPosterEl","querySelector","_findPosterImageEl","_findTitleEl","_findSubtitleEl","_poster","setAttribute","remove","removeAttribute","_title","innerHTML","_subtitle","freeze","object","oc","undefined","MIME_TYPE","HTML","isHTML","value","XML_APPLICATION","XML_TEXT","XML_XHTML_APPLICATION","XML_SVG_IMAGE","NAMESPACE","uri","SVG","XML","XMLNS","TypeError","key","hasOwnProperty","call","find","list","predicate","ac","Array","item","conventions","dom","entities","sax","DOMImplementation","ParseError","XMLReader","normalizeLineEndings","input","replace","DOMParser","locator","DOMHandler","cdata","position","node","lineNumber","columnNumber","_locator","l","systemId","_toString","chars","start","substr","java","lang","String","appendElement","hander","currentElement","doc","parseFromString","mimeType","domBuilder","errorHandler","defaultNSMap","xmlns","test","entityMap","HTML_ENTITIES","XML_ENTITIES","setDocumentLocator","errorImpl","isCallback","Function","build","fn","msg","buildErrorHandler","xml","normalize","parse","error","startDocument","createDocument","documentURI","startElement","namespaceURI","localName","qName","attrs","createElementNS","len","getURI","getValue","attr","getQName","createAttributeNS","getLocator","nodeValue","setAttributeNode","endElement","current","tagName","parentNode","startPrefixMapping","prefix","endPrefixMapping","processingInstruction","data","ins","createProcessingInstruction","ignorableWhitespace","ch","characters","apply","arguments","charNode","createCDATASection","createTextNode","skippedEntity","name","endDocument","comment","comm","createComment","startCDATA","endCDATA","startDTD","publicId","impl","implementation","createDocumentType","dt","doctype","warning","console","warn","fatalError","notEmptyString","orderedSetReducer","element","toOrderedSet","split","filter","splitOnASCIIWhitespace","keys","reduce","copy","dest","p","_extends","Class","Super","pt","t","NodeType","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","ExceptionCode","ExceptionMessage","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","DOMSTRING_SIZE_ERR","NOT_FOUND_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","INUSE_ATTRIBUTE_ERR","NOT_SUPPORTED_ERR","DOMException","code","message","Error","captureStackTrace","NodeList","LiveNodeList","refresh","_node","_refresh","_updateLiveList","inc","_inc","ownerDocument","ls","__set__","NamedNodeMap","_findNodeIndex","_addNamedNode","newAttr","oldAttr","ownerElement","_onRemoveAttribute","_nsMap","_onAddAttribute","_removeNamedNode","lastIndex","Node","_xmlEncoder","c","charCodeAt","_visitNode","firstChild","nextSibling","Document","_onUpdateChild","newChild","cs","childNodes","child","_removeChild","previous","previousSibling","next","lastChild","isDocTypeNode","nodeType","isElementNode","isTextNode","isElementInsertionPossible","parentChildNodes","docTypeNode","isElementReplacementPossible","assertPreInsertionValidityInDocument","parent","nodeChildNodes","nodeChildElements","parentElementChild","assertPreReplacementValidityInDocument","_insertBefore","_inDocumentAssertion","hasValidParentNodeType","hasInsertableNodeType","assertPreInsertionValidity1to5","cp","removeChild","newFirst","newLast","pre","Element","Attr","CharacterData","Text","Comment","CDATASection","DocumentType","Notation","Entity","EntityReference","DocumentFragment","ProcessingInstruction","XMLSerializer","nodeSerializeToString","isHtml","nodeFilter","buf","refNode","documentElement","lookupPrefix","visibleNamespaces","namespace","serializeToString","join","needNamespaceDefine","ns","addSerializedAttribute","qualifiedName","attributes","nodeName","prefixedNodeName","defaultNS","ai","nsi","slice","pubid","sysid","sub","internalSubset","importNode","deep","node2","cloneNode","n","v","attrs2","_ownerElement","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR","toString","getNamedItem","setNamedItem","setNamedItemNS","getNamedItemNS","removeNamedItem","removeNamedItemNS","hasFeature","feature","version","root","insertBefore","refChild","replaceChild","oldChild","hasChildNodes","appendData","hasAttributes","map","lookupNamespaceURI","isDefaultNamespace","importedNode","getElementById","id","rtv","getAttribute","getElementsByClassName","classNames","classNamesSet","base","nodeClassNames","matches","nodeClassNamesSet","every","createDocumentFragment","createAttribute","specified","createEntityReference","pl","hasAttribute","getAttributeNode","removeAttributeNode","_appendSingleChild","setAttributeNodeNS","removeAttributeNS","old","getAttributeNodeNS","hasAttributeNS","getAttributeNS","setAttributeNS","getElementsByTagName","getElementsByTagNameNS","substringData","offset","count","substring","text","insertData","replaceData","deleteData","splitText","newText","newNode","defineProperty","getTextContent","get","$$length","set","e","amp","apos","gt","lt","quot","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","szlig","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","times","divide","forall","part","exist","empty","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","prop","infin","ang","and","or","cap","cup","there4","sim","cong","asymp","ne","equiv","le","ge","sup","nsub","sube","supe","oplus","otimes","perp","sdot","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega","thetasym","upsih","piv","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","tilde","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","euro","trade","larr","uarr","rarr","darr","harr","crarr","lceil","rceil","lfloor","rfloor","loz","spades","clubs","hearts","diams","nameStartChar","nameChar","RegExp","tagNamePattern","copyLocator","f","parseElementStartPart","currentNSMap","entityReplacer","addAttribute","qname","startIndex","attributeNames","addValue","attrName","s","charAt","setTagName","closed","match","localNSMap","a","nsp","nsPrefix","_copy","parseHtmlSpecialContent","elStartEnd","elEndStart","fixSelfClosed","closeMap","pos","lastIndexOf","parseDCC","end","matchs","exec","lastMatch","endDTD","parseInstruction","ElementAttributes","defaultNSMapCopy","k","surrogate1","surrogate2","fromCharCode","fixedFromCharCode","parseInt","appendText","xt","m","lineEnd","linePattern","lineStart","parseStack","tagStart","config","pop","endMatch","toLowerCase","locator2","max","getLocalName","getUint64","view","DataView","buffer","byteOffset","byteLength","result","flags","Uint8Array","subarray","references","referenceId","getUint32","timescale","earliestPresentationTime","firstOffset","referenceCount","getUint16","referenceType","referencedSize","subsegmentDuration","startsWithSap","sapType","sapDeltaTime","secondsToVideoTs","secondsToAudioTs","videoTsToSeconds","audioTsToSeconds","audioTsToVideoTs","videoTsToAudioTs","metadataTsToSeconds","ONE_SECOND_IN_TS","seconds","sampleRate","timestamp","timelineStartPts","keepOriginalTimestamps","MAX_UINT32","pow","uint8","dv","getBigUint64","Number","MAX_SAFE_INTEGER","decodeResponseBody","err","response","responseBody","statusCode","cause","TextDecoder","charset","contentTypeHeader","headers","contentType","_contentType$split","trim","decode","isFunction","createXHR","httpHandler","parseHeaders","forEach","row","isArray","initParams","params","_createXHR","called","body","getBody","xhr","responseText","responseType","responseXML","firefoxBugTakenEffect","getXml","isJson","JSON","errorFunc","evt","timeoutTimer","failureResponse","loadFunc","aborted","status","useXDR","method","rawRequest","getAllResponseHeaders","cors","XDomainRequest","XMLHttpRequest","sync","json","stringify","onreadystatechange","onload","onerror","onprogress","onabort","ontimeout","open","username","password","withCredentials","timeout","abort","setRequestHeader","obj","isEmpty","beforeSend","send","array","iterator","forEachArray","toUpperCase","globalAdBlock","REQUEST_CONFIG","mode","setupAdBlock","_ref","_asyncToGenerator","_regeneratorRuntime","_callee","_context","prev","fetch","redirected","sent","abrupt","stop","hasAdBlock","showAdBlockBreaker","showErrorMsg","TYPE_OF_MSG","NO_AD","autoPlay","logo","playlistId","calhau","share","sz","full","customAdHash","referrerUrl","externalLinks","debug","debugHash","debugRelated","timerRelated","logoRecord","contextModal","parentUrl","noTitle","endBehavior","_defineProperties","props","descriptor","enumerable","configurable","writable","toPropertyKey","BrowserDetector","instance","Constructor","_classCallCheck","browser","unsupportedBrowsers","Chrome","Firefox","IE","Edge","Opera","Safari","detectBrowser","protoProps","tem","ua","M","appName","appVersion","isIE","isEdge","android","blackberry","windowsMobile","ios","isAndroid","isBlackBerry","isWindowsMobile","isIOS","BOOLEAN_MAP","truthy","falsy","toBoolean","param","includes","isArcEnviroment","isArcLive","arcGeoBlock","dataset","arcGeoblocked","completeWithDefaultParams","playerParams","defaultParams","DEFAULT_PARAMS","newParams","paramToUse","updateParamsFromUrl","urlParams","targetParams","_objectSpread","concat","_toConsumableArray","isBoolean","toNumber","formatTwoDigits","verifyUrl","isSuportedBrowser","isMobile","isChromeAndroid","browserDetector","isChrome","isSafariIos","isSafari","formatDate","date","newDate","Date","getDay","getDate","getMonth","getYear","getFullYear","getFullDate","getHour","getHours","getMinutes","getFullTime","isLiveVideo","Infinity","isLocalhost","location","hostname","isDevelopEnv","isInIframe","disableDefaultAutoplay","querySelectorAll","video","preloadImage","Image","searchToObject","pairs","search","pair","_pair$split","_pair$split2","_slicedToArray","decodeKey","decodeURIComponent","isEmbeded","self","top","formatDurationFromMetadata","durationInSeconds","hour","floor","minute","second","formatedDuration","getAdPlacement","fullDuration","currTime","threshold","postrollThreshold","showChromecastBtn","timer","chromecastBtn","enable","disable","verifyEndCasting","toFixed","getMediaInfo","videoId","locationUrl","link","regExpUrl","qaNumber","reverse","getBaseWebbUrl","href","log","fixUrlProtocol","cleanedUrl","cleanUrl","getEventByContext","isLegacyVideo","tagAttributes","player_url","getRelatedVideos","getVideoId","URL","pathname","fixLegacyUrl","changeCurrentUrl","newUrl","formatedUrl","currentPlayer","modal","modalType","MODAL_CLASS","getDefaultTemplate","buttonLabel","button","ctaButton","outlineIconClass","outlineIcon","outlineContainedClass","outlineContained","template","icon","desc","container","BLOCK","GEO_BLOCK","ERROR","OLD_BROWSER","suggestedContent","createModal","label","fillAlways","temporary","addClass","closeable","showDialog","Quality","Auto","Mute","Unmute","Share","Copy","Copied","Background","Window","White","Black","Red","Green","Blue","Yellow","Magenta","Cyan","Opaque","Transparent","None","Raised","Depressed","Uniform","Dropshadow","Reset","Done","r7player","rawParams","player_params","verifiedParams","paramsToUse","useTrueToUndefinedField","field","ads","timeStamp","fullscreenToggle","dispose","FlashObj","defaultDismiss","IS_IPHONE","plugin","defaults","header","backgroundTimeout","dismiss","errors","headline","initPlugin","monitor","waiting","isStalling","listeners","updateErrors","updates","mergeOptions","resetMonitor","removeClass","disableValues","disableValueMatch","valArray","option","cleanup","shift","off","onPlayStartMonitor","lastTime","check","tech","$","vjs_getProperty","healthcheck","onPlayNoSource","currentSrc","onErrorHandler","details","content","dialogContent","display","errorCode","isTimeoutError","fillWith","reloadButton","dismissButton","reset","close","one","contentEl","okButton","currentWidth","currentHeight","onDisposeHandler","reInitPlugin","newOptions","extend","getAll","disableProgress","VERSION","ERROR_CODES","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED","PLAYER_ERR_NO_SRC","PLAYER_ERR_TIMEOUT","PLAYER_ERR_DOMAIN_RESTRICTED","PLAYER_ERR_GEO_RESTRICTED","PLAYER_ERR_IP_RESTRICTED","MEDIA_ERR_UNKNOWN","mediaError","values","_assertThisInitialized","ReferenceError","QualityLevel","representation","level","width","height","bitrate","bandwidth","frameRate","enabled_","enabled","QualityLevelList","_videojs$EventTarget","subClass","superClass","_this","levels_","selectedIndex_","create","__proto__","_proto","addQualityLevel","qualityLevel","getQualityLevelById","removeQualityLevel","removed","EventTarget","allowedEvents_","change","addqualitylevel","removequalitylevel","qualityLevels","originalPluginFn","qualityLevelList","disposeHandler","_typeof","Symbol","classCallCheck","AwaitValue","AsyncGenerator","gen","front","back","resume","arg","Promise","resolve","settle","done","reject","_invoke","return","asyncIterator","throw","inherits","setPrototypeOf","possibleConstructorReturn","VideoJsButtonClass","VideoJsMenuClass","VideoJsComponent","Dom","ConcreteButton","_VideoJsButtonClass","createItems","createMenu","string","menu","player_","menuButton","hideThreshold_","tabIndex","titleComponent","addItem","items","ConcreteMenuItem","_VideoJsMenuItemClass","qualityButton","selectable","selected","setQuality","HlsQualitySelectorPlugin","getHls","createQualityButton","bindPlayerEvents","IWillNotUseThisInPlugins","hls","onAddQualityLevel","_qualityButton","placementIndex","concreteButtonInstance","componentClass","displayCurrentQuality","setButtonInnerText","vjsIconClass","menuButton_","getQualityMenuItem","levels","levelItems","_loop","_existingItem","levelItem","sort","update","qualityList","_currentQuality","quality","unpressButton","getCurrentQuality","hlsQualitySelector","_this2","onPlayerReady","WIN_PARAMS","encodeParams","encodeURIComponent","getFbFeedUrl","fbAppId","redirectUri","app_id","redirect_uri","fbFeed","getFbShareUrl","hashtag","fbShare","getFbButtonUrl","kid_directed_site","sdk","u","ref","fbButton","gp","mail","share_url","description","imageurl","image","getEmailUrl","to","subject","email","getOkUrl","imageUrl","ok","getTelegramUrl","telegram","getTwUrl","_options$hashtags","hashtags","tw","reddit","pinterest","tumblr","caption","_options$tags","tags","_options$posttype","posttype","canonicalUrl","getViberUrl","viber","VK_MAX_LENGTH","getVkUrl","isVkParse","noparse","vk","getWhatsappUrl","phone","whatsapp","linkedin","summary","messenger","line","mobileVerification","socials","embedCode","createClass","defineProperties","staticProps","ShareButton","_Button","EXCLUDED_SOCIALS","icons","ShareModalContent","social","filterSocials","copyBtnTextClass","socialBtnClass","_createContent","_initToggle","_initClipboard","_initSharing","getContent","copyBtn","wrapper","embedContainer","_getSocialItems","previousElementSibling","textContainer","restore","innerText","clearSelection","MaxTouchPoints","msMaxTouchPoints","parentElement","btns","from","btn","currentTarget","sharingFN","socialOptions","iconsList","innerWidth","style","socialItems","_options","ShareModal","_ModalDialog","playerClassName","ShareOverlay","_Component","_createModal","_Plugin","getPlugin","defaultState","initShareModification","shareButton","eventToUse","wrappers","inputs","iframe","textarea","cols","rows","readOnly","configureShareEmbed","mainSectionUrl","getMetadatas","urlToUse","socialShareWrapper","urlButtonTemplate","insertAdjacentHTML","ClipboardJS","urlBtn","sharedMedia","socialShareTwitter","fragment","createRange","createContextualFragment","replaceChildren","overrideTwitterLogo","clickShareButton","contains","preventDefault","clickEvent","MouseEvent","bubbles","cancelable","dispatchEvent","unused","getEmbedTemplate","initSharePlugin","shareOptions","myModal","OVERLAY_CLASS","suggestedOverlayConfigs","showSuggested","getParams","linkTarget","d","thumb","suggest","reviewattr","reviewBtn","getSuggestedContent","relatedVideos","hasNextVideo","embedUrl","shouldShowRelated","createSuggestedContainer","nextVideoData","isDevEnrionment","NEXT_VIDEO_TIMEOUT","triggerNextVideo","endVideo","endAd","endedAdOnce","toNextVideo","_getParams2","disableAdv","checkEndOfVideo","vjsSuggestedVideos","nextVideo","shouldShowNext","suggestedNextContainer","initSuggestedNextVideo","ima","addContentAndAdsEndedListener","titleOverlayConfigs","ageOverlayConfigs","AGE_RATINGS","L","flag","SELECTORS","isAutoRating","rating","shouldPlayNext","playlistSendMessage","nextVideoSrc","newSrc","postMessage","TAG_TYPE","loadScript","async","scriptTag","rel","head","firstPlay","align","class","showBackground","attachToControlBar","overlays","isNumber","hasNoWhitespace","Overlay","startEvent_","rewindListener_","endEvent_","background","appendContent","args","endListener_","startListener_","shouldHide_","shouldShow_","hasShownSinceSeek_","previousTime_","settings","overlays_","overlay","mapOverlays","o","referenceChild","referenceChildIndex","playerChild","addedOverlays","forcePlayAfterAds","forcePlay","chromecast","protocol","buttonPosition","vjsChromecast","vjsErrorsTreat","vjsErrors","qualityItem","vjsQualitySelector","spriteThumbnails","spriteUrl","sprite_url","interval","vjsSpriteThumbnails","seekButtons","forward","forwardIndex","backIndex","vjsSeekButtons","createSuggestedOverlay","children_","setSuggestedContent","curTime","suggestOverlayContainer","suggestedCloseBtn","initSuggestedOverlay","vjsSuggestedOverlay","vjsSuggestedNext","_getMetadatas","mainSection","sectionPath","_getParams","noLogoClass","linkTemplate","titleLink","overlayTitleContent","vjsTitleOverlay","ageRating","ageRatingDescription","overlayAgeContent","ageRatingToUse","ageClassToUse","ratingToUse","defaultDescriptionText","ageDescriptionToUse","fixedTimeStampStart","$container","$singleIcon","vjsAgeRatingOverlay","originUrlParams","vjsPlaylist","offsetH","offsetV","fadeDelay","opacity","vjsLogo","vjsPauseOnTouch","fullscreen","enterOnRotate","alwaysInLandscapeMode","iOS","landscapeFullscreen","vjsLandscapeOnRotate","allOverlays","vjsOverlayManager","vjsTimeStamp","vjsAutoPlay","shouldLoop","loop","vjsLoop","playerUrl","urlShare","embed","_playerUrl$split","videoUrlSplit","shortened_url","vjsShare","firstplay","startTracking","childNameIndex_","socialBtns","shareButtons","shareTracking","seekBack","seekForward","skipTracking","hasQualityButton","qualityButtons","qualitySet","qualityChangeTracking","fullscreenTracking","pictureInPictureTracking","errorTracking","endTracking","adsManager","google","AdEvent","Type","STARTED","COMPLETE","SKIPPED","evtName","placementValues","adPlacementType","adsData","adTitle","getAd","getTitle","adPlacement","trackAdsEvent","adsEventsTracking","suggested","suggestedTracking","nextTracking","playButton","replayTracking","volumeButton","volumeTracking","metadatas","lastPlaytime","watchedDuration","timestamps","publicationDate","today","formatCreatedDate","subSection","createdDate","createdHour","origin","editoria","subeditoria","product","genre","author","audienceRating","daysPublication","playtime","subtitleOption","classificacao_indicativa","url_parent","selectedIndex","newPlaytime","currentEvent","dataLayer","r7dataLayer","track","cancelEvent","isImmediatePropagationStopped","cancelBubble","isPropagationStopped","prefixEvent","originalEvent","redispatch","isInAdMode","isContentResuming","_contentEnding","handlePlaying","_contentHasEnded","stitchedAds","handleEnded","_hasThereBeenALoadStartDuringPlayerLife","_hasThereBeenALoadedData","_hasThereBeenALoadedMetaData","inAdBreak","contentSrc","handleLoadEvent","handlePlay","tcData","listenToTcf","_","isInFrame","cmpFrame","frame","cmpCallbacks","frames","__tcfapiLocator","ignore","cmd","callId","random","__tcfapiCall","command","parameter","payload","__tcfapiReturn","returnValue","success","proxyTcfApi","uriEncodeIfNeeded","uriEncode","customFields","mediainfo","macros","customFieldsName","fields","fieldNames","adMacroReplacement","customMacros","defaultVal","id_","playlistinfo","getTime","gdprApplies","names","_i","cueTextTracks","processMetadataTrack","tracks","textTracks","setModeAndProcess","kind","setMetadataTrackMode","cue","cueAlreadySeen","cueId","includedCues","setCueAlreadySeen","cancelContentPlay","_shouldBlockPlay","_cancelledPlay","processAdTrack","cues","processCue","cancelAdsHandler","cueData","getSupportedAdCue","isSupportedAdCue","getCueId","videojsReference","isMiddlewareMediatorSupported","IS_IOS","IS_ANDROID","use","middleware","TERMINATOR","playMiddleware","srcObj","callPlay","_playBlocked","terminated","playPromise","catch","IS_SAFARI","testHook","testVjs","States","getState","states_","registerState","StateToRegister","State","_getName","transitionTo","NewState","newState","_state","_len","_key","init","onPlay","onPlaying","onEnded","onAdEnded","onAdsReady","onAdsError","onAdsCanceled","onAdTimeout","onAdStarted","onContentChanged","onContentResumed","onReadyForPostroll","onNoPreroll","onNoPostroll","startLinearAdMode","endLinearAdMode","skipLinearAdMode","isAdState","isWaitingForAdBreak","handleEvent","AdState","_State","contentResuming","waitingForAdBreak","ContentPlayback","_inLinearAdMode","ContentState","BeforePreroll","Preroll","_pausedOnContentupdate","tryToResumeTimeout_","AdsDone","_ContentState","obj$1","shouldTakeSnapshots","snapshot","suppressedTracks","snapshotObject","tech_","currentType","getPlayerSnapshot","shouldPlayContentBehindAd","preAdVolume_","hasClass","removeNativePoster","adType","disableNextSnapshotRestore","trackSnapshot","attempts","restoreTracks","_playPromise","shouldRemoveAutoplay_","tryToResume","videoElementRecycled","restorePlayerSnapshot","_AdState","adsReady","shouldResumeToContent","nopreroll_","resumeAfterNoPreroll","prerollTimeout","_timeout","handleAdsReady","readyForPreroll","afterLoadStart","noPreroll","_this3","_this4","_this5","cleanupPartial","_playRequested","allowVjsAutoplay","Midroll","Postroll","nopostroll_","resumeContent","postrollTimeout","_postrollTimeout","StitchedContentPlayback","StitchedAdRoll","isMiddlewareMediatorSupported$1","VIDEO_EVENTS","getTech","Events","contentIsLive","liveCuePoints","normalizeAutoplay","contribAdsPlugin","videoEvents","eventName","initCancelContentPlay","hasStarted","srcChanged","currentSrcChanged","somePlayer","IOS_VERSION","isAdPlaying","getAds","_seenInitialLoadstart","oldValue","newValue","initializeContentupdate","textTrackChangeHandler","textTrackList","Boolean","Player","hasAdsPlugin","usingContribAdsMiddleware_","register","PlayerWrapper","adsPluginSettings","controller","vjsPlayer","contentTrackingTimer","contentComplete","updateTimeIntervalHandle","updateTimeInterval","seekCheckIntervalHandle","seekCheckInterval","resizeCheckIntervalHandle","resizeCheckInterval","seekThreshold","contentEndedListeners","contentSource","contentSourceType","contentPlayheadTracker","previousTime","seeking","vjsPlayerDimensions","getPlayerWidth","getPlayerHeight","vjsControls","h5Player","setUpPlayerIntervals","boundContentEndedListener","localContentEndedListener","playerDisposedListener","onReadyForPreroll","getSettings","requestMode","requestAds","updateCurrentTime","checkForSeeking","checkForResize","diff","abs","onPlayerResize","onContentComplete","onPlayerDisposed","adTimeoutTimeout","intervalsToClear","onPlayerReadyForPreroll","getPlayerId","setSetting","onVolumeChange","onFullscreenChange","isFullscreen","onPlayerEnterFullscreen","onPlayerExitFullscreen","newVolume","onPlayerVolumeChanged","injectAdContainerDiv","adContainerDiv","getContentPlayer","getVolume","unmute","mute","togglePlayback","getComputedStyle","parseFloat","getBoundingClientRect","getPlayerOptions","toggleFullscreen","exitFullscreen","requestFullscreen","getContentPlayheadTracker","onAdError","adErrorEvent","errorMessage","getError","stack","AdError","AdErrorEvent","onAdLog","adEvent","adData","getAdData","getMessage","onAdBreakStart","onAdBreakEnd","onAdStart","onAllAdsCompleted","onContentAndAdsCompleted","changeSource","seekContentToZero","triggerPlayerEvent","addContentEndedListener","AdUi","controlsDiv","countdownDiv","seekBarDiv","progressDiv","playPauseDiv","muteDiv","sliderDiv","sliderLevelDiv","fullscreenDiv","boundOnMouseUp","onMouseUp","boundOnMouseMove","onMouseMove","adPlayheadTracker","controlPrefix","showCountdown","isAdNonlinear","createAdContainer","assignControlAttributes","zIndex","showAdControls","hideAdControls","onAdContainerClick","createControls","getIsMobile","adLabel","onAdPlayPauseClick","onAdMuteClick","onAdVolumeSliderMouseDown","getIsIos","onAdFullscreenClick","onAdsPaused","sdkImpl","adPlaying","onAdsResumed","onAdsPlaying","updateAdUi","remainingTime","adPosition","totalAds","remainingMinutes","remainingSeconds","podCount","adLabelNofN","playProgressPercent","getPlayerVolume","changeVolume","percent","clientX","left","offsetWidth","showAdContainer","hideAdContainer","getContentType","showControlsForJSAds","currentAd","getCurrentAd","isLinear","onLinearAdStart","onNonLinearAdLoad","disableAdControls","controlName","getClassRegexp","elementHasClass","classToAdd","classToRemove","classRegexp","getAdContainerDiv","setShowCountdown","showCountdownIn","SdkImpl","adDisplayContainer","adDisplayContainerInitialized","adsLoader","adsRenderingSettings","adsResponse","adTrackingTimer","allAdsCompleted","adsActive","adMuted","adBreakReadyListener","contentCompleteCalled","isAdTimedOut","adsManagerDimensions","autoPlayAdBreaks","locale","setLocale","disableFlashAds","setDisableFlashAds","disableCustomPlaybackForIOS10Plus","setDisableCustomPlaybackForIOS10Plus","ppid","setPpid","featureFlags","setFeatureFlags","initAdObjects","AdDisplayContainer","AdsLoader","setVpaidMode","ImaSdkSettings","VpaidMode","ENABLED","vpaidAllowed","DISABLED","vpaidMode","numRedirects","setNumRedirects","sessionId","setSessionId","setPlayerType","setPlayerVersion","setAutoPlayAdBreaks","AdsManagerLoadedEvent","ADS_MANAGER_LOADED","onAdsManagerLoaded","AD_ERROR","onAdsLoaderError","playerWrapper","adsRequest","AdsRequest","adTagUrl","forceNonLinearFullSlot","vastLoadTimeout","omidMode","omidVendorAccess","omidAccessModeRules","omidVendorValues","vendorKey","linearAdSlotWidth","linearAdSlotHeight","nonLinearAdSlotWidth","nonLinearWidth","nonLinearAdSlotHeight","nonLinearHeight","setAdWillAutoPlay","adsWillAutoplay","setAdWillPlayMuted","adsWillPlayMuted","providedAdsRequest","adsManagerLoadedEvent","createAdsRenderingSettings","getAdsManager","AD_BREAK_READY","onAdBreakReady","CONTENT_PAUSE_REQUESTED","onContentPauseRequested","CONTENT_RESUME_REQUESTED","onContentResumeRequested","ALL_ADS_COMPLETED","LOADED","onAdLoaded","onAdComplete","LOG","onAdPaused","RESUMED","onAdResumed","initAdsManager","preventLateAdStart","adsManagerLoadedCallback","onErrorLoadingAds","destroy","initWidth","initHeight","ViewMode","NORMAL","initializeAdDisplayContainer","adError","AdsRenderingSettings","restoreCustomPlaybackStateOnAdBreakComplete","setting","playContent","onAdPlayheadTrackerInterval","onNonLinearAdStart","getRemainingTime","getDuration","getAdPodInfo","getAdPosition","getTotalAds","onAdPlayheadUpdated","getCuePoints","resize","screen","FULLSCREEN","setAdBreakReadyListener","isAdMuted","pauseAds","resumeAds","initialize","playAdBreak","Controller","contentAndAdsEndedListeners","isIos","initWithSettings","contribAdsDefaults","contribAdsSettings","adUi","IMA_DEFAULTS","warnAboutDeprecatedSettings","setContentWithAdTag","adTag","setContentWithAdsResponse","setContentWithAdsRequest","changeAdTag","pauseAd","resumeAd","adWillAutoplay","adWillPlayMuted","PlayerWrapper$2","daiController","onPause","onSeekEnd","isInAdBreak","getStreamPlayer","getVjsPlayer","SdkImpl$2","streamPlayer","streamManager","uiSettings","dai","api","UiSettings","isAdBreak","isSnapback","snapForwardTime","timedMetadata","metadataLoaded","SOURCE_TYPES","dash","initImaDai","createAdUiDiv","StreamManager","adUiDiv","onStreamPause","onStreamPlay","StreamEvent","AD_BREAK_STARTED","AD_BREAK_ENDED","onStreamEvent","onaddtrack","onAddTrack","requestStream","oncuechange","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","activeCues_","onTimedMetadata","uiDiv","previousCuePoint","previousCuePointForStreamTime","played","loadUrl","getStreamData","fallbackStreamUrl","loadurl","streamUrl","streamFormat","bookmarkTime","streamTimeForContentTime","streamRequest","VODStreamRequest","contentSourceId","cmsId","LiveStreamRequest","assetKey","format","apiKey","authToken","adTagParameters","streamActivityMonitorId","omidValues","FULL","OmidAccessMode","DOMAIN","LIMITED","StreamRequest","getStreamManager","DaiController","streamWillAutoplay","ImaPlugin","ImaDaiPlugin","streamEndedListener","addStreamEndedListener","LiveStream","VodStream","stream","imaDai","singleInlineLinear","singleSkippableLinear","vmapPreroll","vmapPrerollBumper","vmapPostroll","vmapPostrollBumper","vmapPrePostSingle","vmapPreMidPost","vmapPreMidPostBumper","vmapPreMidPostBumper5","isIpad","isIPhone","getProdAdTagUrl","hash","r7ad","getAdHash","custParams","profileKey","custom","ttprofiles","age","getAge","gender","getGender","cluster","getProfiles","subjects","getSubjects","team","getTeam","sclass","getSocialClass","msegments","getMicrosegments","customaud","getCustomAudience","setTargeting","now","_getMetadatas2","referrer","descriptionUrl","hasNoIma","startEvent","initAdDisplayContainer","imaAd","proper","imaSampleTags","getAdTagUrl","AdEventType","USER_CLOSE","imaAdEvents","youbora","accountCode","logLevel","Level","DEBUG","setAdapter","Videojs","getResource","comscorePlugin","ComScore","publisherId","contentMetadata","mediaType","classificationTypes","isNaN","getMediaType","uniqueId","getUniqueId","getLength","programTitle","getProgramTitle","defaultEmptyValue","ns_st_ct","ns_st_ci","ns_st_cl","ns_st_st","ns_st_pu","ns_st_pr","ns_st_ep","ns_st_ge","ns_st_ce","ns_st_ty","c3","c4","c6","getContentMetadata","labelName","getPlaybackSession","getAsset","setLabels","query","counter","encode","JSONP","callbackName","parameters","entries","_ref2","script","_document$getElements","_document$getElements2","_split","randomNumber","playerName","playerVersion","playerType","rdm","referrerPlayer","R7Tv","mensagem","path","category","_e$split","categoryName","formatCategories","sendLog","rawMetadata","playerMetadata","thirdSection","sectionName","views","formatedCreatedDate","currentScript","__webpack_public_path__","factory","__webpack_modules__","__unused_webpack_module","clipboard","tiny_emitter","tiny_emitter_default","listen","listen_default","src_select","select_default","execCommand","actions_cut","selectedText","fakeCopyAction","fakeElement","isRTL","fontSize","border","padding","margin","yPosition","pageYOffset","scrollTop","createFakeElement","actions_copy","HTMLInputElement","clipboard_typeof","_setPrototypeOf","_getPrototypeOf","getPrototypeOf","getAttributeValue","suffix","attribute","Clipboard","_Emitter","_inherits","Derived","hasNativeReflectConstruct","_super","Reflect","construct","sham","Proxy","_isNativeReflectConstruct","NewTarget","_possibleConstructorReturn","resolveOptions","listenClick","action","defaultAction","defaultTarget","defaultText","onClick","delegateTarget","_options$action","actions_default","emit","focus","getSelection","removeAllRanges","selector","actions","support","queryCommandSupported","proto","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","__unused_webpack_exports","closest","_delegate","useCapture","listenerFn","elements","HTMLElement","nodeList","is","delegate","listenNode","listenNodeList","listenSelector","isReadOnly","select","setSelectionRange","selection","range","selectNodeContents","addRange","E","ctx","once","evtArr","evts","liveEvents","TinyEmitter","__webpack_module_cache__","moduleId","getter","__esModule","definition","default","___CSS_LOADER_URL_IMPORT_0___","___CSS_LOADER_URL_IMPORT_1___","___CSS_LOADER_EXPORT___","___CSS_LOADER_URL_REPLACEMENT_0___","___CSS_LOADER_URL_REPLACEMENT_1___","cssWithMappingToString","needLayer","modules","dedupe","supports","layer","alreadyImportedModules","_k","needQuotes","cssMapping","btoa","base64","unescape","sourceMapping","doccy","topLevel","g","minDoc","win","alert","confirm","prompt","keyCode","searchInput","hasKeyCode","which","charCode","foundNamedKey","codes","aliases","isEventKey","nameOrCode","alias","reviver","stylesInDOM","getIndexByIdentifier","identifier","modulesToDom","idCountMap","identifiers","indexByIdentifier","css","sourceMap","updater","addElementStyle","byIndex","domAPI","newObj","lastIdentifiers","newList","newLastIdentifiers","_index","memo","insert","styleTarget","HTMLIFrameElement","contentDocument","getTarget","setAttributes","styleElement","nonce","insertStyleElement","styleTagTransform","removeStyleElement","styleSheet","cssText","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","opts","alwaysNormalize","basePartsForNormalise","parseURL","normalizePath","buildURLFromParts","relativeParts","scheme","baseParts","netLoc","pathParts","builtParts","baseURLPath","newPath","parts","_inheritsLoose","_construct","Parent","valueOf","baseUrl","relativeUrl","nativeURL","protocolLess","removeLocation","DEFAULT_LOCATION","Stream","callbacks","_length","pipe","destination","decodeB64ToUint8Array","b64Text","decodedString","Buffer","b","DESCRIPTORS","LineStream","_Stream","nextNewline","TAB","parseByterange","byterangeString","parseAttributes","ParseStream","customParsers","tagMappers","acc","mapper","mappedLine","newLine","tagType","number","playlistType","allowed","URI","BYTERANGE","byterange","RESOLUTION","resolution","BANDWIDTH","dateTimeString","dateTimeObject","IV","Uint32Array","PRECISE","subkey","addParser","expression","customType","dataParser","segment","addTagMapper","camelCaseKeys","setHoldBack","manifest","serverControl","targetDuration","partTargetDuration","tag","hb","phb","minTargetDuration","minPartDuration","Parser","lineStream","parseStream","currentMap","uris","currentUri","hasParts","noop","defaultMediaGroups","currentTimeline","allowCache","discontinuityStarts","segments","lastByterangeEnd","lastPartByterangeEnd","preloadHints","timeline","preloadSegment","entry","mediaGroup","rendition","endlist","endList","inf","mediaSequence","discontinuitySequence","METHOD","KEYFORMAT","contentProtection","KEYID","schemeIdUri","keyId","pssh","iv","isFinite","playlist","playlists","mediaGroups","TYPE","NAME","mediaGroupType","DEFAULT","autoselect","AUTOSELECT","LANGUAGE","language","instreamId","CHARACTERISTICS","characteristics","FORCED","forced","discontinuity","targetduration","timeOffset","precise","cueOut","cueOutCont","cueIn","skip","warnOnMissingAttributes_","segmentIndex","partIndex","renditionReports","r","canBlockReload","canSkipDateranges","hint","isPart","otherHint","report","required","partInf","partTarget","missing","chunk","regexs","mp4","webm","ogg","audio","muxerVideo","muxerAudio","muxerText","mediaTypes","upperMediaTypes","translateLegacyCodec","codec","orig","profile","avcLevel","parseCodecs","codecString","codecs","codecType","isAudioCodec","getMimeForCodec","browserSupportsCodec","isTypeSupported","muxerSupportsCodec","DEFAULT_AUDIO_CODEC","MPEGURL_REGEX","DASH_REGEX","simpleTypeFromSourceType","isArrayBufferView","ArrayBuffer","isView","bytes","BigInt","BYTE_TABLE","Uint16Array","_temp","_ref$signed","signed","_ref$le","total","byte","exponent","stringToBytes","stringIsBytes","_temp3","_ref3","_ref3$offset","_ref3$mask","mask","bByte","isObject","merge","objects","flatten","lists","x","y","findIndex","matchingFunction","urlTypeToSegment","_ref$baseUrl","_ref$source","_ref$range","_ref$indexRange","indexRange","resolvedUri","ranges","startRange","endRange","parseEndNumber","endNumber","segmentRange","_attributes$timescale","sourceDuration","periodDuration","segmentDuration","dynamic","NOW","clientOffset","availabilityStartTime","_attributes$timescale2","_attributes$periodSta","periodStart","_attributes$minimumUp","minimumUpdatePeriod","_attributes$timeShift","timeShiftBufferDepth","periodStartWC","segmentCount","ceil","availableStart","availableEnd","parseByDuration","_attributes$timescale4","_segmentRange$type","_attributes$timescale3","_attributes$startNumb","startNumber","toSegments","sectionDuration","segmentsFromBase","_attributes$initializ","initialization","_attributes$indexRang","presentationTime","_attributes$number","initSegment","sourceURL","segmentTimeInfo","addSidxSegmentsToPlaylist$1","sidx","sidxByteRange","sidxEnd","mediaReferences","endIndex","reference","size","SUPPORTED_MEDIA_TYPES","getUniqueTimelineStarts","timelineStarts","keyFunction","getMediaGroupPlaylists","master","mediaGroupPlaylists","properties","group","groupKey","labelKey","mediaProperties","updateMediaSequenceForPlaylist","generateSidxKey","mergeDiscontiguousPlaylists","_acc$name$segments","addSidxSegmentsToPlaylist","sidxMapping","sidxKey","sidxMatch","addSidxSegmentsToPlaylists","formatVideoPlaylist","_attributes2","AUDIO","SUBTITLES","CODECS","videoOnly","_ref4","audioOnly","_ref5","vttOnly","_ref6","flattenMediaGroupPlaylists","mediaGroupObject","labelContents","toM3u8","_ref8","_mediaGroups","dashPlaylists","locations","_ref8$sidxMapping","previousManifest","_dashPlaylists$0$attr","suggestedPresentationDelay","videoPlaylists","audioPlaylists","vttPlaylists","captions","captionServices","VIDEO","oldManifest","newManifest","oldPlaylists","newPlaylists","isAudioOnly","organizedAudioGroup","mainPlaylist","formattedPlaylists","role","roleLabel","formatted","_attributes","formatAudioPlaylist","organizeAudioPlaylists","organizedVttGroup","_m3u8Attributes","m3u8Attributes","formatVttPlaylist","organizeVttPlaylists","playlistTimelineStarts","_ref9","_ref7","subs","cc","svcObj","svc","service","channel","aspectRatio","easyReader","oldPlaylist","findPlaylistWithName","firstNewSegment","oldMatchingSegmentIndex","oldSegment","unshift","updateSequenceNumbers","getLiveRValue","parseByTimeline","segmentTimeline","_attributes$minimumUp2","_attributes$media","sIndex","S","repeat","segmentTime","nextS","identifierPattern","constructTemplateUrl","identifierReplacement","segmentsFromTemplate","templateValues","RepresentationID","Bandwidth","mapSegment","parseTemplateInfo","Time","presentationTimeOffset","segmentsFromList","_attributes$segmentUr","segmentUrls","segmentUrlMap","segmentUrlObject","segmentUrl","mediaRange","SegmentURLToSegmentObject","generateSegments","segmentAttributes","segmentsFn","segmentInfo","segmentsInfo","_segmentAttributes","_segmentAttributes$ti","findChildren","parseDuration","_match$slice","year","month","day","parsers","mediaPresentationDuration","parsedValue","parseFn","keySystemsMap","buildBaseUrls","referenceUrls","baseUrlElements","baseUrlElement","getSegmentInformation","adaptationSet","segmentTemplate","segmentList","segmentBase","segmentTimelineParentNode","segmentInitializationParentNode","segmentInitialization","toAdaptationSets","mpdAttributes","mpdBaseUrls","period","periodBaseUrls","periodAttributes","adaptationSets","periodSegmentInfo","adaptationSetAttributes","adaptationSetBaseUrls","roleAttributes","accessibility","_value$split","_value$split2","_value$split2$","opt","_opt$split","val","labelVal","keySystem","psshNode","representations","adaptationSetSegmentInfo","repBaseUrlElements","repBaseUrls","representationSegmentInfo","inheritBaseUrls","toRepresentations","stringToMpdXml","manifestString","mpd","parser","ID3","getId3Offset","returnSize","getId3Size","parseDescriptors","results","headerSize","z","_DESCRIPTORS$z","dependsOnEsId","ocrEsId","descriptors","escape","oti","bufferSize","maxBitrate","avgBitrate","findBox","paths","complete","normalizePaths","EBML_TAGS","EBML","DocType","Segment","SegmentInfo","Tracks","Track","TrackNumber","DefaultDuration","TrackEntry","TrackType","FlagDefault","CodecID","CodecPrivate","VideoTrack","AudioTrack","Cluster","Timestamp","TimestampScale","BlockGroup","BlockDuration","Block","SimpleBlock","LENGTH_TABLE","getvint","removeLength","valueBytes","_temp2","_ref2$le","byteCount","countBits","byteIndex","numberToBytes","getInfinityDataSize","innerid","dataHeader","findEbml","dataStart","dataEnd","NAL_TYPE_ONE","NAL_TYPE_TWO","EMULATION_PREVENTION","discardEmulationPreventionBytes","positions","newLength","newData","sourceIndex","findNal","dataType","types","nalLimit","nalStart","nalsFound","nalOffset","nalType","CONSTANTS","_isLikely","aac","mp3","docType","mkv","matroska","mov","fmp4","moof","moov","ac3","ts","flac","avi","riff","wav","findH264Nal","findH265Nal","isLikelyTypes","isLikelyFn","browserApi","isLikely","detectContainerForBytes","version$5","hooks_","hooks","removeHook","FullscreenApi","prefixed","apiMap","specApi","log$1","createLogger$1","logByType","lvl","lvlRegExp","info","LogByTypeFactory","createLogger","subname","all","history","fname","historyItem","clear","_len2","_key2","_len3","_key3","_len4","_key4","each","isPlain","computedStyle","computedStyleValue","getPropertyValue","USER_AGENT","webkitVersionMap","appleWebkitVersion","IS_IPOD","ANDROID_VERSION","major","minor","IS_NATIVE_ANDROID","IS_FIREFOX","IS_EDGE","IS_CHROME","CHROME_VERSION","IE_VERSION","IS_WINDOWS","TOUCH_ENABLED","isReal","maxTouchPoints","IS_IPAD","IS_ANY_SAFARI","isNonBlankString","throwIfWhitespace","isEl","createQuerier","getOwnPropertyNames","propName","prependTo","classToCheck","toggleClass","classToToggle","has","attrValue","getAttributes","attrVal","blockTextSelection","unblockTextSelection","rect","findPosition","offsetParent","offsetHeight","fullscreenElement","offsetLeft","offsetTop","getPointerPosition","translated","transform","_values","boxTarget","box","boxW","boxH","offsetY","offsetX","changedTouches","pageX","pageY","emptyEl","normalizeContent","insertContent","isSingleLeftClick","buttons","videojs$1","$$","_windowLoaded","autoSetup","vids","audios","divs","mediaEls","mediaEl","autoSetupTimeout","wait","vjs","setWindowLoaded","FakeWeakMap","createStyleElement","setTextContent","_guid","newGUID","vdata","access","_supportsPassive","DomData","WeakMap","_cleanUpEvents","elem","handlers","dispatcher","detachEvent","disabled","_handleMultipleEvents","fixEvent","fixed_","returnTrue","returnFalse","srcElement","relatedTarget","fromElement","toElement","defaultPrevented","stopPropagation","stopImmediatePropagation","scrollLeft","clientLeft","clientY","clientTop","supportsPassive","passiveEvents","guid","handlersCopy","passive","attachEvent","removeType","elemData","targetData","func","any","EVENT_MAP","UPDATE_REFRESH_INTERVAL","uid","bound","throttle","last","EventTarget$2","ael","queueTrigger","Map","oldTimeout","objName","name_","isEvented","eventBusEl_","isValidEventType","validateTarget","fnName","validateEventType","validateListener","normalizeListenArgs","isTargetingSelf","EventedMixin","_normalizeListenArgs","removeListenerOnDispose","removeRemoverOnTargetDispose","_normalizeListenArgs2","largs","_normalizeListenArgs3","_len5","_key5","targetOrType","typeOrListener","evented","eventBusKey","eventedCallbacks","StatefulMixin","state","setState","stateUpdates","changes","stateful","handleStateChanged","w","toTitleCase$1","mergeOptions$3","MapSham","map_","thisArg","Map$1","SetSham","set_","Set$1","Component$1","Component","isDisposed_","parentComponent_","handleLanguagechange","childIndex_","setTimeoutIds_","setIntervalIds_","rafIds_","namedRafs_","clearingTimersOnDispose_","initChildren","reportTouchActivity","enableTouchActivity","readyQueue_","restoreEl","isDisposed","tokens","defaultValue","languages","primaryCode","primaryLang","localizedString","ret","contentEl_","getChildById","getDescendant","currentChild","component","componentName","componentClassName","ComponentClass","childFound","compEl","workingChildren","parentOptions","some","wchild","isTech","playerOptions","isReady_","readyQueue","lockShowing","unlockShowing","num","skipListeners","dimension","dimensions","widthOrHeight","pxIndex","currentDimension","computedWidthOrHeight","rule","currentDimensions","blur","handleKeyDown","handleKeyPress","emitTapEvents","couldBeTap","touchStart","firstTouch","touches","xdiff","ydiff","sqrt","noTap","reportUserActivity","touchHolding","touchEnd","timeoutId","clearTimersOnDispose_","intervalId","requestAnimationFrame","supportsRaf_","requestNamedAnimationFrame","cancelNamedAnimationFrame","cancelAnimationFrame","_this6","idName","cancelName","ComponentToRegister","isComp","isPrototypeOf","components_","players","playerNames","pname","getRange","valueIndex","rangeIndex","maxIndex","rangeCheck","createTimeRangesObj","timeRangesObj","createTimeRanges","bufferedPercent","bufferedDuration","MediaError","defaultMessages","errorTypes","errNum","isPromise","silencePromise","trackToJson_","endTime","MODAL_CLASS_NAME","ModalDialog","handleKeyDown_","close_","opened_","hasBeenOpened_","hasBeenFilled_","uncloseable","descEl_","previouslyActiveEl_","fill","wasPlaying_","pauseOnOpen","hadControls_","conditionalFocus_","opened","conditionalBlur_","closeable_","temp","parentEl","nextSiblingEl","closeButton","content_","activeEl","playerEl","focusIndex","focusableEls","focusableEls_","shiftKey","allChildren","TrackList","_EventTarget","tracks_","addTrack","labelchange_","removeTrack","rtrack","getTrackById","addtrack","removetrack","labelchange","disableOthers$1","AudioTrackList","_TrackList","changing_","enabledChange_","disableOthers","VideoTrackList","selectedChange_","TextTrackList","queueChange_","triggerSelectedlanguagechange","triggerSelectedlanguagechange_","selectedlanguagechange_","HtmlTrackElementList","trackElements","trackElements_","addTrackElement_","trackElement","getTrackElementByTrack_","trackElement_","removeTrackElement_","TextTrackCueList","setCues_","length_","oldLength","cues_","defineProp","getCueById","VideoTrackKind","alternative","main","sign","subtitles","commentary","AudioTrackKind","TextTrackKind","descriptions","chapters","TextTrackMode","hidden","showing","trackProps","newLabel","parseUrl","host","getAbsoluteURL","getFileExtension","isCrossOrigin","winLoc","urlInfo","Url","parseCues","srcContent","StringDecoder","oncue","addCue","onparsingerror","onflush","groupCollapsed","groupEnd","flush","loadTrack","crossOrigin","loaded_","TextTrack","_Track","srclang","default_","preload_","preloadTextTracks","activeCues","changed","timeupdateHandler","rvf_","requestVideoFrameCallback","stopTracking","newMode","ct","active","cancelVideoFrameCallback","originalCue","VTTCue","originalCue_","removeCue","_removeCue","cuechange","newEnabled","newSelected","HTMLTrackElement","NONE","LOADING","ListClass","TrackClass","capitalName","getterName","privateName","REMOTE","remoteText","remoteTextEl","ALL","onDurationChange_","onDurationChange","trackProgress_","trackProgress","trackCurrentTime_","trackCurrentTime","stopTrackingCurrentTime_","stopTrackingCurrentTime","disposeSourceHandler_","disposeSourceHandler","queuedHanders_","Set","hasStarted_","manualProgressOn","manualTimeUpdatesOn","nativeCaptions","nativeTextTracks","emulateTextTracks","autoRemoteTextTracks_","initTrackListeners","nativeControlsForTouch","triggerSourceset","manualProgress","manualProgressOff","stopTrackingProgress","progressInterval","numBufferedPercent","bufferedPercent_","duration_","manualTimeUpdates","manualTimeUpdatesOff","currentTimeInterval","manuallyTriggered","clearTracks","removeRemoteTextTrack","cleanupAutoTextTracks","setCrossOrigin","error_","setScrubbing","scrubbing","trackListChanges","addWebVttScript_","remoteTracks","remoteTextTracks","handleAddTrack","handleRemoveTrack","updateDisplay","textTracksChanges","addTextTrack","createTrackHelper","createRemoteTextTrack","addRemoteTextTrack","manualCleanup","_this7","htmlTrackElement","remoteTextTrackEls","getVideoPlaybackQuality","requestPictureInPicture","PromiseClass","disablePictureInPicture","setDisablePictureInPicture","cb","_this8","setPlaysinline","overrideNativeAudioTracks","overrideNativeVideoTracks","canPlayType","techs_","defaultTechOrder_","featuresMuteControl","featuresSourceset","featuresVideoFrameCallback","withSourceHandlers","_Tech","registerSourceHandler","handler","sourceHandlers","can","selectSourceHandler","canHandleSource","sh","originalFn","sourceHandler_","nativeSourceHandler","currentSource_","handleSource","middlewares","middlewareInstances","setSourceHelper","mediate","callMethod","middlewareValue","middlewareIterator","mws","mw","executeRight","allowedGetters","allowedSetters","allowedMediators","lastRun","_middleware","mwFactory","mwrest","_mws$i","mwf","mwi","getOrCreateFactory","_src","MimetypesKind","opus","ogv","m4v","m4a","caf","oga","m3u8","jpg","jpeg","gif","png","svg","webp","getMimetype","ext","filterSource","newsrc","srcobj","fixSource","mimetype","MediaLoader","j","techOrder","techName","loadTech_","ClickableComponent","handleMouseOver_","handleMouseOver","handleMouseOut_","handleMouseOut","handleClick_","tabIndex_","createControlTextEl","controlTextEl_","controlText_","localizedText","nonIconControl","noUITitleAttributes","clickHandler","PosterImage","_ClickableComponent","update_","setSrc","backgroundImage","sourceIsEncrypted","usingPlugin","eme","sessions","darkGray","fontMap","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif","casual","smallcaps","constructColor","color","hex","tryUpdateStyle","TextTrackDisplay","updateDisplayHandler","toggleDisplay","preselectTrack","firstDesc","firstCaptions","preferredTrack","modes","trackList","userPref","cache_","selectedLanguage","clearDisplay","processCues","allowMultipleShowingTracks","showingTracks","updateForTrack","descriptionsTrack","captionsSubtitlesTrack","_track","updateDisplayState","overrides","textTrackSettings","getValues","cueDiv","displayState","textOpacity","backgroundColor","backgroundOpacity","windowColor","windowOpacity","edgeStyle","textShadow","fontPercent","fontFamily","fontVariant","_i2","_track2","_j","cueEl","LoadingSpinner","isAudio","dir","Button","BigPlayButton","mouseused_","handleMouseDown","playToggle","playFocus","CloseButton","PlayToggle","replay","handlePause","handleSeeked","defaultImplementation","guide","h","gm","gh","formatTime","TimeDisplay","updateContent","updateTextNode_","span","labelText_","textNode_","formattedTime_","oldNode","CurrentTimeDisplay","_TimeDisplay","getCache","DurationDisplay","TimeDivider","div","RemainingTimeDisplay","displayNegative","remainingTimeDisplay","LiveDisplay","updateShowing","SeekToLive","updateLiveEdgeStatus","updateLiveEdgeStatusHandler_","textEl_","atLiveEdge","seekToLiveEdge","clamp","Slider","handleMouseDown_","handleMouseUp_","handleMouseUp","handleMouseMove_","handleMouseMove","bar","barName","vertical","playerEvent","progress","getProgress","progress_","sizeKey","getPercent","calculateDistance","stepBack","stepForward","bool","vertical_","percentify","LoadProgressBar","partEls_","loadedText","separator","percentageEl_","seekableEnd","bufferedEnd","percent_","TimeTooltip","seekBarRect","seekBarPoint","tooltipRect","playerRect","seekBarPointPx","spaceLeftOfPoint","spaceRightOfPoint","right","pullTooltipBy","round","write","updateTime","liveWindow","secondsBehind","PlayProgressBar","timeTooltip","MouseTimeDisplay","SeekBar","_Slider","setEventHandlers_","updateInterval","enableIntervalHandler_","enableInterval_","disableIntervalHandler_","disableInterval_","toggleVisibility_","getCurrentTime_","liveCurrentTime","currentTime_","userSeek_","nextSeekedFromUser","seekableStart","videoWasPlaying","mouseDown","newTime","distance","mouseTimeDisplay","handleAction","gotoFraction","STEP_SECONDS","ProgressControl","throttledHandleMouseSeek","handleMouseSeek","handleMouseUpHandler_","handleMouseDownHandler_","seekBar","playProgressBar","seekBarEl","removeListenersAddedOnMousedownAndTouchstart","PictureInPictureToggle","handlePictureInPictureChange","handlePictureInPictureEnabledChange","audioPosterMode","audioOnlyMode","isInPictureInPicture","exitPictureInPicture","FullscreenToggle","handleFullscreenChange","fsApi_","fullscreenEnabled","VolumeLevel","VolumeLevelTooltip","rangeBarRect","rangeBarPoint","volumeBarPointPx","updateVolume","MouseVolumeLevelDisplay","bottom","VolumeBar","updateLastVolume_","updateARIAAttributes","mouseVolumeLevelDisplay","volumeBarEl","volumeBarRect","volumeBarPoint","checkMuted","ariaValue","volumeAsPercentage_","volumeBeforeDrag","lastVolume_","VolumeControl","volumeBar","checkVolumeSupport","throttledHandleMouseMove","orientationClass","MuteToggle","checkMuteSupport","vol","lastVolume","volumeToSet","updateIcon_","updateControlText_","VolumePanel","inline","volumeControl","handleKeyPressHandler_","volumePanelState_","muteToggle","handleVolumeControlKeyUp","sliderActive_","sliderInactive_","Menu","focusedChild_","boundHandleBlur_","handleBlur","boundHandleTapClick_","handleTapClick","addEventListenerForItem","removeEventListenerForItem","childComponent","contentElType","append","buttonPressed_","childComponents","foundComponent","stepChild","MenuButton","buttonClass","handleMenuKeyUp_","handleMenuKeyUp","handleMouseLeave","handleSubmenuKeyDown","buildWrapperCSSClass","menuButtonClass","pressButton","handleSubmenuKeyPress","TrackButton","_MenuButton","updateHandler","MenuKeys","MenuItem","isSelected_","multiSelectable","_selected","TextTrackMenuItem","_MenuItem","kinds","changeHandler","handleTracksChange","selectedLanguageChangeHandler","handleSelectedLanguageChange","onchange","initEvent","referenceTrack","shouldBeSelected","OffTextTrackMenuItem","_TextTrackMenuItem","allHidden","TextTrackButton","_TrackButton","TrackMenuItem","label_","kinds_","kind_","ChaptersTrackMenuItem","ChaptersButton","_TextTrackButton","selectCurrentItem_","track_","findChaptersTrack","setTrack","updateHandler_","remoteTextTrackEl","_remoteTextTrackEl","getMenuCaption","mi","DescriptionsButton","SubtitlesButton","CaptionSettingsMenuItem","CaptionsButton","SubsCapsMenuItem","parentSpan","SubsCapsButton","language_","AudioTrackMenuItem","audioTracks","AudioTrackButton","PlaybackRateMenuItem","rate","PlaybackRateMenuButton","labelElId_","updateVisibility","updateLabel","handlePlaybackRateschange","labelEl_","rates","playbackRates","currentRate","newIndex","playbackRateSupported","Spacer","CustomControlSpacer","_Spacer","ControlBar","ErrorDisplay","LOCAL_STORAGE_KEY$1","COLOR_BLACK","COLOR_BLUE","COLOR_CYAN","COLOR_GREEN","COLOR_MAGENTA","COLOR_RED","COLOR_WHITE","COLOR_YELLOW","OPACITY_OPAQUE","OPACITY_SEMI","OPACITY_TRANS","selectConfigs","parseOptionValue","TextTrackSettings","endDialog","setDefaults","persistTextTrackSettings","saveSettings","restoreSettings","createElSelect_","legendId","selectLabelledbyIds","optionId","createElFgColor_","createElBgColor_","createElWinColor_","createElColors_","createElFont_","createElControls_","defaultsDescription","initial","accum","setValues","setSelectedOption","getItem","setItem","removeItem","ttDisplay","subsCapsBtn","subsCapsButton","ccBtn","captionsButton","ResizeManager","RESIZE_OBSERVER_AVAILABLE","ResizeObserver","loadListener_","resizeObserver_","debouncedHandler_","immediate","debounced","_later","cancel","debounce","resizeHandler","observe","contentWindow","unloadListener_","unobserve","disconnect","resizeObserver","trackingThreshold","liveTolerance","LiveTracker","handleVisibilityChange_","handleVisibilityChange","trackLiveHandler_","trackLive_","handlePlay_","handleFirstTimeupdate_","handleFirstTimeupdate","handleSeeked_","seekToLiveEdge_","reset_","handleDurationchange","toggleTracking","deltaTime","lastTime_","pastSeekEnd_","pastSeekEnd","isBehind","seekedBehindLive_","timeupdateSeen_","behindLiveEdge_","liveui","isTracking","trackingInterval_","timeDiff","nextSeekedFromUser_","lastSeekEnd_","seekableEnds","seekableStarts","behindLiveEdge","sourcesetLoad","srcUrls","innerHTMLDescriptorPolyfill","dummy","docFrag","getDescriptor","priority","getOwnPropertyDescriptor","firstSourceWatch","resetSourceWatch_","innerDescriptor","getInnerHTMLDescriptor","appendWrapper","appendFn","retval","srcDescriptorPolyfill","defineLazyProperty","setter","Html5","crossoriginTracks","initNetworkState_","handleLateInit_","enableSourceset","setupSourcesetHandling_","isScrubbing_","nodes","nodesLength","removeNodes","proxyNativeTracks_","restoreMetadataTracksInIOSNativePlayer_","setControls","proxyWebkitFullscreen_","resetSourceset_","disposeMediaElement","srcDescriptor","getSrcDescriptor","oldSetAttribute","oldLoad","setupSourceset","metadataTracksPreFullscreenState","takeMetadataTrackSnapshot","storedMode","restoreTrackMode","storedTrack","overrideNative_","override","lowerCaseType","proxyNativeTracksForType_","elTracks","techTracks","removeOldTracks","removeTracks","found","playerElIngest","clone","techId","settingsAttrs","networkState","loadstartFired","setLoadstartFired","triggerLoadstart","eventsToTrigger","isScrubbing","fastSeek","checkProgress","NaN","endFn","beginFn","webkitPresentationMode","nativeIOSFullscreen","webkitEnterFullScreen","enterFullScreen","HAVE_METADATA","exitFullScreen","webkitDisplayingFullscreen","webkitExitFullScreen","webkitKeys","resetMediaElement","videoPlaybackQuality","webkitDroppedFrameCount","webkitDecodedFrameCount","droppedVideoFrames","totalVideoFrames","creationTime","timing","navigationStart","TEST_VID","canControlVolume","canControl","canMuteVolume","canControlPlaybackRate","canOverrideAttributes","supportsNativeTextTracks","supportsNativeVideoTracks","videoTracks","supportsNativeAudioTracks","patchCanPlayType","unpatchCanPlayType","TECH_EVENTS_RETRIGGER","TECH_EVENTS_QUEUE","canplay","canplaythrough","playing","seeked","BREAKPOINT_ORDER","BREAKPOINT_CLASSES","DEFAULT_BREAKPOINTS","tiny","xsmall","small","medium","large","xlarge","huge","getTagSettings","boundDocumentFullscreenChange_","documentFullscreenChange_","boundFullWindowOnEscKey_","fullWindowOnEscKey","boundUpdateStyleEl_","updateStyleEl_","boundApplyInitTime_","applyInitTime_","boundUpdateCurrentBreakpoint_","updateCurrentBreakpoint_","boundHandleTechClick_","handleTechClick_","boundHandleTechDoubleClick_","handleTechDoubleClick_","boundHandleTechTouchStart_","handleTechTouchStart_","boundHandleTechTouchMove_","handleTechTouchMove_","boundHandleTechTouchEnd_","handleTechTouchEnd_","boundHandleTechTap_","handleTechTap_","isFullscreen_","isPosterFromTech_","queuedCallbacks_","userActive_","debugEnabled_","audioOnlyMode_","audioPosterMode_","audioOnlyCache_","playerHeight","hiddenChildren","languagesToLower","languages_","resetCache_","poster_","controls_","changingSrc_","playCallbacks_","playTerminatedQueue_","plugins","scrubbing_","fullscreenchange","fluid_","playerOptionsCopy","middleware_","flexNotSupported_","majorVersion","userActive","listenForUserActivity_","handleStageClick_","breakpoints","responsive","styleEl_","playerElIngest_","divEmbed","tabindex","defaultsStyleEl","fill_","fluid","crossorigin","links","linkEl","techGet_","techCall_","_dimension","privDimension","parsedVal","ratio","aspectRatio_","idClass","ratioParts","videoWidth","videoHeight","ratioMultiplier","width_","height_","_width","_height","techEl","unloadTech_","titleTechName","camelTechName","techName_","techOptions","techCanOverridePoster","TechClass","handleTechReady_","textTracksJson_","addedTrack","eventObj","handleTechLoadStart_","handleTechSourceset_","handleTechWaiting_","handleTechEnded_","handleTechSeeking_","handleTechPlay_","handleTechFirstPlay_","handleTechPause_","handleTechDurationChange_","handleTechFullscreenChange_","handleTechFullscreenError_","handleTechEnterPictureInPicture_","handleTechLeavePictureInPicture_","handleTechError_","handleTechPosterChange_","handleTechTextData_","handleTechRateChange_","usingNativeControls","addTechControlsListeners_","trackEls","trackObjs","trackEl","safety","removeTechControlsListeners_","manualAutoplay_","promise","resolveMuted","previouslyMuted","restoreMuted","mutedPromise","updateSourceCaches_","matchingSources","findMimetype","sourceElSources","sourceEls","matchingSourceEls","sourceObj","updateSourceCaches","playerSrc","eventSrc","lastSource_","techSrc","techGet","lastPlaybackRate","queued","timeWhenWaiting","timeUpdateListener","handleTechCanPlay_","handleTechCanPlayThrough_","handleTechPlaying_","handleTechSeeked_","starttime","userActions","click","doubleClick","userWasActive","toggleFullscreenClass_","targetPlayer","isFs","_this9","togglePictureInPictureClass_","initTime","inactivityTimeout","defaultPlaybackRate","reduceRight","_this10","play_","_this11","isSrcReady","waitToPlay_","runPlayTerminatedQueue_","runPlayCallbacks_","queue","q","percentAsDecimal","_muted","defaultMuted","_defaultMuted","isFS","fullscreenOptions","offHandler","requestFullscreenHelper_","fsOptions","_this12","preferFullWindow","enterFullWindow","exitFullscreenHelper_","_this13","exitFullWindow","isFullWindow","docOrigOverflow","overflow","isPiP","isInPictureInPicture_","hotkeys","activeElement","isContentEditable","handleHotkeys","_hotkeys$fullscreenKe","fullscreenKey","keydownEvent","_hotkeys$muteKey","muteKey","_hotkeys$playPauseKey","playPauseKey","FSToggle","selectSource","foundSourceAndTech","_this14","techs","findFirstPassingTechSourcePair","outerArray","innerArray","tester","outerChoice","innerChoice","finder","sourceOrder","handleSrc_","isRetry","_this15","resetRetryOnError_","middlewareSource","src_","notSupportedMessage","setTech","retryOnError","retry","stopListeningForErrors","str1","str2","_this16","sourceTech","_this17","doReset_","resetControlBarUI_","resetProgressBar_","resetPlaybackRate_","resetVolumeBar_","durationDisplay","techAutoplay","newPoster","usingNativeControls_","_this18","hookFunction","newErr","suppressNotSupportedError","triggerSuppressedError","errorDisplay","userActivity_","mouseInProgress","lastMoveX","lastMoveY","handleActivity","handleMouseUpAndMouseLeave","screenX","screenY","isAudio_","enableAudioOnlyUI_","_this19","playerChildren","controlBarHeight","disableAudioOnlyUI_","_this20","exitPromises","enablePosterModeUI_","disablePosterModeUI_","_this21","toJSON","_this22","currentBreakpoint","candidateBreakpoint","breakpoints_","breakpoint_","removeCurrentBreakpoint_","currentBreakpointClass","_breakpoints","responsive_","_this23","_this$cache_$media","artwork","tt","getMedia","baseOptions","tagOptions","dataSetup","_safeParseTuple","childName","previousLogLevel_","newRates","html5","userLanguage","navigationUI","BASE_PLUGIN_NAME","PLUGIN_CACHE_KEY","pluginStorage","pluginExists","markPluginAsActive","triggerSetupEvent","before","createPluginFactory","PluginSubClass","getEventHash","Plugin","isBasic","basicPluginWrapper","createBasicPlugin","deregisterPlugin","getPlugins","getPluginVersion","hasPlugin","normalizeId","getPlayer","defaultView","PlayerComponent","hook","hookOnce","original","getPlayers","nId","_tag","_player","getAllPlayers","comp","writeable","subClassMethods","methods","super_","addLanguage","_mergeOptions","setFormatTime","customImplementation","resetFormatTime","resolveManifestRedirect","handleManifestRedirect","req","responseURL","logger","TIME_FUDGE_FACTOR","SAFE_TIME_DELTA","filterRanges","timeRanges","findRange","findNextRange","printableRange","strArr","timeRangesToArray","timeRangesList","lastBufferedEnd","timeAheadOf","segmentDurationWithParts","getPartsAndSegments","si","getLastParts","lastSegment","getKnownPartCount","liveEdgeDelay","partHoldBack","holdBack","intervalDuration","endSequence","expired","backward","backwardDuration","forwardDuration","totalDuration","sumDurations","defaultDuration","durationList","durations","playlistEnd","useSafeLiveEnd","liveEdgePadding","lastSegmentEndTime","isBlacklisted","excludeUntil","isIncompatible","isEnabled","blacklisted","isLowestEnabledRendition","currentBandwidth","MAX_VALUE","playlistMatch","someAudioVariant","groupName","variant","_ret","Playlist","getMediaInfoForTime","startingSegmentIndex","startingPartIndex","experimentalExactManifestTimings","partsAndSegments","partAndSegment","_partAndSegment","_i3","_i4","_partAndSegment2","isDisabled","isAes","estimateSegmentRequestTime","bytesReceived","createPlaylistID","setupMediaPlaylist","playlistErrors_","addPropertiesToMaster","phonyUri","audioOnlyMaster","groupId","setupMediaPlaylists","resolveMediaGroupUris","mergeOptions$2","EventTarget$1","updateSegment","skipped","resolveSegmentUris","baseUri","getAllSegments","isPlaylistUnchanged","updateMaster$1","newMedia","unchangedCheck","oldMedia","mergedPlaylist","skippedSegments","oldSegments","newSegments","newSegment","updateSegments","refreshDelay","lastPart","lastDuration","PlaylistLoader","vhs","logger_","_options$withCredenti","_options$handleManife","handleManifestRedirects","vhs_","vhsOptions","customTagParsers","customTagMappers","experimentalLLHLS","handleMediaupdatetimeout_","nextMSN","nextPart","_HLS_part","_HLS_msn","canSkipUntil","_HLS_skip","parsedUri","searchParams","addLLHLSQueryDirectives","playlistRequestError","haveMetadata","playlistString","startingState","parseManifest_","onwarn","oninfo","_ref$customTagParsers","_ref$customTagMappers","customParser","parseManifest","playlistObject","lastRequest","pendingMedia_","media_","updateMediaUpdateTimeout_","stopRequest","mediaUpdateTimeout","finalRenditionTimeout","oldRequest","shouldDelay","delay","mediaChange","masterPlaylistRef","started","setupInitialPlaylist","srcUri","masterForMedia","videojsXHR","mergeOptions$1","callbackWrapper","reqResponse","responseTime","roundTripTime","requestTime","responseHeaders","timedout","xhrFactory","XhrFunction","beforeRequest","Vhs","originalAbort","segmentXhrHeaders","Range","textRange","formatHexString","formatAsciiString","createTransferableMessage","transferable","initSegmentId","segmentKeyId","hexDump","step","utils","tagDump","textRanges","seekToProgramTime","programTime","_ref2$retryCount","retryCount","seekTo","_ref2$pauseAfterSeek","pauseAfterSeek","verifyProgramDateTimeTags","matchedSegment","videoTimingInfo","lastSegmentStart","lastSegmentDuration","transmuxedPresentationEnd","transmuxedPresentationStart","transmuxerPrependedSeconds","estimatedStart","findSegmentForProgramTime","mediaOffset","comparisonTimeStamp","segmentDateTime","programDateTime","segmentTimeEpoch","getOffsetFromTimestamp","seekToTime","callbackOnCompleted","dashPlaylistUnchanged","aSegment","bSegment","aByterange","bByterange","equivalentSidx","compareSidxEntry","oldSidxMapping","newSidxMapping","currentSidxInfo","savedSidxInfo","sidxInfo","DashPlaylistLoader","srcUrlOrPlaylist","masterPlaylistLoader","masterPlaylistLoader_","isMaster_","refreshXml_","refreshMedia_","loadedPlaylists_","srcUrl","sidxMapping_","childPlaylist_","requestErrored_","addSidxSegments_","fin","id3Offset","finished","endRequestAndCallback","_bytes","progressListener","newPart","buffers","totalLen","tempBuffer","concatTypedArrays","overrideMimeType","loaded","containerRequest","internal","blacklistDuration","_playlist$sidx$bytera","mediaRequest_","minimumUpdatePeriodTimeout_","createMupOnMedia_","hasPendingRequest","sidxChanged","isFinalRendition","updateMinimumUpdatePeriodTimeout_","requestMaster_","masterChanged","haveMaster_","masterXml_","masterLoaded_","handleMaster_","syncClientServerClock_","utcTiming","UTCTimingNode","parseUTCTimingScheme","clientOffset_","serverTime","oldMaster","newMaster","parsedManifestInfo","_options$manifestUri","manifestUri","_options$NOW","_options$clientOffset","periodNodes","periods","priorPeriod","priorPeriodAttributes","mpdType","getPeriodStart","representationInfo","inheritAttributes","masterXml","noChanges","playlistUpdate","_playlistUpdate","updateMaster","mpl","mup","createMUPTimeout_","mediaGroupSidx","mediaID","mediaChanged","createMediaUpdateTimeout","Config","GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","BACK_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","INITIAL_BANDWIDTH","BANDWIDTH_VARIANCE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BUFFER_HIGH_WATER_LINE","browserWorkerPolyFill","workerObj","objectUrl","createObjectURL","Blob","blob","BlobBuilder","getBlob","worker","Worker","objURL","terminate","revokeObjectURL","getWorkerString","workerCode$1","flushSource","partialFlush","endTimeline","dinf","esds","ftyp","mfhd","minf","mvex","mvhd","trak","tkhd","mdia","mdhd","hdlr","sdtp","stbl","stsd","traf","trex","trun$1","MAJOR_BRAND","MINOR_VERSION","AVC1_BRAND","VIDEO_HDLR","AUDIO_HDLR","HDLR_TYPES","VMHD","SMHD","DREF","STCO","STSC","STSZ","STTS","videoSample","audioSample","audioTrun","videoTrun","trunHeader","MAX_UINT32$1","numbers","avc1","avcC","btrt","dref","mdat","mp4a","pasp","smhd","stco","stsc","stsz","stts","styp","tfdt","tfhd","trun","vmhd","setUint32","audioobjecttype","samplingfrequencyindex","channelcount","samplerate","sequenceNumber","trackFragments","boxes","samples","dependsOn","isDependedOn","hasRedundancy","avc1Box","sps","pps","sequenceParameterSets","pictureParameterSets","profileIdc","profileCompatibility","levelIdc","sarRatio","hSpacing","vSpacing","samplesize","trackFragmentHeader","trackFragmentDecodeTime","trackFragmentRun","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","baseMediaDecodeTime","durationPresent","sizePresent","flagsPresent","compositionTimeOffset","bytesOffest","sample","isLeading","paddingValue","isNonSyncSample","degradationPriority","silence","mp4Generator","sampleForFrame","dataOffset","pts","dts","keyFrame","highPrefix","lowPrefix","zeroFill","ONE_SECOND_IN_TS$4","clock","audioFrameUtils","audioAppendStartTs","videoBaseMediaDecodeTime","baseMediaDecodeTimeTs","frameDuration","silentFrame","firstFrame","audioGapDuration","audioFillFrameCount","audioFillDuration","coneOfSilence","metaTable","arr","silence_1","trackDecodeInfo","minSegmentDts","maxSegmentDts","minSegmentPts","maxSegmentPts","timelineStartInfo","CaptionStream$1","CaptionStream","parse708captions_","parse708captions","captionPackets_","ccStreams_","Cea608Stream","cc708Stream_","Cea708Stream","sei","userData","newCaptionPackets","nalUnitType","payloadType","payloadSize","captionPacketParser","escapedRBSP","latestDts_","ignoreNextEqualDts_","numSameDts_","ccData","flushCCStreams","flushType","flushStream","idx","presortIndex","packet","dispatchCea608Packet","dispatchCea708Packet","activeCea608Channel_","ccStream","setsTextOrXDSActive","setsChannel1Active","setsChannel2Active","CHARACTER_TRANSLATION_708","within708TextBlock","Cea708Window","windowNum","clearText","pendingNewLine","winAttr","penAttr","penLoc","penColor","visible","rowLock","columnLock","relativePositioning","anchorVertical","anchorHorizontal","anchorPoint","rowCount","virtualRowCount","columnCount","windowStyle","penStyle","getText","rowIdx","beforeRowOverflow","addText","backspace","Cea708Service","serviceNum","encoding","currentWindow","windows","createTextDecoder","startPts","setCurrentWindow","textDecoder_","serviceProps","captionServiceEncodings","serviceName","serviceEncodings","current708Packet","services","new708Packet","add708Bytes","push708Packet","ptsVals","byte0","byte1","packet708","packetData","blockSize","seq","sizeCode","pushServiceBlock","initService","handleText","multiByteCharacter","extendedCommands","defineWindow","clearWindows","deleteWindows","displayWindows","hideWindows","toggleWindows","setWindowAttributes","setPenAttributes","setPenColor","setPenLocation","isExtended","getPts","flushDisplayed","_char","charCodeArray","newCode","isMultiByte","extended","currentByte","nextByte","firstByte","secondByte","fillOpacity","fillRed","fillGreen","fillBlue","borderType","borderRed","borderGreen","borderBlue","wordWrap","printDirection","scrollDirection","justify","effectSpeed","effectDirection","displayEffect","displayedText","winId","endPts","pushCaption","textTag","penSize","italics","underline","edgeType","fontStyle","fgOpacity","fgRed","fgGreen","fgBlue","bgOpacity","bgRed","bgGreen","bgBlue","edgeRed","edgeGreen","edgeBlue","column","CHARACTER_TRANSLATION","getCharFromCode","ROWS","createDisplayBuffer","BOTTOM_ROW","dataChannel","field_","dataChannel_","setConstants","swap","char0","char1","lastControlCode_","PADDING_","RESUME_CAPTION_LOADING_","mode_","END_OF_CAPTION_","clearFormatting","displayed_","nonDisplayed_","startPts_","ROLL_UP_2_ROWS_","rollUpRows_","setRollUp","ROLL_UP_3_ROWS_","ROLL_UP_4_ROWS_","CARRIAGE_RETURN_","shiftRowsUp_","BACKSPACE_","row_","ERASE_DISPLAYED_MEMORY_","ERASE_NON_DISPLAYED_MEMORY_","RESUME_DIRECT_CAPTIONING_","isSpecialCharacter","column_","isExtCharacter","isMidRowCode","addFormatting","isOffsetControlCode","isPAC","formatting_","isColorPAC","isNormalChar","topRow_","BASE_","EXT_","CONTROL_","OFFSET_","_char2","newBaseRow","popOn","baseRow","rollUp","paintOn","captionStream","streamTypes","H264_STREAM_TYPE","ADTS_STREAM_TYPE","METADATA_STREAM_TYPE","TYPE_SHARED","handleRollover$1","direction","TimestampRolloverStream$1","TimestampRolloverStream","lastDTS","referenceDTS","type_","_MetadataStream","timestampRolloverStream","percentEncode$1","parseUtf8","parseSyncSafeInteger$1","tagParsers","TXXX","WXXX","PRIV","owner","privateData","tagSize","dispatchType","frameStart","frameSize","dataAlignmentIndicator","_TransportPacketStream","_TransportParseStream","_ElementaryStream","metadataStream","MP2T_PACKET_LENGTH$1","bytesInBuffer","everything","parsePsi","parsePat","parsePmt","packetsWaitingForPmt","programMapTable","payloadUnitStartIndicator","pat","section_number","last_section_number","pmtPid","pmt","tableEnd","pid","processPes_","STREAM_TYPES","h264","adts","segmentHadPmt","forceFlush","packetFlushable","trackId","pes","ptsDtsFlags","startPrefix","packetLength","flushStreams_","m2ts","PAT_PID","MP2T_PACKET_LENGTH","TransportPacketStream","TransportParseStream","ElementaryStream","MetadataStream","_AdtsStream","m2ts_1","ADTS_SAMPLING_FREQUENCIES$1","handlePartialSegments","frameNum","skipWarn_","frameLength","protectionSkipBytes","oldBuffer","sampleCount","adtsFrameDuration","_H264Stream","_NalByteStream","PROFILES_WITH_OPTIONAL_SPS_DATA","expGolomb","workingData","workingBytesAvailable","workingWord","workingBitsAvailable","bitsAvailable","loadWord","workingBytes","availableBytes","skipBits","skipBytes","readBits","bits","valu","skipLeadingZeros","leadingZeroCount","skipUnsignedExpGolomb","skipExpGolomb","readUnsignedExpGolomb","clz","readExpGolomb","readBoolean","readUnsignedByte","syncPoint","swapBuffer","currentPts","currentDts","readSequenceParameterSet","skipScalingList","nalByteStream","nalUnitTypeCode","expGolombDecoder","lastScale","nextScale","emulationPreventionBytesPositions","chromaFormatIdc","picOrderCntType","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","_AacStream","H264Stream","NalByteStream","ADTS_SAMPLING_FREQUENCIES","parseId3TagSize","parseSyncSafeInteger","isLikelyAacData","parseAdtsSize","lowThree","middle","parseType","parseSampleRate","parseAacTimestamp","percentEncode","setTimestamp","bytesLeft","tempLength","_VideoSegmentStream","_AudioSegmentStream","_Transmuxer","_CoalesceStream","audioProperties","videoProperties","retriggerForStream","addPipelineLogRetriggers","transmuxer","pipeline","arrayEquals","generateSegmentTimingInfo","startDts","endDts","prependedContentDuration","adtsFrames","earliestAllowedDts","firstSequenceNumber","setEarliestDts","earliestDts","setVideoBaseMediaDecodeTime","setAudioAppendStart","videoClockCyclesOfSilencePrefixed","currentFrame","sumFrameByteLengths","ONE_SECOND_IN_TS$1","nalUnits","gopsToAlignWith","minPTS","gopCache_","nalUnit","gopForFusion","gops","firstGop","lastGop","resetStream_","currentNal","nalCount","frameUtils","currentGop","getGopForFusion_","alignedGops","alignGopsAtEnd","alignGopsAtEnd_","alignGopsAtStart_","gop","baseDataOffset","nalsByteLength","numberOfNals","dtsDistance","nearestGopObj","currentGopObj","nearestDistance","alignIndex","gopIndex","alignEndIndex","matchFound","trimIndex","alignGopsWith","newGopsToAlignWith","numberOfTracks","remux","remuxTracks","pendingTracks","videoTrack","pendingBoxes","pendingCaptions","pendingMetadata","pendingBytes","emittedTracks","output","audioTrack","id3","captionStreams","fileType","movie","cueTime","setRemux","hasFlushed","transmuxPipeline_","setupAacPipeline","aacStream","audioTimestampRolloverStream","timedMetadataTimestampRolloverStream","adtsStream","coalesceStream","headOfPipeline","audioSegmentStream","getLogTrigger_","hasAudio","hasVideo","setupTsPipeline","packetStream","elementaryStream","h264Stream","videoSegmentStream","id3Frame","setBaseMediaDecodeTime","isAac","resetCaptions","getTracks","getTimescaleFromMediaHeader","Transmuxer","VideoSegmentStream","AudioSegmentStream","AUDIO_PROPERTIES","VIDEO_PROPERTIES","bin","parseType_1","toUnsigned$2","findBox_1","subresults","toUnsigned$1","getUint64$1","parseSampleFlags_1","commonjsGlobal","globalThis","window_1","mapToSample","approximateOffset","parseCaptionNals","videoTrackId","trafs","mdats","captionNals","mdatTrafPairs","matchingTraf","headerInfo","baseDataOffsetPresent","sampleDescriptionIndexPresent","defaultSampleDurationPresent","defaultSampleSizePresent","defaultSampleFlagsPresent","durationIsEmpty","defaultBaseIsMoof","sampleDescriptionIndex","defaultSampleDuration","defaultSampleSize","defaultSampleFlags","baseDataOffsetIsMoof","parseTfhd","parseTfdt","truns","allSamples","dataOffsetPresent","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleFlagsPresent","sampleCompositionTimeOffsetPresent","getInt32","parseTrun","parseSamples","avcStream","seiNal","lastMatchedSample","avcView","logs","seiNals","matchingSample","findSeiNals","captionParser","segmentCache","parsedCaptions","parsingPartial","isInitialized","isPartial","isNewInit","videoTrackIds","timescales","parsedData","cachedSegment","trackNals","parseEmbeddedCaptions","pushNals","nals","nal","clearParsedCaptions","resetCaptionStream","clearAllCaptions","toUnsigned","toHexString","lowestTime","baseTime","scale","traks","tkhdVersion","getUint8","sampleDescriptions","codecConfig","codecBox","probe$2","parsePid","parsePayloadUnitStartIndicator","parseAdaptionField","parseNalUnitType","probe$1","pusi","payloadOffset","parsePesType","parsePesTime","videoPacketContainsKeyFrame","frameBuffer","frameI","frameSyncPoint","foundKeyFrame","handleRollover","probe","SYNC_BYTE","parseAudioPes_","pesType","parsed","endLoop","table","parseVideoPes_","firstKeyFrame","tsInspector","baseTimestamp","audioCount","audioTimescale","inspectAac_","parsePsi_","inspectTs_","audioBaseTimestamp","dtsTime","ptsTime","videoBaseTimestamp","adjustTimestamp_","MessageHandlers","initArray","typedArray","gopInfo","timingInfo","videoSegmentTimingInfo","audioSegmentTimingInfo","trackInfo","audioTimingInfo","wireTransmuxerEvents","pushMp4Captions","trackIds","probeMp4StartTime","probeMp4Tracks","probeTs","baseStartTime","tsStartTime","timeInfo","videoStart","audioStart","clearAllMp4Captions","clearParsedMp4Captions","setTimestampOffset","timestampOffset","appendStart","onmessage","messageHandlers","TransmuxWorker","processTransmux","audioAppendStart","onData","onTrackInfo","onAudioTimingInfo","onVideoTimingInfo","onVideoSegmentTimingInfo","onAudioSegmentTimingInfo","onId3","onCaptions","onDone","onEndedTimeline","onTransmuxerLog","isEndOfTimeline","transmuxedData","waitForEndedTimelineEvent","currentTransmux","_event$data$segment","videoFrameDtsTime","videoFramePtsTime","handleData_","handleGopInfo_","handleDone_","dequeue","transmuxQueue","processAction","segmentTransmuxer","enqueueAction","workerCallback","endAction","listenForEndEvent","isArrayBuffer","transfers","REQUEST_ERRORS","abortAll","activeXhrs","handleErrors","handleKeyResponse","finishProcessingFn","errorObj","parseInitSegment","_callback","transmuxAndNotify","trackInfoFn","timingInfoFn","videoSegmentTimingInfoFn","audioSegmentTimingInfoFn","id3Fn","captionsFn","endedTimelineFn","dataFn","doneFn","fmp4Tracks","isMuxed","audioStartFn","audioEndFn","videoStartFn","videoEndFn","probeResult","transmux","id3Frames","handleSegmentBytes","bytesAsUint8Array","isLikelyFmp4MediaSegment","isFmp4","audioCodec","videoCodec","finishLoading","decrypt","keyBytes","encryptedBytes","decryptionWorker","decryptionHandler","decrypted","encrypted","mediaSegmentRequest","_ref12","xhrOptions","abortFn","progressFn","didError","segmentFinish","requestId","decryptedBytes","decryptSegment","endOfAllRequests","parseError","waitForCompletion","keyXhr","mapKeyXhr","initSegmentOptions","initSegmentRequestCallback","handleInitSegmentResponse","initSegmentXhr","segmentRequestOptions","segmentXhr","newBytes","stringToArrayBuffer","lastReachedChar","stats","getRequestStats","handleSegmentResponse","_ref11","progressEvent","firstBytesReceivedAt","handleProgress","loadendState","activeXhr","_ref10","calledAbortFn","handleLoadEnd","logFn$1","isMaat","mediaAttributes","unwrapCodecList","codecList","codecCount","codecObj","codecsForPlaylist","codecInfo","getCodecs","audioGroup","defaultCodecs","audioGroupId","audioType","codecsFromDefault","logFn","representationToString","safeGetComputedStyle","property","stableSort","sortFn","newArray","cmp","comparePlaylistBandwidth","leftBandwidth","rightBandwidth","simpleSelector","playerBandwidth","playerWidth","limitRenditionByPlayerDimensions","masterPlaylistController","getAudioTrackPlaylists_","sortedPlaylistReps","enabledPlaylistReps","rep","bandwidthPlaylistReps","highestRemainingBandwidthRep","bandwidthBestRep","_chosenRep","haveResolution","resolutionBestRepList","resolutionPlusOneList","resolutionPlusOneSmallest","resolutionPlusOneRep","leastPixelDiffRep","resolutionBestRep","experimentalLeastPixelDiffSelector","leastPixelDiffList","pixelDiff","chosenRep","_type","lastBandwidthSelector","pixelRatio","useDevicePixelRatio","systemBandwidth","masterPlaylistController_","removeCuesFromTrack","finite","MIN_SEGMENT_DURATION_TO_SAVE_STATS","segmentInfoString","startOfSegment","_segmentInfo$playlist","_segmentInfo$playlist2","mediaIndex","segmentLen","isSyncRequest","independent","hasPartIndex","zeroBasedPartCount","timingInfoPropertyForMedia","shouldWaitForTimelineChange","timelineChangeController","loaderType","audioDisabled","lastMainTimelineChange","lastTimelineChange","pendingAudioTimelineChange","pendingTimelineChange","segmentTooLong","maxDuration","SegmentLoader","mediaSource","throughput","roundTrip","resetStats_","hasPlayed_","hasPlayed","seekable_","seeking_","mediaSource_","loaderType_","currentMediaInfo_","startingMediaInfo_","segmentMetadataTrack_","segmentMetadataTrack","goalBufferLength_","goalBufferLength","sourceType_","sourceType","sourceUpdater_","sourceUpdater","inbandTextTracks_","inbandTextTracks","state_","timelineChangeController_","shouldSaveSegmentTimingInfo_","useDtsForTimestampOffset_","useDtsForTimestampOffset","captionServices_","checkBufferTimeout_","currentTimeline_","pendingSegment_","xhrOptions_","pendingSegments_","audioDisabled_","isPendingTimestampOffset_","gopBuffer_","timeMapping_","safeAppend_","appendInitSegment_","playlistOfLastInitSegment_","callQueue_","loadQueue_","metadataQueue_","waitingOnRemove_","quotaExceededErrorRetryTimeout_","activeInitSegmentId_","initSegments_","cacheEncryptionKeys_","cacheEncryptionKeys","keyCache_","decrypter_","decrypter","syncController_","syncController","syncPoint_","transmuxer_","createTransmuxer_","triggerSyncInfoUpdate_","isEndOfStream_","ended_","fetchAtBuffer_","hasEnoughInfoToAppend_","processCallQueue_","hasEnoughInfoToLoad_","processLoadQueue_","term","mediaBytesTransferred","mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaSecondsLoaded","mediaAppends","abort_","setAudio","removeAudio","monitorBuffer_","abortRequests","clearPendingTimelineChange","checkForAbort_","_error","endOfStream","buffered_","getMediaInfo_","videoBuffered","audioBuffered","initSegmentForMap","storedMap","segmentKey","storedKey","couldBeginLoading_","playlist_","init_","resetEverything","newPlaylist","syncInfo","setDateTimeMappingForStart","oldId","resyncLoader","resetLoader","mediaSequenceDiff","saveExpiredSegmentInfo","force","removesRemaining","removeFinished","mapping","updatedBuffer","removeGopBuffer","removeVideo","monitorBufferTick_","fillBuffer_","updating","chooseNextRequest_","loadSegment_","appendedLastSegment","appendedLastPart","bufferedTime","preloaded","haveEnoughBuffer","getSyncPoint","targetTime","timelineSegments","getSyncSegmentCandidate","_Playlist$getMediaInf","_partIndex","nextSegment","lastSegmentLastPart","generateSegmentInfo_","forceTimestampOffset","overrideCheck","timestampOffsetForSegment_","audioBufferedEnd","audioTimestampOffset","currentTimePts","gopsSafeToAlignWith","videoTimestampOffset","earlyAbortWhenNeeded_","measuredBandwidth","requestTimeRemaining","timeUntilRebuffer$1","timeUntilRebuffer","switchCandidate","compatiblePlaylists","enabledPlaylists","rebufferingEstimates","numRequests","rebufferingImpact","noRebufferingPlaylists","estimate","minRebufferMaxBandwidthSelector","timeSavedBySwitching","minimumTimeSaving","handleAbort_","handleProgress_","simpleSegment","handleTrackInfo_","checkForIllegalMediaSwitch","akeys","bkeys","shallowEqual","handleTimingInfo_","timeType","timingInfoProperty","handleCaptions_","captionData","hasAppendedData_","captionTracks","captionTrack","trackName","_captionTracks$trackN","def","captionService","createCaptionsTrackIfNotExists","captionArray","Cue","addCaptionData","handleId3_","metadataTrack_","inBandMetadataTrackDispatchType","createMetadataTrackIfNotExists","metadataArray","videoDuration","metadataTrack","deprecateOldCue","cuesArray","cuesGroupedByStartTime","timeSlot","sortedStartTimes","cueGroup","nextTime","addMetadata","processMetadataQueue_","callQueue","fun","loadQueue","getCurrentMediaInfo_","setTimeMapping_","updateMediaSecondsLoaded_","firstVideoFrameTimeForData","useVideoTimingInfo","trueSegmentStart_","currentStart","currentVideoTimestampOffset","updateAppendInitSegmentStatus","updateSourceBufferTimestampOffset_","updateTimingInfoEnd_","saveSegmentTimingInfo","shouldSaveTimelineMapping","appendData_","changedTimestampOffset","getInitSegmentAndUpdateState_","handleQuotaExceededError_","audioBufferStart","audioBufferEnd","videoBufferStart","videoBufferEnd","appendToSourceBuffer_","timeToRemoveUntil","MIN_BACK_BUFFER","handleAppendError_","segmentObj","appendBuffer","handleSegmentTimingInfo_","segmentTimingInfo","transmuxedDecodeStart","transmuxedDecodeEnd","trimBackBuffer_","updateTransmuxerAndRequestSegment_","shouldUpdateTransmuxerTimestampOffset_","createSimplifiedSegmentObj_","isEndOfStream","isWalkingForward","isDiscontinuity","segmentRequestFinished_","removeToTime","trimTime","maxTrimTime","safeBackBufferTrimTime","previousSegment","saveTransferStats_","saveBandwidthRelatedStats_","handleTimeout_","updateGopBuffer","waitForAppendsToComplete_","timelineMapping","mappingForTimeline","waitForVideo","waitForAudio","waitingOnAppends","checkAppendsDone_","videoQueueCallback","audioQueueCallback","handleAppendsDone_","illegalMediaSwitchError","startingMedia","illegalMediaSwitch","didChange","getSegmentStartTimeForTimestampOffsetCalculation_","prioritizedTimingInfo","segmentDurationMessage","timingInfos","typeTimingInfo","isSegmentWayTooLong","isSegmentSlightlyTooLong","segmentTooLongMessage","severity","getTroublesomeSegmentDurationMessage","recordThroughput_","addSegmentMetadataCue_","badSegmentGuess","badPartGuess","segmentProcessingTime","segmentProcessingThroughput","Vhs$1","toTitleCase","bufferTypes","_updating","sourceBuffer","queuePending","shiftQueue","queueIndex","queueEntry","nextQueueIndexOfType","cleanupBuffer","titleType","inSourceBuffers","sourceBuffers","onError","mime","addSourceBuffer","removeSourceBuffer","changeType","pushQueue","onUpdateend","SourceUpdater","sourceopenListener_","audioTimestampOffset_","videoTimestampOffset_","delayedAudioAppendQueue_","videoAppendQueued_","onVideoUpdateEnd_","onAudioUpdateEnd_","onVideoError_","videoError_","onAudioError_","audioError_","createdSourceBuffers_","initializedEme_","triggeredReady_","initializedEme","hasCreatedSourceBuffers","hasInitializedAnyEme","createSourceBuffers","addOrChangeSourceBuffers","canRemoveSourceBuffer","canChangeType","processedAppend_","videoBuffer","que","audioBuffer","bufferA","bufferB","arity","extents","bufferIntersection","setDuration","_duration","uint8ToUtf8","uintArray","VTT_LINE_TERMINATORS","_char3","VTTSegmentLoader","_SegmentLoader","subtitlesTrack_","featuresNativeTextTracks_","combinedByteLength","combinedSegment","timestampOffsetForTimeline","skipEmptySegments_","stopForError","loadHandler","requested","parseVTTCues_","updateTimeMapping_","timelines","duplicates","occurrences","dupe","removeDuplicateCuesFromTrack","decoder","decodeBytesToString","timestampmap","MPEGTS","LOCAL","ontimestampmap","mapData","segmentData","mappingObj","firstStart","lastStart","findAdCue","mediaTime","adStartTime","adEndTime","syncPointStrategies","run","timelineToDatetimeMappings","lastDistance","datetimeMapping","discontinuitySync","discontinuities","SyncController","syncPoints","runStrategies_","selectSyncPoint_","getExpiredTime","strategy","bestSyncPoint","bestDistance","bestStrategy","newDistance","lastRemovedSegment","firstSegment","playlistTimestamp","didCalculateSegmentTimeMapping","calculateSegmentTimeMapping_","saveDiscontinuitySyncInfo_","dateTime","accuracy","mediaIndexDiff","TimelineChangeController","pendingTimelineChanges_","lastTimelineChanges_","workerCode","createCommonjsModule","basedir","require","commonjsRequire","inheritsLoose","aesTables","AES","tmp","xInv","x2","x4","tEnc","tDec","tables","encTable","decTable","sbox","sboxInv","th","precompute","_tables","keyLen","rcon","encKey","decKey","encrypted0","encrypted1","encrypted2","encrypted3","out","a2","b2","c2","nInnerRounds","kIndex","table0","table1","table2","table3","AsyncStream","jobs","timeout_","processJob_","job","ntoh","word","Decrypter","initVector","STEP","encrypted32","Int32Array","asyncStream_","decryptChunk_","padded","init0","init1","init2","init3","wordIx","decipher","decrypted32","audioTrackKind_","stopLoaders","segmentLoader","activePlaylistLoader","startLoaders","playlistLoader","segmentLoaders","blacklistCurrentPlaylist","activeTrack","activeGroup","defaultTrack","onTrackChanged","setupListeners","requestOptions","_settings$mediaTypes$","groups","variantLabel","isMasterPlaylist","_settings$mediaTypes$2","_settings$mediaTypes$3","newProps","groupMatch","loaderStats","sumLoaderStat","stat","audioSegmentLoader_","mainSegmentLoader_","MasterPlaylistController","externVhs","useCueTags","enableLowInitialPlaylist","experimentalBufferBasedABR","maxPlaylistRetries","useCueTags_","cueTagsTrack_","requestOptions_","pauseLoading","mediaTypes_","getActiveGroup","onGroupChanged","lastTrack_","createMediaTypes","handleDurationChange_","handleSourceOpen_","handleSourceEnded_","segmentLoaderSettings","setupMasterPlaylistLoaderListeners_","subtitleSegmentLoader_","setupSegmentLoaderListeners_","startABRTimer_","stopABRTimer_","triggeredFmp4Usage","loadOnPlay_","timeToLoadedData__","mainAppendsToLoadedData__","audioAppendsToLoadedData__","timeToLoadedDataStart","mainAppendsToLoadedData_","audioAppendsToLoadedData_","appendsToLoadedData_","timeToLoadedData_","checkABR_","nextPlaylist","selectPlaylist","shouldSwitchToMedia_","switchMedia_","newId","abrTimer_","defaultPlaylists","groupKeys","defaultGroup","requestTimeout","_settings$segmentLoad3","audioSegmentLoader","mainSegmentLoader","variants","groupPropertyList","_settings$segmentLoad","previousActiveLoader","lastGroup","lastGroup_","onGroupChanging","_settings$segmentLoad2","lastTrack","mpc","fastQualityChange_","activeTrack_","onAudioTrackChanged","setupMediaGroups","triggerPresenceUsage_","setupFirstPlay","updatedPlaylist","selectedMedia","excludeUnsupportedVariants_","selectInitialPlaylist","initialMedia_","handleUpdatedMediaPlaylist","lastExcludeReason_","stuckAtPlaylistEnd_","reason","updateAdCues_","updateDuration","defaultDemuxed","audioGroupKeys","currentPlaylist","bufferLowWaterLine","bufferHighWaterLine","sharedLogLine","isBuffered","forwardBuffer","maxBufferLowWaterLine","nextBandwidth","currBandwidth","logLine","_logLine","shouldSwitchToMedia","onSyncInfoUpdate_","onEndOfStream","delegateLoaders_","updateCodecs","tryToCreateSourceBuffers_","getCodecsOrExclude_","mediaSecondsLoaded_","smoothQualityChange_","mainMediaInfo","absolutePlaylistEnd","reincluded","delayDuration","fnNames","loaders","dontFilterPlaylist","loader","audioSeekable","mainSeekable","oldEnd","oldStart","updateDuration_","areMediaTypesKnown_","usingAudioLoader","hasMainMediaInfo","hasAudioMediaInfo","playlistCodecs","unsupportedAudio","unsupportedCodecs","supporter","switchMessages","newCodec","oldCodec","excludeIncompatibleVariants_","ids","unsupported","codecCount_","videoDetails","audioDetails","blacklistReasons","variantCodecs","variantCodecCount","variantVideoDetails","variantAudioDetails","_segment$cueOutCont$s","adOffset","adTotal","updateAdCues","newMax","Representation","vhsHandler","playlistID","changePlaylistFn","qualityChangeFunction","smoothQualityChange","incompatible","currentlyEnabled","timerCancelEvents","PlaybackWatcher","allowSeeksWithinUnsafeLiveWindow","liveRangeSafeTimeDelta","consecutiveUpdates","lastRecordedTime","timer_","checkCurrentTimeTimeout_","playHandler","monitorCurrentTime_","canPlayHandler","waitingHandler","techWaiting_","cancelTimerHandler","cancelTimer_","loaderTypes","loaderChecks","resetSegmentDownloads_","updateend","checkSegmentDownloads_","setSeekingHandlers","seekingAppendCheck_","fixesBadSeeks_","clearSeekingAppendCheck_","watchForBadSeeking_","checkCurrentTime_","isBufferedDifferent","isRangeDifferent","waiting_","afterSeekableWindow_","beforeSeekableWindow_","minAppendedDuration","bufferedToCheck","nextRange","currentRange","livePoint","videoUnderflow_","difference","skipTheGap_","allowedEnd","gap","lastVideoRange","videoRange","audioRange","gapFromVideoUnderflow_","scheduledCurrentTime","gaps","findGaps","defaultOptions","errorInterval","getSource","lastCalled","localOptions","loadedMetadataHandler","cleanupEvents","reloadSourceOnError","version$4","STANDARD_PLAYLIST_SELECTOR","INITIAL_PLAYLIST_SELECTOR","movingAverageBandwidthSelector","decay","average","lastSystemBandwidth","comparePlaylistResolution","leftWidth","rightWidth","LOCAL_STORAGE_KEY","handleVhsMediaChange","getVhsLocalStorage","storedObject","supportsNativeHls","canItPlay","supportsNativeDash","supportsTypeNatively","VhsHandler","initialBandwidth","source_","ignoreNextSeekingEvent_","setOptions_","overrideNative","useBandwidthFromLocalStorage","useNetworkInformationApi","dataUri","playbackWatcherOptions","playbackWatcher_","defaultSelector","playerBandwidthEst","networkInformation","connection","mozConnection","webkitConnection","tenMbpsAsBitsPerSecond","networkInfoBandwidthEstBitsPerSec","downlink","invThroughput","invBandwidth","mediaRequests_","mediaRequestsAborted_","mediaRequestsTimedout_","mediaRequestsErrored_","mediaTransferDuration_","mediaBytesTransferred_","mediaAppends_","mainAppendsToLoadedData","audioAppendsToLoadedData","appendsToLoadedData","timeToLoadedData","currentTech","playerDimensions","objectToStore","updateVhsLocalStorage","setupEme_","setupQualityLevels_","mediaSourceUrl_","createKeySessions_","audioPlaylistLoader","sourceKeySystems","audioMedia","mainPlaylists","initializeMediaKeys","keySystems","keySystemsOptionsArr","keySystemsArr","keySystemsOptions","keySystemsObj","keySystemOptions","initializationFinishedPromises","keySessionCreatedPromises","race","waitForKeySessionCreation","handleWaitingForKey_","sourceOptions","didSetupEmeOptions","audioPlaylist","videoContentType","audioContentType","keySystemContentTypes","emeKeySystems","masterPlaylist","_videojs$log","excludedHDPlaylists","qualityLevels_","convertToProgramTime","_ref$time","segmentEnd","findSegmentForPlayerTime","seekTime","programTimeObject","mediaSeconds","playerTime","offsetFromSegmentStart","playerTimeToProgramTime","toISOString","getProgramTime","VhsSourceHandler","_videojs$mergeOptions","_videojs$mergeOptions2","_videojs$mergeOptions3","_videojs$mergeOptions4","_videojs$mergeOptions5","legacyOverrideNative","supportedType","exitOnRotate","lockOrientationUniversal","orientation","lock","mozLockOrientation","msLockOrientation","angle","_interopDefaultLegacy","videojs__default","hideOnReady","Logo","tid","_onPlayerReady","_setup","_this$options","img","_this$options2","onclick","SeekButton","_select","_select2","_createClass","ClipboardAction","initSelection","emitter","selectFake","selectTarget","removeFake","fakeHandlerCallback","fakeHandler","fakeElem","copyText","succeeded","handleResult","_action","_target","_clipboardAction","_tinyEmitter","_goodListener","_clipboardAction2","_interopRequireDefault","_tinyEmitter2","_goodListener2","clipboardAction","window__default","assertThisInitialized","SpriteThumbnails","that","isPreloading","sprites","progressControl","mouseTimeTooltip","tooltipStyle","ttstyle","setProperty","removeProperty","resetMouseTooltip","hijackMouseTooltip","sprite","imgWidth","naturalWidth","imgHeight","naturalHeight","scaleFactor","columns","scaledWidth","scaledHeight","cleft","ctop","bgSize","controlsTop","seekBarTop","topOffset","spriteready","spriteEvents","dl","cached","setReady","spriteOpts","spriteThumbs","vttjs","WebVTT","VTTRegion","cueShim","regionShim","nativeVTTCue","nativeVTTRegion","shim","_objCreate","F","ParsingError","errorData","parseTimeStamp","computeSeconds","Settings","parseOptions","keyValueDelim","groupDelim","kv","parseCue","regionList","oInput","consumeTimeStamp","Errors","BadTimeStamp","skipWhitespace","region","alt","vals","vals0","integer","lineAlign","snapToLines","center","positionAlign","consumeCueSettings","BadSignature","dflt","defaultKey","TEXTAREA_ELEMENT","TAG_NAME","ruby","rt","DEFAULT_COLOR_CLASS","white","lime","cyan","red","yellow","magenta","blue","black","TAG_ANNOTATION","NEEDS_PARENT","parseContent","nextToken","shouldAdd","annotation","rootDiv","tagStack","classes","cl","bgColor","colorName","propValue","strongRTLRanges","isStrongRTLChar","determineBidi","nodeStack","pushNodes","nextTextNode","StyleBox","CueStyleBox","styleOptions","styles","writingMode","unicodeBidi","applyStyles","textAlign","font","whiteSpace","textPos","formatStyle","move","BoxPosition","lh","rects","getClientRects","lineHeight","moveBoxToLinePosition","styleBox","containerBox","boxPositions","boxPosition","linePos","mediaElement","computeLinePos","axis","maxPosition","initialAxis","calculatedPercentage","bestPosition","specifiedPosition","percentage","overlapsOppositeAxis","within","overlapsAny","intersectPercentage","findBestPosition","toCSSCompatValues","unit","toMove","overlaps","getSimpleBoxPosition","convertCueToDOMTree","cuetext","paddedOverlay","hasBeenReset","shouldCompute","reportOrThrowError","collectNextLine","alreadyCollectedLine","parseTimestampMap","xy","anchor","lines","regionAnchorX","regionAnchorY","viewportAnchorX","viewportAnchorY","scroll","onregion","parseRegion","hasSubstring","directionSetting","alignSetting","findAlignSetting","_id","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","findDirectionSetting","SyntaxError","getCueAsHTML","scrollSetting","isValidPercentValue","_lines","_regionAnchorX","_regionAnchorY","_viewportAnchorX","_viewportAnchorY","_scroll","findScrollSetting","scope","WebComponents","noOpts","CustomElements","hasWorkingUrl","forceJURL","relative","relativePathDotMapping","EOF","ALPHA","ALPHANUMERIC","jURL","_isInvalid","_url","authority","_username","_password","_isRelative","_query","_fragment","_scheme","_port","_host","port","_path","_schemeData","OriginalURL","isRelativeScheme","invalid","IDNAToASCII","percentEscape","unicode","percentEscapeQuery","stateOverride","cursor","seenAt","seenBracket","nextC","nextNextC","tempC","global","JsMutationObserver","setImmediate","registrationsTable","setImmediateQueue","sentinel","currentRecord","recordWithOldValue","isScheduled","scheduledObservers","uidCounter","ShadowDOMPolyfill","wrapIfNeeded","childList","characterData","attributeOldValue","attributeFilter","characterDataOldValue","registration","registrations","observer","removeListeners","Registration","nodes_","addListeners","records_","takeRecords","copyOfRecords","enqueue","record","records","recordToReplaceLast","lastRecord","newRecord","selectRecord","dispatchCallbacks","addListeners_","subtree","removeListeners_","addTransientObserver","transientObservedNodes","removeTransientObservers","relatedNode","getRecord","attributeName","attributeNamespace","attrChange","MutationEvent","ADDITION","prevValue","forEachAncestorAndObserverEnqueueRecord","getRecordWithOldValue","addedNodes","removedNodes","changedNode","MutationObserver","_isPolyfilled","observers","o1","o2","uid_","anyNonEmpty","removeTransientObserversFor","callback_","MutationRecord","needsTemplate","HTMLTemplateElement","needsCloning","t2","TEMPLATE_TAG","TemplateImpl","contentDoc","createHTMLDocument","canDecorate","templateStyle","firstElementChild","decorate","outerHTML","escapeDataRegExp","escapeReplace","bootstrap","templates","nativeCloneNode","fixClonedDom","s$","t$","originalImportNode","performance","nativeRaf","webkitRequestAnimationFrame","mozRequestAnimationFrame","webkitCancelAnimationFrame","mozCancelAnimationFrame","createEvent","origPreventDefault","Event","CustomEvent","inType","initCustomEvent","detail","origEvent","HTMLImports","IMPORT_LINK_TYPE","useNative","hasShadowDOMPolyfill","wrap","rootDocument","currentScriptDescriptor","scripts","whenReady","whenDocumentReady","imports","parsedCount","importCount","newImports","errorImports","checkDone","allImports","loadedImports","loadedImport","markTargetLoaded","errorLoadingImport","imp","__loaded","import","__importParsed","watchImportsLoad","requiredReadyState","READY_EVENT","isDocumentReady","checkReady","handleImports","handleImport","mxns","readyTime","addModule","initializeModules","CSS_URL_REGEXP","CSS_IMPORT_REGEXP","resolveUrlsInStyle","linkUrl","resolver","resolveUrlsInCssText","urlObj","replaceUrls","regexp","post","urlPath","nextContext","bust","redirectedUrl","locationHeader","getResponseHeader","loadDocument","Loader","onLoad","onComplete","cache","oncomplete","inflight","pending","addNodes","addNode","elt","__nodeUrl","tail","pieces","atob","receive","receiveXhr","resource","$p","Observer","addCallback","mo","mutations","IMPORT_SELECTOR","importParser","documentSelectors","importsSelectors","dynamicElements","parseNext","nextToParse","isParsed","markParsing","parseDynamic","quiet","parsingElement","markParsingComplete","markDynamicParsingComplete","__importElement","parseImport","__doc","__importsParsingHook","__resource","__error","__pending","parseLink","linkElt","nodeIsImport","parseGeneric","parseStyle","__appliedElement","addElementToDocument","rootImportForElement","__importLink","fakeLoad","sheet","csr","cssRules","CSSRule","IMPORT_RULE","parseScript","scriptElt","scriptContent","__importedScripts","moniker","baseURI","generateSourceMapHint","generateScriptContent","generateScriptDataUrl","_mayParse","nextToParseInDoc","nextToParseDynamic","parseSelectorsForNode","hasResource","needsDynamicParsing","importer","documents","documentPreloadSelectors","importsPreloadSelectors","loadNode","importLoader","loadSubtree","marshalNodes","loadSelectorsForNode","isLinkRel","isImportLink","_URL","hasBaseURIAccessor","meta","makeDocument","bootDocument","loadedAll","baseURIDescriptor","added","loading","shouldLoadNode","shouldParseNode","hasNative","forSubtree","findAllElements","forRoots","nextElementSibling","shadowRoot","olderShadowRoot","_forDocumentTree","processingDocuments","forDocumentTree","addedNode","isAttached","addedSubtree","upgrade","attached","hasThrottledAttached","hasPolyfillMutations","isPendingMutations","pendingMutations","deferMutation","takeMutations","_attached","__upgraded__","__attached","attachedCallback","detached","_detached","detachedCallback","mx","inDocument","inRoot","__observer","upgradeDocument","originalCreateShadowRoot","createShadowRoot","watchShadow","__watched","upgradeDocumentTree","upgradeSubtree","upgradeAll","upgradeWithDefinition","implementPrototype","createdCallback","created","inTarget","inSrc","inNative","used","customMixin","native","getRegisteredDefinition","extends","changeAttribute","operation","attributeChangedCallback","reservedTagList","ancestry","extnds","extendee","registry","typeExtension","ctor","domCreateElement","isInstance","domCreateElementNS","wrapDomMethodToForceUpgrade","methodName","isReservedTag","__name","lifecycle","baseTag","resolveTagName","nativePrototype","inst","ancestor","foundPrototype","resolvePrototypeChain","_polyfilled","overrideAttributeApi","registerDefinition","instantiate","generateConstructor","instanceof","nop","elapsed","unwrap","unwrapIfNeeded","eager","loadEvent","AdapterConstants","Chrono","AdapterAdsMixin","getPosition","getGivenBreaks","getExpectedBreaks","getExpectedPattern","getBreaksTime","getGivenAds","getExpectedAds","getIsVisible","getAudioEnabled","getIsSkippable","getIsFullscreen","getCampaign","getCreativeId","getProvider","getAdInsertionType","fireClick","CLICK","fireQuartile","quartile","isStarted","lastQuartileSent","QUARTILE","startChronoView","backgroundDetector","isInBackground","chronos","viewedMax","stopTime","stopChronoView","fireManifest","paramsObject","errorType","MANIFEST","fireSkip","fireStop","fireBreakStart","PODSTART","fireBreakStop","PODSTOP","Log","AdapterContentMixin","getPlayrate","getFramesPerSecond","getDroppedFrames","getThroughput","getRendition","getTitle2","getIsLive","getCdnTraffic","getP2PTraffic","getUploadTraffic","getIsP2PEnabled","getSegmentDuration","getHouseholdId","getLatency","getPacketLoss","getPacketSent","getMetrics","getAudioCodec","getVideoCodec","getURLToParse","fireSeekBegin","convertFromBuffer","triggeredEvent","_discardFalseBuffers","isJoined","isSeeking","isBuffering","notice","fireEventsStruct","SEEK_BEGIN","fireSeekEnd","triggeredEvents","cancelSeek","SEEK_END","skipNextTick","fireEvent","topLevelDimensions","returnparams","VIDEO_EVENT","Emitter","Util","PlaybackChronos","PlaybackFlags","PlayheadMonitor","StateMonitor","Adapter","_isAdsAdapter","setPlayer","getVersion","unregisterListeners","registerListeners","stopMonitor","stopReadyStateMonitor","monitorPlayhead","monitorBuffers","monitorSeeks","BUFFER","SEEK","_timer","isRunning","monitorReadyState","intervalMilliseconds","stateMonitor","startReadyStateMonitor","checkReadyState","getReadyStateMonitorEnabled","fireBufferEnd","fireJoin","fireBufferBegin","getPlayhead","getBitrate","getTotalBytes","getPlayerVersion","getPlayerName","getVideoObject","fireInit","fireStart","canBlockStartCalls","START","_isAds","isInitiated","JOIN","firePause","PAUSE","fireResume","RESUME","convertFromSeek","triggeredByStateProperty","isVideoStateBuffering","BUFFER_BEGIN","cancelBuffer","BUFFER_END","_getDeltaBufferTime","getDeltaTime","_isStopReady","STOP","setIsAds","fireCasted","casted","fireError","buildErrorParams","fireFatalError","YouboraObject","isEnded","isStopped","Timer","adapter","_adapter","_seekEnabled","_bufferEnabled","_chrono","_lastPlayhead","canBeUsed","bufferThreshold","kBUFFER_THRESHOLD_RATIO","kSEEK_THRESHOLD_RATIO","currentPlayhead","_getPlayhead","diffPlayhead","getPlayheadMonitorEnabled","_videoElement","_startedStateCheck","_intervalCheckId","_intervalMilliseconds","checkStateProperty","pauseTime","retValue","tempOffset","tempStop","chrono","YBRequest","Transform","Communication","pluginref","transforms","pluginRef","_requests","sendRequest","callbackParams","SUCCESS","_registerRequest","buildRequest","addTransform","isBlocking","DONE","_processRequests","removeTransform","requestHeaders","Authorization","authType","workingQueue","rejected","transformState","_transform","STATE_NO_BLOCKED","getHost","STATE_BLOCKED","STATE_OFFLINE","retries","sendPostRequest","preparedPostRequest","setParam","ActiveXObject","getXHR","getResponse","getResponseText","getResponseHeaders","getUrl","getParamString","getParam","setBody","setPostRequest","getParamsForPostMessages","timemark","sessionRoot","retryAfter","maxRetries","atv","VERBOSE","verbose","_globalListeners","LOAD","ABORT","onEvery","offEvery","Constants","FlowTransform","_services","Service","INIT","OFFLINE_EVENTS","_isBusy","OfflineTransform","session","_sendRequest","transformName","offlineStorage","addEvent","hasToSend","HlsParser","CdnParser","CdnSwitch","DashParser","LocationheaderParser","ResourceTransform","__super__","_plugin","_realResource","_transportFormat","_initResource","_cdnName","_cdnNodeHost","_cdnNodeTypeString","_cdnNodeType","_responses","_getInitialCdnResource","getTransportFormat","getCdnName","getNodeHost","getNodeTypeString","getNodeType","_parseManifestEnabled","isParseManifest","_cdnEnabled","isParseCdnNode","_cdnList","getParseCdnNodeList","setBalancerHeaderName","getParseCdnNodeNameHeader","getParseNodeHeader","_setTimeout","_isFinalUrl","_parseCDN","segmentExtensions","timeoutComplete","_parseTimeout","lastManifest","lastSrc","parserArray","_parseManifest","shouldExecute","getLastManifest","isCdnSwitch","switchDetector","resp","cdn","cdnParser","getResponses","getParsedCdnName","getParsedNodeHost","getParsedNodeTypeString","getParsedNodeType","lastSent","requestBuilder","parsedResource","transportFormat","nodeHost","nodeTypeString","headerName","getAdapter","_request","_successfulRequest","_failedRequest","cdnName","requestMethod","setCdnName","setRequestMethod","setParseType","responses","headerString","_parseResponse","_requestResponse","useheaders","_executeParser","regex","ElementType","HOST","HOST_AND_TYPE","TYPE_AND_HOST","_cdnConfigs","nodename","Balancer","Pragma","TransportFormat","parseLocation","_headers","iterations","locationRegexp","_lastManifest","newRes","_htmlDecode","parseFinalResource","baseUrlRegexp","segmentUrlRegexp","segmentTemplateRegexp","_getManifestMetadata","_isFullUrl","MP4","MPEG2","CMF","parentResource","replaceAll","res","prevParent","ind","_parseWithManifest","startsWith","ViewTransform","_viewIndex","_session","_httpSecure","offline","pingTime","beatTime","storage","sessionExpire","getDataTime","getStoredData","setData","DATA","outputformat","buildParams","system","_receiveData","_failedData","addProtocol","bt","exp","setLocal","nextView","getViewCode","getSession","setSession","setHost","getAccountCode","EventList","PingTime","CreateView","infinity","infinityStarted","getLocal","parentId","navContext","getContext","NAV","SESSION_START","SESSION_STOP","EVENT","BEAT","PING","WrongTransform","AdPosition","ManifestError","RequestMethod","WillSendEvent","AdInsertionType","ClientSide","ServerSide","NO_RESPONSE","EMPTY","WRONG","GET","POST","AD_INIT","AD_START","AD_JOIN","AD_PAUSE","AD_RESUME","AD_BUFFER","AD_STOP","AD_CLICK","AD_MANIFEST","AD_POD_START","AD_POD_STOP","AD_QUARTILE","HDS","HLS","MSS","DASH","RTMP","RTP","RTSP","WILL_SEND_INIT","WILL_SEND_START","WILL_SEND_JOIN","WILL_SEND_PAUSE","WILL_SEND_RESUME","WILL_SEND_SEEK","WILL_SEND_BUFFER","WILL_SEND_ERROR","WILL_SEND_FATAL_ERROR","WILL_SEND_STOP","WILL_SEND_PING","WILL_SEND_VIDEO_EVENT","WILL_SEND_AD_START","WILL_SEND_AD_JOIN","WILL_SEND_AD_PAUSE","WILL_SEND_AD_RESUME","WILL_SEND_AD_BUFFER","WILL_SEND_AD_STOP","WILL_SEND_AD_CLICK","WILL_SEND_AD_ERROR","WILL_SEND_AD_MANIFEST","WILL_SEND_AD_POD_START","WILL_SEND_AD_POD_STOP","WILL_SEND_AD_QUARTILE","WILL_SEND_SESSION_START","WILL_SEND_SESSION_STOP","WILL_SEND_NAV","WILL_SEND_BEAT","WILL_SEND_EVENT","WILL_SEND_OFFLINE_EVENTS","BackgroundDetector","listenerReference","_visibilityListener","_reset","startDetection","isBackgroundDetectorStarted","stopDetection","_getSettings","visibilityState","_toBackground","_toForeground","_adsAdapter","_fireStop","_firePause","lastBeatTime","difftime","_beat","_sendBeat","newSession","deviceDetector","isSmartTV","isDesktop","isIphone","isPlayStation","_fireX","fireMethod","adsAdapter","getAdsAdapter","contentAdapter","DeviceDetector","_isSmartTVDevice","_isPlaystationDevice","_isIphoneDevice","_isAndroidDevice","_isSmartphoneDevice","_isDesktopDevice","isSmartphone","ResizeScrollDetector","_changeListener","loadReference","_loadListener","pageHeight","maxHeight","getScrollDepth","trunc","docEl","scrollHeight","clientHeight","innerHeight","_updateCompletionRate","prevHeight","DataExtractor","getAllData","getNonRandomData","getTimestamp","getUserAgent","threads","getVirtualCores","getLanguage","langList","getAvailableLanguages","getResolution","colorDepth","getColorDepth","deviceMemory","getMemory","touchscreen","getTouchscreen","localStorage","getLocalStorage","sessionStorage","getSessionStorage","cookiesAvailable","getCookiesAvailable","flashAvailable","getHasFlash","timeZone","getTimeZone","getPluginList","_getNavigatorValue","pluginlist","filename","getTimezoneOffset","_navigatorCheck","MD5","HashGenerator","dataExtractor","getPreviousKey","generateHashKey","_hashFunction","getKey","inputString","outputString","K","G","I","H","aa","Z","D","B","P","Y","X","W","V","C","J","_listeners","_eachCallback","Comm","YouboraInfinity","infinityStopped","andBeyond","begin","_comm","viewTransform","_registeredProperties","fireSessionStart","_setLastActive","_firstActive","getFirstActive","setStorages","getLastActive","getComm","restartViewTransform","_getParamsJson","fireSessionStop","removeStorages","isActive","fireNav","_sendExtraBeat","builtParams","registerOnce","unregister","removeLocal","isNavigaton","isStart","key2","page","route","_emitter","SILENT","WARNING","NOTICE","plainLogs","logMethod","letter","_getCurrentTime","documentMode","_plainReport","getSeconds","getMilliseconds","loadLevelFromUrl","_parseLevelFromUrl","nextKey","RUMSpeedIndex","BrowserLoadTimes","timeObject","playerSetup","perfObject","myTimesObject","getEntriesByType","PerformanceObserver","getEntries","largestContentfulPaint","renderTime","supportedEntryTypes","entryTypes","_getEnoughFPS","_fireLoadTimesEvent","_getLastMetrics","_getAllValues","PageLoadTime","getPageLoadTime","DNSTime","getDnsTime","TCPTime","getTcpTime","HandshakeTime","getHandshakeTime","DomReadyTime","getDomReadyTime","BackendTime","getBackendTime","FrontendTime","getFrontendTime","VisualReady","getTimeToVisuallyReady","TimeToInteractive","getTimeToInteractive","JsTime","getJSTime","CssTime","getCSSTime","ImageTime","getImageTime","FontTime","getFontTime","AvgReqLatency","getAvgReqLatency","MaxReqLatency","getMaxReqLatency","FirstPaint","getFirstPaint","FirstContentfulPaint","getFirstContentfulPaint","LargestContentfulPaint","getLargestContentfulPaint","SpeedIndex","getSpeedIndex","loadEventEnd","getPlayerStartupTime","domainLookupEnd","domainLookupStart","connectEnd","connectStart","secureConnectionStart","domComplete","responseStart","firstPaint","domContentLoadedEventEnd","fps","_getXTime","latency","requestStart","firstContentfulPaint","validExtensions","initiatorType","valid","contentfulPaint","msFirstPaint","msRequestAnimationFrame","preFPS","setPlayerSetupTime","HybridNetowrk","CdnBalancerStats","totalDownloadedBytes","Streamroot","_getStreamrootPeerObject","_getStreamrootInstanceObject","peer5","getStats","totalHttpDownloaded","teltoo","totalReceivedBytes","p2pReceivedBytes","getMultiCdnInfo","cdns","p2p","P2P","downloaded_bytes","downloadedBytes","uploaded_bytes","uploadedBytes","downloaded_chunks","downloadedSegments","uploaded_chunks","uploadedSegments","failedRequests","missed_downloaded_chunks","absent","timeout_errors","other_errors","late_uploaded_chunks","discardedUploadedSegments","late_uploaded_bytes","discardedUploadedBytes","late_downloaded_bytes","discardedDownloadedBytes","downloadMillis","active_peers","activePeers","peers","totalPeers","chunks","failures","getBalancerResponseId","responseUUID","totalP2PDownloaded","totalP2PUploaded","downloadEnabled","p2pAvailable","peerAgents","agent","isP2PEnabled","instances","dnaDownloadEnabled","dnaUploadEnabled","objectName","agentInst","currentContent","GetElementViewportRect","intersect","elRect","clientWidth","area","CheckElement","navStart","re","tm","GetRects","timings","requests","responseEnd","GetRectTimings","paintMetrics","headURLs","headElements","doneCritical","requestEnd","GetFirstPaint","paints","pixels","accumulated","CalculateVisualProgress","lastProgress","CalculateSpeedIndex","createObject","DeprecatedOptions","exists","optionName","Dictionary","getNewName","newName","httpSecure","anonymousUser","obfuscateIp","userType","Storage","OfflineStorage","actualView","viewList","givenIds","_getOldViewList","_newView","viewId","_getValidId","fullEvent","getView","idToSend","removeView","stringList","StreamingProtocol","Options","preventZombieViews","referer","referral","disableCookies","forceCookies","disableStorage","forceInit","linkedViewId","waitForMetadata","isInBase","deprecatedOptions","deprecated","newKey","setExtraParams","paramsArray","setCustomDimensions","setAdExtraParams","setAdCustomDimensions","PluginAdsGettersMixin","getAdPlayerVersion","_safeGetterAdsAdapter","temporalRet","getAdNumber","adNumber","getAdNumberInBreak","adNumberInBreak","getBreakNumber","breakNumber","getAdPlayhead","parseNumber","getAdDuration","getAdBitrate","getWebkitAdBitrate","webkitVideoDecodedByteCount","_lastWebkitAdBitrate","getAdTitle","getAdResource","getAdCampaign","getAdCreativeId","getAdProvider","getAdAdapterVersion","getAdMetadata","expBreaks","expPattern","mid","pattern","getAdsExpected","getAdJoinDuration","getAdBufferDuration","getAdPauseDuration","getAdTotalDuration","getAdViewedDuration","_getTimeMaxOrAcum","getAdViewability","acum","maxTime","PluginAdsMixin","setAdsAdapter","removeAdsAdapter","adsAdapterListeners","_adStartListener","_adJoinListener","_adPauseListener","_adResumeListener","_adBufferBeginListener","_adBufferEndListener","_adStopListener","_adErrorListener","_adClickListener","_adManifestListener","_adBreakStartListener","_adBreakStopListener","_adQuartileListener","resizeScrollDetector","getNewAdNumber","adStartSent","getNewAdNumberInBreak","_sendAdEventIfAllowed","adInitSent","WILL_SEND_AD_INIT","adConnected","adConnectedTime","_totalPrerollsTime","playedPostrolls","givenAds","_blockAdError","isBreakStarted","getNewBreakNumber","_savedAdError","_adSavedError","_adSavedManifest","_savedAdManifest","errorParams","_lastAdErrorParams","adCreativeId","_lastAdErrorTime","isAdsManifestSent","willSend","_send","PluginContentGetterMixin","_safeGetterAdapter","hybridNetwork","getWebkitDroppedFrames","getWebkitBitrate","_lastWebkitBitrate","getParsedResource","resourceTransform","getTransactionCode","getMetadata","getCdn","getAdapterVersion","getLibVersion","getStreamingProtocol","getVideoMetrics","getMetricsFrom","browserLoadTimes","getJoinDuration","getBufferDuration","getSeekDuration","getPauseDuration","getPackage","getSaga","getTvShow","getSeason","getEpisodeTitle","getChannel","getID","getImdbId","getGracenoteID","getType","getGenre","getVideoLanguage","getSubtitles","getContractedResolution","getCost","getPrice","getPlaybackType","getDRM","getCodecSettings","getCodecProfile","getContainerFormat","getLinkedViewId","functionName","PluginContentMixin","removeAdapter","contentAdapterListeners","_startListener","_joinListener","_pauseListener","_resumeListener","_seekBufferBeginListener","_seekEndListener","_bufferEndListener","_errorListener","_stopListener","_videoEventListener","initChrono","_initComm","_startPings","allParamsReady","_isExtraMetadataReady","mediaResource","_retryStart","startDelayed","joinDuration","playhead","pauseDuration","seekDuration","bufferDuration","_blockError","_lastErrorParams","_lastErrorTime","live","mediaDuration","expectedPostrolls","breaksTime","breaks","getters","getGetters","PluginFireMixin","errorLevel","fireOfflineEvents","_offlineParams","_generateAndSendOffline","offlineReference","bodyAndId","buildBody","viewJson","newViewCode","offlineId","PluginGetterMixin","stripProtocol","getUserType","getObfuscateIp","getPrivacyProtocol","getCustomDimensions","dim","getExtraparam1","getExtraparam2","getExtraparam3","getExtraparam4","getExtraparam5","getExtraparam6","getExtraparam7","getExtraparam8","getExtraparam9","getExtraparam10","getExtraparam11","getExtraparam12","getExtraparam13","getExtraparam14","getExtraparam15","getExtraparam16","getExtraparam17","getExtraparam18","getExtraparam19","getExtraparam20","getAdExtraparam1","getAdExtraparam2","getAdExtraparam3","getAdExtraparam4","getAdExtraparam5","getAdExtraparam6","getAdExtraparam7","getAdExtraparam8","getAdExtraparam9","getAdExtraparam10","getPluginInfo","lib","adAdapter","getIp","getIsp","getConnectionType","getDeviceInfo","getDeviceCode","deviceCode","getModel","model","getBrand","brand","getDeviceType","deviceType","getDeviceName","deviceName","getOsName","osName","getOsVersion","osVersion","getBrowserName","browserName","getBrowserVersion","browserVersion","getBrowserType","browserType","getBrowserEngine","browserEngine","getEDID","edid","getUsername","getAnonymousUser","getEmail","getReferer","getReferral","getRequestNumber","getOfflineView","getDeviceUUID","uuidGenerator","getSmartswitchConfigCode","getSmartswitchGroupCode","getSmartswitchContractCode","getAppName","getAppReleaseVersion","getIsBlocked","isMethodPostEnabled","PluginInfinityGettersMixin","removeSession","getStorages","getStorageHost","setStoredData","setDataTime","setLastActive","getPageName","getIsSessionExpired","getIsDataExpired","PluginInfinityMixin","_initInfinity","_navListener","_sessionStartListener","_sessionStopListener","_eventListener","_sendInfinity","willSendEvent","lastServeiceSent","diffTime","getSessionMetrics","PluginPingMixin","_ping","_stopPings","_sendPing","getChangedEntities","fetchParams","YouboraStorage","RequestBuilder","HybridNetwork","UUIDGenerator","dataReq","_refreshData","_checkOldData","lastEventTime","getFastDataConfig","startParams","adStartParams","_adNumber","_adNumberInBreak","paramList","onlyDifferent","bodyParams","differentParams","requestNumber","playrate","droppedFrames","totalBytes","title2","transactionCode","pluginVersion","libVersion","streamingProtocol","privacyProtocol","householdId","packetLoss","packetSent","metrics","param1","param2","param3","param4","param5","param6","param7","param8","param9","param10","param11","param12","param13","param14","param15","param16","param17","param18","param19","param20","extraparam1","extraparam2","extraparam3","extraparam4","extraparam5","extraparam6","extraparam7","extraparam8","extraparam9","extraparam10","adPlayhead","adDuration","adCampaign","adBitrate","adResource","adPlayerVersion","adProperties","adAdapterVersion","givenBreaks","expectedBreaks","expectedPattern","expectedAds","adsExpected","adViewedDuration","adViewability","skippable","adProvider","adInsertionType","pluginInfo","isp","connectionType","ip","deviceInfo","adJoinDuration","adBufferDuration","adPauseDuration","adTotalDuration","playerStartupTime","pageLoadTime","cdnDownloadedTraffic","multiCdnInfo","p2pDownloadedTraffic","p2pEnabled","uploadTraffic","cdnBalancerResponseUUID","deviceUUID","sessionMetrics","scrollDepth","adsBlocked","smartswitchConfigCode","smartswitchGroupCode","smartswitchContractCode","appReleaseVersion","package","saga","tvshow","season","titleEpisode","drm","codecSettings","codecProfile","containerFormat","contentId","imdbID","gracenoteID","contentLanguage","contractedResolution","cost","price","playbackType","_setCookie","_localGetRemove","storageMethod","cookieMethod","_sessionGetRemove","cname","cvalue","domain","cookie","_getCookie","ca","_removeCookie","invokedAsConstructor","_setTick","strippedUrl","serviceUrl","logAllEvents","extraEvents","playerEvents","buildRenditionString","errorMetadata","calculateAdViewability","screenPercent","isVisible","x1","y1","op1","op2","metric","temporal","previousYoubora","polyfills","Request","OfflineParser","adapters","registerAdapter","unregisterAdapter","Freewheel","_getAdInstanceMethodCall","titles","_getAdNumber","_adId","creativeRendition","getPrimaryCreativeRenditionAsset","asset","getWrapperUrl","tv","freewheel","SDK","contentPlayer","adManager","getAdVolume","slot","getAdCount","slots","getSlots","slotindex","getAdInstances","adindex","_creativeRenditions","_baseUnit","getTimePosition","adnumber","_creativeId","currentAdContext","_adResponse","getTemporalSlots","methdodName","canRemoveListeners","events","manifestNoResponse","ERROR_SECURITY","ERROR_TIMEOUT","manifestEmpty","ERROR_NO_AD_AVAILABLE","ERROR_VAST_NO_AD","manifestWrong","ERROR_VAST_VERSION_NOT_SUPPORTED","ERROR_VAST_WRAPPER_LIMIT_REACH","ERROR_VAST_XML_PARSING","ERROR_PARSE","ignoredErrors","ERROR_ADINSTANCE_UNAVAILABLE","EVENT_AD","logListener","EVENT_ERROR","errorListener","EVENT_SLOT_STARTED","slotListener","EVENT_SLOT_ENDED","closeListener","noResponseManifestListener","manifestEmptyListener","key3","manifestWrongListener","key4","subType","errorInfo","errorModule","EVENT_AD_PAUSE","pauseListener","EVENT_AD_RESUME","resumeListener","EVENT_AD_IMPRESSION_END","endedListener","EVENT_AD_INITIATED","playListener","EVENT_AD_IMPRESSION","playingListener","EVENT_AD_SKIPPED","skipListener","EVENT_AD_CLOSE","EVENT_AD_CLICK","clickListener","EVENT_AD_FIRST_QUARTILE","EVENT_AD_MIDPOINT","EVENT_AD_THIRD_QUARTILE","getTimePositionClass","adInstance","getEventCallbackUrls","EVENT_TYPE_CLICK","lastUrl","changeVideo","isInited","VideojsAdapter","lastPlayhead","getUsedTech","ContribHlsTech","isUsed","HlsJsTech","ShakaTech","DashShakaTech","DashTech","ImaAdsAdapter","OnceUXAdsAdapter","pluginName","FreeWheelPlugin","isOnAdBreak","acumBytes","ignoreList","fatalList","nonFatalList","loadstart","loadstartListener","adsready","loadAdsAdapter","timeupdate","timeupdateListener","conditionalStop","disposeListener","seekingListener","seekedListener","adserror","aderrorListener","adsEnded","adsEndedListener","texttrackchange","textListener","bufferingListener","adPlayerErrorListener","acumBytesFunc","_startEvent","triggerListener","joinPolling","_jointimePolling","lastSeekPlayhead","fatal","crashed","isGeneric","BcoveImaAdsAdapter","BcoveFreewheelAdsAdapter","FreewheelAdsAdapter","freewheelAds","GenericAdsAdapter","registerImaEvents","errorModifyer","nonfatal","ad","adPlayer","getActiveCreativeRendition","_adContext","_currentSlot","_video","startJoinListener","pausedListener","resumedListener","adEndedListener","podEndListener","firstQuartileListener","secondQuartileListener","thirdQuartileListener","adcontext","fwreferences","errorFwListener","skippedListener","clickFwListener","playheadVal","ima3","getMediaUrl","cuelist","isSkippable","getVastMediaBitrate","getCreativeAdId","getCode","clickurl","clickThroughUrl","getErrorCode","FwAdsAdapter","adstart","adStartListener","adend","adEndListener","adskip","adSkipListener","manager","cuepoints","AD_METADATA","metadataListener","loadedListener","contentPauseRequestedListener","startedListener","completeListener","FIRST_QUARTILE","MIDPOINT","THIRD_QUARTILE","playerReferences","getAdCuePoints","adPodInfo","onceux","youboralib","hls_","att","shakaPlayer","sp","getManifestUri","getAssetUri","streamBandwidth","shaka","getVariantTracks","mediaPlayer","_getDashPlayer","getQualityFor","getBitrateInfoListFor","renditionInfo","currentLevel","_getShaka","_shakaplayerInstance","getCurrentSrc","getVideoTracks","getVideoTrackCurrentIndex","videoIndex","_parseHeaderResponse","headerNameElement","DVB","DVBC","DVBT","DVBT2","MULTICAST","forceNewSession","productAnalytics","adapterAfterSet","adapterBeforeRemove","_getResourceForTransform","getScreenResolution","devicePixelRatio","ProductAnalytics","screenResolution","ProductAnalyticsConfig","ProductAnalyticsUserState","YouboraProductAnalytics","_infinity","_productAnalyticsSettingsDefault","autoTrackNavigation","autoTrackAttribution","highlightContentAfter","enableStateTracking","activeStateTimeout","activeStateDimension","pageRules","_productAnalyticsSettings","_page","_userState","_config","_searchQuery","_location","_contentHighlighted","_contentHighlightTimeout","productAnalyticsSettings","_fireEvent","_identify","_trackNavigation","_trackAttribution","URLSearchParams","identify","ex","_adapterTrackStart","trackPlayerInteraction","_fireAdapterEvent","_adapterGet","executed","trackNavigation","pageName","eventType","routeDomain","fullRoute","trackAttribution","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","utm_source","utm_medium","utm_campaign","utm_term","utm_content","utmParams","_getUTMParams","keySplitted","keyIndex","paramValue","paramKey","trackSectionIn","section","trackSectionOut","contentFocusIn","contentID","contentFocusOut","_trackContentHiglight","trackContentClick","trackPlay","setActive","playerStarted","trackSearchQuery","searchQuery","trackSearchResult","resultCount","trackSearchClick","trackExternalAppLaunch","trackExternalAppExit","trackEngagementEvent","trackEvent","dimensionsInternal","dimensionsUser","fired","_buildDimensions","dimensionsTopLevel","dimensionsCustom","topKeysDelete","topKeys","eventSource","YouboraProductAnalyticsConfig","_npawtmConfig","npawtmConfig","_getPage","_getEvents","_bindElements","urlString","regexInfo","pageInfo","urls","regexes","domains","eventInfo","npawEventInfo","npawEventType","eventData","currentEventInfo","currentEventType","_elementEvent","uiElement","YouboraProductAnalyticsUserState","fireAdapterEvent","pluginOptionsHandler","_pluginOptionsHandler","_timerId","_timerInterval","_started","_storeState","ACTIVE","_timerStart","triggerEvent","stateFromTo","PASSIVE","_timerStop","Op","hasOwn","$Symbol","iteratorSymbol","asyncIteratorSymbol","toStringTagSymbol","toStringTag","define","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","AsyncIterator","PromiseImpl","invoke","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","delegateResult","maybeInvokeDelegate","_sent","dispatchException","resultName","nextLoc","pushTryEntry","locs","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","doneResult","displayName","isGeneratorFunction","genFun","mark","awrap","iter","skipTempReset","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","finish","thrown","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","_arrayLikeToArray","arr2","asyncGeneratorStep","_next","_throw","_defineProperty","_s","_e","_x","_r","_arr","_n","_d","unsupportedIterableToArray","arrayLikeToArray","_toPropertyKey","prim","toPrimitive","_unsupportedIterableToArray","minLen","__webpack_require__","cachedModule","nc","locals","clientAttributePattern","isHexaDecimal","isDecimalFloating","lastProgramDateTime","dateRanges","dateRangeTags","dateRange","endDate","startDate","plannedDuration","endOnNextYes","endOnNext","newDateInSeconds","dateRangeWithSameId","dateRangeToFind","independentSegments","contentSteering","byteRangeToString","playlistsByBaseUrl","cur","allPlaylists","playlistGroup","mergedPlaylists","serviceLocation","eventStream","vttPlaylist","positionManifestOnTimeline","parseDivisionValue","initialBaseUrl","resolvedBaseUrl","finalBaseUrl","toEventStream","eventStreamAttributes","eventAttributes","messageData","contentEncoding","generateContentSteeringInformation","contentSteeringNodes","eventHandler","infoFromContentSteeringTag","serverURL","queryBeforeStart","partCount","isExcluded","excluded","exactManifestTimings","canUseFudgeFactor","groupID","addPropertiesToMain","createGroupID","audioOnlyMain","DateRangesStorage","offset_","pendingDateRanges_","processedDateRanges_","setOffset","setPendingDateRanges","trimProcessedDateRanges_","pendingDateRange","processDateRange","delete","getDateRangesToProcess","dateRangeClasses","dateRangesToProcess","classListIndex","updateMain$1","addDateRangesToTextTrack_","addDateRangesToTextTrack","llhls","dateRangesStorage_","handleLoadedPlaylist_","mediaPlaylist","availableDateRanges","mainPlaylistRef","mainForMedia","updateOrDeleteClone","isUpdate","pathway","ID","oldPlaylistUri","oldPlaylistId","newPlaylistUri","createCloneURI_","newPlaylistId","createCloneAttributes_","createClonePlaylist_","updateOrDeleteCloneMedia","oldMediaPlaylist","createClonedMediaGroups_","addClonePathway","basePlaylist","baseID","newUri","newPlaylistID","newMediaPlaylist","PARAMS","oldAttributes","getKeyIdSet","keyIds","keysystem","_requestCallbackSet","_responseCallbackSet","xhrMethod","beforeRequestOptions","requestSet","requestCallback","callAllRequestHooks","responseSet","responseCallback","callAllResponseHooks","byterangeEnd","byterangeStart","byterangeStr","ascii","dashGroupId","mainPlaylistLoader","mainPlaylistLoader_","isMain_","addMetadataToTextTrack","playlistExclusionDuration","requestMain_","mainChanged","haveMain_","mainXml_","mainLoaded_","handleMain_","oldMain","newMain","mainXml","contentSteeringInfo","parseMainXml","removeOldMediaGroupLabels","updateMain","addEventStreamToMetadataTrack_","filterChangedSidxMappings","eventStreamNode","defaultKID","Stream$8","frameUtils$1","groupNalsIntoFrames","groupFramesIntoGops","extendFirstKeyFrame","generateSampleTable","concatenateNalData","generateSampleTableForFrame","concatenateNalDataForFrame","clock$2","clock$1","audioFrameUtils$1","prefixWithSilence","trimAdtsFramesByEarliestDts","concatenateFrameData","ONE_SECOND_IN_TS$3","trackDecodeInfo$1","clearDtsInfo","calculateTrackBaseMediaDecodeTime","collectDtsInfo","parseSei","parseUserData","parseCaptionPackets","USER_DATA_REGISTERED_ITU_T_T35","Stream$7","cea708Parser","CaptionStream$2","char","indent","indentations","logWarning","Stream$6","typedArrayIndexOf","fromIndex","currentIndex","parseIso88591$1","frameParsers","mimeTypeEndIndex","descriptionEndIndex","pictureType","pictureData","parseId3","parseId3Frames","Stream$5","StreamTypes$3","Stream$4","StreamTypes$2","parsePes","m2ts$1","AdtsStream$1","ONE_SECOND_IN_TS$2","H264Stream$1","Stream$2","ExpGolomb","AacStream$1","aacUtils","CoalesceStream","AdtsStream","AacStream","parseType$2","findBox$2","getUint64$2","parseTfdt$2","parseSampleFlags","parseTrun$2","parseTfhd$2","findBox$1","parseTfdt$1","parseTrun$1","parseTfhd$1","window$2","uint8ToCString","curChar","retString","isDefined","emsg$1","parseEmsgBox","boxData","scheme_id_uri","presentation_time","presentation_time_delta","event_duration","emsgBox","message_data","emsg","hasScheme","isValidV0Box","isValidV1Box","isValidEmsgBox","scaleTime","timeDelta","parseType$1","window$1","parsedBox","parsedId3Frames","StreamTypes$1","StreamTypes","probeEmsgID3","emsgData","getProgressStats","playlistController","leastPixelDiffSelector","playlistController_","dateRangeAttr","scte35Out","scte35In","dateRangeKeysToOmit","shouldForceTimestampOffsetAfterResync_","updateMediaSequenceMap","hasIndependentSegments","timestampOffsetForSegment","getPendingSegmentPlaylist","concatSegments","NoVttJsError","loadVttJs","checkTimestampOffset","uniqueCues","cueKey","handleRollover_","valueIn90khz","referenceIn90khz","mediaSequenceMap","getMediaSequenceMap","currentMediaSequence","currentPartStart","mediaSequenceStorage_","currentBaseTime","syncPointInfo","x8","excludePlaylist","isMainPlaylist","useForcedSubtitles","SteeringManifest","priority_","pathwayClones_","version_","ttl","ttl_","reloadUri","reloadUri_","pathwayClones","ContentSteeringController","currentPathway","defaultPathway","availablePathways_","steeringManifest","proxyServerUrl_","manifestType_","ttlTimeout_","request_","currentPathwayClones","nextPathwayClones","excludedSteeringManifestURLs","xhr_","getBandwidth_","assignTagProperties","steeringTag","serverUri","steeringUri","decodeDataUriManifest_","pathwayId","defaultServiceLocation","proxyServerURL","requestSteeringManifest","getRequestURI","retrySeconds","startTTLTimeout_","steeringManifestJson","assignSteeringProperties_","setProxyServerUrl_","steeringUrl","steeringUrlObject","proxyServerUrlObject","encodeURI","setSteeringParams_","urlObject","getPathway","networkThroughput","pathwayKey","throughputKey","steeringJson","TTL","nextPathway","pathwaysByPriority","chooseNextPathway","proxyURI","steeringURI","ttlMS","clearTTLTimeout_","addAvailablePathway","clearAvailablePathways","excludePathway","didDASHTagChange","newTag","getAvailablePathways","PlaylistController","bufferBasedABR","keyStatusMap_","setupMainPlaylistLoaderListeners_","contentSteeringController_","switchMediaForDASHContentSteering_","dashMediaPlaylists","pc","attachContentSteeringListeners_","initContentSteeringController_","playlistToExclude","waitingForFastQualityPlaylistReceived_","runFastQualitySwitch_","startPoint","pathwayAttribute_","reIncludeDelay","excludeThenChangePathway_","exclusionReasons","addDateRangeMetadata","finiteDuration","resetContentSteeringController_","availablePathways","newPathways","didPathwaysChange","handlePathwayClones_","didEnablePlaylists","differentPathwayId","noExcludeUntil","changeSegmentPathway_","oldClone","equalPathwayClones_","aParams","bParams","excludeNonUsablePlaylistsByKeyId_","nonUsableKeyStatusCount","NON_USABLE","keyIdSet","USABLE","hasUsableKeyStatus","nonUsableExclusion","isNonHD","excludedForNonUsableKey","addKeyStatus_","formattedKeyIdString","uInt8Buffer","padStart","bufferToHexString","updatePlaylistByKeyStatus","excludeNonUsableThenChangePlaylist_","resetTimeUpdate_","isLLHLS","addOnRequestHook","addOnResponseHook","removeOnRequestHook","removeOnResponseHook","onRequest","onResponse","offRequest","offResponse","setupEmeOptions","setupXhrHooks_","simpleType","getOverrideNative","defaultOverrideNative","hasIma","R7PlayerStrategy","_isReady","_currentPlayTime","_startedAt","_currentContentType","ContentType","CONTENT","VideoState","UNPLAYED","_displayingAd","_playTime","_playTimeMilestone","_adPlayTime","_playAdTimeMilestone","AD","PLAYED","STOPPED","COMPLETED","OVERLAY","SPECIAL","isReady","getVideoPath","getTotalDuration","getCurrentPlayTime","currentQuality","getThumbnailPath","getPlayerType","getViewStartTime","getViewPlayTime","getViewAdPlayTime","getStrategyName","verify","_unused","langPt","configParams","initPlugins","eventTracking","googleAnalytics","initAds","vjsYoubora","initComscore","kibana","R7Players","initR7Player","_callee3","checkPlayerReady","initializePlayer","initializePlayers","_context3","nativeAudioTracks","nativeVideoTracks","volumePanel","arcId","_callee2","wrapClassName","wrapPlayers","readyPromises","_context2","loadIMA"],"sourceRoot":""}