rx-player 3.29.0-dev.2022110200 → 3.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/VERSION +1 -1
  3. package/dist/_esm5.processed/compat/browser_compatibility_types.d.ts +1 -1
  4. package/dist/_esm5.processed/compat/browser_detection.js +10 -5
  5. package/dist/_esm5.processed/compat/eme/close_session.js +1 -1
  6. package/dist/_esm5.processed/compat/eme/custom_media_keys/index.d.ts +1 -1
  7. package/dist/_esm5.processed/compat/eme/custom_media_keys/webkit_media_keys_constructor.d.ts +1 -1
  8. package/dist/_esm5.processed/compat/eme/load_session.js +1 -1
  9. package/dist/_esm5.processed/compat/event_listeners.d.ts +1 -1
  10. package/dist/_esm5.processed/core/adaptive/adaptive_representation_selector.d.ts +3 -3
  11. package/dist/_esm5.processed/core/adaptive/network_analyzer.d.ts +1 -1
  12. package/dist/_esm5.processed/core/api/option_utils.d.ts +2 -2
  13. package/dist/_esm5.processed/core/api/playback_observer.d.ts +1 -1
  14. package/dist/_esm5.processed/core/api/public_api.js +2 -2
  15. package/dist/_esm5.processed/core/decrypt/attach_media_keys.js +1 -1
  16. package/dist/_esm5.processed/core/decrypt/content_decryptor.js +21 -18
  17. package/dist/_esm5.processed/core/decrypt/create_or_load_session.d.ts +1 -1
  18. package/dist/_esm5.processed/core/decrypt/create_or_load_session.js +1 -1
  19. package/dist/_esm5.processed/core/decrypt/create_session.d.ts +1 -1
  20. package/dist/_esm5.processed/core/decrypt/create_session.js +1 -1
  21. package/dist/_esm5.processed/core/decrypt/dispose_decryption_resources.js +1 -1
  22. package/dist/_esm5.processed/core/decrypt/find_key_system.d.ts +1 -1
  23. package/dist/_esm5.processed/core/decrypt/find_key_system.js +1 -1
  24. package/dist/_esm5.processed/core/decrypt/get_media_keys.js +1 -1
  25. package/dist/_esm5.processed/core/decrypt/init_media_keys.js +1 -1
  26. package/dist/_esm5.processed/core/decrypt/set_server_certificate.js +1 -1
  27. package/dist/_esm5.processed/core/decrypt/types.d.ts +1 -1
  28. package/dist/_esm5.processed/core/decrypt/utils/check_key_statuses.d.ts +1 -1
  29. package/dist/_esm5.processed/core/decrypt/utils/clean_old_loaded_sessions.js +1 -1
  30. package/dist/_esm5.processed/core/decrypt/utils/loaded_sessions_store.js +1 -1
  31. package/dist/_esm5.processed/core/fetchers/manifest/manifest_fetcher.js +1 -1
  32. package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.d.ts +1 -1
  33. package/dist/_esm5.processed/core/fetchers/segment/prioritized_segment_fetcher.js +2 -1
  34. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.d.ts +1 -1
  35. package/dist/_esm5.processed/core/fetchers/segment/segment_fetcher.js +1 -1
  36. package/dist/_esm5.processed/core/fetchers/segment/task_prioritizer.d.ts +1 -1
  37. package/dist/_esm5.processed/core/fetchers/utils/schedule_request.js +1 -1
  38. package/dist/_esm5.processed/core/init/content_time_boundaries_observer.d.ts +1 -1
  39. package/dist/_esm5.processed/core/init/initial_seek_and_play.d.ts +1 -1
  40. package/dist/_esm5.processed/core/init/link_drm_and_content.d.ts +1 -1
  41. package/dist/_esm5.processed/core/init/load_on_media_source.js +5 -7
  42. package/dist/_esm5.processed/core/init/manifest_update_scheduler.d.ts +2 -2
  43. package/dist/_esm5.processed/core/init/stream_events_emitter/types.d.ts +1 -1
  44. package/dist/_esm5.processed/core/init/types.d.ts +4 -4
  45. package/dist/_esm5.processed/core/segment_buffers/garbage_collector.js +1 -1
  46. package/dist/_esm5.processed/core/segment_buffers/implementations/types.d.ts +2 -2
  47. package/dist/_esm5.processed/core/segment_buffers/segment_buffers_store.d.ts +3 -3
  48. package/dist/_esm5.processed/core/stream/orchestrator/stream_orchestrator.d.ts +2 -2
  49. package/dist/_esm5.processed/core/stream/period/get_adaptation_switch_strategy.d.ts +1 -1
  50. package/dist/_esm5.processed/core/stream/period/period_stream.d.ts +1 -1
  51. package/dist/_esm5.processed/core/stream/representation/append_segment_to_buffer.js +1 -1
  52. package/dist/_esm5.processed/core/stream/representation/downloading_queue.d.ts +3 -3
  53. package/dist/_esm5.processed/core/stream/representation/force_garbage_collection.js +2 -5
  54. package/dist/_esm5.processed/core/stream/types.d.ts +5 -5
  55. package/dist/_esm5.processed/default_config.d.ts +1 -1
  56. package/dist/_esm5.processed/errors/error_codes.d.ts +7 -7
  57. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.js +5 -5
  58. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/types.d.ts +2 -2
  59. package/dist/_esm5.processed/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.js +1 -1
  60. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.d.ts +1 -1
  61. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/capabilities.d.ts +1 -1
  62. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.d.ts +1 -1
  63. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/index.d.ts +1 -1
  64. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.d.ts +1 -1
  65. package/dist/_esm5.processed/experimental/tools/mediaCapabilitiesProber/types.d.ts +1 -1
  66. package/dist/_esm5.processed/features/types.d.ts +10 -10
  67. package/dist/_esm5.processed/manifest/period.d.ts +1 -1
  68. package/dist/_esm5.processed/manifest/types.d.ts +1 -1
  69. package/dist/_esm5.processed/parsers/manifest/dash/common/infer_adaptation_type.d.ts +1 -1
  70. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_adaptation_sets.d.ts +1 -1
  71. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_mpd.d.ts +1 -1
  72. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_periods.d.ts +2 -2
  73. package/dist/_esm5.processed/parsers/manifest/dash/common/parse_representations.d.ts +1 -1
  74. package/dist/_esm5.processed/parsers/manifest/dash/node_parser_types.d.ts +1 -1
  75. package/dist/_esm5.processed/parsers/manifest/dash/parsers_types.d.ts +2 -2
  76. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.js +1 -1
  77. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.js +2 -4
  78. package/dist/_esm5.processed/parsers/manifest/dash/wasm-parser/ts/parsers_stack.d.ts +2 -2
  79. package/dist/_esm5.processed/parsers/manifest/local/types.d.ts +2 -2
  80. package/dist/_esm5.processed/parsers/manifest/metaplaylist/metaplaylist_parser.d.ts +1 -1
  81. package/dist/_esm5.processed/parsers/manifest/types.d.ts +2 -2
  82. package/dist/_esm5.processed/parsers/texttracks/ttml/get_styling.d.ts +1 -1
  83. package/dist/_esm5.processed/parsers/texttracks/types.d.ts +2 -2
  84. package/dist/_esm5.processed/public_types.d.ts +14 -14
  85. package/dist/_esm5.processed/transports/dash/image_pipelines.js +1 -1
  86. package/dist/_esm5.processed/transports/smooth/isobmff/create_init_segment.d.ts +1 -1
  87. package/dist/_esm5.processed/transports/smooth/pipelines.js +1 -1
  88. package/dist/_esm5.processed/transports/types.d.ts +11 -11
  89. package/dist/_esm5.processed/utils/assert.d.ts +1 -1
  90. package/dist/_esm5.processed/utils/deep_merge.d.ts +2 -2
  91. package/dist/_esm5.processed/utils/event_emitter.d.ts +2 -2
  92. package/dist/_esm5.processed/utils/logger.d.ts +2 -2
  93. package/dist/_esm5.processed/utils/request/fetch.js +1 -1
  94. package/dist/_esm5.processed/utils/task_canceller.d.ts +1 -1
  95. package/dist/rx-player.js +69 -70
  96. package/dist/rx-player.min.js +1 -1
  97. package/package.json +20 -20
  98. package/sonar-project.properties +1 -1
  99. package/src/compat/browser_detection.ts +15 -5
  100. package/src/core/api/public_api.ts +2 -2
  101. package/src/core/decrypt/content_decryptor.ts +13 -15
  102. package/src/core/fetchers/segment/prioritized_segment_fetcher.ts +3 -1
  103. package/src/core/init/load_on_media_source.ts +5 -7
  104. package/src/core/stream/representation/force_garbage_collection.ts +1 -4
  105. package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +6 -5
  106. package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +2 -4
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see rx-player.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return h},YM:function(){return s},fq:function(){return o},gM:function(){return f},kD:function(){return u},op:function(){return c},uz:function(){return v},vS:function(){return p},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=(!a.Z&&/Web0S/.test(navigator.userAgent),!a.Z&&/WebOS.TV-2021/.test(navigator.userAgent)),v=!a.Z&&/WebOS.TV-2022/.test(navigator.userAgent),p=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),h=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}();if(!s.Z){var d=window.MSMediaKeys;void 0!==d&&void 0!==d.prototype&&"function"==typeof d.isTypeSupported&&"function"==typeof d.prototype.createSession&&(r=d)}var f,v=n(4578),p=n(6716),h=n(3071),m=n(3505),g=n(1959),y=n(1381),_=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new p.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,v.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,h.T)(y.GJ(n._ss),y.GV(n._ss),y.Xe(n._ss)).pipe((0,m.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(g.Z),b=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(f=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(g.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(g.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return R(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==f){var F={isTypeSupported:function(e,t){if(void 0===f)throw new Error("No MozMediaKeys API.");return void 0!==t?f.isTypeSupported(e,t):f.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===f)throw new Error("No MozMediaKeys API.");return new f(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},1381:function(e,t,n){"use strict";n.d(t,{XR:function(){return E},w0:function(){return w},it:function(){return k},O0:function(){return A},Oh:function(){return N},M4:function(){return V},Q1:function(){return I},GV:function(){return L},Xe:function(){return B},GJ:function(){return O},eX:function(){return U},K4:function(){return x},gg:function(){return D},bQ:function(){return z},Q$:function(){return F},UG:function(){return M},ep:function(){return C},ym:function(){return R},UA:function(){return Z},_E:function(){return P}});var r=n(2401),i=n(1480),a=n(2967),o=new i.y(a.Z);var s=n(3071),u=n(6872),l=n(6923),c=n(1946),d=n(8894),f=n(5095),v=n(2203),p=n(5059),h=["","webkit","moz","ms"],m=v.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function g(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function y(e,t){return e.reduce((function(e,n){return e.concat((null==t?h:t).map((function(e){return e+n})))}),[])}function _(e){var t,n=y(e);return function(e,r,i){if(!i.isCancelled){if(e instanceof HTMLElement){if(void 0===t&&(t=g(e,n)),!(0,l.Z)(t))return void 0;e.addEventListener(t,r),i.register((function(){void 0!==t&&e.removeEventListener(t,r)}))}n.forEach((function(t){e.addEventListener(t,r),i.register((function(){e.removeEventListener(t,r)}))}))}}}function b(e,t){var n,i=y(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=g(e,i)),(0,l.Z)(n)?(0,r.R)(e,n):o):s.T.apply(void 0,i.map((function(t){return(0,r.R)(e,t)})))}}function T(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,l.Z)(t)?t+"Hidden":"hidden",i=(0,l.Z)(t)?t+"visibilitychange":"visibilitychange",a=document[r],o=(0,f.ZP)(!a);return K(document,i,(function(){var e=!document[r];o.setValueIfChanged(e)}),e),e.register((function(){o.finish()})),o}function E(e){var t,n=T(e),r=(0,f.ZP)(!0);return e.register((function(){clearTimeout(t),t=void 0,r.finish()})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=u.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){r.setValueIfChanged(!1)}),n)}r.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),r}function S(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function w(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=(0,f.ZP)({isEnabled:r,pipWindow:null});return K(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),t.register((function(){i.finish()})),i}var a=document.pictureInPictureElement===n,o=(0,f.ZP)({isEnabled:a,pipWindow:null});return K(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),K(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),t.register((function(){o.finish()})),o}function k(e,t){var n,r=T(t),i=(0,f.ZP)(!0);return t.register((function(){clearTimeout(n),n=void 0,i.finish()})),r.onUpdate(a,{clearSignal:t}),e.onUpdate(a,{clearSignal:t}),a(),i;function a(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||r.getValue())i.setValueIfChanged(!0);else{var t=u.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){i.setValueIfChanged(!1)}),t)}}}function A(e,t,n){var r=(0,f.ZP)(e.clientWidth*m),i=d.Z;t.onUpdate(o,{clearSignal:n}),K(window,"resize",o,n);var a=window.setInterval(o,2e4);return o(),n.register((function(){i(),clearInterval(a),r.finish()})),r;function o(){i();var n=t.getValue();if(n.isEnabled)if((0,c.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var a=n.pipWindow,o=S(e,a),s=function(){r.setValueIfChanged(S(e,a)*m)};a.addEventListener("resize",s),i=function(){a.removeEventListener("resize",s),i=d.Z},r.setValueIfChanged(o*m)}else r.setValueIfChanged(e.clientWidth*m)}}var x=b(["loadedmetadata"]),I=(b(["seeking"]),b(["seeked"]),b(["ended"]),b(["timeupdate"]),b(["fullscreenchange","FullscreenChange"],h.concat("MS"))),Z=function(e){return(0,s.T)(b(["addtrack"])(e),b(["removetrack"])(e))},R=b(["sourceopen","webkitsourceopen"]),M=b(["sourceclose","webkitsourceclose"]),C=b(["sourceended","webkitsourceended"]),P=b(["update"]),D=b(["onremovesourcebuffer"]),N=b((0,p.Z)()?["needkey"]:["encrypted","needkey"]),O=b(["keymessage","message"]),L=b(["keyadded","ready"]),B=b(["keyerror","error"]),U=b(["keystatuseschange"]),F=_(["seeking"]),z=_(["seeked"]),V=_(["ended"]);function K(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return(r.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,DEFAULT_MAX_VIDEO_BUFFER_SIZE:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:5e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_CDN_DOWNGRADE_TIME:60,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after:5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l=e[u];void 0===l&&(l={},e[u]=l),o(l,s[u])}else{var c;(0,i.Z)(e,((c={})[u]=s[u],c))}return o.apply(void 0,[e].concat(n))}var s=function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}(),u=new s},6796:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4578),i=n(3666);var a=n(1959),o=n(7829);function s(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function u(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:c,nativeTrack:a})}return n}function l(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var d=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?u(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?c(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?l(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){f(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){p(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return v(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else f(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void f(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return v(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}f(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else p(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&p(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=u(e._nativeAudioTracks);if(s(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=u(e._nativeAudioTracks);if(s(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=l(e._nativeTextTracks);if(s(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=l(e._nativeTextTracks);if(s(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=c(e._nativeVideoTracks);if(s(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=c(e._nativeVideoTracks);if(s(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){!function(e,t){for(var n=0;n<e.length;n++)i.yS&&n===t||(e[n].enabled=!1);t<0||t>=e.length||(e[t].enabled=!0)}(this._audioTracks.map((function(e){return e.nativeTrack})),e)},t}(a.Z);function f(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function v(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function p(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7425:function(e,t,n){"use strict";n.d(t,{u:function(){return At},Z:function(){return It}});var r=n(5861),i=n(4578),a=n(4687),o=n.n(a),s=n(1381),u=n(3887),l=n(6490),c=n(4791),d=n(6968),f=n(3635),v=(0,d.pX)((0,f.tG)("pssh"),0);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,c.Z)(t.data,r.data))return!0}return!1}function h(e){var t=e.initData,n=e.initDataType;if(null==t)return u.Z.warn("Compat: No init data found on media encrypted event."),null;var r=function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,d.pX)(e,n+4)!==v)return u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,d.pX)(new Uint8Array(e),n);if(n+r>e.length)return u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,l.Y)(i,8),data:i};p(t,a)?u.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:r}}var m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,s=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:s,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:u.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),u.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(u.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(u.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){u.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return M=(0,r.Z)(o().mark((function e(t,n,i,a){var s,l,c,d,f,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v=function(){return v=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return u.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.prev=5,e.next=8,t.closeSession(s.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===s.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(s.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),v.apply(this,arguments)},f=function(){return v.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(u.Z.info("DRM: Creating persistent MediaKeySession"),s=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:s});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(s.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=19;break}return u.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),t.removeSessionWithoutClosingIt(s.mediaKeySession),d=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!c||!I(s.mediaKeySession)){e.next=23;break}return n.add(i,i.keyIds,s.mediaKeySession),u.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:s});case 23:return u.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",f());case 27:return e.prev=27,e.t0=e.catch(9),u.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",f());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),M.apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var s,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(s=d.mediaKeySession)){e.next=10;break}return u.Z.info("DRM: Reuse loaded session",s.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:s,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===s){e.next=16;break}return e.next=14,l.closeSession(s);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);function L(){return!(O.gM||O.uz)}var B=n(9592);function U(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function F(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,B.Z)(o,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,B.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function z(e,t,n){u.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=U(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return u.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var s=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];if(null!=r)n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}}));else{var i=function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=s.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=s[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=F(i,c),u.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+s.length),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,u.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),u.Z.debug("DRM: Rejected access to keysystem",a,t+1),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var V=n(2297);function K(e,t,n){var r;u.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){u.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,d.pX)(e,i+4)!==v)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,d.pX)(new Uint8Array(e),i);if(i+a>e.length)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,V.Xj)(o),l=null===s?void 0:o[s[1]];u.Z.info("Compat: CENC PSSH found with version",l),void 0===l?u.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,d.zo)(n,o):1===l?(u.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):u.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,d.zo)(r,o);i+=a}if(i!==e.length)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,d.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return u.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function G(e,t){return H.apply(this,arguments)}function H(){return H=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)}))),H.apply(this,arguments)}var W=n(7864);function j(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,W.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",u.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,W.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}var q=n(811);function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $(e,t){return e===t||(0,c.Z)(e,t)}function Q(e,t){return t.some((function(t){return $(t,e)}))}function J(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return $(t,e)})))return{v:!1}},i=Y(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return te(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ne=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=ee(this._keyIds);!(t=n()).done;){if($(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t&&t.length>0){if(null!==this._keyIds&&J(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return J(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?J(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function re(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ie(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ae=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ne(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){u.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),u.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=re(this._storage);case 1:if((s=a()).done){e.next=8;break}if((l=s.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return u.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=re(this._storage);case 1:if((a=i()).done){e.next=8;break}if((s=a.value).mediaKeySession!==t){e.next=6;break}return r=s,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return u.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",G(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,G(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=re(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return u.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,u.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.removeSessionWithoutClosingIt=function(e){(0,q.Z)(""===e.sessionId,"Initialized `MediaKeySession`s should always be properly closed");for(var t=this._storage.length-1;t>=0;t--){if(this._storage[t].mediaKeySession===e)return this._storage.splice(t,1),!0}return!1},t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),oe(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function oe(e){return se.apply(this,arguments)}function se(){return(se=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,j(t);case 4:return u.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),u.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var ue=n(9689),le=n(2870),ce=n(6923),de=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,ue.J)(this.initData)},e.decode=function(e){return(0,ue.K)(e)},e}();function fe(e,t){var n,r;return null!==(r=null!==(n=ve(e,t))&&void 0!==n?n:ve(t,e))&&void 0!==r&&r}function ve(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?de.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?de.decode(a.data):a.data.initData;if(!(0,c.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var l=t[i];if(u.systemId===l.systemId){if(u.hash!==l.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?de.decode(u.data):u.data.initData,f=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?de.decode(l.data):l.data.initData;if(!(0,c.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var me=function(){function e(e){!function(e){(0,q.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){u.Z.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?e:""),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){var r;if(!(0,E.Z)(n)&&(0,ce.Z)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,s=this._entries[a];if((null!==(r=s.version)&&void 0!==r?r:-1)>=o&&i===s.sessionId)return;u.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else u.Z.info("DRM-PSS: Add new session",i);var l=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new de(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:l,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new de(e)})),values:l,initDataType:e.type}),this._save()}else u.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];u.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else u.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){u.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(u.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,le.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,ue.J)(e),r=pe(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if($(a.initData,e))return!0}return!1})))return{v:n}}else if(fe(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(fe(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,s=a.initDataHash;if(i.initDataHash===s)try{var l="string"==typeof i.initData?de.decode(i.initData):i.initData.initData;if((0,c.Z)(l,o))return{v:n}}catch(e){u.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var d=r(),f=d.initData,v=d.initDataHash;if(i.initDataHash===v){if(void 0===i.initData.length)return{v:n};if((0,c.Z)(i.initData,f))return{v:n}}break;default:var p=r().initDataHash;if(i.initData===p)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){u.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var ge=new WeakMap,ye=function(e){ge.set(e,null)},_e=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,le.Z)(n);ge.set(e,{hash:r,serverCertificate:n})},be=function(e){var t=ge.get(e);return void 0!==t&&(null!==t||void 0)},Te=function(e,t){var n=ge.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,le.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Ee(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return u.Z.debug("DRM: Set the given license storage"),new me(t)}function Se(e,t,n){return we.apply(this,arguments)}function we(){return(we=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l,c,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,s=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Ee(s),!L()||null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,v=c.loadedSessionsStore,!1!==be(f)&&((0,E.Z)(s.serverCertificate)||!Te(f,s.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:v,persistentSessionsStore:d},options:s});case 12:return e.next=14,ke(l);case 14:return p=e.sent,u.Z.info("DRM: MediaKeys created with success"),h=new ae(p),e.abrupt("return",{mediaKeys:p,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:s});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function xe(){return(xe=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Se(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(u.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ie=n(7326),Ze=n(2146),Re=n(6716),Me=n(9127),Ce=n(7877),Pe=n(9917),De=n(7991),Ne=n(1454),Oe=n(6798),Le=n(7878),Be=n(1819),Ue=n(2566),Fe=n(7845),ze=(0,Be.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ve(e){throw new ze(e)}var Ke=n(278),Ge=n(9878),He=n(3071),We=n(8474);var je=n(1545),qe=n(2817),Ye=n(3505),Xe=n(2034),$e=n(2006),Qe=n(533),Je=n(8117),et=n(6625),tt=n(2572);var nt=n(5561);var rt=n(7904),it=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ie.Z)(r),t.prototype),r.reason=n,r}return(0,i.Z)(t,e),t}((0,Ze.Z)(Error)),at="expired",ot="internal-error",st="output-restricted";function ut(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],c=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],d=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,f.wO)(t):t}(n,new Uint8Array(r[1])),v={keyId:d.buffer,keyStatus:i};switch(i){case at:var p=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new it(p);case"fallback":u.push(d);break;default:"continue"===s||void 0===s?l.push(d):(0,rt.Z)(s)}c.push(v);break;case ot:if(!0!==a.keyInternalError)throw new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});c.push(v),u.push(d);break;case st:if(!0!==a.keyOutputRestricted)throw new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});c.push(v),u.push(d);break;default:l.push(d)}})),c.length>0&&(r=new g.Z("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:c})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var lt=s.Xe,ct=s.GJ,dt=s.eX,ft=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ie.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ze.Z)(Error));function vt(e,t,n){u.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Re.x,o=t.getLicenseConfig,s=void 0===o?{}:o,l=lt(e).pipe((0,Me.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=dt(e).pipe((0,Ce.z)((function(r){return function(e,t,n,r){u.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Pe.P)((function(){return(0,nt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?je.E:(0,Je.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Me.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ge.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,ce.Z)(e.message)&&(t.message=e.message),t})));return(0,He.T)(pt(e,t,n),i)}(e,t,n,r)}))),d=ct(e).pipe((0,Ce.z)((function(n){var r=new Uint8Array(n.message),i=(0,ce.Z)(n.messageType)?n.messageType:"license-request";u.Z.info("DRM: Received message event, type "+i,e.sessionId);var o,l,c,d,f,v,p,h,m=(0,Pe.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(s.timeout)?1e4:s.timeout;return(0,Je.Z)(e).pipe(n>=0?function(e,t){var n=(0,Ne.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?Ve:a,s=n.scheduler,u=void 0===s?null!=t?t:De.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Oe.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Fe.f)(t,u,(function(){try{n.unsubscribe(),(0,Le.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe((0,Ue.x)(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),!l&&d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ke.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof ze||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ht(t)})}}}(a,s.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,v=l.shouldRetry,p=l.onRetry,h=0,o.pipe((0,Ge.K)((function(e,t){if(!(0,E.Z)(v)&&!v(e)||h++>=f)throw e;"function"==typeof p&&p(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,tt.Z)(n);return(0,et.H)(r).pipe((0,Ce.z)((function(){return t})))})))).pipe((0,Me.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ge.K)((function(e){var t=ht(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw u.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new ft(t);throw t})))}))),f=(0,He.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(u.Z.info("DRM: No message given, skipping session.update"),je.E):function(e,t){return u.Z.info("DRM: Updating MediaKeySession with message"),(0,Je.Z)(e.update(t)).pipe((0,Ge.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,$e.b)((function(){u.Z.info("DRM: MediaKeySession update succeeded.")})),(0,Qe.l)())}(e,t.value.license);default:return(0,qe.of)(t)}},(0,We.m)(i)?(0,Ce.z)(r,i,1):(0,Ce.z)(r,1))),v=(0,He.T)(pt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?v:v.pipe((0,Ye.R)((0,Je.Z)(e.closed)))}function pt(e,t,n){return(0,Pe.P)((function(){if(0===e.keyStatuses.size)return je.E;var r=ut(e,t,n),i=r.warning,a=r.blacklistedKeyIds,o=r.whitelistedKeyIds,s=(0,qe.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIds:a}});return void 0!==i?(0,Xe.z)((0,qe.of)({type:"warning",value:i}),s):s}))}function ht(e){if(e instanceof ze)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,ce.Z)(e.message)&&(t.message=e.message),t}var mt=n(9822);function gt(e,t){return yt.apply(this,arguments)}function yt(){return(yt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),u.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function _t(e,t){return bt.apply(this,arguments)}function bt(){return(bt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==be(t)){e.next=3;break}return u.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return u.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return u.Z.info("DRM: Setting server certificate on the MediaKeys"),ye(t),e.prev=8,e.next=11,gt(t,n);case 11:return r=e.sent,_e(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,mt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function Tt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;u.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var Et=n(9252);var St=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return d.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return fe(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,le.Z)(n)}}))),this._lazyFormattedValues},e}();function wt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var At,xt=s.Oh,It=function(e){function t(t,n){var r;r=e.call(this)||this,u.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:At.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=xt(t).subscribe((function(e){u.Z.debug("DRM: Encrypted event received from media element.");var t=h(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return xe.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,Et.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,Et.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,Et.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===At.Initializing&&(r._stateData={state:At.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==At.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)u.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,s=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:s,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:At.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(u.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,_t(s,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:u=e._stateData.state,e._stateData={state:At.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},u!==At.ReadyForContent&&e.trigger("stateChange",At.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:At.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new St(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,l,c,d,v,p,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(s=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?u.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):Mt(t.content.manifest,t),e.abrupt("return");case 10:return s.record.associateKeyIds(l),void 0!==t.content&&(u.Z.hasLevel("DEBUG")&&(c=l.reduce((function(e,t){return e+", "+(0,f.ci)(t)}),""),u.Z.debug("DRM: Blacklisting new key ids",c)),Rt(t.content.manifest,[],l,[])),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}d=t.content.period,v=this._currentSessions.filter((function(e){return"created-session"===e.source})),Dt(p=new Set,d),h=wt(v);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(p),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(p.values()),k=wt(T);!(A=k()).done;)Q(x=A.value,b.keyStatuses.whitelisted)||Q(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return Rt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted,[]),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":Zt(r)?I="persistent-license":(u.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=vt(L,a,r.keySystem).subscribe({next:function(e){if("warning"!==e.type){var n=Ct(t,N.record,a.singleLicensePer,"created-session"===N.source,e.value.whitelistedKeyIds,e.value.blacklistedKeyIds);if(N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;Tt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&Rt(t.content.manifest,n.whitelisted,n.blacklisted,[]),G._unlockInitDataQueue()}else G.trigger("warning",e.value)},error:function(e){var n;if(e instanceof it){u.Z.warn("DRM: A session's closing condition has been triggered"),G._lockInitDataQueue();var r=G._currentSessions.indexOf(N);return r>=0&&G._currentSessions.splice(r),void 0!==t.content&&Rt(t.content.manifest,[],[],N.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(L.sessionId),i.loadedSessionsStore.closeSession(L).catch((function(e){var t=e instanceof Error?e:"unknown error";u.Z.warn("DRM: failed to close expired session",t)})).then((function(){return G._unlockInitDataQueue()})).catch((function(e){return G._onFatalError(e)})),void(G._isStopped()||G.trigger("warning",e.reason))}if(e instanceof ft){if(N.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;u.Z.info("DRM: blacklisting Representations based on protection data."),Mt(a,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(u.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(u.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),Mt(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var s=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return $(t,e)})))return{v:!0}},i=Y(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,s)}else{var l=i.keyStatuses.whitelisted;o=!J(e.keyIds,l)}if(o)return void 0===e.content?(u.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(u.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),Rt(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return u.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?u.Z.error("DRM: Unable to remove processed init data: not found."):(u.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown decryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:At.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===At.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===At.Disposed||this._stateData.state===At.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):u.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function Zt(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function Rt(e,t,n,r){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var i=e.contentProtections.keyIds;if(void 0!==i)for(var a=0;a<i.length;a++){for(var o=i[a],s=0;s<n.length;s++)if($(n[s],o.keyId))return!1;for(var u=0;u<t.length;u++)if($(t[u],o.keyId))return!0;for(var l=0;l<r.length;l++)if($(r[l],o.keyId))return}return e.decipherable}))}function Mt(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i=null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[],a=function(e){if((void 0===t.type||i[e].type===t.type)&&t.values.getFormattedValues().every((function(t){return i[e].values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,c.Z)(e.data,t.data)}))})))return{v:!1}},o=0;o<i.length;o++){var s=a(o);if("object"==typeof s)return s.v}return e.decipherable}))}function Ct(e,t,n,r,i,a){for(var o,s,l=[].concat(i,a),c=function(){var e=s.value;l.some((function(t){return $(t,e)}))||(u.Z.hasLevel("DEBUG")&&u.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,f.ci)(e)),l.push(e))},d=wt(t.getAssociatedKeyIds());!(s=d()).done;)c();if(void 0!==n&&"init-data"!==n){var v=e.keyIds,p=e.content;if(void 0!==v){var h=v.filter((function(e){return!l.some((function(t){return $(t,e)}))}));h.length>0&&(u.Z.hasLevel("DEBUG")&&u.Z.debug("DRM: init data keys missing in the license, blacklisting them",h.map((function(e){return(0,f.ci)(e)})).join(", ")),l.push.apply(l,h))}if(r&&void 0!==p)if("content"===n){for(var m,g=new Set,y=wt(p.manifest.periods);!(m=y()).done;){Dt(g,m.value)}Pt(g,l)}else if("periods"===n)for(var _,b=wt(p.manifest.periods);!(_=b()).done;){var T=_.value,E=new Set;if(Dt(E,T),(null===(o=e.content)||void 0===o?void 0:o.period.id)===T.id)Pt(E,l);else for(var S=Array.from(E),w=function(){var e=A[k];if(l.some((function(t){return $(t,e)})))return Pt(E,l),"break"},k=0,A=S;k<A.length;k++){if("break"===w())break}}}return{whitelisted:i,blacklisted:l.slice(i.length)}}function Pt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return $(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Dt(e,t){for(var n,r=wt(t.getAdaptations());!(n=r()).done;)for(var i,a=wt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=wt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(At||(At={}))},1266:function(e,t,n){"use strict";var r=n(7425);t.ZP=r.Z},770:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(2034),v=n(9917),p=n(8117),h=n(5561);var m=n(3774),g=n(1381);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,v.P)((function(){return(0,h.Z)((function(){return(0,p.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$l)(!1),v=(0,T.$l)(!1),p=function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){var e="function"==typeof r?r():r;b.Z.info("Init: Set initial time",e),n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0}));return{seekAndPlay$:p.pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.getReference().asObservable());var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.getReference().asObservable()).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(v.setValue(!0),v.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),v.setValue(!0),v.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:v,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(1545),i=n(5583),a=n(4975),o=n(4727),s=n(7877),u=n(4978),l=n(2817),c=n(3071),d=n(533),f=n(5767),v=n(1480),p=n(3887);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(342),b=n(2447);function T(e){var t=e.autoPlay,n=e.keySystems,T=e.mediaElement,E=e.playbackObserver,S=e.speed,w=e.startAt,k=e.url;if((0,f.Z)(T),null==k)throw new Error("No URL for a DirectFile content");var A=function(e,t){return new v.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,f.Z)(e)}}))}(T,k),x=(0,g.Z)({mediaElement:T,playbackObserver:E,startTime:function(){p.Z.debug("Init: Calculating initial time");var e=function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return p.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(T,w);return p.Z.debug("Init: Initial time calculated:",e),e},mustAutoPlay:t}),I=x.seekAndPlay$,Z=(0,y.Z)(T,n,r.E,A).pipe((0,h.Z)(),(0,i.B)()),R=(0,b.Z)(T),M=E.getReference().asObservable(),C=(0,_.Z)(E,null,S,r.E,r.E),P=Z.pipe((0,a.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,o.q)(1),(0,s.z)((function(){return I})),(0,u.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,m.Z)(M,T,null,!0)})));return(0,c.T)(P,Z.pipe((0,d.l)()),R,C)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3071),i=n(9127),a=n(1480),o=n(1381),s=n(6139);var u=n(5157),l=n(7874),c=n(3887),d=n(7425),f=o.Oh;function v(e,t,n,o){var v=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof s.N)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var p=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new p(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=o.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var s=n.subscribe((function(e){a.onInitializationData(e)}));return function(){s.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},342:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3286),c=n(3666).yS,d=n(6872),f=n(3714),v=n(3887),p=n(2829),h=n(288),m=n(8567),g=1/60;function y(e,t,n,f,h){var y,E=h.pipe((0,r.M)(e.getReference().asObservable()),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return _(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return _(t)&&e.splice(a,0,t),e;_(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),S=null,w=null,k=f.pipe((0,r.M)(e.getReference().asObservable()),(0,a.b)((function(t){var r,i=t[0],a=t[1];if(!(!a.rebuffering||a.paused||n.getValue()<=0||"audio"!==i.bufferType&&"video"!==i.bufferType)){var o=a.position,s=null!==(r=a.rebuffering.position)&&void 0!==r?r:o,u=i.period.start;o<u&&Math.abs(s-u)<1&&(v.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(u+.001))}})),(0,o.l)()),A=new T(e,n),x=e.getReference().asObservable().pipe((0,r.M)(E),(0,s.U)((function(r){var i,a=r[0],o=r[1],s=a.buffered,u=a.position,l=a.readyState,f=a.rebuffering,h=a.freezing,_=d.Z.getCurrent(),T=_.BUFFER_DISCONTINUITY_THRESHOLD,E=_.FORCE_DISCONTINUITY_SEEK_DELAY,k=_.FREEZING_STALLED_DELAY,x=_.UNFREEZING_SEEK_DELAY,I=_.UNFREEZING_DELTA_POSITION;if(!a.seeking&&c&&null===w&&null!==S&&a.position<S){v.Z.debug("Init: the device appeared to have seeked back by itself.");var Z=performance.now();w=Z}if(S=a.seeking?Math.max(null!==(i=a.pendingInternalSeek)&&void 0!==i?i:0,a.position):null,null!==h){var R=performance.now();if(R-(null===y?h.timestamp:y.attemptTimestamp)>x&&(v.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+I),y={attemptTimestamp:R}),R-h.timestamp>k)return null===f||null!==w?A.stopRebuffering():A.startRebuffering(),{type:"stalled",value:"freezing"}}else y=null;if(null===f)return A.stopRebuffering(),1===l?{type:"stalled",value:a.seeking?null!==a.pendingInternalSeek?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var M="seeking"===f.reason&&null!==a.pendingInternalSeek?"internal-seek":f.reason;if(null!==w){var C=performance.now();if(C-w<E)return A.stopRebuffering(),v.Z.debug("Init: letting the device get out of a stall by itself"),{type:"stalled",value:M};v.Z.warn("Init: ignored stall for too long, checking discontinuity",C-w)}if(w=null,A.startRebuffering(),null===t)return{type:"stalled",value:M};var P=f.position;if(null!=P&&n.getValue()>0){var D=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-g)if(null===d){var f=t.getPeriodAfter(a);null!==f?o=f.start+g:v.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+g&&(o=d+g);void 0!==o&&(v.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(o,t,P);if(null!==D){var N=D+.001;if(!(N<=e.getCurrentTime()))return v.Z.warn("SA: skippable discontinuity found in the stream",u,N),e.setCurrentTime(N),m.Z.warning(b(P,N));v.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),N)}}var O=null!=P?P:u,L=(0,p.XS)(s,O);if(n.getValue()>0&&L<T){var B=O+L+g;if(e.getCurrentTime()<B)return v.Z.warn("Init: discontinuity encountered inferior to the threshold",O,B,T),e.setCurrentTime(B),m.Z.warning(b(O,B))}for(var U=t.periods.length-2;U>=0;U--){var F=t.periods[U];if(void 0!==F.end&&F.end<=O){if(t.periods[U+1].start>O&&t.periods[U+1].start>e.getCurrentTime()){var z=t.periods[U+1];return e.setCurrentTime(z.start),m.Z.warning(b(O,z.start))}break}}return{type:"stalled",value:M}})));return(0,u.T)(k,x).pipe((0,l.x)((function(){A.dispose()})))}function _(e){return null!==e.discontinuity}function b(e,t){return new f.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var T=function(){function e(e,t){this._speedUpdateCanceller=new h.ZP,this._isRebuffering=!1,this._playbackObserver=e,this._isDisposed=!1,this._speed=t,this._updateSpeed()}var t=e.prototype;return t.startRebuffering=function(){this._isRebuffering||this._isDisposed||(this._isRebuffering=!0,this._speedUpdateCanceller.cancel(),v.Z.info("Init: Pause playback to build buffer"),this._playbackObserver.setPlaybackRate(0))},t.stopRebuffering=function(){this._isRebuffering&&!this._isDisposed&&(this._isRebuffering=!1,this._speedUpdateCanceller=new h.ZP,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){v.Z.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2401),i=n(7877),a=n(3714),o=n(1946);function s(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){var t,n,r=e.error;switch((0,o.Z)(r)||(t=r.code,n=r.message),t){case 1:throw n=null!=n?n:"The fetching of the associated resource was aborted by the user's request.",new a.Z("MEDIA_ERR_ABORTED",n);case 2:throw n=null!=n?n:"A network error occurred which prevented the media from being successfully fetched",new a.Z("MEDIA_ERR_NETWORK",n);case 3:throw n=null!=n?n:"An error occurred while trying to decode the media resource",new a.Z("MEDIA_ERR_DECODE",n);case 4:throw n=null!=n?n:"The media resource has been found to be unsuitable.",new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",n);default:throw n=null!=n?n:"The HTMLMediaElement errored due to an unknown reason.",new a.Z("MEDIA_ERR_UNKNOWN",n)}})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(4578),i=n(3887),a=n(9612),o=n(4309),s=function(e){function t(){var t;return i.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new o.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t,n;if(i.Z.debug("ISB: appending new data."),null===e.data.chunk)return Promise.resolve();var r=e.data,a=r.appendWindow,o=r.chunk,s=o.start,u=o.end,l=o.timescale,c=null!==(t=a[0])&&void 0!==t?t:0,d=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(c,f),h=Math.min(d,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return i.Z.info("ISB: ignored image data remove order",e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){i.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(a.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(4578),i=n(1381),a=n(3887),o=n(5095),s=n(2203).Z?void 0:window.ResizeObserver;var u=n(6872),l=n(288),c=n(9612),d=n(4309),f=n(7874);function v(e,t){return Math.abs(e-t)<=.2}function p(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function h(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function m(e,t,n){var r=Math.max(e.start,t),i=p(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=h(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var g=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=h(a.cues,n),a.start=n;else{var o=m(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=p(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||v(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=h(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(v(t,s.start)){if(v(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=h(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(v(n,s.start))return s.start=n,void r.splice(o,0,i);if(v(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=h(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(v(s.end,n))return s.cues=p(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=m(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=p(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function y(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var _=i.M4,b=i.bQ,T=i.Q$;function E(e,t){try{e.removeChild(t)}catch(e){a.Z.warn("HTSB: Can't remove text track: not in the element.")}}function S(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var w=function(e){function t(t,n){var r;return a.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new d.Z,r._videoElement=t,r._textTrackElement=n,r._sizeUpdateCanceller=new l.ZP,r._canceller=new l.ZP,r._buffer=new g,r._currentCues=[],r.autoRefreshSubtitles(r._canceller.signal),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){try{this.pushChunkSync(e)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this.removeBufferSync(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._canceller.cancel()},n.pushChunkSync=function(e){var t,n;a.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk;if(null!==s){var u,l,c=s.start,d=s.end,v=s.data,p=s.type,h=s.language,m=null!==(t=o[0])&&void 0!==t?t:0,g=null!==(n=o[1])&&void 0!==n?n:1/0,y=function(e,t,n,r){a.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=f.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.Z.debug("HTSB: Parser found, parsing...");var o=i(t,n,r);return a.Z.debug("HTTB: Parsed successfully!",o.length),o}(p,v,i,h);if(0!==m&&g!==1/0){for(var _=0;_<y.length&&y[_].end<=m;)_++;for(y.splice(0,_),_=0;_<y.length&&y[_].start<m;)y[_].start=m,_++;for(_=y.length-1;_>=0&&y[_].start>=g;)_--;for(y.splice(_,y.length),_=y.length-1;_>=0&&y[_].end>g;)y[_].end=g,_--}if(void 0!==c)u=Math.max(m,c);else{if(y.length<=0)return void a.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");a.Z.warn("HTSB: No start time given. Guessing from cues."),u=y[0].start}if(void 0!==d)l=Math.min(g,d);else{if(y.length<=0)return void a.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");a.Z.warn("HTSB: No end time given. Guessing from cues."),l=y[y.length-1].end}l<=u?a.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(y,u,l),this._buffered.insert(u,l))}},n.removeBufferSync=function(e,t){a.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._sizeUpdateCanceller.cancel(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)E(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._sizeUpdateCanceller.cancel();for(var t=0;t<this._currentCues.length;t++)E(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=S(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var c=this._currentCues.filter((function(e){return null!==e.resolution}));if(c.length>0){this._sizeUpdateCanceller=new l.ZP({cancelOn:this._canceller.signal});var d=u.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=(0,o.ZP)({height:i,width:u}),c=i,d=u;if(void 0!==s){var f=new s((function(e){if(0!==e.length){var t=e[0].contentRect,n=t.height,r=t.width;n===c&&r===d||(c=n,d=r,l.setValue({height:n,width:r}))}else a.Z.error("Compat: Resized but no observed element.")}));f.observe(e),n.register((function(){f.disconnect()}))}else{var v=setInterval((function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;n===c&&r===d||(c=n,d=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,d,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<c.length;r++){var i=c[r];y(t,n,i.resolution,i.element)}}),{clearSignal:this._sizeUpdateCanceller.signal,emitCurrentValue:!0})}}},n.autoRefreshSubtitles=function(e){var t=this,n=null,r=u.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,i=function(){a(),n=new l.ZP({cancelOn:e});var i=setInterval((function(){return t.refreshSubtitles()}),r);n.signal.register((function(){clearInterval(i)})),t.refreshSubtitles()};function a(){null!==n&&(n.cancel(),n=null)}T(this._videoElement,(function(){a(),t._disableCurrentCues()}),e),b(this._videoElement,i,e),_(this._videoElement,i,e),i()},n.refreshSubtitles=function(){var e,t=u.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL;e=this._videoElement.paused||this._videoElement.playbackRate<=0?this._videoElement.currentTime:Math.max(this._videoElement.currentTime+t/1e3/2,0);var n=this._buffer.get(e);0===n.length?this._disableCurrentCues():this._displayCues(n)},t}(c.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4578),i=n(3666);var a=n(3887);function o(e,t){if(i.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){a.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){a.Z.warn("Compat: Could not remove cue from text track.")}}var s=n(9612),u=n(4309),l=n(7874);var c=function(e){function t(t,n){var r;a.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var o=function(e,t){var n,r,a,o,s="subtitles";if(i.YM){var u=e.textTracks.length;(a=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=a.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=a.SHOWING)&&void 0!==r?r:"showing"}else o=document.createElement("track"),e.appendChild(o),a=o.track,o.kind=s,a.mode=t?"hidden":"showing";return{track:a,trackElement:o}}(t,n),s=o.track,l=o.trackElement;return r.bufferType="text",r._buffered=new u.Z,r._videoElement=t,r._track=s,r._trackElement=l,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t,n;if(a.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return Promise.resolve();var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk,u=s.start,c=s.end,d=s.data,f=s.type,v=s.language,p=null!==(t=o[0])&&void 0!==t?t:0,h=null!==(n=o[1])&&void 0!==n?n:1/0;try{var m,g,y=function(e,t,n,r){a.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=l.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.Z.debug("NTSB: Parser found, parsing...");var o=i(t,n,r);return a.Z.debug("NTSB: Parsed successfully!",o.length),o}(f,d,i,v);if(0!==p&&h!==1/0){for(var _=0;_<y.length&&y[_].endTime<=p;)_++;for(y.splice(0,_),_=0;_<y.length&&y[_].startTime<p;)y[_].startTime=p,_++;for(_=y.length-1;_>=0&&y[_].startTime>=h;)_--;for(y.splice(_,y.length),_=y.length-1;_>=0&&y[_].endTime>h;)y[_].endTime=h,_--}if(void 0!==u)m=Math.max(p,u);else{if(y.length<=0)return a.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),Promise.resolve();a.Z.warn("NTSB: No start time given. Guessing from cues."),m=y[0].startTime}if(void 0!==c)g=Math.min(h,c);else{if(y.length<=0)return a.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),Promise.resolve();a.Z.warn("NTSB: No end time given. Guessing from cues."),g=y[y.length-1].endTime}if(g<=m)return a.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),Promise.resolve();if(y.length>0){var b=y[0],T=this._track.cues;null!==T&&T.length>0&&b.startTime<T[T.length-1].startTime&&this._removeData(b.startTime,1/0);for(var E=0;E<y.length;E++)this._track.addCue(y[E])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this._removeData(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){a.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){a.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var s=r[i],u=s.startTime,l=s.endTime;u>=e&&u<=t&&l<=t&&o(n,s)}this._buffered.remove(e,t)},t}(s.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return _},f:function(){return g}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,d=0;d<l;d++){if(void 0===a)return;var f=e.start(d),v=e.end(d);if(v-f<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,f,v);else{for(var p=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-f<s;)a=t[++n];var g=null,y=n-p;if(y>0){var _=t[p+y-1];g={end:(0,o.Z)(_.bufferedEnd,_.end),precizeEnd:_.precizeEnd},i.Z.debug("SI: "+y+" segments GCed.",u);for(var b,T=c(t.splice(p,y));!(b=T()).done;){var E=b.value;void 0===E.bufferedStart&&void 0===E.bufferedEnd&&this._bufferedHistory.addBufferedSegment(E.infos,null)}n=p}if(void 0===a)return;if(v-(0,o.Z)(a.bufferedStart,a.start)>=s){if(h(a,f,g,u),n===t.length-1)return void m(a,v,u);a=t[++n];for(var S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end),k=d<l-1?e.start(d+1):void 0;void 0!==a&&v-S>=s&&(void 0===k||v-S>=w-k);){var A=t[n-1];void 0===A.bufferedEnd&&(A.bufferedEnd=a.precizeStart?a.start:A.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,A.bufferedEnd,A.end)),a.bufferedStart=A.bufferedEnd,void 0!==(a=t[++n])&&(S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end))}}var x=t[n-1];void 0!==x&&m(x,v,u)}}if(null!=a){i.Z.debug("SI: last segments have been GCed",u,n,t.length);for(var I,Z=c(t.splice(n,t.length-n));!(I=Z()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&this._bufferedHistory.addBufferedSegment(R.infos,null)}}void 0!==u&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+u+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,v=n[d],p=void 0;if(void 0===v)p=o(l.infos),n[d]=((c={})[f]=p,c);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var v=c[f];if(v.start<=s){if(v.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,v.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(v.start===s){if(v.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,v.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,v.end),c.splice(f,0,d),v.start=d.end,v.bufferedStart=void 0,void(v.precizeStart=v.precizeStart&&d.precizeEnd)}if(v.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,v.start,v.end),this._inventory.splice(f+1,0,d),v.end=d.start,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,v.start,v.end);var p={partiallyPushed:v.partiallyPushed,chunkSize:v.chunkSize,splitted:!0,start:d.end,end:v.end,precizeStart:v.precizeStart&&v.precizeEnd&&d.precizeEnd,precizeEnd:v.precizeEnd,bufferedStart:void 0,bufferedEnd:v.end,infos:v.infos};return v.end=d.start,v.splitted=!0,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,p)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}();function v(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function p(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function h(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&v(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,v(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,v(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function m(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&p(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,p(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var g,y=f,_=function(){function e(){this._segmentInventory=new y}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(g||(g={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t,n){"use strict";var r=n(8026),i={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},e)}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i,a){var u;return u=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(u),t.prototype),u.name="EncryptedMediaError",u.type=o.ZB.ENCRYPTED_MEDIA_ERROR,u.code=n,u.message=(0,s.Z)(u.name,u.code,i),u.fatal=!1,"string"==typeof(null==a?void 0:a.keyStatuses)&&(u.keyStatuses=a.keyStatuses),u}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return v},Z:function(){return p}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.cdnMetadata=e.cdnMetadata,this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var r=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var i=this.contentProtections.keyIds;if(void 0===i)this.contentProtections.keyIds=[{keyId:t}];else{for(var a,o=!1,s=c(i);!(a=s()).done;){var d=a.value;(0,l.Z)(d.keyId,t)&&(o=!0)}o||(u.Z.warn("Manifest: found unanounced key id."),i.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,l.Z)(m.data,p[g].data))break;u.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),r=!0)}return r}return this.contentProtections.initData.push({type:e,values:n}),!0},e}(),v=["audio","video","text","image"],p=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,c=[],d=!1,v=0;v<l.length;v++){var p=new f(l[v],{type:this.type});((0,i.Z)(s)||s(p,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(c.push(p),!d&&p.isSupported&&(d=!0))}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=d,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return S}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(9829),c=n(8806),d=n(8999),f=n(1679),v=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new d.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,f.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},t.containsTime=function(e){return e>=this.start&&(void 0===this.end||e<this.end)},e}(),p=n(3887),h=function(){function e(e){this._url=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,url:this._url,time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,privateInfos:{},timescale:1}]},t.getFirstAvailablePosition=function(){},t.getLastAvailablePosition=function(){},t.getEnd=function(){},t.awaitSegmentBetween=function(){return!1},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){p.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){p.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var m=n(5138);function g(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)p.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?p.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):(t.cdnMetadata=i.cdnMetadata,n===r.Full?t.index._replace(i.index):t.index._update(i.index))},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=(0,u.Z)(),T=(0,u.Z)(),E=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=T(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new v(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=y(e.periods);!(n=i()).done;)for(var a,o=n.value,s=y(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=y(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,c.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,c.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,c.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+b(),o="gen-image-rep-"+b(),s=(0,l.$)(r),u=r.substring(0,s),c=r.substring(s),f=new d.Z({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:c})}]},{isManuallyAdded:!0});if(f.representations.length>0&&!f.isSupported){var v=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(v)}return f}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,c=n.closedCaption,f=null!=s?[s]:null!=u?u:[],v=(0,l.$)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(f.map((function(e){var n="gen-text-ada-"+b(),o="gen-text-rep-"+b(),s=new d.Z({id:n,type:"text",language:e,closedCaption:c,representations:[{bitrate:0,cdnMetadata:[{baseUrl:p}],id:o,mimeType:r,codecs:i,index:new h({media:m})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){g(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)p.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");g(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),g(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumSafePosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z);var S=E},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{Qy:function(){return f},Xj:function(){return p},iz:function(){return d},lp:function(){return c},nR:function(){return v},t_:function(){return l},vA:function(){return u}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function c(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function d(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.Z.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var c=i(n,s[0],s[2]),d=u(c,s[1]-s[0]);void 0!==d&&a.push({systemId:d,data:c}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{J6:function(){return m},LD:function(){return h},MM:function(){return p},Qx:function(){return f},R0:function(){return y},Wf:function(){return d},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var v=(0,i.pX)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+p-1]}),l+=h,r+=p}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function v(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function p(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var p=(0,i.QI)(c,d);d+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,_=(512&p)>0,b=(1024&p)>0,T=(2048&p)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,v=d.string;c=f;var p=(0,a.DM)(o,c),h=p.end,m=p.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}function y(e){var t=(0,s.vA)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.t_)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.t_)(n,1701733217)):i=78,null===r)return null;var a=(0,s.vA)(r.subarray(i),[1936289382,1935894633,1952804451]);return null===a||a.byteLength<24?null:a.subarray(8,24)}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var v=(0,i.uR)(e.subarray(t,t+4));t+=4;var p=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a,o=t.periodStart,u=t.periodEnd,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-o*f,p=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,s.zA)(e.initialization.media,l,c),h=void 0===e.media?null:(0,s.zA)(e.media,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:v,initialization:{url:p,range:m},segmentUrlTemplate:h,startNumber:e.startNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._scaledPeriodStart=(0,i.gT)(o,this._index),this._scaledPeriodEnd=null==u?void 0:(0,i.gT)(u,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastAvailablePosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.jH)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i.zG)(r,this._index)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r=e.initialization,i={};return void 0!==t&&(i.isEMSGWhitelisted=t),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=r?r.range:void 0,indexRange:e.indexRange,url:null!==(n=null==r?void 0:r.url)&&void 0!==n?n:null,complete:!0,privateInfos:i,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,v=e.segmentUrlTemplate,p=e.startNumber,h=null!=p?p:1,m=[],g=d.length,y=0;y<g;y++){for(var _=d[y],b=_.duration,T=_.start,E=_.range,S=(0,r.KF)(_,d[y+1],o),w=!1!==e.availabilityTimeComplete||y!==g-1&&0!==S,k=(s=b,u=void 0,(u=l-T)>0?Math.floor(u/s):0),A=T+k*b;A<c&&k<=S;){var x=h+k,I=null===v?null:(0,i.QB)(A,x)(v),Z=A-e.indexTimeOffset,R=b;Z<0&&(R=b+Z,Z=0);var M={id:String(A),time:Z/f,end:(Z+R)/f,duration:R/f,isInit:!1,range:E,timescale:1,url:I,number:x,timestampOffset:-e.indexTimeOffset/f,complete:w,privateInfos:{isEMSGWhitelisted:a}};m.push(M),A=T+ ++k*b}if(A>=c)return m;h+=S+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return o},zA:function(){return a}});var r=n(6923);function i(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function a(e,t,n){return function(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,i(void 0===n?0:n))}(e,t,n)}function o(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return i(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return i(e)(t,n,r)}))}}},4541:function(e,t,n){"use strict";n.d(t,{Z:function(){return We}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=d(r);if(void 0===u)return;a=u}if(void 0!==i){var l=d(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}(e),n=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=c(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=n(9592),p=n(908),h=n(1679),m=n(3635);var g=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),y=n(8999),_=n(5138),b=n(7714),T=n(6923);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(y.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,v=E(d);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,b.Z)(y.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,b.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var v=i(d,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var x=n(8026);var I=n(7403),Z=n(3911),R=n(1915),M=n(4784),C=function(){function e(e,t){var n,r;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var i=t.periodStart,a=t.periodEnd,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=i,this._periodEnd=a;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,c=null!==(n=e.timescale)&&void 0!==n?n:1,d=l-i*c,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,M.zA)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,M.zA)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:c,duration:e.duration,indexTimeOffset:d,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{url:f,range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,R.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,Z.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],v=Math.floor(l/r);v<=d;){var p=i[v].mediaRange,h=i[v].url,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,url:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstAvailablePosition=function(){return this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),D=n(811),N=n(8232),O=n(1091),L=n(5505),B=n(6394);function U(e){return a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e}function F(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.Z)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e){for(var t=[],n=0;n<e.length;n++)t.push(z(e[n]));for(var r=[],i=0;i<t.length;i++){var a=F(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function K(e,t){var n,r=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-c;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(p+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e);var c=t.slice(i);if(s>0){var d=c[0];d.start+=d.duration*s,c[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e);var f=c[c.length-1],v=z(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),V(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(z(e[g]));for(var y=0;y<m.length;y++){var _=F(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==_&&h.push(_)}return c.concat(h)}var G=function(){function e(t,n){var r,i,a,o;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var s=n.availabilityTimeComplete,u=n.manifestBoundsCalculator,l=n.isDynamic,c=n.isLastPeriod,d=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=u,this._isEMSGWhitelisted=h,this._isLastPeriod=c,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=l,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=void 0===(null===(a=t.initialization)||void 0===a?void 0:a.media)?null:(0,M.zA)(t.initialization.media,d,f),_=void 0===t.media?null:(0,M.zA)(t.media,d,f);this._index={availabilityTimeComplete:s,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:y,range:t.initialization.range},segmentUrlTemplate:_,startNumber:t.startNumber,timeline:null!==(o=t.timeline)&&void 0!==o?o:null,timescale:m},this._scaledPeriodStart=(0,Z.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,Z.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.segmentUrlTemplate,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({segmentUrlTemplate:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,Z.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodEnd);return null===t?null:(0,Z.zG)(t,this._index)},t.getEnd=function(){if(!this._isDynamic||!this._isLastPeriod)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,D.Z)(e<=t),!this._isDynamic||!this._isLastPeriod)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var r=this._index,i=r.timeline,a=U(r.timescale),o=(0,Z.gT)(t,this._index);if(i.length>0){var s=i[i.length-1];if((0,Z.jH)(s,null,this._scaledPeriodEnd)+a>=Math.min(o,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0))return!1}return void 0===this._scaledPeriodEnd?o+a>this._scaledPeriodStart&&void 0:(0,Z.gT)(e,this._index)-a<this._scaledPeriodEnd&&o+a>this._scaledPeriodStart},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,Z._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,L.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1];return(0,Z.jH)(t,null,this._scaledPeriodEnd)+U(this._index.timescale)>=this._scaledPeriodEnd},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,Z.gT)(e,this._index),n=(0,N.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}}},e.getIndexEnd=function(e,t){return e.length<=0?null:Math.min((0,Z.jH)(e[e.length-1],null,t),null!=t?t:1/0)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?V(e):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,K(e,t))},e}(),H=G,W=function(){function e(e,t){var n,r,i=t.aggressiveMode,a=t.availabilityTimeOffset,o=t.manifestBoundsCalculator,s=t.isDynamic,u=t.periodEnd,l=t.periodStart,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,v=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=a,this._manifestBoundsCalculator=o,this._aggressiveMode=i;var p=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,h=p-l*v;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var m=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,M.zA)(e.initialization.media,c,d),g=void 0===e.media?null:(0,M.zA)(e.media,c,d);this._index={duration:e.duration,timescale:v,indexRange:e.indexRange,indexTimeOffset:h,initialization:null==e.initialization?void 0:{url:m,range:e.initialization.range},url:g,presentationTimeOffset:p,startNumber:e.startNumber},this._isDynamic=s,this._periodStart=l,this._scaledRelativePeriodEnd=void 0===u?void 0:(u-l)*v,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.url,s=this._periodStart*a,u=this._scaledRelativePeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var v=Math.max(d,l),p=Math.min(f,c);if(p+r<=v)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(v/r),y=g*r;y<=p;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:(0,M.QB)(E,_)(o),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,url:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._getLastSegmentStart();return null==t?t:Math.min(t+this._index.duration,null!==(e=this._scaledRelativePeriodEnd)&&void 0!==e?e:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();if(void 0!==this._scaledRelativePeriodEnd){var e=this._index.timescale;return(this._scaledRelativePeriodEnd+this._periodStart*e)/this._index.timescale}},t.awaitSegmentBetween=function(e,t){if((0,D.Z)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=U(n),i=this._periodStart*n,a=t*n-i;return(void 0===this._scaledRelativePeriodEnd||e*n-i-r<this._scaledRelativePeriodEnd)&&a+r>=0},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledRelativePeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&t+this._index.duration+U(e)>=this._scaledRelativePeriodEnd},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledRelativePeriodEnd=e._scaledRelativePeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var o=this._aggressiveMode?n/r:0;if(null!=this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledRelativePeriodEnd<n?null:(Math.floor(this._scaledRelativePeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledRelativePeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function j(e,t){var n;if(0===t.length)return e;var r=t.map((function(e){return{url:e.value}}));if(0===e.length)return r;for(var i=[],a=0;a<e.length;a++)for(var o=e[a],s=0;s<r.length;s++){var l=r[s],c=(0,u.Z)(o.url,l.url);i.push({url:c,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}function q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function $(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,v=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),p=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=t.aggressiveMode,o=t.availabilityTimeOffset,s=t.manifestBoundsCalculator,u=t.isDynamic,l=t.end,c=t.start,d=t.receivedTime,f=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,p=t.inbandEventStreams,h={aggressiveMode:a,availabilityTimeComplete:!0,availabilityTimeOffset:o,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==p&&p.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:s,isDynamic:u,periodEnd:l,periodStart:c,receivedTime:d,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:f};if(void 0!==e.children.segmentBase){var m=e.children.segmentBase;i=new I.Z(m,h)}else if(void 0!==e.children.segmentList){var g=e.children.segmentList;i=new C(g,h)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var y=t.parentSegmentTemplates.slice(),_=e.children.segmentTemplate;void 0!==_&&y.push(_);var b=x.Z.apply(void 0,[{}].concat(y));h.availabilityTimeComplete=null!==(n=b.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,h.availabilityTimeOffset=(null!==(r=b.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=H.isTimelineIndexArgument(b)?new H(b,h):new W(b,h)}else{var T=t.adaptation.children;if(void 0!==T.segmentBase){var E=T.segmentBase;i=new I.Z(E,h)}else if(void 0!==T.segmentList){var S=T.segmentList;i=new C(S,h)}else i=new W({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},h)}return i}(e,(0,x.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:p,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:v})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,cdnMetadata:j(n.baseURLs,e.children.baseURLs).map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=q(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,c=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===c)e.initData.push({type:"cenc",values:a});else(l=c.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(T.initData).length>0||void 0!==T.keyIds&&T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=X({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=q(e);!(l=f()).done;)d();return c}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ee(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function te(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function ne(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function re(e,t){if((0,T.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,T.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,T.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,T.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,T.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,T.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ie(e){if(null!=e.children.supplementalProperties)for(var t,n=Q(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function ae(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ue=(0,p.Z)();function le(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,E=new g({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||E.setLastPosition(t.duration);for(var S=function(g){var S=g===e.length-1,k=e[g],x=t.xlinkInfos.get(k),I=j(t.baseURLs,k.children.baseURLs),Z=d[g],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==k.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+ue()):P=k.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==x?x.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=k.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=k.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=k.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:E,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},v=[],p={},h=[],m=-1,g=0;g<e.length;g++){var E=e[g],S=E.children,k=S.essentialProperties,x=S.roles,I=S.label,Z=Array.isArray(x)&&x.some((function(e){return"main"===e.value}))&&x.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),R=E.children.representations,M=null!==(n=E.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=(null!==(r=E.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,P=E.attributes.mimeType,D=E.attributes.codecs,N=A(R,(0,T.Z)(P)?P:null,(0,T.Z)(D)?D:null,null!=S.roles?S.roles:null);if(void 0!==N){var O=null!==(i=E.attributes.selectionPriority)&&void 0!==i?i:1,L=E.attributes.id,B=void 0,U=ie(E),F=[];void 0!==t.segmentTemplate&&F.push(t.segmentTemplate),void 0!==E.children.segmentTemplate&&F.push(E.children.segmentTemplate);var z={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:M,availabilityTimeOffset:C,baseURLs:j(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:F,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},V=Array.isArray(k)?(0,s.Z)(k,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,K=null===(a=null==V?void 0:V.value)||void 0===a?void 0:a.split(" "),G=void 0!==K;if("video"===N&&Z&&m>=0&&f.video.length>m&&!G){var H,W=f.video[m][0];z.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(W.id))&&void 0!==l?l:null;var q=$(R,E,z);(H=W.representations).push.apply(H,q),B=W.id}else{var Y=S.accessibilities,X=void 0;void 0!==x&&x.some((function(e){return"dub"===e.value}))&&(X=!0);var J=void 0;"text"!==N?J=!1:void 0!==Y&&(J=Y.some(te));var oe=void 0;"audio"!==N?oe=!1:void 0!==Y&&(oe=Y.some(ee));var se=void 0;"video"!==N?se=!1:void 0!==Y&&(se=Y.some(ne));for(var ue=re(E,{isAudioDescription:oe,isClosedCaption:J,isSignInterpreted:se,isTrickModeTrack:G,type:N});(0,b.Z)(h,ue);)ue+="-dup";B=ue,h.push(ue),z.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(ue))&&void 0!==d?d:null;var le={id:ue,representations:$(R,E,z),type:N,isTrickModeTrack:G};if(null!=E.attributes.language&&(le.language=E.attributes.language),null!=J&&(le.closedCaption=J),null!=oe&&(le.audioDescription=oe),!0===X&&(le.isDub=!0),!0===se&&(le.isSignInterpreted=!0),void 0!==I&&(le.label=I),void 0!==K)v.push({adaptation:le,trickModeAttachedAdaptationIds:K});else{for(var ce,de=-1,fe=function(){var e=ce.value,t=p[e];if(void 0!==t&&t.newID!==B&&(0,b.Z)(t.adaptationSetSwitchingIDs,L)){de=(0,_.Z)(f[N],(function(t){return t[0].id===e}));var n,r=f[N][de];void 0!==r&&r[0].audioDescription===le.audioDescription&&r[0].closedCaption===le.closedCaption&&r[0].language===le.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',L,e),(n=r[0].representations).push.apply(n,le.representations),"video"===N&&Z&&!r[1].isMainAdaptation&&(m=Math.max(m,de)),r[1]={priority:Math.max(O,r[1].priority),isMainAdaptation:Z||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},ve=Q(U);!(ce=ve()).done;)fe();de<0&&(f[N].push([le,{priority:O,isMainAdaptation:Z,indexInMpd:g}]),"video"===N&&Z&&(m=f.video.length-1))}}null!=L&&null==p[L]&&(p[L]={newID:B,adaptationSetSwitchingIDs:U})}}var pe=y.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(ae),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(ae),w(pe,v),pe}(k.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=k.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=oe(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,v=c.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),g=oe(l.children.events);!(u=g()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,b=void 0===y.duration?void 0:_+y.duration/p,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,m.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:T}}})}}return o}(k.children.eventStreams,R,K),H={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(H),!E.lastPositionIsKnown()){var W=function(e){for(var t,n=null,r=!0,i=(0,h.Z)(e).filter((function(e){return null!=e})),a=oe((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=oe(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastAvailablePosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof W){var q=performance.now()/1e3;E.setLastPosition(W,q)}else{var Y=ce(t,R);if(void 0!==Y){var X=Y[0],J=Y[1];E.setLastPosition(X,J)}}else"number"==typeof W&&E.setLastPosition(W)}},k=e.length-1;k>=0;k--)S(k);if(t.isDynamic&&!E.lastPositionIsKnown()){var x=ce(t,0);if(void 0!==x){var I=x[0],Z=x[1];E.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];(void 0===i.duration||i.start+i.duration>r.start)&&(o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,!(i.duration>0));)t.pop(),i=t[t.length-1];t.push(r)}return t}(c)}function ce(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function de(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ve=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var d=t.children,v=t.attributes;if(null==n.externalClockOffset){var p="dynamic"===v.type,h=(0,s.Z)(d.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(p&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<d.periods.length;b++){var T=d.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,c,d,v,p=e.children,h=e.attributes,m="dynamic"===h.type,g=j(void 0!==t.url?[{url:t.url.substring(0,(0,u.$)(t.url))}]:[],p.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=le(p.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(c=0===h.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:h.minimumUpdatePeriod);var A=f(S),x=A.minimumSafePosition,I=A.maximumSafePosition,Z=A.maximumUnsafePosition,R=performance.now();if(m){var M,C;if(d=x,k=null!=_?_:null,void 0!==Z&&(C=Z),void 0!==I)M=I;else{var P=null!=y?y:0,D=t.externalClockOffset;if(void 0===D)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-P;else M=(performance.now()+D)/1e3-P}void 0===C&&(C=M),v={isLinear:!0,maximumSafePosition:M,livePosition:C,time:R},null!==k&&void 0!==d&&M-d>k&&(k=M-d)}else{d=void 0!==x?x:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var N=null!=w?w:1/0;if(void 0!==S[S.length-1]){var O=S[S.length-1],L=null!==(s=O.end)&&void 0!==s?s:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L<N&&(N=L)}void 0!==I&&I<N&&(N=I),v={isLinear:!1,maximumSafePosition:N,livePosition:void 0,time:R}}var B=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=S[S.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:B,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:d,timeshiftDepth:k,maximumTimeData:v},lifetime:c,uris:null==t.url?p.locations:[t.url].concat(p.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=de(f);!(g=y()).done;){var b=g.value;c.set(b,{receivedTime:p,sendingTime:h,url:m})}(s=d.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,c)}}}};function pe(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function he(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}var me=n(7326),ge=n(4578),ye=n(2146),_e=n(9689),be=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Te=/([0-9]+)-([0-9]+)/;function Ee(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ce("`"+t+'` property is not a boolean value but "'+e+'"')]}function Se(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function ke(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ae(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ce("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,T.Z)(e))return[0,new Ce("`"+t+"` property is empty")];var n=be.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,T.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,T.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,T.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,T.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,T.Z)(n[10])?n[10]:"0")+parseFloat((0,T.Z)(n[12])?n[12]:"0"),null]}function Ie(e,t){var n=Te.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ze(e,t){try{return[(0,_e.K)(e),null]}catch(n){return[null,new Ce("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Re(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Me(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ce=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,me.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ge.Z)(t,e),t}((0,ye.Z)(Error));function Pe(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ze(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,m.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function De(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:Ie,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Ne(e){for(var t={},n=[],r=Me(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=De(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:Se,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:we,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:Ee,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:Se,dashName:"startNumber"})}}return[t,n]}function Oe(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Ie,dashName:"mediaRange"})}}return[t,n]}function Le(e){for(var t=Ne(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Oe(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,x.Z)(n,{list:i}),r]}function Be(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ue(e){for(var t,n=Ne(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Be(o))}for(var s=(0,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=Me(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"})}}return[s,i]}function Fe(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=pe(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Re(a));break;case"SegmentBase":var l=Ne(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Le(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ue(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Pe(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:Se,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:Se,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ce("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function ze(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[Re(a)]:t.accessibilities.push(Re(a));break;case"BaseURL":var o=pe(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=he(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Re(a)]:t.essentialProperties.push(Re(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Re(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var c=Fe(a),d=c[0],f=c[1];t.representations.push(d),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Re(a)]:t.roles.push(Re(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Re(a)]:t.supplementalProperties.push(Re(a));break;case"SegmentBase":var v=Ne(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Le(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Ue(a),b=_[0],T=_[1];t.segmentTemplate=b,T.length>0&&(r=r.concat(T));break;case"ContentProtection":var E=Pe(a),S=E[0],w=E[1];w.length>0&&(r=r.concat(w)),void 0!==S&&n.push(S)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:Se,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:Se,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Se,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Se,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Se,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Se,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Se,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:Se,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:ke,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:ke,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ve(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Me(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:Se,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];if("Event"===s.nodeName){var u=Ke(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ke(e){for(var t={eventStreamData:e},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:Se,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ge(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=pe(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=ze(s),f=d[0],v=d[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Ve(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ue(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:xe,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:xe,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function He(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=pe(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ge(s),f=d[0],v=d[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Re(s);i.push(p)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Ae,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ae,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ae,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:xe,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:xe,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:xe,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:xe,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:xe,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:xe,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:xe,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var We=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=He(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m,g=Ge(f[h]),y=g[0],_=g[1];(m=p).push.apply(m,_),v.push(y)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var b=t.value.continue(r);return e(b)}}};(0,r.Z)(t)}(ve(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=v,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=v.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return p;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if("&nbsp;"===c)p[p.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.Z)(_)&&(v.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&v.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),v.appendChild(y)}f.appendChild(v),d.appendChild(f),p.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=v.exec(e),f=p.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&("&nbsp;"===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],v=0;v<d.length;v++){var p=(0,a.Z)(d[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],v=f.name;if("style"===v)e=f.value;else if("region"===v)t=f.value;else{var p=v.substring(4);if((0,i.Z)(u,p)&&(s[p]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(959);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(3791),f=n(1594),v=n(3887),p=n(5336);function h(e,t){var n=t;return(0,l.Z)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=p.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=p.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?v.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else v.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):v.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):v.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):v.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):v.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):v.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=p.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):v.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):v.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):v.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=p.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}var o=document.createTextNode(i);return r.appendChild(o),r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.jF)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),_(v,i),null!==t){var p=(0,d.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,d.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=T(p,i,o);u.push(m)}else if((0,f.OE)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.jg)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var _=p.getAttribute("xml:space"),b=(0,l.Z)(_)?"default"===_:o,E=(0,c.Z)({},i,(0,d.U)(g,[p],n,t));u.push.apply(u,e(p,E,[p].concat(a),b))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return v.appendChild(h),v}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(959),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l=n(1594),c={left:"start",center:"center",right:"end",start:"start",end:"end"},d={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,f),h=p.start,m=p.end,g=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var c=u.trim();u=c=c.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,v),y=(0,i.Z)(h+n,m+n,g);return null===y?null:((0,a.Z)(y)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var l=c[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},959:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(3791),l=n(5138),c=n(7714);var d=n(1594),f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,d.H)(p),m=(0,d.vU)(p),g=(0,d.DM)(p),y=(0,d.kd)(p),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),v=parseInt(d[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:v}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:p*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=p*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,u.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,l.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var d=e[u];(0,c.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(d,u),r.style=(0,a.Z)({},d.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,u.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,u.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,d.jF)(P),N=(0,a.Z)({},R,(0,u.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return p},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1594:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function c(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{DM:function(){return s},H:function(){return a},OE:function(){return l},jF:function(){return i},jg:function(){return c},kd:function(){return u},vU:function(){return o}})},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.Z)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?E(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[p.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(d),d.appendChild(v),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),v=0;v<d.length;v++){var p=(0,o.Z)(d[v],t);if(null!=p){var h=A(p,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,v=(0,o.yE)(n),p=(0,i.Z)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.Z)(p[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},85:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=n(7874),i=n(8791),a=n(5861),o=n(4687),s=n.n(o),u=n(4597),l=n(5278),c=n(9829);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,c.Z)(e.baseUrl,t.url)}function f(e,t,n,r,i){return v.apply(this,arguments)}function v(){return(v=(0,a.Z)(s().mark((function e(t,n,r,i,a){var o,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.segment,l=d(t,o),!o.isInit&&null!==l){e.next=4;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return e.next=6,(0,u.ZP)({url:l,responseType:"arraybuffer",timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i});case 6:return c=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:c});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var h=n(6872),m=n(8750),g=n(3887),y=n(1989),_=n(8026),b=n(3635);function T(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,v=o.externalClockOffset,p=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,T=null!=i?i:v,E={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:p,referenceDateTime:n,externalClockOffset:T},S=r.Z.dashParsers;if(null===S.wasm||"uninitialized"===S.wasm.status||"failure"===S.wasm.status)return g.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),k();var w=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,b.tG)(e).buffer;if(e instanceof Document)return(0,b.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(w)?"initialized"===S.wasm.status?(g.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E))):(g.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),S.wasm.waitForInitialization().catch((function(){})).then((function(){return null===S.wasm||"initialized"!==S.wasm.status?(g.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),k()):(g.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E)))}))):(g.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),k());function k(){if(null===S.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,b.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return A(S.js(e,E))}function A(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new y.ZP(t.value.parsed,e),url:p};var n=t.value,r=n.urls.map((function(e){return c((function(){var t=h.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT;return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",timeout:t,cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",timeout:t,cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,_.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,_.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,m.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,_.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,A(n.continue(e))}))}}}var E=n(7839),S=n(9105),w=n(5992),k=n(1946),A="function"==typeof Headers?Headers:null,x="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,k.Z)(x)&&!(0,k.Z)(A)}var Z=n(8806),R=n(281);function M(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var C=n(288),P=n(4460);function D(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new C.ZP({cancelOn:i}),c=l.signal.register(u);e(t,n,r,l.signal,Object.assign(Object.assign({},a),{onNewChunk:function(e){try{o(e),a.onNewChunk(e)}catch(e){c(),l.cancel(),u(e)}}})).then((function(e){if(!l.isUsed){if(c(),"segment-loaded"===e.resultType)try{o(e.resultData.responseData)}catch(e){return void u(e)}s(e)}}),(function(e){c(),u(e)}))}));function o(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===M(n.adaptation.type,n.representation)&&(0,P.Z)(new Uint8Array(e),n.segment.isInit)}}}var N=n(6968);function O(e,t,n,r,i){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,R.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var a=(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.indexRange)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress});return Promise.all([a,o]).then((function(t){var n=t[0],r=t[1],i=(0,N.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var L=n(8766);function B(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,R.Z)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,k.Z)(e.headers))if((0,k.Z)(A))t=e.headers;else{t=new A;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}g.Z.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,c=performance.now(),d=(0,k.Z)(x)?null:new x;function f(){(0,k.Z)(d)?g.Z.warn("Fetch: AbortController API not available."):d.abort()}void 0!==e.timeout&&(o=window.setTimeout((function(){l=!0,f()}),e.timeout));var v=e.cancelSignal.register((function(e){u=e,f()})),p={method:"GET"};return void 0!==t&&(p.headers=t),p.signal=(0,k.Z)(d)?null:d.signal,fetch(e.url,p).then((function(t){if((0,k.Z)(o)||clearTimeout(o),t.status>=300)throw g.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new S.Z(t.url,t.status,w.br.ERROR_HTTP_CODE);if((0,k.Z)(t.body))throw new S.Z(t.url,t.status,w.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,k.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),u=0;return l();function l(){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function n(){var a,o,d,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,k.Z)(a.value)){n.next=11;break}return u+=a.value.byteLength,o=performance.now(),d={url:t.url,currentTime:o,duration:o-c,sendingTime:c,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(d),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-c,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:c,size:u,status:t.status,url:t.url});case 16:return n.abrupt("return",l());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==u)throw u;if(v(),l)throw g.Z.warn("Fetch: Request timeouted."),new S.Z(e.url,0,w.br.TIMEOUT);if(t instanceof S.Z)throw t;throw g.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new S.Z(e.url,0,w.br.ERROR_EVENT)}))}({url:e,headers:u,onData:function(e){var t=new Uint8Array(e.chunk),n=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,L.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,N.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,N.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==l?(0,N.zo)(l,t):t),a=n[0];l=n[1];for(var o=0;o<a.length;o++)if(r.onNewChunk(a[o]),i.isCancelled)return;r.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),i.isCancelled},timeout:n.timeout,cancelSignal:i}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function U(e,t,n,r,i,a){if(t.segment.isInit)return O(e,t.segment,r,a,i);var o=M(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return B(e,t,r,i,a);(0,Z.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var s=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==s.range?{Range:(0,R.Z)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(6490),z=n(4644),V=408125543,K=357149030;function G(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=q(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=Y(n,l);if(null==c)return null;var d=c,f=l+d.length,v=f+d.value;if(u===e)return[f,v];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return G(e,t.slice(p+1,t.length),n,[f,v])}o=v}return null}function H(e,t){var n=G(2807729,[V,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/X(e,n[0],r)}function W(e,t){var n=G(17545,[V,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function j(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function q(e,t){var n=j(e,t);if(null==n)return g.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return g.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function Y(e,t){var n=j(e,t);if(null==n)return g.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return g.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function X(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var $=n(7403);function Q(e,t,n,r){var i=(0,z.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,z.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&g.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function J(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs,a=null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),o=void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,b.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t);return{inbandEvents:a,needsManifestRefresh:o}}}function ee(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=n.manifest,d=e.data,f=e.isChunked,v=[a.start,a.end];if(null===d)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:v};var p=d instanceof Uint8Array?d:new Uint8Array(d),h=M(o.type,s),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,F.Z)(p);u.isInit&&(y=null!==(i=(0,z.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=s._addProtectionData("cenc",y,_))}if(!u.isInit){var b=m?Q(p,f,u,r):null,T=(0,l.Z)(u.timestampOffset,0);if(m){var E=(0,z.s9)(p);if(void 0!==E){var S=J(E.filter((function(e){return void 0!==u.privateInfos&&void 0!==u.privateInfos.isEMSGWhitelisted&&u.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==S){var w=S.needsManifestRefresh,A=S.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,protectionDataUpdate:g,appendWindow:v}}var x=u.indexRange,I=null;if("webm"===h)I=function(e,t){var n=G(V,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=H(e,r);if(null==a)return null;var o=W(e,r);if(null==o)return null;var s=G(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=G(187,[],e,[l,s[1]]);if(null==c)break;var d=G(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=X(e,d[0],d[1]-d[0]),v=G(241,[183],e,[c[0],c[1]]);if(null==v)return null;var p=X(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(m&&(I=(0,z.Wf)(p,Array.isArray(x)?x[0]:0),!0===t&&null!==I&&I.length>0)){var Z=I[I.length-1];Array.isArray(Z.range)&&(Z.range[1]=1/0)}s.index instanceof $.Z&&null!==I&&I.length>0&&s.index.initializeIndex(I);var R=m?(0,z.LD)(p):"webm"===h?H(p,0):void 0,C=(0,k.Z)(R)?void 0:R;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var te=n(6807);function ne(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):g.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u),c=function(e){var t=(0,te.Le)(e);return null===t?"":(0,b.uR)(t)}(t);return{data:c,type:l,language:s.language,start:i,end:a}}function re(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?g.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration));var u=function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s);return{data:t,type:u,language:o.language,start:r,end:i}}function ie(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=M(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,b.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,z.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,z.LD)(d);return o.index instanceof $.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=Q(d,t,s,r),m=ne(n,d,h,t),g=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,b.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:re(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var ae=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=T(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:D(r);function r(e,r,i,a,o){var s=d(e,r.segment);if(null==s)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return U(s,r,t,i,o,a);var u={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",timeout:i.timeout,url:s};return new Promise((function(e,l){var c=!1,d=n(u,{reject:function(e){var t,n,r;if(!c&&!a.isCancelled){c=!0,a.deregister(f);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new E.Z(o,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);l(s)}},resolve:function(t){c||a.isCancelled||(c=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){c||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){c||a.isCancelled||(c=!0,a.deregister(f),U(s,r,t,i,o,a).then(e,l))}});function f(e){c||(c=!0,"function"==typeof d&&d(),l(e))}a.register(f)}))}}(e),o=ee(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:D(n);function n(e,n,r,i,a){var o=n.adaptation,s=n.representation,l=n.segment,c=l.range,f=d(e,l);if(null===f)return Promise.resolve({resultType:"segment-created",resultData:null});if(l.isInit)return O(f,l,r,i,a);var v=M(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return B(f,n,r,a,i);(0,Z.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return p?(0,u.ZP)({url:f,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,R.Z)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:f,responseType:"text",headers:Array.isArray(c)?{Range:(0,R.Z)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:s,parseSegment:ie(e)},image:{loadSegment:f,parseSegment:p}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return ye}});var r=n(5861),i=n(4687),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(9362),d=n(811),f=n(8232),v=n(3911),p=n(1091),h=n(5505);function m(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,v.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function g(e,t){return e.replace(/\{start time\}/g,String(t))}function y(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function _(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var b=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,v.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},url:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],m=h.duration,b=h.start,T=_(h,s[p+1]),E=y(b,i,m),S=b+E*m,w=c?0:m;S<a&&E<=T&&(null==v||S+w<=v);){var k=S,A=null!=n?n+E:void 0,x={id:String(S),isInit:!1,time:k/u,end:(k+m)/u,duration:m/u,timescale:1,number:A,url:g(l,k),complete:!0,privateInfos:{smoothMediaSegment:{time:k,duration:m}}};d.push(x),S=b+ ++E*m}if(S>=a)return d;null!=n&&(n+=T+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstAvailablePosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastAvailablePosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,v.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.getEnd=function(){if(!this._isLive)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,d.Z)(e<=t),this.isFinished())return!1;var r=this.getLastAvailablePosition();return!(void 0!==r&&t<r)&&(t>(null!==(n=this.getFirstAvailablePosition())&&void 0!==n?n:0)&&void 0)},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,v._j)(this._index,e,void 0)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,p.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof c.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,v.jH)(o,null);if(!((0,v.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,v.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var p=f/c.duration-1,h=c.repeatCount-p;if(h<0)return;o.repeatCount+=h;var m=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(m))}}}},t._update=function(e){(0,h.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)m(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,f.Z)(e.timeline,r)}}},e}(),T=n(8999),E=n(7714),S=n(6968),w=n(6923),k=n(8026),A=n(9829),x=n(3635),I=n(5278),Z=n(2689),R={};function M(e){if(null!=R[e])return R[e];var t=(0,x.tG)(e);return R[e]=t,t}function C(e,t){var n=t.length+8;return n<=Z.s?(0,S.zo)((0,S.kh)(n),M(e),t):(0,S.zo)((0,S.kh)(1),M(e),(0,S.el)(n+8),t)}function P(e,t){return C(e,S.zo.apply(void 0,t))}function D(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,E.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,D(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,E.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,D(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,E.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,D(e),i.push(r)}else i.push(n)}))}))}))}))}var N=n(9689);function O(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,S.zo)([8,1,18,16],e)}]}function L(e,t){if(void 0===t&&(t=O),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,N.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,S.qb)(e,8),n=(0,x.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,x.wO)((0,N.K)(i));return(0,x.ci)(a).toLowerCase()}(r),a=(0,x.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var p=function(e,t){var n;return 0==(n="AACH"===t?5:(0,w.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:v,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:p,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var h=r("CodecPrivateData"),m=r("FourCC"),g=r("MaxWidth"),y=r("MaxHeight"),_=r("Bitrate"),b=void 0===_||isNaN(parseInt(_,10))?0:parseInt(_,10);if(void 0!==m&&void 0===F[m]||void 0===h)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var T=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,w.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:b,customAttributes:n,mimeType:void 0!==m?F[m]:m,codecPrivateData:h,codecs:T,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var E=r("CodecPrivateData"),S=r("FourCC"),k=r("Bitrate");return{bitrate:void 0===k||isNaN(parseInt(k,10))?0:parseInt(k,10),customAttributes:n,mimeType:void 0!==S?F[S]:S,codecPrivateData:(0,I.Z)(E,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.baseUrl,u=t.protections,l=t.timeShiftBufferDepth,c=t.manifestReceivedTime,f=t.isLive,v=r.getAttribute("Timescale"),p=null===v||isNaN(+v)?i:+v,h=r.getAttribute("Type");if(null===h)throw new Error("StreamIndex without type.");(0,E.Z)(T.r,h)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),_=r.getAttribute("Url"),A=null===_?"":_;var I,Z=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,m);if(null===i)return e;("video"!==m||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=Z.qualityLevels,M=Z.cNodes,P={timeline:(I=M,I.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=I[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,w.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:p};(0,d.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var D=m+((0,w.Z)(y)?"_"+y:""),N=R.map((function(t){var n,r,i,a,s={timeline:P.timeline,timescale:P.timescale,media:(n=A,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,w.Z)(t.mimeType)?t.mimeType:U[m],v=t.codecs,p=D+"_"+(null!=m?m+"-":"")+(null!=d?d+"-":"")+(null!=v?v+"-":"")+String(t.bitrate),h=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){h.push({keyId:t,systemId:e.systemId})}))})));var g={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},y=null!=e.aggressiveMode&&e.aggressiveMode,_=new b(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:c,segmentPrivateInfos:g,timeShiftBufferDepth:l}),T=(0,k.Z)({},t,{index:_,cdnMetadata:[{baseUrl:o}],mimeType:d,codecs:v,id:p});if(h.length>0||void 0!==a){var E=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,""),i=function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return C("pssh",(0,S.zo)([n,0,0,0],(0,x.nr)(e),(0,S.kh)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(E.length>0){var I=[{type:"cenc",values:E}];T.contentProtections={keyIds:h,initData:I}}else T.contentProtections={keyIds:h,initData:[]}}return T}));if("ADVT"===g)return null;var O={id:D,type:m,representations:N,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(O.closedCaption=!0),O}return function(n,r,a){var s="";if(void 0!==r){var u=(0,A.$)(r);s=r.substring(0,u)}var l=n.documentElement;if(null==l||"SmoothStreamingMedia"!==l.nodeName)throw new Error("document root should be SmoothStreamingMedia");var c=l.getAttribute("MajorVersion"),d=l.getAttribute("MinorVersion");if(null===c||null===d||!/^[2]-[0-2]$/.test(c+"-"+d))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,w.Z)(p)?isNaN(+p)?1e7:+p:1e7,m=B(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(L(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),g=m.protections,y=m.adaptationNodes,_="boolean"==typeof(f=l.getAttribute("IsLive"))?f:"string"==typeof f&&"TRUE"===f.toUpperCase();if(_){var b=l.getAttribute("DVRWindowLength");null==b||isNaN(+b)||0==+b||(v=+b/h)}var T,E,S,k,x,I,Z,R=y.reduce((function(e,t){var n=o({root:t,baseUrl:s,timescale:h,protections:g,isLive:_,timeShiftBufferDepth:v,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),M=null,C=void 0!==R.video?R.video[0]:void 0,P=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],O=[];if(void 0!==C){var U=C.representations[0];if(void 0!==U){var F=U.index.getFirstAvailablePosition(),z=U.index.getLastAvailablePosition();null!=F&&N.push(F),null!=z&&O.push(z)}}if(void 0!==P){var V=P.representations[0];if(void 0!==V){var K=V.index.getFirstAvailablePosition(),G=V.index.getLastAvailablePosition();null!=K&&N.push(K),null!=G&&O.push(G)}}N.length>0&&(x=Math.max.apply(Math,N)),O.length>0&&(I=Math.min.apply(Math,O),Z=Math.max.apply(Math,O))}var H=l.getAttribute("Duration"),W=null!==H&&0!=+H?+H/h:void 0;if(_){T=e.suggestedPresentationDelay,E=t,S=null!=x?x:E;var j=Z;void 0===j&&(j=Date.now()/1e3-E);var q=I;void 0===q&&(q=j),k={isLinear:!0,maximumSafePosition:q,livePosition:j,time:performance.now()},M=null!=v?v:null}else{S=null!=x?x:0,k={isLinear:!1,maximumSafePosition:void 0!==I?I:void 0!==W?S+W:1/0,livePosition:void 0,time:performance.now()}}var Y=_?0:S,X=_?void 0:k.maximumSafePosition,$={availabilityStartTime:void 0===E?0:E,clockOffset:i,isLive:_,isDynamic:_,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:S,timeshiftDepth:M,maximumTimeData:k},periods:[{adaptations:R,duration:void 0!==X?X-Y:W,end:X,id:"gen-smooth-period-0",start:Y}],suggestedPresentationDelay:T,transportType:"smooth",uris:null==r?[]:[r]};return D($),$}},V=z,K=n(4597),G=n(8806),H=n(4460),W=n(8791),j=n(4644),q=n(2297);function Y(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,q.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,S.pV)(t,16*a+5),o=(0,S.pV)(t,16*a+5+8)):(s=(0,S.pX)(t,8*a+5),o=(0,S.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,q.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,S.pV)(t,12),time:(0,S.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,j.MM)(e),m=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var X=n(3666);function $(e,t){return C("schm",(0,S.zo)(4,(0,x.tG)(e),(0,S.kh)(t)))}function Q(e){return C("frma",(0,x.tG)(e))}function J(e){var t=[7,[e.length]];return C("stsd",S.zo.apply(void 0,t.concat(e)))}function ee(e,t,n){return C("tenc",(0,S.zo)(6,[e,t],n))}function te(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(C("senc",i),function(e){if(0===e.length)return C("saiz",new Uint8Array(0));var t=(0,S.pX)(e,0),n=(0,S.pX)(e,4),r=new Uint8Array(n+9);r.set((0,S.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,S.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return C("saiz",r)}(i),function(e,t,n,r){return C("saio",(0,S.zo)(4,[0,0,0,1],(0,S.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),P("traf",a)}function ne(e,t){var n=(0,q.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,q.iz)(r,1835427940),a=(0,q.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,q.Qy)(a,1952868452),s=(0,q.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return C("tfdt",(0,S.zo)([1,0,0,0],(0,S.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,j.J6)(n)}(l,s[1]-s[0]),f=te(u,c,d,i,(0,q.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=P("moof",[i,f]),p=(0,q.Qy)(v,1836019558),h=(0,q.Qy)(f,1953653094),m=(0,q.Qy)(d,1953658222);if(null===p||null===h||null===m)throw new Error("Smooth: Invalid moof, trun or traf generation");var g=p[1]-p[0]+i.length+(h[1]-h[0])+u.length+c.length+(m[1]-m[0])+8,y=n[2]-n[0],_=v.length-y,b=(0,q.Qy)(e,1835295092);if(null===b)throw new Error("Smooth: Invalid ISOBMFF given");if(!X.YM&&(0===_||_<=-8)){var T=b[1];return v.set((0,S.kh)(T),g),e.set(v,n[0]),_<=-8&&e.set(C("free",new Uint8Array(-_-8)),v.length),e}var E=b[1]+_;v.set((0,S.kh)(E),g);var w=new Uint8Array(e.length+_),k=e.subarray(0,n[0]),A=e.subarray(n[2],e.length);return w.set(k,0),w.set(v,k.length),w.set(A,k.length+v.length),w}var re=n(7839),ie=n(281);function ae(e,t,n,r,i,a){var o,s,u,l=P("stbl",[n,C("stts",new Uint8Array(8)),C("stsc",new Uint8Array(8)),C("stsz",new Uint8Array(12)),C("stco",new Uint8Array(8))]),c=function(e){return C("dref",(0,S.zo)(7,[1],e))}(C("url ",new Uint8Array([0,0,0,1]))),d=P("dinf",[c]),f=P("minf",[r,d,l]),v=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return C("hdlr",(0,S.zo)(8,(0,x.tG)(t),12,(0,x.tG)(n),1))}(t),p=function(e){return C("mdhd",(0,S.zo)(12,(0,S.kh)(e),8))}(e),h=P("mdia",[p,v,f]),m=function(e,t,n){return C("tkhd",(0,S.zo)((0,S.kh)(7),8,(0,S.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,S.XT)(e),2,(0,S.XT)(t),2))}(i,a,1),g=P("trak",[m,h]),y=P("mvex",[(o=1,C("trex",(0,S.zo)(4,(0,S.kh)(o),[0,0,0,1],12)))]),_=function(e,t){return C("mvhd",(0,S.zo)(12,(0,S.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,S.XT)(t+1)))}(e,1),b=function(e,t,n){return P("moov",[e,t,n])}(_,y,g),T=(s="isom",u=["isom","iso2","iso6","avc1","dash"],C("ftyp",S.zo.apply(void 0,[(0,x.tG)(s),[0,0,0,1]].concat(u.map(x.tG)))));return(0,S.zo)(T,b)}function oe(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,f,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return C("avcC",(0,S.zo)([1,i,a,o,252|r,225],(0,S.XT)(e.length),e,[1],(0,S.XT)(t.length),t))}((0,x.nr)(l),(0,x.nr)(c),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return C("avc1",(0,S.zo)(6,(0,S.XT)(1),16,(0,S.XT)(e),(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),6,[0,1,i.length],(0,x.tG)(i),31-i.length,(0,S.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);d=J([p])}else{var h=P("schi",[ee(1,8,s)]),m=$("cenc",65536),g=function(e,t,n,r,i,a,o,s){return C("encv",(0,S.zo)(6,(0,S.XT)(1),16,(0,S.XT)(e),(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),6,[0,1,i.length],(0,x.tG)(i),31-i.length,(0,S.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,P("sinf",[Q("avc1"),m,h]));d=J([g])}return ae(e,"video",d,((f=new Uint8Array(12))[3]=1,C("vmhd",f)),t,n)}var se=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function ue(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return C("esds",(0,S.zo)(4,[3,25],(0,S.XT)(e),[0,4,17,64,21],11,[5,2],(0,x.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&se.indexOf(s))<<4)|31&u)<<3,(0,x.ci)((0,S.XT)(l))):a),d=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return C("mp4a",(0,S.zo)(6,(0,S.XT)(e),8,(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),(0,S.XT)(i),2,a))}(1,t,n,r,i,c);return J([e])}var a=P("schi",[ee(1,8,o)]),s=$("cenc",65536),u=P("sinf",[Q("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return C("enca",(0,S.zo)(6,(0,S.XT)(e),8,(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),(0,S.XT)(i),2,a,o))}(1,t,n,r,i,c,u);return J([l])}();return ae(e,"audio",d,C("smhd",new Uint8Array(8)),0,0)}var le=/(\.isml?)(\?token=\S+)?$/,ce=/\?token=(\S+)/;function de(e,t){return(0,w.Z)(t)?e.replace(ce,"?token="+t):e.replace(ce,"")}function fe(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ve(e,t){return null===e?null:null===t.url?e.baseUrl:(0,A.Z)(e.baseUrl,t.url)}function pe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ie.Z)(s)}),(0,K.ZP)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!fe(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,H.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var he=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a,o){var s=r.segment,u=r.manifest,l=r.period,c=r.adaptation,d=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,v=s.privateInfos.smoothInitSegment,p=v.codecPrivateData,h=v.timescale,m=v.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(c.type){case"video":var y=d.width,_=void 0===y?0:y,b=d.height;f=oe(h,_,void 0===b?0:b,72,72,4,p,g.keyId);break;case"audio":var T=v.channels,E=void 0===T?0:T,S=v.bitsPerSample,w=void 0===S?0:S,k=v.packetSize,A=void 0===k?0:k,x=v.samplingRate;f=ue(h,E,w,A,void 0===x?0:x,p,g.keyId);break;default:0,f=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:f})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var I={adaptation:c,manifest:u,period:l,representation:d,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?pe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,c=n(I,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled){l=!0,a.deregister(d);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",s=new re.Z(o,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);u(s)}},resolve:function(e){if(!l&&!a.isCancelled){l=!0,a.deregister(d),fe(r.representation)&&!0===t||s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,H.Z)(n,r.segment.isInit),s({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){l||a.isCancelled||(l=!0,a.deregister(d),pe(e,r,o,i,a,t).then(s,u))},progress:function(e){l||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function d(e){l||((l=!0)||"function"!=typeof c||c(),u(e))}a.register(d)}))}},me=/\.wsx?(\?token=\S+)?/;function ge(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof b&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var ye=function(e){var t=V(e),n=he(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i,a){var o=ve(e,t.segment);return n(o,t,r,i,a)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?Y(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var v=f.nextSegments,p=f.chunkInfos,h=ne(c,f.scaledSegmentTime);return v.length>0&&ge(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},d={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ve(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):fe(s)?(0,K.ZP)({url:u,responseType:"arraybuffer",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,H.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,K.ZP)({url:u,responseType:"text",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,v=fe(c),p=c.mimeType,h=void 0===p?"":p,m=c.codec,g=void 0===m?"":m,y=e.data,_=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var b,T,E,S,w=null;if(v){var k;i=(k="string"==typeof y?(0,x.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var A=void 0!==n?Y(k,_,n,d,o.isLive):null;a=null==A?void 0:A.nextSegments,null===(w=null!==(r=null==A?void 0:A.chunkInfos)&&void 0!==r?r:null)?_?s.Z.warn("Smooth: Unavailable time data for current text track."):(b=d.time,T=d.end):(b=w.time,T=void 0!==w.duration?w.time+w.duration:d.end);var I=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)S="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);S="vtt"}var Z=(0,l.Le)(k);E=null===Z?"":(0,x.uR)(Z)}else{var R;if(b=d.time,T=d.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,R=(0,x.uR)(M)}else R=y;switch(h){case"application/x-sami":case"application/smil":S="sami";break;case"application/ttml+xml":S="ttml";break;case"text/vtt":S="vtt"}if(void 0===S){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);S="srt"}E=R}return null!==w&&Array.isArray(a)&&a.length>0&&ge(u,a,d),{segmentType:"media",chunkData:{type:S,data:E,start:b,end:T,language:f},chunkSize:i,chunkInfos:w,chunkOffset:null!=b?b:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;me.test(e)?((0,G.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,K.ZP)({url:de(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=ce.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return de(function(e){return le.test(e)?((0,G.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(le,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,W.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:d,image:{loadSegment:function(e,t,n,i,o){return(0,r.Z)(a().mark((function r(){var s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s=t.segment,u=ve(e,s),!s.isInit&&null!==u){r.next=4;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return r.next=6,(0,K.ZP)({url:u,responseType:"arraybuffer",timeout:n.timeout,onProgress:o.onProgress,cancelSignal:i});case 6:return l=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:l});case 8:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n,a){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:a});case"text":return(0,i.ZP)({url:t,responseType:"text",timeout:n.timeout,cancelSignal:a});case"document":return(0,i.ZP)({url:t,responseType:"document",timeout:n.timeout,cancelSignal:a});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r,i){return new Promise((function(o,s){var u=Date.now()-performance.now(),l=!1,c=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var o=e,u=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",c=new a.Z(u,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(r=null==o?void 0:o.isOfflineError)&&void 0!==r&&r,null==o?void 0:o.xhr);s(c)}},resolve:function(e){if(!l&&!i.isCancelled){l=!0,i.deregister(d);var t=void 0!==e.receivingTime?e.receivingTime-u:void 0,n=void 0!==e.sendingTime?e.sendingTime-u:void 0;o({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),t(n,r,i).then(o,s))}},{timeout:r.timeout});function d(e){l||(l=!0,"function"==typeof c&&c(),s(e))}i.register(d)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function v(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function p(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},_f:function(){return p},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r,i=n(8720),a=n(5987),o=n(8337),s=1,u={};function l(e){return e in u&&(delete u[e],!0)}var c=function(e){var t=s++;return u[t]=!0,r||(r=Promise.resolve()),r.then((function(){return l(t)&&e()})),t},d=function(e){l(e)},f={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=f.delegate;return((null==n?void 0:n.setImmediate)||c).apply(void 0,(0,a.ev)([],(0,a.CR)(e)))},clearImmediate:function(e){var t=f.delegate;return((null==t?void 0:t.clearImmediate)||d)(e)},delegate:void 0},v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,a.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=f.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var a=t.actions;null!=n&&(null===(i=a[a.length-1])||void 0===i?void 0:i.id)!==n&&(f.clearImmediate(n),t._scheduled=void 0)},t}(o.o),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,a.ZT)(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n,r=this.actions;e=e||r.shift();do{if(n=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,n){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw n}},t}(n(9682).v),h=new p(v);function m(){return function(e){return e.pipe((0,i.R)(h))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return v},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return p},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function v(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function p(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$l:function(){return s},ZP:function(){return s},lR:function(){return u}});var r=n(1480),i=n(288);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(!o&&(t=e,0!==n.length))for(var r,i=a(n.slice());!(r=i()).done;){var s=r.value;try{s.hasBeenCleared||s.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!o){var i={trigger:e,complete:a,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(a)}function a(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},waitUntilDefined:function(e,n){if(void 0===t){if(!o){var r=new i.ZP;void 0!==(null==n?void 0:n.clearSignal)&&n.clearSignal.register((function(){return r.cancel()})),this.onUpdate((function(n){if(void 0!==n)return r.cancel(),void e(t)}),{clearSignal:r.signal})}}else e(t)},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete(),r.hasBeenCleared=!0}catch(e){}}n.length=0}}}function u(e,t,n){var r=s(t(e.getValue()));return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),void 0!==n&&n.register((function(){r.finish()})),r}},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return o}});var r=n(9105),i=n(6923),a=n(1946);var o=function(e){var t={url:e.url,headers:e.headers,responseType:(0,a.Z)(e.responseType)?"json":e.responseType,timeout:e.timeout};return new Promise((function(n,o){var s,u=e.onProgress,l=e.cancelSignal,c=t.url,d=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",c,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){_(),o(new r.Z(c,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.Z)(d)){var h=d;for(var m in h)h.hasOwnProperty(m)&&p.setRequestHeader(m,h[m])}var g=performance.now(),y=null;function _(){void 0!==s&&clearTimeout(s),null!==y&&y()}void 0!==l&&(y=l.register((function(e){_(),(0,a.Z)(p)||4===p.readyState||p.abort(),o(e)})),l.isCancelled)||(p.onerror=function(){_(),o(new r.Z(c,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){_(),o(new r.Z(c,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:c,duration:t-g,sendingTime:g,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(_(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,l=p.status,d=p.responseType,f=(0,i.Z)(p.responseURL)?p.responseURL:c;if(t="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,a.Z)(t))return void o(new r.Z(c,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:d,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.Z(c,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{$:function(){return s},Z:function(){return o}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e.length;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e.length}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):t+1}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return v},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return p},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var c=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(c),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var d=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(d),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+c(l,4):"%"+c(l,2)}}return decodeURIComponent(i)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function v(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function p(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(e){var t,n=this,r=(t=s.Z,[function(e){t(e)},function(e){t=e}]),i=r[0],a=r[1];if(this.isUsed=!1,this._trigger=i,this.signal=new l(a),void 0!==(null==e?void 0:e.cancelOn)){var o=e.cancelOn.register((function(){n.cancel()}));this.signal.register(o)}}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,i){var a=new r.Hp({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=(0,r.XA)(t.currentObservers),o=a.next();!o.done;o=a.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?a.Lc:(this.currentObservers=null,o.push(e),new a.w0((function(){t.currentObservers=null,(0,s.P)(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return g},Lv:function(){return v}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),v=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=b,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new g(e,t,n)},t.prototype.next=function(e){this.isStopped?_(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=Function.prototype.bind;function h(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,n,r){var a,s,u=e.call(this)||this;(0,i.m)(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&o.v.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},a={next:t.next&&h(t.next,s),error:t.error&&h(t.error,s),complete:t.complete&&h(t.complete,s)}):a=t;return u.destination=new m(a),u}return(0,r.ZT)(t,e),t}(v);function y(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}function _(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var b={closed:!0,next:u.Z,error:function(e){throw e},complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var p=(0,r.XA)(v),h=p.next();!h.done;h=p.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2034:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(4367);function i(){return(0,r.J)(1)}var a=n(2457),o=n(3102);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i()((0,o.D)(e,(0,a.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe((0,o.x)(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var v=n(1764),p=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,v.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return v}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function v(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return v(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(p(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(p(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return v(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function p(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),v=n(5),p=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[p.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,v.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(5987);function i(e,t,n,r,i){return new a(e,t,n,r,i)}var a=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe((0,i.x)(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe((0,i.x)(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},3286:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(6798);function i(e){return(0,r.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe((0,i.x)(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe((0,i.x)(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,v=0,p=!1,h=function(){!p||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,v++)).subscribe((0,s.x)(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe((0,s.x)(t,m,(function(){p=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe((0,i.x)(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return u}});var r=n(5987),i=n(7878),a=n(6716),o=n(6267),s=n(6798);function u(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new a.x}:t,r=e.resetOnError,u=void 0===r||r,c=e.resetOnComplete,d=void 0===c||c,f=e.resetOnRefCountZero,v=void 0===f||f;return function(e){var t,r,a,c=0,f=!1,p=!1,h=function(){null==r||r.unsubscribe(),r=void 0},m=function(){h(),t=a=void 0,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,s.e)((function(e,s){c++,p||f||h();var y=a=null!=a?a:n();s.add((function(){0!==--c||p||f||(r=l(g,v))})),y.subscribe(s),!t&&c>0&&(t=new o.Hp({next:function(e){return y.next(e)},error:function(e){p=!0,h(),r=l(m,u,e),y.error(e)},complete:function(){f=!0,h(),r=l(m,d),y.complete()}}),(0,i.Xf)(e).subscribe(t))}))(e)}}function l(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!0!==t){if(!1!==t){var a=new o.Hp({next:function(){a.unsubscribe(),e()}});return t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).subscribe(a)}}else e()}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u,l=!1;return e&&"object"==typeof e?(a=e.bufferSize,u=void 0===a?1/0:a,o=e.windowTime,t=void 0===o?1/0:o,l=void 0!==(s=e.refCount)&&s,n=e.scheduler):u=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(u,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(2034),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe((0,a.x)(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=(0,a.x)(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe((0,a.x)(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe((0,i.x)(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe((0,a.x)(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,v=function(t){(0,o.Xf)(e[t]).subscribe((0,a.x)(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},p=0;p<l;p++)v(p);t.subscribe((0,a.x)(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=a.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,r.ev)([e,t],(0,r.CR)(n))):setInterval.apply(void 0,(0,r.ev)([e,t],(0,r.CR)(n)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.ev)([e,t],(0,r.CR)(n))):setTimeout.apply(void 0,(0,r.ev)([e,t],(0,r.CR)(n)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7061:function(e,t,n){var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function p(){}function h(){}function m(){}var g={};c(g,s,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(x([])));_&&_!==n&&a.call(_,s)&&(g=_);var b=m.prototype=p.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,s,u){var l=f(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,c(b,"constructor",m),c(m,"constructor",h),h.displayName=c(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},T(E.prototype),c(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(d(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(b),c(b,l,"Generator"),c(b,s,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8698:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:function(e,t,n){var r=n(7061)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return o=a()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a},o.apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)},s(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return Dr}});var e=n(3144),t=n(4578),i=n(6716),a=n(4727),o=n(3505),s=n(9127),u=n(278),l=n(6798),c=n(2566);function d(e,t){return void 0===t&&(t=u.y),e=null!=e?e:f,(0,l.e)((function(n,r){var i,a=!0;n.subscribe((0,c.x)(r,(function(n){var o=t(n);!a&&e(i,o)||(a=!1,i=o,r.next(n))})))}))}function f(e,t){return e===t}var v=n(1480),p=n(2817),h=n(7877),m=n(8515),g=n(9917),y={connector:function(){return new i.x},resetOnDisconnect:!0};function _(e,t){void 0===t&&(t=y);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new v.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,g.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var b=n(4975),T=n(5583),E=Array.isArray,S=Object.getPrototypeOf,w=Object.prototype,k=Object.keys;function A(e){if(1===e.length){var t=e[0];if(E(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&S(r)===w){var n=k(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var x=n(3102),I=n(3211),Z=n(2457);function R(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var M=n(7845);function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,Z.yG)(e),r=(0,Z.jO)(e),i=A(e),a=i.args,o=i.keys;if(0===a.length)return(0,x.D)([],n);var s=new v.y(P(a,n,o?function(e){return R(o,e)}:u.y));return r?s.pipe((0,I.Z)(r)):s}function P(e,t,n){return void 0===n&&(n=u.y),function(r){D(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){D(t,(function(){var u=(0,x.D)(e[i],t),l=!1;u.subscribe((0,c.x)(r,(function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},l=0;l<i;l++)u(l)}),r)}}function D(e,t,n){e?(0,M.f)(n,e,t):t()}var N=n(6108),O=n(2034),L=n(4978),B=n(3071),U=n(1545);function F(e){return(0,l.e)((function(t,n){var r=!1,i=0;t.subscribe((0,c.x)(n,(function(t){return(r||(r=!e(t,i++)))&&n.next(t)})))}))}var z=n(2006),V=n(1381);function K(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function G(){if(H()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function H(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var W=n(3666),j=n(3887);function q(){if(!W.vU)return!0;var e=function(){if(!W.vU)return j.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var Y=n(6872),X=n(3714),$=n(8750),Q=n(5992),J=n(7874),ee=n(1989),te=n(4791),ne=n(1959),re=n(1946),ie=n(8026),ae=n(2829),oe=n(5095),se=n(288),ue=n(8806),le=n(5861),ce=n(4687),de=n.n(ce),fe=n(6139),ve=n(770);function pe(e){return he.apply(this,arguments)}function he(){return(he=(0,le.Z)(de().mark((function e(t){var n,r;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=ve.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return j.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,ve.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,fe.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){var t=ve.Z.getState(e);return null==t?null:t.keySystemOptions.type}function ge(e){if(j.Z.info("DRM: Clearing-up DRM session."),W.fq)return j.Z.info("DRM: disposing current MediaKeys."),pe(e);var t=ve.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(j.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(j.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var ye=n(811),_e=n(9105),be=n(9362);function Te(e){return e instanceof _e.Z?new be.Z("PIPELINE_LOAD_ERROR",e):(0,$.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var Ee=n(7839),Se=n(9822),we=n(7864),ke=n(2572),Ae=n(8894);function xe(e){return e instanceof _e.Z?e.type===Q.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===Q.br.TIMEOUT||e.type===Q.br.ERROR_EVENT:e instanceof Ee.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,Se.Z)(e)&&"INTEGRITY_ERROR"===e.code}function Ie(e){return e instanceof _e.Z?e.type===Q.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof Ee.Z&&e.isOfflineError}function Ze(e){return Ie(e)?2:1}function Re(e,t,n,r,i){return Me.apply(this,arguments)}function Me(){return Me=(0,le.Z)(de().mark((function e(t,n,r,i,a){var o,s,u,l,c,d,f,v,p,h,m,g,y,_;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_=function(e){var t;if(0===d.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=d.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=d.get(t))||void 0===r?void 0:r.blockedUntil;return void 0!==i&&i<=n&&(i=void 0),void 0===e?[t,i]:void 0===i?void 0===e[1]?e:[t,void 0]:void 0===e[1]?e:i<e[1]?[t,i]:e}),void 0))||void 0===t?void 0:t[0]},y=function(e,t){var r=d.get(e);if(void 0===r||void 0===r.blockedUntil)return p(e);var i=performance.now(),o=r.blockedUntil-i;if(o<=0)return p(e);var s=new se.ZP({cancelOn:a});return new Promise((function(r,i){null==n||n.addEventListener("priorityChange",(function(){var n=v();if(a.isCancelled)throw a.cancellationError;if(void 0===n)return i(t);n!==e&&(s.cancel(),y(n,t).then(r,i))}),s.signal),(0,we.Z)(o,s.signal).then((function(){return p(e).then(r,i)}),Ae.Z)}))},g=function(){return(g=(0,le.Z)(de().mark((function e(t){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=v(),!a.isCancelled){e.next=3;break}throw a.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(c(t),!a.isCancelled){e.next=8;break}throw a.cancellationError;case 8:return e.abrupt("return",y(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},m=function(e){return g.apply(this,arguments)},h=function(){return(h=(0,le.Z)(de().mark((function e(t){var i,c,f,v,p,h,g;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r(t,a);case 3:return i=e.sent,e.abrupt("return",i);case 7:if(e.prev=7,e.t0=e.catch(0),!se.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),c=Ze(e.t0),void 0===(f=d.get(t))?(f={errorCounter:1,lastErrorType:c,blockedUntil:void 0,isBlacklisted:!1},d.set(t,f)):c!==f.lastErrorType?(f.errorCounter=1,f.lastErrorType=c):f.errorCounter++,xe(e.t0)){e.next=19;break}return f.blockedUntil=void 0,f.isBlacklisted=!0,e.abrupt("return",m(e.t0));case 19:return v=2===c?l:u,f.errorCounter>v?(f.blockedUntil=void 0,f.isBlacklisted=!0):(p=f.errorCounter,h=Math.min(o*Math.pow(2,p-1),s),g=(0,ke.Z)(h),f.blockedUntil=performance.now()+g),e.abrupt("return",m(e.t0));case 22:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},p=function(e){return h.apply(this,arguments)},v=function(){if(null===t){var e=d.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return _(t);var r=n.getCdnPreferenceForResource(t);return _(r)},null===a.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(a.cancellationError));case 9:if(o=i.baseDelay,s=i.maxDelay,u=i.maxRetryRegular,l=i.maxRetryOffline,c=i.onRetry,null!==t&&0===t.length&&j.Z.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),d=new Map,void 0!==(f=v())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",p(f));case 16:case"end":return e.stop()}}),e)}))),Me.apply(this,arguments)}function Ce(e,t,n){return Re(null,null,e,t,n)}function Pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return De(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return De(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new v.y((function(n){var r,i,a=t._settings,o=t._pipelines,s=null!=e?e:t._manifestUrl,u=!1,l=new se.ZP,c=t._getBackoffSetting((function(e){n.next({type:"warning",value:Te(e)})}));return(void 0===o.resolveManifestUrl?d(s):(r=s,i=o.resolveManifestUrl,(0,ye.Z)(void 0!==i),Ce((function(){return i(r,l.signal)}),c,l.signal)).then(d)).then((function(e){u=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){l.isUsed||(u=!0,n.error(Te(e)))})),function(){u||l.cancel()};function d(e){var t=o.loadManifest,n=(0,re.Z)(a.requestTimeout)?Y.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:a.requestTimeout;n<0&&(n=void 0);return Ce((function(){return t(e,{timeout:n},l.signal)}),c,l.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new v.y((function(r){var i=performance.now(),a=new se.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:Te(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return v(e.manifest)})).catch((function(e){a.isUsed||p(e,!0)})):v(c.manifest)}catch(e){if(a.isUsed)return;p(e,!0)}return function(){a.cancel()};function d(){return(d=(0,le.Z)(de().mark((function e(t){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),Te(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=Pe(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;p(r,!1)}}function v(e){f(e.contentWarnings);var t=performance.now()-i;j.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function p(e,t){var n=(0,$.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=Y.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var Oe=Ne,Le=n(3286),Be=n(533);var Ue=n(8333),Fe=n(2793),ze=n(5278),Ve=n(5138);function Ke(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var Ge=function(){function e(e){this._levelsMap=Ke(e),this._bitrates=e,j.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,Ve.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return j.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),He=n(3274),We=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}();function je(e){if(!(e.progress.length<5)){for(var t=new We(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function qe(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var Ye=function(){function e(e,t){var n=Y.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=Y.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l.last<c-f?!this._inStarvationMode&&d<=s.starvationGap?(j.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(j.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(j.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s.last+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,v=je(c);if(void 0!==f&&void 0!==v){var p=qe(f,v);if((d-f.timestamp)/1e3<=p&&p-u/o>2e3)return v}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(j.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate))),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,He.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=je(a);if(void 0===s||void 0===u)return!0;var l=qe(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Xe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qe=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=Je(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(j.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,Ve.Z)(e,(function(e){return e.id===t.id}));if(n<0)return j.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=Je(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Xe(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=je(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function Je(e,t){var n=e.length,r=(0,Ve.Z)(e,(function(e){return e.id===t.id}));if(r<0)return j.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var et=function(){function e(){var e=Y.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new We(t),this._slowEWMA=new We(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<Y.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=Y.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=Y.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new We(t),this._slowEWMA=new We(n),this._bytesSampled=0},e}();var tt=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),nt=n(1679),rt=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):j.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&j.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,nt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),it=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new We(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(j.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function at(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ve.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var ot=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,l,c,d){var f=e.adaptation.type,v=function(e){var n=t[e];if(null==n){j.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new et;return t[e]=r,r}return n}(f),p=(0,ze.Z)(n[f],(0,oe.ZP)(-1)),h=(0,ze.Z)(r[f],(0,oe.ZP)(0)),m=(0,ze.Z)(i[f],(0,oe.ZP)(1/0)),g=(0,ze.Z)(a[f],0);return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,l=e.maxAutoBitrate,c=e.minAutoBitrate,d=e.playbackObserver,f=e.representations,v=new it,p=new Ye(null!=o?o:0,s),h=new rt,m=Ae.Z,g={metrics:E,requestBegin:S,requestProgress:w,requestEnd:k,addedSegment:function(e){m(e)}},y=new se.ZP({cancelOn:t}),_=b(u.getValue(),f.getValue(),y.signal);return u.onUpdate(T,{clearSignal:t}),f.onUpdate(T,{clearSignal:t}),{estimates:_,callbacks:g};function b(e,t,o){if(e>=0){var u=at(t,e,0,1/0);return(0,oe.ZP)({representation:u,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}if(1===t.length)return(0,oe.ZP)({bitrate:void 0,representation:t[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var f,g=!1,y=t.map((function(e){return e.bitrate})),_=new Ge(y),b=new tt,T=new Qe(v,b),E=d.getReference().getValue(),S=(0,oe.ZP)(k());return d.listen((function(e){E=e,w()}),{includeLastObservation:!1,clearSignal:o}),m=function(e){if(null!==E){var t=E,n=t.position,r=t.speed,i=e.buffered,a=(0,ae.L7)(i,n.last),o=e.content.representation,s=v.getEstimate(o),u=null==s?void 0:s[0],l={bufferGap:a,currentBitrate:o.bitrate,currentScore:u,speed:r};f=_.getEstimate(l),w()}},c.onUpdate(w,{clearSignal:o}),l.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),S;function w(){S.setValue(k())}function k(){var e=E,o=e.bufferGap,u=e.position,d=e.maximumPosition,m=a.limitWidth.getValue(),y=a.throttleBitrate.getValue(),_=i.getValue(),S=c.getValue(),w=l.getValue(),k=function(e,t,n){var r=e;n<1/0&&(r=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ve.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){return(0,ze.Z)(e.width,0)-(0,ze.Z)(t.width,0)})),r=(0,He.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(r,t));return r}(t,m,y),A=h.getRequests(),x=p.getBandwidthEstimate(E,n,_,A,b.bandwidth),I=x.bandwidthEstimate,Z=x.bitrateChosen,R=v.getLastStableRepresentation(),M=null===R?void 0:R.bitrate/(E.speed>0?E.speed:1);g&&o<=5?g=!1:!g&&isFinite(o)&&o>10&&(g=!0);var C=at(k,Z,S,w),P=C.bitrate,D=null;g&&void 0!==f&&f>P&&(P=(D=at(k,f,S,w)).bitrate);var N=null;return s&&null!==_&&r.manifest.isDynamic&&d-u.last<40&&(N=T.getGuess(t,E,_,P,A)),null!==N&&N.bitrate>P?(j.Z.debug("ABR: Choosing representation with guess-based estimation.",N.bitrate,N.id),b.update(N,I,2),{bitrate:I,representation:N,urgent:null===_||N.bitrate<_.bitrate,manual:!1,knownStableBitrate:M}):null!==D?(j.Z.debug("ABR: Choosing representation with buffer-based estimation.",D.bitrate,D.id),b.update(D,I,0),{bitrate:I,representation:D,urgent:p.isUrgent(D.bitrate,_,A,E),manual:!1,knownStableBitrate:M}):(j.Z.debug("ABR: Choosing representation with bandwidth estimation.",C.bitrate,C.id),b.update(C,I,1),{bitrate:I,representation:C,urgent:p.isUrgent(C.bitrate,_,A,E),manual:!1,knownStableBitrate:M})}}function T(){var e=u.getValue(),n=f.getValue();y.cancel(),b(e,n,(y=new se.ZP({cancelOn:t})).signal).onUpdate((function(e){_.setValue(e)}),{clearSignal:y.signal,emitCurrentValue:!0})}function E(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,t/1e3,u)}}function S(e){h.add(e)}function w(e){h.addProgress(e)}function k(e){h.remove(e.id)}}({bandwidthEstimator:v,context:e,currentRepresentation:u,filters:{limitWidth:(0,ze.Z)(o.limitWidth[f],(0,oe.ZP)(void 0)),throttleBitrate:(0,ze.Z)(o.throttleBitrate[f],o.throttle[f],(0,oe.ZP)(1/0))},initialBitrate:g,manualBitrate:p,minAutoBitrate:h,maxAutoBitrate:m,playbackObserver:c,representations:l,lowLatencyMode:s},d)}};function st(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ut(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lt=function(e){function n(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=st(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,t.Z)(n,e);var r=n.prototype;return r.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},r.downgradeCdn=function(e){var t=this,n=ct(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=Y.Z.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=ct(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},r._innerGetCdnPreferenceForResource=function(e){var t=this,n=e.reduce((function(e,n){return t._downgradedCdnList.metadata.some((function(e){return e.id===n.id&&e.baseUrl===n.baseUrl}))?e[1].push(n):e[0].push(n),e}),[[],[]]),r=n[0],i=n[1];return r.concat(i)},r._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},n}(ne.Z);function ct(e,t){return 0===e.length?-1:void 0!==t.id?(0,Ve.Z)(e,(function(e){return e.id===t.id})):(0,Ve.Z)(e,(function(e){return e.baseUrl===t.baseUrl}))}var dt=n(520),ft=n(7714),vt=n(908),pt=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),ht=(0,vt.Z)();var mt=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("TP: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t,n,r){var i,a=this;return new Promise((function(o,s){var u=r.register((function(e){a._endTask(i),s(e)})),l=function(){u(),a._endTask(i)},c=function(e){n.beforeEnded(),l(),o(e)},d=function(e){l(),s(e)};i={hasEnded:!1,priority:t,trigger:function(){if(i.hasEnded)u();else{var e=new se.ZP({cancelOn:r});i.interrupter=e,e.signal.register((function(){i.interrupter=null,r.isCancelled||n.beforeInterrupted()})),a._minPendingPriority=null===a._minPendingPriority?i.priority:Math.min(a._minPendingPriority,i.priority),a._pendingTasks.push(i),i.taskFn(e.signal).then(c).catch((function(t){!r.isCancelled&&e.isUsed&&t instanceof se.FU||d(t)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i)}))},t._endTask=function(e){e.hasEnded=!0;var t=gt(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=gt(e.taskFn,this._pendingTasks);if(n<0)return;this._pendingTasks.splice(n,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):this._minPendingPriority=null,this._loopThroughWaitingQueue()}},t.updatePriority=function(e,t){var n=gt(e,this._waitingQueue);if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._findAndRunWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=gt(e,this._pendingTasks);if(i<0)j.Z.warn("TP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority?this._minPendingPriority=t:this._minPendingPriority===o&&(1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()),this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._findAndRunWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._findAndRunWaitingQueueTask=function(e){return e>=this._waitingQueue.length||e<0?(j.Z.warn("TP : Tried to start a non existing task"),!1):(this._waitingQueue.splice(e,1)[0].trigger(),!0)},t._interruptPendingTask=function(e){var t,n=gt(e.taskFn,this._pendingTasks);n<0?j.Z.warn("TP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(n,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),null===(t=e.interrupter)||void 0===t||t.cancel())},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}();function gt(e,t){return(0,Ve.Z)(t,(function(t){return t.taskFn===e}))}var yt=function(){function e(e,t,n){var r=new lt(n),i=Y.Z.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new mt({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=Y.Z.getCurrent(),s=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,u=o.DEFAULT_REQUEST_TIMEOUT,l=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,d=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:s,maxRetryOffline:null!=r?r:l,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?d.LOW_LATENCY:d.REGULAR,requestTimeout:(0,re.Z)(a)?u:a}}(e,this._backoffOptions),o=function(e,t,n,r,i){var a={timeout:i.requestTimeout<0?void 0:i.requestTimeout},o=(0,ft.Z)(["audio","video"],e)?new pt:void 0,s=t.loadSegment,u=t.parseSegment;return function(){var e=(0,le.Z)(de().mark((function e(t,l,c){var d,f,v,p,h,m,g,y,_,b,T,E,S,w,k,A;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A=function(){var e;y||!(0,re.Z)(h)&&void 0!==h.size&&void 0!==h.requestDuration&&m.length>0&&m.every((function(e){return e}))&&(y=!0,null===(e=r.onMetrics)||void 0===e||e.call(r,{size:h.size,requestDuration:h.requestDuration,content:t,segmentDuration:g}))},k=function(e){l.onRetry(Te(e))},w=function(e,n){m.push(!1);var r=m.length-1;return function(i){var a={data:e,isChunked:n};try{var o=u(a,t,i);return m[r]||(g=void 0!==g&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?g+o.chunkInfos.duration:void 0,m[r]=!0,A()),o}catch(e){throw(0,$.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},S=function(e){return s(e,t,a,c,_)},v=(0,dt.K)(t),p=ht(),m=[],g=0,y=!1,_={onProgress:function(e){var t;void 0===h&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=r.onProgress)||void 0===t||t.call(r,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:p}))},onNewChunk:function(e){l.onChunk(w(e,!0))}},null===(b=void 0!==o?o.get(t):null)){e.next=15;break}return j.Z.debug("SF: Found wanted segment in cache",v),l.onChunk(w(b,!1)),e.abrupt("return",Promise.resolve());case 15:return j.Z.debug("SF: Beginning request",v),null===(d=r.onRequestBegin)||void 0===d||d.call(r,{requestTimestamp:performance.now(),id:p,content:t}),c.register((function(){var e;void 0===h&&(j.Z.debug("SF: Segment request cancelled",v),h=null,null===(e=r.onRequestEnd)||void 0===e||e.call(r,{id:p}))})),e.prev=18,e.next=21,Re(t.representation.cdnMetadata,n,S,(0,ie.Z)({onRetry:k},i),c);case 21:"segment-loaded"===(T=e.sent).resultType?(E=T.resultData.responseData,void 0!==o&&o.add(t,T.resultData.responseData),l.onChunk(w(E,!1))):"segment-created"===T.resultType&&l.onChunk(w(T.resultData,!1)),j.Z.debug("SF: Segment request ended with success",v),l.onAllChunksReceived(),"segment-created"!==T.resultType?(h=T.resultData,A()):h=null,c.isCancelled||null===(f=r.onRequestEnd)||void 0===f||f.call(r,{id:p}),e.next=37;break;case 29:if(e.prev=29,e.t0=e.catch(18),h=null,!(e.t0 instanceof se.FU)){e.next=35;break}throw j.Z.debug("SF: Segment request aborted",v),e.t0;case 35:throw j.Z.debug("SF: Segment request failed",v),Te(e.t0);case 37:case"end":return e.stop()}}),e,null,[[18,29]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t,a,o){void 0===t&&(t=0);var s=function(t){return r(e,a,t)},u=n.create(s,t,a,o);return i.set(u,s),u},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):j.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),_t=yt,bt=n(5767),Tt=n(3774),Et=n(6923),St=V.ym;function wt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(j.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){j.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&j.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,bt.Z)(e),null!==n)try{j.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){j.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function kt(e){return function(e){return new v.y((function(t){if(null==Tt.J)throw new X.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,Et.Z)(e.src)?e.src:null;wt(e,null,n),j.Z.info("Init: Creating MediaSource");var r=new Tt.J,i=URL.createObjectURL(r);return j.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){wt(e,r,i)}}))}(e).pipe((0,h.z)((function(e){return St(e).pipe((0,a.q)(1),(0,s.U)((function(){return e})))})))}var At=n(8343);var xt=n(9607),It=n(3610),Zt=n(7326);var Rt=n(7904),Mt=n(6968),Ct=n(2870),Pt=n(9612);var Dt=function(e){function n(t,n,r){var i;i=e.call(this)||this;var a=r.addSourceBuffer(n);i._canceller=new se.ZP,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegment=null,i.codec=n;var o=i._onPendingTaskError.bind((0,Zt.Z)(i)),s=i._flush.bind((0,Zt.Z)(i)),u=Y.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,l=setInterval(s,u);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",s),i._canceller.signal.register((function(){clearInterval(l),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",s)})),i}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e,t){return j.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,dt.K)(e.inventoryInfos)),this._addToQueue({type:Pt.f.Push,value:e},t)},r.removeBuffer=function(e,t,n){return j.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Pt.f.Remove,value:{start:e,end:t}},n)},r.endOfSegment=function(e,t){return j.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,dt.K)(e)),this._addToQueue({type:Pt.f.EndOfSegment,value:e},t)},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Pt.f.Push:case Pt.f.Remove:case Pt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new se.FU),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new se.FU)}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){j.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.reject(t)}},r._addToQueue=function(e,t){var n=this;return new Promise((function(r,i){if(null!==t.cancellationError)return i(t.cancellationError);var a=0===n._queue.length&&null===n._pendingTask,o=(0,ie.Z)({resolve:r,reject:i},e);n._queue.push(o),t.register((function(e){var t=n._queue.indexOf(o);t>=0&&n._queue.splice(t,1),o.resolve=Ae.Z,o.reject=Ae.Z,i(e)})),a&&n._flush()}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Pt.f.Push||0===e.data.length){switch(e.type){case Pt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Pt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case Pt.f.Remove:this.synchronizeInventory();break;default:(0,Rt.Z)(e)}var t=e.resolve;return this._pendingTask=null,t(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Pt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,ie.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.reject(a)}this._pendingTask=(0,ie.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Pt.f.EndOfSegment:return j.Z.debug("AVSB: Acknowledging complete segment",(0,dt.K)(this._pendingTask.value)),void this._flush();case Pt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();j.Z.debug("AVSB: pushing segment",this.bufferType,(0,dt.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case Pt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;j.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Rt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(j.Z.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return j.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n),a?this.codec=n:j.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;j.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Mt._f)(s);this._lastInitSegment={data:u,hash:(0,Ct.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Mt._f)(e);if((0,Ct.Z)(n)===this._lastInitSegment.hash&&(0,te.Z)(t,n))return!0}return!1},n}(Pt.C),Nt=["audio","video","text","image"];function Ot(e){return"audio"===e||"video"===e}var Lt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Ot(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==J.Z.nativeTextTracksBuffer&&null==J.Z.htmlTextTracksBuffer||e.push("text"),null!=J.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(e){var t=this;return this._areNativeBuffersUsable()?Promise.resolve():new Promise((function(n,r){var i=function(){t._areNativeBuffersUsable()&&n()};t._onNativeBufferAddedOrDisabled.push(i),e.register((function(e){var n=t._onNativeBufferAddedOrDisabled.indexOf(i);n>=0&&t._onNativeBufferAddedOrDisabled.splice(n,1),r(e)}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else j.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(Ot(e)){if(null!=i)return i instanceof Dt&&i.codec!==t?j.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):j.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;j.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Dt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return j.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(j.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==J.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new J.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==J.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new J.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==J.Z.imageBuffer)throw new Error("Image buffer feature not activated");return j.Z.info("SB: Creating a new image SegmentBuffer"),r=new J.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw j.Z.error("SB: Unknown buffer type:",e),new X.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(j.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):j.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Nt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Bt=n(7878);function Ut(e,t){return t?function(n){return n.pipe(Ut((function(n,r){return(0,Bt.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,l.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe((0,c.x)(n,(function(t){i||(i=(0,c.x)(n,void 0,(function(){i=null,a&&n.complete()})),(0,Bt.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}function Ft(e,t){return new v.y((function(n){var r=!1,i=!1;return t().then((function(e){r||(i=!0,n.next(e),n.complete())}),(function(e){i=!0,r||n.error(e)})),function(){i||(r=!0,e.cancel())}}))}var zt=n(7473),Vt=n.n(zt);function Kt(){return new v.y((function(e){var t=!1;return Vt()((function(){t||(e.next(),e.complete())})),function(){t=!0}}))}var Gt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,He.Z)(this._array,e)},t.has=function(e){return(0,ft.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ht=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}();function Wt(e,t){var n,r=e.segmentBuffer,i=e.playbackObserver,a=e.maxBufferBehind,o=e.maxBufferAhead;function s(){(function(e,t,n,r,i){return jt.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";j.Z.error("Could not run BufferGarbageCollector:",t)}))}i.listen((function(e){var t;n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,s()}),{includeLastObservation:!0,clearSignal:t}),a.onUpdate(s,{clearSignal:t}),o.onUpdate(s,{clearSignal:t}),s()}function jt(){return(jt=(0,le.Z)(de().mark((function e(t,n,r,i,a){var o,s,u,l,c,d,f,v;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(isFinite(r)||isFinite(i)){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:o=[],s=(0,ae.F_)(t.getBufferedRanges(),n),u=s.innerRange,l=s.outerRanges,c=function(){if(isFinite(i)){for(var e=0;e<l.length;e++){var t=l[e];n+i<=t.start?o.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&o.push({start:n+i,end:t.end})}null!=u&&n+i<u.end&&o.push({start:n+i,end:u.end})}},function(){if(isFinite(r)){for(var e=0;e<l.length;e++){var t=l[e];n-r>=t.end?o.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&o.push({start:t.start,end:n-r})}null!=u&&n-r>u.start&&o.push({start:u.start,end:n-r})}}(),c(),d=0,f=o;case 9:if(!(d<f.length)){e.next=20;break}if(!((v=f[d]).start<v.end)){e.next=17;break}if(j.Z.debug("GC: cleaning range from SegmentBuffer",v.start,v.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(v.start,v.end,a);case 17:d++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qt=n(8567),Yt=n(3),Xt=n(9878);function $t(e,t,n,r){return Kt().pipe((0,h.z)((function(){return n.getReference().asObservable()})),(0,s.U)((function(i){var a,o,s=n.getCurrentTime()+r,u=Math.min(Math.max(e.start,s),null!==(a=e.end)&&void 0!==a?a:1/0),l=!(null!==(o=i.paused.pending)&&void 0!==o?o:n.getIsPaused());return qt.Z.waitingMediaSourceReload(t,e,u,l)})))}var Qt=n(3428);var Jt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentInfoRef=(0,oe.ZP)(void 0),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentInfoRef.setValue(null)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,g.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,b.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request,o.priority),!1)})),(0,L.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():U.E}))),n=e._downloadQueue.asObservable().pipe((0,b.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,L.w)((function(t){return null===t.initSegment?U.E:e._requestInitSegment(t.initSegment)})));return(0,B.T)(n,t)})).pipe((0,T.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=this;return(0,g.P)((function(){return r(t)})).pipe((0,Le.x)((function(){e._mediaSegmentRequest=null})));function r(e){if(void 0===e)return(0,p.of)({type:"end-of-queue",value:null});var t=e.segment,i=e.priority,a=(0,ie.Z)({segment:t},n._content);return new v.y((function(e){var o,s=new se.ZP,u=!1,l=!1,c=n._segmentFetcher.createRequest(a,i,{onRetry:function(n){e.next({type:"retry",value:{segment:t,error:n}})},beforeInterrupted:function(){j.Z.info("Stream: segment request interrupted temporarly.",t.id,t.time)},onChunk:function(e){var t=n._initSegmentInfoRef.getValue();void 0!==t?d(e(null!=t?t:void 0)):(l=!0,n._initSegmentInfoRef.waitUntilDefined((function(t){d(e(null!=t?t:void 0))}),{clearSignal:s.signal}))},onAllChunksReceived:function(){l?(n._mediaSegmentsAwaitingInitMetadata.add(t.id),n._initSegmentInfoRef.waitUntilDefined((function(){e.next({type:"end-of-segment",value:{segment:t}}),n._mediaSegmentsAwaitingInitMetadata.delete(t.id),l=!1}),{clearSignal:s.signal})):e.next({type:"end-of-segment",value:{segment:t}})},beforeEnded:function(){n._mediaSegmentRequest=null,l?n._initSegmentInfoRef.waitUntilDefined(f,{clearSignal:s.signal}):f()}},s.signal);return c.catch((function(t){u||(u=!0,e.error(t))})),n._mediaSegmentRequest={segment:t,priority:i,request:c},function(){n._mediaSegmentsAwaitingInitMetadata.delete(t.id),void 0!==o&&o.unsubscribe(),u||(u=!0,l=!1,s.cancel())};function d(n){(0,ye.Z)("media"===n.segmentType,"Should have loaded a media segment."),e.next((0,ie.Z)({},n,{type:"parsed-media",segment:t}))}function f(){var i=n._downloadQueue.getValue().segmentQueue;if(0===i.length)return e.next({type:"end-of-queue",value:null}),u=!0,void e.complete();i[0].segment.id===t.id&&i.shift(),u=!0,o=r(i[0]).subscribe(e)}}))}},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,U.E;var n=this;return new v.y((function(r){var i=new se.ZP,a=e.segment,o=e.priority,s=(0,ie.Z)({segment:a},t._content),u=!1,l=t._segmentFetcher.createRequest(s,o,{onRetry:function(e){r.next({type:"retry",value:{segment:a,error:e}})},beforeInterrupted:function(){j.Z.info("Stream: init segment request interrupted temporarly.",a.id)},beforeEnded:function(){n._initSegmentRequest=null,u=!0,r.complete()},onChunk:function(e){var t,i=e(void 0);(0,ye.Z)("init"===i.segmentType,"Should have loaded an init segment."),r.next((0,ie.Z)({},i,{type:"parsed-init",segment:a})),"init"===i.segmentType&&n._initSegmentInfoRef.setValue(null!==(t=i.initTimescale)&&void 0!==t?t:null)},onAllChunksReceived:function(){r.next({type:"end-of-segment",value:{segment:a}})}},i.signal);return l.catch((function(e){u||(u=!0,r.error(e))})),t._initSegmentRequest={segment:a,priority:o,request:l},function(){t._initSegmentRequest=null,u||(u=!0,i.cancel())}}))},e}();function en(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n)){var d=c.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,d)?(j.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:d}):null}var f=function(e,t,n){if(n<=0)return j.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==f){var v=i[f-1],p=i[f];if(null===n||p.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(v.infos.segment.end,p.infos.segment.time))return null;var h=v.bufferedEnd,m=p.bufferedStart;return j.Z.debug("RS: future discontinuity encountered",o.type,h,m),{start:h,end:m}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var g=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==g){var y=i[g];if(void 0!==y.bufferedEnd&&y.bufferedEnd<a.end)return j.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,y.bufferedEnd,a.end),{start:y.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var _=i.length-1;_>=0;_--){var b=i[_];if(void 0===b.bufferedStart)break;if(b.bufferedStart<t.end){if(void 0!==b.bufferedEnd&&b.bufferedEnd<t.end){var T=s.index.checkDiscontinuity(t.end);if(null!==T)return{start:b.bufferedEnd,end:T}}return null}}}return null}function tn(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.adaptation,c=n.representation,d=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),f=c.index.getSegments(o.start,o.end-o.start),v=t.filter((function(e){return!rn(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=Y.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return j.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e.start),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return j.Z.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;j.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=Y.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return j.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e.end),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return j.Z.info("Stream: The end of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;j.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),p=Y.Z.getCurrent(),h=p.MINIMUM_SEGMENT_SIZE,m=p.MIN_BUFFER_AHEAD,g=!1,y=Math.min(1/60,h),_=!1,b=[],T=f.filter((function(e){var t=(0,ie.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,dt.z)(t,e)})))return!1;var u=e.duration,f=e.time,p=e.end;if(e.isInit)return!0;if(g)return b.push(e),!1;if(e.complete&&u<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-y>f)&&(!(a.end+y<p)&&!rn(e,t,r,i))})))return!1;for(var T=0;T<v.length;T++){var E=v[T];if(E.infos.period.id===n.period.id){var S=E.infos.segment;if(f-S.time>-y&&S.end-p>-y)return!1}}var w=u*n.representation.bitrate;if(d-w<0&&(_=!0,f>o.start+m))return g=!0,b.push(e),!1;var k=a(t);if(k.length>1){var A=k[k.length-1],x=k[k.length-2];if(null===A.buffered&&null===x.buffered)return j.Z.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+l.type,c.id,e.time),!1}for(var I=0;I<v.length;I++){var Z=v[I];if(Z.end+y>f){var R=Z.start>f+y||nn(v,I).end<p-y;return R&&(d-=w),R}}return d-=w,!0}));return{segmentsToLoad:T,segmentsOnHold:b,isBufferFull:_}}function nn(e,t){for(var n=t+1,r=Y.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function rn(e,t,n,r){var i=Y.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=Y.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function an(e,t){for(var n=e-t,r=Y.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function on(e,t,n,r,i,a,o){o.synchronizeInventory();var s=e.representation,u=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastAvailablePosition(),l=s.index;i=!(0,re.Z)(u)&&t>=u&&l.isInitialized()&&l.isFinished()&&function(e,t,n){var r;return t.containsTime(n)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t-.1;var c,d=i+n;c=!(!s.index.isInitialized()||!s.index.isFinished()||void 0===o.end)&&(void 0===u?d>=o.end:null===u||d>=u);return{start:Math.max(i,o.start),end:Math.min(d,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:c}}(e,u,i),c=s.index.shouldRefresh(l.start,l.end),d=o.getPendingOperations().filter((function(e){return e.type===Pt.f.EndOfSegment})).map((function(e){return e.value})),f=function(e,t){for(var n=Y.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(l.start-.5,0),end:l.end+.5},o.getInventory()),v=tn({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:d,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:an(e.time,u),segment:e}})),y=s.index.isInitialized()&&s.index.isFinished()&&l.hasReachedPeriodEnd&&0===g.length&&0===h.length,_=null;return d.length>0&&(_=Math.min.apply(Math,d.map((function(e){return e.segment.time})))),h.length>0&&(_=null!==_?Math.min(_,h[0].time):h[0].time),g.length>0&&(_=null!==_?Math.min(_,g[0].segment.time):g[0].segment.time),{imminentDiscontinuity:en(e,l,_,y,f),hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:c}}function sn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return un(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e,t,n){return cn.apply(this,arguments)}function cn(){return(cn=(0,le.Z)(de().mark((function e(t,n,r){var i,a,o,s,u,l,c,d,f;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Y.Z.getCurrent().BUFFER_GC_GAPS.CALM,a=Y.Z.getCurrent().BUFFER_GC_GAPS.BEEFY,j.Z.warn("Stream: Running garbage collector"),o=n.getBufferedRanges(),0===(s=dn(t,o,i)).length&&(s=dn(t,o,a)),j.Z.hasLevel("DEBUG")&&j.Z.debug("Stream: GC cleaning",s.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),u=sn(s);case 8:if((l=u()).done){e.next=16;break}if(c=l.value,d=c.start,f=c.end,!(d<f)){e.next=14;break}return e.next=14,n.removeBuffer(d,f,r);case 14:e.next=8;break;case 16:return e.abrupt("return");case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,t,n){for(var r=(0,ae.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(j.Z.hasLevel("DEBUG")&&j.Z.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function fn(e,t,n,r){return vn.apply(this,arguments)}function vn(){return(vn=(0,le.Z)(de().mark((function e(t,n,r,i){var a,o,s,u,l,c;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.pushChunk(r,i);case 3:case 17:e.next=23;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=10;break}throw o=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new X.Z("BUFFER_APPEND_ERROR",o);case 10:return s=t.getReference().getValue(),u=s.position,l=null!==(a=u.pending)&&void 0!==a?a:u.last,e.prev=12,e.next=15,ln(l,n,i);case 15:return e.next=17,n.pushChunk(r,i);case 19:throw e.prev=19,e.t1=e.catch(12),c=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new X.Z("BUFFER_FULL_ERROR",c);case 23:case"end":return e.stop()}}),e,null,[[0,5],[12,19]])})))).apply(this,arguments)}var pn=function(e){var t=e.content,n=e.options,r=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,d=e.terminate$,f=t.period,v=t.adaptation,m=t.representation,y=n.bufferGoal$,_=n.maxBufferSize$,b=n.drmSystemId,E=n.fastSwitchThreshold$,S=v.type,w={segment:m.index.getInitSegment(),segmentData:null,isLoaded:!1},k=new i.x,A=(0,oe.$l)({initSegment:null,segmentQueue:[]}),x=null!==w.segment,I=new Jt(t,A,u,x);x||(w.segmentData=null,w.isLoaded=!0);var Z=!1,R=U.E;if(void 0!==b){var M=m.getEncryptionData(b);M.length>0&&M.every((function(e){return void 0!==e.keyIds}))&&(R=p.of.apply(void 0,M.map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))),Z=!0)}var P,D,L=I.start().pipe((0,h.z)((function(e){switch(e.type){case"retry":return(0,O.z)((0,p.of)({type:"warning",value:e.value.error}),(0,g.P)((function(){var t=e.value.segment,n=m.index;if(!1===n.isSegmentStillAvailable(t))k.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,p.of)(qt.Z.manifestMightBeOufOfSync());return U.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Vt()((function(){k.next()})),w.segmentData=e.initializationData,w.isLoaded=!0;var n=m.getAllEncryptionData(),i=!Z&&n.length>0?p.of.apply(void 0,n.map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))):U.E,a=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,g.P)((function(){if(null===i)return U.E;var e=n.representation.getMimeTypeString(),o={initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},u=new se.ZP;return Ft(u,(function(){return fn(t,a,{data:o,inventoryInfos:null},u.signal)})).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return qt.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o});return(0,B.T)(i,a)}var u=e.inbandEvents,l=e.needsManifestRefresh,c=e.protectionDataUpdate&&!Z?p.of.apply(void 0,m.getAllEncryptionData().map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))):U.E,d=!0===l?(0,p.of)(qt.Z.needsManifestRefresh()):U.E,f=void 0!==u&&u.length>0?(0,p.of)({type:"inband-events",value:u}):U.E,v=w.segmentData,h=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,g.P)((function(){var e,u;if(null===i.chunkData)return U.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,v=i.appendWindow,p=n.representation.getMimeTypeString(),h=Y.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==v[0]?Math.max(0,v[0]-h.START):void 0,void 0!==v[1]?v[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:p},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,ie.Z)({segment:a,chunkSize:f,start:y,end:_},n),T=new se.ZP;return Ft(T,(function(){return fn(t,o,{data:g,inventoryInfos:b},T.signal)})).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return qt.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:v,parsedSegment:e,segment:e.segment,segmentBuffer:o});return(0,O.z)(c,d,f,h)}(e);case"end-of-segment":var n=e.value.segment,i=new se.ZP;return Ft(i,(function(){return o.endOfSegment((0,ie.Z)({segment:n},t),i.signal)})).pipe((0,Be.l)());case"end-of-queue":return k.next(),U.E;default:(0,Rt.Z)(e)}}))),F=C([r.getReference().asObservable(),y,_,d.pipe((0,a.q)(1),(0,N.O)(null)),k.pipe((0,N.O)(void 0))]).pipe((0,Qt.M)(E),(0,h.z)((function(e){var n,i,a=e[0],s=a[0],u=a[1],l=a[2],c=a[3],d=e[1],v=null!==(n=s.position.pending)&&void 0!==n?n:s.position.last,h=on(t,v,r,d,u,l,o),g=h.neededSegments,y=null;if(m.index.isInitialized()){if(g.length>0&&!w.isLoaded&&null!==w.segment){var _=g[0].priority;y={segment:w.segment,priority:_}}}else if(null===w.segment)j.Z.warn("Stream: Uninitialized index without an initialization segment");else if(w.isLoaded)j.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var b=null!==(i=s.position.pending)&&void 0!==i?i:s.position.last;y={segment:w.segment,priority:an(f.start,b)}}if(null===c)A.setValue({initSegment:y,segmentQueue:g});else{if(c.urgent)return j.Z.debug("Stream: Urgent switch, terminate now.",S),A.setValue({initSegment:null,segmentQueue:[]}),A.finish(),(0,p.of)(qt.Z.streamTerminating());var T=g[0],E=I.getRequestedInitSegment(),k=I.getRequestedMediaSegment(),x=null===k||void 0===T||k.id!==T.segment.id?[]:[T],Z=null===E?null:y;if(A.setValue({initSegment:Z,segmentQueue:x}),0===x.length&&null===Z)return j.Z.debug("Stream: No request left, terminate",S),A.finish(),(0,p.of)(qt.Z.streamTerminating())}var R=(0,p.of)({type:"stream-status",value:{period:f,position:s.position.last,bufferType:S,imminentDiscontinuity:h.imminentDiscontinuity,hasFinishedLoading:h.hasFinishedLoading,neededSegments:h.neededSegments}}),M=U.E,C=Y.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(h.isBufferFull){var P=Math.max(0,v-C);if(P>0){var D=new se.ZP;M=Ft(D,(function(){return o.removeBuffer(0,P,D.signal)})).pipe((0,Be.l)())}}return h.shouldRefreshManifest?(0,O.z)((0,p.of)(qt.Z.needsManifestRefresh()),R,M):(0,O.z)(R,M)})),(P=function(e){return"stream-terminating"!==e.type},void 0===(D=!0)&&(D=!1),(0,l.e)((function(e,t){var n=0;e.subscribe((0,c.x)(t,(function(e){var r=P(e,n++);(r||D)&&t.next(e),!r&&t.complete()})))}))));return(0,B.T)(F,L,R).pipe((0,T.B)())};var hn=function(e){var t=e.playbackObserver,n=e.content,r=e.options,o=e.representationEstimator,u=e.segmentBuffer,l=e.segmentFetcherCreator,c=e.wantedBufferAhead,f=e.maxVideoBufferSize,m="direct"===r.manualBitrateSwitchingMode,y=n.manifest,_=n.period,E=n.adaptation,S={},w=(0,oe.$l)(null),k=new i.x,A=new se.ZP,x=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=(0,oe.ZP)([]);f(),o.addEventListener("decipherabilityUpdate",f);var l=a.register(v),c=t(e,n,u,r,a),d=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:d};function f(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new X.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played");return v(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function v(){o.removeEventListener("decipherabilityUpdate",f),u.finish(),void 0!==l&&l()}}(n,o,w,t,(function(e){k.error(e)}),A.signal),I=x.estimateRef,Z=x.abrCallbacks,R=l.createSegmentFetcher(E.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics}),M=(0,oe.$l)(null),C=I.asObservable().pipe((0,z.b)((function(e){M.setValue(e)})),(0,Ue.Z)(),(0,T.B)()),P=C.pipe((0,b.h)((function(e){return null!=e.bitrate})),d((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return j.Z.debug("Stream: new "+E.type+" bitrate estimate",t),qt.Z.bitrateEstimationChange(E.type,t)}))),D=C.pipe(Ut((function(e,t){return N(e,0===t)})));return(0,B.T)(k,D,P,new v.y((function(){return function(){return A.cancel()}})));function N(e,n){var i=e.representation;if(m&&e.manual&&!n){var o=Y.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return $t(_,E.type,t,o.bitrateSwitch)}var u=M.asObservable().pipe((0,b.h)((function(t){return null===t||t.representation.id!==i.id||t.manual&&!e.manual})),(0,a.q)(1),(0,s.U)((function(e){return null===e?(j.Z.info("Stream: urgent Representation termination",E.type),{urgent:!0}):e.urgent?(j.Z.info("Stream: urgent Representation switch",E.type),{urgent:!0}):(j.Z.info("Stream: slow Representation switch",E.type),{urgent:!1})}))),l=r.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),d()):(0,p.of)(0),c=(0,p.of)(qt.Z.representationChange(E.type,_,i));return(0,O.z)(c,L(i,u,l)).pipe((0,z.b)((function(e){"added-segment"===e.type&&Z.addedSegment(e.value),"representationChange"===e.type&&w.setValue(e.value.representation)})),(0,h.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?U.E:N(t,!1)}return(0,p.of)(e)})))}function L(e,n,i){return(0,g.P)((function(){var a=S[e.id],o=null!=a?a:1;S[e.id]=o;var l=c.asObservable().pipe((0,s.U)((function(e){return e*o}))),d="video"===E.type?f.asObservable():(0,p.of)(1/0);return j.Z.info("Stream: changing representation",E.type,e.id,e.bitrate),pn({playbackObserver:t,content:{representation:e,adaptation:E,period:_,manifest:y},segmentBuffer:u,segmentFetcher:R,terminate$:n,options:{bufferGoal$:l,maxBufferSize$:d,drmSystemId:r.drmSystemId,fastSwitchThreshold$:i}}).pipe((0,Xt.K)((function(t){var r=(0,$.Z)(t,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===r.code){var a=c.getValue(),s=o;if(s<=.25||a*s<=2)throw r;return S[e.id]=s-.25,L(e,n,i)}throw r})))}))}};function mn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable();return C([e.getReference().asObservable(),o]).pipe((0,h.z)((function(e){var t=e[0],r=e[1],o=t.position.last;return void 0!==i.end&&o+r>=i.end&&(j.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,p.of)({type:"stream-status",value:{period:i,bufferType:n,position:o,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var gn=n(9252);var yn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,He.Z)(i,(function(e){return(0,gn.Z)(e,"codecs=")})),l=(0,He.Z)(s,(function(e){return(0,gn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function _n(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return yn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,ae.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,ae.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,ae.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var v=r.currentTime,p=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===p)&&(0,ae.Ti)({start:s,end:u},v)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return yn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,ae.A1)(d,v))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===p,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=Y.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:v-b,end:v+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,ae.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var bn=function(e){var t=e.bufferType,n=e.content,r=e.garbageCollectors,i=e.playbackObserver,a=e.representationEstimator,o=e.segmentFetcherCreator,u=e.segmentBuffersStore,l=e.options,c=e.wantedBufferAhead,d=e.maxVideoBufferSize,f=n.period,v=new Yt.t(1);return v.pipe((0,L.w)((function(e,v){var m=Y.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===v?0:"audio"===t?m.trackSwitch.audio:"video"===t?m.trackSwitch.video:m.trackSwitch.other;if(null===e){j.Z.info("Stream: Set no "+t+" Adaptation. P:",f.start);var _,b=u.getStatus(t);if("initialized"===b.type){if(j.Z.info("Stream: Clearing previous "+t+" SegmentBuffer"),Lt.isNative(t))return $t(f,t,i,0);var T=new se.ZP;_=Ft(T,(function(){return void 0===f.end?b.value.removeBuffer(f.start,1/0,T.signal):f.end<=f.start?Promise.resolve():b.value.removeBuffer(f.start,f.end,T.signal)}))}else"uninitialized"===b.type&&u.disableSegmentBuffer(t),_=(0,p.of)(null);return(0,O.z)(_.pipe((0,s.U)((function(){return qt.Z.adaptationChange(t,null,f)}))),mn(i,c,t,{period:f}))}if(Lt.isNative(t)&&"disabled"===u.getStatus(t).type)return $t(f,t,i,y);j.Z.info("Stream: Updating "+t+" adaptation","A: "+e.id,"P: "+f.start);var E=(0,g.P)((function(){var s=i.getReadyState(),v=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return j.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new X.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played")}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(u,t,e,l),m={currentTime:i.getCurrentTime(),readyState:s},g=_n(v,f,e,m,l);if("needs-reload"===g.type)return $t(f,t,i,y);var _="flush-buffer"===g.type?(0,p.of)(qt.Z.needsBufferFlush()):U.E,b="clean-buffer"===g.type||"flush-buffer"===g.type?O.z.apply(void 0,g.value.map((function(e){var t=e.start,n=e.end,r=new se.ZP;return Ft(r,(function(){return v.removeBuffer(t,n,r.signal)}))}))).pipe((0,Be.l)()):U.E,T=r.get(v),E=function(e,r){var s=n.manifest,v=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=(0,oe.ZP)(i());return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){r.finish()})),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,ae.L7)(r,n.position.last);return(0,ie.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(i,r);return hn({content:{manifest:s,period:f,adaptation:e},options:l,playbackObserver:v,representationEstimator:a,segmentBuffer:r,segmentFetcherCreator:o,wantedBufferAhead:c,maxVideoBufferSize:d}).pipe((0,Xt.K)((function(e){if(!Lt.isNative(t)){j.Z.error("Stream: "+t+" Stream crashed. Aborting it.",e instanceof Error?e:""),u.disposeSegmentBuffer(t);var n=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,O.z)((0,p.of)(qt.Z.warning(n)),mn(i,c,t,{period:f}))}throw j.Z.error("Stream: "+t+" Stream crashed. Stopping playback.",e instanceof Error?e:""),e})))}(e,v),S=new se.ZP;return Ft(S,(function(){return u.waitForUsableBuffers(S.signal)})).pipe((0,h.z)((function(){return(0,O.z)(b,_,(0,B.T)(E,T))})))}));return(0,O.z)((0,p.of)(qt.Z.adaptationChange(t,e,f)),E)})),(0,N.O)(qt.Z.periodStreamReady(t,f,v)))},Tn=n(3074);function En(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,b.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,N.O)(!1),d())}));return C(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),d())}function Sn(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){j.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}function wn(e,t){if(0===t.length)return!1;var n=e.position.last;return e.speed>=0?t[t.length-1].end>=n-5:t[0].start<=n+5}var kn=function(e,t,n,r,u,l){var c,f,m=e.manifest,y=e.initialPeriod,_=l.maxBufferAhead,E=l.maxBufferBehind,S=l.wantedBufferAhead,w=l.maxVideoBufferSize,k=Y.Z.getCurrent(),A=k.MAXIMUM_MAX_BUFFER_AHEAD,x=k.MAXIMUM_MAX_BUFFER_BEHIND,I=new Ht((function(e){var n=e.bufferType,r=null!=x[n]?x[n]:1/0,i=null!=A[n]?A[n]:1/0;return new v.y((function(){var n=new se.ZP;return Wt({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,oe.lR)(E,(function(e){return Math.min(e,r)}),n.signal),maxBufferAhead:(0,oe.lR)(_,(function(e){return Math.min(e,i)}),n.signal)},n.signal),function(){n.cancel()}}))})),Z=r.getBufferTypes().map((function(e){return function(e,n){var o=new Gt((function(e,t){return e.start-t.start})),u=new i.x,l=!1;function c(t){return D(e,t,u).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=o.head();if(void 0===t||t.id!==e.value.period.id)return qt.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return qt.Z.needsMediaSourceReload(r,i);case"periodStreamReady":l=!0,o.add(e.value.period);break;case"periodStreamCleared":o.removeElement(e.value.period)}return e})),(0,T.B)())}function d(e){var t=o.head(),n=o.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var f=t.getReference().asObservable().pipe((0,Fe.Z)((function(t){var n,r,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(!l||!d(a))return null;var o=null!==(r=m.getPeriodForTime(a))&&void 0!==r?r:m.getNextPeriod(a);return void 0===o?null:(j.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,a),l=!1,u.next(),o)}),null),(0,h.z)((function(e){if(null==e)throw new X.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return c(e)}))),v=(0,ne.R)(m,"decipherabilityUpdate").pipe((0,h.z)(y));return(0,B.T)(f,v,c(n));function y(n){var i=r.getStatus(e),o=n.filter((function(t){return t.adaptation.type===e}));if(0===o.length||"initialized"!==i.type)return U.E;var s=i.value,d=o.filter((function(e){return void 0===e.representation.decipherable})),f=o.filter((function(e){return!1===e.representation.decipherable})),v=Sn(s,f),y=Sn(s,d);l=!1,u.next();var _=[].concat(v,y).map((function(e){var t=e.start,n=e.end;if(t>=n)return U.E;var r=new se.ZP;return Ft(r,(function(){return s.removeBuffer(t,n,r.signal)})).pipe((0,Be.l)())}));return O.z.apply(void 0,_.concat([Kt().pipe((0,Be.l)()),t.getReference().asObservable().pipe((0,a.q)(1),(0,h.z)((function(e){var n,r=(0,g.P)((function(){var t,n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,r=m.getPeriodForTime(n);if(null==r)throw new X.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return c(r)}));if(wn(e,v)){var i=!(null!==(n=e.paused.pending)&&void 0!==n?n:t.getIsPaused());return(0,O.z)((0,p.of)(qt.Z.needsDecipherabilityFlush(e.position.last,i,e.duration)),r)}return wn(e,y)?(0,O.z)((0,p.of)(qt.Z.needsBufferFlush()),r):r})))]))}}(e,y).pipe((0,Ue.Z)(),(0,T.B)())})),R=(c=Z,f=c.length,B.T.apply(void 0,c).pipe((0,b.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Tn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===f&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),d((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,b.h)((function(e){return null!==e})),(0,s.U)((function(e){return j.Z.info("Stream: New active period",e.start),qt.Z.activePeriodChanged(e)}))),M=(0,ne.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return m.isLastPeriodKnown})),(0,N.O)(m.isLastPeriodKnown),d()),P=C([En.apply(void 0,Z),M]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),d(),(0,s.U)((function(e){return e?qt.Z.endOfStream():qt.Z.resumeStream()})));return B.T.apply(void 0,Z.concat([R,P]));function D(e,s,c){j.Z.info("SO: Creating new Stream for",e,s.start);var d=new i.x,f=new i.x,v=t.getReference().asObservable().pipe((0,b.h)((function(e){var t,n=e.position;return null!=s.end&&(null!==(t=n.pending)&&void 0!==t?t:n.last)>=s.end}))),g=d.pipe(Ut((function(t){return D(e,t,f)}))),y=c.pipe((0,a.q)(1),(0,z.b)((function(){d.complete(),f.next(),f.complete()})),(0,T.B)()),_=(0,B.T)(v,y),E=bn({bufferType:e,content:{manifest:m,period:s},garbageCollectors:I,maxVideoBufferSize:w,segmentFetcherCreator:u,segmentBuffersStore:r,options:l,playbackObserver:t,representationEstimator:n,wantedBufferAhead:S}).pipe((0,h.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=m.getPeriodAfter(s);if(null===n)return(0,O.z)((0,p.of)(t),(0,p.of)(qt.Z.streamComplete(e)));d.next(n)}else f.next();return(0,p.of)(t)})),(0,T.B)()),k=(0,O.z)(E.pipe((0,o.R)(_)),(0,p.of)(qt.Z.periodStreamCleared(e,s)).pipe((0,z.b)((function(){j.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,B.T)(k,g,y.pipe((0,Be.l)()))}},An=kn;var xn=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getMaximumAvailablePosition=function(){var e;if(this._manifest.isDynamic)return null!==(e=this._manifest.getLivePosition())&&void 0!==e?e:this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var t=In(this._lastVideoAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}if(null===this._lastVideoAdaptation){var n=In(this._lastAudioAdaptation);return"number"!=typeof n?this._manifest.getMaximumSafePosition():n}var r=In(this._lastAudioAdaptation),i=In(this._lastVideoAdaptation);return"number"!=typeof r||"number"!=typeof i?this._manifest.getMaximumSafePosition():Math.min(r,i)},t.getEndingPosition=function(){var e,t;if(!this._manifest.isDynamic)return this.getMaximumAvailablePosition();if(void 0!==this._lastVideoAdaptation&&void 0!==this._lastAudioAdaptation){if(null===this._lastAudioAdaptation)return null===this._lastVideoAdaptation?void 0:null!==(e=Zn(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=Zn(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=Zn(this._lastAudioAdaptation),r=Zn(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function In(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastAvailablePosition();if(void 0===a)return;null!==a&&(r=(0,re.Z)(r)?a:Math.min(r,a))}return r}function Zn(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getEnd();if(void 0===a)return;null!==a&&(r=(0,re.Z)(r)?a:Math.min(r,a))}return r}var Rn=n(5039),Mn=Array.isArray;function Cn(e){return 1===e.length&&Mn(e[0])?e[0]:e}function Pn(e){return function(t){for(var n=[],r=function(r){n.push((0,Bt.Xf)(e[r]).subscribe((0,c.x)(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var Dn=n(5987);var Nn=V.gg,On=V.ym,Ln=V._E;function Bn(e){return(0,g.P)((function(){if(j.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return j.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,p.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return j.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,p.of)(null);j.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return Ln(e).pipe((0,a.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Cn(e)).length?(0,Bt.Xf)(e[0]):new v.y(Pn(e))}(B.T.apply(void 0,i).pipe((r=1,r<=0?function(){return U.E}:(0,l.e)((function(e,t){var n=[];e.subscribe((0,c.x)(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,Dn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),Nn(t).pipe((0,a.q)(1))).pipe((0,h.z)((function(){return Bn(e)})))}))}var Un=n(7920),Fn=n(6625),zn=n(2401),Vn=n(7991);function Kn(e,t){return void 0===e&&(e=0),void 0===t&&(t=Vn.z),e<0&&(e=0),(0,Fn.H)(e,e,t)}var Gn=31536e3,Hn=function(){function e(e,t){var n=this;this._lastKnownDuration=(0,oe.ZP)(void 0),this._subscription=function(e){return(0,B.T)((0,V.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,V.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,V.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,N.O)("open"===e.readyState),d())}(t).pipe((0,L.w)((function(t){return t?C([n._lastKnownDuration.asObservable(),(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null))]):U.E})),(0,L.w)((function(n){var r=n[0];return function(e){if(0===e.length)return(0,p.of)(!1);for(var t=[],n=function(n){var r=e[n];t.push((0,B.T)((0,zn.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,zn.R)(r,"update").pipe((0,s.U)((function(){return!1}))),Kn(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,N.O)(r.updating),d()))},r=0;r<e.length;r++)n(r);return C(t).pipe((0,s.U)((function(e){return e.some((function(e){return e}))})),d())}(t.sourceBuffers).pipe((0,L.w)((function(n){return n?U.E:function n(){if("success"===function(e,t,n){var r,i=n;if(void 0===i)if(t.isDynamic){var a=null!==(r=t.getLivePosition())&&void 0!==r?r:t.getMaximumSafePosition();i=Math.max(Math.pow(2,32),a+Gn)}else i=t.getMaximumSafePosition();for(var o=0,s=0;s<e.sourceBuffers.length;s++){var u=e.sourceBuffers[s],l=u.buffered.length;l>0&&(o=Math.max(u.buffered.end(l-1)))}if(i===e.duration)return"success";if(o>i){if(o<e.duration)try{j.Z.info("Init: Updating duration to what is currently buffered",o),e.duration=i}catch(e){return j.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var c=e.duration;try{j.Z.info("Init: Updating duration",i),e.duration=i}catch(e){return j.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var d=Math.abs(e.duration-i);return d>=.1?d<Math.abs(e.duration-c)?"partial":"failed":"success"}(t,e,r))return U.E;return(0,Fn.H)(2e3).pipe((0,h.z)((function(){return n()})))}()})))}))).subscribe()}var t=e.prototype;return t.updateKnownDuration=function(e){this._lastKnownDuration.setValue(e)},t.stop=function(){this._subscription.unsubscribe()},e}();var Wn=n(342);var jn=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var qn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(jn(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function Yn(e){return void 0!==e.end}var Xn=function(e,t,n){var r=new WeakMap,i=[];return(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null),(0,Tn.R)((function(t){return qn(t,e)}),[])).pipe((0,z.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),d(),(0,L.w)((function(e){return e?C([Kn(Y.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL).pipe((0,N.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,l.e)((function(e,t){var n,r=!1;e.subscribe((0,c.x)(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,h.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var c=e[l],d=c.start,f=Yn(c)?c.end:void 0;r.has(c)?(d>o||void 0!==f&&o>=f)&&(Yn(c)&&u.push(c.publicEvent),r.delete(c)):d<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:c.publicEvent}),r.set(c,!0)):i<d&&o>=(null!=f?f:d)&&(a?s.push({type:"stream-event-skip",value:c.publicEvent}):(s.push({type:"stream-event",value:c.publicEvent}),Yn(c)&&u.push(c.publicEvent)))}return(0,O.z)(s.length>0?p.of.apply(void 0,s):U.E,u.length>0?p.of.apply(void 0,u).pipe((0,z.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,Be.l)()):U.E)}(i,t,n)}))):U.E})))},$n=Xn;function Qn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.representationEstimator,l=e.playbackObserver,c=e.segmentFetcherCreator;return function(e,f,v){var m,g=new Hn(n,e),y=null!==(m=n.getPeriodForTime(f))&&void 0!==m?m:n.getNextPeriod(f);if(void 0===y){var _=new X.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,It._)((function(){return _}))}var T=new Lt(t,e),E=(0,Un.Z)({mediaElement:t,playbackObserver:l,startTime:f,mustAutoPlay:v}),S=E.seekAndPlay$,w=E.initialPlayPerformed,k=E.initialSeekPerformed,A=l.getReference().asObservable(),x=w.asObservable().pipe((0,b.h)((function(e){return e})),(0,h.z)((function(){return $n(n,t,A)}))),I=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,s=n.startTime;return t.deriveReadOnlyObserver((function(t,n){var u=(0,oe.ZP)(l());return o.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),t.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){u.finish()})),u;function l(){var n,u=t.getValue(),l=o.getValue();if(a.getValue()){if(!e.isDynamic||e.isLastPeriodKnown){var c=e.periods[e.periods.length-1];void 0!==c&&void 0!==c.end&&u.position>c.end&&(n=c.end-1)}}else n=s;return{maximumPosition:e.getMaximumSafePosition(),position:{last:u.position,pending:n},duration:u.duration,paused:{last:u.paused,pending:i.getValue()||!r===u.paused?void 0:!r},readyState:u.readyState,speed:l}}function c(){u.setValue(l())}}))}(n,l,{autoPlay:v,initialPlayPerformed:w,initialSeekPerformed:k,speed:r,startTime:f}),Z=new i.x,R=new i.x,M=new i.x,C=(0,oe.ZP)(null),P=An({manifest:n,initialPeriod:y},I,u,T,c,a).pipe((0,h.z)((function(t){switch(t.type){case"end-of-stream":return j.Z.debug("Init: end-of-stream order received."),function(e){return On(e).pipe((0,N.O)(null),(0,L.w)((function(){return Bn(e)})))}(e).pipe((0,Be.l)(),(0,o.R)(Z));case"resume-stream":return j.Z.debug("Init: resume-stream order received."),Z.next(null),U.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return R.next({period:r,bufferType:i,discontinuity:a,position:s}),U.E;case"locked-stream":return M.next(t.value),U.E;case"adaptationChange":return C.setValue(t),(0,p.of)(t);default:return(0,p.of)(t)}}))),D=function(e,t,n){var r=new xn(e),i=n.getReference().asObservable().pipe((0,Fe.Z)((function(t){var n,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(a<e.getMinimumSafePosition()){var o=new X.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return At.Z.warning(o)}if(a>r.getMaximumAvailablePosition()){var s=new X.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return At.Z.warning(s)}return null}),null)),a=(0,oe.ZP)(void 0),o=(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null),(0,z.b)((function(){var t=e.isDynamic?r.getEndingPosition():r.getMaximumAvailablePosition();a.setValue(t)})),(0,Be.l)()),u=t.asObservable().pipe((0,z.b)((function(t){if(null!==t&&e.isLastPeriodKnown){var n=e.periods[e.periods.length-1];if(t.value.period.id===(null==n?void 0:n.id)&&("audio"===t.value.type||"video"===t.value.type)){"audio"===t.value.type?r.updateLastAudioAdaptation(t.value.adaptation):r.updateLastVideoAdaptation(t.value.adaptation);var i=e.isDynamic?r.getMaximumAvailablePosition():r.getEndingPosition();a.setValue(i)}}})),(0,Be.l)());return(0,B.T)(o,u,i,a.asObservable().pipe(F((function(e){return void 0===e})),d(),(0,s.U)((function(e){return{type:"contentDurationUpdate",value:e}}))))}(n,C,I).pipe((0,h.z)((function(e){return"contentDurationUpdate"===e.type?(j.Z.debug("Init: Duration has to be updated.",e.value),g.updateKnownDuration(e.value),U.E):(0,p.of)(e)}))),O=(0,Wn.Z)(l,n,r,M,R),V=S.pipe((0,L.w)((function(e){return"warning"===e.type?(0,p.of)(e):(0,Rn.Z)(A,t,T,!1)})));return(0,B.T)(V,O,P,D,x).pipe((0,Le.x)((function(){g.stop(),T.disposeAll()})))}}function Jn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,o=e.minimumManifestUpdateInterval,u=e.scheduleRefresh$,l=(t=function(e,t){return i.fetch(e).pipe((0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):e.parse(t)})),(0,T.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new v.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),c=r.manifest,d=0;return(0,g.P)((function(){return f(r)}));function f(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,l=Y.Z.getCurrent(),v=l.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,g=l.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,y=d>0?d<v:void 0!==i&&i>=g,_=void 0===t?0:performance.now()-t,b=Math.max(o-_,0),T=u.pipe((0,h.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&y;return er(null!=r?r:0,o,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),E=null===c.expired?U.E:(0,Fn.H)(b).pipe((0,h.z)((function(){return null===c.expired?U.E:(0,x.D)(c.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:y}}))),S=function(){if(void 0===c.lifetime||c.lifetime<0)return U.E;var e,t=1e3*c.lifetime-_;void 0===i?e=t:c.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-_,Math.max(t,0)+i),6*t),j.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*c.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),j.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,Fn.H)(Math.max(e,b)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:y}})))}();return(0,B.T)(S,T,E).pipe((0,a.q)(1),(0,h.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):f(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=c.updateUrl,i=t||void 0===r,a=i?c.getUrl():r,s=c.clockOffset;return n?(d+=1,j.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(d)+" consecutive time.")):d>0&&(j.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(d)+" consecutive times."),d=0),l(a,{externalClockOffset:s,previousManifest:c,unsafeMode:n}).pipe((0,h.z)((function(e){if("warning"===e.type)return(0,p.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,a=e.parsingTime,s=performance.now();if(i)c.replace(t);else try{c.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return j.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),er(Y.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,o,n).pipe((0,h.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,p.of)({type:"parsed",manifest:c,sendingTime:n,receivedTime:r,parsingTime:a,updatingTime:performance.now()-s})})))}}function er(e,t,n){return(0,g.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,Fn.H)(Math.max(e-r,i))}))}var tr=n(2447);var nr=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,u=e.keySystems,l=e.lowLatencyMode,c=e.manifest$,d=e.manifestFetcher,f=e.mediaElement,v=e.minimumManifestUpdateInterval,g=e.playbackObserver,y=e.segmentRequestOptions,_=e.speed,E=e.startAt,S=e.transport,w=e.textTrackOptions,k=ot(t),A=new se.ZP,x=kt(f).pipe((0,m.d)({refCount:!0})),I=new i.x,Z=(0,xt.Z)(f,u,I,x).pipe((0,Ue.Z)(),(0,T.B)()),R=(0,tr.Z)(f),M=C([c,Z.pipe((0,b.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,a.q)(1))]).pipe((0,h.z)((function(e){var t=e[0],a=e[1],u=a.drmSystemId,c=a.mediaSource;if("warning"===t.type)return(0,p.of)(t);var m=t.manifest;j.Z.debug("Init: Calculating initial time");var b=function(e,t,n){if(!(0,re.Z)(n)){var r,i=e.getMinimumSafePosition();if(e.isLive&&(r=e.getLivePosition()),void 0===r&&(r=e.getMaximumSafePosition()),!(0,re.Z)(n.position))return j.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,r),i);if(!(0,re.Z)(n.wallClockTime)){j.Z.debug("Init: using startAt.wallClockTime");var a=void 0===e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,r),i)}if(!(0,re.Z)(n.fromFirstPosition)){j.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?i:Math.min(r,i+s)}if(!(0,re.Z)(n.fromLastPosition)){j.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?r:Math.max(i,r+u)}if(!(0,re.Z)(n.percentage)){j.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?r:l<0?i:i+ +l/100*(r-i)}}var c=e.getMinimumSafePosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,v=e.clockOffset,p=e.getMaximumSafePosition(),h=Y.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===v)j.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=p;else{j.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=void 0===e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+v)/1e3-m;d=Math.min(p,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return j.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return j.Z.info("Init: starting at the minimum available position:",c),c}(m,l,E);j.Z.debug("Init: Initial time calculated:",b);var T={lowLatencyMode:l,requestTimeout:y.requestTimeout,maxRetryRegular:y.regularError,maxRetryOffline:y.offlineError},x=new _t(S,T,A.signal),Z=Qn({bufferOptions:(0,ie.Z)({textTrackOptions:w,drmSystemId:u},r),manifest:m,mediaElement:f,playbackObserver:g,representationEstimator:k,segmentFetcherCreator:x,speed:_}),R=function e(t,n,r){var a=new i.x,s=Z(t,n,r).pipe((0,Fe.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return M.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=Y.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return M.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=me(f);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?g.setCurrentTime(f.currentTime+.001):g.setCurrentTime(r),null;case"encryption-data-encountered":return I.next(e.value),null;case"needs-buffer-flush":return g.setCurrentTime(f.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,L.w)((function(t){return kt(f).pipe((0,h.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,N.O)(At.Z.reloadingMediaSource()))})));return(0,B.T)(u,s)}(c,b,n),M=new i.x,C=Jn({initialManifest:t,manifestFetcher:d,minimumManifestUpdateInterval:v,scheduleRefresh$:M}),P=(0,B.T)((0,ne.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return At.Z.manifestUpdate()}))),(0,ne.R)(m,"decipherabilityUpdate").pipe((0,s.U)(At.Z.decipherabilityUpdate)));return(0,B.T)(P,C,R).pipe((0,N.O)(At.Z.manifestReady(m)),(0,Le.x)((function(){M.complete()})))})));return(0,B.T)(M,R,Z.pipe((0,Be.l)())).pipe((0,Le.x)((function(){A.cancel()})))},rr=n(5553);function ir(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ar(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var or=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],sr=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new se.ZP,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getPlaybackRate=function(){return this._mediaElement.playbackRate},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeeksIncoming.push(e),this._mediaElement.currentTime=e},t.setPlaybackRate=function(e){this._mediaElement.playbackRate=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled))return Ae.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return cr(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=Y.Z.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r,i=n;"seeking"===i&&t._internalSeeksIncoming.length>0&&(i="internal-seeking",r=t._internalSeeksIncoming.shift());var a=null!=e?e:t._generateInitialObservation(),o=lr(t._mediaElement,i,t._withMediaSource),s=null;o.seeking&&("number"==typeof r?s=r:null!==a.pendingInternalSeek&&"seeking"!==n&&(s=a.pendingInternalSeek));var u=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=Y.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,v=t.paused,p=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n,r,i){var a=Y.Z.getCurrent().REBUFFERING_GAP,o=i?"LOW_LATENCY":"DEFAULT";if(void 0===t)return n&&Math.abs(r-e)<=a[o];return null!==t&&r-t.end<=a[o]}(l,d,h,f,o),b=p>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c===1/0?(r=!0,T=l):void 0===c?p<3&&(r=!0,T=void 0):c<=E&&(r=!0,T=l+c);else if(null!==m){var S=ur(m,o);!0!==r&&null!==m&&p>1&&(_||h||void 0!==c&&isFinite(c)&&c>S)||void 0===c&&p>=3?i=!0:void 0===c?T=void 0:c===1/0?T=l:c<=S&&(T=l+c)}}else b&&(!v&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&(c===1/0||void 0===c&&p<3))?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||void 0===c&&p>=3||void 0!==c&&c<1/0&&(c>ur(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),l=function(e,t){var n=Y.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&void 0!==t.bufferGap&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(a,o),c=(0,ie.Z)({},{rebuffering:u,freezing:l,pendingInternalSeek:s},o);return j.Z.hasLevel("DEBUG")&&j.Z.debug("API: current media element state tick","event",c.event,"position",c.position,"seeking",c.seeking,"internalSeek",c.pendingInternalSeek,"rebuffering",null!==c.rebuffering,"freezing",null!==c.freezing,"ended",c.ended,"paused",c.paused,"playbackRate",c.playbackRate,"readyState",c.readyState),c},s=(0,oe.ZP)(o("init")),u=function(t){var n=o(t);j.Z.hasLevel("DEBUG")&&j.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},l=this._lowLatencyMode?i:this._withMediaSource?r:a,c=setInterval(f,l),d=or.map((function(e){function n(){clearInterval(c),c=setInterval(f,l),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(c),d.forEach((function(e){return e()})),s.finish()})),s;function f(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,ie.Z)(lr(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function ur(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=Y.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function lr(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,c=e.playbackRate,d=e.readyState,f=e.seeking;return!n&&0===a.length&&d>=3?(r=void 0,i=void 0):i=null!==(r=(0,ae.rx)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:c,readyState:d,seeking:f,event:t}}function cr(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getPlaybackRate:function(){return e.getPlaybackRate()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled)||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return cr(this,e,n)}}}var dr=n(7829);function fr(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,dr.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function vr(e){return e.map((function(e){return null===e?e:{normalized:(0,dr.ZP)(e.language),closedCaption:e.closedCaption}}))}var pr=function(){function e(e){this._periods=new Gt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=Tr(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void j.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):j.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else j.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,ft.Z)(r,i))n.adaptation$.next(i);else{var a=mr(r,fr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,ft.Z)(r,i))n.adaptation$.next(i);else{var a=yr(r,vr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.video:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,ft.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=br(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=wr(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.audio:null;if((0,re.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.text:null;if((0,re.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.video:null;if((0,re.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=wr(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=Tr(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,re.Z)(r))return null;var i={language:(0,ze.Z)(r.language,""),normalized:(0,ze.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(Sr),label:r.label};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,re.Z)(r)?null:{language:(0,ze.Z)(r.language,""),normalized:(0,ze.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id,label:r.label}},t.getChosenVideoTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.video:null;if((0,re.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,re.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(Er),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(Er),label:i.label};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,re.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,ze.Z)(e.language,""),normalized:(0,ze.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(Sr),label:e.label};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,re.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,ze.Z)(e.language,""),normalized:(0,ze.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id,label:e.label}}))},t.getAvailableVideoTracks=function(e){var t,n=Tr(this._periods,e),r=void 0!==n?n.video:null;if((0,re.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(Er),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(Er),label:e.label};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=fr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,ft.Z)(s,u))n(r+1);else{var l=mr(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=vr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,ft.Z)(s,u))n(r+1);else{var l=yr(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,ft.Z)(s,u.baseAdaptation)){var l=wr(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=br(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=wr(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function hr(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function mr(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=hr(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return e[0]}function gr(e){return function(t){return(0,ze.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function yr(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=gr(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return null}function _r(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function br(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=_r(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return e[0]}function Tr(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function Er(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function Sr(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function wr(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var kr=V.XR,Ar=V.w0,xr=V.it,Ir=V.O0,Zr=V.Q1,Rr=V.UA,Mr=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p,h,m,g=Y.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,re.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,re.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,re.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,re.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,re.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,re.Z)(e.throttleWhenHidden)?a=A:((0,ue.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,re.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,ue.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,ue.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,ue.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,re.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,re.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,re.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,re.Z)(e.minVideoBitrate))p=b.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,re.Z)(e.minAudioBitrate))v=b.audio;else if(v=Number(e.minAudioBitrate),isNaN(v))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,re.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,re.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(v>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+v+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:v,minVideoBitrate:p,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,re.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),u=r.initialAudioBitrate,l=r.initialVideoBitrate,c=r.limitVideoWidth,f=r.minAudioBitrate,v=r.minVideoBitrate,p=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=Y.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;S.preload="auto",t.version="3.29.0-dev.2022110200",t.log=j.Z,t.state="STOPPED",t.videoElement=S;var I=new se.ZP;return t._priv_destroy$=new i.x,t._priv_destroy$.pipe((0,a.q)(1)).subscribe((function(){I.cancel()})),t._priv_pictureInPictureRef=Ar(S,I.signal),Zr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),Rr(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),d((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_speed=(0,oe.ZP)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,oe.ZP)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,oe.ZP)(w),maxBufferAhead:(0,oe.ZP)(h),maxBufferBehind:(0,oe.ZP)(m),maxVideoBufferSize:(0,oe.ZP)(k)},t._priv_bitrateInfos={lastBitrates:{audio:u,video:l},minAutoBitrates:{audio:(0,oe.ZP)(f),video:(0,oe.ZP)(v)},maxAutoBitrates:{audio:(0,oe.ZP)(p),video:(0,oe.ZP)(g)},manualBitrates:{audio:(0,oe.ZP)(-1),video:(0,oe.ZP)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=c,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t}(0,t.Z)(r,n);var u=r.prototype;return u.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},u.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},u.dispose=function(){this.stop(),null!==this.videoElement&&pe(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";j.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_reloadingMetadata={},this.videoElement=null},u.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p=Y.Z.getCurrent(),h=p.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,m=p.DEFAULT_AUTO_PLAY,g=p.DEFAULT_CODEC_SWITCHING_BEHAVIOR,y=p.DEFAULT_ENABLE_FAST_SWITCHING,_=p.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,b=p.DEFAULT_SHOW_NATIVE_SUBTITLE,T=p.DEFAULT_TEXT_TRACK_MODE;if((0,re.Z)(e))throw new Error("No option set on loadVideo");if((0,re.Z)(e.url)){if((0,re.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,re.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else u=String(e.url);if((0,re.Z)(e.transport))throw new Error("No transport set on loadVideo");l=String(e.transport);var E=(0,re.Z)(e.autoPlay)?m:!!e.autoPlay;if((0,re.Z)(e.keySystems))c=[];else for(var S,w=ir(c=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(S=w()).done;){var k=S.value;if("string"!=typeof k.type||"function"!=typeof k.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var A=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,x="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},I=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,Z=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,R=(0,re.Z)(e.audioTrackSwitchingMode)?h:e.audioTrackSwitchingMode;(0,ft.Z)(["seamless","direct","reload"],R)||(j.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+h+" strategy will be used as default"),R=h);var M=(0,re.Z)(e.onCodecSwitch)?g:e.onCodecSwitch;(0,ft.Z)(["continue","reload"],M)||(j.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+g+" will be used as default"),M=g);var C=(0,ie.Z)({},x,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:A});if(delete C.initialManifest,delete C.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,ue.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var P,D=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],N=ir(D);!(P=N()).done;){var O=P.value;if("string"!=typeof O.language||"string"!=typeof O.mimeType||"string"!=typeof O.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}C.supplementaryTextTracks=D}if(void 0!==e.supplementaryImageTracks){(0,ue.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var L,B=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],U=ir(B);!(L=U()).done;){var F=L.value;if("string"!=typeof F.mimeType||"string"!=typeof F.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}C.supplementaryImageTracks=B}if((0,re.Z)(e.textTrackMode))d=T;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");d=e.textTrackMode}(0,re.Z)(e.defaultAudioTrack)||(0,ue.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var z=(0,rr.iH)(e.defaultAudioTrack);(0,re.Z)(e.defaultTextTrack)||(0,ue.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var V=(0,rr.Y1)(e.defaultTextTrack),K=!b;(0,re.Z)(e.hideNativeSubtitle)||((0,ue.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),K=!!e.hideNativeSubtitle);var G=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:_,H=(0,re.Z)(e.enableFastSwitching)?y:e.enableFastSwitching;if("html"===d){if((0,re.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");f=e.textTrackElement}else(0,re.Z)(e.textTrackElement)||j.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,re.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var W=e.startAt.wallClockTime.getTime()/1e3;v=(0,ie.Z)({},e.startAt,{wallClockTime:W})}else v=e.startAt;return{autoPlay:E,defaultAudioTrack:z,defaultTextTrack:V,enableFastSwitching:H,hideNativeSubtitle:K,keySystems:c,initialManifest:I,lowLatencyMode:A,manualBitrateSwitchingMode:G,audioTrackSwitchingMode:R,minimumManifestUpdateInterval:Z,networkConfig:null!==(s=e.networkConfig)&&void 0!==s?s:{},onCodecSwitch:M,startAt:v,textTrackElement:f,textTrackMode:d,transport:l,transportOptions:C,url:u}}(e);j.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t)},u.reload=function(e){var t,n,r,i,a=this._priv_reloadingMetadata,o=a.options,s=a.manifest,u=a.reloadPosition,l=a.reloadInPause;if(void 0===o)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))r={position:e.reloadAt.position};else if(void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.relative)){if(void 0===u)throw new Error("Can't reload to a relative position when previous content was not loaded.");r={position:e.reloadAt.relative+u}}else void 0!==u&&(r={position:u});void 0!==(null==e?void 0:e.autoPlay)?i=e.autoPlay:void 0!==l&&(i=!l);var c=Object.assign(Object.assign({},o),{initialManifest:s});void 0!==r&&(c.startAt=r),void 0!==i&&(c.autoPlay=i),this._priv_initializeContentPlayback(c)},u._priv_initializeContentPlayback=function(e){var t,n,r,u=this,l=e.autoPlay,c=e.audioTrackSwitchingMode,f=e.defaultAudioTrack,y=e.defaultTextTrack,E=e.enableFastSwitching,S=e.initialManifest,w=e.keySystems,k=e.lowLatencyMode,A=e.manualBitrateSwitchingMode,x=e.minimumManifestUpdateInterval,I=e.networkConfig,Z=e.onCodecSwitch,R=e.startAt,M=e.transport,P=e.transportOptions,D=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var V,K="directfile"===M,G=new se.ZP,H=new v.y((function(e){G.signal.register((function(){e.next(),e.complete()}))})),W={url:D,currentContentCanceller:G,isDirectFile:K,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:f,initialTextTrack:y},X=this.videoElement,$=new sr(X,{withMediaSource:!K,lowLatencyMode:k});if(G.signal.register((function(){$.stop()})),K){if(this.stop(),this._priv_currentError=null,null===J.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=W,this._priv_mediaElementTrackChoiceManager=new J.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var Q=void 0===f?this._priv_preferredAudioTracks:[f];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(Q,!0);var te=void 0===y?this._priv_preferredTextTracks:[y];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(te,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return u.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return u.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return u.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return u.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return u.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return u.trigger("textTrackChange",e)}));var ne=J.Z.directfile.initDirectFile({autoPlay:l,keySystems:w,mediaElement:X,speed:this._priv_speed,playbackObserver:$,startAt:R,url:D}).pipe((0,o.R)(H));V=_(ne,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var re=J.Z.transports[M];if("function"!=typeof re)throw this.stop(),this._priv_currentError=null,new Error('transport "'+M+'" not supported');var ae,ue=re(P),le=I.offlineRetry,ce=I.segmentRetry,de=I.manifestRetry,fe=I.manifestRequestTimeout,ve=I.segmentRequestTimeout,pe=new Oe(D,ue,{lowLatencyMode:k,maxRetryRegular:de,maxRetryOffline:le,requestTimeout:fe});(ae=(ae=S instanceof ee.ZP?(0,p.of)({type:"parsed",manifest:S}):void 0!==S?pe.parse(S,{previousManifest:null,unsafeMode:!1}):pe.fetch(D).pipe((0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(H),(0,m.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_contentInfos=W;var he=q(),me={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(he?me.throttle={video:(0,oe.lR)(kr(G.signal),(function(e){return e?1/0:0}),G.signal)}:j.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(he?me.throttleBitrate={video:(0,oe.lR)(xr(this._priv_pictureInPictureRef,G.signal),(function(e){return e?1/0:0}),G.signal)}:j.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(he?me.limitWidth={video:Ir(X,this._priv_pictureInPictureRef,G.signal)}:j.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var ge={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:k,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:me},ye="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},_e=(0,ie.Z)({audioTrackSwitchingMode:c,enableFastSwitching:E,manualBitrateSwitchingMode:A,onCodecSwitch:Z},this._priv_bufferOptions),be=nr({adaptiveOptions:ge,autoPlay:l,bufferOptions:_e,playbackObserver:$,keySystems:w,lowLatencyMode:k,manifest$:ae,manifestFetcher:pe,mediaElement:X,minimumManifestUpdateInterval:x,segmentRequestOptions:{regularError:ce,requestTimeout:ve,offlineError:le},speed:this._priv_speed,startAt:R,transport:ue,textTrackOptions:ye}).pipe((0,o.R)(H));V=_(be,{connector:function(){return new i.x},resetOnDisconnect:!1})}var Te,Ee=V.pipe((0,b.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),d((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),Se=V.pipe((0,b.h)((function(e){return"loaded"===e.type})),(0,T.B)()),we=V.pipe((0,b.h)((function(e){return"reloading-media-source"===e.type})),(0,T.B)()),ke=$.getReference().asObservable(),Ae=ke.pipe((0,b.h)((function(e){return"seeking"===e.event||"ended"===e.event||"play"===e.event||"pause"===e.event}))),xe=C([Ee.pipe((0,N.O)(null)),Ae.pipe((0,N.O)(null))]).pipe((0,o.R)(H),(0,s.U)((function(e){var t=e[0];return function(e,t){var n=Y.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return"ENDED";if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?"ENDED":"seeking"===t?"SEEKING":"BUFFERING"}return e.paused?"PAUSED":"PLAYING"}(X,t)}))),Ie=(0,O.z)((0,p.of)("LOADING"),Se.pipe((0,L.w)((function(e,t){var n=0===t;return(0,B.T)(we.pipe((0,s.U)((function(){return"RELOADING"}))),n?(0,p.of)("LOADED"):U.E,xe.pipe((0,o.R)(we),F((function(e){return n&&"PAUSED"===e}))))})))).pipe(d());H.subscribe((function(){void 0!==Te&&Te.unsubscribe()}));var Ze=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":u._priv_reloadingMetadata.reloadInPause=!0,u._priv_reloadingMetadata.reloadPosition=$.getReference().getValue().position;break;default:var t=$.getReference().getValue();u._priv_reloadingMetadata.reloadInPause=t.paused,u._priv_reloadingMetadata.reloadPosition=t.position}};Ie.pipe((0,z.b)((function(e){Ze(e),u._priv_setPlayerState(e),"ENDED"===u.state&&u._priv_stopAtEnd&&G.cancel()})),(0,s.U)((function(e){return"RELOADING"!==e&&"STOPPED"!==e})),d(),(0,L.w)((function(e){return e?ke:U.E})),(0,o.R)(H)).subscribe((function(e){Ze(u.state),u._priv_triggerPositionUpdate(e)})),Se.pipe((0,L.w)((function(){return function(e,t){return(0,g.P)((function(){if(null===e)return U.E;var n=t.pipe((0,b.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,N.O)("seeking")));var r=n.pipe((0,L.w)((function(){return t.pipe((0,b.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,a.q)(1))})));return(0,B.T)(n,r)}))}(u.videoElement,ke)})),(0,o.R)(H)).subscribe((function(e){j.Z.info('API: Triggering "'+e+'" event'),u.trigger(e,null)})),V.subscribe({next:function(e){return u._priv_onPlaybackEvent(e)},error:function(e){return u._priv_onPlaybackError(e)},complete:function(){W.currentContentCanceller.isUsed||(j.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),W.currentContentCanceller.cancel(),u._priv_cleanUpCurrentContentState(),u._priv_setPlayerState("STOPPED"))}}),this._priv_contentLock.asObservable().pipe((0,b.h)((function(e){return!e})),(0,a.q)(1),(0,o.R)(H)).subscribe((function(){Te=V.connect()}))},u.getError=function(){return this._priv_currentError},u.getManifest=function(){return(0,ue.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},u.getCurrentAdaptations=function(){if((0,ue.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,re.Z)(n[t.id])?null:n[t.id]},u.getCurrentRepresentations=function(){return(0,ue.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},u.getVideoElement=function(){return this.videoElement},u.getNativeTextTrack=function(){if((0,ue.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},u.getPlayerState=function(){return this.state},u.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},u.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},u.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},u.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},u.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.L7)(e.buffered,e.currentTime)},u.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.at)(e.buffered,e.currentTime)},u.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.DD)(e.buffered,e.currentTime)},u.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){var r=K(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},u.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},u.getPlaybackRate=function(){return this._priv_speed.getValue()},u.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},u.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,re.Z)(r.video)?[]:r.video.getAvailableBitrates()},u.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,re.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},u.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},u.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},u.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,re.Z)(e.video))return e.video.bitrate},u.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,re.Z)(e.audio))return e.audio.bitrate},u.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},u.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},u.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},u.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},u.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,re.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new X.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},u.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},u.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,a=r.manifest;if(!i&&null===a)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var o=e,s=this.videoElement.currentTime;if((0,re.Z)(o.relative))if((0,re.Z)(o.position)){if((0,re.Z)(o.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==a)n=o.wallClockTime-(null!==(t=a.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var u=K(this.videoElement);void 0!==u&&(n=o.wallClockTime-u)}void 0===n&&(n=o.wallClockTime)}else n=o.position;else n=s+o.relative}if(void 0===n)throw new Error("invalid time given");return this.videoElement.currentTime=n,n},u.isFullscreen=function(){return(0,ue.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),H()},u.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,ue.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!H()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):G()},u.exitFullscreen=function(){(0,ue.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),G()},u.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},u.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},u.isMute=function(){return 0===this.getVolume()},u.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},u.unMute=function(){var e=Y.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},u.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},u.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},u.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},u.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},u.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},u.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},u.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},u.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},u.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},u.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},u.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},u.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},u.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},u.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},u.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return me(this.videoElement)},u.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},u.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},u.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},u.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},u.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},u.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},u.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},u.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},u.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},u.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},u.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},u.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},u.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},u.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},u.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},u.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},u.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},u.getImageTrackData=function(){return(0,ue.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},u.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumSafePosition():null},u.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},u.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},u._priv_cleanUpCurrentContentState=function(){var e,t=this;j.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){null!==t.videoElement&&(j.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1))};(0,re.Z)(this.videoElement)?n():ge(this.videoElement).then((function(){j.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){j.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},u._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void j.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void j.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,re.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},u._priv_onPlaybackError=function(e){var t=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,j.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),this._priv_setPlayerState("STOPPED"),this._priv_currentError===t&&this.trigger("error",t)},u._priv_onPlaybackWarning=function(e){var t=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});j.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},u._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_reloadingMetadata.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new pr({preferTrickModeTracks:this._priv_preferTrickModeTracks});var o=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(o,!0);var s=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(s,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),n.addEventListener("manifestUpdate",(function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}),r.currentContentCanceller.signal)}else j.Z.error("API: The manifest is loaded but no content is.")},u._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else j.Z.error("API: The active period changed but no content is loaded")},u._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,re.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},u._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,re.Z)(i)&&!(0,re.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,re.Z)(a)&&!(0,re.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},u._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},u._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,re.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,re.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var v=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",v)}}else j.Z.error("API: The adaptations changed but no content is loaded")},u._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,re.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,re.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else j.Z.error("API: The representations changed but no content is loaded")},u._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},u._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},u._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,j.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},u._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,re.Z)(e)){var a=null!==i?i.getMaximumSafePosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:void 0!==e.bufferGap&&isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s;var u=i.getLivePosition();void 0!==u&&(o.liveGap=u-e.position)}else if(r&&null!==this.videoElement){var l=K(this.videoElement);void 0!==l&&(o.wallClockTime=l+e.position)}this.trigger("positionUpdate",o)}}else j.Z.warn("API: Cannot perform time update: no content loaded.")},u._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,te.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},u._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},u._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,re.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return Q.ZB}},{key:"ErrorCodes",get:function(){return Q.SM}},{key:"LogLevel",get:function(){return j.Z.getLevel()},set:function(e){j.Z.setLevel(e)}}]),r}(ne.Z);Mr.version="3.29.0-dev.2022110200";var Cr=Mr,Pr=n(7273);!function(){Pr.Z.ContentDecryptor=n(1266).ZP,Pr.Z.imageBuffer=n(7127).Z,Pr.Z.imageParser=n(3203).Z,Pr.Z.transports.smooth=n(2339).Z,Pr.Z.transports.dash=n(85).Z,Pr.Z.dashParsers.js=n(4541).Z,Pr.Z.nativeTextTracksBuffer=n(9059).Z,Pr.Z.nativeTextTracksParsers.vtt=n(9405).Z,Pr.Z.nativeTextTracksParsers.ttml=n(1570).Z,Pr.Z.nativeTextTracksParsers.sami=n(1812).Z,Pr.Z.nativeTextTracksParsers.srt=n(8057).Z,Pr.Z.htmlTextTracksBuffer=n(5192).Z,Pr.Z.htmlTextTracksParsers.sami=n(5734).Z,Pr.Z.htmlTextTracksParsers.ttml=n(7439).Z,Pr.Z.htmlTextTracksParsers.srt=n(8675).Z,Pr.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(6796).Z;Pr.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&j.Z.setLevel("DEBUG");var Dr=Cr}(),r=r.default}()}));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RxPlayer=t():e.RxPlayer=t()}(self,(function(){return function(){var e={3774:function(e,t,n){"use strict";n.d(t,{J:function(){return a},c:function(){return o}});var r=n(1946),i=n(2203).Z?void 0:window,a=void 0===i?void 0:(0,r.Z)(i.MediaSource)?(0,r.Z)(i.MozMediaSource)?(0,r.Z)(i.WebKitMediaSource)?i.MSMediaSource:i.WebKitMediaSource:i.MozMediaSource:i.MediaSource,o={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}},3666:function(e,t,n){"use strict";n.d(t,{SB:function(){return m},YM:function(){return s},fq:function(){return o},gM:function(){return v},kD:function(){return u},op:function(){return c},uz:function(){return p},vS:function(){return h},vU:function(){return l},yS:function(){return d}});var r,i,a=n(2203),o=!a.Z&&void 0!==window.MSInputMethodContext&&void 0!==document.documentMode,s=!a.Z&&("Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)),u=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("edg/"),l=!a.Z&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),c=!a.Z&&/SamsungBrowser/.test(navigator.userAgent),d=!a.Z&&/Tizen/.test(navigator.userAgent),f=!a.Z&&navigator.userAgent.indexOf("Web0S")>=0,v=f&&(/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent)||/[Cc]hr[o0]me\/79/.test(navigator.userAgent)),p=f&&(/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent)||/[Cc]hr[o0]me\/87/.test(navigator.userAgent)),h=!a.Z&&(Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>=0||"[object SafariRemoteNotification]"===(null===(i=null===(r=window.safari)||void 0===r?void 0:r.pushNotification)||void 0===i?void 0:i.toString())),m=!a.Z&&"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)},5767:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e){var t=e.textTracks;if(!(0,i.Z)(t)){for(var n=0;n<t.length;n++)t[n].mode="disabled";if(e.hasChildNodes())for(var a=e.childNodes,o=a.length-1;o>=0;o--)if("track"===a[o].nodeName)try{e.removeChild(a[o])}catch(e){r.Z.warn("Compat: Could not remove text track child from element.")}}e.src="",e.removeAttribute("src")}},6139:function(e,t,n){"use strict";n.d(t,{N:function(){return P},Y:function(){return D}});var r,i=n(3714),a=n(811),o=n(3666),s=n(2203),u=n(5059),l=n(3144),c=function(){function e(e,t,n){this._keyType=e,this._mediaKeys=t,this._configuration=n}var t=e.prototype;return t.createMediaKeys=function(){var e=this;return new Promise((function(t){return t(e._mediaKeys)}))},t.getConfiguration=function(){return this._configuration},(0,l.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}();if(!s.Z){var d=window.MSMediaKeys;void 0!==d&&void 0!==d.prototype&&"function"==typeof d.isTypeSupported&&"function"==typeof d.prototype.createSession&&(r=d)}var f,v=n(4578),p=n(6716),h=n(3071),m=n(3505),g=n(1959),y=n(1381),_=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._closeSession$=new p.x,n.closed=new Promise((function(e){n._closeSession$.subscribe(e)})),n.update=function(e){return new Promise((function(t,r){if(void 0===n._ss)return r("MediaKeySession not set.");try{t(n._ss.update(e,""))}catch(e){r(e)}}))},n}(0,v.Z)(t,e);var n=t.prototype;return n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r=t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer);n._ss=n._mk.createSession("video/mp4",r),(0,h.T)(y.GJ(n._ss),y.GV(n._ss),y.Xe(n._ss)).pipe((0,m.R)(n._closeSession$)).subscribe((function(e){return n.trigger(e.type,e)})),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._closeSession$.next(),e._closeSession$.complete(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._ss)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(g.Z),b=function(){function e(e){if(void 0===r)throw new Error("No MSMediaKeys API.");this._mediaKeys=new r(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0!==this._videoElement.msSetMediaKeys)return this._videoElement.msSetMediaKeys(this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new _(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!s.Z){var T=window.MozMediaKeys;void 0!==T&&void 0!==T.prototype&&"function"==typeof T.isTypeSupported&&"function"==typeof T.prototype.createSession&&(f=T)}var E=n(9689),S=n(8894),w=n(3635);function k(e){return"function"==typeof e.webkitGenerateKeyRequest}var A=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=S.Z,r.keyStatuses=new Map,r.expiration=NaN;var i=function(e){r.trigger(e.type,e)};return r.closed=new Promise((function(e){r._closeSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.removeEventListener(e,i),t.removeEventListener("webkit"+e,i)})),e()}})),["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(e){t.addEventListener(e,i),t.addEventListener("webkit"+e,i)})),r}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){try{if(t._key.indexOf("clearkey")>=0){var i=e instanceof ArrayBuffer?new Uint8Array(e):e,a=JSON.parse((0,w.uR)(i)),o=(0,E.K)(a.keys[0].k),s=(0,E.K)(a.keys[0].kid);n(t._vid.webkitAddKey(t._key,o,s,""))}else n(t._vid.webkitAddKey(t._key,e,null,""))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){n._vid.webkitGenerateKeyRequest(n._key,t),e()}))},n.close=function(){var e=this;return new Promise((function(t){e._closeSession(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},t}(g.Z),x=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){if(!k(e))throw new Error("Video not attached to the MediaKeys");this._videoElement=e},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new A(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var I=n(6968);var Z=n(158);function R(e,t){var n=e;if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");return n.webkitSetMediaKeys(t)}var M=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._serverCertificate=r,i._videoElement=t,i._keyType=n,i._unbindSession=S.Z,i._closeSession=S.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,v.Z)(t,e);var n=t.prototype;return n.update=function(e){var t=this;return new Promise((function(n,r){if(void 0===t._nativeSession||void 0===t._nativeSession.update||"function"!=typeof t._nativeSession.update)return r("Unavailable WebKit key session.");try{var i;i=e instanceof ArrayBuffer?new Uint8Array(e):e instanceof Uint8Array?e:new Uint8Array(e.buffer),n(t._nativeSession.update(i))}catch(e){r(e)}}))},n.generateRequest=function(e,t){var n=this;return new Promise((function(e){var r,i,a,o=n._videoElement;if(void 0===(null===(r=o.webkitKeys)||void 0===r?void 0:r.createSession))throw new Error("No WebKitMediaKeys API.");if("com.apple.fps.1_0"===(a=n._keyType)||"com.apple.fps.2_0"===a){if(void 0===n._serverCertificate)throw new Error("A server certificate is needed for creating fairplay session.");i=function(e,t){var n=e instanceof Uint8Array?e:new Uint8Array(e),r=t instanceof Uint8Array?t:new Uint8Array(t);if((0,I.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,w.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,w.TZ)(o),u=0,l=new Uint8Array(n.byteLength+4+s.byteLength+4+r.byteLength);return l.set(n),u+=n.length,l.set((0,I.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,I.O_)(r.byteLength),u),u+=4,l.set(r,u),l}(t,n._serverCertificate)}else i=t;var s=o.webkitKeys.createSession("video/mp4",i);if(null==s)throw new Error("Impossible to get the key sessions");n._listenEvent(s),n._nativeSession=s,e()}))},n.close=function(){var e=this;return new Promise((function(t,n){e._unbindSession(),e._closeSession(),void 0!==e._nativeSession?(e._nativeSession.close(),t()):n("No session to close.")}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},n._listenEvent=function(e){var t=this;this._unbindSession();var n=function(e){t.trigger(e.type,e)};["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.addEventListener(t,n),e.addEventListener("webkit"+t,n)})),this._unbindSession=function(){["keymessage","message","keyadded","ready","keyerror","error"].forEach((function(t){e.removeEventListener(t,n),e.removeEventListener("webkit"+t,n)}))}},(0,l.Z)(t,[{key:"sessionId",get:function(){var e,t;return null!==(t=null===(e=this._nativeSession)||void 0===e?void 0:e.sessionId)&&void 0!==t?t:""}}]),t}(g.Z),C=function(){function e(e){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new Z.t(e)}var t=e.prototype;return t._setVideo=function(e){if(this._videoElement=e,void 0===this._videoElement)throw new Error("Video not attached to the MediaKeys");return R(this._videoElement,this._mediaKeys)},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new M(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();var P=null,D=function(e,t){var n=e;return"function"==typeof n.setMediaKeys?n.setMediaKeys(t):"function"==typeof n.webkitSetMediaKeys?n.webkitSetMediaKeys(t):"function"==typeof n.mozSetMediaKeys?n.mozSetMediaKeys(t):"function"==typeof n.msSetMediaKeys&&null!==t?n.msSetMediaKeys(t):void 0};if(s.Z||null!=navigator.requestMediaKeySystemAccess&&!(0,u.Z)())P=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)};else{var N,O;if(k(HTMLVideoElement.prototype)){var L={isTypeSupported:function(e){var t=document.querySelector("video");return null==t&&(t=document.createElement("video")),null!=t&&"function"==typeof t.canPlayType&&!!t.canPlayType("video/mp4",e)},createCustomMediaKeys:function(e){return new x(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof x))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}}};N=L.isTypeSupported,O=L.createCustomMediaKeys,D=L.setMediaKeys}else if(void 0!==Z.t){var B=function(){if(void 0===Z.t)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:Z.t.isTypeSupported,createCustomMediaKeys:function(e){return new C(e)},setMediaKeys:function(e,t){if(null===t)return R(e,t);if(!(t instanceof C))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}();N=B.isTypeSupported,O=B.createCustomMediaKeys,D=B.setMediaKeys}else if(o.fq&&void 0!==r){var U={isTypeSupported:function(e,t){if(void 0===r)throw new Error("No MSMediaKeys API.");return void 0!==t?r.isTypeSupported(e,t):r.isTypeSupported(e)},createCustomMediaKeys:function(e){return new b(e)},setMediaKeys:function(e,t){if(null!==t){if(!(t instanceof b))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}}};N=U.isTypeSupported,O=U.createCustomMediaKeys,D=U.setMediaKeys}else if(void 0!==f){var F={isTypeSupported:function(e,t){if(void 0===f)throw new Error("No MozMediaKeys API.");return void 0!==t?f.isTypeSupported(e,t):f.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===f)throw new Error("No MozMediaKeys API.");return new f(e)},setMediaKeys:function(e,t){var n=e;if(void 0===n.mozSetMediaKeys||"function"!=typeof n.mozSetMediaKeys)throw new Error("Can't set video on MozMediaKeys.");return n.mozSetMediaKeys(t)}};N=F.isTypeSupported,O=F.createCustomMediaKeys,D=F.setMediaKeys}else{var z=window.MediaKeys,V=function(){if(void 0===z)throw new i.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===z.isTypeSupported){throw new Error("This browser seems to be unable to play encrypted contents currently. Note: Some browsers do not allow decryption in some situations, like when not using HTTPS.")}};N=function(e){return V(),(0,a.Z)("function"==typeof z.isTypeSupported),z.isTypeSupported(e)},O=function(e){return V(),new z(e)}}P=function(e,t){if(!N(e))return Promise.reject(new Error("Unsupported key type"));for(var n=0;n<t.length;n++){var r=t[n],i=r.videoCapabilities,a=r.audioCapabilities,o=r.initDataTypes,s=r.distinctiveIdentifier,u=!0;if(u=(u=u&&(null==o||o.some((function(e){return"cenc"===e}))))&&"required"!==s){var l={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(l.videoCapabilities=i),void 0!==a&&(l.audioCapabilities=a);var d=O(e);return Promise.resolve(new c(e,d,l))}}return Promise.reject(new Error("Unsupported configuration"))}}},158:function(e,t,n){"use strict";var r;if(n.d(t,{t:function(){return r}}),!n(2203).Z){var i=window.WebKitMediaKeys;void 0!==i&&"function"==typeof i.isTypeSupported&&"function"==typeof i.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=i)}},1381:function(e,t,n){"use strict";n.d(t,{XR:function(){return E},w0:function(){return w},it:function(){return k},O0:function(){return A},Oh:function(){return N},M4:function(){return V},Q1:function(){return I},GV:function(){return L},Xe:function(){return B},GJ:function(){return O},eX:function(){return U},K4:function(){return x},gg:function(){return D},bQ:function(){return z},Q$:function(){return F},UG:function(){return M},ep:function(){return C},ym:function(){return R},UA:function(){return Z},_E:function(){return P}});var r=n(2401),i=n(1480),a=n(2967),o=new i.y(a.Z);var s=n(3071),u=n(6872),l=n(6923),c=n(1946),d=n(8894),f=n(5095),v=n(2203),p=n(5059),h=["","webkit","moz","ms"],m=v.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function g(e,t){return t.filter((function(t){return function(e,t){var n=document.createElement(e.tagName),r="on"+t;return r in n||(n.setAttribute(r,"return;"),"function"==typeof n[r])}(e,t)}))[0]}function y(e,t){return e.reduce((function(e,n){return e.concat((null==t?h:t).map((function(e){return e+n})))}),[])}function _(e){var t,n=y(e);return function(e,r,i){if(!i.isCancelled){if(e instanceof HTMLElement){if(void 0===t&&(t=g(e,n)),!(0,l.Z)(t))return void 0;e.addEventListener(t,r),i.register((function(){void 0!==t&&e.removeEventListener(t,r)}))}n.forEach((function(t){e.addEventListener(t,r),i.register((function(){e.removeEventListener(t,r)}))}))}}}function b(e,t){var n,i=y(e,t);return function(e){return e instanceof HTMLElement?(void 0===n&&(n=g(e,i)),(0,l.Z)(n)?(0,r.R)(e,n):o):s.T.apply(void 0,i.map((function(t){return(0,r.R)(e,t)})))}}function T(e){var t,n=document;null!=n.hidden?t="":null!=n.mozHidden?t="moz":null!=n.msHidden?t="ms":null!=n.webkitHidden&&(t="webkit");var r=(0,l.Z)(t)?t+"Hidden":"hidden",i=(0,l.Z)(t)?t+"visibilitychange":"visibilitychange",a=document[r],o=(0,f.ZP)(!a);return K(document,i,(function(){var e=!document[r];o.setValueIfChanged(e)}),e),e.register((function(){o.finish()})),o}function E(e){var t,n=T(e),r=(0,f.ZP)(!0);return e.register((function(){clearTimeout(t),t=void 0,r.finish()})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=u.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){r.setValueIfChanged(!1)}),n)}r.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),r}function S(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function w(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=(0,f.ZP)({isEnabled:r,pipWindow:null});return K(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),t.register((function(){i.finish()})),i}var a=document.pictureInPictureElement===n,o=(0,f.ZP)({isEnabled:a,pipWindow:null});return K(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),K(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),t.register((function(){o.finish()})),o}function k(e,t){var n,r=T(t),i=(0,f.ZP)(!0);return t.register((function(){clearTimeout(n),n=void 0,i.finish()})),r.onUpdate(a,{clearSignal:t}),e.onUpdate(a,{clearSignal:t}),a(),i;function a(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||r.getValue())i.setValueIfChanged(!0);else{var t=u.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){i.setValueIfChanged(!1)}),t)}}}function A(e,t,n){var r=(0,f.ZP)(e.clientWidth*m),i=d.Z;t.onUpdate(o,{clearSignal:n}),K(window,"resize",o,n);var a=window.setInterval(o,2e4);return o(),n.register((function(){i(),clearInterval(a),r.finish()})),r;function o(){i();var n=t.getValue();if(n.isEnabled)if((0,c.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var a=n.pipWindow,o=S(e,a),s=function(){r.setValueIfChanged(S(e,a)*m)};a.addEventListener("resize",s),i=function(){a.removeEventListener("resize",s),i=d.Z},r.setValueIfChanged(o*m)}else r.setValueIfChanged(e.clientWidth*m)}}var x=b(["loadedmetadata"]),I=(b(["seeking"]),b(["seeked"]),b(["ended"]),b(["timeupdate"]),b(["fullscreenchange","FullscreenChange"],h.concat("MS"))),Z=function(e){return(0,s.T)(b(["addtrack"])(e),b(["removetrack"])(e))},R=b(["sourceopen","webkitsourceopen"]),M=b(["sourceclose","webkitsourceclose"]),C=b(["sourceended","webkitsourceended"]),P=b(["update"]),D=b(["onremovesourcebuffer"]),N=b((0,p.Z)()?["needkey"]:["encrypted","needkey"]),O=b(["keymessage","message"]),L=b(["keyadded","ready"]),B=b(["keyerror","error"]),U=b(["keystatuseschange"]),F=_(["seeking"]),z=_(["seeked"]),V=_(["ended"]);function K(e,t,n,r){e.addEventListener(t,n),r.register((function(){e.removeEventListener(t,n)}))}},2203:function(e,t){"use strict";var n="undefined"==typeof window;t.Z=n},1988:function(e,t,n){"use strict";function r(e){return"function"==typeof window.VTTCue&&e instanceof window.VTTCue}n.d(t,{Z:function(){return r}})},7253:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946);function a(e,t,n){if(e>=t)return r.Z.warn("Compat: Invalid cue times: "+e+" - "+t),null;if((0,i.Z)(window.VTTCue)){if((0,i.Z)(window.TextTrackCue))throw new Error("VTT cues not supported in your target");return new TextTrackCue(e,t,n)}return new VTTCue(e,t,n)}},5059:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3666),i=n(158);function a(){return(r.vS||r.SB)&&void 0!==i.t}},1669:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3666);function i(){return r.op}},6872:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r={DEFAULT_UNMUTED_VOLUME:.1,DEFAULT_REQUEST_TIMEOUT:3e4,DEFAULT_TEXT_TRACK_MODE:"native",DEFAULT_MANUAL_BITRATE_SWITCHING_MODE:"seamless",DEFAULT_ENABLE_FAST_SWITCHING:!0,DEFAULT_AUDIO_TRACK_SWITCHING_MODE:"seamless",DELTA_POSITION_AFTER_RELOAD:{bitrateSwitch:-.1,trackSwitch:{audio:-.7,video:-.1,other:0}},DEFAULT_CODEC_SWITCHING_BEHAVIOR:"continue",DEFAULT_AUTO_PLAY:!1,DEFAULT_SHOW_NATIVE_SUBTITLE:!0,DEFAULT_STOP_AT_END:!0,DEFAULT_WANTED_BUFFER_AHEAD:30,DEFAULT_MAX_BUFFER_AHEAD:1/0,DEFAULT_MAX_BUFFER_BEHIND:1/0,DEFAULT_MAX_VIDEO_BUFFER_SIZE:1/0,MAXIMUM_MAX_BUFFER_AHEAD:{text:18e3},MAXIMUM_MAX_BUFFER_BEHIND:{text:18e3},DEFAULT_INITIAL_BITRATES:{audio:0,video:0,other:0},DEFAULT_MIN_BITRATES:{audio:0,video:0,other:0},DEFAULT_MAX_BITRATES:{audio:1/0,video:1/0,other:1/0},INACTIVITY_DELAY:6e4,DEFAULT_THROTTLE_WHEN_HIDDEN:!1,DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN:!1,DEFAULT_LIMIT_VIDEO_WIDTH:!1,DEFAULT_LIVE_GAP:{DEFAULT:10,LOW_LATENCY:3.5},BUFFER_DISCONTINUITY_THRESHOLD:.2,FORCE_DISCONTINUITY_SEEK_DELAY:5e3,BITRATE_REBUFFERING_RATIO:1.5,BUFFER_GC_GAPS:{CALM:240,BEEFY:30},DEFAULT_MAX_MANIFEST_REQUEST_RETRY:4,DEFAULT_CDN_DOWNGRADE_TIME:60,DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR:4,DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE:1/0,INITIAL_BACKOFF_DELAY_BASE:{REGULAR:200,LOW_LATENCY:50},MAX_BACKOFF_DELAY_BASE:{REGULAR:3e3,LOW_LATENCY:1e3},SAMPLING_INTERVAL_MEDIASOURCE:1e3,SAMPLING_INTERVAL_LOW_LATENCY:250,SAMPLING_INTERVAL_NO_MEDIASOURCE:500,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.8,LOW_LATENCY:.8},ABR_STARVATION_GAP:{DEFAULT:5,LOW_LATENCY:5},OUT_OF_STARVATION_GAP:{DEFAULT:7,LOW_LATENCY:7},ABR_STARVATION_DURATION_DELTA:.1,ABR_FAST_EMA:2,ABR_SLOW_EMA:10,RESUME_GAP_AFTER_SEEKING:{DEFAULT:1.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_NOT_ENOUGH_DATA:{DEFAULT:.5,LOW_LATENCY:.5},RESUME_GAP_AFTER_BUFFERING:{DEFAULT:5,LOW_LATENCY:.5},REBUFFERING_GAP:{DEFAULT:.5,LOW_LATENCY:.2},MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING:2,UNFREEZING_SEEK_DELAY:6e3,FREEZING_STALLED_DELAY:600,UNFREEZING_DELTA_POSITION:.001,MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT:.15,MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE:.4,MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE:.3,MINIMUM_SEGMENT_SIZE:.005,APPEND_WINDOW_SECURITIES:{START:.2,END:.1},MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL:50,TEXT_TRACK_SIZE_CHECKS_INTERVAL:250,BUFFER_PADDING:{audio:1,video:3,other:1},SEGMENT_PRIORITIES_STEPS:[2,4,8,12,18,25],MAX_HIGH_PRIORITY_LEVEL:1,MIN_CANCELABLE_PRIORITY:3,EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.chromecast.playready","com.youtube.playready"],fairplay:["com.apple.fps.1_0"]},MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE:10,MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE:200,MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY:300,OUT_OF_SYNC_MANIFEST_REFRESH_DELAY:3e3,FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY:3e3,DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:3,EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS:15,EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION:1e3,EME_WAITING_DELAY_LOADED_SESSION_EMPTY_KEYSTATUSES:100,FORCED_ENDED_THRESHOLD:8e-4,ADAPTATION_SWITCH_BUFFER_PADDINGS:{video:{before:5,after:5},audio:{before:2,after:2.5},text:{before:0,after:0},image:{before:0,after:0}},SOURCE_BUFFER_FLUSHING_INTERVAL:500,CONTENT_REPLACEMENT_PADDING:1.2,CACHE_LOAD_DURATION_THRESHOLDS:{video:50,audio:10},STREAM_EVENT_EMITTER_POLL_INTERVAL:250,DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR:.001,BUFFERED_HISTORY_RETENTION_TIME:6e4,BUFFERED_HISTORY_MAXIMUM_ENTRIES:200,MIN_BUFFER_AHEAD:5,UPTO_CURRENT_POSITION_CLEANUP:5},i=n(8026);function a(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function o(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(0===n.length)return e;var s=n.shift();if(a(e)&&a(s))for(var u in s)if(a(s[u])){var l=e[u];void 0===l&&(l={},e[u]=l),o(l,s[u])}else{var c;(0,i.Z)(e,((c={})[u]=s[u],c))}return o.apply(void 0,[e].concat(n))}var s=function(){function e(){this._config=r}var t=e.prototype;return t.update=function(e){var t=o(this._config,e);this._config=t},t.getCurrent=function(){return this._config},e}(),u=new s},6796:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4578),i=n(3666);var a=n(1959),o=n(7829);function s(e,t){var n;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r].nativeTrack!==(null===(n=e[r])||void 0===n?void 0:n.nativeTrack))return!0;return!1}function u(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_audio_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:c,nativeTrack:a})}return n}function l(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],s=""===a.language?"nolang":a.language,u=null!==(t=r[s])&&void 0!==t?t:1,l="gen_text_"+s+"_"+u.toString();r[s]=u+1;var c={language:a.language,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function c(e){for(var t,n=[],r={},i=0;i<e.length;i++){var a=e[i],o=""===a.language?"nolang":a.language,s=null!==(t=r[o])&&void 0!==t?t:1,u="gen_video_"+o+"_"+s.toString();r[o]=s+1,n.push({track:{id:u,representations:[]},nativeTrack:a})}return n}var d=function(e){function t(t){var n,r,i,a;return(n=e.call(this)||this)._preferredAudioTracks=[],n._preferredTextTracks=[],n._preferredVideoTracks=[],n._nativeAudioTracks=t.audioTracks,n._nativeVideoTracks=t.videoTracks,n._nativeTextTracks=t.textTracks,n._audioTracks=void 0!==n._nativeAudioTracks?u(n._nativeAudioTracks):[],n._videoTracks=void 0!==n._nativeVideoTracks?c(n._nativeVideoTracks):[],n._textTracks=void 0!==n._nativeTextTracks?l(n._nativeTextTracks):[],n._lastEmittedNativeAudioTrack=null===(r=n._getPrivateChosenAudioTrack())||void 0===r?void 0:r.nativeTrack,n._lastEmittedNativeVideoTrack=null===(i=n._getPrivateChosenVideoTrack())||void 0===i?void 0:i.nativeTrack,n._lastEmittedNativeTextTrack=null===(a=n._getPrivateChosenTextTrack())||void 0===a?void 0:a.nativeTrack,n._handleNativeTracksCallbacks(),n}(0,r.Z)(t,e);var n=t.prototype;return n.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},n.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},n.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},n.setAudioTrackById=function(e){for(var t=0;t<this._audioTracks.length;t++){var n=this._audioTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return this._enableAudioTrackFromIndex(t),void(this._audioTrackLockedOn=i)}throw new Error("Audio track not found.")},n.disableTextTrack=function(){f(this._textTracks),this._textTrackLockedOn=null},n.setTextTrackById=function(e){for(var t=!1,n=0;n<this._textTracks.length;n++){var r=this._textTracks[n],i=r.track,a=r.nativeTrack;i.id===e?(a.mode="showing",t=!0,this._textTrackLockedOn=a):"showing"!==a.mode&&"hidden"!==a.mode||(a.mode="disabled")}if(!t)throw new Error("Text track not found.")},n.disableVideoTrack=function(){p(this._videoTracks),this._videoTrackLockedOn=null},n.setVideoTrackById=function(e){for(var t=0;t<this._videoTracks.length;t++){var n=this._videoTracks[t],r=n.track,i=n.nativeTrack;if(r.id===e)return i.selected=!0,void(this._videoTrackLockedOn=i)}throw new Error("Video track not found.")},n.getChosenAudioTrack=function(){var e=this._getPrivateChosenAudioTrack();return null!=e?e.track:e},n.getChosenTextTrack=function(){var e=this._getPrivateChosenTextTrack();return null!=e?e.track:e},n.getChosenVideoTrack=function(){var e=this._getPrivateChosenVideoTrack();return null!=e?e.track:e},n.getAvailableAudioTracks=function(){return this._audioTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,audioDescription:t.audioDescription,active:n.enabled,representations:t.representations}}))},n.getAvailableTextTracks=function(){return this._textTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,language:t.language,normalized:t.normalized,closedCaption:t.closedCaption,active:"showing"===n.mode}}))},n.getAvailableVideoTracks=function(){return this._videoTracks.map((function(e){var t=e.track,n=e.nativeTrack;return{id:t.id,representations:t.representations,active:n.selected}}))},n.dispose=function(){void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onchange=null,this._nativeVideoTracks.onaddtrack=null,this._nativeVideoTracks.onremovetrack=null),void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onchange=null,this._nativeAudioTracks.onaddtrack=null,this._nativeAudioTracks.onremovetrack=null),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onchange=null,this._nativeTextTracks.onaddtrack=null,this._nativeTextTracks.onremovetrack=null),this.removeEventListener()},n._getPrivateChosenAudioTrack=function(){if(void 0!==this._nativeAudioTracks){for(var e=0;e<this._audioTracks.length;e++){var t=this._audioTracks[e];if(t.nativeTrack.enabled)return t}return null}},n._getPrivateChosenVideoTrack=function(){if(void 0!==this._nativeVideoTracks){for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e];if(t.nativeTrack.selected)return t}return null}},n._getPrivateChosenTextTrack=function(){if(void 0!==this._nativeTextTracks){for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e];if("showing"===t.nativeTrack.mode)return t}return null}},n._setOptimalAudioTrack=function(){if(void 0!==this._audioTrackLockedOn)for(var e=0;e<this._audioTracks.length;e++){if(this._audioTracks[e].nativeTrack===this._audioTrackLockedOn)return void this._enableAudioTrackFromIndex(e)}this._applyAudioPreferences()},n._applyAudioPreferences=function(){this._audioTrackLockedOn=void 0;for(var e=this._preferredAudioTracks,t=0;t<e.length;t++){var n=e[t];if(null!==n&&void 0!==n.language)for(var r=(0,o.ZP)(n.language),i=0;i<this._audioTracks.length;i++){var a=this._audioTracks[i];if(a.track.normalized===r&&a.track.audioDescription===n.audioDescription)return void this._enableAudioTrackFromIndex(i)}}},n._setOptimalTextTrack=function(){if(null!==this._textTrackLockedOn){if(void 0!==this._textTrackLockedOn)for(var e=0;e<this._textTracks.length;e++){var t=this._textTracks[e].nativeTrack;if(t===this._textTrackLockedOn)return v(this._textTracks,t),void("showing"!==t.mode&&(t.mode="showing"))}this._applyTextPreferences()}else f(this._textTracks)},n._applyTextPreferences=function(){this._textTrackLockedOn=void 0;for(var e=this._preferredTextTracks,t=0;t<e.length;t++){var n=e[t];if(null===n)return void f(this._textTracks);for(var r=(0,o.ZP)(n.language),i=0;i<this._textTracks.length;i++){var a=this._textTracks[i];if(a.track.normalized===r&&a.track.closedCaption===n.closedCaption)return v(this._textTracks,a.nativeTrack),void("showing"!==a.nativeTrack.mode&&(a.nativeTrack.mode="showing"))}}f(this._textTracks)},n._setOptimalVideoTrack=function(){if(null!==this._videoTrackLockedOn){if(void 0!==this._videoTrackLockedOn)for(var e=0;e<this._videoTracks.length;e++){var t=this._videoTracks[e].nativeTrack;if(t===this._videoTrackLockedOn)return void(t.selected=!0)}this._applyVideoPreferences()}else p(this._videoTracks)},n._applyVideoPreferences=function(){this._videoTrackLockedOn=void 0,this._preferredVideoTracks.some((function(e){return null===e}))&&p(this._videoTracks)},n._handleNativeTracksCallbacks=function(){var e=this;void 0!==this._nativeAudioTracks&&(this._nativeAudioTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=u(e._nativeAudioTracks);if(s(e._audioTracks,r)){e._audioTracks=r,e._setOptimalAudioTrack(),e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeAudioTracks){var r=u(e._nativeAudioTracks);if(s(e._audioTracks,r)){e._audioTracks=r,e.trigger("availableAudioTracksChange",e.getAvailableAudioTracks());var i=e._getPrivateChosenAudioTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeAudioTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeAudioTracks.onchange=function(){if(void 0!==e._audioTracks)for(var t=0;t<e._audioTracks.length;t++){var n=e._audioTracks[t],r=n.track,i=n.nativeTrack;if(i.enabled)return void(i!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",r),e._lastEmittedNativeAudioTrack=i))}null!==e._lastEmittedNativeAudioTrack&&(e.trigger("audioTrackChange",null),e._lastEmittedNativeAudioTrack=null)}),void 0!==this._nativeTextTracks&&(this._nativeTextTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=l(e._nativeTextTracks);if(s(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeTextTracks){var r=l(e._nativeTextTracks);if(s(e._textTracks,r)){e._textTracks=r,e._setOptimalTextTrack(),e.trigger("availableTextTracksChange",e.getAvailableTextTracks());var i=e._getPrivateChosenTextTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeTextTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeTextTracks.onchange=function(){if(void 0!==e._textTracks)for(var t=0;t<e._textTracks.length;t++){var n=e._textTracks[t],r=n.track,i=n.nativeTrack;if("showing"===i.mode)return void(i!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",r),e._lastEmittedNativeTextTrack=i))}null!==e._lastEmittedNativeTextTrack&&(e.trigger("textTrackChange",null),e._lastEmittedNativeTextTrack=null)}),void 0!==this._nativeVideoTracks&&(this._nativeVideoTracks.onaddtrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=c(e._nativeVideoTracks);if(s(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onremovetrack=function(){var t,n;if(void 0!==e._nativeVideoTracks){var r=c(e._nativeVideoTracks);if(s(e._videoTracks,r)){e._videoTracks=r,e._setOptimalVideoTrack(),e.trigger("availableVideoTracksChange",e.getAvailableVideoTracks());var i=e._getPrivateChosenVideoTrack();(null==i?void 0:i.nativeTrack)!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null!==(t=null==i?void 0:i.track)&&void 0!==t?t:null),e._lastEmittedNativeVideoTrack=null!==(n=null==i?void 0:i.nativeTrack)&&void 0!==n?n:null)}}},this._nativeVideoTracks.onchange=function(){if(void 0!==e._videoTracks)for(var t=0;t<e._videoTracks.length;t++){var n=e._videoTracks[t],r=n.track,i=n.nativeTrack;if(i.selected)return void(i!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",r),e._lastEmittedNativeVideoTrack=i))}null!==e._lastEmittedNativeVideoTrack&&(e.trigger("videoTrackChange",null),e._lastEmittedNativeVideoTrack=null)})},n._enableAudioTrackFromIndex=function(e){!function(e,t){for(var n=0;n<e.length;n++)i.yS&&n===t||(e[n].enabled=!1);t<0||t>=e.length||(e[t].enabled=!0)}(this._audioTracks.map((function(e){return e.nativeTrack})),e)},t}(a.Z);function f(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.mode="disabled"}}function v(e,t){for(var n=0;n<e.length;n++){var r=e[n].nativeTrack;r===t||"showing"!==r.mode&&"hidden"!==r.mode||(r.mode="disabled")}}function p(e){for(var t=0;t<e.length;t++){e[t].nativeTrack.selected=!1}}},7425:function(e,t,n){"use strict";n.d(t,{u:function(){return At},Z:function(){return It}});var r=n(5861),i=n(4578),a=n(4687),o=n.n(a),s=n(1381),u=n(3887),l=n(6490),c=n(4791),d=n(6968),f=n(3635),v=(0,d.pX)((0,f.tG)("pssh"),0);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n];if((void 0===t.systemId||void 0===r.systemId||t.systemId===r.systemId)&&(0,c.Z)(t.data,r.data))return!0}return!1}function h(e){var t=e.initData,n=e.initDataType;if(null==t)return u.Z.warn("Compat: No init data found on media encrypted event."),null;var r=function(e){for(var t=[],n=0;n<e.length;){if(e.length<n+8||(0,d.pX)(e,n+4)!==v)return u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,d.pX)(new Uint8Array(e),n);if(n+r>e.length)return u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,l.Y)(i,8),data:i};p(t,a)?u.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(u.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:r}}var m=n(6872),g=n(5157),y=n(5389),_=n(3274),b=n(7714),T=n(1959),E=n(1946),S=n(288),w=n(6139),k=n(770);function A(e){k.Z.setState(e,null),(0,w.Y)(e,null)}function x(){return(x=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l,c,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.keySystemOptions,a=n.loadedSessionsStore,s=n.mediaKeySystemAccess,l=n.mediaKeys,c=k.Z.getState(t),d=null!==c&&c.loadedSessionsStore!==a?c.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,d;case 5:if(!r.isCancelled){e.next=7;break}throw r.cancellationError;case 7:if(k.Z.setState(t,{keySystemOptions:i,mediaKeySystemAccess:s,mediaKeys:l,loadedSessionsStore:a}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:u.Z.info("DRM: Attaching MediaKeys to the media element"),(0,w.Y)(t,l),u.Z.info("DRM: MediaKeys attached with success");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,b.Z)(n,"expired")?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,b.Z)(n,"internal-error")?(u.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(u.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function Z(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?R(i,t):null===a?(u.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),R(i,t)):function(e,t,n,r){return M.apply(this,arguments)}(i,a,t,r)}function R(e,t){u.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function M(){return M=(0,r.Z)(o().mark((function e(t,n,i,a){var s,l,c,d,f,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v=function(){return v=(0,r.Z)(o().mark((function e(){var r,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===a.cancellationError){e.next=2;break}throw a.cancellationError;case 2:return u.Z.info("DRM: Removing previous persistent session."),null!==(r=n.get(i))&&n.delete(r.sessionId),e.prev=5,e.next=8,t.closeSession(s.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===s.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(s.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return l=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:l});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),v.apply(this,arguments)},f=function(){return v.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(u.Z.info("DRM: Creating persistent MediaKeySession"),s=t.createSession(i,"persistent-license"),null!==(l=n.getAndReuse(i))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:s});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(s.mediaKeySession,l.sessionId);case 12:if(c=e.sent){e.next=19;break}return u.Z.warn("DRM: No data stored for the loaded session"),n.delete(l.sessionId),t.removeSessionWithoutClosingIt(s.mediaKeySession),d=t.createSession(i,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!c||!I(s.mediaKeySession)){e.next=23;break}return n.add(i,i.keyIds,s.mediaKeySession),u.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:s});case 23:return u.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",f());case 27:return e.prev=27,e.t0=e.catch(9),u.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",f());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),M.apply(this,arguments)}function C(e,t){return P.apply(this,arguments)}function P(){return(P=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<0||n>=t.getLength())){e.next=2;break}return e.abrupt("return");case 2:for(r=[],i=t.getAll().slice(),a=i.length-n,s=0;s<a;s++)u=i[s],r.push(t.closeSession(u.mediaKeySession));return e.next=8,Promise.all(r);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t,n,r,i){return N.apply(this,arguments)}function N(){return(N=(0,r.Z)(o().mark((function e(t,n,r,i,a){var s,l,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null,l=n.loadedSessionsStore,c=n.persistentSessionsStore,null===(d=l.reuse(t))){e.next=11;break}if(!I(s=d.mediaKeySession)){e.next=10;break}return u.Z.info("DRM: Reuse loaded session",s.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:s,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==c&&""!==d.mediaKeySession.sessionId&&c.delete(d.mediaKeySession.sessionId);case 11:if(null===s){e.next=16;break}return e.next=14,l.closeSession(s);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,C(l,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,Z(n,t,r,a);case 22:return f=e.sent,e.abrupt("return",{type:f.type,value:{mediaKeySession:f.value.mediaKeySession,sessionType:f.value.sessionType,keySessionRecord:f.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=n(3666);function L(){return!(O.gM||O.uz)}var B=n(9592);function U(e,t,n){var r=t.getConfiguration();if(O.fq||null==r)return null;var i=e.filter((function(e){return e.type===n.type&&((!0!==e.persistentLicense&&!0!==e.persistentStateRequired||"required"===r.persistentState)&&(!0!==e.distinctiveIdentifierRequired||"required"===r.distinctiveIdentifier))}))[0];return null!=i?{keySystemOptions:i,keySystemAccess:t}:null}function F(e,t){var n=["temporary"],r="optional",i="optional";!0===t.persistentLicense&&(r="required",n.push("persistent-license")),!0===t.persistentStateRequired&&(r="required"),!0===t.distinctiveIdentifierRequired&&(i="required");var a=m.Z.getCurrent().EME_DEFAULT_WIDEVINE_ROBUSTNESSES,o=null!=t.videoRobustnesses?t.videoRobustnesses:"widevine"===e?a:[],s=null!=t.audioRobustnesses?t.audioRobustnesses:"widevine"===e?a:[];return 0===o.length&&o.push(void 0),0===s.length&&s.push(void 0),[{initDataTypes:["cenc"],videoCapabilities:(0,B.Z)(o,(function(e){return['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),audioCapabilities:(0,B.Z)(s,(function(e){return['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"].map((function(t){return void 0!==e?{contentType:t,robustness:e}:{contentType:t}}))})),distinctiveIdentifier:i,persistentState:r,sessionTypes:n}]}function z(e,t,n){u.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var i=k.Z.getState(e);if(null!=i){var a=U(t,i.mediaKeySystemAccess,i.keySystemOptions);if(null!==a)return u.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var s=t.reduce((function(e,t){var n,r=m.Z.getCurrent().EME_KEY_SYSTEMS[t.type];if(null!=r)n=r.map((function(e){return{keyName:t.type,keyType:e,keySystemOptions:t}}));else{var i=function(e){for(var t=m.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,b.Z)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return l(0);function l(e){return c.apply(this,arguments)}function c(){return(c=(0,r.Z)(o().mark((function e(t){var r,i,a,c,d,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=s.length)){e.next=2;break}throw new g.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=w.N){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=s[t],i=r.keyName,a=r.keyType,c=r.keySystemOptions,d=F(i,c),u.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+s.length),e.prev=7,e.next=10,(0,w.N)(a,d);case 10:return f=e.sent,u.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:c,mediaKeySystemAccess:f}});case 15:if(e.prev=15,e.t0=e.catch(7),u.Z.debug("DRM: Rejected access to keysystem",a,t+1),null===n.cancellationError){e.next=20;break}throw n.cancellationError;case 20:return e.abrupt("return",l(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var V=n(2297);function K(e,t,n){var r;u.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){u.Z.info("Compat: Trying to move CENC PSSH from init data at the end of it.");for(var t=!1,n=new Uint8Array,r=new Uint8Array,i=0;i<e.length;){if(e.length<i+8||(0,d.pX)(e,i+4)!==v)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,d.pX)(new Uint8Array(e),i);if(i+a>e.length)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var o=e.subarray(i,i+a);if(16===e[i+12]&&119===e[i+13]&&239===e[i+14]&&236===e[i+15]&&192===e[i+16]&&178===e[i+17]&&77===e[i+18]&&2===e[i+19]&&172===e[i+20]&&227===e[i+21]&&60===e[i+22]&&30===e[i+23]&&82===e[i+24]&&226===e[i+25]&&251===e[i+26]&&75===e[i+27]){var s=(0,V.Xj)(o),l=null===s?void 0:o[s[1]];u.Z.info("Compat: CENC PSSH found with version",l),void 0===l?u.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===l)?n=(0,d.zo)(n,o):1===l?(u.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):u.Z.warn("Compat: filtering out cenc pssh box with wrong version",l)}else r=(0,d.zo)(r,o);i+=a}if(i!==e.length)throw u.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,d.zo)(r,n)}(n)}catch(e){r=n}var i=null!=t?t:"";return e.generateRequest(i,r).catch((function(t){if(""!==i||!(t instanceof TypeError))throw t;return u.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}function G(e,t){return H.apply(this,arguments)}function H(){return H=(0,r.Z)(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.info("Compat/DRM: Load persisted session",n),e.next=3,t.load(n);case 3:if((r=e.sent)&&!(t.keyStatuses.size>0)){e.next=6;break}return e.abrupt("return",r);case 6:return e.abrupt("return",new Promise((function(e){t.addEventListener("keystatuseschange",i);var n=setTimeout(i,100);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)}))),H.apply(this,arguments)}var W=n(7864);function j(e){var t=new S.ZP;return Promise.race([e.close().then((function(){t.cancel()})),e.closed.then((function(){t.cancel()})),function(){return n.apply(this,arguments)}()]);function n(){return(n=(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,W.Z)(1e3,t.signal);case 3:return e.next=5,i();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof S.FU)){e.next=11;break}return e.abrupt("return");case 11:n=e.t0 instanceof Error?e.t0.message:"Unknown error made it impossible to close the session",u.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function i(){return a.apply(this,arguments)}function a(){return(a=(0,r.Z)(o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.update(new Uint8Array(1));case 3:n.next=13;break;case 5:if(n.prev=5,n.t0=n.catch(0),!t.isUsed){n.next=9;break}return n.abrupt("return");case 9:if(!(n.t0 instanceof Error&&"The session is already closed."===n.t0.message)){n.next=11;break}return n.abrupt("return");case 11:return n.next=13,(0,W.Z)(1e3,t.signal);case 13:if(!t.isUsed){n.next=15;break}return n.abrupt("return");case 15:throw new Error("Compat: Couldn't know if session is closed");case 16:case"end":return n.stop()}}),n,null,[[0,5]])})))).apply(this,arguments)}}var q=n(811);function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $(e,t){return e===t||(0,c.Z)(e,t)}function Q(e,t){return t.some((function(t){return $(t,e)}))}function J(e,t){for(var n,r=function(){var e=n.value;if(!t.some((function(t){return $(t,e)})))return{v:!1}},i=Y(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!0}function ee(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return te(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ne=function(){function e(e){this._initializationData=e,this._keyIds=null}var t=e.prototype;return t.associateKeyIds=function(e){null===this._keyIds&&(this._keyIds=[]);for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t];this.isAssociatedWithKeyId(r)||this._keyIds.push(r)}},t.isAssociatedWithKeyId=function(e){if(null===this._keyIds)return!1;for(var t,n=ee(this._keyIds);!(t=n()).done;){if($(t.value,e))return!0}return!1},t.getAssociatedKeyIds=function(){return null===this._keyIds?[]:this._keyIds},t.isCompatibleWith=function(e){var t=e.keyIds;if(void 0!==t&&t.length>0){if(null!==this._keyIds&&J(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return J(t,this._initializationData.keyIds)}return this._checkInitializationDataCompatibility(e)},t._checkInitializationDataCompatibility=function(e){return void 0!==e.keyIds&&e.keyIds.length>0&&void 0!==this._initializationData.keyIds?J(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function re(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ie(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ae=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new ne(e),i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,E.Z)(i.closed)||i.closed.then((function(){var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){u.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),u.Z.debug("DRM-LSS: Add MediaKeySession",a.sessionType),this._storage.push(Object.assign({},a)),a},t.reuse=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.keySessionRecord.isCompatibleWith(e))return this._storage.splice(t,1),this._storage.push(n),Object.assign({},n)}return null},t.getEntryForSession=function(e){for(var t=this._storage.length-1;t>=0;t--){var n=this._storage[t];if(n.mediaKeySession===e)return Object.assign({},n)}return null},t.generateLicenseRequest=function(){var e=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=re(this._storage);case 1:if((s=a()).done){e.next=8;break}if((l=s.value).mediaKeySession!==t){e.next=6;break}return i=l,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return u.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",K(t,n,r));case 11:if(i.isGeneratingRequest=!0,"none"===i.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,K(t,n,r);case 17:e.next=26;break;case 19:if(e.prev=19,e.t0=e.catch(14),void 0!==i){e.next=23;break}throw e.t0;case 23:throw i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start(),e.t0;case 26:if(void 0!==i){e.next=28;break}return e.abrupt("return",void 0);case 28:i.isGeneratingRequest=!1,"awaiting"===i.closingStatus.type&&i.closingStatus.start();case 30:case"end":return e.stop()}}),e,this,[[14,19]])})));return function(t,n,r){return e.apply(this,arguments)}}(),t.loadPersistentSession=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=re(this._storage);case 1:if((a=i()).done){e.next=8;break}if((s=a.value).mediaKeySession!==t){e.next=6;break}return r=s,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return u.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",G(t,n));case 11:if(r.isLoadingPersistentSession=!0,"none"===r.closingStatus.type){e.next=14;break}throw new Error("The `MediaKeySession` is being closed.");case 14:return e.prev=14,e.next=17,G(t,n);case 17:l=e.sent,e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(14),void 0!==r){e.next=24;break}throw e.t0;case 24:throw r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.t0;case 27:if(void 0!==r){e.next=29;break}return e.abrupt("return",l);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",l);case 32:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t.closeSession=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=re(this._storage);case 1:if((i=r()).done){e.next=8;break}if((a=i.value).mediaKeySession!==t){e.next=6;break}return n=a,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==n){e.next=11;break}return u.Z.warn("DRM-LSS: No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",Promise.resolve(!1));case 11:return e.abrupt("return",this._closeEntry(n));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getLength=function(){return this._storage.length},t.getAll=function(){return this._storage},t.closeAllSessions=function(){var e=(0,r.Z)(o().mark((function e(){var t,n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,u.Z.debug("DRM-LSS: Closing all current MediaKeySessions",t.length),this._storage=[],n=t.map((function(e){return r._closeEntry(e)})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.removeSessionWithoutClosingIt=function(e){(0,q.Z)(""===e.sessionId,"Initialized `MediaKeySession`s should always be properly closed");for(var t=this._storage.length-1;t>=0;t--){if(this._storage[t].mediaKeySession===e)return this._storage.splice(t,1),!0}return!1},t.getIndex=function(e){for(var t=0;t<this._storage.length;t++){if(this._storage[t].keySessionRecord===e)return t}return-1},t._closeEntry=function(){var e=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mediaKeySession,e.abrupt("return",new Promise((function(e,r){function i(){void 0!==t&&(t.closingStatus={type:"pending"}),oe(n).then((function(){void 0!==t&&(t.closingStatus={type:"done"}),e(!0)})).catch((function(e){void 0!==t&&(t.closingStatus={type:"failed"}),r(e)}))}void 0!==t&&(t.isLoadingPersistentSession||t.isGeneratingRequest)?t.closingStatus={type:"awaiting",start:i}:i()})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e}();function oe(e){return se.apply(this,arguments)}function se(){return(se=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,j(t);case 4:return u.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),u.Z.error("DRM: Could not close MediaKeySession: "+(e.t0 instanceof Error?e.t0.toString():"Unknown error")),e.abrupt("return");case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var ue=n(9689),le=n(2870),ce=n(6923),de=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,ue.J)(this.initData)},e.decode=function(e){return(0,ue.K)(e)},e}();function fe(e,t){var n,r;return null!==(r=null!==(n=ve(e,t))&&void 0!==n?n:ve(t,e))&&void 0!==r&&r}function ve(e,t){if(0===e.length)return!1;if(t.length<e.length)return null;for(var n=e[0],r=0,i=0;i<t.length;i++){var a=t[i];if(a.systemId===n.systemId){if(a.hash!==n.hash)return!1;var o=n.data instanceof Uint8Array?n.data:"string"==typeof n.data?de.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?de.decode(a.data):a.data.initData;if(!(0,c.Z)(o,s))return!1;if(t.length-i<e.length)return null;for(r=1;r<e.length;r++){var u=e[r];for(i+=1;i<t.length;i++){var l=t[i];if(u.systemId===l.systemId){if(u.hash!==l.hash)return!1;var d=u.data instanceof Uint8Array?u.data:"string"==typeof u.data?de.decode(u.data):u.data.initData,f=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?de.decode(l.data):l.data.initData;if(!(0,c.Z)(d,f))return!1;break}}if(r===t.length)return null}return!0}}return null}function pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var me=function(){function e(e){!function(e){(0,q.u)(e,{save:"function",load:"function"},"licenseStorage")}(e),this._entries=[],this._storage=e;try{var t=this._storage.load();Array.isArray(t)||(t=[]),this._entries=t}catch(e){u.Z.warn("DRM-PSS: Could not get entries from license storage",e instanceof Error?e:""),this.dispose()}}var t=e.prototype;return t.getLength=function(){return this._entries.length},t.getAll=function(){return this._entries},t.get=function(e){var t=this._getIndex(e);return-1===t?null:this._entries[t]},t.getAndReuse=function(e){var t=this._getIndex(e);if(-1===t)return null;var n=this._entries.splice(t,1)[0];return this._entries.push(n),n},t.add=function(e,t,n){var r;if(!(0,E.Z)(n)&&(0,ce.Z)(n.sessionId)){var i=n.sessionId,a=this._getIndex(e);if(a>=0){var o=void 0===t?3:4,s=this._entries[a];if((null!==(r=s.version)&&void 0!==r?r:-1)>=o&&i===s.sessionId)return;u.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else u.Z.info("DRM-PSS: Add new session",i);var l=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new de(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:l,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new de(e)})),values:l,initDataType:e.type}),this._save()}else u.Z.warn("DRM-PSS: Invalid Persisten Session given.")},t.delete=function(e){for(var t=-1,n=0;n<this._entries.length;n++){if(this._entries[n].sessionId===e){t=n;break}}if(-1!==t){var r=this._entries[t];u.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else u.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){u.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(u.Z.warn("DRM-PSS: Asked to remove more information that it contains",e,this._entries.length),this._entries=[]),this._save())},t.dispose=function(){this._entries=[],this._save()},t._getIndex=function(e){var t=this,n=null;function r(){if(null===n){var t=e.values.constructRequestData();n={initData:t,initDataHash:(0,le.Z)(t)}}return n}for(var i=function(n){var i=t._entries[n];if(i.initDataType===e.type)switch(i.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,n=(0,ue.J)(e),r=pe(i.keyIds);!(t=r()).done;){var a=t.value;if("string"==typeof a){if(n===a)return!0}else if($(a.initData,e))return!0}return!1})))return{v:n}}else if(fe(e.values.getFormattedValues(),i.values))return{v:n};break;case 3:if(fe(e.values.getFormattedValues(),i.values))return{v:n};break;case 2:var a=r(),o=a.initData,s=a.initDataHash;if(i.initDataHash===s)try{var l="string"==typeof i.initData?de.decode(i.initData):i.initData.initData;if((0,c.Z)(l,o))return{v:n}}catch(e){u.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var d=r(),f=d.initData,v=d.initDataHash;if(i.initDataHash===v){if(void 0===i.initData.length)return{v:n};if((0,c.Z)(i.initData,f))return{v:n}}break;default:var p=r().initDataHash;if(i.initData===p)return{v:n}}},a=0;a<this._entries.length;a++){var o=i(a);if("object"==typeof o)return o.v}return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){u.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var ge=new WeakMap,ye=function(e){ge.set(e,null)},_e=function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=(0,le.Z)(n);ge.set(e,{hash:r,serverCertificate:n})},be=function(e){var t=ge.get(e);return void 0!==t&&(null!==t||void 0)},Te=function(e,t){var n=ge.get(e);if(null==n)return!1;var r=n.hash,i=n.serverCertificate,a=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer);if((0,le.Z)(a)!==r||i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(i[o]!==a[o])return!1;return!0};function Ee(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new g.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return u.Z.debug("DRM: Set the given license storage"),new me(t)}function Se(e,t,n){return we.apply(this,arguments)}function we(){return(we=(0,r.Z)(o().mark((function e(t,n,r){var i,a,s,l,c,d,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z(t,n,r);case 2:if(i=e.sent,null===r.cancellationError){e.next=5;break}throw r.cancellationError;case 5:if(a=i.value,s=a.options,l=a.mediaKeySystemAccess,c=k.Z.getState(t),d=Ee(s),!L()||null===c||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(f=c.mediaKeys,v=c.loadedSessionsStore,!1!==be(f)&&((0,E.Z)(s.serverCertificate)||!Te(f,s.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:f,mediaKeySystemAccess:l,stores:{loadedSessionsStore:v,persistentSessionsStore:d},options:s});case 12:return e.next=14,ke(l);case 14:return p=e.sent,u.Z.info("DRM: MediaKeys created with success"),h=new ae(p),e.abrupt("return",{mediaKeys:p,mediaKeySystemAccess:l,stores:{loadedSessionsStore:h,persistentSessionsStore:d},options:s});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.Z.info("DRM: Calling createMediaKeys on the MediaKeySystemAccess"),e.prev=1,e.next=4,t.createMediaKeys();case 4:return n=e.sent,e.abrupt("return",n);case 8:throw e.prev=8,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.message:"Unknown error when creating MediaKeys.",new g.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function xe(){return(xe=(0,r.Z)(o().mark((function e(t,n,r){var i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Se(t,n,r);case 2:return i=e.sent,a=i.mediaKeys,null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys&&(u.Z.debug("DRM: Disabling old MediaKeys"),A(t)),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ie=n(7326),Ze=n(2146),Re=n(6716),Me=n(9127),Ce=n(7877),Pe=n(9917),De=n(7991),Ne=n(1454),Oe=n(6798),Le=n(7878),Be=n(1819),Ue=n(2566),Fe=n(7845),ze=(0,Be.d)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ve(e){throw new ze(e)}var Ke=n(278),Ge=n(9878),He=n(3071),We=n(8474);var je=n(1545),qe=n(2817),Ye=n(3505),Xe=n(2034),$e=n(2006),Qe=n(533),Je=n(8117),et=n(6625),tt=n(2572);var nt=n(5561);var rt=n(7904),it=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ie.Z)(r),t.prototype),r.reason=n,r}return(0,i.Z)(t,e),t}((0,Ze.Z)(Error)),at="expired",ot="internal-error",st="output-restricted";function ut(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],c=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],d=function(e,t){return-1!==e.indexOf("playready")&&(O.YM||O.kD)?(0,f.wO)(t):t}(n,new Uint8Array(r[1])),v={keyId:d.buffer,keyStatus:i};switch(i){case at:var p=new g.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new it(p);case"fallback":u.push(d);break;default:"continue"===s||void 0===s?l.push(d):(0,rt.Z)(s)}c.push(v);break;case ot:if(!0!==a.keyInternalError)throw new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});c.push(v),u.push(d);break;case st:if(!0!==a.keyOutputRestricted)throw new g.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,f.ci)(d)+")",{keyStatuses:[v].concat(c)});c.push(v),u.push(d);break;default:l.push(d)}})),c.length>0&&(r=new g.Z("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:c})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var lt=s.Xe,ct=s.GJ,dt=s.eX,ft=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,Ie.Z)(r),t.prototype),r.sessionError=n,r}return(0,i.Z)(t,e),t}((0,Ze.Z)(Error));function vt(e,t,n){u.Z.info("DRM: Binding session events",e.sessionId);var r,i,a=new Re.x,o=t.getLicenseConfig,s=void 0===o?{}:o,l=lt(e).pipe((0,Me.U)((function(e){throw new g.Z("KEY_ERROR",e.type)}))),c=dt(e).pipe((0,Ce.z)((function(r){return function(e,t,n,r){u.Z.info("DRM: keystatuseschange event received",e.sessionId);var i=(0,Pe.P)((function(){return(0,nt.Z)((function(){return"function"!=typeof t.onKeyStatusesChange?je.E:(0,Je.Z)(t.onKeyStatusesChange(r,e))}),void 0)})).pipe((0,Me.U)((function(t){return{type:"key-status-change-handled",value:{session:e,license:t}}})),(0,Ge.K)((function(e){var t=new g.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error");throw!(0,E.Z)(e)&&(0,ce.Z)(e.message)&&(t.message=e.message),t})));return(0,He.T)(pt(e,t,n),i)}(e,t,n,r)}))),d=ct(e).pipe((0,Ce.z)((function(n){var r=new Uint8Array(n.message),i=(0,ce.Z)(n.messageType)?n.messageType:"license-request";u.Z.info("DRM: Received message event, type "+i,e.sessionId);var o,l,c,d,f,v,p,h,m=(0,Pe.P)((function(){var e=t.getLicense(r,i),n=(0,E.Z)(s.timeout)?1e4:s.timeout;return(0,Je.Z)(e).pipe(n>=0?function(e,t){var n=(0,Ne.q)(e)?{first:e}:"number"==typeof e?{each:e}:e,r=n.first,i=n.each,a=n.with,o=void 0===a?Ve:a,s=n.scheduler,u=void 0===s?null!=t?t:De.z:s,l=n.meta,c=void 0===l?null:l;if(null==r&&null==i)throw new TypeError("No timeout provided.");return(0,Oe.e)((function(e,t){var n,a,s=null,l=0,d=function(e){a=(0,Fe.f)(t,u,(function(){try{n.unsubscribe(),(0,Le.Xf)(o({meta:c,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe((0,Ue.x)(t,(function(e){null==a||a.unsubscribe(),l++,t.next(s=e),i>0&&d(i)}),void 0,void 0,(function(){(null==a?void 0:a.closed)||null==a||a.unsubscribe(),s=null}))),!l&&d(null!=r?"number"==typeof r?r:+r-u.now():i)}))}(n):Ke.y)})),g=function(e,t){return{totalRetry:null!=t?t:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof ze||(0,E.Z)(e)||!0!==e.noRetry},onRetry:function(t){return e.next({type:"warning",value:ht(t)})}}}(a,s.retry);return(o=m,l=g,c=l.baseDelay,d=l.maxDelay,f=l.totalRetry,v=l.shouldRetry,p=l.onRetry,h=0,o.pipe((0,Ge.K)((function(e,t){if(!(0,E.Z)(v)&&!v(e)||h++>=f)throw e;"function"==typeof p&&p(e,h);var n=Math.min(c*Math.pow(2,h-1),d),r=(0,tt.Z)(n);return(0,et.H)(r).pipe((0,Ce.z)((function(){return t})))})))).pipe((0,Me.U)((function(t){return{type:"key-message-handled",value:{session:e,license:t}}})),(0,Ge.K)((function(e){var t=ht(e);if(!(0,E.Z)(e)&&!0===e.fallbackOnLastTry)throw u.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),new ft(t);throw t})))}))),f=(0,He.T)(d,c).pipe((r=function(t){switch(t.type){case"key-message-handled":case"key-status-change-handled":return(0,E.Z)(t.value.license)?(u.Z.info("DRM: No message given, skipping session.update"),je.E):function(e,t){return u.Z.info("DRM: Updating MediaKeySession with message"),(0,Je.Z)(e.update(t)).pipe((0,Ge.K)((function(e){var t=e instanceof Error?e.toString():"`session.update` failed";throw new g.Z("KEY_UPDATE_ERROR",t)})),(0,$e.b)((function(){u.Z.info("DRM: MediaKeySession update succeeded.")})),(0,Qe.l)())}(e,t.value.license);default:return(0,qe.of)(t)}},(0,We.m)(i)?(0,Ce.z)(r,i,1):(0,Ce.z)(r,1))),v=(0,He.T)(pt(e,t,n),f,l,a);return(0,E.Z)(e.closed)?v:v.pipe((0,Ye.R)((0,Je.Z)(e.closed)))}function pt(e,t,n){return(0,Pe.P)((function(){if(0===e.keyStatuses.size)return je.E;var r=ut(e,t,n),i=r.warning,a=r.blacklistedKeyIds,o=r.whitelistedKeyIds,s=(0,qe.of)({type:"keys-update",value:{whitelistedKeyIds:o,blacklistedKeyIds:a}});return void 0!==i?(0,Xe.z)((0,qe.of)({type:"warning",value:i}),s):s}))}function ht(e){if(e instanceof ze)return new g.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new g.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,E.Z)(e)&&(0,ce.Z)(e.message)&&(t.message=e.message),t}var mt=n(9822);function gt(e,t){return yt.apply(this,arguments)}function yt(){return(yt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setServerCertificate(n);case 3:return r=e.sent,e.abrupt("return",r);case 7:throw e.prev=7,e.t0=e.catch(0),u.Z.warn("DRM: mediaKeys.setServerCertificate returned an error",e.t0 instanceof Error?e.t0:""),i=e.t0 instanceof Error?e.t0.toString():"`setServerCertificate` error",new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function _t(e,t){return bt.apply(this,arguments)}function bt(){return(bt=(0,r.Z)(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==be(t)){e.next=3;break}return u.Z.info("DRM: The MediaKeys already has a server certificate, skipping..."),e.abrupt("return",{type:"already-has-one"});case 3:if("function"==typeof t.setServerCertificate){e.next=6;break}return u.Z.warn("DRM: Could not set the server certificate. mediaKeys.setServerCertificate is not a function"),e.abrupt("return",{type:"method-not-implemented"});case 6:return u.Z.info("DRM: Setting server certificate on the MediaKeys"),ye(t),e.prev=8,e.next=11,gt(t,n);case 11:return r=e.sent,_e(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,mt.Z)(e.t0)?e.t0:new g.Z("LICENSE_SERVER_CERTIFICATE_ERROR","Unknown error when setting the server certificate."),e.abrupt("return",{type:"error",value:i});case 20:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)}function Tt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;u.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var Et=n(9252);var St=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return d.zo.apply(void 0,this._innerValues.map((function(e){return e.data})))},t.isCompatibleWith=function(t){var n=t instanceof e?t.getFormattedValues():t;return fe(this.getFormattedValues(),n)},t.getFormattedValues=function(){return null===this._lazyFormattedValues&&(this._lazyFormattedValues=this._innerValues.slice().sort((function(e,t){return e.systemId===t.systemId?0:void 0===e.systemId?1:void 0===t.systemId||e.systemId<t.systemId?-1:1})).map((function(e){var t=e.systemId,n=e.data;return{systemId:t,data:n,hash:(0,le.Z)(n)}}))),this._lazyFormattedValues},e}();function wt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var At,xt=s.Oh,It=function(e){function t(t,n){var r;r=e.call(this)||this,u.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new S.ZP;r._currentSessions=[],r._canceller=i,r._wasAttachCalled=!1,r._initDataQueue=[],r._stateData={state:At.Initializing,isMediaKeysAttached:!1,isInitDataQueueLocked:!0,data:null},r.error=null;var a=xt(t).subscribe((function(e){u.Z.debug("DRM: Encrypted event received from media element.");var t=h(e);null!==t&&r.onInitializationData(t)}));return i.signal.register((function(){a.unsubscribe()})),function(e,t,n){return xe.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,E.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,Et.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,Et.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,Et.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===At.Initializing&&(r._stateData={state:At.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,i.Z)(t,e);var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==At.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(this._wasAttachCalled)u.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.");else{this._wasAttachCalled=!0;var t=this._stateData.data,n=t.mediaElement,i=t.mediaKeysInfo,a=i.options,s=i.mediaKeys,l=i.mediaKeySystemAccess,c={loadedSessionsStore:i.stores.loadedSessionsStore,mediaKeySystemAccess:l,mediaKeys:s,keySystemOptions:a};!0===a.disableMediaKeysAttachmentLock&&(this._stateData={state:At.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:!1,data:null},this.trigger("stateChange",this._stateData.state),this._isStopped())||(u.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return x.apply(this,arguments)}(n,c,this._canceller.signal).then((0,r.Z)(o().mark((function t(){var n,r,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=a.serverCertificate,(0,E.Z)(n)){t.next=6;break}return t.next=4,_t(s,n);case 4:"error"===(r=t.sent).type&&e.trigger("warning",r.value);case 6:if(!e._isStopped()){t.next=8;break}return t.abrupt("return");case 8:u=e._stateData.state,e._stateData={state:At.ReadyForContent,isMediaKeysAttached:!0,isInitDataQueueLocked:!1,data:{mediaKeysData:i}},u!==At.ReadyForContent&&e.trigger("stateChange",At.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 12:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)})))}},n.dispose=function(){this.removeEventListener(),this._stateData={state:At.Disposed,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("stateChange",this._stateData.state)},n.onInitializationData=function(e){var t=this;if(!1===this._stateData.isInitDataQueueLocked){var n=this._stateData.data.mediaKeysData,r=Object.assign(Object.assign({},e),{values:new St(e.values)});this._processInitializationData(r,n).catch((function(e){t._onFatalError(e)}))}else{if(this._isStopped())throw new Error("ContentDecryptor either disposed or stopped.");this._initDataQueue.push(e)}},n._processInitializationData=function(){var e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,l,c,d,v,p,h,y,b,T,E,S,w,k,A,x,I,Z,R,M,C,P,N,O,L,B,U,F,z,V,K,G=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.mediaKeySystemAccess,i=n.stores,a=n.options,!this._tryToUseAlreadyCreatedSession(t,n)&&!this._isStopped()){e.next=3;break}return e.abrupt("return");case 3:if("content"!==a.singleLicensePer){e.next=15;break}if(void 0===(s=(0,_.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(l=t.keyIds)){e.next=10;break}return void 0===t.content?u.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):Mt(t.content.manifest,t),e.abrupt("return");case 10:return s.record.associateKeyIds(l),void 0!==t.content&&(u.Z.hasLevel("DEBUG")&&(c=l.reduce((function(e,t){return e+", "+(0,f.ci)(t)}),""),u.Z.debug("DRM: Blacklisting new key ids",c)),Rt(t.content.manifest,[],l,[])),e.abrupt("return");case 13:e.next=37;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=37;break}d=t.content.period,v=this._currentSessions.filter((function(e){return"created-session"===e.source})),Dt(p=new Set,d),h=wt(v);case 21:if((y=h()).done){e.next=37;break}b=y.value,T=Array.from(p),E=0,S=T;case 25:if(!(E<S.length)){e.next=35;break}if(w=S[E],!b.record.isAssociatedWithKeyId(w)){e.next=32;break}for(b.record.associateKeyIds(p.values()),k=wt(T);!(A=k()).done;)Q(x=A.value,b.keyStatuses.whitelisted)||Q(x,b.keyStatuses.blacklisted)||b.keyStatuses.blacklisted.push(x);return Rt(t.content.manifest,b.keyStatuses.whitelisted,b.keyStatuses.blacklisted,[]),e.abrupt("return");case 32:E++,e.next=25;break;case 35:e.next=21;break;case 37:return this._lockInitDataQueue(),!0!==a.persistentLicense?I="temporary":Zt(r)?I="persistent-license":(u.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),I="temporary"),Z=m.Z.getCurrent(),R=Z.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,M=Z.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,C="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:R,e.next=43,D(t,i,I,C,this._canceller.signal);case 43:if(P=e.sent,!this._isStopped()){e.next=46;break}return e.abrupt("return");case 46:if(N={record:P.value.keySessionRecord,source:P.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(N),O=P.value,L=O.mediaKeySession,B=O.sessionType,U=!1,F=vt(L,a,r.keySystem).subscribe({next:function(e){if("warning"!==e.type){var n=Ct(t,N.record,a.singleLicensePer,"created-session"===N.source,e.value.whitelistedKeyIds,e.value.blacklistedKeyIds);if(N.record.associateKeyIds(n.whitelisted),N.record.associateKeyIds(n.blacklisted),N.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==N.record.getAssociatedKeyIds().length&&"persistent-license"===B&&null!==i.persistentSessionsStore&&!U){var r=i.persistentSessionsStore;Tt(r,M-1),r.add(t,N.record.getAssociatedKeyIds(),L),U=!0}void 0!==t.content&&Rt(t.content.manifest,n.whitelisted,n.blacklisted,[]),G._unlockInitDataQueue()}else G.trigger("warning",e.value)},error:function(e){var n;if(e instanceof it){u.Z.warn("DRM: A session's closing condition has been triggered"),G._lockInitDataQueue();var r=G._currentSessions.indexOf(N);return r>=0&&G._currentSessions.splice(r),void 0!==t.content&&Rt(t.content.manifest,[],[],N.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(L.sessionId),i.loadedSessionsStore.closeSession(L).catch((function(e){var t=e instanceof Error?e:"unknown error";u.Z.warn("DRM: failed to close expired session",t)})).then((function(){return G._unlockInitDataQueue()})).catch((function(e){return G._onFatalError(e)})),void(G._isStopped()||G.trigger("warning",e.reason))}if(e instanceof ft){if(N.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;u.Z.info("DRM: blacklisting Representations based on protection data."),Mt(a,t)}G._unlockInitDataQueue()}else G._onFatalError(e)}}),this._canceller.signal.register((function(){F.unsubscribe()})),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==P.type){e.next=68;break}return z=t.values.constructRequestData(),e.prev=55,e.next=58,i.loadedSessionsStore.generateLicenseRequest(L,t.type,z);case 58:e.next=68;break;case 60:if(e.prev=60,e.t0=e.catch(55),null!==(V=i.loadedSessionsStore.getEntryForSession(L))&&"none"===V.closingStatus.type){e.next=67;break}return(K=this._currentSessions.indexOf(N))>=0&&this._currentSessions.splice(K,1),e.abrupt("return",Promise.resolve());case 67:throw new g.Z("KEY_GENERATE_REQUEST_ERROR",e.t0 instanceof Error?e.t0.toString():"Unknown error");case 68:return e.abrupt("return",Promise.resolve());case 69:case"end":return e.stop()}}),e,this,[[55,60]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,_.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,E.Z)(a))return void 0===e.type||void 0===e.content?(u.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(u.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),Mt(e.content.manifest,e),!0);if(void 0!==e.keyIds){var o;if(void 0===r.singleLicensePer||"init-data"===r.singleLicensePer){var s=i.keyStatuses.blacklisted;o=function(e,t){for(var n,r=function(){var e=n.value;if(t.some((function(t){return $(t,e)})))return{v:!0}},i=Y(e);!(n=i()).done;){var a=r();if("object"==typeof a)return a.v}return!1}(e.keyIds,s)}else{var l=i.keyStatuses.whitelisted;o=!J(e.keyIds,l)}if(o)return void 0===e.content?(u.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(u.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),Rt(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return u.Z.debug("DRM: Init data already processed. Skipping it."),!0;var c=this._currentSessions.indexOf(i);return-1===c?u.Z.error("DRM: Unable to remove processed init data: not found."):(u.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(c,1)),!1},n._onFatalError=function(e){if(!this._canceller.isUsed){var t=e instanceof Error?e:new y.Z("NONE","Unknown decryption error");this.error=t,this._initDataQueue.length=0,this._stateData={state:At.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===At.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===At.Disposed||this._stateData.state===At.Error},n._processCurrentInitDataQueue=function(){for(;!1===this._stateData.isInitDataQueueLocked;){var e=this._initDataQueue.shift();if(void 0===e)return;this.onInitializationData(e)}},n._lockInitDataQueue=function(){!1===this._stateData.isInitDataQueueLocked&&(this._stateData.isInitDataQueueLocked=!0)},n._unlockInitDataQueue=function(){!0===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):u.Z.error("DRM: Trying to unlock in the wrong state")},t}(T.Z);function Zt(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,b.Z)(t,"persistent-license")}function Rt(e,t,n,r){e.updateRepresentationsDeciperability((function(e){if(void 0===e.contentProtections)return e.decipherable;var i=e.contentProtections.keyIds;if(void 0!==i)for(var a,o=wt(i);!(a=o()).done;){for(var s,u=a.value,l=wt(n);!(s=l()).done;){if($(s.value,u.keyId))return!1}for(var c,d=wt(t);!(c=d()).done;){if($(c.value,u.keyId))return!0}for(var f,v=wt(r);!(f=v()).done;){if($(f.value,u.keyId))return}}return e.decipherable}))}function Mt(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i,a=function(){var e=i.value;if((void 0===t.type||e.type===t.type)&&t.values.getFormattedValues().every((function(t){return e.values.some((function(e){return(void 0===t.systemId||e.systemId===t.systemId)&&(0,c.Z)(e.data,t.data)}))})))return{v:!1}},o=wt(null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[]);!(i=o()).done;){var s=a();if("object"==typeof s)return s.v}return e.decipherable}))}function Ct(e,t,n,r,i,a){for(var o,s,l=[].concat(i,a),c=function(){var e=s.value;l.some((function(t){return $(t,e)}))||(u.Z.hasLevel("DEBUG")&&u.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,f.ci)(e)),l.push(e))},d=wt(t.getAssociatedKeyIds());!(s=d()).done;)c();if(void 0!==n&&"init-data"!==n){var v=e.keyIds,p=e.content;if(void 0!==v){var h=v.filter((function(e){return!l.some((function(t){return $(t,e)}))}));h.length>0&&(u.Z.hasLevel("DEBUG")&&u.Z.debug("DRM: init data keys missing in the license, blacklisting them",h.map((function(e){return(0,f.ci)(e)})).join(", ")),l.push.apply(l,h))}if(r&&void 0!==p)if("content"===n){for(var m,g=new Set,y=wt(p.manifest.periods);!(m=y()).done;){Dt(g,m.value)}Pt(g,l)}else if("periods"===n)for(var _,b=wt(p.manifest.periods);!(_=b()).done;){var T=_.value,E=new Set;if(Dt(E,T),(null===(o=e.content)||void 0===o?void 0:o.period.id)===T.id)Pt(E,l);else for(var S=Array.from(E),w=function(){var e=A[k];if(l.some((function(t){return $(t,e)})))return Pt(E,l),"break"},k=0,A=S;k<A.length;k++){if("break"===w())break}}}return{whitelisted:i,blacklisted:l.slice(i.length)}}function Pt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return $(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function Dt(e,t){for(var n,r=wt(t.getAdaptations());!(n=r()).done;)for(var i,a=wt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=wt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}!function(e){e[e.Initializing=0]="Initializing",e[e.WaitingForAttachment=1]="WaitingForAttachment",e[e.ReadyForContent=2]="ReadyForContent",e[e.Error=3]="Error",e[e.Disposed=4]="Disposed"}(At||(At={}))},1266:function(e,t,n){"use strict";var r=n(7425);t.ZP=r.Z},770:function(e,t){"use strict";var n=new WeakMap;t.Z={setState:function(e,t){n.set(e,t)},getState:function(e){var t=n.get(e);return void 0===t?null:t},clearState:function(e){n.set(e,null)}}},5039:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(4727),i=n(3666);var a=n(1669),o=n(2793),s=n(8343);function u(e,t,n,u){return e.pipe((0,o.Z)((function(e){return null!==e.rebuffering||null!==e.freezing||0===e.readyState?null:function(e,t){return!e||!i.SB||t}(u,t.hasAttribute("playsinline"))?e.readyState>=3&&null!==e.currentRange&&(!(0,a.Z)()||t.duration>0)?s.Z.loaded(n):null:t.duration>0?s.Z.loaded(n):null}),null),(0,r.q)(1))}},8343:function(e,t){"use strict";var n={loaded:function(e){return{type:"loaded",value:{segmentBuffersStore:e}}},decipherabilityUpdate:function(e){return{type:"decipherabilityUpdate",value:e}},manifestReady:function(e){return{type:"manifestReady",value:{manifest:e}}},manifestUpdate:function(){return{type:"manifestUpdate",value:null}},nullRepresentation:function(e,t){return{type:"representationChange",value:{type:e,representation:null,period:t}}},reloadingMediaSource:function(){return{type:"reloading-media-source",value:void 0}},stalled:function(e){return{type:"stalled",value:e}},unstalled:function(){return{type:"unstalled",value:null}},warning:function(e){return{type:"warning",value:e}}};t.Z=n},7920:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(4975),i=n(4727),a=n(9127),o=n(9878),s=n(2817),u=n(2006),l=n(8515),c=n(7877),d=n(6108),f=n(2034),v=n(9917),p=n(8117),h=n(5561);var m=n(3774),g=n(1381);var y=n(1669),_=n(3714),b=n(3887),T=n(5095),E=n(8343);function S(e){return e.pipe((0,r.h)((function(e){var t=e.seeking,n=e.rebuffering,r=e.readyState;return!t&&null===n&&r>=1})),(0,i.q)(1),(0,a.U)((function(){})))}function w(e){return function(e){return(0,v.P)((function(){return(0,h.Z)((function(){return(0,p.Z)(e.play())}),void 0)}))}(e).pipe((0,a.U)((function(){return"autoplay"})),(0,o.K)((function(e){if(e instanceof Error&&"NotAllowedError"===e.name)return b.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies."),(0,s.of)("autoplay-blocked");throw e})))}function k(e){var t=e.mediaElement,n=e.playbackObserver,r=e.startTime,a=e.mustAutoPlay,o=(0,T.$l)(!1),v=(0,T.$l)(!1),p=function(e){return e.readyState>=m.c.HAVE_METADATA?(0,s.of)(null):(0,g.K4)(e).pipe((0,i.q)(1))}(t).pipe((0,i.q)(1),(0,u.b)((function(){var e="function"==typeof r?r():r;b.Z.info("Init: Set initial time",e),n.setCurrentTime(e),o.setValue(!0),o.finish()})),(0,l.d)({refCount:!0}));return{seekAndPlay$:p.pipe((0,c.z)((function(){if(!(0,y.Z)()||t.duration>0)return S(n.getReference().asObservable());var e=new _.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");return S(n.getReference().asObservable()).pipe((0,d.O)(E.Z.warning(e)))})),(0,c.z)((function(e){return void 0!==e?(0,s.of)(e):(b.Z.info("Init: Can begin to play content"),a?w(t).pipe((0,c.z)((function(e){if(v.setValue(!0),v.finish(),"autoplay"===e)return(0,s.of)({type:"autoplay"});var t=new _.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");return(0,f.z)((0,s.of)(E.Z.warning(t)),(0,s.of)({type:"autoplay-blocked"}))}))):(t.autoplay&&b.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),v.setValue(!0),v.finish(),(0,s.of)({type:"skipped"})))})),(0,l.d)({refCount:!0})),initialPlayPerformed:v,initialSeekPerformed:o}}},8969:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(1545),i=n(5583),a=n(4975),o=n(4727),s=n(7877),u=n(4978),l=n(2817),c=n(3071),d=n(533),f=n(5767),v=n(1480),p=n(3887);var h=n(8333),m=n(5039),g=n(7920),y=n(9607),_=n(342),b=n(2447);function T(e){var t=e.autoPlay,n=e.keySystems,T=e.mediaElement,E=e.playbackObserver,S=e.speed,w=e.startAt,k=e.url;if((0,f.Z)(T),null==k)throw new Error("No URL for a DirectFile content");var A=function(e,t){return new v.y((function(n){return p.Z.info("Setting URL to HTMLMediaElement",t),e.src=t,n.next(void 0),function(){(0,f.Z)(e)}}))}(T,k),x=(0,g.Z)({mediaElement:T,playbackObserver:E,startTime:function(){p.Z.debug("Init: Calculating initial time");var e=function(e,t){if(null==t)return 0;if(null!=t.position)return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if(null==n||!isFinite(n))return p.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0;if("number"==typeof t.fromLastPosition)return Math.max(0,n+t.fromLastPosition);if(null!=t.percentage){var r=t.percentage;return r>=100?n:r<=0?0:n*(+r/100)}return 0}(T,w);return p.Z.debug("Init: Initial time calculated:",e),e},mustAutoPlay:t}),I=x.seekAndPlay$,Z=(0,y.Z)(T,n,r.E,A).pipe((0,h.Z)(),(0,i.B)()),R=(0,b.Z)(T),M=E.getReference().asObservable(),C=(0,_.Z)(E,null,S,r.E,r.E),P=Z.pipe((0,a.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,o.q)(1),(0,s.z)((function(){return I})),(0,u.w)((function(e){return"warning"===e.type?(0,l.of)(e):(0,m.Z)(M,T,null,!0)})));return(0,c.T)(P,Z.pipe((0,d.l)()),R,C)}},9607:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3071),i=n(9127),a=n(1480),o=n(1381),s=n(6139);var u=n(5157),l=n(7874),c=n(3887),d=n(7425),f=o.Oh;function v(e,t,n,o){var v=(0,r.T)(f(e),n);if(null==l.Z.ContentDecryptor)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but EME feature not activated"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","EME feature not activated.")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if(0===t.length)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Ciphered media and no keySystem passed"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Media is encrypted and no `keySystems` given")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));if("function"!=typeof s.N)return(0,r.T)(v.pipe((0,i.U)((function(){throw c.Z.error("Init: Encrypted event but no EME API available"),new u.Z("MEDIA_IS_ENCRYPTED_ERROR","Encryption APIs not found.")}))),o.pipe((0,i.U)((function(e){return{type:"decryption-disabled",value:{drmSystemId:void 0,mediaSource:e}}}))));c.Z.debug("Init: Creating ContentDecryptor");var p=l.Z.ContentDecryptor;return new a.y((function(r){var i,a=new p(e,t);a.addEventListener("stateChange",(function(e){e===d.u.WaitingForAttachment&&(a.removeEventListener("stateChange"),i=o.subscribe((function(e){a.addEventListener("stateChange",(function(t){t===d.u.ReadyForContent&&(r.next({type:"decryption-ready",value:{drmSystemId:a.systemId,mediaSource:e}}),a.removeEventListener("stateChange"))})),a.attach()})))})),a.addEventListener("error",(function(e){r.error(e)})),a.addEventListener("warning",(function(e){r.next({type:"warning",value:e})}));var s=n.subscribe((function(e){a.onInitializationData(e)}));return function(){s.unsubscribe(),null==i||i.unsubscribe(),a.dispose()}}))}},342:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(3428),i=n(3074),a=n(2006),o=n(533),s=n(9127),u=n(3071),l=n(3286),c=n(3666).yS,d=n(6872),f=n(3714),v=n(3887),p=n(2829),h=n(288),m=n(8567),g=1/60;function y(e,t,n,f,h){var y,E=h.pipe((0,r.M)(e.getReference().asObservable()),(0,i.R)((function(e,t){return function(e,t,n){for(;e.length>0&&void 0!==e[0].period.end&&e[0].period.end+10<n.position;)e.shift();var r=t.period,i=t.bufferType;if("audio"!==i&&"video"!==i)return e;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return _(t)?e[a]=t:e.splice(a,1),e}else if(e[a].period.start>r.start)return _(t)&&e.splice(a,0,t),e;_(t)&&e.push(t);return e}(e,t[0],t[1])}),[])),S=null,w=null,k=f.pipe((0,r.M)(e.getReference().asObservable()),(0,a.b)((function(t){var r,i=t[0],a=t[1];if(!(!a.rebuffering||a.paused||n.getValue()<=0||"audio"!==i.bufferType&&"video"!==i.bufferType)){var o=a.position,s=null!==(r=a.rebuffering.position)&&void 0!==r?r:o,u=i.period.start;o<u&&Math.abs(s-u)<1&&(v.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),e.setCurrentTime(u+.001))}})),(0,o.l)()),A=new T(e,n),x=e.getReference().asObservable().pipe((0,r.M)(E),(0,s.U)((function(r){var i,a=r[0],o=r[1],s=a.buffered,u=a.position,l=a.readyState,f=a.rebuffering,h=a.freezing,_=d.Z.getCurrent(),T=_.BUFFER_DISCONTINUITY_THRESHOLD,E=_.FORCE_DISCONTINUITY_SEEK_DELAY,k=_.FREEZING_STALLED_DELAY,x=_.UNFREEZING_SEEK_DELAY,I=_.UNFREEZING_DELTA_POSITION;if(!a.seeking&&c&&null===w&&null!==S&&a.position<S){v.Z.debug("Init: the device appeared to have seeked back by itself.");var Z=performance.now();w=Z}if(S=a.seeking?Math.max(null!==(i=a.pendingInternalSeek)&&void 0!==i?i:0,a.position):null,null!==h){var R=performance.now();if(R-(null===y?h.timestamp:y.attemptTimestamp)>x&&(v.Z.warn("Init: trying to seek to un-freeze player"),e.setCurrentTime(e.getCurrentTime()+I),y={attemptTimestamp:R}),R-h.timestamp>k)return null===f||null!==w?A.stopRebuffering():A.startRebuffering(),{type:"stalled",value:"freezing"}}else y=null;if(null===f)return A.stopRebuffering(),1===l?{type:"stalled",value:a.seeking?null!==a.pendingInternalSeek?"internal-seek":"seeking":"not-ready"}:{type:"unstalled",value:null};var M="seeking"===f.reason&&null!==a.pendingInternalSeek?"internal-seek":f.reason;if(null!==w){var C=performance.now();if(C-w<E)return A.stopRebuffering(),v.Z.debug("Init: letting the device get out of a stall by itself"),{type:"stalled",value:M};v.Z.warn("Init: ignored stall for too long, checking discontinuity",C-w)}if(w=null,A.startRebuffering(),null===t)return{type:"stalled",value:M};var P=f.position;if(null!=P&&n.getValue()>0){var D=function(e,t,n){if(0===e.length)return null;for(var r=null,i=0;i<e.length;i++){var a=e[i].period;if(a.start>n)return r;var o=void 0;if(void 0===a.end||a.end>n){var s=e[i],u=s.discontinuity,l=s.position,c=u.start,d=u.end;if(n>=(null!=c?c:l)-g)if(null===d){var f=t.getPeriodAfter(a);null!==f?o=f.start+g:v.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<d+g&&(o=d+g);void 0!==o&&(v.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(o,t,P);if(null!==D){var N=D+.001;if(!(N<=e.getCurrentTime()))return v.Z.warn("SA: skippable discontinuity found in the stream",u,N),e.setCurrentTime(N),m.Z.warning(b(P,N));v.Z.info("Init: position to seek already reached, no seeking",e.getCurrentTime(),N)}}var O=null!=P?P:u,L=(0,p.XS)(s,O);if(n.getValue()>0&&L<T){var B=O+L+g;if(e.getCurrentTime()<B)return v.Z.warn("Init: discontinuity encountered inferior to the threshold",O,B,T),e.setCurrentTime(B),m.Z.warning(b(O,B))}for(var U=t.periods.length-2;U>=0;U--){var F=t.periods[U];if(void 0!==F.end&&F.end<=O){if(t.periods[U+1].start>O&&t.periods[U+1].start>e.getCurrentTime()){var z=t.periods[U+1];return e.setCurrentTime(z.start),m.Z.warning(b(O,z.start))}break}}return{type:"stalled",value:M}})));return(0,u.T)(k,x).pipe((0,l.x)((function(){A.dispose()})))}function _(e){return null!==e.discontinuity}function b(e,t){return new f.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var T=function(){function e(e,t){this._speedUpdateCanceller=new h.ZP,this._isRebuffering=!1,this._playbackObserver=e,this._isDisposed=!1,this._speed=t,this._updateSpeed()}var t=e.prototype;return t.startRebuffering=function(){this._isRebuffering||this._isDisposed||(this._isRebuffering=!0,this._speedUpdateCanceller.cancel(),v.Z.info("Init: Pause playback to build buffer"),this._playbackObserver.setPlaybackRate(0))},t.stopRebuffering=function(){this._isRebuffering&&!this._isDisposed&&(this._isRebuffering=!1,this._speedUpdateCanceller=new h.ZP,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){v.Z.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},2447:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(2401),i=n(7877),a=n(3714),o=n(1946);function s(e){return(0,r.R)(e,"error").pipe((0,i.z)((function(){var t,n,r=e.error;switch((0,o.Z)(r)||(t=r.code,n=r.message),t){case 1:throw n=null!=n?n:"The fetching of the associated resource was aborted by the user's request.",new a.Z("MEDIA_ERR_ABORTED",n);case 2:throw n=null!=n?n:"A network error occurred which prevented the media from being successfully fetched",new a.Z("MEDIA_ERR_NETWORK",n);case 3:throw n=null!=n?n:"An error occurred while trying to decode the media resource",new a.Z("MEDIA_ERR_DECODE",n);case 4:throw n=null!=n?n:"The media resource has been found to be unsuitable.",new a.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",n);default:throw n=null!=n?n:"The HTMLMediaElement errored due to an unknown reason.",new a.Z("MEDIA_ERR_UNKNOWN",n)}})))}},7127:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(4578),i=n(3887),a=n(9612),o=n(4309),s=function(e){function t(){var t;return i.Z.debug("ISB: Creating ImageSegmentBuffer"),(t=e.call(this)||this).bufferType="image",t._buffered=new o.Z,t}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t,n;if(i.Z.debug("ISB: appending new data."),null===e.data.chunk)return Promise.resolve();var r=e.data,a=r.appendWindow,o=r.chunk,s=o.start,u=o.end,l=o.timescale,c=null!==(t=a[0])&&void 0!==t?t:0,d=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(c,f),h=Math.min(d,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return i.Z.info("ISB: ignored image data remove order",e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){i.Z.debug("ISB: disposing image SegmentBuffer"),this._buffered.remove(0,1/0)},t}(a.C)},5192:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(4578),i=n(1381),a=n(3887),o=n(5095),s=n(2203).Z?void 0:window.ResizeObserver;var u=n(6872),l=n(288),c=n(9612),d=n(4309),f=n(7874);function v(e,t){return Math.abs(e-t)<=.2}function p(e,t){for(var n=e.length-1;n>=0;n--){if(e[n].start<t)return e.slice(0,n+1)}return[]}function h(e,t){for(var n=0;n<e.length;n++){if(e[n].end>t)return e.slice(n,e.length)}return[]}function m(e,t,n){var r=Math.max(e.start,t),i=p(e.cues,t),a={start:e.start,end:r,cues:i},o=Math.min(n,e.end),s=h(e.cues,n);return[a,{start:o,end:e.end,cues:s}]}var g=function(){function e(){this._cuesBuffer=[]}var t=e.prototype;return t.get=function(e){for(var t=this._cuesBuffer,n=[],r=t.length-1;r>=0;r--){var i=t[r];if(e<i.end&&e>=i.start){for(var a=i.cues,o=0;o<a.length;o++)e>=a[o].start&&e<a[o].end&&n.push(a[o].element);return n}}return[]},t.remove=function(e,t){for(var n=Math.max(e,t),r=this._cuesBuffer,i=0;i<r.length;i++)if(r[i].end>e){var a=r[i];if(a.start>=n)return;if(a.end>=n){if(e<=a.start)a.cues=h(a.cues,n),a.start=n;else{var o=m(a,e,n),s=o[0],u=o[1];this._cuesBuffer[i]=s,r.splice(i+1,0,u)}return}a.start>=e?(r.splice(i,1),i--):(a.cues=p(a.cues,e),a.end=Math.max(e,a.start))}},t.insert=function(e,t,n){var r=this._cuesBuffer,i={start:t,end:n,cues:e};function a(e){var t=r[e];void 0===t||v(i.end,t.end)?r[e]=i:(t.start>=i.end||(t.cues=h(t.cues,i.end),t.start=i.end),r.splice(e,0,i))}for(var o=0;o<r.length;o++){var s=r[o];if(t<s.end){if(v(t,s.start)){if(v(n,s.end))return void(r[o]=i);if(n<s.end)return s.cues=h(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(t<s.start){if(n<s.start)return void r.splice(o,0,i);if(v(n,s.start))return s.start=n,void r.splice(o,0,i);if(v(n,s.end))return void r.splice(o,1,i);if(n<s.end)return s.cues=h(s.cues,n),s.start=n,void r.splice(o,0,i);do{r.splice(o,1),s=r[o]}while(void 0!==s&&n>s.end);return void a(o)}if(v(s.end,n))return s.cues=p(s.cues,t),s.end=t,void r.splice(o+1,0,i);if(s.end>n){var u=m(s,t,n),l=u[0],c=u[1];return this._cuesBuffer[o]=l,r.splice(o+1,0,i),void r.splice(o+2,0,c)}s.cues=p(s.cues,t),s.end=t;var d=o+1;for(s=r[d];void 0!==s&&n>s.end;)r.splice(d,1),s=r[d];return void a(d)}}r.push(i)},e}();function y(e,t,n,r){for(var i=[t/n.columns,e/n.rows],a=r.getElementsByClassName("proportional-style"),o=0;o<a.length;o++){var s=a[o];if(s instanceof HTMLElement){var u=s.getAttribute("data-proportional-font-size");null===u||isNaN(+u)||(s.style.fontSize=String(+u*i[1])+"px");var l=s.getAttribute("data-proportional-width");null===l||isNaN(+l)||(s.style.width=String(+l*i[0])+"px");var c=s.getAttribute("data-proportional-height");null===c||isNaN(+c)||(s.style.height=String(+c*i[1])+"px");var d=s.getAttribute("data-proportional-line-height");null===d||isNaN(+d)||(s.style.lineHeight=String(+d*i[1])+"px");var f=s.getAttribute("data-proportional-left");null===f||isNaN(+f)||(s.style.left=String(+f*i[0])+"px");var v=s.getAttribute("data-proportional-top");null===v||isNaN(+v)||(s.style.top=String(+v*i[1])+"px");var p=s.getAttribute("data-proportional-padding-top");null===p||isNaN(+p)||(s.style.paddingTop=String(+p*i[1])+"px");var h=s.getAttribute("data-proportional-padding-bottom");null===h||isNaN(+h)||(s.style.paddingBottom=String(+h*i[1])+"px");var m=s.getAttribute("data-proportional-padding-left");null===m||isNaN(+m)||(s.style.paddingLeft=String(+m*i[0])+"px");var g=s.getAttribute("data-proportional-padding-right");null===g||isNaN(+g)||(s.style.paddingRight=String(+g*i[0])+"px")}}return a.length>0}var _=i.M4,b=i.bQ,T=i.Q$;function E(e,t){try{e.removeChild(t)}catch(e){a.Z.warn("HTSB: Can't remove text track: not in the element.")}}function S(e){var t=e.getAttribute("data-resolution-rows"),n=e.getAttribute("data-resolution-columns");if(null===t||null===n)return null;var r=parseInt(t,10),i=parseInt(n,10);return null===r||null===i?null:{rows:r,columns:i}}var w=function(e){function t(t,n){var r;return a.Z.debug("HTSB: Creating HTMLTextSegmentBuffer"),(r=e.call(this)||this).bufferType="text",r._buffered=new d.Z,r._videoElement=t,r._textTrackElement=n,r._sizeUpdateCanceller=new l.ZP,r._canceller=new l.ZP,r._buffer=new g,r._currentCues=[],r.autoRefreshSubtitles(r._canceller.signal),r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){try{this.pushChunkSync(e)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this.removeBufferSync(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.Z.debug("HTSB: Disposing HTMLTextSegmentBuffer"),this._disableCurrentCues(),this._buffer.remove(0,1/0),this._buffered.remove(0,1/0),this._canceller.cancel()},n.pushChunkSync=function(e){var t,n;a.Z.debug("HTSB: Appending new html text tracks");var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk;if(null!==s){var u,l,c=s.start,d=s.end,v=s.data,p=s.type,h=s.language,m=null!==(t=o[0])&&void 0!==t?t:0,g=null!==(n=o[1])&&void 0!==n?n:1/0,y=function(e,t,n,r){a.Z.debug("HTSB: Finding parser for html text tracks:",e);var i=f.Z.htmlTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.Z.debug("HTSB: Parser found, parsing...");var o=i(t,n,r);return a.Z.debug("HTTB: Parsed successfully!",o.length),o}(p,v,i,h);if(0!==m&&g!==1/0){for(var _=0;_<y.length&&y[_].end<=m;)_++;for(y.splice(0,_),_=0;_<y.length&&y[_].start<m;)y[_].start=m,_++;for(_=y.length-1;_>=0&&y[_].start>=g;)_--;for(y.splice(_,y.length),_=y.length-1;_>=0&&y[_].end>g;)y[_].end=g,_--}if(void 0!==c)u=Math.max(m,c);else{if(y.length<=0)return void a.Z.warn("HTSB: Current text tracks have no cues nor start time. Aborting");a.Z.warn("HTSB: No start time given. Guessing from cues."),u=y[0].start}if(void 0!==d)l=Math.min(g,d);else{if(y.length<=0)return void a.Z.warn("HTSB: Current text tracks have no cues nor end time. Aborting");a.Z.warn("HTSB: No end time given. Guessing from cues."),l=y[y.length-1].end}l<=u?a.Z.warn("HTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."):(null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos),this._buffer.insert(y,u,l),this._buffered.insert(u,l))}},n.removeBufferSync=function(e,t){a.Z.debug("HTSB: Removing html text track data",e,t),this._buffer.remove(e,t),this._buffered.remove(e,t)},n._disableCurrentCues=function(){if(this._sizeUpdateCanceller.cancel(),this._currentCues.length>0){for(var e=0;e<this._currentCues.length;e++)E(this._textTrackElement,this._currentCues[e].element);this._currentCues=[]}},n._displayCues=function(e){if(!(this._currentCues.length===e.length&&this._currentCues.every((function(t,n){return t.element===e[n]})))){this._sizeUpdateCanceller.cancel();for(var t=0;t<this._currentCues.length;t++)E(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=S(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var c=this._currentCues.filter((function(e){return null!==e.resolution}));if(c.length>0){this._sizeUpdateCanceller=new l.ZP({cancelOn:this._canceller.signal});var d=u.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=(0,o.ZP)({height:i,width:u}),c=i,d=u;if(void 0!==s){var f=new s((function(e){if(0!==e.length){var t=e[0].contentRect,n=t.height,r=t.width;n===c&&r===d||(c=n,d=r,l.setValue({height:n,width:r}))}else a.Z.error("Compat: Resized but no observed element.")}));f.observe(e),n.register((function(){f.disconnect()}))}else{var v=setInterval((function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;n===c&&r===d||(c=n,d=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,d,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<c.length;r++){var i=c[r];y(t,n,i.resolution,i.element)}}),{clearSignal:this._sizeUpdateCanceller.signal,emitCurrentValue:!0})}}},n.autoRefreshSubtitles=function(e){var t=this,n=null,r=u.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL,i=function(){a(),n=new l.ZP({cancelOn:e});var i=setInterval((function(){return t.refreshSubtitles()}),r);n.signal.register((function(){clearInterval(i)})),t.refreshSubtitles()};function a(){null!==n&&(n.cancel(),n=null)}T(this._videoElement,(function(){a(),t._disableCurrentCues()}),e),b(this._videoElement,i,e),_(this._videoElement,i,e),i()},n.refreshSubtitles=function(){var e,t=u.Z.getCurrent().MAXIMUM_HTML_TEXT_TRACK_UPDATE_INTERVAL;e=this._videoElement.paused||this._videoElement.playbackRate<=0?this._videoElement.currentTime:Math.max(this._videoElement.currentTime+t/1e3/2,0);var n=this._buffer.get(e);0===n.length?this._disableCurrentCues():this._displayCues(n)},t}(c.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(4578),i=n(3666);var a=n(3887);function o(e,t){if(i.vU&&function(e,t){var n=e.activeCues;if(null===n)return!1;for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1}(e,t)){var n=e.mode;e.mode="hidden";try{e.removeCue(t)}catch(e){a.Z.warn("Compat: Could not remove cue from text track.")}e.mode=n}else try{e.removeCue(t)}catch(e){a.Z.warn("Compat: Could not remove cue from text track.")}}var s=n(9612),u=n(4309),l=n(7874);var c=function(e){function t(t,n){var r;a.Z.debug("NTSB: Creating NativeTextSegmentBuffer"),r=e.call(this)||this;var o=function(e,t){var n,r,a,o,s="subtitles";if(i.YM){var u=e.textTracks.length;(a=u>0?e.textTracks[u-1]:e.addTextTrack(s)).mode=t?null!==(n=a.HIDDEN)&&void 0!==n?n:"hidden":null!==(r=a.SHOWING)&&void 0!==r?r:"showing"}else o=document.createElement("track"),e.appendChild(o),a=o.track,o.kind=s,a.mode=t?"hidden":"showing";return{track:a,trackElement:o}}(t,n),s=o.track,l=o.trackElement;return r.bufferType="text",r._buffered=new u.Z,r._videoElement=t,r._track=s,r._trackElement=l,r}(0,r.Z)(t,e);var n=t.prototype;return n.pushChunk=function(e){var t,n;if(a.Z.debug("NTSB: Appending new native text tracks"),null===e.data.chunk)return Promise.resolve();var r=e.data,i=r.timestampOffset,o=r.appendWindow,s=r.chunk,u=s.start,c=s.end,d=s.data,f=s.type,v=s.language,p=null!==(t=o[0])&&void 0!==t?t:0,h=null!==(n=o[1])&&void 0!==n?n:1/0;try{var m,g,y=function(e,t,n,r){a.Z.debug("NTSB: Finding parser for native text tracks:",e);var i=l.Z.nativeTextTracksParsers[e];if("function"!=typeof i)throw new Error("no parser found for the given text track");a.Z.debug("NTSB: Parser found, parsing...");var o=i(t,n,r);return a.Z.debug("NTSB: Parsed successfully!",o.length),o}(f,d,i,v);if(0!==p&&h!==1/0){for(var _=0;_<y.length&&y[_].endTime<=p;)_++;for(y.splice(0,_),_=0;_<y.length&&y[_].startTime<p;)y[_].startTime=p,_++;for(_=y.length-1;_>=0&&y[_].startTime>=h;)_--;for(y.splice(_,y.length),_=y.length-1;_>=0&&y[_].endTime>h;)y[_].endTime=h,_--}if(void 0!==u)m=Math.max(p,u);else{if(y.length<=0)return a.Z.warn("NTSB: Current text tracks have no cues nor start time. Aborting"),Promise.resolve();a.Z.warn("NTSB: No start time given. Guessing from cues."),m=y[0].startTime}if(void 0!==c)g=Math.min(h,c);else{if(y.length<=0)return a.Z.warn("NTSB: Current text tracks have no cues nor end time. Aborting"),Promise.resolve();a.Z.warn("NTSB: No end time given. Guessing from cues."),g=y[y.length-1].endTime}if(g<=m)return a.Z.warn("NTSB: Invalid text track appended: ","the start time is inferior or equal to the end time."),Promise.resolve();if(y.length>0){var b=y[0],T=this._track.cues;null!==T&&T.length>0&&b.startTime<T[T.length-1].startTime&&this._removeData(b.startTime,1/0);for(var E=0;E<y.length;E++)this._track.addCue(y[E])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos)}catch(e){return Promise.reject(e)}return Promise.resolve()},n.removeBuffer=function(e,t){return this._removeData(e,t),Promise.resolve()},n.endOfSegment=function(e){return this._segmentInventory.completeSegment(e,this._buffered),Promise.resolve()},n.getBufferedRanges=function(){return this._buffered},n.dispose=function(){a.Z.debug("NTSB: Aborting NativeTextSegmentBuffer"),this._removeData(0,1/0);var e=this._trackElement,t=this._videoElement;if(void 0!==e&&t.hasChildNodes())try{t.removeChild(e)}catch(e){a.Z.warn("NTSB: Can't remove track element from the video")}this._track.mode="disabled",void 0!==this._trackElement&&(this._trackElement.innerHTML="")},n._removeData=function(e,t){a.Z.debug("NTSB: Removing native text track data",e,t);var n=this._track,r=n.cues;if(null!==r)for(var i=r.length-1;i>=0;i--){var s=r[i],u=s.startTime,l=s.endTime;u>=e&&u<=t&&l<=t&&o(n,s)}this._buffered.remove(e,t)},t}(s.C)},9612:function(e,t,n){"use strict";n.d(t,{C:function(){return _},f:function(){return g}});var r=n(6872),i=n(3887),a=n(520),o=n(5278);function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(){function e(e,t){this._history=[],this._lifetime=e,this._maxHistoryLength=t}var t=e.prototype;return t.addBufferedSegment=function(e,t){var n=performance.now();this._history.push({date:n,buffered:t,context:e}),this._cleanHistory(n)},t.getHistoryFor=function(e){return this._history.filter((function(t){return(0,a.z)(t.context,e)}))},t._cleanHistory=function(e){for(var t,n=e-this._lifetime,r=0,i=s(this._history);!(t=i()).done;){if(!(t.value.date<n))break;r++}if(r>0&&(this._history=this._history.splice(r)),this._history.length>this._maxHistoryLength){var a=this._history.length-this._maxHistoryLength;this._history=this._history.splice(a)}},e}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(){var e=r.Z.getCurrent(),t=e.BUFFERED_HISTORY_RETENTION_TIME,n=e.BUFFERED_HISTORY_MAXIMUM_ENTRIES;this._inventory=[],this._bufferedHistory=new l(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e){for(var t=this._inventory,n=0,a=t[0],s=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,u=null==a?void 0:a.infos.adaptation.type,l=e.length,d=0;d<l;d++){if(void 0===a)return;var f=e.start(d),v=e.end(d);if(v-f<s)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",u,f,v);else{for(var p=n;void 0!==a&&(0,o.Z)(a.bufferedEnd,a.end)-f<s;)a=t[++n];var g=null,y=n-p;if(y>0){var _=t[p+y-1];g={end:(0,o.Z)(_.bufferedEnd,_.end),precizeEnd:_.precizeEnd},i.Z.debug("SI: "+y+" segments GCed.",u);for(var b,T=c(t.splice(p,y));!(b=T()).done;){var E=b.value;void 0===E.bufferedStart&&void 0===E.bufferedEnd&&this._bufferedHistory.addBufferedSegment(E.infos,null)}n=p}if(void 0===a)return;if(v-(0,o.Z)(a.bufferedStart,a.start)>=s){if(h(a,f,g,u),n===t.length-1)return void m(a,v,u);a=t[++n];for(var S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end),k=d<l-1?e.start(d+1):void 0;void 0!==a&&v-S>=s&&(void 0===k||v-S>=w-k);){var A=t[n-1];void 0===A.bufferedEnd&&(A.bufferedEnd=a.precizeStart?a.start:A.end,i.Z.debug("SI: calculating buffered end of contiguous segment",u,A.bufferedEnd,A.end)),a.bufferedStart=A.bufferedEnd,void 0!==(a=t[++n])&&(S=(0,o.Z)(a.bufferedStart,a.start),w=(0,o.Z)(a.bufferedEnd,a.end))}}var x=t[n-1];void 0!==x&&m(x,v,u)}}if(null!=a){i.Z.debug("SI: last segments have been GCed",u,n,t.length);for(var I,Z=c(t.splice(n,t.length-n));!(I=Z()).done;){var R=I.value;void 0===R.bufferedStart&&void 0===R.bufferedEnd&&this._bufferedHistory.addBufferedSegment(R.infos,null)}}void 0!==u&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+u+" inventory timeline:\n"+function(e){var t=1/60,n={},r=[],i=null,a=null;function o(e){var t=String.fromCharCode(r.length+65);return r.push({letter:t,periodId:e.period.id,representationId:e.representation.id,bitrate:e.representation.bitrate}),t}for(var s="",u=0;u<e.length;u++){var l=e[u];if(void 0!==l.bufferedStart&&void 0!==l.bufferedEnd){var c,d=l.infos.period.id,f=l.infos.representation.id,v=n[d],p=void 0;if(void 0===v)p=o(l.infos),n[d]=((c={})[f]=p,c);else void 0===v[f]?(p=o(l.infos),v[f]=p):p=v[f];null===i?s+=l.bufferedStart.toFixed(2)+"|"+p+"|":a===p?i.bufferedEnd+t<l.bufferedStart&&(s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|"):s+=i.bufferedEnd.toFixed(2)+" ~ "+l.bufferedStart.toFixed(2)+"|"+p+"|",i=l,a=p}}null!==i&&(s+=String(i.end.toFixed(2)));return r.forEach((function(e){var t;s+="\n["+e.letter+"] P: "+e.periodId+" || R: "+e.representationId+"("+(null!==(t=e.bitrate)&&void 0!==t?t:"unknown bitrate")+")"})),s}(this._inventory))},t.insertChunk=function(e){var t=e.period,n=e.adaptation,r=e.representation,a=e.segment,o=e.chunkSize,s=e.start,u=e.end;if(!a.isInit){var l=n.type;if(s>=u)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",l,s,u);else{for(var c=this._inventory,d={partiallyPushed:!0,chunkSize:o,splitted:!1,start:s,end:u,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:a,period:t,adaptation:n,representation:r}},f=c.length-1;f>=0;f--){var v=c[f];if(v.start<=s){if(v.end<=s){for(i.Z.debug("SI: Pushing segment strictly after previous one.",l,s,v.end),this._inventory.splice(f+1,0,d),f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}if(v.start===s){if(v.end<=u){for(i.Z.debug("SI: Segment pushed replace another one",l,s,u,v.end),this._inventory.splice(f,1,d),f+=1;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",l,s,u,v.end),c.splice(f,0,d),v.start=d.end,v.bufferedStart=void 0,void(v.precizeStart=v.precizeStart&&d.precizeEnd)}if(v.end<=d.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",l,s,u,v.start,v.end),this._inventory.splice(f+1,0,d),v.end=d.start,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,f+=2;f<c.length&&c[f].start<d.end;){if(c[f].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[f].start),c[f].start=d.end,c[f].bufferedStart=void 0,void(c[f].precizeStart=c[f].precizeStart&&d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[f].start,c[f].end),c.splice(f,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",l,s,u,v.start,v.end);var p={partiallyPushed:v.partiallyPushed,chunkSize:v.chunkSize,splitted:!0,start:d.end,end:v.end,precizeStart:v.precizeStart&&v.precizeEnd&&d.precizeEnd,precizeEnd:v.precizeEnd,bufferedStart:void 0,bufferedEnd:v.end,infos:v.infos};return v.end=d.start,v.splitted=!0,v.bufferedEnd=void 0,v.precizeEnd=v.precizeEnd&&d.precizeStart,c.splice(f+1,0,d),void c.splice(f+2,0,p)}}var h=this._inventory[0];if(void 0===h)return i.Z.debug("SI: first segment pushed",l,s,u),void this._inventory.push(d);if(!(h.start>=u)){if(h.end<=u){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",l,s,u,h.start,h.end),this._inventory.splice(0,1,d);c.length>1&&c[1].start<d.end;){if(c[1].end>d.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",l,d.end,c[1].start),c[1].start=d.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=d.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",l,s,u,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",l,s,u,h.start,h.end),h.start=u,h.bufferedStart=void 0,h.precizeStart=d.precizeEnd,void this._inventory.splice(0,0,d)}i.Z.debug("SI: Segment pushed comes before all previous ones",l,s,u,h.start),this._inventory.splice(0,0,d)}}},t.completeSegment=function(e,t){if(!e.segment.isInit){for(var n=this._inventory,r=[],o=0;o<n.length;o++)if((0,a.z)(n[o].infos,e)){var s=!1;r.length>0&&(s=!0,1===r.length&&(i.Z.warn("SI: Completed Segment is splitted.",e.segment.id,e.segment.time,e.segment.end),r[0].splitted=!0));var u=o,l=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var d=n[o].chunkSize;void 0!==l&&void 0!==d&&(l+=d),o++}var f=o-1,v=f-u,p=n[f].end,h=n[f].bufferedEnd;v>0&&(this._inventory.splice(u+1,v),o-=v),this._inventory[u].partiallyPushed=!1,this._inventory[u].chunkSize=l,this._inventory[u].end=p,this._inventory[u].bufferedEnd=h,this._inventory[u].splitted=s,r.push(this._inventory[u])}if(0===r.length)i.Z.warn("SI: Completed Segment not found",e.segment.id,e.segment.time);else{this.synchronizeBuffered(t);for(var m,g=c(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?this._bufferedHistory.addBufferedSegment(y.infos,{start:y.bufferedStart,end:y.bufferedEnd}):i.Z.debug("SI: buffered range not known after sync. Skipping history.",y.start,y.end)}}}},t.getInventory=function(){return this._inventory},t.getHistoryFor=function(e){return this._bufferedHistory.getHistoryFor(e)},e}();function v(e){if(void 0===e.bufferedStart||e.partiallyPushed)return!1;var t=e.start,n=e.end-t,i=r.Z.getCurrent(),a=i.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,o=i.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(t-e.bufferedStart)<=a&&(void 0===e.bufferedEnd||e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-n)<=Math.min(o,n/3))}function p(e){if(void 0===e.bufferedEnd||e.partiallyPushed)return!1;var t=e.start,n=e.end,i=n-t,a=r.Z.getCurrent(),o=a.MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE,s=a.MAX_MANIFEST_BUFFERED_DURATION_DIFFERENCE;return Math.abs(n-e.bufferedEnd)<=o&&null!=e.bufferedStart&&e.bufferedEnd>e.bufferedStart&&Math.abs(e.bufferedEnd-e.bufferedStart-i)<=Math.min(s,i/3)}function h(e,t,n,a){var o=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedStart?(e.bufferedStart<t&&(i.Z.debug("SI: Segment partially GCed at the start",a,e.bufferedStart,t),e.bufferedStart=t),!e.precizeStart&&v(e)&&(e.start=e.bufferedStart,e.precizeStart=!0)):e.precizeStart?(i.Z.debug("SI: buffered start is precize start",a,e.start),e.bufferedStart=e.start):null!==n&&n.end>t&&(n.precizeEnd||e.start-n.end<=o)?(i.Z.debug("SI: buffered start is end of previous segment",a,t,e.start,n.end),e.bufferedStart=n.end,v(e)&&(e.start=n.end,e.precizeStart=!0)):e.start-t<=o?(i.Z.debug("SI: found true buffered start",a,t,e.start),e.bufferedStart=t,v(e)&&(e.start=t,e.precizeStart=!0)):t<e.start?i.Z.debug("SI: range start too far from expected start",a,t,e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function m(e,t,n){var a=r.Z.getCurrent().MAX_MANIFEST_BUFFERED_START_END_DIFFERENCE;void 0!==e.bufferedEnd?(e.bufferedEnd>t&&(i.Z.debug("SI: Segment partially GCed at the end",n,e.bufferedEnd,t),e.bufferedEnd=t),!e.precizeEnd&&t-e.end<=a&&p(e)&&(e.precizeEnd=!0,e.end=t)):e.precizeEnd?(i.Z.debug("SI: buffered end is precize end",n,e.end),e.bufferedEnd=e.end):t-e.end<=a?(i.Z.debug("SI: found true buffered end",n,t,e.end),e.bufferedEnd=t,p(e)&&(e.end=t,e.precizeEnd=!0)):t>e.end?(i.Z.debug("SI: range end too far from expected end",n,t,e.end),e.bufferedEnd=e.end):(i.Z.debug("SI: Segment appears immediately garbage collected at the end",n,e.bufferedEnd,t),e.bufferedEnd=t)}var g,y=f,_=function(){function e(){this._segmentInventory=new y}var t=e.prototype;return t.synchronizeInventory=function(){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges())},t.getInventory=function(){return this._segmentInventory.getInventory()},t.getPendingOperations=function(){return[]},t.getSegmentHistory=function(e){return this._segmentInventory.getHistoryFor(e)},e}();!function(e){e[e.Push=0]="Push",e[e.Remove=1]="Remove",e[e.EndOfSegment=2]="EndOfSegment"}(g||(g={}))},4309:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2829),i=function(){function e(){this._ranges=[],this.length=0}var t=e.prototype;return t.insert=function(e,t){(0,r.kR)(this._ranges,{start:e,end:t}),this.length=this._ranges.length},t.remove=function(e,t){var n=[];e>0&&n.push({start:0,end:e}),t<1/0&&n.push({start:t,end:1/0}),this._ranges=(0,r.tn)(this._ranges,n),this.length=this._ranges.length},t.start=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].start},t.end=function(e){if(e>=this._ranges.length)throw new Error("INDEX_SIZE_ERROR");return this._ranges[e].end},e}()},8567:function(e,t,n){"use strict";var r=n(8026),i={activePeriodChanged:function(e){return{type:"activePeriodChanged",value:{period:e}}},adaptationChange:function(e,t,n){return{type:"adaptationChange",value:{type:e,adaptation:t,period:n}}},addedSegment:function(e,t,n,r){return{type:"added-segment",value:{content:e,segment:t,segmentData:r,buffered:n}}},bitrateEstimationChange:function(e,t){return{type:"bitrateEstimationChange",value:{type:e,bitrate:t}}},streamComplete:function(e){return{type:"complete-stream",value:{type:e}}},endOfStream:function(){return{type:"end-of-stream",value:void 0}},needsManifestRefresh:function(){return{type:"needs-manifest-refresh",value:void 0}},manifestMightBeOufOfSync:function(){return{type:"manifest-might-be-out-of-sync",value:void 0}},needsMediaSourceReload:function(e,t){return{type:"needs-media-source-reload",value:{position:e,autoPlay:t}}},lockedStream:function(e,t){return{type:"locked-stream",value:{bufferType:e,period:t}}},needsBufferFlush:function(){return{type:"needs-buffer-flush",value:void 0}},needsDecipherabilityFlush:function(e,t,n){return{type:"needs-decipherability-flush",value:{position:e,autoPlay:t,duration:n}}},periodStreamReady:function(e,t,n){return{type:"periodStreamReady",value:{type:e,period:t,adaptation$:n}}},periodStreamCleared:function(e,t){return{type:"periodStreamCleared",value:{type:e,period:t}}},encryptionDataEncountered:function(e,t){return{type:"encryption-data-encountered",value:(0,r.Z)({content:t},e)}},representationChange:function(e,t,n){return{type:"representationChange",value:{type:e,period:t,representation:n}}},streamTerminating:function(){return{type:"stream-terminating",value:void 0}},resumeStream:function(){return{type:"resume-stream",value:void 0}},warning:function(e){return{type:"warning",value:e}},waitingMediaSourceReload:function(e,t,n,r){return{type:"waiting-media-source-reload",value:{bufferType:e,period:t,position:n,autoPlay:r}}}};t.Z=i},7839:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="CustomLoaderError",s.message=n,s.canRetry=i,s.isOfflineError=a,s.xhr=o,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},5157:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i,a){var u;return u=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(u),t.prototype),u.name="EncryptedMediaError",u.type=o.ZB.ENCRYPTED_MEDIA_ERROR,u.code=n,u.message=(0,s.Z)(u.name,u.code,i),u.fatal=!1,"string"==typeof(null==a?void 0:a.keyStatuses)&&(u.keyStatuses=a.keyStatuses),u}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},5992:function(e,t,n){"use strict";n.d(t,{SM:function(){return a},ZB:function(){return r},br:function(){return i}});var r={NETWORK_ERROR:"NETWORK_ERROR",MEDIA_ERROR:"MEDIA_ERROR",ENCRYPTED_MEDIA_ERROR:"ENCRYPTED_MEDIA_ERROR",OTHER_ERROR:"OTHER_ERROR"},i={TIMEOUT:"TIMEOUT",ERROR_EVENT:"ERROR_EVENT",ERROR_HTTP_CODE:"ERROR_HTTP_CODE",PARSE_ERROR:"PARSE_ERROR"},a={PIPELINE_LOAD_ERROR:"PIPELINE_LOAD_ERROR",PIPELINE_PARSE_ERROR:"PIPELINE_PARSE_ERROR",INTEGRITY_ERROR:"INTEGRITY_ERROR",MANIFEST_PARSE_ERROR:"MANIFEST_PARSE_ERROR",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"MANIFEST_INCOMPATIBLE_CODECS_ERROR",MANIFEST_UPDATE_ERROR:"MANIFEST_UPDATE_ERROR",MANIFEST_UNSUPPORTED_ADAPTATION_TYPE:"MANIFEST_UNSUPPORTED_ADAPTATION_TYPE",MEDIA_STARTING_TIME_NOT_FOUND:"MEDIA_STARTING_TIME_NOT_FOUND",MEDIA_TIME_BEFORE_MANIFEST:"MEDIA_TIME_BEFORE_MANIFEST",MEDIA_TIME_AFTER_MANIFEST:"MEDIA_TIME_AFTER_MANIFEST",MEDIA_TIME_NOT_FOUND:"MEDIA_TIME_NOT_FOUND",NO_PLAYABLE_REPRESENTATION:"NO_PLAYABLE_REPRESENTATION",MEDIA_IS_ENCRYPTED_ERROR:"MEDIA_IS_ENCRYPTED_ERROR",CREATE_MEDIA_KEYS_ERROR:"CREATE_MEDIA_KEYS_ERROR",KEY_ERROR:"KEY_ERROR",KEY_STATUS_CHANGE_ERROR:"KEY_STATUS_CHANGE_ERROR",KEY_UPDATE_ERROR:"KEY_UPDATE_ERROR",KEY_LOAD_ERROR:"KEY_LOAD_ERROR",KEY_LOAD_TIMEOUT:"KEY_LOAD_TIMEOUT",KEY_GENERATE_REQUEST_ERROR:"KEY_GENERATE_REQUEST_ERROR",INCOMPATIBLE_KEYSYSTEMS:"INCOMPATIBLE_KEYSYSTEMS",INVALID_ENCRYPTED_EVENT:"INVALID_ENCRYPTED_EVENT",INVALID_KEY_SYSTEM:"INVALID_KEY_SYSTEM",LICENSE_SERVER_CERTIFICATE_ERROR:"LICENSE_SERVER_CERTIFICATE_ERROR",MULTIPLE_SESSIONS_SAME_INIT_DATA:"MULTIPLE_SESSIONS_SAME_INIT_DATA",BUFFER_APPEND_ERROR:"BUFFER_APPEND_ERROR",BUFFER_FULL_ERROR:"BUFFER_FULL_ERROR",BUFFER_TYPE_UNKNOWN:"BUFFER_TYPE_UNKNOWN",MEDIA_ERR_BLOCKED_AUTOPLAY:"MEDIA_ERR_BLOCKED_AUTOPLAY",MEDIA_ERR_PLAY_NOT_ALLOWED:"MEDIA_ERR_PLAY_NOT_ALLOWED",MEDIA_ERR_NOT_LOADED_METADATA:"MEDIA_ERR_NOT_LOADED_METADATA",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_UNKNOWN:"MEDIA_ERR_UNKNOWN",MEDIA_SOURCE_NOT_SUPPORTED:"MEDIA_SOURCE_NOT_SUPPORTED",MEDIA_KEYS_NOT_SUPPORTED:"MEDIA_KEYS_NOT_SUPPORTED",DISCONTINUITY_ENCOUNTERED:"DISCONTINUITY_ENCOUNTERED",NONE:"NONE"}},7367:function(e,t,n){"use strict";function r(e,t,n){return e+" ("+t+") "+n}n.d(t,{Z:function(){return r}})},8750:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9822),i=n(5389);function a(e,t){var n=t.defaultCode,a=t.defaultReason;if((0,r.Z)(e))return e;var o=e instanceof Error?e.toString():a;return new i.Z(n,o)}},9822:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5157),i=n(5992),a=n(3714),o=n(9362),s=n(5389);function u(e){return(e instanceof r.Z||e instanceof a.Z||e instanceof s.Z||e instanceof o.Z)&&Object.keys(i.ZB).indexOf(e.type)>=0}},3714:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="MediaError",a.type=o.ZB.MEDIA_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9362:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="NetworkError",a.type=o.ZB.NETWORK_ERROR,a.xhr=void 0===i.xhr?null:i.xhr,a.url=i.url,a.status=i.status,a.errorType=i.type,a.code=n,a.message=(0,s.Z)(a.name,a.code,i.message),a.fatal=!1,a}return(0,i.Z)(t,e),t.prototype.isHttpError=function(e){return this.errorType===o.br.ERROR_HTTP_CODE&&this.status===e},t}((0,a.Z)(Error))},5389:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(5992),s=n(7367),u=function(e){function t(n,i){var a;return a=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(a),t.prototype),a.name="OtherError",a.type=o.ZB.OTHER_ERROR,a.code=n,a.message=(0,s.Z)(a.name,a.code,i),a.fatal=!1,a}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},9105:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7326),i=n(4578),a=function(e){function t(n,i,a,o){var s;return s=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(s),t.prototype),s.name="RequestError",s.url=n,void 0!==o&&(s.xhr=o),s.status=i,s.type=a,s.message=a,s}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error))},7273:function(e,t){"use strict";t.Z={dashParsers:{wasm:null,js:null},directfile:null,ContentDecryptor:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,nativeTextTracksBuffer:null,nativeTextTracksParsers:{},transports:{}}},7874:function(e,t,n){"use strict";var r=n(7273);t.Z=r.Z},3887:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8894),i=new(function(){function e(){this.error=r.Z,this.warn=r.Z,this.info=r.Z,this.debug=r.Z,this._levels={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},this._currentLevel="NONE"}var t=e.prototype;return t.setLevel=function(e){var t,n=this._levels[e];"number"==typeof n?(t=n,this._currentLevel=e):(t=0,this._currentLevel="NONE"),this.error=t>=this._levels.ERROR?console.error.bind(console):r.Z,this.warn=t>=this._levels.WARNING?console.warn.bind(console):r.Z,this.info=t>=this._levels.INFO?console.info.bind(console):r.Z,this.debug=t>=this._levels.DEBUG?console.log.bind(console):r.Z},t.getLevel=function(){return this._currentLevel},t.hasLevel=function(e){return this._levels[e]>=this._levels[this._currentLevel]},e}())},8999:function(e,t,n){"use strict";n.d(t,{r:function(){return v},Z:function(){return p}});var r=n(3274),i=n(1946),a=n(7829);var o="undefined"!=typeof window&&"function"==typeof window.Set&&"function"==typeof Array.from?function(e){return Array.from(new Set(e))}:function(e){return e.filter((function(e,t,n){return n.indexOf(e)===t}))},s=n(3774);var u=n(3887),l=n(4791);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=function(){function e(e,t){var n;this.id=e.id,this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width),void 0!==e.mimeType&&(this.mimeType=e.mimeType),void 0!==e.contentProtections&&(this.contentProtections=e.contentProtections),void 0!==e.frameRate&&(this.frameRate=e.frameRate),void 0!==e.hdrInfo&&(this.hdrInfo=e.hdrInfo),this.cdnMetadata=e.cdnMetadata,this.index=e.index,this.isSupported="audio"!==t.type&&"video"!==t.type||(n=this.getMimeTypeString(),null!=s.J&&("function"!=typeof s.J.isTypeSupported||s.J.isTypeSupported(n)))}var t=e.prototype;return t.getMimeTypeString=function(){var e,t;return(null!==(e=this.mimeType)&&void 0!==e?e:"")+';codecs="'+(null!==(t=this.codec)&&void 0!==t?t:"")+'"'},t.getEncryptionData=function(e){for(var t,n,r=this.getAllEncryptionData(),i=[],a=0;a<r.length;a++)for(var o=!1,s=r[a],u=0;u<s.values.length;u++)if(s.values[u].systemId.toLowerCase()===e.toLowerCase())if(o)i[i.length-1].values.push(s.values[u]);else{var l=null===(n=null===(t=this.contentProtections)||void 0===t?void 0:t.keyIds)||void 0===n?void 0:n.map((function(e){return e.keyId}));i.push({type:s.type,keyIds:l,values:[s.values[u]]}),o=!0}return i},t.getAllEncryptionData=function(){var e,t;if(void 0===this.contentProtections||0===this.contentProtections.initData.length)return[];var n=null===(t=null===(e=this.contentProtections)||void 0===e?void 0:e.keyIds)||void 0===t?void 0:t.map((function(e){return e.keyId}));return this.contentProtections.initData.map((function(e){return{type:e.type,keyIds:n,values:e.values}}))},t._addProtectionData=function(e,t,n){var r=!1;if(void 0===this.contentProtections)return this.contentProtections={keyIds:void 0!==t?[{keyId:t}]:[],initData:[{type:e,values:n}]},!0;if(void 0!==t){var i=this.contentProtections.keyIds;if(void 0===i)this.contentProtections.keyIds=[{keyId:t}];else{for(var a,o=!1,s=c(i);!(a=s()).done;){var d=a.value;(0,l.Z)(d.keyId,t)&&(o=!0)}o||(u.Z.warn("Manifest: found unanounced key id."),i.push({keyId:t}))}}for(var f=this.contentProtections.initData,v=0;v<f.length;v++)if(f[v].type===e){for(var p=f[v].values,h=0;h<n.length;h++){var m=n[h],g=void 0;for(g=0;g<p.length;g++)if(m.systemId===p[g].systemId){if((0,l.Z)(m.data,p[g].data))break;u.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),r=!0)}return r}return this.contentProtections.initData.push({type:e,values:n}),!0},e}(),v=["audio","video","text","image"],p=function(){function e(t,n){void 0===n&&(n={});var r=t.trickModeTracks,o=n,s=o.representationFilter,u=o.isManuallyAdded;this.id=t.id,this.type=t.type,void 0!==t.isTrickModeTrack&&(this.isTrickModeTrack=t.isTrickModeTrack),void 0!==t.language&&(this.language=t.language,this.normalizedLanguage=(0,a.ZP)(t.language)),void 0!==t.closedCaption&&(this.isClosedCaption=t.closedCaption),void 0!==t.audioDescription&&(this.isAudioDescription=t.audioDescription),void 0!==t.isDub&&(this.isDub=t.isDub),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==r&&r.length>0&&(this.trickModeTracks=r.map((function(t){return new e(t)})));for(var l=t.representations,c=[],d=!1,v=0;v<l.length;v++){var p=new f(l[v],{type:this.type});((0,i.Z)(s)||s(p,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted}))&&(c.push(p),!d&&p.isSupported&&(d=!0))}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=d,this.manuallyAdded=!0===u}var t=e.prototype;return t.getAvailableBitrates=function(){for(var e=[],t=0;t<this.representations.length;t++){var n=this.representations[t];!1!==n.decipherable&&e.push(n.bitrate)}return o(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,r.Z)(this.representations,(function(t){var n=t.id;return e===n}))},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return S}});var r,i=n(4578),a=n(3714),o=n(3274),s=n(1959),u=n(908),l=n(9829),c=n(8806),d=n(8999),f=n(1679),v=function(){function e(e,t){var n=this;if(this.contentWarnings=[],this.id=e.id,this.adaptations=Object.keys(e.adaptations).reduce((function(r,i){var o=e.adaptations[i];if(null==o)return r;var s=o.map((function(e){var r=new d.Z(e,{representationFilter:t});if(r.representations.length>0&&!r.isSupported){var i=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");n.contentWarnings.push(i)}return r})).filter((function(e){return e.representations.length>0}));if(s.every((function(e){return!e.isSupported}))&&o.length>0&&("video"===i||"audio"===i))throw new a.Z("MANIFEST_PARSE_ERROR","No supported "+i+" adaptations");return s.length>0&&(r[i]=s),r}),{}),!Array.isArray(this.adaptations.video)&&!Array.isArray(this.adaptations.audio))throw new a.Z("MANIFEST_PARSE_ERROR","No supported audio and video tracks.");this.duration=e.duration,this.start=e.start,null!=this.duration&&null!=this.start&&(this.end=this.start+this.duration),this.streamEvents=void 0===e.streamEvents?[]:e.streamEvents}var t=e.prototype;return t.getAdaptations=function(){var e=this.adaptations;return(0,f.Z)(e).reduce((function(e,t){return null!=t?e.concat(t):e}),[])},t.getAdaptationsForType=function(e){var t=this.adaptations[e];return null==t?[]:t},t.getAdaptation=function(e){return(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},t.getSupportedAdaptations=function(e){if(void 0===e)return this.getAdaptations().filter((function(e){return e.isSupported}));var t=this.adaptations[e];return void 0===t?[]:t.filter((function(e){return e.isSupported}))},t.containsTime=function(e){return e>=this.start&&(void 0===this.end||e<this.end)},e}(),p=n(3887),h=function(){function e(e){this._url=e.media}var t=e.prototype;return t.getInitSegment=function(){return null},t.getSegments=function(){return[{id:"0",isInit:!1,number:0,url:this._url,time:0,end:Number.MAX_VALUE,duration:Number.MAX_VALUE,complete:!0,privateInfos:{},timescale:1}]},t.getFirstAvailablePosition=function(){},t.getLastAvailablePosition=function(){},t.getEnd=function(){},t.awaitSegmentBetween=function(){return!1},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(){return!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(){p.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){p.Z.warn("Tried to update a static RepresentationIndex")},e}();!function(e){e[e.Full=0]="Full",e[e.Partial=1]="Partial"}(r||(r={}));var m=n(5138);function g(e,t,n){e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var i=e.getAdaptations(),a=t.getAdaptations(),s=function(e){var t=i[e],s=(0,o.Z)(a,(function(e){return e.id===t.id}));if(void 0===s)p.Z.warn('Manifest: Adaptation "'+i[e].id+'" not found when merging.');else for(var u=i[e].representations,l=s.representations,c=function(e){var t=u[e],i=(0,o.Z)(l,(function(e){return e.id===t.id}));void 0===i?p.Z.warn('Manifest: Representation "'+u[e].id+'" not found when merging.'):(t.cdnMetadata=i.cdnMetadata,n===r.Full?t.index._replace(i.index):t.index._update(i.index))},d=0;d<u.length;d++)c(d)},u=0;u<i.length;u++)s(u)}function y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=(0,u.Z)(),T=(0,u.Z)(),E=function(e){function t(t,n){var r,i;r=e.call(this)||this;var a=n.supplementaryTextTracks,o=void 0===a?[]:a,s=n.supplementaryImageTracks,u=void 0===s?[]:s,l=n.representationFilter,c=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=T(),r.expired=null!==(i=t.expired)&&void 0!==i?i:null,r.transport=t.transportType,r.clockOffset=t.clockOffset,r.periods=t.periods.map((function(e){var t,n=new v(e,l);return(t=r.contentWarnings).push.apply(t,n.contentWarnings),n})).sort((function(e,t){return e.start-t.start})),r.adaptations=void 0===r.periods[0]?{}:r.periods[0].adaptations,r._timeBounds=t.timeBounds,r.isDynamic=t.isDynamic,r.isLive=t.isLive,r.isLastPeriodKnown=t.isLastPeriodKnown,r.uris=void 0===t.uris?[]:t.uris,r.updateUrl=c,r.lifetime=t.lifetime,r.suggestedPresentationDelay=t.suggestedPresentationDelay,r.availabilityStartTime=t.availabilityStartTime,r.publishTime=t.publishTime,u.length>0&&r._addSupplementaryImageAdaptations(u),o.length>0&&r._addSupplementaryTextAdaptations(o),r}(0,i.Z)(t,e);var n=t.prototype;return n.getPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){return(0,o.Z)(this.periods,(function(t){return e>=t.start&&(void 0===t.end||t.end>e)}))},n.getNextPeriod=function(e){return(0,o.Z)(this.periods,(function(t){return t.start>e}))},n.getPeriodAfter=function(e){var t=e.end;if(void 0===t)return null;var n=(0,o.Z)(this.periods,(function(e){return void 0===e.end||t<e.end}));return void 0===n?null:n},n.getUrl=function(){return this.uris[0]},n.replace=function(e){this._performUpdate(e,r.Full)},n.update=function(e){this._performUpdate(e,r.Partial)},n.getMinimumSafePosition=function(){var e,t,n=this._timeBounds;if(null===n.timeshiftDepth)return null!==(e=n.minimumSafePosition)&&void 0!==e?e:0;var r,i=n.maximumTimeData;if(n.maximumTimeData.isLinear){var a=performance.now()-i.time;r=i.maximumSafePosition+a/1e3}else r=i.maximumSafePosition;var o=r-n.timeshiftDepth;return Math.max(null!==(t=n.minimumSafePosition)&&void 0!==t?t:0,o)},n.getLivePosition=function(){var e=this._timeBounds.maximumTimeData;if(this.isLive&&void 0!==e.livePosition){if(!e.isLinear)return e.livePosition;var t=performance.now()-e.time;return e.livePosition+t/1e3}},n.getMaximumSafePosition=function(){var e=this._timeBounds.maximumTimeData;if(!e.isLinear)return e.maximumSafePosition;var t=performance.now()-e.time;return e.maximumSafePosition+t/1e3},n.updateRepresentationsDeciperability=function(e){var t=function(e,t){for(var n,r=[],i=y(e.periods);!(n=i()).done;)for(var a,o=n.value,s=y(o.getAdaptations());!(a=s()).done;)for(var u,l=a.value,c=y(l.representations);!(u=c()).done;){var d=u.value,f=t(d);f!==d.decipherable&&(r.push({manifest:e,period:o,adaptation:l,representation:d}),d.decipherable=f)}return r}(this,e);t.length>0&&this.trigger("decipherabilityUpdate",t)},n.getAdaptations=function(){(0,c.Z)("manifest.getAdaptations() is deprecated. Please use manifest.period[].getAdaptations() instead");var e=this.periods[0];if(void 0===e)return[];var t=e.adaptations,n=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n.push.apply(n,i)}return n},n.getAdaptationsForType=function(e){(0,c.Z)("manifest.getAdaptationsForType(type) is deprecated. Please use manifest.period[].getAdaptationsForType(type) instead");var t=this.periods[0];if(void 0===t)return[];var n=t.adaptations[e];return void 0===n?[]:n},n.getAdaptation=function(e){return(0,c.Z)("manifest.getAdaptation(id) is deprecated. Please use manifest.period[].getAdaptation(id) instead"),(0,o.Z)(this.getAdaptations(),(function(t){var n=t.id;return e===n}))},n._addSupplementaryImageAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).map((function(e){var n=e.mimeType,r=e.url,i="gen-image-ada-"+b(),o="gen-image-rep-"+b(),s=(0,l.$)(r),u=r.substring(0,s),c=r.substring(s),f=new d.Z({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:c})}]},{isManuallyAdded:!0});if(f.representations.length>0&&!f.isSupported){var v=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(v)}return f}));if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.image=null!=r.image?r.image.concat(n):n}},n._addSupplementaryTextAdaptations=function(e){var t=this,n=(Array.isArray(e)?e:[e]).reduce((function(e,n){var r=n.mimeType,i=n.codecs,o=n.url,s=n.language,u=n.languages,c=n.closedCaption,f=null!=s?[s]:null!=u?u:[],v=(0,l.$)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(f.map((function(e){var n="gen-text-ada-"+b(),o="gen-text-rep-"+b(),s=new d.Z({id:n,type:"text",language:e,closedCaption:c,representations:[{bitrate:0,cdnMetadata:[{baseUrl:p}],id:o,mimeType:r,codecs:i,index:new h({media:m})}]},{isManuallyAdded:!0});if(s.representations.length>0&&!s.isSupported){var u=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.");t.contentWarnings.push(u)}return s})))}),[]);if(n.length>0&&this.periods.length>0){var r=this.periods[0].adaptations;r.text=null!=r.text?r.text.concat(n):n}},n._performUpdate=function(e,t){if(this.availabilityStartTime=e.availabilityStartTime,this.expired=e.expired,this.isDynamic=e.isDynamic,this.isLive=e.isLive,this.isLastPeriodKnown=e.isLastPeriodKnown,this.lifetime=e.lifetime,this.contentWarnings=e.contentWarnings,this.suggestedPresentationDelay=e.suggestedPresentationDelay,this.transport=e.transport,this.publishTime=e.publishTime,t===r.Full)this._timeBounds=e._timeBounds,this.uris=e.uris,function(e,t){for(var n=0,i=0;i<t.length;i++){for(var a=t[i],o=n,s=e[o];null!=s&&s.id!==a.id;)s=e[++o];if(null!=s){g(s,a,r.Full);var u=t.slice(n,i),l=o-n;e.splice.apply(e,[n,l].concat(u)),n=i+1}}if(n>e.length)p.Z.error("Manifest: error when updating Periods");else{n<e.length&&e.splice(n,e.length-n);var c=t.slice(n,t.length);c.length>0&&e.push.apply(e,c)}}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],function(e,t){if(0!==e.length){if(0!==t.length){var n=e[e.length-1];if(n.start<t[0].start){if(n.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");e.push.apply(e,t)}else{var i=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(i<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");g(e[i],t[0],r.Partial);for(var o=i+1,s=1;s<t.length;s++){for(var u=t[s],l=-1,c=o;c<e.length;c++)if(u.id===e[c].id){l=c;break}if(l<0)return void e.splice.apply(e,[o,e.length-o].concat(t.slice(s,t.length)));l>o&&(e.splice(o,l-o),l=o),g(e[l],u,r.Full),o++}o<e.length&&e.splice(o,e.length-o)}}}else e.splice.apply(e,[0,0].concat(t))}(this.periods,e.periods);for(var n=this.getMinimumSafePosition();this.periods.length>0;){var i=this.periods[0];if(void 0===i.end||i.end>n)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",null)},t}(s.Z);var S=E},520:function(e,t,n){"use strict";n.d(t,{K:function(){return a},z:function(){return i}});var r=n(1946);function i(e,t){return e.segment.id===t.segment.id&&e.representation.id===t.representation.id&&e.adaptation.id===t.adaptation.id&&e.period.id===t.period.id}function a(e){if((0,r.Z)(e))return"";var t=e.period,n=e.adaptation,i=e.representation,a=e.segment;return n.type+" P: "+t.id+" A: "+n.id+" R: "+i.id+" S: "+(a.isInit?"init":a.complete?a.time+"-"+a.duration:""+a.time)}},2689:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r=Math.pow(2,32)-1},2297:function(e,t,n){"use strict";n.d(t,{Qy:function(){return f},Xj:function(){return p},iz:function(){return d},lp:function(){return c},nR:function(){return v},t_:function(){return l},vA:function(){return u}});var r=n(3887),i=n(811),a=n(6968);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n,r=e,i=o(t);!(n=i()).done;){var a=l(r,n.value);if(null===a)return null;r=a}return r}function l(e,t){var n=f(e,t);return null!==n?e.subarray(n[1],n[2]):null}function c(e,t){for(var n=[],r=e;;){var a=f(r,t);if(null===a)return n;(0,i.Z)(0!==a[2]&&0!==r.length),n.push(r.subarray(a[1],a[2])),r=r.subarray(a[2])}}function d(e,t){var n=f(e,t);return null!==n?e.subarray(n[0],n[2]):null}function f(e,t){for(var n,r,i=e.length,o=0,s=0;o+8<=i;){if(r=o,s=(0,a.pX)(e,r),r+=4,n=(0,a.pX)(e,r),r+=4,0===s)s=i-o;else if(1===s){if(r+8>i)return null;s=(0,a.pV)(e,r),r+=8}if(s<0)throw new Error("ISOBMFF: Size out of range");if(n===t)return 1970628964===t&&(r+=16),[o,r,o+s];o+=s}return null}function v(e,t,n,r,i){for(var o,s=e.length,u=0;u<s;u+=o){var l=u;o=(0,a.pX)(e,l),l+=4;var c=(0,a.pX)(e,l);if(l+=4,0===o)o=s-u;else if(1===o){if(l+8>s)return;o=(0,a.pV)(e,l),l+=8}if(1970628964===c&&l+16<=s&&(0,a.pX)(e,l)===t&&(0,a.pX)(e,l+4)===n&&(0,a.pX)(e,l+8)===r&&(0,a.pX)(e,l+12)===i)return l+=16,e.subarray(l,u+o)}}function p(e){var t=e.length;if(t<8)return r.Z.warn("ISOBMFF: box inferior to 8 bytes, cannot find offsets"),null;var n=0,i=(0,a.pX)(e,n);n+=4;var o=(0,a.pX)(e,n);if(n+=4,0===i)i=t;else if(1===i){if(n+8>t)return r.Z.warn("ISOBMFF: box too short, cannot find offsets"),null;i=(0,a.pV)(e,n),n+=8}if(i<0)throw new Error("ISOBMFF: Size out of range");return 1970628964===o&&(n+=16),[0,n,i]}},6807:function(e,t,n){"use strict";n.d(t,{E3:function(){return u},Le:function(){return o},XA:function(){return i},fs:function(){return s},uq:function(){return a}});var r=n(2297);function i(e){var t=(0,r.t_)(e,1836019558);return null===t?null:(0,r.t_)(t,1953653094)}function a(e){return(0,r.lp)(e,1836019558).reduce((function(e,t){var n=(0,r.t_)(t,1953653094);return null!==n&&e.push(n),e}),[])}function o(e){return(0,r.t_)(e,1835295092)}function s(e){var t=(0,r.t_)(e,1836019574);if(null===t)return null;var n=(0,r.t_)(t,1953653099);return null===n?null:(0,r.t_)(n,1835297121)}function u(e,t){return void 0===t&&(t=0),(0,r.t_)(e.subarray(t),1701671783)}},6490:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},Y:function(){return u}});var r=n(3887);var i="function"==typeof Uint8Array.prototype.slice?function(e,t,n){return e.slice(t,n)}:function(e,t,n){return new Uint8Array(Array.prototype.slice.call(e,t,n))},a=n(3635),o=n(2297);function s(e){var t=0,n=(0,o.t_)(e,1836019574);if(null===n)return[];for(var a=[];t<n.length;){var s=void 0;try{s=(0,o.Qy)(n,1886614376)}catch(e){var l=e instanceof Error?e:"";return r.Z.warn("Error while removing PSSH from ISOBMFF",l),a}if(null==s)return a;var c=i(n,s[0],s[2]),d=u(c,s[1]-s[0]);void 0!==d&&a.push({systemId:d,data:c}),n[s[0]+4]=102,n[s[0]+5]=114,n[s[0]+6]=101,n[s[0]+7]=101,t=s[2]}return a}function u(e,t){if(e[t]>1)r.Z.warn("ISOBMFF: un-handled PSSH version");else{var n=t+4;if(!(n+16>e.length)){var o=i(e,n,n+16);return(0,a.ci)(o)}}}},4644:function(e,t,n){"use strict";n.d(t,{J6:function(){return m},LD:function(){return h},MM:function(){return p},Qx:function(){return f},R0:function(){return y},Wf:function(){return d},s9:function(){return g}});var r=n(3887),i=n(6968),a=n(3635),o=n(2689),s=n(2297),u=n(6807);function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=(0,s.Qy)(e,1936286840);if(null===n)return null;var r=t,a=n[2]-n[0],o=n[1],u=e[o];o+=8;var l,c=(0,i.pX)(e,o);if(o+=4,0===u)l=(0,i.pX)(e,o),o+=4,r+=(0,i.pX)(e,o)+a,o+=4;else{if(1!==u)return null;l=(0,i.pV)(e,o),o+=8,r+=(0,i.pV)(e,o)+a,o+=8}var d=[];o+=2;var f=(0,i.zK)(e,o);for(o+=2;--f>=0;){var v=(0,i.pX)(e,o);o+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)throw new Error("sidx with reference_type `1` not yet implemented");var h=(0,i.pX)(e,o);o+=4,o+=4,d.push({time:l,duration:h,timescale:c,range:[r,r+p-1]}),l+=h,r+=p}return d}function f(e){var t=(0,u.XA)(e);if(null!==t){var n=(0,s.t_)(t,1952867444);if(null!==n){var r=n[0];return 1===r?(0,i.pV)(n,4):0===r?(0,i.pX)(n,4):void 0}}}function v(e){var t=(0,s.t_)(e,1952868452);if(null!==t){var n=1,r=(0,i.QI)(t,n);if(n+=3,(8&r)>0)return n+=4,(1&r)>0&&(n+=8),(2&r)>0&&(n+=4),(0,i.pX)(t,n)}}function p(e){var t=(0,u.uq)(e);if(0!==t.length){for(var n,r=0,a=l(t);!(n=a()).done;){var o=n.value,c=(0,s.t_)(o,1953658222);if(null===c)return;var d=0,f=c[d];if(d+=1,f>1)return;var p=(0,i.QI)(c,d);d+=3;var h=(256&p)>0,m=0;if(!h&&void 0===(m=v(o)))return;var g=(1&p)>0,y=(4&p)>0,_=(512&p)>0,b=(1024&p)>0,T=(2048&p)>0,E=(0,i.pX)(c,d);d+=4,g&&(d+=4),y&&(d+=4);for(var S=E,w=0;S-- >0;)h?(w+=(0,i.pX)(c,d),d+=4):w+=m,_&&(d+=4),b&&(d+=4),T&&(d+=4);r+=w}return r}}function h(e){var t=(0,u.fs)(e);if(null!==t){var n=(0,s.t_)(t,1835296868);if(null!==n){var r=0,a=n[r];return r+=4,1===a?(0,i.pX)(n,r+16):0===a?(0,i.pX)(n,r+8):void 0}}}function m(e){var t=e.length;if(t<4)throw new Error("Cannot update box length: box too short");var n=(0,i.pX)(e,0);if(0===n){if(t>o.s){var r=new Uint8Array(t+8);return r.set((0,i.kh)(1),0),r.set(e.subarray(4,8),4),r.set((0,i.el)(t+8),8),r.set(e.subarray(8,t),16),r}return e.set((0,i.kh)(t),0),e}if(1===n){if(t<16)throw new Error("Cannot update box length: box too short");return e.set((0,i.el)(t),8),e}if(t<=o.s)return e.set((0,i.kh)(t),0),e;var a=new Uint8Array(t+8);return a.set((0,i.kh)(1),0),a.set(e.subarray(4,8),4),a.set((0,i.el)(t+8),8),a.set(e.subarray(8,t),16),a}function g(e){for(var t=[],n=0;n<e.length;){var o=(0,u.E3)(e,n);if(null===o)break;var s=o.length;n+=s;var l=o[0];if(0!==l)r.Z.warn("ISOBMFF: EMSG version "+l.toString()+" not supported.");else{var c=4,d=(0,a.DM)(o,c),f=d.end,v=d.string;c=f;var p=(0,a.DM)(o,c),h=p.end,m=p.string;c=h;var g=(0,i.pX)(o,c);c+=4;var y=(0,i.pX)(o,c);c+=4;var _=(0,i.pX)(o,c);c+=4;var b=(0,i.pX)(o,c);c+=4;var T={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(c,s)};t.push(T)}}if(0!==t.length)return t}function y(e){var t=(0,s.vA)(e,[1836019574,1953653099,1835297121,1835626086,1937007212,1937011556]);if(null===t)return null;var n=t.subarray(8),r=(0,s.t_)(n,1701733238),i=0;if(null===r?(i=28,r=(0,s.t_)(n,1701733217)):i=78,null===r)return null;var a=(0,s.vA)(r.subarray(i),[1936289382,1935894633,1952804451]);return null===a||a.byteLength<24?null:a.subarray(8,24)}},3203:function(e,t,n){"use strict";var r=n(6968),i=n(3635);t.Z=function(e){var t=0,n=e.length,a=(0,i.uR)(e.subarray(t+1,t+8));if(t+=8,137!==e[0]||"BIF\r\n\n"!==a)throw new Error("Invalid BIF file");var o=e[t],s=e[t+=1],u=e[t+=1],l=e[t+=1];t+=1;var c=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var d=(0,r.dN)(e,t);t+=4;var f=(0,r.dN)(e,t);t+=4;var v=(0,i.uR)(e.subarray(t,t+4));t+=4;var p=(0,r.qb)(e,t);t+=2;var h=(0,r.qb)(e,t),m=[e[t+=2],e[t+1]].join(":"),g=1===e[t+=2];t=64;var y=[];if(0===d)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var T=(0,r.dN)(e,t);t+=4;var E=(0,r.dN)(e,t);if(t+=4,null!==b){var S=b.timestamp*f,w=f,k=e.slice(b.offset,E);y.push({index:_,duration:w,ts:S,data:k}),_++}if(4294967295===T)break;b={timestamp:T,offset:E}}return{fileFormat:"BIF",version:c,imageCount:d,timescale:1e3,format:v,width:p,height:h,aspectRatio:m,isVod:g,thumbs:y}}},7403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3887),i=n(3911),a=n(1915),o=n(6394),s=n(4784);function u(e,t){if(t.timescale!==e.timescale){var n=e.timescale;e.timeline.push({start:t.time/t.timescale*n,duration:t.duration/t.timescale*n,repeatCount:void 0===t.count?0:t.count,range:t.range})}else e.timeline.push({start:t.time,duration:t.duration,repeatCount:void 0===t.count?0:t.count,range:t.range});return!0}var l=function(){function e(e,t){var n,r,a,o=t.periodStart,u=t.periodEnd,l=t.representationId,c=t.representationBitrate,d=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1,v=(null!=e.presentationTimeOffset?e.presentationTimeOffset:0)-o*f,p=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,s.zA)(e.initialization.media,l,c),h=void 0===e.media?null:(0,s.zA)(e.media,l,c),m=void 0!==e.initialization?e.initialization.range:void 0!==e.indexRange?[0,e.indexRange[0]-1]:void 0;this._index={indexRange:e.indexRange,indexTimeOffset:v,initialization:{url:p,range:m},segmentUrlTemplate:h,startNumber:e.startNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._scaledPeriodStart=(0,i.gT)(o,this._index),this._scaledPeriodEnd=null==u?void 0:(0,i.gT)(u,this._index),this._isInitialized=this._index.timeline.length>0,this._isEMSGWhitelisted=d}var t=e.prototype;return t.getInitSegment=function(){return(0,a.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){return(0,o.Z)(this._index,e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){var e=this._index;return 0===e.timeline.length?null:(0,i.zG)(Math.max(this._scaledPeriodStart,e.timeline[0].start),e)},t.getLastAvailablePosition=function(){var e,t=this._index.timeline;if(0===t.length)return null;var n=t[t.length-1],r=Math.min((0,i.jH)(n,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,i.zG)(r,this._index)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.initializeIndex=function(e){for(var t=0;t<e.length;t++)u(this._index,e[t]);this._isInitialized=!0},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return this._isInitialized},t._replace=function(e){this._index=e._index,this._isInitialized=e._isInitialized,this._scaledPeriodEnd=e._scaledPeriodEnd,this._isEMSGWhitelisted=e._isEMSGWhitelisted},t._update=function(){r.Z.error("Base RepresentationIndex: Cannot update a SegmentList")},e}()},1915:function(e,t,n){"use strict";function r(e,t){var n,r=e.initialization,i={};return void 0!==t&&(i.isEMSGWhitelisted=t),{id:"init",isInit:!0,time:0,end:0,duration:0,timescale:1,range:null!=r?r.range:void 0,indexRange:e.indexRange,url:null!==(n=null==r?void 0:r.url)&&void 0!==n?n:null,complete:!0,privateInfos:i,timestampOffset:-e.indexTimeOffset/e.timescale}}n.d(t,{Z:function(){return r}})},6394:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3911),i=n(4784);function a(e,t,n,a,o){for(var s,u,l=(0,r.gT)(t,e),c=(0,r.gT)(t+n,e),d=e.timeline,f=e.timescale,v=e.segmentUrlTemplate,p=e.startNumber,h=null!=p?p:1,m=[],g=d.length,y=0;y<g;y++){for(var _=d[y],b=_.duration,T=_.start,E=_.range,S=(0,r.KF)(_,d[y+1],o),w=!1!==e.availabilityTimeComplete||y!==g-1&&0!==S,k=(s=b,u=void 0,(u=l-T)>0?Math.floor(u/s):0),A=T+k*b;A<c&&k<=S;){var x=h+k,I=null===v?null:(0,i.QB)(A,x)(v),Z=A-e.indexTimeOffset,R=b;Z<0&&(R=b+Z,Z=0);var M={id:String(A),time:Z/f,end:(Z+R)/f,duration:R/f,isInit:!1,range:E,timescale:1,url:I,number:x,timestampOffset:-e.indexTimeOffset/f,complete:w,privateInfos:{isEMSGWhitelisted:a}};m.push(M),A=T+ ++k*b}if(A>=c)return m;h+=S+1}return m}},4784:function(e,t,n){"use strict";n.d(t,{QB:function(){return o},zA:function(){return a}});var r=n(6923);function i(e){return function(t,n,i){var a,o,s,u=(0,r.Z)(i)?parseInt(i,10):1;return a=String(e),o=u,(s=a.toString()).length>=o?s:(new Array(o+1).join("0")+s).slice(-o)}}function a(e,t,n){return function(e,t,n){return-1===e.indexOf("$")?e:e.replace(/\$\$/g,"$").replace(/\$RepresentationID\$/g,String(t)).replace(/\$Bandwidth(\%0(\d+)d)?\$/g,i(void 0===n?0:n))}(e,t,n)}function o(e,t){return function(n){return-1===n.indexOf("$")?n:n.replace(/\$\$/g,"$").replace(/\$Number(\%0(\d+)d)?\$/g,(function(e,n,r){if(void 0===t)throw new Error("Segment number not defined in a $Number$ scheme");return i(t)(e,n,r)})).replace(/\$Time(\%0(\d+)d)?\$/g,(function(t,n,r){if(void 0===e)throw new Error("Segment time not defined in a $Time$ scheme");return i(e)(t,n,r)}))}}},4541:function(e,t,n){"use strict";n.d(t,{Z:function(){return We}});var r=n(7904),i=n(1946),a=n(6872),o=n(3887),s=n(3274),u=n(9829);function l(e){var t=Date.parse(e)-performance.now();if(!isNaN(t))return t;o.Z.warn("DASH Parser: Invalid clock received: ",e)}function c(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getLastAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.min(n,i))}return null===n?null:n}function d(e){for(var t=e.representations,n=null,r=0;r<t.length;r++){var i=t[r].index.getFirstAvailablePosition();if(void 0===i)return;null!==i&&(n=null==n?i:Math.max(n,i))}return null===n?null:n}function f(e){if(0===e.length)throw new Error("DASH Parser: no period available for a dynamic content");var t=function(e){for(var t=0;t<=e.length-1;t++){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=d(r);if(void 0===u)return;a=u}if(void 0!==i){var l=d(i);if(void 0===l)return;s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return void o.Z.info("Parser utils: found Period with no segment. ","Going to next one to calculate first position");if(null!==s)return null!==a?Math.max(a,s):s;if(null!==a)return a}}}(e),n=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t].adaptations,r=void 0===n.audio?void 0:n.audio[0],i=void 0===n.video?void 0:n.video[0];if(void 0!==r||void 0!==i){var a=null,s=null;if(void 0!==r){var u=c(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=c(i);if(void 0===l)return{safe:void 0,unsafe:void 0};s=l}if(void 0!==r&&null===a||void 0!==i&&null===s)return o.Z.info("Parser utils: found Period with no segment. ","Going to previous one to calculate last position"),{safe:void 0,unsafe:void 0};if(null!==s)return null!==a?{safe:Math.min(a,s),unsafe:Math.max(a,s)}:{safe:s,unsafe:s};if(null!==a)return{safe:a,unsafe:a}}}return{safe:void 0,unsafe:void 0}}(e);return{minimumSafePosition:t,maximumSafePosition:n.safe,maximumUnsafePosition:n.unsafe}}var v=n(9592),p=n(908),h=n(1679),m=n(3635);var g=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null}var t=e.prototype;return t.setLastPosition=function(e,t){this._lastPosition=e,this._positionTime=t},t.lastPositionIsKnown=function(){return this._isDynamic?null!=this._positionTime&&null!=this._lastPosition:null!=this._lastPosition},t.estimateMinimumBound=function(){if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var e=this.estimateMaximumBound();return void 0!==e?e-this._timeShiftBufferDepth:void 0},t.estimateMaximumBound=function(){return this._isDynamic&&null!=this._positionTime&&null!=this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}(),y=n(8999),_=n(5138),b=n(7714),T=n(6923);function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=function(e,t){for(var n,r=E(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=E(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,c=E(y.r);!(u=c()).done;){var d=e[u.value];if(void 0!==d)for(var f,v=E(d);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},k=["subtitle","caption"];function A(e,t,n,r){function i(e,t){var n=e.split("/")[0];return(0,b.Z)(y.r,n)?n:"application/bif"===e?"image":"application/ttml+xml"===e||"application/mp4"===e&&null!=t&&null!=(0,s.Z)(t,(function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&(0,b.Z)(k,e.value)}))?"text":void 0}function a(e){switch(e.substring(0,3)){case"avc":case"hev":case"hvc":case"vp8":case"vp9":case"av1":return"video";case"vtt":return"text";case"bif":return"image"}switch(e.substring(0,4)){case"mp4a":return"audio";case"wvtt":case"stpp":return"text"}}if(null!==t){var o=i(t,r);if(void 0!==o)return o}if(null!==n){var u=a(n);if(void 0!==u)return u}for(var l=0;l<e.length;l++){var c=e[l].attributes,d=c.mimeType,f=c.codecs;if(void 0!==d){var v=i(d,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var x=n(8026);var I=n(7403),Z=n(3911),R=n(1915),M=n(4784),C=function(){function e(e,t){var n,r;if(void 0===e.duration)throw new Error("Invalid SegmentList: no duration");var i=t.periodStart,a=t.periodEnd,o=t.representationId,s=t.representationBitrate,u=t.isEMSGWhitelisted;this._isEMSGWhitelisted=u,this._periodStart=i,this._periodEnd=a;var l=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,c=null!==(n=e.timescale)&&void 0!==n?n:1,d=l-i*c,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,M.zA)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,M.zA)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:c,duration:e.duration,indexTimeOffset:d,indexRange:e.indexRange,initialization:null==e.initialization?void 0:{url:f,range:e.initialization.range}}}var t=e.prototype;return t.getInitSegment=function(){var e=(0,R.Z)(this._index);return void 0===e.privateInfos&&(e.privateInfos={}),e.privateInfos.isEMSGWhitelisted=this._isEMSGWhitelisted,e},t.getSegments=function(e,t){for(var n=this._index,r=n.duration,i=n.list,a=n.timescale,o=r/a,s=e-this._periodStart,u=(0,Z.PZ)(s,t,a),l=u[0],c=u[1],d=Math.min(i.length-1,Math.floor(c/r)),f=[],v=Math.floor(l/r);v<=d;){var p=i[v].mediaRange,h=i[v].url,m=v*o+this._periodStart,g={id:String(v),time:m,isInit:!1,range:p,duration:o,timescale:1,end:m+o,url:h,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};f.push(g),v++}return f},t.shouldRefresh=function(e,t){return!1},t.getFirstAvailablePosition=function(){return this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._index,n=t.duration,r=t.list;return Math.min(r.length*n/t.timescale+this._periodStart,null!==(e=this._periodEnd)&&void 0!==e?e:1/0)},t.getEnd=function(){return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(){return!1},t.isSegmentStillAvailable=function(){return!0},t.checkDiscontinuity=function(){return null},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){return!0},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index},t._update=function(){o.Z.error("List RepresentationIndex: Cannot update a SegmentList")},e}(),P=n(9362),D=n(811),N=n(8232),O=n(1091),L=n(5505),B=n(6394);function U(e){return a.Z.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR*e}function F(e,t,n){var r=e.start,a=e.duration,s=e.repeatCount;return void 0===r&&(null===t?r=0:(0,i.Z)(t.duration)||(r=t.start+t.duration*(t.repeatCount+1))),void 0!==a&&!isNaN(a)||null===n||void 0===n.start||isNaN(n.start)||void 0===r||isNaN(r)||(a=n.start-r),void 0===r||isNaN(r)||void 0===a||isNaN(a)||void 0!==s&&isNaN(s)?(o.Z.warn('DASH: A "S" Element could not have been parsed.'),null):{start:r,duration:a,repeatCount:void 0===s?0:s}}function z(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"t":var i=parseInt(r.value,10);isNaN(i)?o.Z.warn('DASH: invalid t ("'+r.value+'")'):t.start=i;break;case"d":var a=parseInt(r.value,10);isNaN(a)?o.Z.warn('DASH: invalid d ("'+r.value+'")'):t.duration=a;break;case"r":var s=parseInt(r.value,10);isNaN(s)?o.Z.warn('DASH: invalid r ("'+r.value+'")'):t.repeatCount=s}}return t}function V(e){for(var t=[],n=0;n<e.length;n++)t.push(z(e[n]));for(var r=[],i=0;i<t.length;i++){var a=F(t[i],void 0===r[r.length-1]?null:r[r.length-1],void 0===t[i+1]?null:t[i+1]);null!==a&&r.push(a)}return r}function K(e,t){var n,r=function(e,t){if(0===e.length||0===t.length)return null;var n=e[0].start,r=t[0].getAttribute("t"),i=null===r?null:parseInt(r,10);if(null===i||Number.isNaN(i))return null;if(n===i)return{prevSegmentsIdx:0,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(n<i)for(var a=e[0],o=0;;){if(a.repeatCount>0){var s=i-a.start;if(s%a.duration==0&&s/a.duration<=a.repeatCount)return{repeatNumberInPrevSegments:s/a.duration,prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInNewElements:0}}if(++o>=e.length)return null;if((a=e[o]).start===i)return{prevSegmentsIdx:o,newElementsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(a.start>i)return null}else for(var u=0,l=t[0],c=i;;){var d=l.getAttribute("d"),f=null===d?null:parseInt(d,10);if(null===f||Number.isNaN(f))return null;var v=l.getAttribute("r"),p=null===v?null:parseInt(v,10);if(null!==p){if(Number.isNaN(p)||p<0)return null;if(p>0){var h=n-c;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}c+=f*(p+1)}else c+=f;if(++u>=t.length)return null;var m=(l=t[u]).getAttribute("t"),g=null===m?null:parseInt(m,10);if(null!==g){if(Number.isNaN(g))return null;c=g}if(c===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(c>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),V(e);var i=r.prevSegmentsIdx,a=r.newElementsIdx,s=r.repeatNumberInPrevSegments,u=r.repeatNumberInNewElements,l=t.length-i+a-1;if(l>=e.length)return o.Z.info('DASH: Cannot perform "based" update. New timeline too short'),V(e);var c=t.slice(i);if(s>0){var d=c[0];d.start+=d.duration*s,c[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),V(e);var f=c[c.length-1],v=z(e[l]),p=(null!==(n=v.repeatCount)&&void 0!==n?n:0)-u;if(v.duration!==f.duration||f.repeatCount>p)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form at the beginning.'),V(e);void 0!==v.repeatCount&&v.repeatCount>f.repeatCount&&(f.repeatCount=v.repeatCount);for(var h=[],m=[],g=l+1;g<e.length;g++)m.push(z(e[g]));for(var y=0;y<m.length;y++){var _=F(m[y],void 0===h[h.length-1]?f:h[h.length-1],void 0===m[y+1]?null:m[y+1]);null!==_&&h.push(_)}return c.concat(h)}var G=function(){function e(t,n){var r,i,a,o;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var s=n.availabilityTimeComplete,u=n.manifestBoundsCalculator,l=n.isDynamic,c=n.isLastPeriod,d=n.representationId,f=n.representationBitrate,v=n.periodStart,p=n.periodEnd,h=n.isEMSGWhitelisted,m=null!==(r=t.timescale)&&void 0!==r?r:1,g=(null!=t.presentationTimeOffset?t.presentationTimeOffset:0)-v*m;this._manifestBoundsCalculator=u,this._isEMSGWhitelisted=h,this._isLastPeriod=c,this._lastUpdate=null==n.receivedTime?performance.now():n.receivedTime,this._unsafelyBaseOnPreviousIndex=null,null!==n.unsafelyBaseOnPreviousRepresentation&&n.unsafelyBaseOnPreviousRepresentation.index instanceof e&&(n.unsafelyBaseOnPreviousRepresentation.index._unsafelyBaseOnPreviousIndex=null,this._unsafelyBaseOnPreviousIndex=n.unsafelyBaseOnPreviousRepresentation.index),this._isDynamic=l,this._parseTimeline=null!==(i=t.timelineParser)&&void 0!==i?i:null;var y=void 0===(null===(a=t.initialization)||void 0===a?void 0:a.media)?null:(0,M.zA)(t.initialization.media,d,f),_=void 0===t.media?null:(0,M.zA)(t.media,d,f);this._index={availabilityTimeComplete:s,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:y,range:t.initialization.range},segmentUrlTemplate:_,startNumber:t.startNumber,timeline:null!==(o=t.timeline)&&void 0!==o?o:null,timescale:m},this._scaledPeriodStart=(0,Z.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,Z.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var n=this._index,r=n.segmentUrlTemplate,i=n.startNumber,a=n.timeline,o=n.timescale,s=n.indexTimeOffset;return(0,B.Z)({segmentUrlTemplate:r,startNumber:i,timeline:a,timescale:o,indexTimeOffset:s},e,t,this._isEMSGWhitelisted,this._scaledPeriodEnd)},t.shouldRefresh=function(){return!1},t.getFirstAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;return 0===e.length?null:(0,Z.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=e.getIndexEnd(this._index.timeline,this._scaledPeriodEnd);return null===t?null:(0,Z.zG)(t,this._index)},t.getEnd=function(){if(!this._isDynamic||!this._isLastPeriod)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,D.Z)(e<=t),!this._isDynamic||!this._isLastPeriod)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var r=this._index,i=r.timeline,a=U(r.timescale),o=(0,Z.gT)(t,this._index);if(i.length>0){var s=i[i.length-1];if((0,Z.jH)(s,null,this._scaledPeriodEnd)+a>=Math.min(o,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0))return!1}return void 0===this._scaledPeriodEnd?o+a>this._scaledPeriodStart&&void 0:(0,Z.gT)(e,this._index)-a<this._scaledPeriodEnd&&o+a>this._scaledPeriodStart},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index,n=t.timeline,r=t.timescale,i=t.indexTimeOffset;return(0,O.Z)(e,n,r,i)},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,Z._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof P.Z&&e.isHttpError(404))},t._replace=function(e){this._parseTimeline=e._parseTimeline,this._index=e._index,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._manifestBoundsCalculator=e._manifestBoundsCalculator,this._isLastPeriod=e._isLastPeriod},t._update=function(e){null===this._index.timeline&&(this._index.timeline=this._getTimeline()),null===e._index.timeline&&(e._index.timeline=e._getTimeline()),(0,L.Z)(this._index.timeline,e._index.timeline)&&(this._index.startNumber=e._index.startNumber),this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isFinished=function(){if(!this._isDynamic||!this._isLastPeriod)return!0;null===this._index.timeline&&(this._index.timeline=this._getTimeline());var e=this._index.timeline;if(void 0===this._scaledPeriodEnd||0===e.length)return!1;var t=e[e.length-1];return(0,Z.jH)(t,null,this._scaledPeriodEnd)+U(this._index.timescale)>=this._scaledPeriodEnd},t.isInitialized=function(){return!0},e.isTimelineIndexArgument=function(e){return"function"==typeof e.timelineParser||Array.isArray(e.timeline)},t._refreshTimeline=function(){if(null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._isDynamic){var e=this._manifestBoundsCalculator.estimateMinimumBound();if(null!=e){var t=(0,Z.gT)(e,this._index),n=(0,N.Z)(this._index.timeline,t);void 0!==this._index.startNumber&&(this._index.startNumber+=n)}}},e.getIndexEnd=function(e,t){return e.length<=0?null:Math.min((0,Z.jH)(e[e.length-1],null,t),null!=t?t:1/0)},t._getTimeline=function(){if(null===this._parseTimeline)return null!==this._index.timeline?this._index.timeline:(o.Z.error("DASH: Timeline already lazily parsed."),[]);var e=this._parseTimeline();this._parseTimeline=null;var t,n=a.Z.getCurrent().MIN_DASH_S_ELEMENTS_TO_PARSE_UNSAFELY;return null===this._unsafelyBaseOnPreviousIndex||e.length<n?V(e):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,K(e,t))},e}(),H=G,W=function(){function e(e,t){var n,r,i=t.aggressiveMode,a=t.availabilityTimeOffset,o=t.manifestBoundsCalculator,s=t.isDynamic,u=t.periodEnd,l=t.periodStart,c=t.representationId,d=t.representationBitrate,f=t.isEMSGWhitelisted,v=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=a,this._manifestBoundsCalculator=o,this._aggressiveMode=i;var p=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,h=p-l*v;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var m=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,M.zA)(e.initialization.media,c,d),g=void 0===e.media?null:(0,M.zA)(e.media,c,d);this._index={duration:e.duration,timescale:v,indexRange:e.indexRange,indexTimeOffset:h,initialization:null==e.initialization?void 0:{url:m,range:e.initialization.range},url:g,presentationTimeOffset:p,startNumber:e.startNumber},this._isDynamic=s,this._periodStart=l,this._scaledRelativePeriodEnd=void 0===u?void 0:(u-l)*v,this._isEMSGWhitelisted=f}var t=e.prototype;return t.getInitSegment=function(){return(0,R.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.timescale,o=n.url,s=this._periodStart*a,u=this._scaledRelativePeriodEnd,l=e*a-s,c=(e+t)*a-s,d=this._getFirstSegmentStart(),f=this._getLastSegmentStart();if(null==d||null==f)return[];var v=Math.max(d,l),p=Math.min(f,c);if(p+r<=v)return[];for(var h=[],m=null!=i?i:1,g=Math.floor(v/r),y=g*r;y<=p;y+=r){var _=g+m,b=null!=u&&y+r>u?u-y:r,T=y+s,E=y+this._index.presentationTimeOffset,S=null===o?null:(0,M.QB)(E,_)(o),w={id:String(_),number:_,time:T/a,end:(T+b)/a,duration:b/a,timescale:1,isInit:!1,scaledDuration:b/a,url:S,timestampOffset:-n.indexTimeOffset/a,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};h.push(w),g++}return h},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e,t=this._getLastSegmentStart();return null==t?t:Math.min(t+this._index.duration,null!==(e=this._scaledRelativePeriodEnd)&&void 0!==e?e:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();if(void 0!==this._scaledRelativePeriodEnd){var e=this._index.timescale;return(this._scaledRelativePeriodEnd+this._periodStart*e)/this._index.timescale}},t.awaitSegmentBetween=function(e,t){if((0,D.Z)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=U(n),i=this._periodStart*n,a=t*n-i;return(void 0===this._scaledRelativePeriodEnd||e*n-i-r<this._scaledRelativePeriodEnd)&&a+r>=0},t.shouldRefresh=function(){return!1},t.checkDiscontinuity=function(){return null},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;var t=this.getSegments(e.time,.1);return 0!==t.length&&(t[0].time===e.time&&t[0].end===e.end&&t[0].number===e.number)},t.canBeOutOfSyncError=function(){return!1},t.isFinished=function(){if(!this._isDynamic)return!0;if(void 0===this._scaledRelativePeriodEnd)return!1;var e=this._index.timescale,t=this._getLastSegmentStart();return null!=t&&t+this._index.duration+U(e)>=this._scaledRelativePeriodEnd},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,this._aggressiveMode=e._aggressiveMode,this._isDynamic=e._isDynamic,this._periodStart=e._periodStart,this._scaledRelativePeriodEnd=e._scaledRelativePeriodEnd,this._manifestBoundsCalculator=e._manifestBoundsCalculator},t._update=function(e){this._replace(e)},t._getFirstSegmentStart=function(){if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var e=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0!==e&&e<this._periodStart)return null}var t=this._index,n=t.duration,r=t.timescale,i=this._manifestBoundsCalculator.estimateMinimumBound();if(void 0!==i){var a=i>this._periodStart?(i-this._periodStart)*r:0;return Math.floor(a/n)*n}},t._getLastSegmentStart=function(){var e,t=this._index,n=t.duration,r=t.timescale;if(this._isDynamic){var i=this._manifestBoundsCalculator.estimateMaximumBound();if(void 0===i)return;var o=this._aggressiveMode?n/r:0;if(null!=this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<(i+o-this._periodStart)*this._index.timescale)return this._scaledRelativePeriodEnd<n?null:(Math.floor(this._scaledRelativePeriodEnd/n)-1)*n;var s=(i-this._periodStart)*r;if(s<0)return null;var u=((void 0!==this._availabilityTimeOffset?this._availabilityTimeOffset:0)+o)*r,l=Math.floor((s+u)/n);return l<=0?null:(l-1)*n}var c=null!==(e=this._scaledRelativePeriodEnd)&&void 0!==e?e:0,d=Math.ceil(c/n)-1,f=d*n;return c-f>a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*r||0===d?f:(d-1)*n},e}();function j(e,t){var n;if(0===t.length)return e;var r=t.map((function(e){return{url:e.value}}));if(0===e.length)return r;for(var i=[],a=0;a<e.length;a++)for(var o=e[a],s=0;s<r.length;s++){var l=r[s],c=(0,u.Z)(o.url,l.url);i.push({url:c,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}function q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e){var t=e.adaptationProfiles,n=e.manifestProfiles,r=e.codecs;if(void 0!==r)return-1===((null!=t?t:"")+(null!=n?n:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")||"hvc1.2.4.L153.B0"!==r&&"hev1.2.4.L153.B0"!==r?/^vp(08|09|10)/.exec(r)?function(e){var t,n,r,i=e.split("."),a=i[0],o=(i[1],i[2],i[3]),s=(i[4],i[5]),u=i[6],l=i[7];if(("vp08"===a||"vp09"===a||"vp10"===a)&&((void 0!==o&&"10"===o||"12"===o)&&(t=parseInt(o,10)),void 0!==u&&("16"===u?n="pq":"18"===u&&(n="hlg")),void 0!==s&&void 0!==l&&"09"===s&&"09"===l&&(r="rec2020"),void 0!==t&&void 0!==n))return{colorDepth:t,eotf:n,colorSpace:r}}(r):void 0:{colorDepth:10,eotf:"pq",colorSpace:"rec2020"}}function $(e,t,n){for(var r,i,a,u,l,c=[],d=function(){for(var e=l.value,d=null!=e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(null!=e.attributes.height?"-"+e.attributes.height:"")+(null!=e.attributes.width?"-"+e.attributes.width:"")+(null!=e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(null!=e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===d}));)d+="-dup";var f=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(d))&&void 0!==i?i:null,v=function(e,t){var n=[];if(void 0!==e.children.inbandEventStreams&&n.push.apply(n,e.children.inbandEventStreams),void 0!==t.children.inbandEventStreams&&n.push.apply(n,t.children.inbandEventStreams),0!==n.length)return n}(e,t),p=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete,h=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+n.availabilityTimeOffset,m=function(e,t){var n,r,i,a=t.aggressiveMode,o=t.availabilityTimeOffset,s=t.manifestBoundsCalculator,u=t.isDynamic,l=t.end,c=t.start,d=t.receivedTime,f=t.timeShiftBufferDepth,v=t.unsafelyBaseOnPreviousRepresentation,p=t.inbandEventStreams,h={aggressiveMode:a,availabilityTimeComplete:!0,availabilityTimeOffset:o,unsafelyBaseOnPreviousRepresentation:v,isEMSGWhitelisted:function(e){return void 0!==p&&p.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:s,isDynamic:u,periodEnd:l,periodStart:c,receivedTime:d,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id,timeShiftBufferDepth:f};if(void 0!==e.children.segmentBase){var m=e.children.segmentBase;i=new I.Z(m,h)}else if(void 0!==e.children.segmentList){var g=e.children.segmentList;i=new C(g,h)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var y=t.parentSegmentTemplates.slice(),_=e.children.segmentTemplate;void 0!==_&&y.push(_);var b=x.Z.apply(void 0,[{}].concat(y));h.availabilityTimeComplete=null!==(n=b.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,h.availabilityTimeOffset=(null!==(r=b.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,i=H.isTimelineIndexArgument(b)?new H(b,h):new W(b,h)}else{var T=t.adaptation.children;if(void 0!==T.segmentBase){var E=T.segmentBase;i=new I.Z(E,h)}else if(void 0!==T.segmentList){var S=T.segmentList;i=new C(S,h)}else i=new W({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},h)}return i}(e,(0,x.Z)({},n,{availabilityTimeOffset:h,availabilityTimeComplete:p,unsafelyBaseOnPreviousRepresentation:f,adaptation:t,inbandEventStreams:v})),g=void 0;null==e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var y={bitrate:g,cdnMetadata:j(n.baseURLs,e.children.baseURLs).map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:m,id:d},_=void 0;null!=e.attributes.codecs?_=e.attributes.codecs:null!=t.attributes.codecs&&(_=t.attributes.codecs),null!=_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,y.codecs=_),null!=e.attributes.frameRate?y.frameRate=e.attributes.frameRate:null!=t.attributes.frameRate&&(y.frameRate=t.attributes.frameRate),null!=e.attributes.height?y.height=e.attributes.height:null!=t.attributes.height&&(y.height=t.attributes.height),null!=e.attributes.mimeType?y.mimeType=e.attributes.mimeType:null!=t.attributes.mimeType&&(y.mimeType=t.attributes.mimeType),null!=e.attributes.width?y.width=e.attributes.width:null!=t.attributes.width&&(y.width=t.attributes.width);var b=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&b.push.apply(b,e.children.contentProtections),b.length>0){var T=b.reduce((function(e,t){var n;if(void 0!==t.attributes.schemeIdUri&&"urn:uuid:"===t.attributes.schemeIdUri.substring(0,9)&&(n=t.attributes.schemeIdUri.substring(9).replace(/-/g,"").toLowerCase()),void 0!==t.attributes.keyId&&t.attributes.keyId.length>0){var r={keyId:t.attributes.keyId,systemId:n};void 0===e.keyIds?e.keyIds=[r]:e.keyIds.push(r)}if(void 0!==n){for(var i,a=[],o=q(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,c=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===c)e.initData.push({type:"cenc",values:a});else(l=c.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(T.initData).length>0||void 0!==T.keyIds&&T.keyIds.length>0)&&(y.contentProtections=T)}y.hdrInfo=X({adaptationProfiles:t.attributes.profiles,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(y)},f=q(e);!(l=f()).done;)d();return c}function Q(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ee(e){if(void 0===e)return!1;var t="urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"1"===e.value,n="urn:mpeg:dash:role:2011"===e.schemeIdUri&&"description"===e.value;return t||n}function te(e){return void 0!==e&&("urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value)}function ne(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function re(e,t){if((0,T.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isAudioDescription,i=t.isSignInterpreted,a=t.isTrickModeTrack,o=t.type;return(0,T.Z)(e.attributes.language)&&(o+="-"+e.attributes.language),!0===n&&(o+="-cc"),!0===r&&(o+="-ad"),!0===i&&(o+="-si"),a&&(o+="-trickMode"),(0,T.Z)(e.attributes.contentType)&&(o+="-"+e.attributes.contentType),(0,T.Z)(e.attributes.codecs)&&(o+="-"+e.attributes.codecs),(0,T.Z)(e.attributes.mimeType)&&(o+="-"+e.attributes.mimeType),(0,T.Z)(e.attributes.frameRate)&&(o+="-"+e.attributes.frameRate),o}function ie(e){if(null!=e.children.supplementalProperties)for(var t,n=Q(e.children.supplementalProperties);!(t=n()).done;){var r=t.value;if("urn:mpeg:dash:adaptation-set-switching:2016"===r.schemeIdUri&&null!=r.value)return r.value.split(",").map((function(e){return e.trim()})).filter((function(e){return e}))}return[]}function ae(e,t){var n=t[1].priority-e[1].priority;return 0!==n?n:e[1].isMainAdaptation!==t[1].isMainAdaptation?e[1].isMainAdaptation?-1:1:e[1].indexInMpd-t[1].indexInMpd}function oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return se(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return se(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ue=(0,p.Z)();function le(e,t){var n,r,i,a,u,l,c=[],d=function(e,t){var n=[];return e.forEach((function(r,i){var a,o;if(null!=r.attributes.start)a=r.attributes.start;else if(0===i)a=t.isDynamic&&null!=t.availabilityStartTime?t.availabilityStartTime:0;else{var s=n[n.length-1];if(null==s||null==s.periodEnd)throw new Error("Missing start time when parsing periods.");a=s.periodEnd}var u=e[i+1];null!=r.attributes.duration?o=r.attributes.duration:i===e.length-1?o=t.duration:null!=u.attributes.start&&(o=u.attributes.start-a);var l=null!=o?a+o:void 0;n.push({periodStart:a,periodDuration:o,periodEnd:l})})),n}(e,t);if(d.length!==e.length)throw new Error("MPD parsing error: the time information are incoherent.");var f=t.isDynamic,p=t.timeShiftBufferDepth,E=new g({isDynamic:f,timeShiftBufferDepth:p});f||null==t.duration||E.setLastPosition(t.duration);for(var S=function(g){var S=g===e.length-1,k=e[g],x=t.xlinkInfos.get(k),I=j(t.baseURLs,k.children.baseURLs),Z=d[g],R=Z.periodStart,M=Z.periodDuration,C=Z.periodEnd,P=void 0;for(null==k.attributes.id?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),P="gen-dash-period-"+ue()):P=k.attributes.id;c.some((function(e){return e.id===P}));)P+="-dup";var D=void 0!==x?x.receivedTime:t.receivedTime,N=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(P))&&void 0!==r?r:null,O=null===(i=k.attributes.availabilityTimeComplete)||void 0===i||i,L=null!==(a=k.attributes.availabilityTimeOffset)&&void 0!==a?a:0,B=t.aggressiveMode,U=t.manifestProfiles,F=k.children.segmentTemplate,z={aggressiveMode:B,availabilityTimeComplete:O,availabilityTimeOffset:L,baseURLs:I,manifestBoundsCalculator:E,end:C,isDynamic:f,isLastPeriod:S,manifestProfiles:U,receivedTime:D,segmentTemplate:F,start:R,timeShiftBufferDepth:p,unsafelyBaseOnPreviousPeriod:N},V=function(e,t){for(var n,r,i,a,u,l,c,d,f={video:[],audio:[],text:[],image:[]},v=[],p={},h=[],m=-1,g=0;g<e.length;g++){var E=e[g],S=E.children,k=S.essentialProperties,x=S.roles,I=S.label,Z=Array.isArray(x)&&x.some((function(e){return"main"===e.value}))&&x.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),R=E.children.representations,M=null!==(n=E.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,C=(null!==(r=E.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+t.availabilityTimeOffset,P=E.attributes.mimeType,D=E.attributes.codecs,N=A(R,(0,T.Z)(P)?P:null,(0,T.Z)(D)?D:null,null!=S.roles?S.roles:null);if(void 0!==N){var O=null!==(i=E.attributes.selectionPriority)&&void 0!==i?i:1,L=E.attributes.id,B=void 0,U=ie(E),F=[];void 0!==t.segmentTemplate&&F.push(t.segmentTemplate),void 0!==E.children.segmentTemplate&&F.push(E.children.segmentTemplate);var z={aggressiveMode:t.aggressiveMode,availabilityTimeComplete:M,availabilityTimeOffset:C,baseURLs:j(t.baseURLs,S.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:F,receivedTime:t.receivedTime,start:t.start,timeShiftBufferDepth:t.timeShiftBufferDepth,unsafelyBaseOnPreviousAdaptation:null},V=Array.isArray(k)?(0,s.Z)(k,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,K=null===(a=null==V?void 0:V.value)||void 0===a?void 0:a.split(" "),G=void 0!==K;if("video"===N&&Z&&m>=0&&f.video.length>m&&!G){var H,W=f.video[m][0];z.unsafelyBaseOnPreviousAdaptation=null!==(l=null===(u=t.unsafelyBaseOnPreviousPeriod)||void 0===u?void 0:u.getAdaptation(W.id))&&void 0!==l?l:null;var q=$(R,E,z);(H=W.representations).push.apply(H,q),B=W.id}else{var Y=S.accessibilities,X=void 0;void 0!==x&&x.some((function(e){return"dub"===e.value}))&&(X=!0);var J=void 0;"text"!==N?J=!1:void 0!==Y&&(J=Y.some(te));var oe=void 0;"audio"!==N?oe=!1:void 0!==Y&&(oe=Y.some(ee));var se=void 0;"video"!==N?se=!1:void 0!==Y&&(se=Y.some(ne));for(var ue=re(E,{isAudioDescription:oe,isClosedCaption:J,isSignInterpreted:se,isTrickModeTrack:G,type:N});(0,b.Z)(h,ue);)ue+="-dup";B=ue,h.push(ue),z.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(c=t.unsafelyBaseOnPreviousPeriod)||void 0===c?void 0:c.getAdaptation(ue))&&void 0!==d?d:null;var le={id:ue,representations:$(R,E,z),type:N,isTrickModeTrack:G};if(null!=E.attributes.language&&(le.language=E.attributes.language),null!=J&&(le.closedCaption=J),null!=oe&&(le.audioDescription=oe),!0===X&&(le.isDub=!0),!0===se&&(le.isSignInterpreted=!0),void 0!==I&&(le.label=I),void 0!==K)v.push({adaptation:le,trickModeAttachedAdaptationIds:K});else{for(var ce,de=-1,fe=function(){var e=ce.value,t=p[e];if(void 0!==t&&t.newID!==B&&(0,b.Z)(t.adaptationSetSwitchingIDs,L)){de=(0,_.Z)(f[N],(function(t){return t[0].id===e}));var n,r=f[N][de];void 0!==r&&r[0].audioDescription===le.audioDescription&&r[0].closedCaption===le.closedCaption&&r[0].language===le.language&&(o.Z.info('DASH Parser: merging "switchable" AdaptationSets',L,e),(n=r[0].representations).push.apply(n,le.representations),"video"===N&&Z&&!r[1].isMainAdaptation&&(m=Math.max(m,de)),r[1]={priority:Math.max(O,r[1].priority),isMainAdaptation:Z||r[1].isMainAdaptation,indexInMpd:Math.min(g,r[1].indexInMpd)})}},ve=Q(U);!(ce=ve()).done;)fe();de<0&&(f[N].push([le,{priority:O,isMainAdaptation:Z,indexInMpd:g}]),"video"===N&&Z&&(m=f.video.length-1))}}null!=L&&null==p[L]&&(p[L]={newID:B,adaptationSetSwitchingIDs:U})}}var pe=y.r.reduce((function(e,t){var n=f[t];return n.length>0&&(n.sort(ae),e[t]=n.map((function(e){return e[0]}))),e}),{});return f.video.sort(ae),w(pe,v),pe}(k.children.adaptations,z),K=(null!==(u=t.xmlNamespaces)&&void 0!==u?u:[]).concat(null!==(l=k.attributes.namespaces)&&void 0!==l?l:[]),G=function(e,t,n){for(var r,i,a,o=[],s=oe(e);!(a=s()).done;)for(var u,l=a.value,c=l.attributes,d=c.schemeIdUri,f=void 0===d?"":d,v=c.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),g=oe(l.children.events);!(u=g()).done;){var y=u.value;if(void 0!==y.eventStreamData){var _=(null!==(i=y.presentationTime)&&void 0!==i?i:0)/p+t,b=void 0===y.duration?void 0:_+y.duration/p,T=void 0;if(y.eventStreamData instanceof Element)T=y.eventStreamData;else{var E=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");E+=">";var S=(0,m.uR)(new Uint8Array(y.eventStreamData));T=(new DOMParser).parseFromString(E+S+"</toremove>","application/xml").documentElement.childNodes[0]}o.push({start:_,end:b,id:y.id,data:{type:"dash-event-stream",value:{schemeIdUri:f,timescale:p,element:T}}})}}return o}(k.children.eventStreams,R,K),H={id:P,start:R,end:C,duration:M,adaptations:V,streamEvents:G};if(c.unshift(H),!E.lastPositionIsKnown()){var W=function(e){for(var t,n=null,r=!0,i=(0,h.Z)(e).filter((function(e){return null!=e})),a=oe((0,v.Z)(i,(function(e){return e})));!(t=a()).done;)for(var o,s=oe(t.value.representations);!(o=s()).done;){var u=o.value.index.getLastAvailablePosition();null!==u&&(r=!1,"number"==typeof u&&(n=null==n?u:Math.max(n,u)))}if(null!=n)return n;if(r)return null;return}(V);if(f)if("number"==typeof W){var q=performance.now()/1e3;E.setLastPosition(W,q)}else{var Y=ce(t,R);if(void 0!==Y){var X=Y[0],J=Y[1];E.setLastPosition(X,J)}}else"number"==typeof W&&E.setLastPosition(W)}},k=e.length-1;k>=0;k--)S(k);if(t.isDynamic&&!E.lastPositionIsKnown()){var x=ce(t,0);if(void 0!==x){var I=x[0],Z=x[1];E.setLastPosition(I,Z)}}return function(e){if(0===e.length)return[];for(var t=[e[0]],n=1;n<e.length;n++){for(var r=e[n],i=t[t.length-1];(void 0===i.duration||i.start+i.duration>r.start)&&(o.Z.warn("DASH: Updating overlapping Periods.",null==i?void 0:i.start,r.start),i.duration=r.start-i.start,i.end=r.start,!(i.duration>0));)t.pop(),i=t[t.length-1];t.push(r)}return t}(c)}function ce(e,t){if(null!=e.clockOffset){var n=e.clockOffset/1e3-e.availabilityStartTime,r=performance.now()/1e3,i=r+n;if(i>=t)return[i,r]}else{var a=Date.now()/1e3;if(a>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[a-e.availabilityStartTime,performance.now()/1e3]}}function de(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ve=function e(t,n,r,i,c){void 0===c&&(c=new WeakMap);var d=t.children,v=t.attributes;if(null==n.externalClockOffset){var p="dynamic"===v.type,h=(0,s.Z)(d.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),m=null!=h&&null!=h.value?l(h.value):void 0,g=null==m||isNaN(m)?void 0:m;if(null!=g&&!0!==i)n.externalClockOffset=g;else if(p&&!0!==i){var y=function(e){var t=e.children.utcTimings.filter((function(e){return("urn:mpeg:dash:utc:http-iso:2014"===e.schemeIdUri||"urn:mpeg:dash:utc:http-xsdate:2014"===e.schemeIdUri)&&void 0!==e.value}));return t.length>0?t[0].value:void 0}(t);if(null!=y&&y.length>0)return{type:"needs-clock",value:{url:y,continue:function(i){return i.success?(n.externalClockOffset=l(i.data),e(t,n,r,!0)):(r.push(i.error),o.Z.warn("DASH Parser: Error on fetching the clock ressource",i.error),e(t,n,r,!0))}}}}}for(var _=[],b=0;b<d.periods.length;b++){var T=d.periods[b].attributes,E=T.xlinkHref,S=T.xlinkActuate;null!=E&&"onLoad"===S&&_.push({index:b,ressource:E})}return 0===_.length?function(e,t,n,r){var i,s,l,c,d,v,p=e.children,h=e.attributes,m="dynamic"===h.type,g=j(void 0!==t.url?[{url:t.url.substring(0,(0,u.$)(t.url))}]:[],p.baseURLs),y=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(h,t.referenceDateTime),_=h.timeShiftBufferDepth,b=t.externalClockOffset,T=t.unsafelyBaseOnPreviousManifest,E={aggressiveMode:t.aggressiveMode,availabilityStartTime:y,baseURLs:g,clockOffset:b,duration:h.duration,isDynamic:m,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:_,unsafelyBaseOnPreviousManifest:T,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},S=le(p.periods,E),w=h.duration,k=null;void 0!==h.minimumUpdatePeriod&&h.minimumUpdatePeriod>=0&&(c=0===h.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:h.minimumUpdatePeriod);var A=f(S),x=A.minimumSafePosition,I=A.maximumSafePosition,Z=A.maximumUnsafePosition,R=performance.now();if(m){var M,C;if(d=x,k=null!=_?_:null,void 0!==Z&&(C=Z),void 0!==I)M=I;else{var P=null!=y?y:0,D=t.externalClockOffset;if(void 0===D)o.Z.warn("DASH Parser: use system clock to define maximum position"),M=Date.now()/1e3-P;else M=(performance.now()+D)/1e3-P}void 0===C&&(C=M),v={isLinear:!0,maximumSafePosition:M,livePosition:C,time:R},null!==k&&void 0!==d&&M-d>k&&(k=M-d)}else{d=void 0!==x?x:void 0!==(null===(i=S[0])||void 0===i?void 0:i.start)?S[0].start:0;var N=null!=w?w:1/0;if(void 0!==S[S.length-1]){var O=S[S.length-1],L=null!==(s=O.end)&&void 0!==s?s:void 0!==O.duration?O.start+O.duration:void 0;void 0!==L&&L<N&&(N=L)}void 0!==I&&I<N&&(N=I),v={isLinear:!1,maximumSafePosition:N,livePosition:void 0,time:R}}var B=!m||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=S[S.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration);return{type:"done",value:{parsed:{availabilityStartTime:y,clockOffset:t.externalClockOffset,isDynamic:m,isLive:m,isLastPeriodKnown:B,periods:S,publishTime:h.publishTime,suggestedPresentationDelay:h.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:d,timeshiftDepth:k,maximumTimeData:v},lifetime:c,uris:null==t.url?p.locations:[t.url].concat(p.locations)},warnings:n}}}(t,n,r,c):{type:"needs-xlinks",value:{xlinksUrls:_.map((function(e){return e.ressource})),continue:function(a){if(a.length!==_.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=_[o].index,l=a[o],f=l.parsed,v=l.warnings,p=l.receivedTime,h=l.sendingTime,m=l.url;v.length>0&&r.push.apply(r,v);for(var g,y=de(f);!(g=y()).done;){var b=g.value;c.set(b,{receivedTime:p,sendingTime:h,url:m})}(s=d.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,c)}}}};function pe(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function he(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"id":t.id=r.value;break;case"lang":t.language=r.value;break;case"contentType":t.contentType=r.value;break;case"par":t.par=r.value}}return t}var me=n(7326),ge=n(4578),ye=n(2146),_e=n(9689),be=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Te=/([0-9]+)-([0-9]+)/;function Ee(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new Ce("`"+t+'` property is not a boolean value but "'+e+'"')]}function Se(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function we(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new Ce("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function ke(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new Ce("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ae(e,t){var n=Date.parse(e);return isNaN(n)?[null,new Ce("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,T.Z)(e))return[0,new Ce("`"+t+"` property is empty")];var n=be.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,T.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,T.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,T.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,T.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,T.Z)(n[10])?n[10]:"0")+parseFloat((0,T.Z)(n[12])?n[12]:"0"),null]}function Ie(e,t){var n=Te.exec(e);return null===n?[null,new Ce("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Ze(e,t){try{return[(0,_e.K)(e),null]}catch(n){return[null,new Ce("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Re(e){for(var t,n,r=0;r<e.attributes.length;r++){var i=e.attributes[r];switch(i.name){case"schemeIdUri":t=i.value;break;case"value":n=i.value}}return{schemeIdUri:t,value:n}}function Me(e,t){return function(n,r){var i=r.asKey,a=(0,r.parser)(n,r.dashName),s=a[0],u=a[1];null!==u&&(o.Z.warn(u.message),t.push(u)),null!==s&&(e[i]=s)}}var Ce=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,me.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,ge.Z)(t,e),t}((0,ye.Z)(Error));function Pe(e){var t=function(e){for(var t=[],n=[],r=0;r<e.length;r++)if(e[r].nodeType===Node.ELEMENT_NODE){var i=e[r];if("cenc:pssh"===i.nodeName){var a=i.textContent;if(null!==a&&a.length>0){var s=Ze(a,"cenc:pssh"),u=s[0],l=s[1];null!==l&&(o.Z.warn(l.message),t.push(l)),null!==u&&n.push(u)}}}return[{cencPssh:n},t]}(e.childNodes),n=t[0],r=t[1];return[{children:n,attributes:function(e){for(var t={},n=0;n<e.attributes.length;n++){var r=e.attributes[n];switch(r.name){case"schemeIdUri":t.schemeIdUri=r.value;break;case"value":t.value=r.value;break;case"cenc:default_KID":t.keyId=(0,m.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function De(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"range":r(a.value,{asKey:"range",parser:Ie,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Ne(e){for(var t={},n=[],r=Me(t,n),i=e.childNodes,a=0;a<i.length;a++)if(i[a].nodeType===Node.ELEMENT_NODE){var o=i[a];if("Initialization"===o.nodeName){var s=De(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var c=0;c<e.attributes.length;c++){var d=e.attributes[c];switch(d.name){case"timescale":r(d.value,{asKey:"timescale",parser:Se,dashName:"timescale"});break;case"presentationTimeOffset":r(d.value,{asKey:"presentationTimeOffset",parser:we,dashName:"presentationTimeOffset"});break;case"indexRange":r(d.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"indexRangeExact":r(d.value,{asKey:"indexRangeExact",parser:Ee,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(d.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(d.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"duration":r(d.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"startNumber":r(d.value,{asKey:"startNumber",parser:Se,dashName:"startNumber"})}}return[t,n]}function Oe(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"media":t.media=a.value;break;case"indexRange":r(a.value,{asKey:"indexRange",parser:Ie,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Ie,dashName:"mediaRange"})}}return[t,n]}function Le(e){for(var t=Ne(e),n=t[0],r=t[1],i=[],a=e.childNodes,o=0;o<a.length;o++)if(a[o].nodeType===Node.ELEMENT_NODE){var s=a[o];if("SegmentURL"===s.nodeName){var u=Oe(s),l=u[0],c=u[1];i.push(l),r=r.concat(c)}}return[(0,x.Z)(n,{list:i}),r]}function Be(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ue(e){for(var t,n=Ne(e),r=n[0],i=n[1],a=0;a<e.childNodes.length;a++)if(e.childNodes[a].nodeType===Node.ELEMENT_NODE){var o=e.childNodes[a];"SegmentTimeline"===o.nodeName&&(t=Be(o))}for(var s=(0,x.Z)({},r,{duration:r.duration,timelineParser:t}),u=Me(s,i),l=0;l<e.attributes.length;l++){var c=e.attributes[l];switch(c.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:c.value});break;case"index":s.index=c.value;break;case"availabilityTimeOffset":u(c.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(c.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"});break;case"media":s.media=c.value;break;case"bitstreamSwitching":u(c.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"})}}return[s,i]}function Fe(e){var t=function(e){for(var t={baseURLs:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"BaseURL":var o=pe(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),r=r.concat(u);break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Re(a));break;case"SegmentBase":var l=Ne(a),c=l[0],d=l[1];t.segmentBase=c,d.length>0&&(r=r.concat(d));break;case"SegmentList":var f=Le(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ue(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Pe(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"bandwidth":r(a.value,{asKey:"bitrate",parser:Se,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"qualityRanking":r(a.value,{asKey:"qualityRanking",parser:Se,dashName:"qualityRanking"});break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new Ce("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function ze(e){var t=function(e){for(var t={baseURLs:[],representations:[]},n=[],r=[],i=0;i<e.length;i++)if(e[i].nodeType===Node.ELEMENT_NODE){var a=e[i];switch(a.nodeName){case"Accessibility":void 0===t.accessibilities?t.accessibilities=[Re(a)]:t.accessibilities.push(Re(a));break;case"BaseURL":var o=pe(a),s=o[0],u=o[1];void 0!==s&&t.baseURLs.push(s),u.length>0&&(r=r.concat(u));break;case"ContentComponent":t.contentComponent=he(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Re(a)]:t.essentialProperties.push(Re(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Re(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var c=Fe(a),d=c[0],f=c[1];t.representations.push(d),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Re(a)]:t.roles.push(Re(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Re(a)]:t.supplementalProperties.push(Re(a));break;case"SegmentBase":var v=Ne(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Le(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Ue(a),b=_[0],T=_[1];t.segmentTemplate=b,T.length>0&&(r=r.concat(T));break;case"ContentProtection":var E=Pe(a),S=E[0],w=E[1];w.length>0&&(r=r.concat(w)),void 0!==S&&n.push(S)}}return n.length>0&&(t.contentProtections=n),[t,r]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"group":r(a.value,{asKey:"group",parser:Se,dashName:"group"});break;case"lang":t.language=a.value;break;case"contentType":t.contentType=a.value;break;case"par":t.par=a.value;break;case"minBandwidth":r(a.value,{asKey:"minBitrate",parser:Se,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:Se,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:Se,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:Se,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:Se,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:Se,dashName:"maxHeight"});break;case"minFrameRate":t.minFrameRate=a.value;break;case"maxFrameRate":t.maxFrameRate=a.value;break;case"selectionPriority":r(a.value,{asKey:"selectionPriority",parser:Se,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:ke,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:ke,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:Ee,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:Se,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:we,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:we,dashName:"maximumSAPPeriod"});break;case"mimeType":t.mimeType=a.value;break;case"profiles":t.profiles=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:Se,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:we,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:Ee,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ve(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Me(t.attributes,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"schemeIdUri":t.attributes.schemeIdUri=a.value;break;case"timescale":r(a.value,{asKey:"timescale",parser:Se,dashName:"timescale"});break;case"value":t.attributes.value=a.value}}for(var o=0;o<e.childNodes.length;o++)if(e.childNodes[o].nodeType===Node.ELEMENT_NODE){var s=e.childNodes[o];if("Event"===s.nodeName){var u=Ke(s),l=u[0],c=u[1];t.children.events.push(l),c.length>0&&(n=n.concat(c))}}return[t,n]}function Ke(e){for(var t={eventStreamData:e},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"presentationTime":r(a.value,{asKey:"presentationTime",parser:Se,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:Se,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}function Ge(e){var t=function(e){for(var t,n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=pe(s),l=u[0],c=u[1];void 0!==l&&n.push(l),i=i.concat(c);break;case"AdaptationSet":var d=ze(s),f=d[0],v=d[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Ve(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ue(s),y=g[0],_=g[1];t=y,_.length>0&&(i=i.concat(_))}}return[{baseURLs:n,adaptations:r,eventStreams:a,segmentTemplate:t},i]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"start":r(a.value,{asKey:"start",parser:xe,dashName:"start"});break;case"duration":r(a.value,{asKey:"duration",parser:xe,dashName:"duration"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:Ee,dashName:"bitstreamSwitching"});break;case"xlink:href":t.xlinkHref=a.value;break;case"xlink:actuate":t.xlinkActuate=a.value}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function He(e){var t=function(e){for(var t=[],n=[],r=[],i=[],a=[],o=0;o<e.length;o++)if(e[o].nodeType===Node.ELEMENT_NODE){var s=e[o];switch(s.nodeName){case"BaseURL":var u=pe(s),l=u[0],c=u[1];void 0!==l&&t.push(l),a=a.concat(c);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var d=Ge(s),f=d[0],v=d[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Re(s);i.push(p)}}return[{baseURLs:t,locations:n,periods:r,utcTimings:i},a]}(e.childNodes),n=t[0],r=t[1],i=function(e){for(var t={},n=[],r=Me(t,n),i=0;i<e.attributes.length;i++){var a=e.attributes[i];switch(a.name){case"id":t.id=a.value;break;case"profiles":t.profiles=a.value;break;case"type":t.type=a.value;break;case"availabilityStartTime":r(a.value,{asKey:"availabilityStartTime",parser:Ae,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ae,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ae,dashName:"publishTime"});break;case"mediaPresentationDuration":r(a.value,{asKey:"duration",parser:xe,dashName:"mediaPresentationDuration"});break;case"minimumUpdatePeriod":r(a.value,{asKey:"minimumUpdatePeriod",parser:xe,dashName:"minimumUpdatePeriod"});break;case"minBufferTime":r(a.value,{asKey:"minBufferTime",parser:xe,dashName:"minBufferTime"});break;case"timeShiftBufferDepth":r(a.value,{asKey:"timeShiftBufferDepth",parser:xe,dashName:"timeShiftBufferDepth"});break;case"suggestedPresentationDelay":r(a.value,{asKey:"suggestedPresentationDelay",parser:xe,dashName:"suggestedPresentationDelay"});break;case"maxSegmentDuration":r(a.value,{asKey:"maxSegmentDuration",parser:xe,dashName:"maxSegmentDuration"});break;case"maxSubsegmentDuration":r(a.value,{asKey:"maxSubsegmentDuration",parser:xe,dashName:"maxSubsegmentDuration"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}var We=function(e,t){var n=e.documentElement;if((0,i.Z)(n)||"MPD"!==n.nodeName)throw new Error("DASH Parser: document root should be MPD");var a=He(n),o=a[0],s=a[1];return function e(t){if("done"===t.type)return t;if("needs-clock"===t.type)return{type:"needs-resources",value:{urls:[t.value.url],format:"string",continue:function(n){if(1!==n.length)throw new Error("DASH parser: wrong number of loaded ressources.");var r=t.value.continue(n[0].responseData);return e(r)}}};if("needs-xlinks"===t.type)return{type:"needs-resources",value:{urls:t.value.xlinksUrls,format:"string",continue:function(n){for(var r=[],i=0;i<n.length;i++){var a=n[i],o=a.responseData,s=a.receivedTime,u=a.sendingTime,l=a.url;if(!o.success)throw o.error;var c="<root>"+o.data+"</root>",d=(new DOMParser).parseFromString(c,"text/xml");if(null==d||0===d.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=d.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m,g=Ge(f[h]),y=g[0],_=g[1];(m=p).push.apply(m,_),v.push(y)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var b=t.value.continue(r);return e(b)}}};(0,r.Z)(t)}(ve(o,t,s))}},8232:function(e,t,n){"use strict";function r(e,t){for(var n=0;e.length>0;){var r=e[0];if(r.start>=t)return n;if(-1===r.repeatCount)return n;if(0===r.repeatCount)e.shift(),n+=1;else{var i=e[1];if(void 0!==i&&i.start<=t)e.shift(),n+=1;else{if(r.duration<=0)return n;for(var a=r.start+r.duration,o=1;a<t&&o<=r.repeatCount;)a+=r.duration,o++;if(!(o>r.repeatCount)){var s=r.repeatCount-o;return r.start=a,r.repeatCount=s,n+=o}e.shift(),n=r.repeatCount+1}}}return n}n.d(t,{Z:function(){return r}})},3911:function(e,t,n){"use strict";n.d(t,{KF:function(){return i},PZ:function(){return u},_j:function(){return l},gT:function(){return o},jH:function(){return a},zG:function(){return s}});var r=n(1946);function i(e,t,n){var i,a=e.repeatCount;return a>=0?a:(i=(0,r.Z)(t)?void 0!==n?n:Number.MAX_VALUE:t.start,Math.ceil((i-e.start)/e.duration)-1)}function a(e,t,n){var r=e.start,a=e.duration;return a<=0?r:r+(i(e,t,n)+1)*a}function o(e,t){var n;return e*t.timescale+(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0)}function s(e,t){var n;return(e-(null!==(n=t.indexTimeOffset)&&void 0!==n?n:0))/t.timescale}function u(e,t,n){return[e*n,(e+t)*n]}function l(e,t,n){var r=e.timeline,i=o(t,e);if(i<0)return null;var u=function(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;e[i].start<=t?n=i+1:r=i}return n-1}(r,i);if(u<0||u>=r.length-1)return null;var l=r[u];if(l.duration<=0)return null;var c=r[u+1];if(void 0===c)return null;var d=c.start;return i>=a(l,c,n)&&i<d?s(d,e):null}},1091:function(e,t,n){"use strict";function r(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=(a.start-r)/n;if(o>e.time)return!1;if(o===e.time)return void 0===a.range?void 0===e.range:null!=e.range&&a.range[0]===e.range[0]&&a.range[1]===e.range[1];if(a.repeatCount>=0&&void 0!==a.duration){var s=(o-a.start)/a.duration-1;return s%1==0&&s<=a.repeatCount}}return!1}n.d(t,{Z:function(){return r}})},5505:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3714),i=n(3887),a=n(3911);function o(e,t){if(0===e.length)return e.push.apply(e,t),!0;if(0===t.length)return!1;var n=e.length,o=t[0].start,s=e[n-1];if((0,a.jH)(s,t[0])<o)throw new r.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");for(var u=n-1;u>=0;u--){var l=e[u].start;if(l===o){var c=n-u;return e.splice.apply(e,[u,c].concat(t)),!1}if(l<o){var d=e[u];if(d.start+d.duration>o)return i.Z.warn("RepresentationIndex: Manifest update removed all previous segments"),e.splice.apply(e,[0,n].concat(t)),!0;if(void 0===d.repeatCount||d.repeatCount<=0)return d.repeatCount<0&&(d.repeatCount=Math.floor((o-d.start)/d.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(d.start+d.duration*(d.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-d.start)/d.duration-1;if(f%1==0&&d.duration===t[0].duration){var v=t[0].repeatCount<0?-1:t[0].repeatCount+f+1;return e.splice.apply(e,[u,n-u].concat(t)),e[u].start=d.start,e[u].repeatCount=v,!1}return i.Z.warn("RepresentationIndex: Manifest update removed previous segments"),e[u].repeatCount=Math.floor(f),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1}}var p=e[e.length-1],h=t[t.length-1];return void 0!==p.repeatCount&&p.repeatCount<0?p.start>h.start?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0):p.start+p.duration*(p.repeatCount+1)>=h.start+h.duration*(h.repeatCount+1)?(i.Z.warn("RepresentationIndex: The new index is older than the previous one"),!1):(i.Z.warn('RepresentationIndex: The new index is "bigger" than the previous one'),e.splice.apply(e,[0,n].concat(t)),!0)}},5734:function(e,t,n){"use strict";var r=n(6923),i=/&#([0-9]+);/g,a=/<br>/gi,o=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,s=/\s*<p (?:class=([^>]+))?>(.*)/i,u=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function l(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var c,d,f=/<sync[ >]/gi,v=/<sync[ >]|<\/body>/gi,p=[],h=o.exec(e),m=Array.isArray(h)?h[1]:"";v.exec(e);var g,y=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);null!==r;){var i=r[1],a=l(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(m),_=function(e){var t=/p\s*{([^}]*)}/gi.exec(e);return null===t?"":t[1]}(m);if((0,r.Z)(n)&&void 0===(g=y[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;c=f.exec(e),d=v.exec(e),null!==c||null!==d;){if(null===c||null===d||c.index>=d.index)throw new Error("parse error");var b=e.slice(c.index,d.index),T=u.exec(b);if(!Array.isArray(T))throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return p;function S(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],c=u[2];if(g===l)if("&nbsp;"===c)p[p.length-1].end=n;else{var d=document.createElement("DIV");d.className="rxp-texttrack-region";var f=document.createElement("DIV");f.className="rxp-texttrack-div",f.style.position="absolute",f.style.bottom="0",f.style.width="100%",f.style.color="#fff",f.style.textShadow="-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000";var v=document.createElement("div");v.className="rxp-texttrack-p",(0,r.Z)(_)&&(v.style.cssText=_);for(var h=c.split(a),m=0;m<h.length;m++){0!==m&&v.appendChild(document.createElement("BR"));var y=document.createElement("SPAN");y.className="rxp-texttrack-span",y.textContent=h[m].replace(i,(function(e,t){return String.fromCharCode(Number(t))})),v.appendChild(y)}f.appendChild(v),d.appendChild(f),p.push({element:d,start:n+t,end:-1})}}}}}},1812:function(e,t,n){"use strict";var r=n(7253),i=n(6923),a=/&#([0-9]+);/g,o=/<br>/gi,s=/<style[^>]*>([\s\S]*?)<\/style[^>]*>/i,u=/\s*<p (?:class=([^>]+))?>(.*)/i,l=/<sync[^>]+?start="?([0-9]*)"?[^0-9]/i;function c(e,t){var n=new RegExp("\\s*"+t+":\\s*(\\S+);","i").exec(e);return Array.isArray(n)?n[1]:null}t.Z=function(e,t,n){var d,f,v=/<sync[ >]/gi,p=/<sync[ >]|<\/body>/gi,h=[],m=s.exec(e),g=null!==m?m[1]:"";p.exec(e);var y,_=function(e){for(var t=/\.(\S+)\s*{([^}]*)}/gi,n={},r=t.exec(e);Array.isArray(r);){var i=r[1],a=c(r[2],"lang");null!=i&&null!=a&&(n[a]=i),r=t.exec(e)}return n}(g);if((0,i.Z)(n)&&void 0===(y=_[n]))throw new Error("sami: could not find lang "+n+" in CSS");for(;d=v.exec(e),f=p.exec(e),null!==d||null!==f;){if(null===d||null===f||d.index>=f.index)throw new Error("parse error");var b=e.slice(d.index,f.index),T=l.exec(b);if(null===T)throw new Error("parse error (sync time attribute)");var E=+T[1];if(isNaN(E))throw new Error("parse error (sync time attribute NaN)");S(b.split("\n"),E/1e3)}return function(e){for(var t=[],n=0;n<e.length;n++){var a=e[n],o=a.start,s=a.end,u=a.text;if((0,i.Z)(u)&&null!=s){var l=(0,r.Z)(o,s,u);null!=l&&t.push(l)}}return t}(h);function S(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,c=l[1],d=l[2];y===c&&("&nbsp;"===d?h[h.length-1].end=n:h.push({text:(i=d,i.replace(o,"\n").replace(a,(function(e,t){return String.fromCharCode(Number(t))}))),start:n+t}))}}}},2061:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}function a(e){for(var t=[],n=0;n<e.length;n++)if((0,r.Z)(e[n])){var a=i(e,n),o=e.slice(n,a);o.length>0&&(1===o.length?o[0].indexOf("--\x3e")>=0&&t.push(o):(o[1].indexOf("--\x3e")>=0||o[0].indexOf("--\x3e")>=0)&&t.push(o)),n=a}return t}},8675:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2061),i=n(788);function a(e,t){for(var n=e.split(/\r\n|\n|\r/),a=(0,r.Z)(n),s=[],u=0;u<a.length;u++){var l=(0,i.Z)(a[u],t);if(null!=l){var c=o(l);null!=c&&s.push(c)}}return s}function o(e){var t=e.start,n=e.end,r=e.payload,i=document.createElement("div");i.className="rxp-texttrack-p",i.style.fontSize="28px",i.style.position="absolute",i.style.bottom="5%",i.style.width="100%",i.style.textAlign="center",i.style.color="#fff",i.style.textShadow="-1px -1px 2px #000,1px -1px 2px #000,-1px 1px 2px #000,1px 1px 2px #000";for(var a=0;a<r.length;a++){0!==a&&i.appendChild(document.createElement("br"));var o=s(r[a]);i.appendChild(o)}return{start:t,end:n,element:i}}function s(e){var t=document.createElement("div");t.innerHTML=e;return function e(t){var n=t.childNodes,r=document.createElement("span");r.className="rxp-texttrack-span";for(var i=0;i<n.length;i++){var a=n[i];if("#text"===a.nodeName){for(var o=a.wholeText.split("\n"),s=0;s<o.length;s++)if(0!==s&&r.appendChild(document.createElement("br")),o[s].length>0){var l=document.createTextNode(o[s]);r.appendChild(l)}}else if("B"===a.nodeName){var c=e(a);c.style.fontWeight="bold",r.appendChild(c)}else if("I"===a.nodeName){var d=e(a);d.style.fontStyle="italic",r.appendChild(d)}else if("U"===a.nodeName){var f=e(a);f.style.textDecoration="underline",r.appendChild(f)}else if(u(a)&&"string"==typeof a.color){var v=e(a);v.style.color=a.color,r.appendChild(v)}else{var p=e(a);r.appendChild(p)}}return r}(t)}function u(e){return"FONT"===e.nodeName&&"color"in e}},8057:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7253),i=n(2061),a=n(788);function o(e,t){for(var n,o,s,u,l,c=e.split(/\r\n|\n|\r/),d=(0,i.Z)(c),f=[],v=0;v<d.length;v++){var p=(0,a.Z)(d[v],t);if(null!==p){var h=(o=void 0,s=void 0,u=void 0,l=void 0,o=(n=p).start,s=n.end,u=n.payload,l=u.join("\n"),(0,r.Z)(o,s,l));null!==h&&f.push(h)}}return f}},788:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":");if((0,r.Z)(t[2])){var n=parseInt(t[0],10),i=parseInt(t[1],10),a=parseFloat(t[2].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){if(0===e.length)return null;var n,a,o=[];if((0,r.Z)(e[1])&&-1!==e[1].indexOf("--\x3e")){var s=e[1].split("--\x3e").map((function(e){return e.trim()}));n=s[0],a=s[1],o=e.slice(2,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a)){var u=e[0].split("--\x3e").map((function(e){return e.trim()}));n=u[0],a=u[1],o=e.slice(1,e.length)}if(!(0,r.Z)(n)||!(0,r.Z)(a))return null;var l=i(n),c=i(a);return void 0===l||void 0===c?null:{start:l+t,end:c+t,payload:o}}},3791:function(e,t,n){"use strict";n.d(t,{U:function(){return s},b:function(){return u}});var r=n(3274),i=n(7714),a=n(6923),o=n(9252);function s(e,t,n,o){for(var s={},u=e.slice(),l=0;l<=t.length-1;l++){var c=t[l];if(void 0!==c){var d=function(){var e=void 0,t=void 0;if(c.nodeType===Node.ELEMENT_NODE)for(var l=c,d=0;d<=l.attributes.length-1;d++){var f=l.attributes[d],v=f.name;if("style"===v)e=f.value;else if("region"===v)t=f.value;else{var p=v.substring(4);if((0,i.Z)(u,p)&&(s[p]=f.value,u.splice(d,1),0===u.length))return{v:s}}}if((0,a.Z)(e)){var h=(0,r.Z)(n,(function(t){return t.id===e}));if(void 0!==h)for(var m=0;m<=u.length-1;m++){var g=u[m];if(!(0,a.Z)(s[g])&&(0,a.Z)(h.style[g])){if(s[g]=h.style[g],u.splice(m,1),0===u.length)return{v:s};m--}}}if((0,a.Z)(t)){var y=(0,r.Z)(o,(function(e){return e.id===t}));if(void 0!==y)for(var _=0;_<=u.length-1;_++){var b=u[_];if(!(0,a.Z)(s[b])&&(0,a.Z)(y.style[b])){if(s[b]=y.style[b],u.splice(_,1),0===u.length)return{v:s};_--}}}}();if("object"==typeof d)return d.v}}return s}function u(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};for(var t=e,n={},r=0;r<=t.attributes.length-1;r++){var i=t.attributes[r];if((0,o.Z)(i.name,"tts"))n[i.name.substring(4)]=i.value}return n}},6177:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6923),i=n(5336);function a(e,t){var n=e.exec(t);if(null===n||""===n[0])return null;var r=Number(n[1]);isNaN(r)&&(r=0);var i=Number(n[2]);isNaN(i)&&(i=0);var a=Number(n[3]);isNaN(a)&&(a=0);var o=Number(n[4]);return isNaN(o)&&(o=0),o/1e3+a+60*i+3600*r}var o=function(e,t){return i.gu.test(e)?function(e,t){var n=i.gu.exec(t),r=Number(n[1]),a=Number(n[2]),o=Number(n[3]),s=Number(n[4]),u=Number(n[5]);isNaN(u)&&(u=0);return s+=u/e.subFrameRate,(o+=s/e.frameRate)+60*a+3600*r}(t,e):i.KO.test(e)?a(i.KO,e):i.wf.test(e)?a(i.wf,e):i.jb.test(e)?function(e,t){var n=i.jb.exec(t);return Number(n[1])/e.frameRate}(t,e):i.Du.test(e)?function(e,t){var n=i.Du.exec(t);return Number(n[1])/e.tickRate}(t,e):i.te.test(e)?a(i.te,e):void 0};function s(e,t){var n=e.getAttribute("begin"),i=e.getAttribute("dur"),a=e.getAttribute("end"),s=(0,r.Z)(n)?o(n,t):null,u=(0,r.Z)(i)?o(i,t):null,l=(0,r.Z)(a)?o(a,t):null;if(null==s||null==l&&null==u)throw new Error("Invalid text cue");return{start:s,end:null==l?s+u:l}}},7439:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(959);function i(e){return void 0===e.extent&&void 0===e.origin&&void 0===e.displayAlign&&void 0===e.display&&void 0===e.textAlign&&void 0===e.fontSize}function a(e){e.extent="70% 20%",e.fontSize="1c",e.origin="15% 80%",e.displayAlign="before",e.textAlign="center"}var o,s=n(6177);function u(e,t){(void 0===o&&(o=void 0!==e.classList&&"function"==typeof e.classList.add),o)?e.classList.add(t):(" "+e.className+" ").indexOf(" "+t+" ")<0&&(e.className+=" "+t)}var l=n(6923),c=n(8026),d=n(3791),f=n(1594),v=n(3887),p=n(5336);function h(e,t){var n=t;return(0,l.Z)(t)&&t.trim().endsWith("%")&&(n=t.trim().slice(0,-1),n=(parseInt(n,10)/100).toString()+"em"),"-1px -1px "+n+" "+e+",1px -1px "+n+" "+e+",-1px 1px "+n+" "+e+",1px 1px "+n+" "+e}function m(e){var t;return null!=(t=p.Dq.exec(e))?"rgba("+String(parseInt(t[1],16))+","+String(parseInt(t[2],16))+","+String(parseInt(t[3],16))+","+String(parseInt(t[4],16)/255)+")":null!=(t=p.YU.exec(e))?"rgba("+String(parseInt(t[1]+t[1],16))+","+String(parseInt(t[2]+t[2],16))+","+String(parseInt(t[3]+t[3],16))+","+String(parseInt(t[4]+t[4],16)/255)+")":null!=(t=p.GK.exec(e))?"rgb("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+")":null!=(t=p.ev.exec(e))?"rgba("+String(+t[1])+","+String(+t[2])+","+String(+t[3])+","+String(+t[4]/255)+")":e}var g=["color","direction","display","fontFamily","fontSize","fontStyle","fontWeight","textDecoration","textOutline","unicodeBidi","visibility","wrapOption"];function y(e,t,n){var r=t.color;(0,l.Z)(r)&&(e.style.color=m(r));var i=t.backgroundColor;(0,l.Z)(i)&&(e.style.backgroundColor=m(i));var a=t.textOutline;if((0,l.Z)(a)){var o=a.trim().replace(/\s+/g," ").split(" "),s=o.length;if(3===s){var c=m(o[0]),d=o[1];e.style.textShadow=h(c,d)}else if((0,l.Z)(r)&&1===s){var f=o[0];e.style.textShadow=h(r,f)}else if(2===s){var g=/^[#A-Z]/i.test(o[0]);if(g!==/^[0-9]/.test(o[0]))if(g){var y=m(o[0]),_=o[1];e.style.textShadow=h(y,_)}else if((0,l.Z)(r)){var b=o[0];e.style.textShadow=h(r,b)}}}var T=t.textDecoration;if((0,l.Z)(T))switch(T){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=T}var E=t.fontFamily;if((0,l.Z)(E))switch(E){case"proportionalSansSerif":e.style.fontFamily="Arial, Helvetica, Liberation Sans, sans-serif";break;case"monospaceSansSerif":case"sansSerif":e.style.fontFamily="sans-serif";break;case"monospaceSerif":case"default":e.style.fontFamily="Courier New, Liberation Mono, monospace";break;case"proportionalSerif":e.style.fontFamily="serif";break;default:e.style.fontFamily=E}var S=t.fontStyle;(0,l.Z)(S)&&(e.style.fontStyle=S);var w=t.fontWeight;(0,l.Z)(w)&&(e.style.fontWeight=w);var k=t.fontSize;(0,l.Z)(k)?function(e,t){var n=t.trim().split(" ");if(0!==n.length){var r=p.eT.exec(n[0]);if(null!==r)if("px"===r[2]||"em"===r[2])e.style.fontSize=r[1]+r[2];else if("c"===r[2])e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",r[1]);else if("%"===r[2]){var i=Number(r[1]);isNaN(i)?v.Z.warn('TTML Parser: could not parse fontSize value "'+r[1]+'" into a number'):(e.style.position="relative",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size",String(i/100)))}else v.Z.warn("TTML Parser: unhandled fontSize unit:",r[2])}}(e,k):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var x=t.unicodeBidi;if((0,l.Z)(x))switch(x){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var I=t.visibility;(0,l.Z)(I)&&(e.style.visibility=I),"none"===t.display&&(e.style.display="none");var Z=t.wrapOption;e.style.whiteSpace="noWrap"===Z?n?"nowrap":"pre":n?"normal":"pre-wrap"}function _(e,t){e.style.color="white",e.style.position="absolute";var n=t.extent;(0,l.Z)(n)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.width=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-width",i[1])):v.Z.warn("TTML Parser: unhandled extent unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.height=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-height",a[1])):v.Z.warn("TTML Parser: unhandled extent unit:",a[2]))}}}(e,n);var r=t.writingMode;(0,l.Z)(r);var i=t.overflow;e.style.overflow=(0,l.Z)(i)?i:"hidden";var a=t.padding;(0,l.Z)(a)&&function(e,t){var n=t.trim().split(" ");if(!(n.length<1)){var r=p.eT.exec(n[0]);if(null!==r){if("px"===r[2]||"%"===r[2]||"em"===r[2]){var i=r[1]+r[2];1===n.length?e.style.padding=i:2===n.length?(e.style.paddingTop=i,e.style.paddingBottom=i):e.style.paddingTop=i}else"c"===r[2]?(u(e,"proportional-style"),1===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1]),e.setAttribute("data-proportional-padding-left",r[1]),e.setAttribute("data-proportional-padding-right",r[1])):2===n.length?(e.setAttribute("data-proportional-padding-top",r[1]),e.setAttribute("data-proportional-padding-bottom",r[1])):e.setAttribute("data-proportional-padding-top",r[1])):v.Z.warn("TTML Parser: unhandled padding unit:",r[2]);if(1!==n.length){var a=p.eT.exec(n[1]);if(null!==a){if("px"===a[2]||"%"===a[2]||"em"===a[2]){var o=a[1]+a[2];n.length<4?(e.style.paddingLeft=o,e.style.paddingRight=o):e.style.paddingRight=o}else"c"===a[2]?(u(e,"proportional-style"),n.length<4?(e.setAttribute("data-proportional-padding-left",a[1]),e.setAttribute("data-proportional-padding-right",a[1])):e.setAttribute("data-proportional-padding-right",a[1])):v.Z.warn("TTML Parser: unhandled padding unit:",a[2]);if(2!==n.length){var s=p.eT.exec(n[2]);if(null!==s){if("px"===s[2]||"%"===s[2]||"em"===s[2]){var l=s[1]+s[2];e.style.paddingBottom=l}else"c"===s[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-bottom",s[1])):v.Z.warn("TTML Parser: unhandled padding unit:",s[2]);if(3!==n.length){var c=p.eT.exec(n[3]);if(null!==c)if("px"===c[2]||"%"===c[2]||"em"===c[2]){var d=c[1]+c[2];e.style.paddingLeft=d}else"c"===c[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",c[1])):v.Z.warn("TTML Parser: unhandled padding unit:",c[2])}}}}}}}}(e,a);var o=t.origin;(0,l.Z)(o)&&function(e,t){var n=t.trim();if("auto"!==n){var r=n.split(" ");if(2===r.length){var i=p.eT.exec(r[0]),a=p.eT.exec(r[1]);null!==i&&null!==a&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.left=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-left",i[1])):v.Z.warn("TTML Parser: unhandled origin unit:",i[2]),"px"===a[2]||"%"===a[2]||"em"===a[2]?e.style.top=a[1]+a[2]:"c"===a[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-top",a[1])):v.Z.warn("TTML Parser: unhandled origin unit:",a[2]))}}}(e,o);var s=t.displayAlign;if((0,l.Z)(s))switch(e.style.display="flex",e.style.flexDirection="column",s){case"before":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"after":e.style.justifyContent="flex-end"}var c=t.opacity;(0,l.Z)(c)&&(e.style.opacity=c);var d=t.visibility;(0,l.Z)(d)&&(e.style.visibility=d),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px";var n=t.backgroundColor;(0,l.Z)(n)&&(e.style.backgroundColor=m(n));var r=t.lineHeight;(0,l.Z)(r)&&function(e,t){var n=t.trim();if("auto"!==n){var r=p.eT.exec(n[0]);null!==r&&("px"===r[2]||"%"===r[2]||"em"===r[2]?e.style.lineHeight=r[1]+r[2]:"c"===r[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",r[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",r[2]))}}(e,r);var i=t.textAlign;if((0,l.Z)(i))switch(i){case"center":e.style.textAlign="center";break;case"left":case"start":e.style.textAlign="left";break;case"right":case"end":e.style.textAlign="right"}}function T(e,t,n){var r=document.createElement("span"),i=null===e.textContent?"":e.textContent;if(n){var a=i.trim();i=a=a.replace(/\s+/g," ")}var o=document.createTextNode(i);return r.appendChild(o),r.className="rxp-texttrack-span",y(r,t,n),r}function E(e,t,n,r,i,a){var o=a.cellResolution,s=a.shouldTrimWhiteSpace,u=(0,f.jF)(e),v=document.createElement("DIV");if(v.className="rxp-texttrack-region",v.setAttribute("data-resolution-columns",String(o.columns)),v.setAttribute("data-resolution-rows",String(o.rows)),_(v,i),null!==t){var p=(0,d.U)(["backgroundColor"],[].concat(u,[t]),r,n).bodyBackgroundColor;(0,l.Z)(p)&&(v.style.backgroundColor=m(p))}var h=document.createElement("p");h.className="rxp-texttrack-p",b(h,i);for(var y=function(e,t,n,r,i){return function e(r,i,a,o){for(var s=r.childNodes,u=[],v=0;v<s.length;v++){var p=s[v];if("#text"===p.nodeName){var h=(0,d.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=T(p,i,o);u.push(m)}else if((0,f.OE)(p)){var y=document.createElement("BR");u.push(y)}else if((0,f.jg)(p)&&p.nodeType===Node.ELEMENT_NODE&&p.childNodes.length>0){var _=p.getAttribute("xml:space"),b=(0,l.Z)(_)?"default"===_:o,E=(0,c.Z)({},i,(0,d.U)(g,[p],n,t));u.push.apply(u,e(p,E,[p].concat(a),b))}}return u}(e,(0,c.Z)({},r),[],i)}(e,n,r,i,s),E=0;E<y.length;E++)h.appendChild(y[E]);return v.appendChild(h),v}function S(e){var t=e.paragraph,n=e.ttParams,r=e.body,i=e.regionStyles,a=e.idStyles,o=e.paragraphStyle,u=e.timeOffset,l=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var c=n.cellResolution,d=(0,s.Z)(t,n);return{start:d.start+u,end:d.end+u,element:E(t,r,i,a,o,{cellResolution:c,shouldTrimWhiteSpace:l})}}var w=function(e,t){for(var n=(0,r.Z)(e,t),o=[],s=0;s<n.length;s++){var u=n[s].paragraphStyle;i(u)&&a(u);var l=S(n[s]);null!==l&&o.push(l)}return o}},1570:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(959),i=n(7253),a=n(1988),o=n(6923),s=n(6177),u=n(5336),l=n(1594),c={left:"start",center:"center",right:"end",start:"start",end:"end"},d={left:"line-left",center:"center",right:"line-right"};function f(e){var t=e.paragraph,n=e.timeOffset,r=e.paragraphStyle,f=e.ttParams,v=e.shouldTrimWhiteSpace;if(!t.hasAttribute("begin")&&!t.hasAttribute("end")&&/^\s*$/.test(null===t.textContent?"":t.textContent))return null;var p=(0,s.Z)(t,f),h=p.start,m=p.end,g=function(e,t){function n(e,t){for(var r=e.childNodes,i="",a=0;a<r.length;a++){var s=r[a];if("#text"===s.nodeName){var u=s.textContent;if(null===u&&(u=""),t){var c=u.trim();u=c=c.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&amp;").replace(/<|\u003C/g,"&lt;").replace(/>|\u2265/g,"&gt;").replace(/\u200E/g,"&lrm;").replace(/\u200F/g,"&rlm;").replace(/\u00A0/g,"&nbsp;")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var d=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(d)?"default"===d:t)}}return i}return n(e,t)}(t,v),y=(0,i.Z)(h+n,m+n,g);return null===y?null:((0,a.Z)(y)&&function(e,t){var n=t.extent;if((0,o.Z)(n)){var r=u._0.exec(n);null!=r&&(e.size=Number(r[1]))}switch(t.writingMode){case"tb":case"tblr":e.vertical="lr";break;case"tbrl":e.vertical="rl"}var i=t.origin;if((0,o.Z)(i))u._0.exec(i);var a=t.align;if((0,o.Z)(a)){e.align=a,"center"===a&&("center"!==e.align&&(e.align="middle"),e.position="auto");var s=d[a];e.positionAlign=void 0===s?"":s;var l=c[a];e.lineAlign=void 0===l?"":l}}(y,r),y)}var v=function(e,t){for(var n=(0,r.Z)(e,t),i=[],a=0;a<n.length;a++){var o=f(n[a]);null!==o&&i.push(o)}return i}},959:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(3274),i=n(6923),a=n(8026),o=n(3887),s=/(\d+) (\d+)/;var u=n(3791),l=n(5138),c=n(7714);var d=n(1594),f=["align","backgroundColor","color","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode"];function v(e,t){var n=[],v=(new DOMParser).parseFromString(e,"text/xml");if(null!=v){var p=v.getElementsByTagName("tt")[0];if(void 0===p)if(void 0===(p=v.getElementsByTagNameNS("*","tt")[0]))throw new Error("invalid XML");for(var h=(0,d.H)(p),m=(0,d.vU)(p),g=(0,d.DM)(p),y=(0,d.kd)(p),_=function(e){var t=e.getAttribute("ttp:frameRate"),n=e.getAttribute("ttp:subFramRate"),r=e.getAttribute("ttp:tickRate"),a=e.getAttribute("ttp:frameRateMultiplier"),u=e.getAttribute("xml:space"),l=e.getAttribute("ttp:cellResolution"),c={columns:32,rows:15};if(null!==l){var d=s.exec(l);if(null===d||d.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(d[1],10),v=parseInt(d[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):c={columns:f,rows:v}}}if((0,i.Z)(u)&&"default"!==u&&"preserve"!==u)throw new Error("Invalid spacing style");var p=Number(t);(isNaN(p)||p<=0)&&(p=30);var h=Number(n);(isNaN(h)||h<=0)&&(h=1);var m=Number(r);(isNaN(m)||m<=0)&&(m=void 0);var g=p,y=null!=h?h:1,_=null!==u?u:"default",b=void 0!==m?m:p*h;if(null!==a){var T=/^(\d+) (\d+)$/g.exec(a);null!==T&&(g=p*(Number(T[1])/Number(T[2])))}return{cellResolution:c,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],T=0;T<=m.length-1;T++){var E=m[T];if(E instanceof Element){var S=E.getAttribute("xml:id");if(null!==S){var w=E.getAttribute("style"),k=null===w?[]:w.split(" ");b.push({id:S,style:(0,u.b)(E),extendsStyles:k})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(i){var s=r.extendsStyles[i],u=(0,l.Z)(e,(function(e){return e.id===s}));if(u<0)o.Z.warn("TTML Parser: unknown style inheritance: "+s);else{var d=e[u];(0,c.Z)(t,u)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(d,u),r.style=(0,a.Z)({},d.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s(u);r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],x=0;x<=g.length-1;x++){var I=g[x];if(I instanceof Element){var Z=I.getAttribute("xml:id");null!==Z&&function(){var e=(0,u.b)(I),t=I.getAttribute("style");if((0,i.Z)(t)){var n=(0,r.Z)(b,(function(e){return e.id===t}));void 0!==n&&(e=(0,a.Z)({},n.style,e))}A.push({id:Z,style:e,extendsStyles:[]})}()}}for(var R=(0,u.U)(f,null!==h?[h]:[],b,A),M="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,C=0;C<y.length;C++){var P=y[C];if(P instanceof Element){var D=(0,d.jF)(P),N=(0,a.Z)({},R,(0,u.U)(f,[P].concat(D),b,A)),O=P.getAttribute("xml:space"),L=(0,i.Z)(O)?"default"===O:M,B={paragraph:P,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:N,ttParams:_,shouldTrimWhiteSpace:L};null!==B&&n.push(B)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return c},ev:function(){return p},gu:function(){return r},jb:function(){return o},te:function(){return u},wf:function(){return a}});var r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,a=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,o=/^(\d*\.?\d*)f$/,s=/^(\d*\.?\d*)t$/,u=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/,l=/^(\d{1,2}|100)% (\d{1,2}|100)%$/,c=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,d=/^#([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})([0-9A-f]{2})$/,f=/^#([0-9A-f])([0-9A-f])([0-9A-f])([0-9A-f])$/,v=/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)/,p=/^rgba\( *(\d+) *, *(\d+) *, *(\d+) *, *(\d+) *\)/},1594:function(e,t,n){"use strict";function r(e,t){if(!(e.parentNode instanceof Element))return[];return function e(n){var r=[];n.tagName.toLowerCase()===t.toLowerCase()&&r.push(n);var i=n.parentNode;return i instanceof Element&&r.push.apply(r,e(i)),r}(e.parentNode)}function i(e){var t=r(e,"div");if(0===t.length){var n=r(e,"tt:div");n.length>0&&(t=n)}return t}function a(e){var t=e.getElementsByTagName("body");if(t.length>0)return t[0];var n=e.getElementsByTagName("tt:body");return n.length>0?n[0]:null}function o(e){var t=e.getElementsByTagName("style");if(t.length>0)return t;var n=e.getElementsByTagName("tt:style");return n.length>0?n:t}function s(e){var t=e.getElementsByTagName("region");if(t.length>0)return t;var n=e.getElementsByTagName("tt:region");return n.length>0?n:t}function u(e){var t=e.getElementsByTagName("p");if(t.length>0)return t;var n=e.getElementsByTagName("tt:p");return n.length>0?n:t}function l(e){return"br"===e.nodeName||"tt:br"===e.nodeName}function c(e){return"span"===e.nodeName||"tt:span"===e.nodeName}n.d(t,{DM:function(){return s},H:function(){return a},OE:function(){return l},jF:function(){return i},jg:function(){return c},kd:function(){return u},vU:function(){return o}})},1138:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923),i=n(360);function a(e,t){for(var n=[],a=t;a<e.length;a++)if((0,i.tq)(e,a)){var o=(0,i.$4)(e,a);n.push(e.slice(a,o)),a=o}else if((0,r.Z)(e[a]))for(;(0,r.Z)(e[a]);)a++;return n}},4099:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(1138),i=n(6923),a=n(360);var o=n(9525),s={white:"#ffffff",lime:"#00ff00",cyan:"#00ffff",red:"#ff0000",yellow:"#ffff00",magenta:"#ff00ff",blue:"#0000ff",black:"#000000"};function u(e){var t=Object.keys(s).reduce((function(e,t){return e[t]="color: "+s[t]+";",e["bg_"+t]="background-color: "+s[t]+";",e}),{}),n="";return e.forEach((function(e){if(e.length>=2)for(var r=1;r<e.length;r++){var a=e[r];if(Array.isArray(/::cue {/.exec(a)))for(a=e[++r];(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)n+=a,a=e[++r];else!function(){for(var n=[],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);(0,i.Z)(a)&&Array.isArray(o);)n.push(o[1]),a=e[++r],o=/::cue\(\.?(.*?)\)(?:,| {)/.exec(a);for(var s="";(0,i.Z)(a)&&!Array.isArray(/}/.exec(a))&&0!==a.length;)s+=a,a=e[++r];n.forEach((function(e){void 0===t[e]?t[e]=s:t[e]+=s}))}()}})),{classes:t,global:n}}var l=n(7714);function c(e,t){var n,r=["u","i","b"],a=e.nodeName.toLowerCase().split(".")[0];if((0,l.Z)(["u","i","b","c","#text"],a))if("#text"===a){var o=e.wholeText.split("\n");n=document.createElement("span");for(var s=0;s<o.length;s++)if(s>0&&n.appendChild(document.createElement("br")),o[s].length>0){var u=document.createTextNode(o[s]);n.appendChild(u)}}else{var d=e.nodeName.toLowerCase().split("."),f=[];if(d.forEach((function(e){(0,i.Z)(t[e])&&f.push(t[e])})),0!==f.length){var v=document.createAttribute("style");f.forEach((function(e){v.value+=e}));var p=(0,l.Z)(r,a)?a:"span";(n=document.createElement(p)).setAttributeNode(v)}else{var h=(0,l.Z)(r,a)?a:"span";n=document.createElement(h)}for(var m=0;m<e.childNodes.length;m++){var g=c(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=c(e.childNodes[y],t);n.appendChild(_)}}return n}var d=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,d.Z)(e).length))return"text-align:center";var t=m(e),n=_(e);return"position: absolute;margin: 0;transform: translate("+t.offset+"%,"+n.offset+"%);width: "+S(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+E(e.align)+";"};!function(e){e.LINE_LEFT="line-left",e.CENTER="center",e.LINE_RIGHT="line-right"}(f||(f={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(v||(v={})),function(e){e.START="start",e.CENTER="center",e.END="end"}(p||(p={}));var m=function(e){return{position:g(e),offset:y(e)}},g=function(e){var t,n=k(e.position);if(null!==n)return n;var r=E(e.align);return((t={})[v.LEFT]=0,t[v.CENTER]=50,t[v.RIGHT]=100,t)[r]},y=function(e){var t,n,r,i,a=((t={})[f.LINE_LEFT]=0,t[f.CENTER]=-50,t[f.LINE_RIGHT]=-100,t),o=void 0!==e.position?(r=e.position,i=/,(line-left|line-right|center)/.exec(r),!Array.isArray(i)||i.length<2?null:i[1]):null;return null!==o?a[o]:((n={})[v.LEFT]=0,n[v.CENTER]=-50,n[v.RIGHT]=-100,n)[void 0!==e.align?E(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:T(e.line)}},b=function(e){return k(e)},T=function(e){var t,n=((t={})[p.START]=0,t[p.CENTER]=-50,t[p.END]=-100,t);if(void 0===e)return n[p.START];var r,i=(r=/,(start|center|end)/.exec(e),!Array.isArray(r)||r.length<2?null:r[1]);return null!==i?n[i]:n[p.START]},E=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},S=function(e){return w(e,100)},w=function(e,t){var n=k(e);return null!==n?n:t},k=function(e){if(void 0===e)return null;var t=/^([\d.]+)%/.exec(e);return!Array.isArray(t)||t.length<2?null:parseInt(t[1],10)};function A(e,t){var n=e.start,r=e.end,a=e.settings,o=e.header,s=e.payload,u=document.createElement("div"),l=document.createAttribute("style");l.value="width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;",u.setAttributeNode(l);var d=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);d.setAttributeNode(f);var v=document.createElement("span"),p=document.createAttribute("style");p.value="background-color:rgba(0,0,0,0.8);color:white;",v.setAttributeNode(p);var m=t.global,g=t.classes,y=[m,(0,i.Z)(o)?g[o]:void 0].filter((function(e){return void 0!==e})).join("");return p.value+=y,v.setAttributeNode(p),function(e,t){for(var n=e.replace(/<[0-9]{2}:[0-9]{2}.[0-9]{3}>/,"").replace(/<([u,i,b,c])(\..*?)?(?: .*?)?>(.*?)<\/\1>/g,"<$1$2>$3</$1$2>"),r=(new DOMParser).parseFromString(n,"text/html").body.childNodes,i=[],a=0;a<r.length;a++)i.push(c(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(d),d.appendChild(v),{start:n,end:r,element:u}}var x=function(e,t){var n=e.split(/\r\n|\n|\r/g),s=[];if(null===/^WEBVTT( |\t|\n|\r|$)/.exec(n[0]))throw new Error("Can't parse WebVTT: Invalid File.");for(var l=(0,a.yE)(n),c=function(e,t){for(var n=[],r=t;r<e.length;r++)if((0,a.JF)(e,r)){var o=r;for(r++;(0,i.Z)(e[r]);)r++;var s=e.slice(o,r);n.push(s)}else if((0,i.Z)(e[r]))for(;(0,i.Z)(e[r]);)r++;return n}(n,l),d=(0,r.Z)(n,l),f=u(c),v=0;v<d.length;v++){var p=(0,o.Z)(d[v],t);if(null!=p){var h=A(p,f);s.push(h)}}return s}},9405:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(1988),i=n(1138),a=n(9525),o=n(360),s=n(7714),u=n(6923);function l(e,t){if(!(0,u.Z)(e.vertical)||"rl"!==e.vertical&&"lr"!==e.vertical||(t.vertical=e.vertical),(0,u.Z)(e.line)){var n=/^(\d+(\.\d+)?)%(,([a-z]+))?/.exec(e.line);if(Array.isArray(n))t.line=Number(n[1]),t.snapToLines=!1,(0,s.Z)(["start","center","end"],n[4])&&(t.lineAlign=n[4]);else{var r=/^(-?\d+)(,([a-z]+))?/.exec(e.line);Array.isArray(r)&&(t.line=Number(r[1]),t.snapToLines=!0,(0,s.Z)(["start","center","end"],r[3])&&(t.lineAlign=r[3]))}}if((0,u.Z)(e.position)){var i=/^([\d\.]+)%(?:,(line-left|line-right|center))?$/.exec(e.position);if(Array.isArray(i)&&i.length>=2){var a=parseInt(i[1],10);isNaN(a)||(t.position=a,void 0!==i[2]&&(t.positionAlign=i[2]))}}(0,u.Z)(e.size)&&(t.size=e.size),"string"==typeof e.align&&(0,s.Z)(["start","center","end","left"],e.align)&&(t.align=e.align)}var c=n(7253);var d=function(e,t){var n=e.split(/\r\n|\n|\r/);if(!/^WEBVTT($| |\t)/.test(n[0]))throw new Error("Can't parse WebVTT: Invalid file.");for(var s,u,d,f,v=(0,o.yE)(n),p=(0,i.Z)(n,v),h=[],m=0;m<p.length;m++){var g=(0,a.Z)(p[m],t);if(null!=g){var y=(u=void 0,d=void 0,f=void 0,u=(s=g).start,d=s.end,f=s.payload.join("\n"),(0,c.Z)(u,d,f));null!=y&&((0,r.Z)(y)&&l(g.settings,y),h.push(y))}}return h}},9525:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(6923);function i(e){var t=e.split(":").reverse();if((0,r.Z)(t[2])||(0,r.Z)(t[1])){var n=(0,r.Z)(t[2])?parseInt(t[2],10):0,i=parseInt(t[1],10),a=parseFloat(t[0].replace(",","."));if(isNaN(n)||isNaN(i)||isNaN(a))return;return 60*n*60+60*i+a}}function a(e,t){var n,r,a,o=/-->/;if(o.test(e[0]))n=e[0],r=e.slice(1,e.length);else{if(!o.test(e[1]))return null;a=e[0],n=e[1],r=e.slice(2,e.length)}var s=function(e){var t=/^([\d:.]+)[ |\t]+-->[ |\t]+([\d:.]+)[ |\t]*(.*)$/.exec(e);if(null===t)return null;var n=i(t[1]),r=i(t[2]);return null==n||null==r?null:{start:n,end:r,settings:t[3].split(/ |\t/).reduce((function(e,t){var n=t.split(":");return 2===n.length&&(e[n[0]]=n[1]),e}),{})}}(n);return null===s?null:{start:s.start+t,end:s.end+t,settings:s.settings,payload:r,header:a}}},360:function(e,t,n){"use strict";n.d(t,{$4:function(){return s},JF:function(){return a},tq:function(){return o},yE:function(){return i}});var r=n(6923);function i(e){for(var t=0;t<e.length;){if(""===e[t])return t+1;t++}return t}function a(e,t){return"string"==typeof e[t]&&/^STYLE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}function o(e,t){var n=e[t];if(void 0===n||""===n||a(e,t)||function(e,t){return"string"==typeof e[t]&&/^REGION( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t)||function(e,t){return"string"==typeof e[t]&&/^NOTE( .*)?$/g.test(e[t])&&(void 0===e[t+1]||e[t+1].indexOf("--\x3e")<0)}(e,t))return!1;if(n.indexOf("--\x3e")>=0)return!0;var r=e[t+1];return void 0!==r&&r.indexOf("--\x3e")>=0}function s(e,t){for(var n=t+1;(0,r.Z)(e[n]);)n++;return n}},85:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=n(7874),i=n(8791),a=n(5861),o=n(4687),s=n.n(o),u=n(4597),l=n(5278),c=n(9829);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,c.Z)(e.baseUrl,t.url)}function f(e,t,n,r,i){return v.apply(this,arguments)}function v(){return(v=(0,a.Z)(s().mark((function e(t,n,r,i,a){var o,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.segment,l=d(t,o),!o.isInit&&null!==l){e.next=4;break}return e.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return e.next=6,(0,u.ZP)({url:l,responseType:"arraybuffer",timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i});case 6:return c=e.sent,e.abrupt("return",{resultType:"segment-loaded",resultData:c});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t){var n=t.segment,i=t.period,a=e.data,o=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(o)throw new Error("Image data should not be downloaded in chunks");var s=(0,l.Z)(n.timestampOffset,0);return null===a||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:n.duration,time:n.time},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(a)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:s,protectionDataUpdate:!1,appendWindow:[i.start,i.end]}}var h=n(6872),m=n(8750),g=n(3887),y=n(1989),_=n(8026),b=n(3635);function T(e){var t=e.aggressiveMode,n=e.referenceDateTime,i=void 0!==e.serverSyncInfos?e.serverSyncInfos.serverTimestamp-e.serverSyncInfos.clientTime:void 0;return function(a,o,s,l,c){var d,f=a.responseData,v=o.externalClockOffset,p=null!==(d=a.url)&&void 0!==d?d:o.originalUrl,T=null!=i?i:v,E={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:p,referenceDateTime:n,externalClockOffset:T},S=r.Z.dashParsers;if(null===S.wasm||"uninitialized"===S.wasm.status||"failure"===S.wasm.status)return g.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),k();var w=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,b.tG)(e).buffer;if(e instanceof Document)return(0,b.tG)(e.documentElement.innerHTML).buffer;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return function(e){var t=new DataView(e);if(61371===t.getUint16(0)&&191===t.getUint8(2))return!0;if(65279===t.getUint16(0)||65534===t.getUint16(0))return!1;return!0}(w)?"initialized"===S.wasm.status?(g.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E))):(g.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),S.wasm.waitForInitialization().catch((function(){})).then((function(){return null===S.wasm||"initialized"!==S.wasm.status?(g.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),k()):(g.Z.debug("DASH: Running WASM MPD Parser."),A(S.wasm.runWasmParser(w,E)))}))):(g.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),k());function k(){if(null===S.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,b.uR)(new Uint8Array(e)),"text/xml");if("string"==typeof e)return(new DOMParser).parseFromString(e,"text/xml");if(e instanceof Document)return e;throw new Error("DASH Manifest Parser: Unrecognized Manifest format")}(f);return A(S.js(e,E))}function A(t){if("done"===t.type)return t.value.warnings.length>0&&s(t.value.warnings),l.isCancelled?Promise.reject(l.cancellationError):{manifest:new y.ZP(t.value.parsed,e),url:p};var n=t.value,r=n.urls.map((function(e){return c((function(){var t=h.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT;return"string"===n.format?(0,u.ZP)({url:e,responseType:"text",timeout:t,cancelSignal:l}):(0,u.ZP)({url:e,responseType:"arraybuffer",timeout:t,cancelSignal:l})})).then((function(e){if("string"===n.format){if("string"!=typeof e.responseData)throw new Error("External DASH resources should have been a string");return(0,_.Z)(e,{responseData:{success:!0,data:e.responseData}})}if(!(e.responseData instanceof ArrayBuffer))throw new Error("External DASH resources should have been ArrayBuffers");return(0,_.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,m.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,_.Z)({},{size:void 0,requestDuration:void 0,responseData:{success:!1,error:t}})}))}));return Promise.all(r).then((function(e){return n.format,A(n.continue(e))}))}}}var E=n(7839),S=n(9105),w=n(5992),k=n(1946),A="function"==typeof Headers?Headers:null,x="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,k.Z)(x)&&!(0,k.Z)(A)}var Z=n(8806),R=n(281);function M(e,t){return"audio"===e||"video"===e?"video/mp4"===t.mimeType||"audio/mp4"===t.mimeType?"mp4":"video/webm"===t.mimeType||"audio/webm"===t.mimeType?"webm":void 0:"text"===e&&"application/mp4"===t.mimeType?"mp4":void 0}var C=n(288),P=n(4460);function D(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new C.ZP({cancelOn:i}),c=l.signal.register(u);e(t,n,r,l.signal,Object.assign(Object.assign({},a),{onNewChunk:function(e){try{o(e),a.onNewChunk(e)}catch(e){c(),l.cancel(),u(e)}}})).then((function(e){if(!l.isUsed){if(c(),"segment-loaded"===e.resultType)try{o(e.resultData.responseData)}catch(e){return void u(e)}s(e)}}),(function(e){c(),u(e)}))}));function o(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&"mp4"===M(n.adaptation.type,n.representation)&&(0,P.Z)(new Uint8Array(e),n.segment.isInit)}}}var N=n(6968);function O(e,t,n,r,i){if(void 0===t.range)return(0,u.ZP)({url:e,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(void 0===t.indexRange)return(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));if(t.range[1]+1===t.indexRange[0])return(0,u.ZP)({url:e,headers:{Range:(0,R.Z)([t.range[0],t.indexRange[1]])},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}));var a=(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.ZP)({url:e,headers:{Range:(0,R.Z)(t.indexRange)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress});return Promise.all([a,o]).then((function(t){var n=t[0],r=t[1],i=(0,N.zo)(new Uint8Array(n.responseData),new Uint8Array(r.responseData)),a=Math.min(n.sendingTime,r.sendingTime),o=Math.max(n.receivedTime,r.receivedTime);return{resultType:"segment-loaded",resultData:{url:e,responseData:i,size:n.size+r.size,requestDuration:o-a,sendingTime:a,receivedTime:o}}}))}var L=n(8766);function B(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,R.Z)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,k.Z)(e.headers))if((0,k.Z)(A))t=e.headers;else{t=new A;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}g.Z.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,c=performance.now(),d=(0,k.Z)(x)?null:new x;function f(){(0,k.Z)(d)?g.Z.warn("Fetch: AbortController API not available."):d.abort()}void 0!==e.timeout&&(o=window.setTimeout((function(){l=!0,f()}),e.timeout));var v=e.cancelSignal.register((function(e){u=e,f()})),p={method:"GET"};return void 0!==t&&(p.headers=t),p.signal=(0,k.Z)(d)?null:d.signal,fetch(e.url,p).then((function(t){if((0,k.Z)(o)||clearTimeout(o),t.status>=300)throw g.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new S.Z(t.url,t.status,w.br.ERROR_HTTP_CODE);if((0,k.Z)(t.body))throw new S.Z(t.url,t.status,w.br.PARSE_ERROR);var n=t.headers.get("Content-Length"),r=(0,k.Z)(n)||isNaN(+n)?void 0:+n,i=t.body.getReader(),u=0;return l();function l(){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(s().mark((function n(){var a,o,d,f,p;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.read();case 2:if((a=n.sent).done||(0,k.Z)(a.value)){n.next=11;break}return u+=a.value.byteLength,o=performance.now(),d={url:t.url,currentTime:o,duration:o-c,sendingTime:c,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(d),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-c,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:c,size:u,status:t.status,url:t.url});case 16:return n.abrupt("return",l());case 17:case"end":return n.stop()}}),n)})))).apply(this,arguments)}})).catch((function(t){if(null!==u)throw u;if(v(),l)throw g.Z.warn("Fetch: Request timeouted."),new S.Z(e.url,0,w.br.TIMEOUT);if(t instanceof S.Z)throw t;throw g.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new S.Z(e.url,0,w.br.ERROR_EVENT)}))}({url:e,headers:u,onData:function(e){var t=new Uint8Array(e.chunk),n=function(e){for(var t=0,n=[];t<e.length;){var r=e.subarray(t,1/0),i=(0,L.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,N.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,L.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,N.pX)(e,o+t);if(s>e.length)return[n,r];var u=Math.max(a,s),l=e.subarray(t,u);n.push(l),t=u}return[n,null]}(null!==l?(0,N.zo)(l,t):t),a=n[0];l=n[1];for(var o=0;o<a.length;o++)if(r.onNewChunk(a[o]),i.isCancelled)return;r.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize}),i.isCancelled},timeout:n.timeout,cancelSignal:i}).then((function(e){return{resultType:"chunk-complete",resultData:e}}))}function U(e,t,n,r,i,a){if(t.segment.isInit)return O(e,t.segment,r,a,i);var o=M(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return B(e,t,r,i,a);(0,Z.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}var s=t.segment;return(0,u.ZP)({url:e,responseType:"arraybuffer",headers:void 0!==s.range?{Range:(0,R.Z)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var F=n(6490),z=n(4644),V=408125543,K=357149030;function G(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=q(n,o);if(null==s)return null;var u=s.value,l=o+s.length,c=Y(n,l);if(null==c)return null;var d=c,f=l+d.length,v=f+d.value;if(u===e)return[f,v];if(t.length>0)for(var p=0;p<t.length;p++){if(u===t[p])return G(e,t.slice(p+1,t.length),n,[f,v])}o=v}return null}function H(e,t){var n=G(2807729,[V,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/X(e,n[0],r)}function W(e,t){var n=G(17545,[V,K],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 4===r?function(e,t){return new DataView(e.buffer).getFloat32(t)}(e,n[0]):8===r?function(e,t){return new DataView(e.buffer).getFloat64(t)}(e,n[0]):null}function j(e,t){for(var n=1;n<=8;n++)if(e[t]>=Math.pow(2,8-n))return n}function q(e,t){var n=j(e,t);if(null==n)return g.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return g.Z.warn("webm: impossible length"),null;for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function Y(e,t){var n=j(e,t);if(null==n)return g.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return g.Z.warn("webm: impossible length"),null;for(var r=(e[t]&(1<<8-n)-1)*Math.pow(2,8*(n-1)),i=1;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return{length:n,value:r}}function X(e,t,n){for(var r=0,i=0;i<n;i++)r=e[t+i]*Math.pow(2,8*(n-i-1))+r;return r}var $=n(7403);function Q(e,t,n,r){var i=(0,z.Qx)(e);if(void 0===i||void 0===r)return null;var a,o=void 0!==n.timestampOffset?i+n.timestampOffset*r:i,s=(0,z.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&g.Z.warn("DASH: Chunked segments should indicate a duration through their trun boxes"),{time:o/r,duration:void 0!==s?s/r:void 0};var u=n.duration*r,l=Math.min(.9*r,u/4);return void 0!==s&&Math.abs(s-u)<=l&&(a=s),{time:o/r,duration:void 0!==a?a/r:a}}function J(e,t){if(0!==e.length){var n=e.reduce((function(e,t){return"urn:mpeg:dash:event:2012"===t.schemeIdUri&&"1"===t.value?(void 0===e.manifestRefreshEventsFromEMSGs&&(e.manifestRefreshEventsFromEMSGs=[]),e.manifestRefreshEventsFromEMSGs.push(t)):(void 0===e.EMSGs&&(e.EMSGs=[]),e.EMSGs.push(t)),e}),{manifestRefreshEventsFromEMSGs:void 0,EMSGs:void 0}),r=n.manifestRefreshEventsFromEMSGs,i=n.EMSGs,a=null==i?void 0:i.map((function(e){return{type:"emsg",value:e}})),o=void 0!==t&&void 0!==r&&function(e,t){if(e.length<=0)return!1;for(var n=e.length,r=0;r<n;r++){var i=t,a=e[r].messageData,o=(0,b.uR)(a),s=Date.parse(o);if(void 0===i||void 0===s||isNaN(s)||s>=i)return!0}return!1}(r,t);return{inbandEvents:a,needsManifestRefresh:o}}}function ee(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=n.manifest,d=e.data,f=e.isChunked,v=[a.start,a.end];if(null===d)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:0,protectionDataUpdate:!1,appendWindow:v};var p=d instanceof Uint8Array?d:new Uint8Array(d),h=M(o.type,s),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,F.Z)(p);u.isInit&&(y=null!==(i=(0,z.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=s._addProtectionData("cenc",y,_))}if(!u.isInit){var b=m?Q(p,f,u,r):null,T=(0,l.Z)(u.timestampOffset,0);if(m){var E=(0,z.s9)(p);if(void 0!==E){var S=J(E.filter((function(e){return void 0!==u.privateInfos&&void 0!==u.privateInfos.isEMSGWhitelisted&&u.privateInfos.isEMSGWhitelisted(e)})),c.publishTime);if(void 0!==S){var w=S.needsManifestRefresh,A=S.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:T,protectionDataUpdate:g,appendWindow:v}}var x=u.indexRange,I=null;if("webm"===h)I=function(e,t){var n=G(V,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=H(e,r);if(null==a)return null;var o=W(e,r);if(null==o)return null;var s=G(475249515,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var c=G(187,[],e,[l,s[1]]);if(null==c)break;var d=G(179,[],e,[c[0],c[1]]);if(null==d)return null;var f=X(e,d[0],d[1]-d[0]),v=G(241,[183],e,[c[0],c[1]]);if(null==v)return null;var p=X(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=c[1]}for(var h=[],m=0;m<u.length;m++){var g=u[m];m===u.length-1?h.push({time:g.time,timescale:a,duration:0===m?o:o-g.time,range:[g.rangeStart,1/0]}):h.push({time:g.time,timescale:a,duration:u[m+1].time-g.time,range:[g.rangeStart,u[m+1].rangeStart-1]})}return h}(p,0);else if(m&&(I=(0,z.Wf)(p,Array.isArray(x)?x[0]:0),!0===t&&null!==I&&I.length>0)){var Z=I[I.length-1];Array.isArray(Z.range)&&(Z.range[1]=1/0)}s.index instanceof $.Z&&null!==I&&I.length>0&&s.index.initializeIndex(I);var R=m?(0,z.LD)(p):"webm"===h?H(p,0):void 0,C=(0,k.Z)(R)?void 0:R;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var te=n(6807);function ne(e,t,n,r){var i,a,o=e.segment,s=e.adaptation,u=e.representation;if(o.isInit)return null;null===n?r?(i=o.time,a=o.end):g.Z.warn("Transport: Unavailable time data for current text track."):(i=n.time,void 0!==n.duration?a=i+n.duration:!r&&o.complete&&(a=i+o.duration));var l=function(e){var t=e.codec;if(void 0===t)throw new Error("Cannot parse subtitles: unknown format");switch(t.toLowerCase()){case"stpp":case"stpp.ttml.im1t":return"ttml";case"wvtt":return"vtt"}throw new Error('The codec used for the subtitles "'+t+'" is not managed yet.')}(u),c=function(e){var t=(0,te.Le)(e);return null===t?"":(0,b.uR)(t)}(t);return{data:c,type:l,language:s.language,start:i,end:a}}function re(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?g.Z.warn("Transport: Unavailable time data for current text track."):(r=a.time,a.complete&&(i=a.time+a.duration));var u=function(e){var t=e.mimeType,n=void 0===t?"":t;switch(e.mimeType){case"application/ttml+xml":return"ttml";case"application/x-sami":case"application/smil":return"sami";case"text/vtt":return"vtt"}var r=e.codec;if("srt"===(void 0===r?"":r).toLowerCase())return"srt";throw new Error("could not find a text-track parser for the type "+n)}(s);return{data:t,type:u,language:o.language,start:r,end:i}}function ie(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a=n.period,o=n.adaptation,s=n.representation,u=n.segment,c=e.data,d=e.isChunked;if(null===c)return u.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:null,chunkOffset:null!==(i=u.timestampOffset)&&void 0!==i?i:0,protectionDataUpdate:!1,appendWindow:[a.start,a.end]};var f=M(o.type,s);if("webm"===f)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===f?function(e,t,n,r,i){var a=n.period,o=n.representation,s=n.segment,u=s.isInit,c=s.indexRange,d="string"==typeof e?(0,b.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(u){var f=(0,z.Wf)(d,Array.isArray(c)?c[0]:0);if(!0===i&&null!==f&&f.length>0){var v=f[f.length-1];Array.isArray(v.range)&&(v.range[1]=1/0)}var p=(0,z.LD)(d);return o.index instanceof $.Z&&null!==f&&f.length>0&&o.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=Q(d,t,s,r),m=ne(n,d,h,t),g=(0,l.Z)(s.timestampOffset,0);return{segmentType:"media",chunkData:m,chunkSize:d.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n,r,t):function(e,t,n){var r,i,a=n.period,o=n.segment,s=o.timestampOffset,u=void 0===s?0:s;if(o.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if("string"!=typeof e){var l=e instanceof Uint8Array?e:new Uint8Array(e);r=(0,b.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:re(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(c,d,n)}}var ae=function(e){var t=(0,i.Z)({customManifestLoader:e.manifestLoader},null===r.Z.dashParsers.wasm||"initialized"!==r.Z.dashParsers.wasm.status&&"initializing"!==r.Z.dashParsers.wasm.status?"arraybuffer":"text"),n=T(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:D(r);function r(e,r,i,a,o){var s=d(e,r.segment);if(null==s)return Promise.resolve({resultType:"segment-created",resultData:null});if(t||void 0===n)return U(s,r,t,i,o,a);var u={adaptation:r.adaptation,manifest:r.manifest,period:r.period,representation:r.representation,segment:r.segment,transport:"dash",timeout:i.timeout,url:s};return new Promise((function(e,l){var c=!1,d=n(u,{reject:function(e){var t,n,r;if(!c&&!a.isCancelled){c=!0,a.deregister(f);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a DASH segment through a custom segmentLoader.",s=new E.Z(o,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);l(s)}},resolve:function(t){c||a.isCancelled||(c=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){c||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){c||a.isCancelled||(c=!0,a.deregister(f),U(s,r,t,i,o,a).then(e,l))}});function f(e){c||(c=!0,"function"==typeof d&&d(),l(e))}a.register(f)}))}}(e),o=ee(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:D(n);function n(e,n,r,i,a){var o=n.adaptation,s=n.representation,l=n.segment,c=l.range,f=d(e,l);if(null===f)return Promise.resolve({resultType:"segment-created",resultData:null});if(l.isInit)return O(f,l,r,i,a);var v=M(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return B(f,n,r,a,i);(0,Z.Z)("DASH: Your browser does not have the fetch API. You will have a higher chance of rebuffering when playing close to the live edge")}return p?(0,u.ZP)({url:f,responseType:"arraybuffer",headers:Array.isArray(c)?{Range:(0,R.Z)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}})):(0,u.ZP)({url:f,responseType:"text",headers:Array.isArray(c)?{Range:(0,R.Z)(c)}:null,timeout:r.timeout,onProgress:a.onProgress,cancelSignal:i}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}}(e);return{manifest:{loadManifest:t,parseManifest:n},audio:{loadSegment:a,parseSegment:o},video:{loadSegment:a,parseSegment:o},text:{loadSegment:s,parseSegment:ie(e)},image:{loadSegment:f,parseSegment:p}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return ye}});var r=n(5861),i=n(4687),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),c=n(9362),d=n(811),f=n(8232),v=n(3911),p=n(1091),h=n(5505);function m(e,t,n){var r=e.timeline,i=e.timescale,a=r[r.length-1],o=t.timescale===i?{time:t.time,duration:t.duration}:{time:t.time/t.timescale*i,duration:t.duration/t.timescale*i};return!(n.time===o.time)&&(o.time>=(0,v.jH)(a,null)&&(a.duration===o.duration?a.repeatCount++:e.timeline.push({duration:o.duration,start:o.time,repeatCount:0}),!0))}function g(e,t){return e.replace(/\{start time\}/g,String(t))}function y(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function _(e,t){var n=e.repeatCount;if(null!=e.duration&&n<0){var r=void 0!==t?t.start:1/0;n=Math.ceil((r-e.start)/e.duration)-1}return n}var b=function(){function e(e,t){var n=t.aggressiveMode,r=t.isLive,i=t.segmentPrivateInfos,a=t.timeShiftBufferDepth,o=null==t.manifestReceivedTime?performance.now():t.manifestReceivedTime;if(this._index=e,this._indexValidityTime=o,this._timeShiftBufferDepth=a,this._initSegmentInfos={bitsPerSample:i.bitsPerSample,channels:i.channels,codecPrivateData:i.codecPrivateData,packetSize:i.packetSize,samplingRate:i.samplingRate,timescale:e.timescale,protection:i.protection},this._isAggressiveMode=n,this._isLive=r,0!==e.timeline.length){var s=e.timeline[e.timeline.length-1],u=(0,v.jH)(s,null);if(this._initialScaledLastPosition=u,r){var l=o/1e3*e.timescale;this._scaledLiveGap=l-u}}}var t=e.prototype;return t.getInitSegment=function(){return{id:"init",isInit:!0,privateInfos:{smoothInitSegment:this._initSegmentInfos},url:null,time:0,end:0,duration:0,timescale:1,complete:!0}},t.getSegments=function(e,t){this._refreshTimeline();for(var n,r=function(e,t,n){var r=void 0===e.timescale||0===e.timescale?1:e.timescale;return{up:t*r,to:(t+n)*r}}(this._index,e,t),i=r.up,a=r.to,o=this._index,s=o.timeline,u=o.timescale,l=o.media,c=this._isAggressiveMode,d=[],f=s.length,v=null==this._scaledLiveGap?void 0:performance.now()/1e3*u-this._scaledLiveGap,p=0;p<f;p++){for(var h=s[p],m=h.duration,b=h.start,T=_(h,s[p+1]),E=y(b,i,m),S=b+E*m,w=c?0:m;S<a&&E<=T&&(null==v||S+w<=v);){var k=S,A=null!=n?n+E:void 0,x={id:String(S),isInit:!1,time:k/u,end:(k+m)/u,duration:m/u,timescale:1,number:A,url:g(l,k),complete:!0,privateInfos:{smoothMediaSegment:{time:k,duration:m}}};d.push(x),S=b+ ++E*m}if(S>=a)return d;null!=n&&(n+=T+1)}return d},t.shouldRefresh=function(e,t){if(this._refreshTimeline(),!this._isLive)return!1;var n=this._index,r=n.timeline,i=n.timescale,a=r[r.length-1];if(void 0===a)return!1;var o=a.repeatCount,s=a.start+(o+1)*a.duration;return!(t*i<s)&&(e*i>=s||e*i>a.start+o*a.duration)},t.getFirstAvailablePosition=function(){this._refreshTimeline();var e=this._index;return 0===e.timeline.length?null:e.timeline[0].start/e.timescale},t.getLastAvailablePosition=function(){this._refreshTimeline();var e=this._index;if(null==this._scaledLiveGap){var t=e.timeline[e.timeline.length-1];return(0,v.jH)(t,null)/e.timescale}for(var n=e.timeline.length-1;n>=0;n--)for(var r=e.timeline[n],i=performance.now()/1e3*e.timescale,a=r.start,o=r.duration,s=r.repeatCount;s>=0;s--){var u=a+o*(s+1);if((this._isAggressiveMode?u-o:u)<=i-this._scaledLiveGap)return u/e.timescale}},t.getEnd=function(){if(!this._isLive)return this.getLastAvailablePosition()},t.awaitSegmentBetween=function(e,t){var n;if((0,d.Z)(e<=t),this.isFinished())return!1;var r=this.getLastAvailablePosition();return!(void 0!==r&&t<r)&&(t>(null!==(n=this.getFirstAvailablePosition())&&void 0!==n?n:0)&&void 0)},t.checkDiscontinuity=function(e){return this._refreshTimeline(),(0,v._j)(this._index,e,void 0)},t.isSegmentStillAvailable=function(e){if(e.isInit)return!0;this._refreshTimeline();var t=this._index,n=t.timeline,r=t.timescale;return(0,p.Z)(e,n,r,0)},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof c.Z&&(e.isHttpError(404)||e.isHttpError(412)))},t._replace=function(e){var t=this._index.timeline,n=e._index.timeline,r=this._index.timescale,i=e._index.timescale;if(this._index=e._index,this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap,0!==t.length&&0!==n.length&&r===i){var a=t[t.length-1],o=n[n.length-1],u=(0,v.jH)(o,null);if(!((0,v.jH)(a,null)<=u))for(var l=0;l<t.length;l++){var c=t[l],d=(0,v.jH)(c,null);if(d===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(d>u){if(c.duration!==o.duration)return;var f=u-c.start;if(0===f)return s.Z.warn("Smooth Parser: a discontinuity detected in the previous manifest has been resolved."),void(this._index.timeline=this._index.timeline.concat(t.slice(l)));if(f<0||f%c.duration!=0)return;var p=f/c.duration-1,h=c.repeatCount-p;if(h<0)return;o.repeatCount+=h;var m=t.slice(l+1);return void(this._index.timeline=this._index.timeline.concat(m))}}}},t._update=function(e){(0,h.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isFinished=function(){return!this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)m(this._index,e[n],t)},t._refreshTimeline=function(){if(null!=this._initialScaledLastPosition){var e=this._index,t=this._timeShiftBufferDepth,n=(performance.now()-this._indexValidityTime)/1e3+this._initialScaledLastPosition/e.timescale;if(null!=t){var r=(n-t)*e.timescale;(0,f.Z)(e.timeline,r)}}},e}(),T=n(8999),E=n(7714),S=n(6968),w=n(6923),k=n(8026),A=n(9829),x=n(3635),I=n(5278),Z=n(2689),R={};function M(e){if(null!=R[e])return R[e];var t=(0,x.tG)(e);return R[e]=t,t}function C(e,t){var n=t.length+8;return n<=Z.s?(0,S.zo)((0,S.kh)(n),M(e),t):(0,S.zo)((0,S.kh)(1),M(e),(0,S.el)(n+8),t)}function P(e,t){return C(e,S.zo.apply(void 0,t))}function D(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,E.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,D(e),t.push(i)}else t.push(r);var a=n.adaptations,o=[];Object.keys(a).forEach((function(t){var n=a[t];void 0!==n&&n.forEach((function(t){var n=t.id;if((0,E.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,D(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,E.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,D(e),i.push(r)}else i.push(n)}))}))}))}))}var N=n(9689);function O(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,S.zo)([8,1,18,16],e)}]}function L(e,t){if(void 0===t&&(t=O),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,N.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,S.qb)(e,8),n=(0,x.wV)(e.subarray(10,t+10)),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("KID");if(null===r)throw new Error("Cannot parse PlayReady private data: invalid XML");var i=null===r.textContent?"":r.textContent,a=(0,x.wO)((0,N.K)(i));return(0,x.ci)(a).toLowerCase()}(r),a=(0,x.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}function B(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var U={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},F={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var z=function(e){void 0===e&&(e={});var t=void 0===e.referenceDateTime?Date.UTC(1970,0,1,0,0,0,0)/1e3:e.referenceDateTime,n=void 0===e.minRepresentationBitrate?0:e.minRepresentationBitrate,r=e.serverSyncInfos,i=void 0!==r?r.serverTimestamp-r.clientTime:void 0;function a(e,t){var n=B(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,B(n,(function(e,t,n){if("Attribute"===t){var r=n.getAttribute("Name"),i=n.getAttribute("Value");null!==r&&null!==i&&e.push(r+"="+i)}return e}),[])),e}),[]);function r(t){var n=e.getAttribute(t);return null==n?void 0:n}switch(t){case"audio":var i=r("AudioTag"),a=r("BitsPerSample"),o=r("Channels"),u=r("CodecPrivateData"),l=r("FourCC"),c=r("PacketSize"),d=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===F[l]||void 0===u)return s.Z.warn("Smooth parser: Unsupported audio codec. Ignoring quality level."),null;var p=function(e,t){var n;return 0==(n="AACH"===t?5:(0,w.Z)(e)?(248&parseInt(e.substring(0,2),16))>>3:2)?"mp4a.40.2":"mp4a.40."+n}(u,l);return{audiotag:void 0!==i?parseInt(i,10):i,bitrate:v,bitsPerSample:void 0!==a?parseInt(a,10):a,channels:void 0!==o?parseInt(o,10):o,codecPrivateData:u,codecs:p,customAttributes:n,mimeType:void 0!==l?F[l]:l,packetSize:void 0!==c?parseInt(c,10):c,samplingRate:void 0!==d?parseInt(d,10):d};case"video":var h=r("CodecPrivateData"),m=r("FourCC"),g=r("MaxWidth"),y=r("MaxHeight"),_=r("Bitrate"),b=void 0===_||isNaN(parseInt(_,10))?0:parseInt(_,10);if(void 0!==m&&void 0===F[m]||void 0===h)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var T=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,w.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:b,customAttributes:n,mimeType:void 0!==m?F[m]:m,codecPrivateData:h,codecs:T,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var E=r("CodecPrivateData"),S=r("FourCC"),k=r("Bitrate");return{bitrate:void 0===k||isNaN(parseInt(k,10))?0:parseInt(k,10),customAttributes:n,mimeType:void 0!==S?F[S]:S,codecPrivateData:(0,I.Z)(E,"")};default:return s.Z.error("Smooth Parser: Unrecognized StreamIndex type: "+t),null}}function o(t){var r=t.root,i=t.timescale,o=t.baseUrl,u=t.protections,l=t.timeShiftBufferDepth,c=t.manifestReceivedTime,f=t.isLive,v=r.getAttribute("Timescale"),p=null===v||isNaN(+v)?i:+v,h=r.getAttribute("Type");if(null===h)throw new Error("StreamIndex without type.");(0,E.Z)(T.r,h)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),_=r.getAttribute("Url"),A=null===_?"":_;var I,Z=B(r,(function(e,t,r){switch(t){case"QualityLevel":var i=a(r,m);if(null===i)return e;("video"!==m||i.bitrate>n)&&e.qualityLevels.push(i);break;case"c":e.cNodes.push(r)}return e}),{qualityLevels:[],cNodes:[]}),R=Z.qualityLevels,M=Z.cNodes,P={timeline:(I=M,I.reduce((function(e,t,n){var r=t.getAttribute("d"),i=t.getAttribute("t"),a=t.getAttribute("r"),o=null!==a?+a-1:0,s=null!==i?+i:void 0,u=null!==r?+r:void 0;if(0===n)s=void 0===s||isNaN(s)?0:s;else{var l=e[n-1];if(null==s||isNaN(s)){if(null==l.duration||isNaN(l.duration))throw new Error("Smooth: Invalid CNodes. Missing timestamp.");s=l.start+l.duration*(l.repeatCount+1)}}if(null==u||isNaN(u)){var c=I[n+1];if(void 0===c)return e;var d=c.getAttribute("t"),f=(0,w.Z)(d)?+d:null;if(null===f)throw new Error("Can't build index timeline from Smooth Manifest.");u=f-s}return e.push({duration:u,start:s,repeatCount:o}),e}),[])),timescale:p};(0,d.Z)(0!==R.length,"Adaptation should have at least one playable representation.");var D=m+((0,w.Z)(y)?"_"+y:""),N=R.map((function(t){var n,r,i,a,s={timeline:P.timeline,timescale:P.timescale,media:(n=A,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},d=(0,w.Z)(t.mimeType)?t.mimeType:U[m],v=t.codecs,p=D+"_"+(null!=m?m+"-":"")+(null!=d?d+"-":"")+(null!=v?v+"-":"")+String(t.bitrate),h=[];u.length>0&&(a=u[0],u.forEach((function(e){var t=e.keyId;e.keySystems.forEach((function(e){h.push({keyId:t,systemId:e.systemId})}))})));var g={bitsPerSample:t.bitsPerSample,channels:t.channels,codecPrivateData:t.codecPrivateData,packetSize:t.packetSize,samplingRate:t.samplingRate,protection:null!=a?{keyId:a.keyId}:void 0},y=null!=e.aggressiveMode&&e.aggressiveMode,_=new b(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:c,segmentPrivateInfos:g,timeShiftBufferDepth:l}),T=(0,k.Z)({},t,{index:_,cdnMetadata:[{baseUrl:o}],mimeType:d,codecs:v,id:p});if(h.length>0||void 0!==a){var E=void 0===a?[]:a.keySystems.map((function(e){var t=e.systemId,n=e.privateData,r=t.replace(/-/g,""),i=function(e,t){if(32!==e.length)throw new Error("HSS: wrong system id length");var n=0;return C("pssh",(0,S.zo)([n,0,0,0],(0,x.nr)(e),(0,S.kh)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(E.length>0){var I=[{type:"cenc",values:E}];T.contentProtections={keyIds:h,initData:I}}else T.contentProtections={keyIds:h,initData:[]}}return T}));if("ADVT"===g)return null;var O={id:D,type:m,representations:N,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(O.closedCaption=!0),O}return function(n,r,a){var s="";if(void 0!==r){var u=(0,A.$)(r);s=r.substring(0,u)}var l=n.documentElement;if(null==l||"SmoothStreamingMedia"!==l.nodeName)throw new Error("document root should be SmoothStreamingMedia");var c=l.getAttribute("MajorVersion"),d=l.getAttribute("MinorVersion");if(null===c||null===d||!/^[2]-[0-2]$/.test(c+"-"+d))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,w.Z)(p)?isNaN(+p)?1e7:+p:1e7,m=B(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(L(r,e.keySystems));break;case"StreamIndex":t.adaptationNodes.push(r)}return t}),{adaptationNodes:[],protections:[]}),g=m.protections,y=m.adaptationNodes,_="boolean"==typeof(f=l.getAttribute("IsLive"))?f:"string"==typeof f&&"TRUE"===f.toUpperCase();if(_){var b=l.getAttribute("DVRWindowLength");null==b||isNaN(+b)||0==+b||(v=+b/h)}var T,E,S,k,x,I,Z,R=y.reduce((function(e,t){var n=o({root:t,baseUrl:s,timescale:h,protections:g,isLive:_,timeShiftBufferDepth:v,manifestReceivedTime:a});if(null===n)return e;var r=n.type,i=e[r];return void 0===i?e[r]=[n]:i.push(n),e}),{}),M=null,C=void 0!==R.video?R.video[0]:void 0,P=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==C||void 0!==P){var N=[],O=[];if(void 0!==C){var U=C.representations[0];if(void 0!==U){var F=U.index.getFirstAvailablePosition(),z=U.index.getLastAvailablePosition();null!=F&&N.push(F),null!=z&&O.push(z)}}if(void 0!==P){var V=P.representations[0];if(void 0!==V){var K=V.index.getFirstAvailablePosition(),G=V.index.getLastAvailablePosition();null!=K&&N.push(K),null!=G&&O.push(G)}}N.length>0&&(x=Math.max.apply(Math,N)),O.length>0&&(I=Math.min.apply(Math,O),Z=Math.max.apply(Math,O))}var H=l.getAttribute("Duration"),W=null!==H&&0!=+H?+H/h:void 0;if(_){T=e.suggestedPresentationDelay,E=t,S=null!=x?x:E;var j=Z;void 0===j&&(j=Date.now()/1e3-E);var q=I;void 0===q&&(q=j),k={isLinear:!0,maximumSafePosition:q,livePosition:j,time:performance.now()},M=null!=v?v:null}else{S=null!=x?x:0,k={isLinear:!1,maximumSafePosition:void 0!==I?I:void 0!==W?S+W:1/0,livePosition:void 0,time:performance.now()}}var Y=_?0:S,X=_?void 0:k.maximumSafePosition,$={availabilityStartTime:void 0===E?0:E,clockOffset:i,isLive:_,isDynamic:_,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:S,timeshiftDepth:M,maximumTimeData:k},periods:[{adaptations:R,duration:void 0!==X?X-Y:W,end:X,id:"gen-smooth-period-0",start:Y}],suggestedPresentationDelay:T,transportType:"smooth",uris:null==r?[]:[r]};return D($),$}},V=z,K=n(4597),G=n(8806),H=n(4460),W=n(8791),j=n(4644),q=n(2297);function Y(e,t,n,r,i){var a,o,u,c=[];if(i){var d=(0,l.XA)(e);null!==d?(u=function(e){var t=(0,q.nR)(e,3565190898,3392751253,2387879627,2655430559);if(void 0===t)return[];for(var n=[],r=t[0],i=t[4],a=0;a<i;a++){var o=void 0,s=void 0;1===r?(s=(0,S.pV)(t,16*a+5),o=(0,S.pV)(t,16*a+5+8)):(s=(0,S.pX)(t,8*a+5),o=(0,S.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(d),o=function(e){var t=(0,q.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,S.pV)(t,12),time:(0,S.pV)(t,4)}}(d)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)c.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:c,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:c,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,j.MM)(e),m=void 0!==(null===(a=r.privateInfos)||void 0===a?void 0:a.smoothMediaSegment)?r.privateInfos.smoothMediaSegment.time:Math.round(r.time*n);return{nextSegments:c,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var X=n(3666);function $(e,t){return C("schm",(0,S.zo)(4,(0,x.tG)(e),(0,S.kh)(t)))}function Q(e){return C("frma",(0,x.tG)(e))}function J(e){var t=[7,[e.length]];return C("stsd",S.zo.apply(void 0,t.concat(e)))}function ee(e,t,n){return C("tenc",(0,S.zo)(6,[e,t],n))}function te(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(C("senc",i),function(e){if(0===e.length)return C("saiz",new Uint8Array(0));var t=(0,S.pX)(e,0),n=(0,S.pX)(e,4),r=new Uint8Array(n+9);r.set((0,S.kh)(n),5);for(var i,a,o=9,s=8;s<e.length;)s+=8,2==(2&t)?(a=2,s+=6*(i=(0,S.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return C("saiz",r)}(i),function(e,t,n,r){return C("saio",(0,S.zo)(4,[0,0,0,1],(0,S.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),P("traf",a)}function ne(e,t){var n=(0,q.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,q.iz)(r,1835427940),a=(0,q.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,q.Qy)(a,1952868452),s=(0,q.Qy)(a,1953658222);if(null===o||null===s)throw new Error("Smooth: Invalid ISOBMFF given");var u=a.subarray(o[0],o[2]),l=a.subarray(s[0],s[2]);u.set([0,0,0,1],o[1]-o[0]+4);var c=function(e){return C("tfdt",(0,S.zo)([1,0,0,0],(0,S.el)(e)))}(t),d=function(e,t){if((1&e[t+3])>0)return e;var n=new Uint8Array(e.length+4);return n.set(e.subarray(0,t+8),0),n[t+3]=1|n[t+3],n.set([0,0,0,0],t+8),n.set(e.subarray(t+8,e.length),t+12),(0,j.J6)(n)}(l,s[1]-s[0]),f=te(u,c,d,i,(0,q.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=P("moof",[i,f]),p=(0,q.Qy)(v,1836019558),h=(0,q.Qy)(f,1953653094),m=(0,q.Qy)(d,1953658222);if(null===p||null===h||null===m)throw new Error("Smooth: Invalid moof, trun or traf generation");var g=p[1]-p[0]+i.length+(h[1]-h[0])+u.length+c.length+(m[1]-m[0])+8,y=n[2]-n[0],_=v.length-y,b=(0,q.Qy)(e,1835295092);if(null===b)throw new Error("Smooth: Invalid ISOBMFF given");if(!X.YM&&(0===_||_<=-8)){var T=b[1];return v.set((0,S.kh)(T),g),e.set(v,n[0]),_<=-8&&e.set(C("free",new Uint8Array(-_-8)),v.length),e}var E=b[1]+_;v.set((0,S.kh)(E),g);var w=new Uint8Array(e.length+_),k=e.subarray(0,n[0]),A=e.subarray(n[2],e.length);return w.set(k,0),w.set(v,k.length),w.set(A,k.length+v.length),w}var re=n(7839),ie=n(281);function ae(e,t,n,r,i,a){var o,s,u,l=P("stbl",[n,C("stts",new Uint8Array(8)),C("stsc",new Uint8Array(8)),C("stsz",new Uint8Array(12)),C("stco",new Uint8Array(8))]),c=function(e){return C("dref",(0,S.zo)(7,[1],e))}(C("url ",new Uint8Array([0,0,0,1]))),d=P("dinf",[c]),f=P("minf",[r,d,l]),v=function(e){var t,n;switch(e){case"video":t="vide",n="VideoHandler";break;case"audio":t="soun",n="SoundHandler";break;default:t="hint",n=""}return C("hdlr",(0,S.zo)(8,(0,x.tG)(t),12,(0,x.tG)(n),1))}(t),p=function(e){return C("mdhd",(0,S.zo)(12,(0,S.kh)(e),8))}(e),h=P("mdia",[p,v,f]),m=function(e,t,n){return C("tkhd",(0,S.zo)((0,S.kh)(7),8,(0,S.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,S.XT)(e),2,(0,S.XT)(t),2))}(i,a,1),g=P("trak",[m,h]),y=P("mvex",[(o=1,C("trex",(0,S.zo)(4,(0,S.kh)(o),[0,0,0,1],12)))]),_=function(e,t){return C("mvhd",(0,S.zo)(12,(0,S.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,S.XT)(t+1)))}(e,1),b=function(e,t,n){return P("moov",[e,t,n])}(_,y,g),T=(s="isom",u=["isom","iso2","iso6","avc1","dash"],C("ftyp",S.zo.apply(void 0,[(0,x.tG)(s),[0,0,0,1]].concat(u.map(x.tG)))));return(0,S.zo)(T,b)}function oe(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],c=u[2];if(void 0===l||void 0===c)throw new Error("Smooth: unsupported codec private data.");var d,f,v=function(e,t,n){var r=2===n?1:4===n?3:0,i=e[1],a=e[2],o=e[3];return C("avcC",(0,S.zo)([1,i,a,o,252|r,225],(0,S.XT)(e.length),e,[1],(0,S.XT)(t.length),t))}((0,x.nr)(l),(0,x.nr)(c),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return C("avc1",(0,S.zo)(6,(0,S.XT)(1),16,(0,S.XT)(e),(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),6,[0,1,i.length],(0,x.tG)(i),31-i.length,(0,S.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);d=J([p])}else{var h=P("schi",[ee(1,8,s)]),m=$("cenc",65536),g=function(e,t,n,r,i,a,o,s){return C("encv",(0,S.zo)(6,(0,S.XT)(1),16,(0,S.XT)(e),(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),6,[0,1,i.length],(0,x.tG)(i),31-i.length,(0,S.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,P("sinf",[Q("avc1"),m,h]));d=J([g])}return ae(e,"video",d,((f=new Uint8Array(12))[3]=1,C("vmhd",f)),t,n)}var se=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function ue(e,t,n,r,i,a,o){var s,u,l,c=function(e,t){return C("esds",(0,S.zo)(4,[3,25],(0,S.XT)(e),[0,4,17,64,21],11,[5,2],(0,x.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&se.indexOf(s))<<4)|31&u)<<3,(0,x.ci)((0,S.XT)(l))):a),d=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return C("mp4a",(0,S.zo)(6,(0,S.XT)(e),8,(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),(0,S.XT)(i),2,a))}(1,t,n,r,i,c);return J([e])}var a=P("schi",[ee(1,8,o)]),s=$("cenc",65536),u=P("sinf",[Q("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return C("enca",(0,S.zo)(6,(0,S.XT)(e),8,(0,S.XT)(t),(0,S.XT)(n),2,(0,S.XT)(r),(0,S.XT)(i),2,a,o))}(1,t,n,r,i,c,u);return J([l])}();return ae(e,"audio",d,C("smhd",new Uint8Array(8)),0,0)}var le=/(\.isml?)(\?token=\S+)?$/,ce=/\?token=(\S+)/;function de(e,t){return(0,w.Z)(t)?e.replace(ce,"?token="+t):e.replace(ce,"")}function fe(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ve(e,t){return null===e?null:null===t.url?e.baseUrl:(0,A.Z)(e.baseUrl,t.url)}function pe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ie.Z)(s)}),(0,K.ZP)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!fe(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,H.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var he=function(e){var t=e.checkMediaSegmentIntegrity,n=e.customSegmentLoader;return function(e,r,i,a,o){var s=r.segment,u=r.manifest,l=r.period,c=r.adaptation,d=r.representation;if(s.isInit){if(void 0===s.privateInfos||void 0===s.privateInfos.smoothInitSegment)throw new Error("Smooth: Invalid segment format");var f,v=s.privateInfos.smoothInitSegment,p=v.codecPrivateData,h=v.timescale,m=v.protection,g=void 0===m?{keyId:void 0,keySystems:void 0}:m;if(void 0===p)throw new Error("Smooth: no codec private data.");switch(c.type){case"video":var y=d.width,_=void 0===y?0:y,b=d.height;f=oe(h,_,void 0===b?0:b,72,72,4,p,g.keyId);break;case"audio":var T=v.channels,E=void 0===T?0:T,S=v.bitsPerSample,w=void 0===S?0:S,k=v.packetSize,A=void 0===k?0:k,x=v.samplingRate;f=ue(h,E,w,A,void 0===x?0:x,p,g.keyId);break;default:0,f=new Uint8Array(0)}return Promise.resolve({resultType:"segment-created",resultData:f})}if(null===e)return Promise.resolve({resultType:"segment-created",resultData:null});var I={adaptation:c,manifest:u,period:l,representation:d,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?pe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,c=n(I,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled){l=!0,a.deregister(d);var i=e,o=null!==(t=null==i?void 0:i.message)&&void 0!==t?t:"Unknown error when fetching a Smooth segment through a custom segmentLoader.",s=new re.Z(o,null!==(n=null==i?void 0:i.canRetry)&&void 0!==n&&n,null!==(r=null==i?void 0:i.isOfflineError)&&void 0!==r&&r,null==i?void 0:i.xhr);u(s)}},resolve:function(e){if(!l&&!a.isCancelled){l=!0,a.deregister(d),fe(r.representation)&&!0===t||s({resultType:"segment-loaded",resultData:{responseData:e.data,size:e.size,requestDuration:e.duration}});var n=e.data instanceof Uint8Array?e.data:new Uint8Array(e.data);(0,H.Z)(n,r.segment.isInit),s({resultType:"segment-loaded",resultData:{responseData:n,size:e.size,requestDuration:e.duration}})}},fallback:function(){l||a.isCancelled||(l=!0,a.deregister(d),pe(e,r,o,i,a,t).then(s,u))},progress:function(e){l||a.isCancelled||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})}});function d(e){l||((l=!0)||"function"!=typeof c||c(),u(e))}a.register(d)}))}},me=/\.wsx?(\?token=\S+)?/;function ge(e,t,n){var r;s.Z.debug("Smooth Parser: update segments information.");for(var i=e.representations,a=0;a<i.length;a++){var o=i[a];o.index instanceof b&&void 0!==(null===(r=null==n?void 0:n.privateInfos)||void 0===r?void 0:r.smoothMediaSegment)?o.index.addNewSegments(t,n.privateInfos.smoothMediaSegment):s.Z.warn("Smooth Parser: should only encounter SmoothRepresentationIndex")}}var ye=function(e){var t=V(e),n=he(e),i={customManifestLoader:e.manifestLoader},c={loadSegment:function(e,t,r,i,a){var o=ve(e,t.segment);return n(o,t,r,i,a)},parseSegment:function(e,t,n){var r,i,a=t.segment,o=t.adaptation,s=t.manifest,u=e.data,l=e.isChunked;if(null===u)return a.isInit?{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0}:{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var c=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var d=null===(i=null===(r=a.privateInfos)||void 0===r?void 0:r.smoothInitSegment)||void 0===i?void 0:i.timescale;return{segmentType:"init",initializationData:u,initializationDataSize:u.byteLength,initTimescale:d,protectionDataUpdate:!1}}var f=void 0!==n?Y(c,l,n,a,s.isLive):null;if(null===f||null===f.chunkInfos||void 0===f.scaledSegmentTime)throw new Error("Smooth Segment without time information");var v=f.nextSegments,p=f.chunkInfos,h=ne(c,f.scaledSegmentTime);return v.length>0&&ge(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},d={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ve(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):fe(s)?(0,K.ZP)({url:u,responseType:"arraybuffer",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(t){if(!0!==e.checkMediaSegmentIntegrity)return{resultType:"segment-loaded",resultData:t};var r=new Uint8Array(t.responseData);return(0,H.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,K.ZP)({url:u,responseType:"text",timeout:r.timeout,cancelSignal:i,onProgress:a.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))},parseSegment:function(e,t,n){var r,i,a,o=t.manifest,u=t.adaptation,c=t.representation,d=t.segment,f=u.language,v=fe(c),p=c.mimeType,h=void 0===p?"":p,m=c.codec,g=void 0===m?"":m,y=e.data,_=e.isChunked;if(d.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(null===y)return{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]};var b,T,E,S,w=null;if(v){var k;i=(k="string"==typeof y?(0,x.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var A=void 0!==n?Y(k,_,n,d,o.isLive):null;a=null==A?void 0:A.nextSegments,null===(w=null!==(r=null==A?void 0:A.chunkInfos)&&void 0!==r?r:null)?_?s.Z.warn("Smooth: Unavailable time data for current text track."):(b=d.time,T=d.end):(b=w.time,T=void 0!==w.duration?w.time+w.duration:d.end);var I=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===I||"stpp.ttml.im1t"===I)S="ttml";else{if("wvtt"!==I)throw new Error("could not find a text-track parser for the type "+h);S="vtt"}var Z=(0,l.Le)(k);E=null===Z?"":(0,x.uR)(Z)}else{var R;if(b=d.time,T=d.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,R=(0,x.uR)(M)}else R=y;switch(h){case"application/x-sami":case"application/smil":S="sami";break;case"application/ttml+xml":S="ttml";break;case"text/vtt":S="vtt"}if(void 0===S){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);S="srt"}E=R}return null!==w&&Array.isArray(a)&&a.length>0&&ge(u,a,d),{segmentType:"media",chunkData:{type:S,data:E,start:b,end:T,language:f},chunkSize:i,chunkInfos:w,chunkOffset:null!=b?b:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}};return{manifest:{resolveManifestUrl:function(e,t){if(void 0===e)return Promise.resolve(void 0);var n;me.test(e)?((0,G.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,K.ZP)({url:de(e,""),responseType:"document",cancelSignal:t}).then((function(e){var t=e.responseData.getElementsByTagName("media")[0].getAttribute("src");if(null===t||0===t.length)throw new Error("Invalid ISML");return t}))):n=Promise.resolve(e);var r=function(e){var t=ce.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return de(function(e){return le.test(e)?((0,G.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(le,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,W.Z)(i,"text"),parseManifest:function(n,r){var i,a=null!==(i=n.url)&&void 0!==i?i:r.originalUrl,o=n.receivedTime,s=n.responseData,l="string"==typeof s?(new DOMParser).parseFromString(s,"text/xml"):s,c=t(l,a,o);return{manifest:new u.ZP(c,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:c,video:c,text:d,image:{loadSegment:function(e,t,n,i,o){return(0,r.Z)(a().mark((function r(){var s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s=t.segment,u=ve(e,s),!s.isInit&&null!==u){r.next=4;break}return r.abrupt("return",{resultType:"segment-created",resultData:null});case 4:return r.next=6,(0,K.ZP)({url:u,responseType:"arraybuffer",timeout:n.timeout,onProgress:o.onProgress,cancelSignal:i});case 6:return l=r.sent,r.abrupt("return",{resultType:"segment-loaded",resultData:l});case 8:case"end":return r.stop()}}),r)})))()},parseSegment:function(e,t,n){var r=e.data,i=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(i)throw new Error("Image data should not be downloaded in chunks");return null===r||null===o.Z.imageParser?{segmentType:"media",chunkData:null,chunkInfos:null,chunkOffset:0,chunkSize:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}:{segmentType:"media",chunkData:{data:o.Z.imageParser(new Uint8Array(r)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkSize:void 0,chunkOffset:0,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}}}}},281:function(e,t,n){"use strict";function r(e){var t=e[0],n=e[1];return n===1/0?"bytes="+t+"-":"bytes="+t+"-"+n}n.d(t,{Z:function(){return r}})},4460:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5389),i=n(8766);function a(e,t){if(t){if((0,i.Z)(e,1718909296)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `ftyp` box");if((0,i.Z)(e,1836019574)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moov` box")}else{if((0,i.Z)(e,1836019558)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `moof` box");if((0,i.Z)(e,1835295092)<0)throw new r.Z("INTEGRITY_ERROR","Incomplete `mdat` box")}}},8766:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(6968);function i(e,t){for(var n=e.length,i=0;i+8<=n;){var a=(0,r.pX)(e,i);if(0===a)a=n-i;else if(1===a){if(i+16>n)return-1;a=(0,r.pV)(e,i+8)}if(isNaN(a)||a<=0)return-1;if((0,r.pX)(e,i+4)===t)return i+a<=n?i:-1;i+=a}return-1}},8791:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7904),i=n(4597),a=n(7839);function o(e,t){var n=e.customManifestLoader,o=function(e){return function(t,n,a){if(void 0===t)throw new Error("Cannot perform HTTP(s) request. URL not known");switch(e){case"arraybuffer":return(0,i.ZP)({url:t,responseType:"arraybuffer",timeout:n.timeout,cancelSignal:a});case"text":return(0,i.ZP)({url:t,responseType:"text",timeout:n.timeout,cancelSignal:a});case"document":return(0,i.ZP)({url:t,responseType:"document",timeout:n.timeout,cancelSignal:a});default:(0,r.Z)(e)}}}(t);return"function"!=typeof n?o:function(e,t){return function(n,r,i){return new Promise((function(o,s){var u=Date.now()-performance.now(),l=!1,c=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled){l=!0,i.deregister(d);var o=e,u=null!==(t=null==o?void 0:o.message)&&void 0!==t?t:"Unknown error when fetching the Manifest through a custom manifestLoader.",c=new a.Z(u,null!==(n=null==o?void 0:o.canRetry)&&void 0!==n&&n,null!==(r=null==o?void 0:o.isOfflineError)&&void 0!==r&&r,null==o?void 0:o.xhr);s(c)}},resolve:function(e){if(!l&&!i.isCancelled){l=!0,i.deregister(d);var t=void 0!==e.receivingTime?e.receivingTime-u:void 0,n=void 0!==e.sendingTime?e.sendingTime-u:void 0;o({responseData:e.data,size:e.size,requestDuration:e.duration,url:e.url,receivedTime:t,sendingTime:n})}},fallback:function(){l||i.isCancelled||(l=!0,i.deregister(d),t(n,r,i).then(o,s))}},{timeout:r.timeout});function d(e){l||(l=!0,"function"==typeof c&&c(),s(e))}i.register(d)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}n.d(t,{Z:function(){return r}})},3274:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.find)return e.find(t,n);for(var r=e.length>>>0,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return a}}n.d(t,{Z:function(){return r}})},5138:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,n);for(var r=e.length>>>0,i=0;i<r;i++)if(t.call(n,e[i],i,e))return i;return-1}n.d(t,{Z:function(){return r}})},7714:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof Array.prototype.includes)return e.includes(t,n);var r=e.length>>>0;if(0===r)return!1;for(var i,a,o=0|n,s=o>=0?Math.min(o,r-1):Math.max(r+o,0);s<r;){if((i=e[s])===(a=t)||"number"==typeof i&&"number"==typeof a&&isNaN(i)&&isNaN(a))return!0;s++}return!1}n.d(t,{Z:function(){return r}})},811:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},u:function(){return a}});var r=n(1946);function i(e,t){0}function a(e,t,n){for(var a in void 0===n&&(n="object"),i((0,r.Z)(e)),t)t.hasOwnProperty(a)&&i((e[a],t[a]),t[a])}},7904:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7326),i=n(4578),a=function(e){function t(n){var i;return i=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(i),t.prototype),i.name="AssertionError",i.message=n,i}return(0,i.Z)(t,e),t}((0,n(2146).Z)(Error));function o(e){throw new a("Unreachable path taken")}},9689:function(e,t,n){"use strict";n.d(t,{J:function(){return s},K:function(){return u}});var r=n(3887),i=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],a=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function o(e){if(e>=a.length)throw new Error("Unable to parse base64 string.");var t=a[e];if(255===t)throw new Error("Unable to parse base64 string.");return t}function s(e){var t,n="",r=e.length;for(t=2;t<r;t+=3)n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2|e[t]>>6],n+=i[63&e[t]];return t===r+1&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4],n+="=="),t===r&&(n+=i[e[t-2]>>2],n+=i[(3&e[t-2])<<4|e[t-1]>>4],n+=i[(15&e[t-1])<<2],n+="="),n}function u(e){var t=e.length%4,n=e;0!==t&&(r.Z.warn("base64ToBytes: base64 given miss padding"),n+=3===t?"=":2===t?"==":"===");var i=n.indexOf("=");if(-1!==i&&i<n.length-2)throw new Error("Unable to parse base64 string.");for(var a,s=n.endsWith("==")?2:n.endsWith("=")?1:0,u=n.length,l=new Uint8Array(u/4*3),c=0,d=0;c<u;c+=4,d+=3)a=o(n.charCodeAt(c))<<18|o(n.charCodeAt(c+1))<<12|o(n.charCodeAt(c+2))<<6|o(n.charCodeAt(c+3)),l[d]=a>>16,l[d+1]=a>>8&255,l[d+2]=255&a;return l.subarray(0,l.length-s)}},6968:function(e,t,n){"use strict";function r(){for(var e,t=arguments.length,n=-1,r=0;++n<t;)r+="number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?e:e.length;var i=new Uint8Array(r),a=0;for(n=-1;++n<t;)"number"==typeof(e=n<0||arguments.length<=n?void 0:arguments[n])?a+=e:e.length>0&&(i.set(e,a),a+=e.length);return i}function i(e,t){return(e[t+0]<<8)+(e[t+1]<<0)}function a(e,t){return 65536*e[t+0]+256*e[t+1]+e[t+2]}function o(e,t){return 16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3]}function s(e,t){return 4294967296*(16777216*e[t+0]+65536*e[t+1]+256*e[t+2]+e[t+3])+16777216*e[t+4]+65536*e[t+5]+256*e[t+6]+e[t+7]}function u(e){return new Uint8Array([e>>>8&255,255&e])}function l(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function c(e){var t=e%4294967296,n=(e-t)/4294967296;return new Uint8Array([n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t])}function d(e,t){return(e[t+0]<<0)+(e[t+1]<<8)}function f(e,t){return e[t+0]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]}function v(e){return new Uint8Array([255&e,e>>>8&255,e>>>16&255,e>>>24&255])}function p(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer)}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},_f:function(){return p},dN:function(){return f},el:function(){return c},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return d},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";function r(e,t){return new Promise((function(n,r){var i=setTimeout((function(){a(),n()}),e),a=t.register((function(e){clearTimeout(i),r(e)}))}))}n.d(t,{Z:function(){return r}})},8117:function(e,t,n){"use strict";var r=n(1480),i=n(3102),a=n(2817),o=n(1946);t.Z=function(e){return e instanceof r.y?e:e instanceof Promise||!(0,o.Z)(e)&&"function"==typeof e.then?(0,i.D)(e):(0,a.of)(e)}},8333:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r,i=n(8720),a=n(5987),o=n(8337),s=1,u={};function l(e){return e in u&&(delete u[e],!0)}var c=function(e){var t=s++;return u[t]=!0,r||(r=Promise.resolve()),r.then((function(){return l(t)&&e()})),t},d=function(e){l(e)},f={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=f.delegate;return((null==n?void 0:n.setImmediate)||c).apply(void 0,(0,a.ev)([],(0,a.CR)(e)))},clearImmediate:function(e){var t=f.delegate;return((null==t?void 0:t.clearImmediate)||d)(e)},delegate:void 0},v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return(0,a.ZT)(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t._scheduled||(t._scheduled=f.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);var a=t.actions;null!=n&&(null===(i=a[a.length-1])||void 0===i?void 0:i.id)!==n&&(f.clearImmediate(n),t._scheduled=void 0)},t}(o.o),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,a.ZT)(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var n,r=this.actions;e=e||r.shift();do{if(n=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,n){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw n}},t}(n(9682).v),h=new p(v);function m(){return function(e){return e.pipe((0,i.R)(h))}}},1959:function(e,t,n){"use strict";n.d(t,{R:function(){return s},Z:function(){return o}});var r=n(1480),i=n(3887),a=n(1946),o=function(){function e(){this._listeners={}}var t=e.prototype;return t.addEventListener=function(e,t,n){var r=this,i=this._listeners[e];Array.isArray(i)?i.push(t):this._listeners[e]=[t],void 0!==n&&n.register((function(){r.removeEventListener(e,t)}))},t.removeEventListener=function(e,t){if((0,a.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,a.Z)(t))delete this._listeners[e];else{var r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&delete this._listeners[e]}}},t.trigger=function(e,t){var n=this._listeners[e];Array.isArray(n)&&n.slice().forEach((function(e){try{e(t)}catch(e){i.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}();function s(e,t){return new r.y((function(n){function r(e){n.next(e)}return e.addEventListener(t,r),function(){e.removeEventListener(t,r)}}))}},2793:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(9917),i=n(9127),a=n(4975);function o(e,t){return function(n){return(0,r.P)((function(){return n.pipe((0,i.U)(e),(0,a.h)((function(e){return e!==t})))}))}}},9592:function(e,t,n){"use strict";function r(e,t){return"function"==typeof Array.prototype.flatMap?e.flatMap(t):e.reduce((function(e,n){var r=t(n);return Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e)}),[])}n.d(t,{Z:function(){return r}})},2572:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});function r(e){return e*(.3*(2*Math.random()-1)+1)}},2870:function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}n.d(t,{Z:function(){return r}})},908:function(e,t,n){"use strict";function r(){var e="",t=-1;return function(){return++t>=Number.MAX_SAFE_INTEGER&&(e+="0",t=0),e+String(t)}}n.d(t,{Z:function(){return r}})},6923:function(e,t,n){"use strict";function r(e){return"string"==typeof e&&e.length>0}n.d(t,{Z:function(){return r}})},1946:function(e,t,n){"use strict";function r(e){return null==e}n.d(t,{Z:function(){return r}})},7829:function(e,t,n){"use strict";var r=n(5553);t.ZP=r.ZP},5553:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},iH:function(){return l},Y1:function(){return u}});var r=n(6923),i=n(1946),a={aa:"aar",ab:"abk",ae:"ave",af:"afr",ak:"aka",am:"amh",an:"arg",ar:"ara",as:"asm",av:"ava",ay:"aym",az:"aze",ba:"bak",be:"bel",bg:"bul",bi:"bis",bm:"bam",bn:"ben",bo:"bod",br:"bre",bs:"bos",ca:"cat",ce:"che",ch:"cha",co:"cos",cr:"cre",cs:"ces",cu:"chu",cv:"chv",cy:"cym",da:"dan",de:"deu",dv:"div",dz:"dzo",ee:"ewe",el:"ell",en:"eng",eo:"epo",es:"spa",et:"est",eu:"eus",fa:"fas",ff:"ful",fi:"fin",fj:"fij",fo:"fao",fr:"fra",fy:"fry",ga:"gle",gd:"gla",gl:"glg",gn:"grn",gu:"guj",gv:"glv",ha:"hau",he:"heb",hi:"hin",ho:"hmo",hr:"hrv",ht:"hat",hu:"hun",hy:"hye",hz:"her",ia:"ina",id:"ind",ie:"ile",ig:"ibo",ii:"iii",ik:"ipk",io:"ido",is:"isl",it:"ita",iu:"iku",ja:"jpn",jv:"jav",ka:"kat",kg:"kon",ki:"kik",kj:"kua",kk:"kaz",kl:"kal",km:"khm",kn:"kan",ko:"kor",kr:"kau",ks:"kas",ku:"kur",kv:"kom",kw:"cor",ky:"kir",la:"lat",lb:"ltz",lg:"lug",li:"lim",ln:"lin",lo:"lao",lt:"lit",lu:"lub",lv:"lav",mg:"mlg",mh:"mah",mi:"mri",mk:"mkd",ml:"mal",mn:"mon",mr:"mar",ms:"msa",mt:"mlt",my:"mya",na:"nau",nb:"nob",nd:"nde",ne:"nep",ng:"ndo",nl:"nld",nn:"nno",no:"nor",nr:"nbl",nv:"nav",ny:"nya",oc:"oci",oj:"oji",om:"orm",or:"ori",os:"oss",pa:"pan",pi:"pli",pl:"pol",ps:"pus",pt:"por",qu:"que",rm:"roh",rn:"run",ro:"ron",ru:"rus",rw:"kin",sa:"san",sc:"srd",sd:"snd",se:"sme",sg:"sag",si:"sin",sk:"slk",sl:"slv",sm:"smo",sn:"sna",so:"som",sq:"sqi",sr:"srp",ss:"ssw",st:"sot",su:"sun",sv:"swe",sw:"swa",ta:"tam",te:"tel",tg:"tgk",th:"tha",ti:"tir",tk:"tuk",tl:"tgl",tn:"tsn",to:"ton",tr:"tur",ts:"tso",tt:"tat",tw:"twi",ty:"tah",ug:"uig",uk:"ukr",ur:"urd",uz:"uzb",ve:"ven",vi:"vie",vo:"vol",wa:"wln",wo:"wol",xh:"xho",yi:"yid",yo:"yor",za:"zha",zh:"zho",zu:"zul"},o={alb:"sqi",arm:"hye",baq:"eus",bur:"mya",chi:"zho",cze:"ces",dut:"nld",fre:"fra",geo:"kat",ger:"deu",gre:"ell",ice:"isl",mac:"mkd",mao:"mri",may:"msa",per:"fas",slo:"slk",rum:"ron",tib:"bod",wel:"cym"};function s(e){if((0,i.Z)(e)||""===e)return"";var t=function(e){var t;switch(e.length){case 2:t=a[e];break;case 3:t=o[e]}return t}((""+e).toLowerCase().split("-")[0]);return(0,r.Z)(t)?t:e}function u(e){if(!(0,i.Z)(e)){var t,n=!1;return"string"==typeof e?t=e:(t=e.language,!0===e.closedCaption&&(n=!0)),{language:t,closedCaption:n,normalized:s(t)}}return e}function l(e){if((0,i.Z)(e))return e;if("string"==typeof e)return{language:e,audioDescription:!1,normalized:s(e)};var t={language:e.language,audioDescription:!0===e.audioDescription,normalized:s(s(e.language))};return!0===e.isDub&&(t.isDub=!0),t}var c=s},8894:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},8026:function(e,t){"use strict";t.Z="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}},1679:function(e,t,n){"use strict";t.Z="function"==typeof Object.values?Object.values:function(e){return Object.keys(e).map((function(t){return e[t]}))}},2829:function(e,t,n){"use strict";n.d(t,{A1:function(){return o},DD:function(){return h},F_:function(){return v},JN:function(){return c},L7:function(){return m},Ti:function(){return s},XS:function(){return f},at:function(){return p},kR:function(){return g},rx:function(){return d},tn:function(){return _},uH:function(){return b}});function r(e,t){return Math.abs(e-t)<.016666666666666666}function i(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function a(e,t){return e.end<=t.start}function o(e,t){for(var n=0;n<e.length;n++)if(s(e[n],t))return!0;return!1}function s(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function u(e,t){return s(e,t.start)||e.start<t.end&&t.end<e.end||s(t,e.start)}function l(e,t){return r(t.start,e.end)||r(t.end,e.start)}function c(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function d(e,t){for(var n=e.length-1;n>=0;n--){var r=e.start(n);if(t>=r){var i=e.end(n);if(t<i)return{start:r,end:i}}}return null}function f(e,t){for(var n=e.length,r=0;r<n;r++){var i=e.start(r);if(t<i)return i-t}return 1/0}function v(e,t){for(var n=null,r=[],i=0;i<e.length;i++){var a=e.start(i),o=e.end(i);t<a||t>=o?r.push({start:a,end:o}):n={start:a,end:o}}return{outerRanges:r,innerRange:n}}function p(e,t){var n=d(e,t);return null!==n?n.end-n.start:0}function h(e,t){var n=d(e,t);return null!==n?t-n.start:0}function m(e,t){var n=d(e,t);return null!==n?n.end-t:1/0}function g(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var o=e[r],s=u(n,o),c=l(n,o);if(s||c)n=i(n,o),e.splice(r--,1);else if(0===r){if(a(n,e[0]))break}else if(a(e[r-1],n)&&a(n,o))break}return e.splice(r,0,n),function(e){for(var t=1;t<e.length;t++){var n=e[t-1],r=e[t];if(l(n,r)){var a=i(n,r);e.splice(--t,2,a)}}return e}(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.start===n.end&&e.splice(t--,1)}return e}(e))}function y(e,t){for(var n=[],r=0;r<t.length;r++)u(e,t[r])&&n.push(t[r]);return n}function _(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=y(i,t);if(a.length>0)for(var o=0;o<a.length;o++){var s=a[o];n.push({start:Math.max(i.start,s.start),end:Math.min(i.end,s.end)})}}return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=y(i,t);if(o.length>0)for(var s=0;s<o.length;s++){var u=o[s];a.push({start:Math.max(i.start,u.start),end:Math.min(i.end,u.end)})}if(0===a.length)n.push(i);else{for(var l=i.start,c=0;c<a.length;c++)a[c].start>l&&n.push({start:l,end:a[c].start}),l=a[c].end;l<i.end&&n.push({start:l,end:i.end})}}return n}},5095:function(e,t,n){"use strict";n.d(t,{$l:function(){return s},ZP:function(){return s},lR:function(){return u}});var r=n(1480),i=n(288);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e,n=[],o=!1;return{getValue:function(){return t},setValue:function(e){if(!o&&(t=e,0!==n.length))for(var r,i=a(n.slice());!(r=i()).done;){var s=r.value;try{s.hasBeenCleared||s.trigger(e)}catch(e){}}},setValueIfChanged:function(e){e!==t&&this.setValue(e)},asObservable:function(e){return new r.y((function(r){if(!0!==e&&r.next(t),!o){var i={trigger:r.next.bind(r),complete:r.complete.bind(r),hasBeenCleared:!1};return n.push(i),function(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}}r.complete()}))},onUpdate:function(e,r){if(!0===(null==r?void 0:r.emitCurrentValue)&&e(t),!o){var i={trigger:e,complete:a,hasBeenCleared:!1};n.push(i),void 0!==(null==r?void 0:r.clearSignal)&&r.clearSignal.register(a)}function a(){i.hasBeenCleared=!0;var e=n.indexOf(i);e>=0&&n.splice(e,1)}},waitUntilDefined:function(e,n){if(void 0===t){if(!o){var r=new i.ZP;void 0!==(null==n?void 0:n.clearSignal)&&n.clearSignal.register((function(){return r.cancel()})),this.onUpdate((function(n){if(void 0!==n)return r.cancel(),void e(t)}),{clearSignal:r.signal})}}else e(t)},finish:function(){o=!0;for(var e,t=a(n.slice());!(e=t()).done;){var r=e.value;try{r.hasBeenCleared||r.complete(),r.hasBeenCleared=!0}catch(e){}}n.length=0}}}function u(e,t,n){var r=s(t(e.getValue()));return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),void 0!==n&&n.register((function(){r.finish()})),r}},4597:function(e,t,n){"use strict";n.d(t,{ZP:function(){return o}});var r=n(9105),i=n(6923),a=n(1946);var o=function(e){var t={url:e.url,headers:e.headers,responseType:(0,a.Z)(e.responseType)?"json":e.responseType,timeout:e.timeout};return new Promise((function(n,o){var s,u=e.onProgress,l=e.cancelSignal,c=t.url,d=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",c,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){_(),o(new r.Z(c,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.Z)(d)){var h=d;for(var m in h)h.hasOwnProperty(m)&&p.setRequestHeader(m,h[m])}var g=performance.now(),y=null;function _(){void 0!==s&&clearTimeout(s),null!==y&&y()}void 0!==l&&(y=l.register((function(e){_(),(0,a.Z)(p)||4===p.readyState||p.abort(),o(e)})),l.isCancelled)||(p.onerror=function(){_(),o(new r.Z(c,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){_(),o(new r.Z(c,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:c,duration:t-g,sendingTime:g,currentTime:t,size:e.loaded,totalSize:e.total})}),p.onload=function(e){if(4===p.readyState)if(_(),p.status>=200&&p.status<300){var t,s=performance.now(),u=p.response instanceof ArrayBuffer?p.response.byteLength:e.total,l=p.status,d=p.responseType,f=(0,i.Z)(p.responseURL)?p.responseURL:c;if(t="json"===d?"object"==typeof p.response?p.response:function(e){try{return JSON.parse(e)}catch(e){return null}}(p.responseText):p.response,(0,a.Z)(t))return void o(new r.Z(c,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:d,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.Z(c,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{$:function(){return s},Z:function(){return o}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(e){if(!i.test(e))return e;for(var t=[],n=e.split("/"),r=0,a=n.length;r<a;r++)if(".."===n[r])t.pop();else{if("."===n[r])continue;t.push(n[r])}return t.join("/")}function o(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var i=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof i&&""!==i&&(r.test(i)?t=i:("/"===i[0]&&(i=i.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+i))}return a(t)}function s(e){var t=e.lastIndexOf("/");if(t<0)return e.length;if(r.test(e)){var n=e.indexOf("/");if(n>=0&&t===n+1)return e.length}var i=e.indexOf("?");return i>=0&&i<t?s(e.substring(0,i)):t+1}},5561:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(3610);function i(e,t){try{return e(t)}catch(e){return(0,r._)((function(){return e}))}}},9252:function(e,t,n){"use strict";function r(e,t,n){if("function"==typeof String.prototype.startsWith)return e.startsWith(t,n);var r="number"==typeof n?Math.max(n,0):0;return e.substring(r,r+t.length)===t}n.d(t,{Z:function(){return r}})},3635:function(e,t,n){"use strict";n.d(t,{DM:function(){return h},TZ:function(){return s},ci:function(){return v},nr:function(){return f},tG:function(){return l},uR:function(){return d},wO:function(){return p},wV:function(){return u}});var r=n(3887),i=n(811),a="object"==typeof window&&"function"==typeof window.TextDecoder,o="object"==typeof window&&"function"==typeof window.TextEncoder;function s(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint8Array(t),r=0;r<n.length;r+=2){var i=e.charCodeAt(r/2);n[r]=255&i,n[r+1]=i>>8&255}return n}function u(e){if(a)try{return new TextDecoder("utf-16le").decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-16LE, fallbacking to another implementation",t)}for(var n="",i=0;i<e.length;i+=2)n+=String.fromCharCode((e[i+1]<<8)+e[i]);return n}function l(e){if(o)try{return(new TextEncoder).encode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextEncoder to encode string into UTF-8, fallbacking to another implementation",t)}var n,i=encodeURIComponent(e);if("function"==typeof unescape)n=unescape(i);else{var a=/[0-9a-fA-F]/,s=i.length;n="";for(var u=0;u<i.length;u++){var l=!1;if("%"===i[u])if(u<=s-6&&"u"===i[u+1]&&a.test(i[u+2])&&a.test(i[u+3])&&a.test(i[u+4])&&a.test(i[u+5])){var c=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(c),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var d=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(d),l=!0,u+=2}l||(n+=i[u])}}for(var f=new Uint8Array(n.length),v=0;v<n.length;v++)f[v]=255&n.charCodeAt(v);return f}function c(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function d(e){if(a)try{return(new TextDecoder).decode(e)}catch(e){var t=e instanceof Error?e:"";r.Z.warn("Utils: could not use TextDecoder to parse UTF-8, fallbacking to another implementation",t)}var n=e;239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));var i,o=function(e){for(var t="",n=0;n<e.length;n+=16e3){var r=e.subarray(n,n+16e3);t+=String.fromCharCode.apply(null,r)}return t}(n);if("function"==typeof escape)i=escape(o);else{var s=/[A-Za-z0-9*_\+-\.\/]/;i="";for(var u=0;u<o.length;u++)if(s.test(o[u]))i+=o[u];else{var l=o.charCodeAt(u);i+=l>=256?"%u"+c(l,4):"%"+c(l,2)}}return decodeURIComponent(i)}function f(e){for(var t=e.length,n=new Uint8Array(t/2),r=0,i=0;r<t;r+=2,i++)n[i]=255&parseInt(e.substring(r,r+2),16);return n}function v(e,t){void 0===t&&(t="");for(var n="",r=0;r<e.byteLength;r++)n+=(e[r]>>>4).toString(16),n+=(15&e[r]).toString(16),t.length>0&&r<e.byteLength-1&&(n+=t);return n}function p(e){(0,i.Z)(16===e.length,"GUID length should be 16");var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=new Uint8Array(16);return c[0]=a,c[1]=r,c[2]=n,c[3]=t,c[4]=s,c[5]=o,c[6]=l,c[7]=u,c.set(e.subarray(8,16),8),c}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:d(e.subarray(t,n))}}},5278:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1946);function i(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var a=n.length;e<a;){var o=n[e];if(!(0,r.Z)(o))return o;e++}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},ZP:function(){return u}});var r=n(7326),i=n(4578),a=n(2146),o=n(811),s=n(8894),u=function(){function e(e){var t,n=this,r=(t=s.Z,[function(e){t(e)},function(e){t=e}]),i=r[0],a=r[1];if(this.isUsed=!1,this._trigger=i,this.signal=new l(a),void 0!==(null==e?void 0:e.cancelOn)){var o=e.cancelOn.register((function(){n.cancel()}));this.signal.register(o)}}return e.prototype.cancel=function(e){if(!this.isUsed){this.isUsed=!0;var t=null!=e?e:new c;this._trigger(t)}},e.isCancellationError=function(e){return e instanceof c},e}(),l=function(){function e(e){var t=this;this.isCancelled=!1,this.cancellationError=null,this._listeners=[],e((function(e){for(t.cancellationError=e,t.isCancelled=!0;t._listeners.length>0;){(0,t._listeners.splice(t._listeners.length-1,1)[0])(e)}}))}var t=e.prototype;return t.register=function(e){var t=this;return this.isCancelled&&((0,o.Z)(null!==this.cancellationError),e(this.cancellationError)),this._listeners.push(e),function(){return t.deregister(e)}},t.deregister=function(e){if(!this.isCancelled)for(var t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)},e}(),c=function(e){function t(){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(n),t.prototype),n.name="CancellationError",n.message="This task was cancelled.",n}return(0,i.Z)(t,e),t}((0,a.Z)(Error))},8806:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(7714),i=[];function a(e){(0,r.Z)(i,e)||(console.warn(e),i.push(e))}},7473:function(e){"use strict";var t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},n=function(e){var n,r,i=document.createTextNode(""),a=0;return new e((function(){var e;if(n)r&&(n=r.concat(n));else{if(!r)return;n=r}if(r=n,n=null,"function"==typeof r)return e=r,r=null,void e();for(i.data=a=++a%2;r;)e=r.shift(),r.length||(r=null),e()})).observe(i,{characterData:!0}),function(e){t(e),n?"function"==typeof n?n=[n,e]:n.push(e):(n=e,i.data=a=++a%2)}};e.exports=function(){if("object"==typeof process&&process&&"function"==typeof process.nextTick)return process.nextTick;if("function"==typeof queueMicrotask)return function(e){queueMicrotask(t(e))};if("object"==typeof document&&document){if("function"==typeof MutationObserver)return n(MutationObserver);if("function"==typeof WebKitMutationObserver)return n(WebKitMutationObserver)}return"function"==typeof setImmediate?function(e){setImmediate(t(e))}:"function"==typeof setTimeout||"object"==typeof setTimeout?function(e){setTimeout(t(e),0)}:null}()},1480:function(e,t,n){"use strict";n.d(t,{y:function(){return d}});var r=n(6267),i=n(5720),a=n(6766),o=n(278);function s(e){return 0===e.length?o.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var u=n(3912),l=n(8474),c=n(8846),d=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.Lv||function(e){return e&&(0,l.m)(e.next)&&(0,l.m)(e.error)&&(0,l.m)(e.complete)}(a)&&(0,i.Nn)(a)?e:new r.Hp(e,t,n);return(0,c.x)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(t))((function(t,i){var a=new r.Hp({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function f(e){var t;return null!==(t=null!=e?e:u.v.Promise)&&void 0!==t?t:Promise}},3:function(e,t,n){"use strict";n.d(t,{t:function(){return o}});var r=n(5987),i=n(6716),a=n(4318),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.ZT)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.x)},6716:function(e,t,n){"use strict";n.d(t,{x:function(){return l}});var r=n(5987),i=n(1480),a=n(5720),o=(0,n(1819).d)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(3699),u=n(8846),l=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.ZT)(t,e),t.prototype.lift=function(e){var t=new c(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=(0,r.XA)(t.currentObservers),o=a.next();!o.done;o=a.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.x)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.x)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?a.Lc:(this.currentObservers=null,o.push(e),new a.w0((function(){t.currentObservers=null,(0,s.P)(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new c(e,t)},t}(i.y),c=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.ZT)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Lc},t}(l)},6267:function(e,t,n){"use strict";n.d(t,{Hp:function(){return g},Lv:function(){return v}});var r=n(5987),i=n(8474),a=n(5720),o=n(3912),s=n(5),u=n(2967),l=c("C",void 0,void 0);function c(e,t,n){return{kind:e,value:t,error:n}}var d=n(8380),f=n(8846),v=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Nn)(t)&&t.add(n)):n.destination=b,n}return(0,r.ZT)(t,e),t.create=function(e,t,n){return new g(e,t,n)},t.prototype.next=function(e){this.isStopped?_(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_(c("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_(l,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.w0),p=Function.prototype.bind;function h(e,t){return p.call(e,t)}var m=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),g=function(e){function t(t,n,r){var a,s,u=e.call(this)||this;(0,i.m)(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&o.v.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},a={next:t.next&&h(t.next,s),error:t.error&&h(t.error,s),complete:t.complete&&h(t.complete,s)}):a=t;return u.destination=new m(a),u}return(0,r.ZT)(t,e),t}(v);function y(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,s.h)(e)}function _(e,t){var n=o.v.onStoppedNotification;n&&d.z.setTimeout((function(){return n(e,t)}))}var b={closed:!0,next:u.Z,error:function(e){throw e},complete:u.Z}},5720:function(e,t,n){"use strict";n.d(t,{Lc:function(){return u},w0:function(){return s},Nn:function(){return l}});var r=n(5987),i=n(8474),a=(0,n(1819).d)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(3699),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var l=(0,r.XA)(u),d=l.next();!d.done;d=l.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.m)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var p=(0,r.XA)(v),h=p.next();!h.done;h=p.next()){var m=h.value;try{c(m)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.ev)((0,r.ev)([],(0,r.CR)(s)),(0,r.CR)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&(0,o.P)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function l(e){return e instanceof s||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function c(e){(0,i.m)(e)?e():e.unsubscribe()}},3912:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},2034:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(4367);function i(){return(0,r.J)(1)}var a=n(2457),o=n(3102);function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i()((0,o.D)(e,(0,a.yG)(e)))}},9917:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(1480),i=n(7878);function a(e){return new r.y((function(t){(0,i.Xf)(e()).subscribe(t)}))}},1545:function(e,t,n){"use strict";n.d(t,{E:function(){return r}});var r=new(n(1480).y)((function(e){return e.complete()}))},3102:function(e,t,n){"use strict";n.d(t,{D:function(){return T}});var r=n(7878),i=n(7845),a=n(6798),o=n(2566);function s(e,t){return void 0===t&&(t=0),(0,a.e)((function(n,r){n.subscribe((0,o.x)(r,(function(n){return(0,i.f)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.f)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.f)(r,e,(function(){return r.error(n)}),t)})))}))}var u=n(8720);var l=n(1480);var c=n(9768),d=n(8474);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new l.y((function(n){(0,i.f)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.f)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var v=n(1764),p=n(3841),h=n(5685),m=n(1837),g=n(8430),y=n(8729),_=n(8671);function b(e,t){if(null!=e){if((0,v.c)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,h.z)(e))return function(e,t){return new l.y((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.t)(e))return function(e,t){return(0,r.Xf)(e).pipe((0,u.R)(t),s(t))}(e,t);if((0,g.D)(e))return f(e,t);if((0,m.T)(e))return function(e,t){return new l.y((function(n){var r;return(0,i.f)(n,t,(function(){r=e[c.h](),(0,i.f)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,d.m)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,_.L)(e))return function(e,t){return f((0,_.Q)(e),t)}(e,t)}throw(0,y.z)(e)}function T(e,t){return t?b(e,t):(0,r.Xf)(e)}},2401:function(e,t,n){"use strict";n.d(t,{R:function(){return v}});var r=n(5987),i=n(7878),a=n(1480),o=n(7877),s=n(5685),u=n(8474),l=n(3211),c=["addListener","removeListener"],d=["addEventListener","removeEventListener"],f=["on","off"];function v(e,t,n,h){if((0,u.m)(n)&&(h=n,n=void 0),h)return v(e,t,n).pipe((0,l.Z)(h));var m=(0,r.CR)(function(e){return(0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)}(e)?d.map((function(r){return function(i){return e[r](t,i,n)}})):function(e){return(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)}(e)?c.map(p(e,t)):function(e){return(0,u.m)(e.on)&&(0,u.m)(e.off)}(e)?f.map(p(e,t)):[],2),g=m[0],y=m[1];if(!g&&(0,s.z)(e))return(0,o.z)((function(e){return v(e,t,n)}))((0,i.Xf)(e));if(!g)throw new TypeError("Invalid event target");return new a.y((function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return g(t),function(){return y(t)}}))}function p(e,t){return function(n){return function(r){return e[n](t,r)}}}},7878:function(e,t,n){"use strict";n.d(t,{Xf:function(){return h}});var r=n(5987),i=n(5685),a=n(3841),o=n(1480),s=n(1764),u=n(8430),l=n(8729),c=n(1837),d=n(8671),f=n(8474),v=n(5),p=n(6766);function h(e){if(e instanceof o.y)return e;if(null!=e){if((0,s.c)(e))return y=e,new o.y((function(e){var t=y[p.L]();if((0,f.m)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.z)(e))return g=e,new o.y((function(e){for(var t=0;t<g.length&&!e.closed;t++)e.next(g[t]);e.complete()}));if((0,a.t)(e))return h=e,new o.y((function(e){h.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,v.h)}));if((0,u.D)(e))return m(e);if((0,c.T)(e))return n=e,new o.y((function(e){var t,i;try{for(var a=(0,r.XA)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,d.L)(e))return t=e,m((0,d.Q)(t))}var t,n,h,g,y;throw(0,l.z)(e)}function m(e){return new o.y((function(t){(function(e,t){var n,i,a,o;return(0,r.mG)(this,void 0,void 0,(function(){var s,u;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,r.KL)(e),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),a={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},3071:function(e,t,n){"use strict";n.d(t,{T:function(){return u}});var r=n(4367),i=n(7878),a=n(1545),o=n(2457),s=n(3102);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.yG)(e),u=(0,o._6)(e,1/0),l=e;return l.length?1===l.length?(0,i.Xf)(l[0]):(0,r.J)(u)((0,s.D)(l,n)):a.E}},2817:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(2457),i=n(3102);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.yG)(e);return(0,i.D)(e,n)}},3610:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(1480),i=n(8474);function a(e,t){var n=(0,i.m)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.y(t?function(e){return t.schedule(a,0,e)}:a)}},6625:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});var r=n(1480),i=n(7991),a=n(4865),o=n(1454);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.P);var s=-1;return null!=t&&((0,a.K)(t)?n=t:s=t),new r.y((function(t){var r=(0,o.q)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},2566:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(5987);function i(e,t,n,r,i){return new a(e,t,n,r,i)}var a=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,r.ZT)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(n(6267).Lv)},9878:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(7878),i=n(2566),a=n(6798);function o(e){return(0,a.e)((function(t,n){var a,s=null,u=!1;s=t.subscribe((0,i.x)(n,void 0,void 0,(function(i){a=(0,r.Xf)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},4975:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe((0,i.x)(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},3286:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(6798);function i(e){return(0,r.e)((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}},533:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(6798),i=n(2566),a=n(2967);function o(){return(0,r.e)((function(e,t){e.subscribe((0,i.x)(t,a.Z))}))}},9127:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(6798),i=n(2566);function a(e,t){return(0,r.e)((function(n,r){var a=0;n.subscribe((0,i.x)(r,(function(n){r.next(e.call(t,n,a++))})))}))}},4367:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(7877),i=n(278);function a(e){return void 0===e&&(e=1/0),(0,r.z)(i.y,e)}},7877:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(9127),i=n(7878),a=n(6798),o=n(7845),s=n(2566);var u=n(8474);function l(e,t,n){return void 0===n&&(n=1/0),(0,u.m)(t)?l((function(n,a){return(0,r.U)((function(e,r){return t(n,e,a,r)}))((0,i.Xf)(e(n,a)))}),n):("number"==typeof t&&(n=t),(0,a.e)((function(t,r){return function(e,t,n,r,a,u,l,c){var d=[],f=0,v=0,p=!1,h=function(){!p||d.length||f||t.complete()},m=function(e){return f<r?g(e):d.push(e)},g=function(e){u&&t.next(e),f++;var c=!1;(0,i.Xf)(n(e,v++)).subscribe((0,s.x)(t,(function(e){null==a||a(e),u?m(e):t.next(e)}),(function(){c=!0}),void 0,(function(){if(c)try{f--;for(var e=function(){var e=d.shift();l?(0,o.f)(t,l,(function(){return g(e)})):g(e)};d.length&&f<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe((0,s.x)(t,m,(function(){p=!0,h()}))),function(){null==c||c()}}(t,r,e,n)})))}},3074:function(e,t,n){"use strict";n.d(t,{R:function(){return o}});var r=n(6798),i=n(2566);function a(e,t,n,r,a){return function(o,s){var u=n,l=t,c=0;o.subscribe((0,i.x)(s,(function(t){var n=c++;l=u?e(l,t,n):(u=!0,t),r&&s.next(l)}),a&&function(){u&&s.next(l),s.complete()}))}}function o(e,t){return(0,r.e)(a(e,t,arguments.length>=2,!0))}},5583:function(e,t,n){"use strict";n.d(t,{B:function(){return u}});var r=n(5987),i=n(7878),a=n(6716),o=n(6267),s=n(6798);function u(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new a.x}:t,r=e.resetOnError,u=void 0===r||r,c=e.resetOnComplete,d=void 0===c||c,f=e.resetOnRefCountZero,v=void 0===f||f;return function(e){var t,r,a,c=0,f=!1,p=!1,h=function(){null==r||r.unsubscribe(),r=void 0},m=function(){h(),t=a=void 0,f=p=!1},g=function(){var e=t;m(),null==e||e.unsubscribe()};return(0,s.e)((function(e,s){c++,p||f||h();var y=a=null!=a?a:n();s.add((function(){0!==--c||p||f||(r=l(g,v))})),y.subscribe(s),!t&&c>0&&(t=new o.Hp({next:function(e){return y.next(e)},error:function(e){p=!0,h(),r=l(m,u,e),y.error(e)},complete:function(){f=!0,h(),r=l(m,d),y.complete()}}),(0,i.Xf)(e).subscribe(t))}))(e)}}function l(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!0!==t){if(!1!==t){var a=new o.Hp({next:function(){a.unsubscribe(),e()}});return t.apply(void 0,(0,r.ev)([],(0,r.CR)(n))).subscribe(a)}}else e()}},8515:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n(3),i=n(5583);function a(e,t,n){var a,o,s,u,l=!1;return e&&"object"==typeof e?(a=e.bufferSize,u=void 0===a?1/0:a,o=e.windowTime,t=void 0===o?1/0:o,l=void 0!==(s=e.refCount)&&s,n=e.scheduler):u=null!=e?e:1/0,(0,i.B)({connector:function(){return new r.t(u,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}},6108:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(2034),i=n(2457),a=n(6798);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,i.yG)(e);return(0,a.e)((function(t,i){(n?(0,r.z)(e,t,n):(0,r.z)(e,t)).subscribe(i)}))}},8720:function(e,t,n){"use strict";n.d(t,{R:function(){return i}});var r=n(6798);function i(e,t){return void 0===t&&(t=0),(0,r.e)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}},4978:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(7878),i=n(6798),a=n(2566);function o(e,t){return(0,i.e)((function(n,i){var o=null,s=0,u=!1,l=function(){return u&&!o&&i.complete()};n.subscribe((0,a.x)(i,(function(n){null==o||o.unsubscribe();var u=0,c=s++;(0,r.Xf)(e(n,c)).subscribe(o=(0,a.x)(i,(function(e){return i.next(t?t(n,e,c,u++):e)}),(function(){o=null,l()})))}),(function(){u=!0,l()})))}))}},4727:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(1545),i=n(6798),a=n(2566);function o(e){return e<=0?function(){return r.E}:(0,i.e)((function(t,n){var r=0;t.subscribe((0,a.x)(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},3505:function(e,t,n){"use strict";n.d(t,{R:function(){return s}});var r=n(6798),i=n(2566),a=n(7878),o=n(2967);function s(e){return(0,r.e)((function(t,n){(0,a.Xf)(e).subscribe((0,i.x)(n,(function(){return n.complete()}),o.Z)),!n.closed&&t.subscribe(n)}))}},2006:function(e,t,n){"use strict";n.d(t,{b:function(){return s}});var r=n(8474),i=n(6798),a=n(2566),o=n(278);function s(e,t,n){var s=(0,r.m)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.e)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe((0,a.x)(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.y}},3428:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(5987),i=n(6798),a=n(2566),o=n(7878),s=n(278),u=n(2967),l=n(2457);function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,l.jO)(e);return(0,i.e)((function(t,i){for(var l=e.length,c=new Array(l),d=e.map((function(){return!1})),f=!1,v=function(t){(0,o.Xf)(e[t]).subscribe((0,a.x)(i,(function(e){c[t]=e,f||d[t]||(d[t]=!0,(f=d.every(s.y))&&(d=null))}),u.Z))},p=0;p<l;p++)v(p);t.subscribe((0,a.x)(i,(function(e){if(f){var t=(0,r.ev)([e],(0,r.CR)(c));i.next(n?n.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):t)}})))}))}},8337:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(5987),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(5720).w0),a={setInterval:function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=a.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,r.ev)([e,t],(0,r.CR)(n))):setInterval.apply(void 0,(0,r.ev)([e,t],(0,r.CR)(n)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(3699),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.ZT)(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},9682:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(5987),i=n(4318),a=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=i.l.now,e}(),o=function(e){function t(t,n){void 0===n&&(n=a.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,r.ZT)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(a)},7991:function(e,t,n){"use strict";n.d(t,{P:function(){return a},z:function(){return i}});var r=n(8337),i=new(n(9682).v)(r.o),a=i},4318:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},8380:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(5987),i={setTimeout:function(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.ev)([e,t],(0,r.CR)(n))):setTimeout.apply(void 0,(0,r.ev)([e,t],(0,r.CR)(n)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},9768:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},6766:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},2457:function(e,t,n){"use strict";n.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return s}});var r=n(8474),i=n(4865);function a(e){return e[e.length-1]}function o(e){return(0,r.m)(a(e))?e.pop():void 0}function s(e){return(0,i.K)(a(e))?e.pop():void 0}function u(e,t){return"number"==typeof a(e)?e.pop():t}},3699:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{P:function(){return r}})},1819:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{d:function(){return r}})},8846:function(e,t,n){"use strict";n.d(t,{O:function(){return o},x:function(){return a}});var r=n(3912),i=null;function a(e){if(r.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},7845:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{f:function(){return r}})},278:function(e,t,n){"use strict";function r(e){return e}n.d(t,{y:function(){return r}})},5685:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},8430:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(8474);function i(e){return Symbol.asyncIterator&&(0,r.m)(null==e?void 0:e[Symbol.asyncIterator])}},1454:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{q:function(){return r}})},8474:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{m:function(){return r}})},1764:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(6766),i=n(8474);function a(e){return(0,i.m)(e[r.L])}},1837:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(9768),i=n(8474);function a(e){return(0,i.m)(null==e?void 0:e[r.h])}},3841:function(e,t,n){"use strict";n.d(t,{t:function(){return i}});var r=n(8474);function i(e){return(0,r.m)(null==e?void 0:e.then)}},8671:function(e,t,n){"use strict";n.d(t,{L:function(){return o},Q:function(){return a}});var r=n(5987),i=n(8474);function a(e){return(0,r.FC)(this,arguments,(function(){var t,n,i;return(0,r.Jh)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.qq)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.qq)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.qq)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},4865:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(8474);function i(e){return e&&(0,r.m)(e.schedule)}},6798:function(e,t,n){"use strict";n.d(t,{e:function(){return i}});var r=n(8474);function i(e){return function(t){if(function(e){return(0,r.m)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},3211:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(5987),i=n(9127),a=Array.isArray;function o(e){return(0,i.U)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.ev)([],(0,r.CR)(t))):e(t)}(e,t)}))}},2967:function(e,t,n){"use strict";function r(){}n.d(t,{Z:function(){return r}})},5:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var r=n(3912),i=n(8380);function a(e){i.z.setTimeout((function(){var t=r.v.onUnhandledError;if(!t)throw e;t(e)}))}},8729:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{z:function(){return r}})},5987:function(e,t,n){"use strict";n.d(t,{CR:function(){return u},FC:function(){return d},Jh:function(){return o},KL:function(){return f},XA:function(){return s},ZT:function(){return i},ev:function(){return l},mG:function(){return a},qq:function(){return c}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function l(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}function c(e){return this instanceof c?(this.v=e,this):new c(e)}function d(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof c?Promise.resolve(n.value.v).then(u,l):d(a[0][2],n)}catch(e){d(a[0][3],e)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create},7061:function(e,t,n){var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),o=new A(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return I()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function p(){}function h(){}function m(){}var g={};c(g,s,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(x([])));_&&_!==n&&a.call(_,s)&&(g=_);var b=m.prototype=p.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,s,u){var l=f(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return v;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=f(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function x(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=m,c(b,"constructor",m),c(m,"constructor",h),h.displayName=c(m,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},T(E.prototype),c(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(d(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(b),c(b,l,"Generator"),c(b,s,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8698:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:function(e,t,n){var r=n(7061)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},3144:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return i}})},4578:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.Z)(e,t)}},9611:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},2146:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:function(){return s}});var i=n(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return o=a()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&(0,i.Z)(a,n.prototype),a},o.apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return o(e,arguments,r(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(a,e)},s(e)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return Dr}});var e=n(3144),t=n(4578),i=n(6716),a=n(4727),o=n(3505),s=n(9127),u=n(278),l=n(6798),c=n(2566);function d(e,t){return void 0===t&&(t=u.y),e=null!=e?e:f,(0,l.e)((function(n,r){var i,a=!0;n.subscribe((0,c.x)(r,(function(n){var o=t(n);!a&&e(i,o)||(a=!1,i=o,r.next(n))})))}))}function f(e,t){return e===t}var v=n(1480),p=n(2817),h=n(7877),m=n(8515),g=n(9917),y={connector:function(){return new i.x},resetOnDisconnect:!0};function _(e,t){void 0===t&&(t=y);var n=null,r=t.connector,i=t.resetOnDisconnect,a=void 0===i||i,o=r(),s=new v.y((function(e){return o.subscribe(e)}));return s.connect=function(){return n&&!n.closed||(n=(0,g.P)((function(){return e})).subscribe(o),a&&n.add((function(){return o=r()}))),n},s}var b=n(4975),T=n(5583),E=Array.isArray,S=Object.getPrototypeOf,w=Object.prototype,k=Object.keys;function A(e){if(1===e.length){var t=e[0];if(E(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&S(r)===w){var n=k(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var x=n(3102),I=n(3211),Z=n(2457);function R(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}var M=n(7845);function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,Z.yG)(e),r=(0,Z.jO)(e),i=A(e),a=i.args,o=i.keys;if(0===a.length)return(0,x.D)([],n);var s=new v.y(P(a,n,o?function(e){return R(o,e)}:u.y));return r?s.pipe((0,I.Z)(r)):s}function P(e,t,n){return void 0===n&&(n=u.y),function(r){D(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){D(t,(function(){var u=(0,x.D)(e[i],t),l=!1;u.subscribe((0,c.x)(r,(function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},l=0;l<i;l++)u(l)}),r)}}function D(e,t,n){e?(0,M.f)(n,e,t):t()}var N=n(6108),O=n(2034),L=n(4978),B=n(3071),U=n(1545);function F(e){return(0,l.e)((function(t,n){var r=!1,i=0;t.subscribe((0,c.x)(n,(function(t){return(r||(r=!e(t,i++)))&&n.next(t)})))}))}var z=n(2006),V=n(1381);function K(e){var t=e;if("function"==typeof t.getStartDate){var n=t.getStartDate();if("object"==typeof n&&null!==n){var r=+n;if(!isNaN(r))return r/1e3}else if("number"==typeof n&&!isNaN(n))return n}}function G(){if(H()){var e=document;"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():"function"==typeof e.webkitExitFullscreen&&e.webkitExitFullscreen()}}function H(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var W=n(3666),j=n(3887);function q(){if(!W.vU)return!0;var e=function(){if(!W.vU)return j.Z.warn("Compat: Can't access Firefox version on no firefox browser."),null;var e=navigator.userAgent,t=/Firefox\/([0-9]+)\./.exec(e);if(null===t)return-1;var n=parseInt(t[1],10);return isNaN(n)?-1:n}();if(null===e||e<67)return!0;var t=null===HTMLVideoElement||void 0===HTMLVideoElement?void 0:HTMLVideoElement.prototype;return void 0!==(null==t?void 0:t.requirePictureInPicture)}var Y=n(6872),X=n(3714),$=n(8750),Q=n(5992),J=n(7874),ee=n(1989),te=n(4791),ne=n(1959),re=n(1946),ie=n(8026),ae=n(2829),oe=n(5095),se=n(288),ue=n(8806),le=n(5861),ce=n(4687),de=n.n(ce),fe=n(6139),ve=n(770);function pe(e){return he.apply(this,arguments)}function he(){return(he=(0,le.Z)(de().mark((function e(t){var n,r;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=ve.Z.getState(t))){e.next=3;break}return e.abrupt("return");case 3:return j.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,ve.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:(0,fe.Y)(t,null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){var t=ve.Z.getState(e);return null==t?null:t.keySystemOptions.type}function ge(e){if(j.Z.info("DRM: Clearing-up DRM session."),W.fq)return j.Z.info("DRM: disposing current MediaKeys."),pe(e);var t=ve.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(j.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(j.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var ye=n(811),_e=n(9105),be=n(9362);function Te(e){return e instanceof _e.Z?new be.Z("PIPELINE_LOAD_ERROR",e):(0,$.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var Ee=n(7839),Se=n(9822),we=n(7864),ke=n(2572),Ae=n(8894);function xe(e){return e instanceof _e.Z?e.type===Q.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===Q.br.TIMEOUT||e.type===Q.br.ERROR_EVENT:e instanceof Ee.Z?"boolean"==typeof e.canRetry?e.canRetry:void 0!==e.xhr&&(e.xhr.status>=500||404===e.xhr.status||415===e.xhr.status||412===e.xhr.status):(0,Se.Z)(e)&&"INTEGRITY_ERROR"===e.code}function Ie(e){return e instanceof _e.Z?e.type===Q.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof Ee.Z&&e.isOfflineError}function Ze(e){return Ie(e)?2:1}function Re(e,t,n,r,i){return Me.apply(this,arguments)}function Me(){return Me=(0,le.Z)(de().mark((function e(t,n,r,i,a){var o,s,u,l,c,d,f,v,p,h,m,g,y,_;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_=function(e){var t;if(0===d.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=d.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=d.get(t))||void 0===r?void 0:r.blockedUntil;return void 0!==i&&i<=n&&(i=void 0),void 0===e?[t,i]:void 0===i?void 0===e[1]?e:[t,void 0]:void 0===e[1]?e:i<e[1]?[t,i]:e}),void 0))||void 0===t?void 0:t[0]},y=function(e,t){var r=d.get(e);if(void 0===r||void 0===r.blockedUntil)return p(e);var i=performance.now(),o=r.blockedUntil-i;if(o<=0)return p(e);var s=new se.ZP({cancelOn:a});return new Promise((function(r,i){null==n||n.addEventListener("priorityChange",(function(){var n=v();if(a.isCancelled)throw a.cancellationError;if(void 0===n)return i(t);n!==e&&(s.cancel(),y(n,t).then(r,i))}),s.signal),(0,we.Z)(o,s.signal).then((function(){return p(e).then(r,i)}),Ae.Z)}))},g=function(){return(g=(0,le.Z)(de().mark((function e(t){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=v(),!a.isCancelled){e.next=3;break}throw a.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(c(t),!a.isCancelled){e.next=8;break}throw a.cancellationError;case 8:return e.abrupt("return",y(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},m=function(e){return g.apply(this,arguments)},h=function(){return(h=(0,le.Z)(de().mark((function e(t){var i,c,f,v,p,h,g;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r(t,a);case 3:return i=e.sent,e.abrupt("return",i);case 7:if(e.prev=7,e.t0=e.catch(0),!se.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),c=Ze(e.t0),void 0===(f=d.get(t))?(f={errorCounter:1,lastErrorType:c,blockedUntil:void 0,isBlacklisted:!1},d.set(t,f)):c!==f.lastErrorType?(f.errorCounter=1,f.lastErrorType=c):f.errorCounter++,xe(e.t0)){e.next=19;break}return f.blockedUntil=void 0,f.isBlacklisted=!0,e.abrupt("return",m(e.t0));case 19:return v=2===c?l:u,f.errorCounter>v?(f.blockedUntil=void 0,f.isBlacklisted=!0):(p=f.errorCounter,h=Math.min(o*Math.pow(2,p-1),s),g=(0,ke.Z)(h),f.blockedUntil=performance.now()+g),e.abrupt("return",m(e.t0));case 22:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},p=function(e){return h.apply(this,arguments)},v=function(){if(null===t){var e=d.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return _(t);var r=n.getCdnPreferenceForResource(t);return _(r)},null===a.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(a.cancellationError));case 9:if(o=i.baseDelay,s=i.maxDelay,u=i.maxRetryRegular,l=i.maxRetryOffline,c=i.onRetry,null!==t&&0===t.length&&j.Z.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),d=new Map,void 0!==(f=v())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",p(f));case 16:case"end":return e.stop()}}),e)}))),Me.apply(this,arguments)}function Ce(e,t,n){return Re(null,null,e,t,n)}function Pe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return De(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return De(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=function(){function e(e,t,n){this._manifestUrl=e,this._pipelines=t.manifest,this._settings=n}var t=e.prototype;return t.fetch=function(e){var t=this;return new v.y((function(n){var r,i,a=t._settings,o=t._pipelines,s=null!=e?e:t._manifestUrl,u=!1,l=new se.ZP,c=t._getBackoffSetting((function(e){n.next({type:"warning",value:Te(e)})}));return(void 0===o.resolveManifestUrl?d(s):(r=s,i=o.resolveManifestUrl,(0,ye.Z)(void 0!==i),Ce((function(){return i(r,l.signal)}),c,l.signal)).then(d)).then((function(e){u=!0,n.next({type:"response",parse:function(n){return t._parseLoadedManifest(e,n)}}),n.complete()})).catch((function(e){l.isUsed||(u=!0,n.error(Te(e)))})),function(){u||l.cancel()};function d(e){var t=o.loadManifest,n=(0,re.Z)(a.requestTimeout)?Y.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:a.requestTimeout;n<0&&(n=void 0);return Ce((function(){return t(e,{timeout:n},l.signal)}),c,l.signal)}}))},t.parse=function(e,t){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t)},t._parseLoadedManifest=function(e,t){var n=this;return new v.y((function(r){var i=performance.now(),a=new se.ZP,o=e.sendingTime,s=e.receivedTime,u=n._getBackoffSetting((function(e){r.next({type:"warning",value:Te(e)})})),l={externalClockOffset:t.externalClockOffset,unsafeMode:t.unsafeMode,previousManifest:t.previousManifest,originalUrl:n._manifestUrl};try{var c=n._pipelines.parseManifest(e,l,f,a.signal,(function(e){return d.apply(this,arguments)}));c instanceof Promise?c.then((function(e){return v(e.manifest)})).catch((function(e){a.isUsed||p(e,!0)})):v(c.manifest)}catch(e){if(a.isUsed)return;p(e,!0)}return function(){a.cancel()};function d(){return(d=(0,le.Z)(de().mark((function e(t){var n;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce(t,u,a.signal);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),Te(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(e){for(var t,n=Pe(e);!(t=n()).done;){var r=t.value;if(a.isUsed)return;p(r,!1)}}function v(e){f(e.contentWarnings);var t=performance.now()-i;j.Z.info("MF: Manifest parsed in "+t+"ms"),r.next({type:"parsed",manifest:e,sendingTime:o,receivedTime:s,parsingTime:t}),r.complete()}function p(e,t){var n=(0,$.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});t?r.error(n):r.next({type:"warning",value:n})}}))},t._getBackoffSetting=function(e){var t=Y.Z.getCurrent(),n=t.DEFAULT_MAX_MANIFEST_REQUEST_RETRY,r=t.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,i=t.INITIAL_BACKOFF_DELAY_BASE,a=t.MAX_BACKOFF_DELAY_BASE,o=this._settings,s=o.lowLatencyMode,u=o.maxRetryRegular,l=o.maxRetryOffline;return{onRetry:e,baseDelay:s?i.LOW_LATENCY:i.REGULAR,maxDelay:s?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=u?u:n,maxRetryOffline:null!=l?l:r}},e}();var Oe=Ne,Le=n(3286),Be=n(533);var Ue=n(8333),Fe=n(2793),ze=n(5278),Ve=n(5138);function Ke(e){var t=e.map((function(t){return Math.log(t/e[0])})),n=t.map((function(e){return e-t[0]+1})),r=(n[n.length-1]-1)/(2*e.length+10),i=1/r;return e.map((function(e,t){return a(t)}));function a(t){if(0===t)return 0;var o=Math.min(Math.max(1,t),e.length-1);return e[o]===e[o-1]?a(t-1):i*(r+(e[o]*n[o-1]-e[o-1]*n[o])/(e[o]-e[o-1]))+4}}var Ge=function(){function e(e){this._levelsMap=Ke(e),this._bitrates=e,j.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}return e.prototype.getEstimate=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null==i)return n[0];var s,u=(0,Ve.Z)(n,(function(e){return e===i}));if(u<0||n.length!==t.length)return j.Z.error("ABR: Current Bitrate not found in the calculated levels"),n[0];if(null!=a&&(s=0===o?a:a/o),null!=s&&s>1){var l=t[u],c=function(){for(var e=u+1;e<t.length;e++)if(t[e]>l)return e}();if(null!=c)if(r>=t[c])return n[c]}if((null==s||s<1.15)&&r<t[u]){for(var d=u-1;d>=0;d--)if(n[d]<i)return n[d];return i}return i},e}(),He=n(3274),We=function(){function e(e){this._alpha=Math.exp(Math.log(.5)/e),this._lastEstimate=0,this._totalWeight=0}var t=e.prototype;return t.addSample=function(e,t){var n=Math.pow(this._alpha,e),r=t*(1-n)+n*this._lastEstimate;isNaN(r)||(this._lastEstimate=r,this._totalWeight+=e)},t.getEstimate=function(){var e=1-Math.pow(this._alpha,this._totalWeight);return this._lastEstimate/e},e}();function je(e){if(!(e.progress.length<5)){for(var t=new We(2),n=e.progress,r=1;r<n.length;r++){var i=n[r].size-n[r-1].size,a=n[r].timestamp-n[r-1].timestamp,o=8*i/(a/1e3);t.addSample(a/1e3,o)}return t.getEstimate()}}function qe(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var Ye=function(){function e(e,t){var n=Y.Z.getCurrent(),r=n.ABR_STARVATION_GAP,i=n.OUT_OF_STARVATION_GAP,a=n.ABR_STARVATION_FACTOR,o=n.ABR_REGULAR_FACTOR;this._initialBitrate=e,this._inStarvationMode=!1,this._lowLatencyMode=t,this._config=t?{starvationGap:r.LOW_LATENCY,outOfStarvationGap:i.LOW_LATENCY,starvationBitrateFactor:a.LOW_LATENCY,regularBitrateFactor:o.LOW_LATENCY}:{starvationGap:r.DEFAULT,outOfStarvationGap:i.DEFAULT,starvationBitrateFactor:a.DEFAULT,regularBitrateFactor:o.DEFAULT}}var t=e.prototype;return t.getBandwidthEstimate=function(e,t,n,r,i){var a,o,s=this._config,u=e.bufferGap,l=e.position,c=e.duration,d=isFinite(u)?u:0,f=Y.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(c)||d+l.last<c-f?!this._inStarvationMode&&d<=s.starvationGap?(j.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&d>=s.outOfStarvationGap&&(j.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(j.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1),this._inStarvationMode&&(o=function(e,t,n,r,i){if(!r){var a=t.bufferGap,o=t.speed,s=t.position,u=isFinite(a)?a:0,l=function(e,t){for(var n=-1,r=0;r<e.length;r++){var i=e[r].content.segment;if(!(i.duration<=0)){var a=i.time+i.duration;if(!i.complete&&r===e.length-1&&t-i.time>-1.2){n=r;break}if(a>t&&t-i.time>-1.2){n=r;break}}}if(n<0)return[];for(var o=e[n],s=o.content.segment.time,u=[o],l=n+1;l<e.length&&e[l].content.segment.time===s;l++)u.push(e[l]);return u}(e,s.last+u);if(1===l.length){var c=l[0],d=performance.now(),f=c.progress.length>0?c.progress[c.progress.length-1]:void 0,v=je(c);if(void 0!==f&&void 0!==v){var p=qe(f,v);if((d-f.timestamp)/1e3<=p&&p-u/o>2e3)return v}if(c.content.segment.complete){var h=c.content.segment.duration,m=(d-c.requestTimestamp)/1e3;if(null!=n&&!(m<=(1.5*h+2)/o)){var g=h/m,y=n.bitrate*Math.min(.7,g);return void 0===i||y<i?y:void 0}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(j.Z.info("ABR: starvation mode emergency estimate:",o),t.reset(),a=null==n?o:Math.min(o,n.bitrate))),null==a&&(a=null!=(o=t.getEstimate())?o*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):null!=i?i*(this._inStarvationMode?s.starvationBitrateFactor:s.regularBitrateFactor):this._initialBitrate),e.speed>1&&(a/=e.speed),{bandwidthEstimate:o,bitrateChosen:a}},t.isUrgent=function(e,t,n,r){return null===t||e!==t.bitrate&&(e>t.bitrate?!this._inStarvationMode:function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,He.Z)(t,(function(e){var t=e.content;return t.segment.duration>0&&t.segment.time+t.segment.duration>i}));if(void 0===a)return!0;var o=performance.now(),s=a.progress.length>0?a.progress[a.progress.length-1]:void 0,u=je(a);if(void 0===s||void 0===u)return!0;var l=qe(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode))},e}();function Xe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qe=function(){function e(e,t){this._scoreCalculator=e,this._lastAbrEstimate=t,this._consecutiveWrongGuesses=0,this._blockGuessesUntil=0,this._lastMaintanableBitrate=null}var t=e.prototype;return t.getGuess=function(e,t,n,r,i){var a=t.bufferGap,o=t.speed,s=this._lastAbrEstimate.representation;if(null===s)return null;if(r>s.bitrate)return 2===this._lastAbrEstimate.algorithmType&&(null!==this._lastAbrEstimate.representation&&(this._lastMaintanableBitrate=this._lastAbrEstimate.representation.bitrate),this._consecutiveWrongGuesses=0),null;var u=this._scoreCalculator.getEstimate(n);if(2!==this._lastAbrEstimate.algorithmType){if(void 0===u)return null;if(this._canGuessHigher(a,o,u)){var l=Je(e,n);if(null!==l)return l}return null}if(this._isLastGuessValidated(s,r,u)&&(j.Z.debug("ABR: Guessed Representation validated",s.bitrate),this._lastMaintanableBitrate=s.bitrate,this._consecutiveWrongGuesses=0),n.id!==s.id)return s;if(this._shouldStopGuess(n,u,a,i))return this._consecutiveWrongGuesses++,this._blockGuessesUntil=performance.now()+Math.min(15e3*this._consecutiveWrongGuesses,12e4),function(e,t){var n=(0,Ve.Z)(e,(function(e){return e.id===t.id}));if(n<0)return j.Z.error("ABR: Current Representation not found."),null;for(;--n>=0;)if(e[n].bitrate<t.bitrate)return e[n];return null}(e,n);if(void 0===u)return n;if(this._canGuessHigher(a,o,u)){var c=Je(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n[0],i=n[1];return isFinite(e)&&e>=2.5&&performance.now()>this._blockGuessesUntil&&1===i&&r/t>1.01},t._shouldStopGuess=function(e,t,n,r){if(void 0!==t&&t[0]<1.01)return!0;if((void 0===t||t[0]<1.2)&&n<.6)return!0;for(var i,a=r.filter((function(t){return t.content.representation.id===e.id})),o=performance.now(),s=Xe(a);!(i=s()).done;){var u=i.value,l=o-u.requestTimestamp;if(u.content.segment.isInit){if(l>1e3)return!0}else{if(l>1e3*u.content.segment.duration+200)return!0;var c=je(u);if(void 0!==c&&c<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n[1]&&n[0]>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function Je(e,t){var n=e.length,r=(0,Ve.Z)(e,(function(e){return e.id===t.id}));if(r<0)return j.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var et=function(){function e(){var e=Y.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new We(t),this._slowEWMA=new We(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<Y.Z.getCurrent().ABR_MINIMUM_CHUNK_SIZE)){var n=8e3*t/e,r=e/1e3;this._bytesSampled+=t,this._fastEWMA.addSample(r,n),this._slowEWMA.addSample(r,n)}},t.getEstimate=function(){var e=Y.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=Y.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new We(t),this._slowEWMA=new We(n),this._bytesSampled=0},e}();var tt=function(){function e(){this.bandwidth=void 0,this.representation=null,this.algorithmType=3}return e.prototype.update=function(e,t,n){this.representation=e,this.bandwidth=t,this.algorithmType=n},e}(),nt=n(1679),rt=function(){function e(){this._currentRequests={}}var t=e.prototype;return t.add=function(e){var t=e.id,n=e.requestTimestamp,r=e.content;this._currentRequests[t]={requestTimestamp:n,progress:[],content:r}},t.addProgress=function(e){var t=this._currentRequests[e.id];null!=t?t.progress.push(e):j.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&j.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,nt.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),it=function(){function e(){this._currentRepresentationData=null,this._lastRepresentationWithGoodScore=null}var t=e.prototype;return t.addSample=function(e,t,n){var r,i=n/t,a=this._currentRepresentationData;null!==a&&a.representation.id===e.id?(r=a.ewma,a.ewma.addSample(t,i),a.loadedDuration+=n,a.loadedSegments++):((r=new We(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(j.Z.debug("ABR: New last stable representation",e.bitrate),this._lastRepresentationWithGoodScore=e)},t.getEstimate=function(e){if(null!==this._currentRepresentationData&&this._currentRepresentationData.representation.id===e.id){var t=this._currentRepresentationData,n=t.ewma,r=t.loadedSegments,i=t.loadedDuration;return[n.getEstimate(),r>=5&&i>=10?1:0]}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function at(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,Ve.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var ot=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,s=e.lowLatencyMode;return function(e,u,l,c,d){var f=e.adaptation.type,v=function(e){var n=t[e];if(null==n){j.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new et;return t[e]=r,r}return n}(f),p=(0,ze.Z)(n[f],(0,oe.ZP)(-1)),h=(0,ze.Z)(r[f],(0,oe.ZP)(0)),m=(0,ze.Z)(i[f],(0,oe.ZP)(1/0)),g=(0,ze.Z)(a[f],0);return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,s=e.lowLatencyMode,u=e.manualBitrate,l=e.maxAutoBitrate,c=e.minAutoBitrate,d=e.playbackObserver,f=e.representations,v=new it,p=new Ye(null!=o?o:0,s),h=new rt,m=Ae.Z,g={metrics:E,requestBegin:S,requestProgress:w,requestEnd:k,addedSegment:function(e){m(e)}},y=new se.ZP({cancelOn:t}),_=b(u.getValue(),f.getValue(),y.signal);return u.onUpdate(T,{clearSignal:t}),f.onUpdate(T,{clearSignal:t}),{estimates:_,callbacks:g};function b(e,t,o){if(e>=0){var u=at(t,e,0,1/0);return(0,oe.ZP)({representation:u,bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0})}if(1===t.length)return(0,oe.ZP)({bitrate:void 0,representation:t[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var f,g=!1,y=t.map((function(e){return e.bitrate})),_=new Ge(y),b=new tt,T=new Qe(v,b),E=d.getReference().getValue(),S=(0,oe.ZP)(k());return d.listen((function(e){E=e,w()}),{includeLastObservation:!1,clearSignal:o}),m=function(e){if(null!==E){var t=E,n=t.position,r=t.speed,i=e.buffered,a=(0,ae.L7)(i,n.last),o=e.content.representation,s=v.getEstimate(o),u=null==s?void 0:s[0],l={bufferGap:a,currentBitrate:o.bitrate,currentScore:u,speed:r};f=_.getEstimate(l),w()}},c.onUpdate(w,{clearSignal:o}),l.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),a.limitWidth.onUpdate(w,{clearSignal:o}),S;function w(){S.setValue(k())}function k(){var e=E,o=e.bufferGap,u=e.position,d=e.maximumPosition,m=a.limitWidth.getValue(),y=a.throttleBitrate.getValue(),_=i.getValue(),S=c.getValue(),w=l.getValue(),k=function(e,t,n){var r=e;n<1/0&&(r=function(e,t){if(0===e.length)return[];e.sort((function(e,t){return e.bitrate-t.bitrate}));var n=e[0].bitrate,r=Math.max(t,n),i=(0,Ve.Z)(e,(function(e){return e.bitrate>r}));return-1===i?e:e.slice(0,i)}(r,n));void 0!==t&&(r=function(e,t){var n=e.slice().sort((function(e,t){return(0,ze.Z)(e.width,0)-(0,ze.Z)(t.width,0)})),r=(0,He.Z)(n,(function(e){return"number"==typeof e.width&&e.width>=t}));if(void 0===r)return e;var i="number"==typeof r.width?r.width:0;return e.filter((function(e){return"number"!=typeof e.width||e.width<=i}))}(r,t));return r}(t,m,y),A=h.getRequests(),x=p.getBandwidthEstimate(E,n,_,A,b.bandwidth),I=x.bandwidthEstimate,Z=x.bitrateChosen,R=v.getLastStableRepresentation(),M=null===R?void 0:R.bitrate/(E.speed>0?E.speed:1);g&&o<=5?g=!1:!g&&isFinite(o)&&o>10&&(g=!0);var C=at(k,Z,S,w),P=C.bitrate,D=null;g&&void 0!==f&&f>P&&(P=(D=at(k,f,S,w)).bitrate);var N=null;return s&&null!==_&&r.manifest.isDynamic&&d-u.last<40&&(N=T.getGuess(t,E,_,P,A)),null!==N&&N.bitrate>P?(j.Z.debug("ABR: Choosing representation with guess-based estimation.",N.bitrate,N.id),b.update(N,I,2),{bitrate:I,representation:N,urgent:null===_||N.bitrate<_.bitrate,manual:!1,knownStableBitrate:M}):null!==D?(j.Z.debug("ABR: Choosing representation with buffer-based estimation.",D.bitrate,D.id),b.update(D,I,0),{bitrate:I,representation:D,urgent:p.isUrgent(D.bitrate,_,A,E),manual:!1,knownStableBitrate:M}):(j.Z.debug("ABR: Choosing representation with bandwidth estimation.",C.bitrate,C.id),b.update(C,I,1),{bitrate:I,representation:C,urgent:p.isUrgent(C.bitrate,_,A,E),manual:!1,knownStableBitrate:M})}}function T(){var e=u.getValue(),n=f.getValue();y.cancel(),b(e,n,(y=new se.ZP({cancelOn:t})).signal).onUpdate((function(e){_.setValue(e)}),{clearSignal:y.signal,emitCurrentValue:!0})}function E(e){var t=e.requestDuration,r=e.segmentDuration,i=e.size,a=e.content;if(n.addSample(t,i),!a.segment.isInit){var o=a.segment,s=a.representation;if(void 0===r&&!o.complete)return;var u=null!=r?r:o.duration;v.addSample(s,t/1e3,u)}}function S(e){h.add(e)}function w(e){h.addProgress(e)}function k(e){h.remove(e.id)}}({bandwidthEstimator:v,context:e,currentRepresentation:u,filters:{limitWidth:(0,ze.Z)(o.limitWidth[f],(0,oe.ZP)(void 0)),throttleBitrate:(0,ze.Z)(o.throttleBitrate[f],o.throttle[f],(0,oe.ZP)(1/0))},initialBitrate:g,manualBitrate:p,minAutoBitrate:h,maxAutoBitrate:m,playbackObserver:c,representations:l,lowLatencyMode:s},d)}};function st(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ut(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lt=function(e){function n(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=st(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,t.Z)(n,e);var r=n.prototype;return r.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},r.downgradeCdn=function(e){var t=this,n=ct(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=Y.Z.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=ct(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},r._innerGetCdnPreferenceForResource=function(e){var t=this,n=e.reduce((function(e,n){return t._downgradedCdnList.metadata.some((function(e){return e.id===n.id&&e.baseUrl===n.baseUrl}))?e[1].push(n):e[0].push(n),e}),[[],[]]),r=n[0],i=n[1];return r.concat(i)},r._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},n}(ne.Z);function ct(e,t){return 0===e.length?-1:void 0!==t.id?(0,Ve.Z)(e,(function(e){return e.id===t.id})):(0,Ve.Z)(e,(function(e){return e.baseUrl===t.baseUrl}))}var dt=n(520),ft=n(7714),vt=n(908),pt=function(){function e(){this._cache=new WeakMap}var t=e.prototype;return t.add=function(e,t){var n=e.representation;e.segment.isInit&&this._cache.set(n,t)},t.get=function(e){var t=e.representation;if(e.segment.isInit){var n=this._cache.get(t);if(void 0!==n)return n}return null},e}(),ht=(0,vt.Z)();var mt=function(){function e(e){var t=e.prioritySteps;if(this._minPendingPriority=null,this._waitingQueue=[],this._pendingTasks=[],this._prioritySteps=t,this._prioritySteps.high>=this._prioritySteps.low)throw new Error("TP: the max high level priority should be given a lowerpriority number than the min low priority.")}var t=e.prototype;return t.create=function(e,t,n,r){var i,a=this;return new Promise((function(o,s){var u=r.register((function(e){a._endTask(i),s(e)})),l=function(){u(),a._endTask(i)},c=function(e){n.beforeEnded(),l(),o(e)},d=function(e){l(),s(e)};i={hasEnded:!1,priority:t,trigger:function(){if(i.hasEnded)u();else{var e=new se.ZP({cancelOn:r});i.interrupter=e,e.signal.register((function(){i.interrupter=null,r.isCancelled||n.beforeInterrupted()})),a._minPendingPriority=null===a._minPendingPriority?i.priority:Math.min(a._minPendingPriority,i.priority),a._pendingTasks.push(i),i.taskFn(e.signal).then(c).catch((function(t){!r.isCancelled&&e.isUsed&&t instanceof se.FU||d(t)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i)}))},t._endTask=function(e){e.hasEnded=!0;var t=gt(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=gt(e.taskFn,this._pendingTasks);if(n<0)return;this._pendingTasks.splice(n,1),this._pendingTasks.length>0?this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))):this._minPendingPriority=null,this._loopThroughWaitingQueue()}},t.updatePriority=function(e,t){var n=gt(e,this._waitingQueue);if(n>=0){var r=this._waitingQueue[n];if(r.priority===t)return;if(r.priority=t,!this._canBeStartedNow(r))return;return this._findAndRunWaitingQueueTask(n),void(this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks())}var i=gt(e,this._pendingTasks);if(i<0)j.Z.warn("TP: request to update the priority of a non-existent task");else{var a=this._pendingTasks[i];if(a.priority!==t){var o=a.priority;a.priority=t,null===this._minPendingPriority||t<this._minPendingPriority?this._minPendingPriority=t:this._minPendingPriority===o&&(1===this._pendingTasks.length?this._minPendingPriority=t:this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority}))),this._loopThroughWaitingQueue()),this._isRunningHighPriorityTasks()&&this._interruptCancellableTasks()}}},t._loopThroughWaitingQueue=function(){var e=this._waitingQueue.reduce((function(e,t){return null===e||e>t.priority?t.priority:e}),null);if(!(null===e||null!==this._minPendingPriority&&this._minPendingPriority<e))for(var t=0;t<this._waitingQueue.length;t++){var n=null===this._minPendingPriority?e:Math.min(this._minPendingPriority,e);this._waitingQueue[t].priority<=n&&(this._findAndRunWaitingQueueTask(t),t--)}},t._interruptCancellableTasks=function(){for(var e=0;e<this._pendingTasks.length;e++){var t=this._pendingTasks[e];if(t.priority>=this._prioritySteps.low)return this._interruptPendingTask(t),this._interruptCancellableTasks()}},t._findAndRunWaitingQueueTask=function(e){return e>=this._waitingQueue.length||e<0?(j.Z.warn("TP : Tried to start a non existing task"),!1):(this._waitingQueue.splice(e,1)[0].trigger(),!0)},t._interruptPendingTask=function(e){var t,n=gt(e.taskFn,this._pendingTasks);n<0?j.Z.warn("TP: Interrupting a non-existent pending task. Aborting..."):(this._pendingTasks.splice(n,1),this._waitingQueue.push(e),0===this._pendingTasks.length?this._minPendingPriority=null:this._minPendingPriority===e.priority&&(this._minPendingPriority=Math.min.apply(Math,this._pendingTasks.map((function(e){return e.priority})))),null===(t=e.interrupter)||void 0===t||t.cancel())},t._canBeStartedNow=function(e){return null===this._minPendingPriority||e.priority<=this._minPendingPriority},t._isRunningHighPriorityTasks=function(){return null!==this._minPendingPriority&&this._minPendingPriority<=this._prioritySteps.high},e}();function gt(e,t){return(0,Ve.Z)(t,(function(t){return t.taskFn===e}))}var yt=function(){function e(e,t,n){var r=new lt(n),i=Y.Z.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new mt({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,r,i,a=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=Y.Z.getCurrent(),s=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,u=o.DEFAULT_REQUEST_TIMEOUT,l=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,d=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:s,maxRetryOffline:null!=r?r:l,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?d.LOW_LATENCY:d.REGULAR,requestTimeout:(0,re.Z)(a)?u:a}}(e,this._backoffOptions),o=function(e,t,n,r,i){var a={timeout:i.requestTimeout<0?void 0:i.requestTimeout},o=(0,ft.Z)(["audio","video"],e)?new pt:void 0,s=t.loadSegment,u=t.parseSegment;return function(){var e=(0,le.Z)(de().mark((function e(t,l,c){var d,f,v,p,h,m,g,y,_,b,T,E,S,w,k,A;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A=function(){var e;y||!(0,re.Z)(h)&&void 0!==h.size&&void 0!==h.requestDuration&&m.length>0&&m.every((function(e){return e}))&&(y=!0,null===(e=r.onMetrics)||void 0===e||e.call(r,{size:h.size,requestDuration:h.requestDuration,content:t,segmentDuration:g}))},k=function(e){l.onRetry(Te(e))},w=function(e,n){m.push(!1);var r=m.length-1;return function(i){var a={data:e,isChunked:n};try{var o=u(a,t,i);return m[r]||(g=void 0!==g&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?g+o.chunkInfos.duration:void 0,m[r]=!0,A()),o}catch(e){throw(0,$.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},S=function(e){return s(e,t,a,c,_)},v=(0,dt.K)(t),p=ht(),m=[],g=0,y=!1,_={onProgress:function(e){var t;void 0===h&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=r.onProgress)||void 0===t||t.call(r,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:p}))},onNewChunk:function(e){l.onChunk(w(e,!0))}},null===(b=void 0!==o?o.get(t):null)){e.next=15;break}return j.Z.debug("SF: Found wanted segment in cache",v),l.onChunk(w(b,!1)),e.abrupt("return",Promise.resolve());case 15:return j.Z.debug("SF: Beginning request",v),null===(d=r.onRequestBegin)||void 0===d||d.call(r,{requestTimestamp:performance.now(),id:p,content:t}),c.register((function(){var e;void 0===h&&(j.Z.debug("SF: Segment request cancelled",v),h=null,null===(e=r.onRequestEnd)||void 0===e||e.call(r,{id:p}))})),e.prev=18,e.next=21,Re(t.representation.cdnMetadata,n,S,(0,ie.Z)({onRetry:k},i),c);case 21:"segment-loaded"===(T=e.sent).resultType?(E=T.resultData.responseData,void 0!==o&&o.add(t,T.resultData.responseData),l.onChunk(w(E,!1))):"segment-created"===T.resultType&&l.onChunk(w(T.resultData,!1)),j.Z.debug("SF: Segment request ended with success",v),l.onAllChunksReceived(),"segment-created"!==T.resultType?(h=T.resultData,A()):h=null,c.isCancelled||null===(f=r.onRequestEnd)||void 0===f||f.call(r,{id:p}),e.next=37;break;case 29:if(e.prev=29,e.t0=e.catch(18),h=null,!(e.t0 instanceof se.FU)){e.next=35;break}throw j.Z.debug("SF: Segment request aborted",v),e.t0;case 35:throw j.Z.debug("SF: Segment request failed",v),Te(e.t0);case 37:case"end":return e.stop()}}),e,null,[[18,29]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,a);return n=this._prioritizer,r=o,i=new WeakMap,{createRequest:function(e,t,a,o){var s=function(t){return r(e,a,t)},u=n.create(s,t,a,o);return i.set(u,s),u},updatePriority:function(e,t){var r=i.get(e);void 0!==r?n.updatePriority(r,t):j.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),_t=yt,bt=n(5767),Tt=n(3774),Et=n(6923),St=V.ym;function wt(e,t,n){if(null!==t&&"closed"!==t.readyState){for(var r=t.readyState,i=t.sourceBuffers,a=i.length-1;a>=0;a--){var o=i[a];try{"open"===r&&(j.Z.info("Init: Removing SourceBuffer from mediaSource"),o.abort()),t.removeSourceBuffer(o)}catch(e){j.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&j.Z.warn("Init: Not all SourceBuffers could have been removed.")}if((0,bt.Z)(e),null!==n)try{j.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){j.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function kt(e){return function(e){return new v.y((function(t){if(null==Tt.J)throw new X.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,Et.Z)(e.src)?e.src:null;wt(e,null,n),j.Z.info("Init: Creating MediaSource");var r=new Tt.J,i=URL.createObjectURL(r);return j.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.next(r),function(){wt(e,r,i)}}))}(e).pipe((0,h.z)((function(e){return St(e).pipe((0,a.q)(1),(0,s.U)((function(){return e})))})))}var At=n(8343);var xt=n(9607),It=n(3610),Zt=n(7326);var Rt=n(7904),Mt=n(6968),Ct=n(2870),Pt=n(9612);var Dt=function(e){function n(t,n,r){var i;i=e.call(this)||this;var a=r.addSourceBuffer(n);i._canceller=new se.ZP,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegment=null,i.codec=n;var o=i._onPendingTaskError.bind((0,Zt.Z)(i)),s=i._flush.bind((0,Zt.Z)(i)),u=Y.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,l=setInterval(s,u);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",s),i._canceller.signal.register((function(){clearInterval(l),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",s)})),i}(0,t.Z)(n,e);var r=n.prototype;return r.pushChunk=function(e,t){return j.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,dt.K)(e.inventoryInfos)),this._addToQueue({type:Pt.f.Push,value:e},t)},r.removeBuffer=function(e,t,n){return j.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:Pt.f.Remove,value:{start:e,end:t}},n)},r.endOfSegment=function(e,t){return j.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,dt.K)(e)),this._addToQueue({type:Pt.f.EndOfSegment,value:e},t)},r.getBufferedRanges=function(){return this._sourceBuffer.buffered},r.getPendingOperations=function(){var e=function(e){switch(e.type){case Pt.f.Push:case Pt.f.Remove:case Pt.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},r.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new se.FU),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new se.FU)}if("open"===this._mediaSource.readyState)try{this._sourceBuffer.abort()}catch(e){j.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},r._onPendingTaskError=function(e){if(this._lastInitSegment=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer");this._pendingTask.reject(t)}},r._addToQueue=function(e,t){var n=this;return new Promise((function(r,i){if(null!==t.cancellationError)return i(t.cancellationError);var a=0===n._queue.length&&null===n._pendingTask,o=(0,ie.Z)({resolve:r,reject:i},e);n._queue.push(o),t.register((function(e){var t=n._queue.indexOf(o);t>=0&&n._queue.splice(t,1),o.resolve=Ae.Z,o.reject=Ae.Z,i(e)})),a&&n._flush()}))},r._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==Pt.f.Push||0===e.data.length){switch(e.type){case Pt.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData);break;case Pt.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case Pt.f.Remove:this.synchronizeInventory();break;default:(0,Rt.Z)(e)}var t=e.resolve;return this._pendingTask=null,t(),void this._flush()}}else{var n=this._queue.shift();if(void 0===n)return;if(n.type!==Pt.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,ie.Z)({data:[],inventoryData:i.inventoryInfos},n);var a=e instanceof Error?e:new Error("An unknown error occured when preparing a push operation");return this._lastInitSegment=null,void n.reject(a)}this._pendingTask=(0,ie.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case Pt.f.EndOfSegment:return j.Z.debug("AVSB: Acknowledging complete segment",(0,dt.K)(this._pendingTask.value)),void this._flush();case Pt.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();j.Z.debug("AVSB: pushing segment",this.bufferType,(0,dt.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case Pt.f.Remove:var s=this._pendingTask.value,u=s.start,l=s.end;j.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,l),this._sourceBuffer.remove(u,l);break;default:(0,Rt.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},r._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(j.Z.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return j.Z.warn("Could not call 'changeType' on the given SourceBuffer:",e instanceof Error?e:""),!1}return!0}return!1}(this._sourceBuffer,n),a?this.codec=n:j.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;j.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0]?this._sourceBuffer.appendWindowStart>0&&(this._sourceBuffer.appendWindowStart=0):i[0]!==this._sourceBuffer.appendWindowStart&&(i[0]>=this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[0]+1),this._sourceBuffer.appendWindowStart=i[0]),void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegment&&(a||!this._isLastInitSegment(e.initSegment))){var s=e.initSegment;t.push(s);var u=(0,Mt._f)(s);this._lastInitSegment={data:u,hash:(0,Ct.Z)(u)}}return null!==e.chunk&&t.push(e.chunk),t},r._isLastInitSegment=function(e){if(null===this._lastInitSegment)return!1;if(this._lastInitSegment.data===e)return!0;var t=this._lastInitSegment.data;if(t.byteLength===e.byteLength){var n=(0,Mt._f)(e);if((0,Ct.Z)(n)===this._lastInitSegment.hash&&(0,te.Z)(t,n))return!0}return!1},n}(Pt.C),Nt=["audio","video","text","image"];function Ot(e){return"audio"===e||"video"===e}var Lt=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return Ot(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==J.Z.nativeTextTracksBuffer&&null==J.Z.htmlTextTracksBuffer||e.push("text"),null!=J.Z.imageBuffer&&e.push("image"),e},t.getNativeBufferTypes=function(){return"AUDIO"===this._mediaElement.nodeName?["audio"]:["video","audio"]},t.getStatus=function(e){var t=this._initializedSegmentBuffers[e];return void 0===t?{type:"uninitialized"}:null===t?{type:"disabled"}:{type:"initialized",value:t}},t.waitForUsableBuffers=function(e){var t=this;return this._areNativeBuffersUsable()?Promise.resolve():new Promise((function(n,r){var i=function(){t._areNativeBuffersUsable()&&n()};t._onNativeBufferAddedOrDisabled.push(i),e.register((function(e){var n=t._onNativeBufferAddedOrDisabled.indexOf(i);n>=0&&t._onNativeBufferAddedOrDisabled.splice(n,1),r(e)}))}))},t.disableSegmentBuffer=function(t){var n=this._initializedSegmentBuffers[t];if(null!==n){if(void 0!==n)throw new Error("Cannot disable an active SegmentBuffer.");this._initializedSegmentBuffers[t]=null,e.isNative(t)&&this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()}))}else j.Z.warn("SBS: The "+t+" SegmentBuffer was already disabled.")},t.createSegmentBuffer=function(e,t,n){void 0===n&&(n={});var r,i=this._initializedSegmentBuffers[e];if(Ot(e)){if(null!=i)return i instanceof Dt&&i.codec!==t?j.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):j.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;j.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Dt(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return j.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(j.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==J.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new J.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==J.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new J.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==J.Z.imageBuffer)throw new Error("Image buffer feature not activated");return j.Z.info("SB: Creating a new image SegmentBuffer"),r=new J.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw j.Z.error("SB: Unknown buffer type:",e),new X.Z("BUFFER_TYPE_UNKNOWN","The player wants to create a SegmentBuffer of an unknown type.")},t.disposeSegmentBuffer=function(e){var t=this._initializedSegmentBuffers[e];null!=t?(j.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):j.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Nt.forEach((function(t){"initialized"===e.getStatus(t).type&&e.disposeSegmentBuffer(t)}))},t._areNativeBuffersUsable=function(){var e=this,t=this.getNativeBufferTypes();return!t.some((function(t){return void 0===e._initializedSegmentBuffers[t]}))&&!t.every((function(t){return null===e._initializedSegmentBuffers[t]}))},e}(),Bt=n(7878);function Ut(e,t){return t?function(n){return n.pipe(Ut((function(n,r){return(0,Bt.Xf)(e(n,r)).pipe((0,s.U)((function(e,i){return t(n,e,r,i)})))})))}:(0,l.e)((function(t,n){var r=0,i=null,a=!1;t.subscribe((0,c.x)(n,(function(t){i||(i=(0,c.x)(n,void 0,(function(){i=null,a&&n.complete()})),(0,Bt.Xf)(e(t,r++)).subscribe(i))}),(function(){a=!0,!i&&n.complete()})))}))}function Ft(e,t){return new v.y((function(n){var r=!1,i=!1;return t().then((function(e){r||(i=!0,n.next(e),n.complete())}),(function(e){i=!0,r||n.error(e)})),function(){i||(r=!0,e.cancel())}}))}var zt=n(7473),Vt=n.n(zt);function Kt(){return new v.y((function(e){var t=!1;return Vt()((function(){t||(e.next(),e.complete())})),function(){t=!0}}))}var Gt=function(){function e(e){this._array=[],this._sortingFn=e}var t=e.prototype;return t.add=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.sort(this._sortingFn);for(var r=0,i=0;i<t.length;i++){for(var a=t[i],o=!1;!o&&r<this._array.length;)this._sortingFn(a,this._array[r])<0?(this._array.splice(r,0,a),o=!0):r++;o||this._array.push(a)}},t.length=function(){return this._array.length},t.get=function(e){if(e<0||e>=this._array.length)throw new Error("Invalid index.");return this._array[e]},t.findFirst=function(e){return(0,He.Z)(this._array,e)},t.has=function(e){return(0,ft.Z)(this._array,e)},t.removeElement=function(e){var t=this._array.indexOf(e);if(t>=0)return this._array.splice(t,1),t},t.head=function(){return this._array[0]},t.last=function(){return this._array[this._array.length-1]},t.shift=function(){return this._array.shift()},t.pop=function(){return this._array.pop()},e}(),Ht=function(){function e(e){this._weakMap=new WeakMap,this._fn=e}var t=e.prototype;return t.get=function(e){var t=this._weakMap.get(e);if(void 0===t){var n=this._fn(e);return this._weakMap.set(e,n),n}return t},t.destroy=function(e){this._weakMap.delete(e)},e}();function Wt(e,t){var n,r=e.segmentBuffer,i=e.playbackObserver,a=e.maxBufferBehind,o=e.maxBufferAhead;function s(){(function(e,t,n,r,i){return jt.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";j.Z.error("Could not run BufferGarbageCollector:",t)}))}i.listen((function(e){var t;n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,s()}),{includeLastObservation:!0,clearSignal:t}),a.onUpdate(s,{clearSignal:t}),o.onUpdate(s,{clearSignal:t}),s()}function jt(){return(jt=(0,le.Z)(de().mark((function e(t,n,r,i,a){var o,s,u,l,c,d,f,v;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(isFinite(r)||isFinite(i)){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:o=[],s=(0,ae.F_)(t.getBufferedRanges(),n),u=s.innerRange,l=s.outerRanges,c=function(){if(isFinite(i)){for(var e=0;e<l.length;e++){var t=l[e];n+i<=t.start?o.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&o.push({start:n+i,end:t.end})}null!=u&&n+i<u.end&&o.push({start:n+i,end:u.end})}},function(){if(isFinite(r)){for(var e=0;e<l.length;e++){var t=l[e];n-r>=t.end?o.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&o.push({start:t.start,end:n-r})}null!=u&&n-r>u.start&&o.push({start:u.start,end:n-r})}}(),c(),d=0,f=o;case 9:if(!(d<f.length)){e.next=20;break}if(!((v=f[d]).start<v.end)){e.next=17;break}if(j.Z.debug("GC: cleaning range from SegmentBuffer",v.start,v.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(v.start,v.end,a);case 17:d++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qt=n(8567),Yt=n(3),Xt=n(9878);function $t(e,t,n,r){return Kt().pipe((0,h.z)((function(){return n.getReference().asObservable()})),(0,s.U)((function(i){var a,o,s=n.getCurrentTime()+r,u=Math.min(Math.max(e.start,s),null!==(a=e.end)&&void 0!==a?a:1/0),l=!(null!==(o=i.paused.pending)&&void 0!==o?o:n.getIsPaused());return qt.Z.waitingMediaSourceReload(t,e,u,l)})))}var Qt=n(3428);var Jt=function(){function e(e,t,n,r){this._content=e,this._currentObs$=null,this._downloadQueue=t,this._initSegmentRequest=null,this._mediaSegmentRequest=null,this._segmentFetcher=n,this._initSegmentInfoRef=(0,oe.ZP)(void 0),this._mediaSegmentsAwaitingInitMetadata=new Set,r||this._initSegmentInfoRef.setValue(null)}var t=e.prototype;return t.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},t.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},t.start=function(){var e=this;if(null!==this._currentObs$)return this._currentObs$;var t=(0,g.P)((function(){var t=e._downloadQueue.asObservable().pipe((0,b.h)((function(t){for(var n=t.segmentQueue,r=0;r<n.length;r++){var i=n[r].segment;if(!e._mediaSegmentsAwaitingInitMetadata.has(i.id))break}var a=e._mediaSegmentRequest;if(r>=n.length)return null!==a;if(null===a)return!0;var o=n[r];return a.segment.id!==o.segment.id||(a.priority!==o.priority&&e._segmentFetcher.updatePriority(a.request,o.priority),!1)})),(0,L.w)((function(t){return t.segmentQueue.length>0?e._requestMediaSegments():U.E}))),n=e._downloadQueue.asObservable().pipe((0,b.h)((function(t){var n=e._initSegmentRequest;return null!==t.initSegment&&null!==n?(t.initSegment.priority!==n.priority&&e._segmentFetcher.updatePriority(n.request,t.initSegment.priority),!1):null===t.initSegment||null===n})),(0,L.w)((function(t){return null===t.initSegment?U.E:e._requestInitSegment(t.initSegment)})));return(0,B.T)(n,t)})).pipe((0,T.B)());return this._currentObs$=t,t},t._requestMediaSegments=function(){var e=this,t=this._downloadQueue.getValue().segmentQueue[0],n=this;return(0,g.P)((function(){return r(t)})).pipe((0,Le.x)((function(){e._mediaSegmentRequest=null})));function r(e){if(void 0===e)return(0,p.of)({type:"end-of-queue",value:null});var t=e.segment,i=e.priority,a=(0,ie.Z)({segment:t},n._content);return new v.y((function(e){var o,s=new se.ZP,u=!1,l=!1,c=n._segmentFetcher.createRequest(a,i,{onRetry:function(n){e.next({type:"retry",value:{segment:t,error:n}})},beforeInterrupted:function(){j.Z.info("Stream: segment request interrupted temporarly.",t.id,t.time)},onChunk:function(e){var t=n._initSegmentInfoRef.getValue();void 0!==t?d(e(null!=t?t:void 0)):(l=!0,n._initSegmentInfoRef.waitUntilDefined((function(t){d(e(null!=t?t:void 0))}),{clearSignal:s.signal}))},onAllChunksReceived:function(){l?(n._mediaSegmentsAwaitingInitMetadata.add(t.id),n._initSegmentInfoRef.waitUntilDefined((function(){e.next({type:"end-of-segment",value:{segment:t}}),n._mediaSegmentsAwaitingInitMetadata.delete(t.id),l=!1}),{clearSignal:s.signal})):e.next({type:"end-of-segment",value:{segment:t}})},beforeEnded:function(){n._mediaSegmentRequest=null,l?n._initSegmentInfoRef.waitUntilDefined(f,{clearSignal:s.signal}):f()}},s.signal);return c.catch((function(t){u||(u=!0,e.error(t))})),n._mediaSegmentRequest={segment:t,priority:i,request:c},function(){n._mediaSegmentsAwaitingInitMetadata.delete(t.id),void 0!==o&&o.unsubscribe(),u||(u=!0,l=!1,s.cancel())};function d(n){(0,ye.Z)("media"===n.segmentType,"Should have loaded a media segment."),e.next((0,ie.Z)({},n,{type:"parsed-media",segment:t}))}function f(){var i=n._downloadQueue.getValue().segmentQueue;if(0===i.length)return e.next({type:"end-of-queue",value:null}),u=!0,void e.complete();i[0].segment.id===t.id&&i.shift(),u=!0,o=r(i[0]).subscribe(e)}}))}},t._requestInitSegment=function(e){var t=this;if(null===e)return this._initSegmentRequest=null,U.E;var n=this;return new v.y((function(r){var i=new se.ZP,a=e.segment,o=e.priority,s=(0,ie.Z)({segment:a},t._content),u=!1,l=t._segmentFetcher.createRequest(s,o,{onRetry:function(e){r.next({type:"retry",value:{segment:a,error:e}})},beforeInterrupted:function(){j.Z.info("Stream: init segment request interrupted temporarly.",a.id)},beforeEnded:function(){n._initSegmentRequest=null,u=!0,r.complete()},onChunk:function(e){var t,i=e(void 0);(0,ye.Z)("init"===i.segmentType,"Should have loaded an init segment."),r.next((0,ie.Z)({},i,{type:"parsed-init",segment:a})),"init"===i.segmentType&&n._initSegmentInfoRef.setValue(null!==(t=i.initTimescale)&&void 0!==t?t:null)},onAllChunksReceived:function(){r.next({type:"end-of-segment",value:{segment:a}})}},i.signal);return l.catch((function(e){u||(u=!0,r.error(e))})),t._initSegmentRequest={segment:a,priority:o,request:l},function(){t._initSegmentRequest=null,u||(u=!0,i.cancel())}}))},e}();function en(e,t,n,r,i){var a=e.period,o=e.adaptation,s=e.representation,u=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(void 0===r.bufferedStart||void 0===r.bufferedEnd||r.bufferedStart>=t.end)return null;if(r.bufferedEnd>t.start)return n}return null}(i,t);if(null===u){if(null===n){if(r&&void 0!==a.end&&t.end>=a.end)return{start:void 0,end:null};var l=s.index.checkDiscontinuity(t.start);if(null!==l)return{start:void 0,end:l}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n)){var d=c.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,d)?(j.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:d}):null}var f=function(e,t,n){if(n<=0)return j.Z.error("RS: Asked to check a discontinuity before the first chunk."),null;for(var r=n;r<e.length;r++){var i=e[r],a=e[r-1];if(void 0===i.bufferedStart||void 0===a.bufferedEnd||i.bufferedStart>=t.end)return null;if(i.bufferedStart-a.bufferedEnd>0)return r}return null}(i,t,u+1);if(null!==f){var v=i[f-1],p=i[f];if(null===n||p.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(v.infos.segment.end,p.infos.segment.time))return null;var h=v.bufferedEnd,m=p.bufferedStart;return j.Z.debug("RS: future discontinuity encountered",o.type,h,m),{start:h,end:m}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var g=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(void 0===r.bufferedStart)return null;if(r.bufferedStart<t)return n}return null}(i,a.end);if(null!==g){var y=i[g];if(void 0!==y.bufferedEnd&&y.bufferedEnd<a.end)return j.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,y.bufferedEnd,a.end),{start:y.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var _=i.length-1;_>=0;_--){var b=i[_];if(void 0===b.bufferedStart)break;if(b.bufferedStart<t.end){if(void 0!==b.bufferedEnd&&b.bufferedEnd<t.end){var T=s.index.checkDiscontinuity(t.end);if(null!==T)return{start:b.bufferedEnd,end:T}}return null}}}return null}function tn(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,s=e.segmentsBeingPushed,u=e.maxBufferSize,l=n.adaptation,c=n.representation,d=function(e,t,n){var r=8e3*n;return r-=t.reduce((function(e,t){return e+t.representation.bitrate*t.segment.duration}),0),e.reduce((function(e,t){return void 0!==t.chunkSize?e-8*t.chunkSize:e}),r)}(t,s,u),f=c.index.getSegments(o.start,o.end-o.start),v=t.filter((function(e){return!rn(e.infos,n,r,i)})).filter((function(e,t,n){var r=0===t?null:n[t-1],i=t>=n.length-1?null:n[t+1],s=null;if(function(e,t,n){var r=Y.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return j.Z.warn("Stream: Start of a segment unknown. Assuming it is garbage collected by default.",e.start),!0;if(null!==t&&void 0!==t.bufferedEnd&&e.bufferedStart-t.bufferedEnd<.1)return!1;if(n<e.bufferedStart&&e.bufferedStart-e.start>r)return j.Z.info("Stream: The start of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,r,o.start)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.start;if(void 0!==t&&void 0!==a&&t-a>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.start;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=a(e.infos),e.bufferedStart))return!1;j.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=Y.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return j.Z.warn("Stream: End of a segment unknown. Assuming it is garbage collected by default.",e.end),!0;if(null!==t&&void 0!==t.bufferedStart&&t.bufferedStart-e.bufferedEnd<.1)return!1;if(n>e.bufferedEnd&&e.end-e.bufferedEnd>r)return j.Z.info("Stream: The end of the wanted segment has been garbage collected",e.start,e.bufferedStart),!0;return!1}(e,i,o.end)){if(function(e,t){var n,r;if(e.length<2)return!0;var i=e[e.length-1],a=null===(n=i.buffered)||void 0===n?void 0:n.end;if(void 0!==t&&void 0!==a&&a-t>.05)return!0;var o=e[e.length-2],s=null===(r=o.buffered)||void 0===r?void 0:r.end;if(void 0===s||void 0===a)return!0;return Math.abs(s-a)>.01}(s=null!=s?s:a(e.infos),e.bufferedEnd))return!1;j.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),p=Y.Z.getCurrent(),h=p.MINIMUM_SEGMENT_SIZE,m=p.MIN_BUFFER_AHEAD,g=!1,y=Math.min(1/60,h),_=!1,b=[],T=f.filter((function(e){var t=(0,ie.Z)({segment:e},n);if(s.length>0&&s.some((function(e){return(0,dt.z)(t,e)})))return!1;var u=e.duration,f=e.time,p=e.end;if(e.isInit)return!0;if(g)return b.push(e),!1;if(e.complete&&u<h)return!1;if(s.length>0&&s.some((function(e){if(e.period.id!==n.period.id||e.adaptation.id!==n.adaptation.id)return!1;var a=e.segment;return!(a.time-y>f)&&(!(a.end+y<p)&&!rn(e,t,r,i))})))return!1;for(var T=0;T<v.length;T++){var E=v[T];if(E.infos.period.id===n.period.id){var S=E.infos.segment;if(f-S.time>-y&&S.end-p>-y)return!1}}var w=u*n.representation.bitrate;if(d-w<0&&(_=!0,f>o.start+m))return g=!0,b.push(e),!1;var k=a(t);if(k.length>1){var A=k[k.length-1],x=k[k.length-2];if(null===A.buffered&&null===x.buffered)return j.Z.warn("Stream: Segment GCed multiple times in a row, ignoring it.","If this happens a lot and lead to unpleasant experience, please check your device's available memory. If it's low when this message is emitted, you might want to update the RxPlayer's settings (`maxBufferAhead`, `maxVideoBufferSize` etc.) so less memory is used by regular media data buffering."+l.type,c.id,e.time),!1}for(var I=0;I<v.length;I++){var Z=v[I];if(Z.end+y>f){var R=Z.start>f+y||nn(v,I).end<p-y;return R&&(d-=w),R}}return d-=w,!0}));return{segmentsToLoad:T,segmentsOnHold:b,isBufferFull:_}}function nn(e,t){for(var n=t+1,r=Y.Z.getCurrent().MINIMUM_SEGMENT_SIZE,i=Math.min(1/60,r);n<e.length-1&&e[n-1].end+i>e[n].start;)n++;return e[--n]}function rn(e,t,n,r){var i=Y.Z.getCurrent().CONTENT_REPLACEMENT_PADDING;return e.period.id===t.period.id&&(!(e.segment.time<n+i)&&(e.adaptation.id!==t.adaptation.id||function(e,t,n){var r=e.bitrate,i=Y.Z.getCurrent().BITRATE_REBUFFERING_RATIO;if(void 0===n){var a=r*i;return t.bitrate>a}return r<n&&t.bitrate>r}(e.representation,t.representation,r)))}function an(e,t){for(var n=e-t,r=Y.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function on(e,t,n,r,i,a,o){o.synchronizeInventory();var s=e.representation,u=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,l=function(e,t,n){var r,i,a=e.manifest,o=e.period,s=e.representation,u=s.index.getLastAvailablePosition(),l=s.index;i=!(0,re.Z)(u)&&t>=u&&l.isInitialized()&&l.isFinished()&&function(e,t,n){var r;return t.containsTime(n)&&e.isLastPeriodKnown&&t.id===(null===(r=e.periods[e.periods.length-1])||void 0===r?void 0:r.id)}(a,o,t)?u-1:t-.1;var c,d=i+n;c=!(!s.index.isInitialized()||!s.index.isFinished()||void 0===o.end)&&(void 0===u?d>=o.end:null===u||d>=u);return{start:Math.max(i,o.start),end:Math.min(d,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:c}}(e,u,i),c=s.index.shouldRefresh(l.start,l.end),d=o.getPendingOperations().filter((function(e){return e.type===Pt.f.EndOfSegment})).map((function(e){return e.value})),f=function(e,t){for(var n=Y.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],s=t.length-1;s>=0;s--){var u=t[s],l=u.infos.representation;if(!u.partiallyPushed&&!1!==l.decipherable&&l.isSupported){var c=u.infos.segment,d=c.time/c.timescale;((c.complete?d+c.duration/c.timescale:u.end)>i&&d<a||u.end>i&&u.start<a)&&o.unshift(u)}}return o}({start:Math.max(l.start-.5,0),end:l.end+.5},o.getInventory()),v=tn({content:e,bufferedSegments:f,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:l,segmentsBeingPushed:d,maxBufferSize:a}),p=v.segmentsToLoad,h=v.segmentsOnHold,m=v.isBufferFull,g=p.map((function(e){return{priority:an(e.time,u),segment:e}})),y=s.index.isInitialized()&&s.index.isFinished()&&l.hasReachedPeriodEnd&&0===g.length&&0===h.length,_=null;return d.length>0&&(_=Math.min.apply(Math,d.map((function(e){return e.segment.time})))),h.length>0&&(_=null!==_?Math.min(_,h[0].time):h[0].time),g.length>0&&(_=null!==_?Math.min(_,g[0].segment.time):g[0].segment.time),{imminentDiscontinuity:en(e,l,_,y,f),hasFinishedLoading:y,neededSegments:g,isBufferFull:m,shouldRefreshManifest:c}}function sn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return un(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e,t,n){return cn.apply(this,arguments)}function cn(){return(cn=(0,le.Z)(de().mark((function e(t,n,r){var i,a,o,s,u,l,c,d,f;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Y.Z.getCurrent().BUFFER_GC_GAPS.CALM,a=Y.Z.getCurrent().BUFFER_GC_GAPS.BEEFY,j.Z.warn("Stream: Running garbage collector"),o=n.getBufferedRanges(),0===(s=dn(t,o,i)).length&&(s=dn(t,o,a)),j.Z.hasLevel("DEBUG")&&j.Z.debug("Stream: GC cleaning",s.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),u=sn(s);case 8:if((l=u()).done){e.next=16;break}if(c=l.value,d=c.start,f=c.end,!(d<f)){e.next=14;break}return e.next=14,n.removeBuffer(d,f,r);case 14:e.next=8;break;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,t,n){for(var r=(0,ae.F_)(t,e),i=r.innerRange,a=r.outerRanges,o=[],s=0;s<a.length;s++){var u=a[s];(e-n>u.end||e+n<u.start)&&o.push(u)}return null!==i&&(j.Z.hasLevel("DEBUG")&&j.Z.debug("Stream: GC removing part of inner range",o.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),e-n>i.start&&o.push({start:i.start,end:e-n}),e+n<i.end&&o.push({start:e+n,end:i.end})),o}function fn(e,t,n,r){return vn.apply(this,arguments)}function vn(){return(vn=(0,le.Z)(de().mark((function e(t,n,r,i){var a,o,s,u,l,c;return de().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.pushChunk(r,i);case 3:case 17:e.next=23;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=10;break}throw o=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new X.Z("BUFFER_APPEND_ERROR",o);case 10:return s=t.getReference().getValue(),u=s.position,l=null!==(a=u.pending)&&void 0!==a?a:u.last,e.prev=12,e.next=15,ln(l,n,i);case 15:return e.next=17,n.pushChunk(r,i);case 19:throw e.prev=19,e.t1=e.catch(12),c=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new X.Z("BUFFER_FULL_ERROR",c);case 23:case"end":return e.stop()}}),e,null,[[0,5],[12,19]])})))).apply(this,arguments)}var pn=function(e){var t=e.content,n=e.options,r=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,d=e.terminate$,f=t.period,v=t.adaptation,m=t.representation,y=n.bufferGoal$,_=n.maxBufferSize$,b=n.drmSystemId,E=n.fastSwitchThreshold$,S=v.type,w={segment:m.index.getInitSegment(),segmentData:null,isLoaded:!1},k=new i.x,A=(0,oe.$l)({initSegment:null,segmentQueue:[]}),x=null!==w.segment,I=new Jt(t,A,u,x);x||(w.segmentData=null,w.isLoaded=!0);var Z=!1,R=U.E;if(void 0!==b){var M=m.getEncryptionData(b);M.length>0&&M.every((function(e){return void 0!==e.keyIds}))&&(R=p.of.apply(void 0,M.map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))),Z=!0)}var P,D,L=I.start().pipe((0,h.z)((function(e){switch(e.type){case"retry":return(0,O.z)((0,p.of)({type:"warning",value:e.value.error}),(0,g.P)((function(){var t=e.value.segment,n=m.index;if(!1===n.isSegmentStillAvailable(t))k.next();else if(n.canBeOutOfSyncError(e.value.error,t))return(0,p.of)(qt.Z.manifestMightBeOufOfSync());return U.E})));case"parsed-init":case"parsed-media":return function(e){if("init"===e.segmentType){Vt()((function(){k.next()})),w.segmentData=e.initializationData,w.isLoaded=!0;var n=m.getAllEncryptionData(),i=!Z&&n.length>0?p.of.apply(void 0,n.map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))):U.E,a=function(e){var t=e.playbackObserver,n=e.content,r=e.segment,i=e.segmentData,a=e.segmentBuffer;return(0,g.P)((function(){if(null===i)return U.E;var e=n.representation.getMimeTypeString(),o={initSegment:i,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:e},u=new se.ZP;return Ft(u,(function(){return fn(t,a,{data:o,inventoryInfos:null},u.signal)})).pipe((0,s.U)((function(){var e=a.getBufferedRanges();return qt.Z.addedSegment(n,r,e,i)})))}))}({playbackObserver:r,content:t,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o});return(0,B.T)(i,a)}var u=e.inbandEvents,l=e.needsManifestRefresh,c=e.protectionDataUpdate&&!Z?p.of.apply(void 0,m.getAllEncryptionData().map((function(e){return qt.Z.encryptionDataEncountered(e,t)}))):U.E,d=!0===l?(0,p.of)(qt.Z.needsManifestRefresh()):U.E,f=void 0!==u&&u.length>0?(0,p.of)({type:"inband-events",value:u}):U.E,v=w.segmentData,h=function(e){var t=e.playbackObserver,n=e.content,r=e.initSegmentData,i=e.parsedSegment,a=e.segment,o=e.segmentBuffer;return(0,g.P)((function(){var e,u;if(null===i.chunkData)return U.E;var l=i.chunkData,c=i.chunkInfos,d=i.chunkOffset,f=i.chunkSize,v=i.appendWindow,p=n.representation.getMimeTypeString(),h=Y.Z.getCurrent().APPEND_WINDOW_SECURITIES,m=[void 0!==v[0]?Math.max(0,v[0]-h.START):void 0,void 0!==v[1]?v[1]+h.END:void 0],g={initSegment:r,chunk:l,timestampOffset:d,appendWindow:m,codec:p},y=null!==(e=null==c?void 0:c.time)&&void 0!==e?e:a.time,_=y+(null!==(u=null==c?void 0:c.duration)&&void 0!==u?u:a.duration);void 0!==m[0]&&(y=Math.max(y,m[0])),void 0!==m[1]&&(_=Math.min(_,m[1]));var b=(0,ie.Z)({segment:a,chunkSize:f,start:y,end:_},n),T=new se.ZP;return Ft(T,(function(){return fn(t,o,{data:g,inventoryInfos:b},T.signal)})).pipe((0,s.U)((function(){var e=o.getBufferedRanges();return qt.Z.addedSegment(n,a,e,l)})))}))}({playbackObserver:r,content:t,initSegmentData:v,parsedSegment:e,segment:e.segment,segmentBuffer:o});return(0,O.z)(c,d,f,h)}(e);case"end-of-segment":var n=e.value.segment,i=new se.ZP;return Ft(i,(function(){return o.endOfSegment((0,ie.Z)({segment:n},t),i.signal)})).pipe((0,Be.l)());case"end-of-queue":return k.next(),U.E;default:(0,Rt.Z)(e)}}))),F=C([r.getReference().asObservable(),y,_,d.pipe((0,a.q)(1),(0,N.O)(null)),k.pipe((0,N.O)(void 0))]).pipe((0,Qt.M)(E),(0,h.z)((function(e){var n,i,a=e[0],s=a[0],u=a[1],l=a[2],c=a[3],d=e[1],v=null!==(n=s.position.pending)&&void 0!==n?n:s.position.last,h=on(t,v,r,d,u,l,o),g=h.neededSegments,y=null;if(m.index.isInitialized()){if(g.length>0&&!w.isLoaded&&null!==w.segment){var _=g[0].priority;y={segment:w.segment,priority:_}}}else if(null===w.segment)j.Z.warn("Stream: Uninitialized index without an initialization segment");else if(w.isLoaded)j.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var b=null!==(i=s.position.pending)&&void 0!==i?i:s.position.last;y={segment:w.segment,priority:an(f.start,b)}}if(null===c)A.setValue({initSegment:y,segmentQueue:g});else{if(c.urgent)return j.Z.debug("Stream: Urgent switch, terminate now.",S),A.setValue({initSegment:null,segmentQueue:[]}),A.finish(),(0,p.of)(qt.Z.streamTerminating());var T=g[0],E=I.getRequestedInitSegment(),k=I.getRequestedMediaSegment(),x=null===k||void 0===T||k.id!==T.segment.id?[]:[T],Z=null===E?null:y;if(A.setValue({initSegment:Z,segmentQueue:x}),0===x.length&&null===Z)return j.Z.debug("Stream: No request left, terminate",S),A.finish(),(0,p.of)(qt.Z.streamTerminating())}var R=(0,p.of)({type:"stream-status",value:{period:f,position:s.position.last,bufferType:S,imminentDiscontinuity:h.imminentDiscontinuity,hasFinishedLoading:h.hasFinishedLoading,neededSegments:h.neededSegments}}),M=U.E,C=Y.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(h.isBufferFull){var P=Math.max(0,v-C);if(P>0){var D=new se.ZP;M=Ft(D,(function(){return o.removeBuffer(0,P,D.signal)})).pipe((0,Be.l)())}}return h.shouldRefreshManifest?(0,O.z)((0,p.of)(qt.Z.needsManifestRefresh()),R,M):(0,O.z)(R,M)})),(P=function(e){return"stream-terminating"!==e.type},void 0===(D=!0)&&(D=!1),(0,l.e)((function(e,t){var n=0;e.subscribe((0,c.x)(t,(function(e){var r=P(e,n++);(r||D)&&t.next(e),!r&&t.complete()})))}))));return(0,B.T)(F,L,R).pipe((0,T.B)())};var hn=function(e){var t=e.playbackObserver,n=e.content,r=e.options,o=e.representationEstimator,u=e.segmentBuffer,l=e.segmentFetcherCreator,c=e.wantedBufferAhead,f=e.maxVideoBufferSize,m="direct"===r.manualBitrateSwitchingMode,y=n.manifest,_=n.period,E=n.adaptation,S={},w=(0,oe.$l)(null),k=new i.x,A=new se.ZP,x=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,u=(0,oe.ZP)([]);f(),o.addEventListener("decipherabilityUpdate",f);var l=a.register(v),c=t(e,n,u,r,a),d=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:d};function f(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new X.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played");return v(),void i(t)}var n=u.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||u.setValue(e)}function v(){o.removeEventListener("decipherabilityUpdate",f),u.finish(),void 0!==l&&l()}}(n,o,w,t,(function(e){k.error(e)}),A.signal),I=x.estimateRef,Z=x.abrCallbacks,R=l.createSegmentFetcher(E.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics}),M=(0,oe.$l)(null),C=I.asObservable().pipe((0,z.b)((function(e){M.setValue(e)})),(0,Ue.Z)(),(0,T.B)()),P=C.pipe((0,b.h)((function(e){return null!=e.bitrate})),d((function(e,t){return e.bitrate===t.bitrate})),(0,s.U)((function(e){var t=e.bitrate;return j.Z.debug("Stream: new "+E.type+" bitrate estimate",t),qt.Z.bitrateEstimationChange(E.type,t)}))),D=C.pipe(Ut((function(e,t){return N(e,0===t)})));return(0,B.T)(k,D,P,new v.y((function(){return function(){return A.cancel()}})));function N(e,n){var i=e.representation;if(m&&e.manual&&!n){var o=Y.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return $t(_,E.type,t,o.bitrateSwitch)}var u=M.asObservable().pipe((0,b.h)((function(t){return null===t||t.representation.id!==i.id||t.manual&&!e.manual})),(0,a.q)(1),(0,s.U)((function(e){return null===e?(j.Z.info("Stream: urgent Representation termination",E.type),{urgent:!0}):e.urgent?(j.Z.info("Stream: urgent Representation switch",E.type),{urgent:!0}):(j.Z.info("Stream: slow Representation switch",E.type),{urgent:!1})}))),l=r.enableFastSwitching?M.asObservable().pipe((0,s.U)((function(e){return null===e?void 0:e.knownStableBitrate})),d()):(0,p.of)(0),c=(0,p.of)(qt.Z.representationChange(E.type,_,i));return(0,O.z)(c,L(i,u,l)).pipe((0,z.b)((function(e){"added-segment"===e.type&&Z.addedSegment(e.value),"representationChange"===e.type&&w.setValue(e.value.representation)})),(0,h.z)((function(e){if("stream-terminating"===e.type){var t=M.getValue();return null===t?U.E:N(t,!1)}return(0,p.of)(e)})))}function L(e,n,i){return(0,g.P)((function(){var a=S[e.id],o=null!=a?a:1;S[e.id]=o;var l=c.asObservable().pipe((0,s.U)((function(e){return e*o}))),d="video"===E.type?f.asObservable():(0,p.of)(1/0);return j.Z.info("Stream: changing representation",E.type,e.id,e.bitrate),pn({playbackObserver:t,content:{representation:e,adaptation:E,period:_,manifest:y},segmentBuffer:u,segmentFetcher:R,terminate$:n,options:{bufferGoal$:l,maxBufferSize$:d,drmSystemId:r.drmSystemId,fastSwitchThreshold$:i}}).pipe((0,Xt.K)((function(t){var r=(0,$.Z)(t,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"===r.code){var a=c.getValue(),s=o;if(s<=.25||a*s<=2)throw r;return S[e.id]=s-.25,L(e,n,i)}throw r})))}))}};function mn(e,t,n,r){var i=r.period,a=!1,o=t.asObservable();return C([e.getReference().asObservable(),o]).pipe((0,h.z)((function(e){var t=e[0],r=e[1],o=t.position.last;return void 0!==i.end&&o+r>=i.end&&(j.Z.debug('Stream: full "empty" AdaptationStream',n),a=!0),(0,p.of)({type:"stream-status",value:{period:i,bufferType:n,position:o,imminentDiscontinuity:null,hasFinishedLoading:a,neededSegments:[],shouldRefreshManifest:!1}})})))}var gn=n(9252);var yn=function(e,t){var n=e.split(";"),r=n[0],i=n.slice(1),a=t.split(";"),o=a[0],s=a.slice(1);if(r!==o)return!1;var u=(0,He.Z)(i,(function(e){return(0,gn.Z)(e,"codecs=")})),l=(0,He.Z)(s,(function(e){return(0,gn.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var c=u.substring(7),d=l.substring(7);return c.split(".")[0]===d.split(".")[0]};function _n(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return yn(e.getMimeTypeString(),t)}))}(n,e.codec))return{type:"needs-reload",value:void 0};var a=e.getBufferedRanges();if(0===a.length)return{type:"continue",value:void 0};var o=(0,ae.JN)(a),s=t.start,u=null==t.end?1/0:t.end,l=(0,ae.tn)(o,[{start:s,end:u}]);if(0===l.length)return{type:"continue",value:void 0};e.synchronizeInventory();var c=e.getInventory();if(!c.some((function(e){return e.infos.period.id===t.id&&e.infos.adaptation.id!==n.id})))return{type:"continue",value:void 0};var d=function(e,t,n){return e.reduce((function(e,r){if(r.infos.period.id!==t.id||r.infos.adaptation.id!==n.id)return e;var i=r.bufferedStart,a=r.bufferedEnd;return void 0===i||void 0===a||e.push({start:i,end:a}),e}),[])}(c,t,n),f=(0,ae.uH)(l,d);if(0===f.length)return{type:"continue",value:void 0};var v=r.currentTime,p=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===p)&&(0,ae.Ti)({start:s,end:u},v)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return yn(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,ae.A1)(d,v))return{type:"needs-reload",value:void 0};var h="audio"===n.type&&"direct"===p,m=[],g=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>=t.start)return n>0?e[n-1]:null;return e.length>0?e[e.length-1]:null}(c,t);null!==g&&(void 0===g.bufferedEnd||t.start-g.bufferedEnd<1)&&m.push({start:0,end:t.start+1});var y=n.type,_=Y.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,b=_[y].before;null==b&&(b=0);var T=_[y].after;if(null==T&&(T=0),h||m.push({start:v-b,end:v+T}),void 0!==t.end){var E=function(e,t){for(var n=0;n<e.length;n++)if(e[n].infos.period.start>t.start)return e[n];return null}(c,t);null!==E&&(void 0===E.bufferedStart||E.bufferedStart-t.end<1)&&m.push({start:t.end-1,end:Number.MAX_VALUE})}var S=(0,ae.uH)(f,m);return 0===S.length?{type:"continue",value:void 0}:h?{type:"flush-buffer",value:S}:{type:"clean-buffer",value:S}}var bn=function(e){var t=e.bufferType,n=e.content,r=e.garbageCollectors,i=e.playbackObserver,a=e.representationEstimator,o=e.segmentFetcherCreator,u=e.segmentBuffersStore,l=e.options,c=e.wantedBufferAhead,d=e.maxVideoBufferSize,f=n.period,v=new Yt.t(1);return v.pipe((0,L.w)((function(e,v){var m=Y.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD,y=0===v?0:"audio"===t?m.trackSwitch.audio:"video"===t?m.trackSwitch.video:m.trackSwitch.other;if(null===e){j.Z.info("Stream: Set no "+t+" Adaptation. P:",f.start);var _,b=u.getStatus(t);if("initialized"===b.type){if(j.Z.info("Stream: Clearing previous "+t+" SegmentBuffer"),Lt.isNative(t))return $t(f,t,i,0);var T=new se.ZP;_=Ft(T,(function(){return void 0===f.end?b.value.removeBuffer(f.start,1/0,T.signal):f.end<=f.start?Promise.resolve():b.value.removeBuffer(f.start,f.end,T.signal)}))}else"uninitialized"===b.type&&u.disableSegmentBuffer(t),_=(0,p.of)(null);return(0,O.z)(_.pipe((0,s.U)((function(){return qt.Z.adaptationChange(t,null,f)}))),mn(i,c,t,{period:f}))}if(Lt.isNative(t)&&"disabled"===u.getStatus(t).type)return $t(f,t,i,y);j.Z.info("Stream: Updating "+t+" adaptation","A: "+e.id,"P: "+f.start);var E=(0,g.P)((function(){var s=i.getReadyState(),v=function(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return j.Z.info("Stream: Reusing a previous SegmentBuffer for the type",t),i.value;var a=function(e){var t=e.getPlayableRepresentations();if(0===t.length){throw new X.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played")}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}(u,t,e,l),m={currentTime:i.getCurrentTime(),readyState:s},g=_n(v,f,e,m,l);if("needs-reload"===g.type)return $t(f,t,i,y);var _="flush-buffer"===g.type?(0,p.of)(qt.Z.needsBufferFlush()):U.E,b="clean-buffer"===g.type||"flush-buffer"===g.type?O.z.apply(void 0,g.value.map((function(e){var t=e.start,n=e.end,r=new se.ZP;return Ft(r,(function(){return v.removeBuffer(t,n,r.signal)}))}))).pipe((0,Be.l)()):U.E,T=r.get(v),E=function(e,r){var s=n.manifest,v=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=(0,oe.ZP)(i());return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){r.finish()})),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,ae.L7)(r,n.position.last);return(0,ie.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(i,r);return hn({content:{manifest:s,period:f,adaptation:e},options:l,playbackObserver:v,representationEstimator:a,segmentBuffer:r,segmentFetcherCreator:o,wantedBufferAhead:c,maxVideoBufferSize:d}).pipe((0,Xt.K)((function(e){if(!Lt.isNative(t)){j.Z.error("Stream: "+t+" Stream crashed. Aborting it.",e instanceof Error?e:""),u.disposeSegmentBuffer(t);var n=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});return(0,O.z)((0,p.of)(qt.Z.warning(n)),mn(i,c,t,{period:f}))}throw j.Z.error("Stream: "+t+" Stream crashed. Stopping playback.",e instanceof Error?e:""),e})))}(e,v),S=new se.ZP;return Ft(S,(function(){return u.waitForUsableBuffers(S.signal)})).pipe((0,h.z)((function(){return(0,O.z)(b,_,(0,B.T)(E,T))})))}));return(0,O.z)((0,p.of)(qt.Z.adaptationChange(t,e,f)),E)})),(0,N.O)(qt.Z.periodStreamReady(t,f,v)))},Tn=n(3074);function En(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return e.pipe((0,b.h)((function(e){return"complete-stream"===e.type||"stream-status"===e.type&&!e.value.hasFinishedLoading})),(0,s.U)((function(e){return"complete-stream"===e.type})),(0,N.O)(!1),d())}));return C(r).pipe((0,s.U)((function(e){return e.every((function(e){return e}))})),d())}function Sn(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n=[],r=e.getInventory(),i=function(i){var a=r[i];if(t.some((function(e){return a.infos.period.id===e.period.id&&a.infos.adaptation.id===e.adaptation.id&&a.infos.representation.id===e.representation.id}))){var o=a.bufferedStart,s=a.bufferedEnd;if(void 0===o||void 0===s){j.Z.warn("SO: No buffered start or end found from a segment.");var u=e.getBufferedRanges(),l=u.length;return 0===l?{v:[]}:{v:[{start:u.start(0),end:u.end(l-1)}]}}var c=n[n.length-1];void 0!==c&&c.end===o?c.end=s:n.push({start:o,end:s})}},a=0;a<r.length;a++){var o=i(a);if("object"==typeof o)return o.v}return n}function wn(e,t){if(0===t.length)return!1;var n=e.position.last;return e.speed>=0?t[t.length-1].end>=n-5:t[0].start<=n+5}var kn=function(e,t,n,r,u,l){var c,f,m=e.manifest,y=e.initialPeriod,_=l.maxBufferAhead,E=l.maxBufferBehind,S=l.wantedBufferAhead,w=l.maxVideoBufferSize,k=Y.Z.getCurrent(),A=k.MAXIMUM_MAX_BUFFER_AHEAD,x=k.MAXIMUM_MAX_BUFFER_BEHIND,I=new Ht((function(e){var n=e.bufferType,r=null!=x[n]?x[n]:1/0,i=null!=A[n]?A[n]:1/0;return new v.y((function(){var n=new se.ZP;return Wt({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,oe.lR)(E,(function(e){return Math.min(e,r)}),n.signal),maxBufferAhead:(0,oe.lR)(_,(function(e){return Math.min(e,i)}),n.signal)},n.signal),function(){n.cancel()}}))})),Z=r.getBufferTypes().map((function(e){return function(e,n){var o=new Gt((function(e,t){return e.start-t.start})),u=new i.x,l=!1;function c(t){return D(e,t,u).pipe((0,s.U)((function(e){switch(e.type){case"waiting-media-source-reload":var t=o.head();if(void 0===t||t.id!==e.value.period.id)return qt.Z.lockedStream(e.value.bufferType,e.value.period);var n=e.value,r=n.position,i=n.autoPlay;return qt.Z.needsMediaSourceReload(r,i);case"periodStreamReady":l=!0,o.add(e.value.period);break;case"periodStreamCleared":o.removeElement(e.value.period)}return e})),(0,T.B)())}function d(e){var t=o.head(),n=o.last();return null==t||null==n||(t.start>e||(null==n.end?1/0:n.end)<e)}var f=t.getReference().asObservable().pipe((0,Fe.Z)((function(t){var n,r,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(!l||!d(a))return null;var o=null!==(r=m.getPeriodForTime(a))&&void 0!==r?r:m.getNextPeriod(a);return void 0===o?null:(j.Z.info("SO: Current position out of the bounds of the active periods,re-creating Streams.",e,a),l=!1,u.next(),o)}),null),(0,h.z)((function(e){if(null==e)throw new X.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return c(e)}))),v=(0,ne.R)(m,"decipherabilityUpdate").pipe((0,h.z)(y));return(0,B.T)(f,v,c(n));function y(n){var i=r.getStatus(e),o=n.filter((function(t){return t.adaptation.type===e}));if(0===o.length||"initialized"!==i.type)return U.E;var s=i.value,d=o.filter((function(e){return void 0===e.representation.decipherable})),f=o.filter((function(e){return!1===e.representation.decipherable})),v=Sn(s,f),y=Sn(s,d);l=!1,u.next();var _=[].concat(v,y).map((function(e){var t=e.start,n=e.end;if(t>=n)return U.E;var r=new se.ZP;return Ft(r,(function(){return s.removeBuffer(t,n,r.signal)})).pipe((0,Be.l)())}));return O.z.apply(void 0,_.concat([Kt().pipe((0,Be.l)()),t.getReference().asObservable().pipe((0,a.q)(1),(0,h.z)((function(e){var n,r=(0,g.P)((function(){var t,n=null!==(t=e.position.pending)&&void 0!==t?t:e.position.last,r=m.getPeriodForTime(n);if(null==r)throw new X.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest.");return c(r)}));if(wn(e,v)){var i=!(null!==(n=e.paused.pending)&&void 0!==n?n:t.getIsPaused());return(0,O.z)((0,p.of)(qt.Z.needsDecipherabilityFlush(e.position.last,i,e.duration)),r)}return wn(e,y)?(0,O.z)((0,p.of)(qt.Z.needsBufferFlush()),r):r})))]))}}(e,y).pipe((0,Ue.Z)(),(0,T.B)())})),R=(c=Z,f=c.length,B.T.apply(void 0,c).pipe((0,b.h)((function(e){var t=e.type;return"periodStreamCleared"===t||"adaptationChange"===t||"representationChange"===t})),(0,Tn.R)((function(e,t){switch(t.type){case"periodStreamCleared":var n=t.value,r=n.period,i=n.type,a=e[r.id];void 0!==a&&a.buffers.has(i)&&(a.buffers.delete(i),0===a.buffers.size&&delete e[r.id]);break;case"adaptationChange":if(null!==t.value.adaptation)return e;case"representationChange":var o=t.value,s=o.period,u=o.type,l=e[s.id];if(void 0===l){var c=new Set;c.add(u),e[s.id]={period:s,buffers:c}}else l.buffers.has(u)||l.buffers.add(u)}return e}),{}),(0,s.U)((function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];void 0!==i&&i.buffers.size===f&&n.push(i.period)}return n.reduce((function(e,t){return null===e||t.start<e.start?t:e}),null)})),d((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e.id===t.id})))).pipe((0,b.h)((function(e){return null!==e})),(0,s.U)((function(e){return j.Z.info("Stream: New active period",e.start),qt.Z.activePeriodChanged(e)}))),M=(0,ne.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return m.isLastPeriodKnown})),(0,N.O)(m.isLastPeriodKnown),d()),P=C([En.apply(void 0,Z),M]).pipe((0,s.U)((function(e){var t=e[0],n=e[1];return t&&n})),d(),(0,s.U)((function(e){return e?qt.Z.endOfStream():qt.Z.resumeStream()})));return B.T.apply(void 0,Z.concat([R,P]));function D(e,s,c){j.Z.info("SO: Creating new Stream for",e,s.start);var d=new i.x,f=new i.x,v=t.getReference().asObservable().pipe((0,b.h)((function(e){var t,n=e.position;return null!=s.end&&(null!==(t=n.pending)&&void 0!==t?t:n.last)>=s.end}))),g=d.pipe(Ut((function(t){return D(e,t,f)}))),y=c.pipe((0,a.q)(1),(0,z.b)((function(){d.complete(),f.next(),f.complete()})),(0,T.B)()),_=(0,B.T)(v,y),E=bn({bufferType:e,content:{manifest:m,period:s},garbageCollectors:I,maxVideoBufferSize:w,segmentFetcherCreator:u,segmentBuffersStore:r,options:l,playbackObserver:t,representationEstimator:n,wantedBufferAhead:S}).pipe((0,h.z)((function(t){if("stream-status"===t.type)if(t.value.hasFinishedLoading){var n=m.getPeriodAfter(s);if(null===n)return(0,O.z)((0,p.of)(t),(0,p.of)(qt.Z.streamComplete(e)));d.next(n)}else f.next();return(0,p.of)(t)})),(0,T.B)()),k=(0,O.z)(E.pipe((0,o.R)(_)),(0,p.of)(qt.Z.periodStreamCleared(e,s)).pipe((0,z.b)((function(){j.Z.info("SO: Destroying Stream for",e,s.start)}))));return(0,B.T)(k,g,y.pipe((0,Be.l)()))}},An=kn;var xn=function(){function e(e){this._manifest=e,this._lastAudioAdaptation=void 0,this._lastVideoAdaptation=void 0}var t=e.prototype;return t.updateLastAudioAdaptation=function(e){this._lastAudioAdaptation=e},t.updateLastVideoAdaptation=function(e){this._lastVideoAdaptation=e},t.getMaximumAvailablePosition=function(){var e;if(this._manifest.isDynamic)return null!==(e=this._manifest.getLivePosition())&&void 0!==e?e:this._manifest.getMaximumSafePosition();if(void 0===this._lastVideoAdaptation||void 0===this._lastAudioAdaptation)return this._manifest.getMaximumSafePosition();if(null===this._lastAudioAdaptation){if(null===this._lastVideoAdaptation)return this._manifest.getMaximumSafePosition();var t=In(this._lastVideoAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}if(null===this._lastVideoAdaptation){var n=In(this._lastAudioAdaptation);return"number"!=typeof n?this._manifest.getMaximumSafePosition():n}var r=In(this._lastAudioAdaptation),i=In(this._lastVideoAdaptation);return"number"!=typeof r||"number"!=typeof i?this._manifest.getMaximumSafePosition():Math.min(r,i)},t.getEndingPosition=function(){var e,t;if(!this._manifest.isDynamic)return this.getMaximumAvailablePosition();if(void 0!==this._lastVideoAdaptation&&void 0!==this._lastAudioAdaptation){if(null===this._lastAudioAdaptation)return null===this._lastVideoAdaptation?void 0:null!==(e=Zn(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=Zn(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=Zn(this._lastAudioAdaptation),r=Zn(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function In(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getLastAvailablePosition();if(void 0===a)return;null!==a&&(r=(0,re.Z)(r)?a:Math.min(r,a))}return r}function Zn(e){for(var t,n=e.representations,r=null,i=0;i<n.length;i++)if(n[i].index!==t){t=n[i].index;var a=n[i].index.getEnd();if(void 0===a)return;null!==a&&(r=(0,re.Z)(r)?a:Math.min(r,a))}return r}var Rn=n(5039),Mn=Array.isArray;function Cn(e){return 1===e.length&&Mn(e[0])?e[0]:e}function Pn(e){return function(t){for(var n=[],r=function(r){n.push((0,Bt.Xf)(e[r]).subscribe((0,c.x)(t,(function(e){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}t.next(e)}))))},i=0;n&&!t.closed&&i<e.length;i++)r(i)}}var Dn=n(5987);var Nn=V.gg,On=V.ym,Ln=V._E;function Bn(e){return(0,g.P)((function(){if(j.Z.debug("Init: Trying to call endOfStream"),"open"!==e.readyState)return j.Z.debug("Init: MediaSource not open, cancel endOfStream"),(0,p.of)(null);var t=e.sourceBuffers,n=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(t);if(0===n.length)return j.Z.info("Init: Triggering end of stream"),e.endOfStream(),(0,p.of)(null);j.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var r,i=n.map((function(e){return Ln(e).pipe((0,a.q)(1))}));return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Cn(e)).length?(0,Bt.Xf)(e[0]):new v.y(Pn(e))}(B.T.apply(void 0,i).pipe((r=1,r<=0?function(){return U.E}:(0,l.e)((function(e,t){var n=[];e.subscribe((0,c.x)(t,(function(e){n.push(e),r<n.length&&n.shift()}),(function(){var e,r;try{for(var i=(0,Dn.XA)(n),a=i.next();!a.done;a=i.next()){var o=a.value;t.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t.complete()}),void 0,(function(){n=null})))})))),Nn(t).pipe((0,a.q)(1))).pipe((0,h.z)((function(){return Bn(e)})))}))}var Un=n(7920),Fn=n(6625),zn=n(2401),Vn=n(7991);function Kn(e,t){return void 0===e&&(e=0),void 0===t&&(t=Vn.z),e<0&&(e=0),(0,Fn.H)(e,e,t)}var Gn=31536e3,Hn=function(){function e(e,t){var n=this;this._lastKnownDuration=(0,oe.ZP)(void 0),this._subscription=function(e){return(0,B.T)((0,V.ym)(e).pipe((0,s.U)((function(){return!0}))),(0,V.ep)(e).pipe((0,s.U)((function(){return!1}))),(0,V.UG)(e).pipe((0,s.U)((function(){return!1})))).pipe((0,N.O)("open"===e.readyState),d())}(t).pipe((0,L.w)((function(t){return t?C([n._lastKnownDuration.asObservable(),(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null))]):U.E})),(0,L.w)((function(n){var r=n[0];return function(e){if(0===e.length)return(0,p.of)(!1);for(var t=[],n=function(n){var r=e[n];t.push((0,B.T)((0,zn.R)(r,"updatestart").pipe((0,s.U)((function(){return!0}))),(0,zn.R)(r,"update").pipe((0,s.U)((function(){return!1}))),Kn(500).pipe((0,s.U)((function(){return r.updating})))).pipe((0,N.O)(r.updating),d()))},r=0;r<e.length;r++)n(r);return C(t).pipe((0,s.U)((function(e){return e.some((function(e){return e}))})),d())}(t.sourceBuffers).pipe((0,L.w)((function(n){return n?U.E:function n(){if("success"===function(e,t,n){var r,i=n;if(void 0===i)if(t.isDynamic){var a=null!==(r=t.getLivePosition())&&void 0!==r?r:t.getMaximumSafePosition();i=Math.max(Math.pow(2,32),a+Gn)}else i=t.getMaximumSafePosition();for(var o=0,s=0;s<e.sourceBuffers.length;s++){var u=e.sourceBuffers[s],l=u.buffered.length;l>0&&(o=Math.max(u.buffered.end(l-1)))}if(i===e.duration)return"success";if(o>i){if(o<e.duration)try{j.Z.info("Init: Updating duration to what is currently buffered",o),e.duration=i}catch(e){return j.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var c=e.duration;try{j.Z.info("Init: Updating duration",i),e.duration=i}catch(e){return j.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var d=Math.abs(e.duration-i);return d>=.1?d<Math.abs(e.duration-c)?"partial":"failed":"success"}(t,e,r))return U.E;return(0,Fn.H)(2e3).pipe((0,h.z)((function(){return n()})))}()})))}))).subscribe()}var t=e.prototype;return t.updateKnownDuration=function(e){this._lastKnownDuration.setValue(e)},t.stop=function(){this._subscription.unsubscribe()},e}();var Wn=n(342);var jn=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var qn=function(e,t){for(var n=[],r=t.periods,i=0;i<r.length;i++){r[i].streamEvents.forEach((function(t){for(var r=t.start,i=t.end,a=t.id,o=t.data,s=0;s<e.length;s++){var u=e[s];if(jn(u,{id:a,start:r,end:i}))return void n.push(u)}if(void 0===i){var l={start:r,id:a,data:o,publicEvent:{start:r,data:o}};n.push(l)}else{var c={start:r,end:i,id:a,data:o,publicEvent:{start:r,end:i,data:o}};n.push(c)}}))}return n};function Yn(e){return void 0!==e.end}var Xn=function(e,t,n){var r=new WeakMap,i=[];return(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null),(0,Tn.R)((function(t){return qn(t,e)}),[])).pipe((0,z.b)((function(e){return i=e})),(0,s.U)((function(e){return e.length>0})),d(),(0,L.w)((function(e){return e?C([Kn(Y.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL).pipe((0,N.O)(null)),n]).pipe((0,s.U)((function(e){e[0];return{isSeeking:e[1].seeking,currentTime:t.currentTime}})),(0,l.e)((function(e,t){var n,r=!1;e.subscribe((0,c.x)(t,(function(e){var i=n;n=e,r&&t.next([i,e]),r=!0})))})),(0,h.z)((function(e){var t=e[0],n=e[1];return function(e,t,n){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var c=e[l],d=c.start,f=Yn(c)?c.end:void 0;r.has(c)?(d>o||void 0!==f&&o>=f)&&(Yn(c)&&u.push(c.publicEvent),r.delete(c)):d<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:c.publicEvent}),r.set(c,!0)):i<d&&o>=(null!=f?f:d)&&(a?s.push({type:"stream-event-skip",value:c.publicEvent}):(s.push({type:"stream-event",value:c.publicEvent}),Yn(c)&&u.push(c.publicEvent)))}return(0,O.z)(s.length>0?p.of.apply(void 0,s):U.E,u.length>0?p.of.apply(void 0,u).pipe((0,z.b)((function(e){"function"==typeof e.onExit&&e.onExit()})),(0,Be.l)()):U.E)}(i,t,n)}))):U.E})))},$n=Xn;function Qn(e){var t=e.mediaElement,n=e.manifest,r=e.speed,a=e.bufferOptions,u=e.representationEstimator,l=e.playbackObserver,c=e.segmentFetcherCreator;return function(e,f,v){var m,g=new Hn(n,e),y=null!==(m=n.getPeriodForTime(f))&&void 0!==m?m:n.getNextPeriod(f);if(void 0===y){var _=new X.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return(0,It._)((function(){return _}))}var T=new Lt(t,e),E=(0,Un.Z)({mediaElement:t,playbackObserver:l,startTime:f,mustAutoPlay:v}),S=E.seekAndPlay$,w=E.initialPlayPerformed,k=E.initialSeekPerformed,A=l.getReference().asObservable(),x=w.asObservable().pipe((0,b.h)((function(e){return e})),(0,h.z)((function(){return $n(n,t,A)}))),I=function(e,t,n){var r=n.autoPlay,i=n.initialPlayPerformed,a=n.initialSeekPerformed,o=n.speed,s=n.startTime;return t.deriveReadOnlyObserver((function(t,n){var u=(0,oe.ZP)(l());return o.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),t.onUpdate(c,{clearSignal:n,emitCurrentValue:!1}),n.register((function(){u.finish()})),u;function l(){var n,u=t.getValue(),l=o.getValue();if(a.getValue()){if(!e.isDynamic||e.isLastPeriodKnown){var c=e.periods[e.periods.length-1];void 0!==c&&void 0!==c.end&&u.position>c.end&&(n=c.end-1)}}else n=s;return{maximumPosition:e.getMaximumSafePosition(),position:{last:u.position,pending:n},duration:u.duration,paused:{last:u.paused,pending:i.getValue()||!r===u.paused?void 0:!r},readyState:u.readyState,speed:l}}function c(){u.setValue(l())}}))}(n,l,{autoPlay:v,initialPlayPerformed:w,initialSeekPerformed:k,speed:r,startTime:f}),Z=new i.x,R=new i.x,M=new i.x,C=(0,oe.ZP)(null),P=An({manifest:n,initialPeriod:y},I,u,T,c,a).pipe((0,h.z)((function(t){switch(t.type){case"end-of-stream":return j.Z.debug("Init: end-of-stream order received."),function(e){return On(e).pipe((0,N.O)(null),(0,L.w)((function(){return Bn(e)})))}(e).pipe((0,Be.l)(),(0,o.R)(Z));case"resume-stream":return j.Z.debug("Init: resume-stream order received."),Z.next(null),U.E;case"stream-status":var n=t.value,r=n.period,i=n.bufferType,a=n.imminentDiscontinuity,s=n.position;return R.next({period:r,bufferType:i,discontinuity:a,position:s}),U.E;case"locked-stream":return M.next(t.value),U.E;case"adaptationChange":return C.setValue(t),(0,p.of)(t);default:return(0,p.of)(t)}}))),D=function(e,t,n){var r=new xn(e),i=n.getReference().asObservable().pipe((0,Fe.Z)((function(t){var n,i=t.position,a=null!==(n=i.pending)&&void 0!==n?n:i.last;if(a<e.getMinimumSafePosition()){var o=new X.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");return At.Z.warning(o)}if(a>r.getMaximumAvailablePosition()){var s=new X.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");return At.Z.warning(s)}return null}),null)),a=(0,oe.ZP)(void 0),o=(0,ne.R)(e,"manifestUpdate").pipe((0,N.O)(null),(0,z.b)((function(){var t=e.isDynamic?r.getEndingPosition():r.getMaximumAvailablePosition();a.setValue(t)})),(0,Be.l)()),u=t.asObservable().pipe((0,z.b)((function(t){if(null!==t&&e.isLastPeriodKnown){var n=e.periods[e.periods.length-1];if(t.value.period.id===(null==n?void 0:n.id)&&("audio"===t.value.type||"video"===t.value.type)){"audio"===t.value.type?r.updateLastAudioAdaptation(t.value.adaptation):r.updateLastVideoAdaptation(t.value.adaptation);var i=e.isDynamic?r.getMaximumAvailablePosition():r.getEndingPosition();a.setValue(i)}}})),(0,Be.l)());return(0,B.T)(o,u,i,a.asObservable().pipe(F((function(e){return void 0===e})),d(),(0,s.U)((function(e){return{type:"contentDurationUpdate",value:e}}))))}(n,C,I).pipe((0,h.z)((function(e){return"contentDurationUpdate"===e.type?(j.Z.debug("Init: Duration has to be updated.",e.value),g.updateKnownDuration(e.value),U.E):(0,p.of)(e)}))),O=(0,Wn.Z)(l,n,r,M,R),V=S.pipe((0,L.w)((function(e){return"warning"===e.type?(0,p.of)(e):(0,Rn.Z)(A,t,T,!1)})));return(0,B.T)(V,O,P,D,x).pipe((0,Le.x)((function(){g.stop(),T.disposeAll()})))}}function Jn(e){var t,n,r=e.initialManifest,i=e.manifestFetcher,o=e.minimumManifestUpdateInterval,u=e.scheduleRefresh$,l=(t=function(e,t){return i.fetch(e).pipe((0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):e.parse(t)})),(0,T.B)())},n=!1,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return new v.y((function(e){if(!n){n=!0;var i=t.apply(void 0,r).subscribe({next:function(t){e.next(t)},error:function(t){n=!1,e.error(t)},complete:function(){n=!1,e.complete()}});return function(){i.unsubscribe(),n=!1}}e.complete()}))}),c=r.manifest,d=0;return(0,g.P)((function(){return f(r)}));function f(e){var t=e.sendingTime,n=e.parsingTime,r=e.updatingTime,i=void 0!==n?n+(null!=r?r:0):void 0,l=Y.Z.getCurrent(),v=l.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,g=l.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,y=d>0?d<v:void 0!==i&&i>=g,_=void 0===t?0:performance.now()-t,b=Math.max(o-_,0),T=u.pipe((0,h.z)((function(e){var n=e.completeRefresh,r=e.delay,i=e.canUseUnsafeMode&&y;return er(null!=r?r:0,o,t).pipe((0,s.U)((function(){return{completeRefresh:n,unsafeMode:i}})))}))),E=null===c.expired?U.E:(0,Fn.H)(b).pipe((0,h.z)((function(){return null===c.expired?U.E:(0,x.D)(c.expired)})),(0,s.U)((function(){return{completeRefresh:!0,unsafeMode:y}}))),S=function(){if(void 0===c.lifetime||c.lifetime<0)return U.E;var e,t=1e3*c.lifetime-_;void 0===i?e=t:c.lifetime<3&&i>=100?(e=Math.min(Math.max(3e3-_,Math.max(t,0)+i),6*t),j.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",t,e)):i>=1e3*c.lifetime/10?(e=Math.min(Math.max(t,0)+i,6*t),j.Z.info("MUS: Manifest took too long to parse. Postponing next request",e,e)):e=t;return(0,Fn.H)(Math.max(e,b)).pipe((0,s.U)((function(){return{completeRefresh:!1,unsafeMode:y}})))}();return(0,B.T)(S,T,E).pipe((0,a.q)(1),(0,h.z)((function(e){return m({completeRefresh:e.completeRefresh,unsafeMode:e.unsafeMode})})),(0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):f(e)})))}function m(e){var t=e.completeRefresh,n=e.unsafeMode,r=c.updateUrl,i=t||void 0===r,a=i?c.getUrl():r,s=c.clockOffset;return n?(d+=1,j.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(d)+" consecutive time.")):d>0&&(j.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(d)+" consecutive times."),d=0),l(a,{externalClockOffset:s,previousManifest:c,unsafeMode:n}).pipe((0,h.z)((function(e){if("warning"===e.type)return(0,p.of)(e);var t=e.manifest,n=e.sendingTime,r=e.receivedTime,a=e.parsingTime,s=performance.now();if(i)c.replace(t);else try{c.update(t)}catch(e){var u=e instanceof Error?e.message:"unknown error";return j.Z.warn("MUS: Attempt to update Manifest failed: "+u,"Re-downloading the Manifest fully"),er(Y.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,o,n).pipe((0,h.z)((function(){return m({completeRefresh:!0,unsafeMode:!1})})))}return(0,p.of)({type:"parsed",manifest:c,sendingTime:n,receivedTime:r,parsingTime:a,updatingTime:performance.now()-s})})))}}function er(e,t,n){return(0,g.P)((function(){var r=void 0===n?0:performance.now()-n,i=Math.max(t-r,0);return(0,Fn.H)(Math.max(e-r,i))}))}var tr=n(2447);var nr=function(e){var t=e.adaptiveOptions,n=e.autoPlay,r=e.bufferOptions,u=e.keySystems,l=e.lowLatencyMode,c=e.manifest$,d=e.manifestFetcher,f=e.mediaElement,v=e.minimumManifestUpdateInterval,g=e.playbackObserver,y=e.segmentRequestOptions,_=e.speed,E=e.startAt,S=e.transport,w=e.textTrackOptions,k=ot(t),A=new se.ZP,x=kt(f).pipe((0,m.d)({refCount:!0})),I=new i.x,Z=(0,xt.Z)(f,u,I,x).pipe((0,Ue.Z)(),(0,T.B)()),R=(0,tr.Z)(f),M=C([c,Z.pipe((0,b.h)((function(e){return"decryption-ready"===e.type||"decryption-disabled"===e.type})),(0,s.U)((function(e){return e.value})),(0,a.q)(1))]).pipe((0,h.z)((function(e){var t=e[0],a=e[1],u=a.drmSystemId,c=a.mediaSource;if("warning"===t.type)return(0,p.of)(t);var m=t.manifest;j.Z.debug("Init: Calculating initial time");var b=function(e,t,n){if(!(0,re.Z)(n)){var r,i=e.getMinimumSafePosition();if(e.isLive&&(r=e.getLivePosition()),void 0===r&&(r=e.getMaximumSafePosition()),!(0,re.Z)(n.position))return j.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,r),i);if(!(0,re.Z)(n.wallClockTime)){j.Z.debug("Init: using startAt.wallClockTime");var a=void 0===e.availabilityStartTime?0:e.availabilityStartTime,o=n.wallClockTime-a;return Math.max(Math.min(o,r),i)}if(!(0,re.Z)(n.fromFirstPosition)){j.Z.debug("Init: using startAt.fromFirstPosition");var s=n.fromFirstPosition;return s<=0?i:Math.min(r,i+s)}if(!(0,re.Z)(n.fromLastPosition)){j.Z.debug("Init: using startAt.fromLastPosition");var u=n.fromLastPosition;return u>=0?r:Math.max(i,r+u)}if(!(0,re.Z)(n.percentage)){j.Z.debug("Init: using startAt.percentage");var l=n.percentage;return l>100?r:l<0?i:i+ +l/100*(r-i)}}var c=e.getMinimumSafePosition();if(e.isLive){var d,f=e.suggestedPresentationDelay,v=e.clockOffset,p=e.getMaximumSafePosition(),h=Y.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===v)j.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),d=p;else{j.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var m=void 0===e.availabilityStartTime?0:e.availabilityStartTime,g=(performance.now()+v)/1e3-m;d=Math.min(p,g)}var y=void 0!==f?f:t?h.LOW_LATENCY:h.DEFAULT;return j.Z.debug("Init: "+d+" defined as the live time, applying a live gap of "+y),Math.max(d-y,c)}return j.Z.info("Init: starting at the minimum available position:",c),c}(m,l,E);j.Z.debug("Init: Initial time calculated:",b);var T={lowLatencyMode:l,requestTimeout:y.requestTimeout,maxRetryRegular:y.regularError,maxRetryOffline:y.offlineError},x=new _t(S,T,A.signal),Z=Qn({bufferOptions:(0,ie.Z)({textTrackOptions:w,drmSystemId:u},r),manifest:m,mediaElement:f,playbackObserver:g,representationEstimator:k,segmentFetcherCreator:x,speed:_}),R=function e(t,n,r){var a=new i.x,s=Z(t,n,r).pipe((0,Fe.Z)((function(e){switch(e.type){case"needs-manifest-refresh":return M.next({completeRefresh:!1,canUseUnsafeMode:!0}),null;case"manifest-might-be-out-of-sync":var t=Y.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;return M.next({completeRefresh:!0,canUseUnsafeMode:!1,delay:t}),null;case"needs-media-source-reload":return a.next(e.value),null;case"needs-decipherability-flush":var n=me(f);if(null===(i=n)||i.indexOf("widevine")<0)return a.next(e.value),null;var r=e.value.position;return r+.001<e.value.duration?g.setCurrentTime(f.currentTime+.001):g.setCurrentTime(r),null;case"encryption-data-encountered":return I.next(e.value),null;case"needs-buffer-flush":return g.setCurrentTime(f.currentTime+.001),null}var i;return e}),null)).pipe((0,o.R)(a)),u=a.pipe((0,L.w)((function(t){return kt(f).pipe((0,h.z)((function(n){return e(n,t.position,t.autoPlay)})),(0,N.O)(At.Z.reloadingMediaSource()))})));return(0,B.T)(u,s)}(c,b,n),M=new i.x,C=Jn({initialManifest:t,manifestFetcher:d,minimumManifestUpdateInterval:v,scheduleRefresh$:M}),P=(0,B.T)((0,ne.R)(m,"manifestUpdate").pipe((0,s.U)((function(){return At.Z.manifestUpdate()}))),(0,ne.R)(m,"decipherabilityUpdate").pipe((0,s.U)(At.Z.decipherabilityUpdate)));return(0,B.T)(P,C,R).pipe((0,N.O)(At.Z.manifestReady(m)),(0,Le.x)((function(){M.complete()})))})));return(0,B.T)(M,R,Z.pipe((0,Be.l)())).pipe((0,Le.x)((function(){A.cancel()})))},rr=n(5553);function ir(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ar(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var or=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],sr=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new se.ZP,this._observationRef=this._createSharedReference()}var t=e.prototype;return t.stop=function(){this._canceller.cancel()},t.getCurrentTime=function(){return this._mediaElement.currentTime},t.getPlaybackRate=function(){return this._mediaElement.playbackRate},t.getIsPaused=function(){return this._mediaElement.paused},t.setCurrentTime=function(e){this._internalSeeksIncoming.push(e),this._mediaElement.currentTime=e},t.setPlaybackRate=function(e){this._mediaElement.playbackRate=e},t.getReadyState=function(){return this._mediaElement.readyState},t.getReference=function(){return this._observationRef},t.listen=function(e,t){var n;if(this._canceller.isUsed||!0===(null===(n=null==t?void 0:t.clearSignal)||void 0===n?void 0:n.isCancelled))return Ae.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return cr(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=Y.Z.getCurrent(),r=n.SAMPLING_INTERVAL_MEDIASOURCE,i=n.SAMPLING_INTERVAL_LOW_LATENCY,a=n.SAMPLING_INTERVAL_NO_MEDIASOURCE,o=function(n){var r,i=n;"seeking"===i&&t._internalSeeksIncoming.length>0&&(i="internal-seeking",r=t._internalSeeksIncoming.shift());var a=null!=e?e:t._generateInitialObservation(),o=lr(t._mediaElement,i,t._withMediaSource),s=null;o.seeking&&("number"==typeof r?s=r:null!==a.pendingInternalSeek&&"seeking"!==n&&(s=a.pendingInternalSeek));var u=function(e,t,n){var r,i,a=n.withMediaSource,o=n.lowLatencyMode,s=Y.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,c=t.bufferGap,d=t.currentRange,f=t.duration,v=t.paused,p=t.readyState,h=t.ended,m=e.rebuffering,g=e.event,y=e.position,_=function(e,t,n,r,i){var a=Y.Z.getCurrent().REBUFFERING_GAP,o=i?"LOW_LATENCY":"DEFAULT";if(void 0===t)return n&&Math.abs(r-e)<=a[o];return null!==t&&r-t.end<=a[o]}(l,d,h,f,o),b=p>=1&&"loadedmetadata"!==u&&null===m&&!(_||h),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(b)c===1/0?(r=!0,T=l):void 0===c?p<3&&(r=!0,T=void 0):c<=E&&(r=!0,T=l+c);else if(null!==m){var S=ur(m,o);!0!==r&&null!==m&&p>1&&(_||h||void 0!==c&&isFinite(c)&&c>S)||void 0===c&&p>=3?i=!0:void 0===c?T=void 0:c===1/0?T=l:c<=S&&(T=l+c)}}else b&&(!v&&"timeupdate"===u&&"timeupdate"===g&&l===y||"seeking"===u&&(c===1/0||void 0===c&&p<3))?r=!0:null!==m&&("seeking"!==u&&l!==y||"canplay"===u||void 0===c&&p>=3||void 0!==c&&c<1/0&&(c>ur(m,o)||_||h))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==m)return w="seeking"===u||null!==m&&"seeking"===m.reason||t.seeking?"seeking":1===p?"not-ready":"buffering",null!==m&&m.reason===w?{reason:m.reason,timestamp:m.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),l=function(e,t){var n=Y.Z.getCurrent().MINIMUM_BUFFER_AMOUNT_BEFORE_FREEZING;if(e.freezing)return t.ended||t.paused||0===t.readyState||0===t.playbackRate||e.position!==t.position?null:e.freezing;return"timeupdate"===t.event&&void 0!==t.bufferGap&&t.bufferGap>n&&!t.ended&&!t.paused&&t.readyState>=1&&0!==t.playbackRate&&t.position===e.position?{timestamp:performance.now()}:null}(a,o),c=(0,ie.Z)({},{rebuffering:u,freezing:l,pendingInternalSeek:s},o);return j.Z.hasLevel("DEBUG")&&j.Z.debug("API: current media element state tick","event",c.event,"position",c.position,"seeking",c.seeking,"internalSeek",c.pendingInternalSeek,"rebuffering",null!==c.rebuffering,"freezing",null!==c.freezing,"ended",c.ended,"paused",c.paused,"playbackRate",c.playbackRate,"readyState",c.readyState),c},s=(0,oe.ZP)(o("init")),u=function(t){var n=o(t);j.Z.hasLevel("DEBUG")&&j.Z.debug("API: current playback timeline:\n"+function(e,t){for(var n="",r="",i=0;i<e.length;i++){var a=e.start(i),o=e.end(i),s=a.toFixed(2),u=o.toFixed(2),l=s+"|=="+(o-a).toFixed(2)+"==|"+u;if(n+=l,0===r.length&&o>t){var c=n.length-Math.floor(l.length/2);r=" ".repeat(c)+"^"+t}if(i<e.length-1){var d=e.start(i+1),f=" ~"+(d-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<d){var v=n.length-Math.floor(f.length/2);r=" ".repeat(v)+"^"+t}}}0===r.length&&(r=" ".repeat(n.length)+"^"+t);return n+"\n"+r}(n.buffered,n.position),"\n"+t),e=n,s.setValue(n)},l=this._lowLatencyMode?i:this._withMediaSource?r:a,c=setInterval(f,l),d=or.map((function(e){function n(){clearInterval(c),c=setInterval(f,l),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(c),d.forEach((function(e){return e()})),s.finish()})),s;function f(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,ie.Z)(lr(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function ur(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=Y.Z.getCurrent(),i=r.RESUME_GAP_AFTER_SEEKING,a=r.RESUME_GAP_AFTER_NOT_ENOUGH_DATA,o=r.RESUME_GAP_AFTER_BUFFERING;switch(e.reason){case"seeking":return i[n];case"not-ready":return a[n];case"buffering":return o[n]}}function lr(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,c=e.playbackRate,d=e.readyState,f=e.seeking;return!n&&0===a.length&&d>=3?(r=void 0,i=void 0):i=null!==(r=(0,ae.rx)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:c,readyState:d,seeking:f,event:t}}function cr(e,t,n){var r=t(e.getReference(),n);return{getCurrentTime:function(){return e.getCurrentTime()},getReadyState:function(){return e.getReadyState()},getPlaybackRate:function(){return e.getPlaybackRate()},getIsPaused:function(){return e.getIsPaused()},getReference:function(){return r},listen:function(e,t){var i;n.isCancelled||!0===(null===(i=null==t?void 0:t.clearSignal)||void 0===i?void 0:i.isCancelled)||r.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},deriveReadOnlyObserver:function(e){return cr(this,e,n)}}}var dr=n(7829);function fr(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,dr.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function vr(e){return e.map((function(e){return null===e?e:{normalized:(0,dr.ZP)(e.language),closedCaption:e.closedCaption}}))}var pr=function(){function e(e){this._periods=new Gt((function(e,t){return e.period.start-t.period.start})),this._audioChoiceMemory=new WeakMap,this._textChoiceMemory=new WeakMap,this._videoChoiceMemory=new WeakMap,this._preferredAudioTracks=[],this._preferredTextTracks=[],this._preferredVideoTracks=[],this.trickModeTrackEnabled=e.preferTrickModeTracks}var t=e.prototype;return t.setPreferredAudioTracks=function(e,t){this._preferredAudioTracks=e,t&&this._applyAudioPreferences()},t.setPreferredTextTracks=function(e,t){this._preferredTextTracks=e,t&&this._applyTextPreferences()},t.setPreferredVideoTracks=function(e,t){this._preferredVideoTracks=e,t&&this._applyVideoPreferences()},t.addPeriod=function(e,t,n){var r=Tr(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void j.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptation$:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptation$:n},a))}},t.removePeriod=function(e,t){var n=function(e,t){for(var n=0;n<e.length();n++){if(e.get(n).period.id===t.id)return n}}(this._periods,t);if(void 0!==n){var r=this._periods.get(n);void 0!==r[e]?(delete r[e],void 0===r.audio&&void 0===r.text&&void 0===r.video&&this._periods.removeElement(r)):j.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else j.Z.warn("TrackChoiceManager: "+e+" not found for period",t.start)},t.resetPeriods=function(){for(;this._periods.length()>0;)this._periods.pop()},t.update=function(){this._resetChosenAudioTracks(),this._resetChosenTextTracks(),this._resetChosenVideoTracks()},t.setInitialAudioTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("audio"),i=this._audioChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,ft.Z)(r,i))n.adaptation$.next(i);else{var a=mr(r,fr(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r=e.getSupportedAdaptations("text"),i=this._textChoiceMemory.get(e);if(null===i)n.adaptation$.next(null);else if(void 0!==i&&(0,ft.Z)(r,i))n.adaptation$.next(i);else{var a=yr(r,vr(this._preferredTextTracks));this._textChoiceMemory.set(e,a),n.adaptation$.next(a)}},t.setInitialVideoTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.video:null;if((0,re.Z)(n)||void 0===t)throw new Error("TrackChoiceManager: Given Period not found.");var r,i=e.getSupportedAdaptations("video"),a=this._videoChoiceMemory.get(e);if(null===a)r=null;else if(void 0!==a&&(0,ft.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=br(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptation$.next(null);var o=wr(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptation$.next(o)},t.setAudioTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.audio:null;if((0,re.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Audio Track not found.");this._audioChoiceMemory.get(e)!==i&&(this._audioChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setTextTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.text:null;if((0,re.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Text Track not found.");this._textChoiceMemory.get(e)!==i&&(this._textChoiceMemory.set(e,i),r.adaptation$.next(i))},t.setVideoTrackByID=function(e,t){var n=Tr(this._periods,e),r=void 0!==n?n.video:null;if((0,re.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,He.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=wr(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptation$.next(a)},t.disableTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrack=function(e){var t=Tr(this._periods,e),n=null==t?void 0:t.video;if(void 0===n)throw new Error("TrackManager: Given Period not found.");null!==this._videoChoiceMemory.get(e)&&(this._videoChoiceMemory.set(e,null),n.adaptation$.next(null))},t.disableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!1,this._resetChosenVideoTracks()},t.enableVideoTrickModeTracks=function(){this.trickModeTrackEnabled=!0,this._resetChosenVideoTracks()},t.isTrickModeEnabled=function(){return this.trickModeTrackEnabled},t.getChosenAudioTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n))return null;var r=this._audioChoiceMemory.get(e);if((0,re.Z)(r))return null;var i={language:(0,ze.Z)(r.language,""),normalized:(0,ze.Z)(r.normalizedLanguage,""),audioDescription:!0===r.isAudioDescription,id:r.id,representations:r.representations.map(Sr),label:r.label};return!0===r.isDub&&(i.dub=!0),i},t.getChosenTextTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,re.Z)(r)?null:{language:(0,ze.Z)(r.language,""),normalized:(0,ze.Z)(r.normalizedLanguage,""),closedCaption:!0===r.isClosedCaption,id:r.id,label:r.label}},t.getChosenVideoTrack=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.video:null;if((0,re.Z)(n))return null;var r=this._videoChoiceMemory.get(e);if((0,re.Z)(r))return null;var i=r.adaptation,a=void 0!==i.trickModeTracks?i.trickModeTracks.map((function(e){var t=e.representations.map(Er),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,o={id:i.id,representations:i.representations.map(Er),label:i.label};return!0===i.isSignInterpreted&&(o.signInterpreted=!0),!0===i.isTrickModeTrack&&(o.isTrickModeTrack=!0),void 0!==a&&(o.trickModeTracks=a),o},t.getAvailableAudioTracks=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.audio:null;if((0,re.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,re.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t={language:(0,ze.Z)(e.language,""),normalized:(0,ze.Z)(e.normalizedLanguage,""),audioDescription:!0===e.isAudioDescription,id:e.id,active:null!==i&&i===e.id,representations:e.representations.map(Sr),label:e.label};return!0===e.isDub&&(t.dub=!0),t}))},t.getAvailableTextTracks=function(e){var t=Tr(this._periods,e),n=void 0!==t?t.text:null;if((0,re.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,re.Z)(r)?null:r.id;return n.adaptations.map((function(e){return{language:(0,ze.Z)(e.language,""),normalized:(0,ze.Z)(e.normalizedLanguage,""),closedCaption:!0===e.isClosedCaption,id:e.id,active:null!==i&&i===e.id,label:e.label}}))},t.getAvailableVideoTracks=function(e){var t,n=Tr(this._periods,e),r=void 0!==n?n.video:null;if((0,re.Z)(r))return[];var i=this._videoChoiceMemory.get(e),a=void 0===i?void 0:null!==(t=null==i?void 0:i.adaptation.id)&&void 0!==t?t:void 0;return r.adaptations.map((function(e){var t=void 0!==e.trickModeTracks?e.trickModeTracks.map((function(e){var t=null!==a&&a===e.id,n=e.representations.map(Er),r={id:e.id,representations:n,isTrickModeTrack:!0,active:t};return!0===e.isSignInterpreted&&(r.signInterpreted=!0),r})):void 0,n={id:e.id,active:null!==a&&a===e.id,representations:e.representations.map(Er),label:e.label};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),void 0!==t&&(n.trickModeTracks=t),n}))},t._applyAudioPreferences=function(){this._audioChoiceMemory=new WeakMap,this._resetChosenAudioTracks()},t._applyTextPreferences=function(){this._textChoiceMemory=new WeakMap,this._resetChosenTextTracks()},t._applyVideoPreferences=function(){this._videoChoiceMemory=new WeakMap,this._resetChosenVideoTracks()},t._resetChosenAudioTracks=function(){var e=this,t=fr(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.audio))n(r+1);else{var a=i.period,o=i.audio,s=a.getSupportedAdaptations("audio"),u=e._audioChoiceMemory.get(a);if(null===u||void 0!==u&&(0,ft.Z)(s,u))n(r+1);else{var l=mr(s,t);e._audioChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=vr(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.text))n(r+1);else{var a=i.period,o=i.text,s=a.getSupportedAdaptations("text"),u=e._textChoiceMemory.get(a);if(null===u||void 0!==u&&(0,ft.Z)(s,u))n(r+1);else{var l=yr(s,t);e._textChoiceMemory.set(a,l),o.adaptation$.next(l),n(0)}}}}(0)},t._resetChosenVideoTracks=function(){var e=this,t=this._preferredVideoTracks;!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,re.Z)(i.video))n(r+1);else{var a=i.period,o=i.video,s=a.getSupportedAdaptations("video"),u=e._videoChoiceMemory.get(a);if(null!==u){if(void 0!==u&&(0,ft.Z)(s,u.baseAdaptation)){var l=wr(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptation$.next(l),n(0))}var c=br(s,t);if(null===c)return e._videoChoiceMemory.set(a,null),o.adaptation$.next(null),n(0);var d=wr(c,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:c,adaptation:d}),o.adaptation$.next(d),n(0)}n(r+1)}}}(0)},e}();function hr(e){return function(t){var n;if(void 0!==e.normalized&&(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")!==e.normalized)return!1;if(void 0!==e.audioDescription)if(e.audioDescription){if(!0!==t.isAudioDescription)return!1}else if(!0===t.isAudioDescription)return!1;if(void 0===e.codec)return!0;var r=e.codec.test,i=function(e){return void 0!==e.codec&&r.test(e.codec)};return e.codec.all?t.representations.every(i):t.representations.some(i)}}function mr(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=hr(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return e[0]}function gr(e){return function(t){return(0,ze.Z)(t.normalizedLanguage,"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)}}function yr(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=gr(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return null}function _r(e){return function(t){if(void 0!==e.signInterpreted&&e.signInterpreted!==t.isSignInterpreted)return!1;if(void 0===e.codec)return!0;var n=e.codec.test,r=function(e){return void 0!==e.codec&&n.test(e.codec)};return e.codec.all?t.representations.every(r):t.representations.some(r)}}function br(e,t){if(0===e.length)return null;for(var n=0;n<t.length;n++){var r=t[n];if(null===r)return null;var i=_r(r),a=(0,He.Z)(e,i);if(void 0!==a)return a}return e[0]}function Tr(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function Er(e){return{id:e.id,bitrate:e.bitrate,frameRate:e.frameRate,width:e.width,height:e.height,codec:e.codec,hdrInfo:e.hdrInfo}}function Sr(e){return{id:e.id,bitrate:e.bitrate,codec:e.codec}}function wr(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}var kr=V.XR,Ar=V.w0,xr=V.it,Ir=V.O0,Zr=V.Q1,Rr=V.UA,Mr=function(n){function r(e){var t;void 0===e&&(e={}),t=n.call(this)||this;var r=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p,h,m,g=Y.Z.getCurrent(),y=g.DEFAULT_INITIAL_BITRATES,_=g.DEFAULT_LIMIT_VIDEO_WIDTH,b=g.DEFAULT_MIN_BITRATES,T=g.DEFAULT_MAX_BITRATES,E=g.DEFAULT_MAX_BUFFER_AHEAD,S=g.DEFAULT_MAX_BUFFER_BEHIND,w=g.DEFAULT_MAX_VIDEO_BUFFER_SIZE,k=g.DEFAULT_STOP_AT_END,A=g.DEFAULT_THROTTLE_WHEN_HIDDEN,x=g.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,I=g.DEFAULT_WANTED_BUFFER_AHEAD;if((0,re.Z)(e.maxBufferAhead))t=E;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,re.Z)(e.maxBufferBehind))n=S;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,re.Z)(e.wantedBufferAhead))r=I;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,re.Z)(e.maxVideoBufferSize))i=w;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var Z=(0,re.Z)(e.limitVideoWidth)?_:!!e.limitVideoWidth;if((0,re.Z)(e.throttleWhenHidden)?a=A:((0,ue.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,re.Z)(e.throttleVideoBitrateWhenHidden)?x:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,ue.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,ue.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,ue.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,re.Z)(e.videoElement))c=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");c=e.videoElement}if((0,re.Z)(e.initialVideoBitrate))d=y.video;else if(d=Number(e.initialVideoBitrate),isNaN(d))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,re.Z)(e.initialAudioBitrate))f=y.audio;else if(f=Number(e.initialAudioBitrate),isNaN(f))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,re.Z)(e.minVideoBitrate))p=b.video;else if(p=Number(e.minVideoBitrate),isNaN(p))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,re.Z)(e.minAudioBitrate))v=b.audio;else if(v=Number(e.minAudioBitrate),isNaN(v))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,re.Z)(e.maxVideoBitrate))m=T.video;else{if(m=Number(e.maxVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(p>m)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+m+'", is inferior to the set minVideoBitrate, "'+p+'"')}if((0,re.Z)(e.maxAudioBitrate))h=T.audio;else{if(h=Number(e.maxAudioBitrate),isNaN(h))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(v>h)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+h+'", is inferior to the set minAudioBitrate, "'+v+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:Z,videoElement:c,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:f,initialVideoBitrate:d,minAudioBitrate:v,minVideoBitrate:p,maxAudioBitrate:h,maxVideoBitrate:m,stopAtEnd:(0,re.Z)(e.stopAtEnd)?k:!!e.stopAtEnd}}(e),u=r.initialAudioBitrate,l=r.initialVideoBitrate,c=r.limitVideoWidth,f=r.minAudioBitrate,v=r.minVideoBitrate,p=r.maxAudioBitrate,h=r.maxBufferAhead,m=r.maxBufferBehind,g=r.maxVideoBitrate,y=r.preferredAudioTracks,_=r.preferredTextTracks,b=r.preferredVideoTracks,T=r.throttleWhenHidden,E=r.throttleVideoBitrateWhenHidden,S=r.videoElement,w=r.wantedBufferAhead,k=r.maxVideoBufferSize,A=r.stopAtEnd,x=Y.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;S.preload="auto",t.version="3.29.0",t.log=j.Z,t.state="STOPPED",t.videoElement=S;var I=new se.ZP;return t._priv_destroy$=new i.x,t._priv_destroy$.pipe((0,a.q)(1)).subscribe((function(){I.cancel()})),t._priv_pictureInPictureRef=Ar(S,I.signal),Zr(S).pipe((0,o.R)(t._priv_destroy$)).subscribe((function(){return t.trigger("fullscreenChange",t.isFullscreen())})),Rr(S.textTracks).pipe((0,o.R)(t._priv_destroy$),(0,s.U)((function(e){for(var t=e.target,n=[],r=0;r<t.length;r++){var i=t[r];n.push(i)}return n})),d((function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}))).subscribe((function(e){return t._priv_onNativeTextTracksNext(e)})),t._priv_speed=(0,oe.ZP)(S.playbackRate),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=(0,oe.ZP)(!1),t._priv_bufferOptions={wantedBufferAhead:(0,oe.ZP)(w),maxBufferAhead:(0,oe.ZP)(h),maxBufferBehind:(0,oe.ZP)(m),maxVideoBufferSize:(0,oe.ZP)(k)},t._priv_bitrateInfos={lastBitrates:{audio:u,video:l},minAutoBitrates:{audio:(0,oe.ZP)(f),video:(0,oe.ZP)(v)},maxAutoBitrates:{audio:(0,oe.ZP)(p),video:(0,oe.ZP)(g)},manualBitrates:{audio:(0,oe.ZP)(-1),video:(0,oe.ZP)(-1)}},t._priv_throttleWhenHidden=T,t._priv_throttleVideoBitrateWhenHidden=E,t._priv_limitVideoWidth=c,t._priv_mutedMemory=x,t._priv_trackChoiceManager=null,t._priv_mediaElementTrackChoiceManager=null,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=A,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t}(0,t.Z)(r,n);var u=r.prototype;return u.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},u.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},u.dispose=function(){this.stop(),null!==this.videoElement&&pe(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";j.Z.error("API: Could not dispose decryption resources: "+t)})),this._priv_destroy$.next(),this._priv_destroy$.complete(),this._priv_speed.finish(),this._priv_contentLock.finish(),this._priv_bufferOptions.wantedBufferAhead.finish(),this._priv_bufferOptions.maxVideoBufferSize.finish(),this._priv_bufferOptions.maxBufferAhead.finish(),this._priv_bufferOptions.maxBufferBehind.finish(),this._priv_bitrateInfos.manualBitrates.video.finish(),this._priv_bitrateInfos.manualBitrates.audio.finish(),this._priv_bitrateInfos.minAutoBitrates.video.finish(),this._priv_bitrateInfos.minAutoBitrates.audio.finish(),this._priv_bitrateInfos.maxAutoBitrates.video.finish(),this._priv_bitrateInfos.maxAutoBitrates.audio.finish(),this._priv_reloadingMetadata={},this.videoElement=null},u.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,l,c,d,f,v,p=Y.Z.getCurrent(),h=p.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,m=p.DEFAULT_AUTO_PLAY,g=p.DEFAULT_CODEC_SWITCHING_BEHAVIOR,y=p.DEFAULT_ENABLE_FAST_SWITCHING,_=p.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,b=p.DEFAULT_SHOW_NATIVE_SUBTITLE,T=p.DEFAULT_TEXT_TRACK_MODE;if((0,re.Z)(e))throw new Error("No option set on loadVideo");if((0,re.Z)(e.url)){if((0,re.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,re.Z)(null===(n=e.transportOptions)||void 0===n?void 0:n.manifestLoader))throw new Error("Unable to load a content: no url set on loadVideo.\nPlease provide at least either an `url` argument, a `transportOptions.initialManifest` option or a `transportOptions.manifestLoader` option so the RxPlayer can load the content.")}else u=String(e.url);if((0,re.Z)(e.transport))throw new Error("No transport set on loadVideo");l=String(e.transport);var E=(0,re.Z)(e.autoPlay)?m:!!e.autoPlay;if((0,re.Z)(e.keySystems))c=[];else for(var S,w=ir(c=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(S=w()).done;){var k=S.value;if("string"!=typeof k.type||"function"!=typeof k.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback")}var A=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,x="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},I=null===(r=e.transportOptions)||void 0===r?void 0:r.initialManifest,Z=null!==(a=null===(i=e.transportOptions)||void 0===i?void 0:i.minimumManifestUpdateInterval)&&void 0!==a?a:0,R=(0,re.Z)(e.audioTrackSwitchingMode)?h:e.audioTrackSwitchingMode;(0,ft.Z)(["seamless","direct","reload"],R)||(j.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+h+" strategy will be used as default"),R=h);var M=(0,re.Z)(e.onCodecSwitch)?g:e.onCodecSwitch;(0,ft.Z)(["continue","reload"],M)||(j.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+g+" will be used as default"),M=g);var C=(0,ie.Z)({},x,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:A});if(delete C.initialManifest,delete C.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,ue.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var P,D=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],N=ir(D);!(P=N()).done;){var O=P.value;if("string"!=typeof O.language||"string"!=typeof O.mimeType||"string"!=typeof O.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}C.supplementaryTextTracks=D}if(void 0!==e.supplementaryImageTracks){(0,ue.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var L,B=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],U=ir(B);!(L=U()).done;){var F=L.value;if("string"!=typeof F.mimeType||"string"!=typeof F.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}C.supplementaryImageTracks=B}if((0,re.Z)(e.textTrackMode))d=T;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");d=e.textTrackMode}(0,re.Z)(e.defaultAudioTrack)||(0,ue.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var z=(0,rr.iH)(e.defaultAudioTrack);(0,re.Z)(e.defaultTextTrack)||(0,ue.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var V=(0,rr.Y1)(e.defaultTextTrack),K=!b;(0,re.Z)(e.hideNativeSubtitle)||((0,ue.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),K=!!e.hideNativeSubtitle);var G=null!==(o=e.manualBitrateSwitchingMode)&&void 0!==o?o:_,H=(0,re.Z)(e.enableFastSwitching)?y:e.enableFastSwitching;if("html"===d){if((0,re.Z)(e.textTrackElement))throw new Error('You have to provide a textTrackElement in "html" textTrackMode.');if(!(e.textTrackElement instanceof HTMLElement))throw new Error("textTrackElement should be an HTMLElement.");f=e.textTrackElement}else(0,re.Z)(e.textTrackElement)||j.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,re.Z)(e.startAt))if(e.startAt.wallClockTime instanceof Date){var W=e.startAt.wallClockTime.getTime()/1e3;v=(0,ie.Z)({},e.startAt,{wallClockTime:W})}else v=e.startAt;return{autoPlay:E,defaultAudioTrack:z,defaultTextTrack:V,enableFastSwitching:H,hideNativeSubtitle:K,keySystems:c,initialManifest:I,lowLatencyMode:A,manualBitrateSwitchingMode:G,audioTrackSwitchingMode:R,minimumManifestUpdateInterval:Z,networkConfig:null!==(s=e.networkConfig)&&void 0!==s?s:{},onCodecSwitch:M,startAt:v,textTrackElement:f,textTrackMode:d,transport:l,transportOptions:C,url:u}}(e);j.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t)},u.reload=function(e){var t,n,r,i,a=this._priv_reloadingMetadata,o=a.options,s=a.manifest,u=a.reloadPosition,l=a.reloadInPause;if(void 0===o)throw new Error("API: Can't reload without having previously loaded a content.");if(function(e){var t,n,r,i;if(null===e||"object"!=typeof e&&void 0!==e)throw new Error("API: reload - Invalid options format.");if(null===(null==e?void 0:e.reloadAt)||"object"!=typeof(null==e?void 0:e.reloadAt)&&void 0!==(null==e?void 0:e.reloadAt))throw new Error("API: reload - Invalid 'reloadAt' option format.");if("number"!=typeof(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position)&&void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.position))throw new Error("API: reload - Invalid 'reloadAt.position' option format.");if("number"!=typeof(null===(r=null==e?void 0:e.reloadAt)||void 0===r?void 0:r.relative)&&void 0!==(null===(i=null==e?void 0:e.reloadAt)||void 0===i?void 0:i.relative))throw new Error("API: reload - Invalid 'reloadAt.relative' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))r={position:e.reloadAt.position};else if(void 0!==(null===(n=null==e?void 0:e.reloadAt)||void 0===n?void 0:n.relative)){if(void 0===u)throw new Error("Can't reload to a relative position when previous content was not loaded.");r={position:e.reloadAt.relative+u}}else void 0!==u&&(r={position:u});void 0!==(null==e?void 0:e.autoPlay)?i=e.autoPlay:void 0!==l&&(i=!l);var c=Object.assign(Object.assign({},o),{initialManifest:s});void 0!==r&&(c.startAt=r),void 0!==i&&(c.autoPlay=i),this._priv_initializeContentPlayback(c)},u._priv_initializeContentPlayback=function(e){var t,n,r,u=this,l=e.autoPlay,c=e.audioTrackSwitchingMode,f=e.defaultAudioTrack,y=e.defaultTextTrack,E=e.enableFastSwitching,S=e.initialManifest,w=e.keySystems,k=e.lowLatencyMode,A=e.manualBitrateSwitchingMode,x=e.minimumManifestUpdateInterval,I=e.networkConfig,Z=e.onCodecSwitch,R=e.startAt,M=e.transport,P=e.transportOptions,D=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var V,K="directfile"===M,G=new se.ZP,H=new v.y((function(e){G.signal.register((function(){e.next(),e.complete()}))})),W={url:D,currentContentCanceller:G,isDirectFile:K,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:f,initialTextTrack:y},X=this.videoElement,$=new sr(X,{withMediaSource:!K,lowLatencyMode:k});if(G.signal.register((function(){$.stop()})),K){if(this.stop(),this._priv_currentError=null,null===J.Z.directfile)throw new Error("DirectFile feature not activated in your build.");this._priv_contentInfos=W,this._priv_mediaElementTrackChoiceManager=new J.Z.directfile.mediaElementTrackChoiceManager(this.videoElement);var Q=void 0===f?this._priv_preferredAudioTracks:[f];this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(Q,!0);var te=void 0===y?this._priv_preferredTextTracks:[y];this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(te,!0),this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this.trigger("availableAudioTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableAudioTracks()),this.trigger("availableVideoTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableVideoTracks()),this.trigger("availableTextTracksChange",this._priv_mediaElementTrackChoiceManager.getAvailableTextTracks()),this.trigger("audioTrackChange",null!==(t=this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack())&&void 0!==t?t:null),this.trigger("textTrackChange",null!==(n=this._priv_mediaElementTrackChoiceManager.getChosenTextTrack())&&void 0!==n?n:null),this.trigger("videoTrackChange",null!==(r=this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack())&&void 0!==r?r:null),this._priv_mediaElementTrackChoiceManager.addEventListener("availableVideoTracksChange",(function(e){return u.trigger("availableVideoTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableAudioTracksChange",(function(e){return u.trigger("availableAudioTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("availableTextTracksChange",(function(e){return u.trigger("availableTextTracksChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("audioTrackChange",(function(e){return u.trigger("audioTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("videoTrackChange",(function(e){return u.trigger("videoTrackChange",e)})),this._priv_mediaElementTrackChoiceManager.addEventListener("textTrackChange",(function(e){return u.trigger("textTrackChange",e)}));var ne=J.Z.directfile.initDirectFile({autoPlay:l,keySystems:w,mediaElement:X,speed:this._priv_speed,playbackObserver:$,startAt:R,url:D}).pipe((0,o.R)(H));V=_(ne,{connector:function(){return new i.x},resetOnDisconnect:!1})}else{var re=J.Z.transports[M];if("function"!=typeof re)throw this.stop(),this._priv_currentError=null,new Error('transport "'+M+'" not supported');var ae,ue=re(P),le=I.offlineRetry,ce=I.segmentRetry,de=I.manifestRetry,fe=I.manifestRequestTimeout,ve=I.segmentRequestTimeout,pe=new Oe(D,ue,{lowLatencyMode:k,maxRetryRegular:de,maxRetryOffline:le,requestTimeout:fe});(ae=(ae=S instanceof ee.ZP?(0,p.of)({type:"parsed",manifest:S}):void 0!==S?pe.parse(S,{previousManifest:null,unsafeMode:!1}):pe.fetch(D).pipe((0,h.z)((function(e){return"warning"===e.type?(0,p.of)(e):e.parse({previousManifest:null,unsafeMode:!1})})))).pipe((0,o.R)(H),(0,m.d)())).subscribe(),this.stop(),this._priv_currentError=null,this._priv_contentInfos=W;var he=q(),me={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(he?me.throttle={video:(0,oe.lR)(kr(G.signal),(function(e){return e?1/0:0}),G.signal)}:j.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(he?me.throttleBitrate={video:(0,oe.lR)(xr(this._priv_pictureInPictureRef,G.signal),(function(e){return e?1/0:0}),G.signal)}:j.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(he?me.limitWidth={video:Ir(X,this._priv_pictureInPictureRef,G.signal)}:j.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var ge={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:k,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:me},ye="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},_e=(0,ie.Z)({audioTrackSwitchingMode:c,enableFastSwitching:E,manualBitrateSwitchingMode:A,onCodecSwitch:Z},this._priv_bufferOptions),be=nr({adaptiveOptions:ge,autoPlay:l,bufferOptions:_e,playbackObserver:$,keySystems:w,lowLatencyMode:k,manifest$:ae,manifestFetcher:pe,mediaElement:X,minimumManifestUpdateInterval:x,segmentRequestOptions:{regularError:ce,requestTimeout:ve,offlineError:le},speed:this._priv_speed,startAt:R,transport:ue,textTrackOptions:ye}).pipe((0,o.R)(H));V=_(be,{connector:function(){return new i.x},resetOnDisconnect:!1})}var Te,Ee=V.pipe((0,b.h)((function(e){return"stalled"===e.type||"unstalled"===e.type})),(0,s.U)((function(e){return e.value})),d((function(e,t){return null===e&&null===t||null!==e&&null!==t&&e===t}))),Se=V.pipe((0,b.h)((function(e){return"loaded"===e.type})),(0,T.B)()),we=V.pipe((0,b.h)((function(e){return"reloading-media-source"===e.type})),(0,T.B)()),ke=$.getReference().asObservable(),Ae=ke.pipe((0,b.h)((function(e){return"seeking"===e.event||"ended"===e.event||"play"===e.event||"pause"===e.event}))),xe=C([Ee.pipe((0,N.O)(null)),Ae.pipe((0,N.O)(null))]).pipe((0,o.R)(H),(0,s.U)((function(e){var t=e[0];return function(e,t){var n=Y.Z.getCurrent().FORCED_ENDED_THRESHOLD;if(e.ended)return"ENDED";if(null!==t){var r=Math.abs(e.duration-e.currentTime);return null!=n&&r<n?"ENDED":"seeking"===t?"SEEKING":"BUFFERING"}return e.paused?"PAUSED":"PLAYING"}(X,t)}))),Ie=(0,O.z)((0,p.of)("LOADING"),Se.pipe((0,L.w)((function(e,t){var n=0===t;return(0,B.T)(we.pipe((0,s.U)((function(){return"RELOADING"}))),n?(0,p.of)("LOADED"):U.E,xe.pipe((0,o.R)(we),F((function(e){return n&&"PAUSED"===e}))))})))).pipe(d());H.subscribe((function(){void 0!==Te&&Te.unsubscribe()}));var Ze=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":u._priv_reloadingMetadata.reloadInPause=!0,u._priv_reloadingMetadata.reloadPosition=$.getReference().getValue().position;break;default:var t=$.getReference().getValue();u._priv_reloadingMetadata.reloadInPause=t.paused,u._priv_reloadingMetadata.reloadPosition=t.position}};Ie.pipe((0,z.b)((function(e){Ze(e),u._priv_setPlayerState(e),"ENDED"===u.state&&u._priv_stopAtEnd&&G.cancel()})),(0,s.U)((function(e){return"RELOADING"!==e&&"STOPPED"!==e})),d(),(0,L.w)((function(e){return e?ke:U.E})),(0,o.R)(H)).subscribe((function(e){Ze(u.state),u._priv_triggerPositionUpdate(e)})),Se.pipe((0,L.w)((function(){return function(e,t){return(0,g.P)((function(){if(null===e)return U.E;var n=t.pipe((0,b.h)((function(e){return"seeking"===e.event})),(0,s.U)((function(){return"seeking"})));e.seeking&&(n=n.pipe((0,N.O)("seeking")));var r=n.pipe((0,L.w)((function(){return t.pipe((0,b.h)((function(e){return"seeked"===e.event})),(0,s.U)((function(){return"seeked"})),(0,a.q)(1))})));return(0,B.T)(n,r)}))}(u.videoElement,ke)})),(0,o.R)(H)).subscribe((function(e){j.Z.info('API: Triggering "'+e+'" event'),u.trigger(e,null)})),V.subscribe({next:function(e){return u._priv_onPlaybackEvent(e)},error:function(e){return u._priv_onPlaybackError(e)},complete:function(){W.currentContentCanceller.isUsed||(j.Z.info("API: Previous playback finished. Stopping and cleaning-up..."),W.currentContentCanceller.cancel(),u._priv_cleanUpCurrentContentState(),u._priv_setPlayerState("STOPPED"))}}),this._priv_contentLock.asObservable().pipe((0,b.h)((function(e){return!e})),(0,a.q)(1),(0,o.R)(H)).subscribe((function(){Te=V.connect()}))},u.getError=function(){return this._priv_currentError},u.getManifest=function(){return(0,ue.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},u.getCurrentAdaptations=function(){if((0,ue.Z)("getCurrentAdaptations is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;return null===t||null===n||(0,re.Z)(n[t.id])?null:n[t.id]},u.getCurrentRepresentations=function(){return(0,ue.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},u.getVideoElement=function(){return this.videoElement},u.getNativeTextTrack=function(){if((0,ue.Z)("getNativeTextTrack is deprecated. Please open an issue if you used this API."),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return e.textTracks.length>0?e.textTracks[0]:null},u.getPlayerState=function(){return this.state},u.isLive=function(){if(null===this._priv_contentInfos)return!1;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return!t&&null!==n&&n.isLive},u.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},u.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.url;return t?r:null!==n?n.getUrl():void 0}},u.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},u.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.L7)(e.buffered,e.currentTime)},u.getVideoLoadedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.at)(e.buffered,e.currentTime)},u.getVideoPlayedTime=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,ae.DD)(e.buffered,e.currentTime)},u.getWallClockTime=function(){if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)return this.videoElement.currentTime;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){var r=K(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},u.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},u.getPlaybackRate=function(){return this._priv_speed.getValue()},u.setPlaybackRate=function(e,t){e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var n=null==t?void 0:t.preferTrickModeTracks;"boolean"==typeof n&&(this._priv_preferTrickModeTracks=n,null!==this._priv_trackChoiceManager&&(n&&!this._priv_trackChoiceManager.isTrickModeEnabled()?this._priv_trackChoiceManager.enableVideoTrickModeTracks():!n&&this._priv_trackChoiceManager.isTrickModeEnabled()&&this._priv_trackChoiceManager.disableVideoTrickModeTracks()))},u.getAvailableVideoBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,re.Z)(r.video)?[]:r.video.getAvailableBitrates()},u.getAvailableAudioBitrates=function(){if(null===this._priv_contentInfos)return[];var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeAdaptations;if(null===t||null===n)return[];var r=n[t.id];return void 0===r||(0,re.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},u.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},u.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},u.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,re.Z)(e.video))return e.video.bitrate},u.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,re.Z)(e.audio))return e.audio.bitrate},u.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},u.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},u.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},u.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},u.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,re.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new X.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},u.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},u.seekTo=function(e){var t;if(null===this.videoElement)throw new Error("Disposed player");if(null===this._priv_contentInfos)throw new Error("player: no content loaded");var n,r=this._priv_contentInfos,i=r.isDirectFile,a=r.manifest;if(!i&&null===a)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var o=e,s=this.videoElement.currentTime;if((0,re.Z)(o.relative))if((0,re.Z)(o.position)){if((0,re.Z)(o.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==a)n=o.wallClockTime-(null!==(t=a.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var u=K(this.videoElement);void 0!==u&&(n=o.wallClockTime-u)}void 0===n&&(n=o.wallClockTime)}else n=o.position;else n=s+o.relative}if(void 0===n)throw new Error("invalid time given");return this.videoElement.currentTime=n,n},u.isFullscreen=function(){return(0,ue.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),H()},u.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,ue.Z)("setFullscreen is deprecated. Fullscreen management should now be managed by the application"),null===this.videoElement)throw new Error("Disposed player");e?function(e){if(!H()){var t=e;"function"==typeof t.requestFullscreen?t.requestFullscreen():"function"==typeof t.msRequestFullscreen?t.msRequestFullscreen():"function"==typeof t.mozRequestFullScreen?t.mozRequestFullScreen():"function"==typeof t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}(this.videoElement):G()},u.exitFullscreen=function(){(0,ue.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),G()},u.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},u.setVolume=function(e){if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement;e!==t.volume&&(t.volume=e,this.trigger("volumeChange",e))},u.isMute=function(){return 0===this.getVolume()},u.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},u.unMute=function(){var e=Y.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},u.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},u.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},u.setMinVideoBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.video.getValue();if(e>t)throw new Error('Invalid minimum video bitrate given. Its value, "'+e+'" is superior the current maximum video birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.video.setValue(e)},u.setMinAudioBitrate=function(e){var t=this._priv_bitrateInfos.maxAutoBitrates.audio.getValue();if(e>t)throw new Error('Invalid minimum audio bitrate given. Its value, "'+e+'" is superior the current maximum audio birate, "'+t+'".');this._priv_bitrateInfos.minAutoBitrates.audio.setValue(e)},u.setMaxVideoBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.video.getValue();if(e<t)throw new Error('Invalid maximum video bitrate given. Its value, "'+e+'" is inferior the current minimum video birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.video.setValue(e)},u.setMaxAudioBitrate=function(e){var t=this._priv_bitrateInfos.minAutoBitrates.audio.getValue();if(e<t)throw new Error('Invalid maximum audio bitrate given. Its value, "'+e+'" is inferior the current minimum audio birate, "'+t+'".');this._priv_bitrateInfos.maxAutoBitrates.audio.setValue(e)},u.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},u.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},u.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},u.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},u.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},u.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},u.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},u.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},u.getCurrentKeySystem=function(){if(null===this.videoElement)throw new Error("Disposed player");return me(this.videoElement)},u.getAvailableAudioTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableAudioTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableAudioTracks(r)},u.getAvailableTextTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableTextTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableTextTracks(r)},u.getAvailableVideoTracks=function(){var e,t;if(null===this._priv_contentInfos)return[];var n=this._priv_contentInfos,r=n.currentPeriod;return n.isDirectFile?null!==(t=null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e?void 0:e.getAvailableVideoTracks())&&void 0!==t?t:[]:null===this._priv_trackChoiceManager||null===r?[]:this._priv_trackChoiceManager.getAvailableVideoTracks(r)},u.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenAudioTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenAudioTrack(t)}},u.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenTextTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenTextTrack(t)}},u.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile){if(null===this._priv_mediaElementTrackChoiceManager)return;return this._priv_mediaElementTrackChoiceManager.getChosenVideoTrack()}if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.getChosenVideoTrack(t)}},u.setAudioTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setAudioTrackByID(r,e)}catch(e){throw new Error("player: unknown audio track")}},u.setTextTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setTextTrackByID(r,e)}catch(e){throw new Error("player: unknown text track")}},u.disableTextTrack=function(){var e;if(null!==this._priv_contentInfos){var t=this._priv_contentInfos,n=t.currentPeriod;if(t.isDirectFile)null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.disableTextTrack();else if(null!==this._priv_trackChoiceManager&&null!==n)return this._priv_trackChoiceManager.disableTextTrack(n)}},u.setVideoTrack=function(e){var t;if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=this._priv_contentInfos,r=n.currentPeriod;if(n.isDirectFile)try{return void(null===(t=this._priv_mediaElementTrackChoiceManager)||void 0===t||t.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===this._priv_trackChoiceManager||null===r)throw new Error("No compatible content launched.");try{this._priv_trackChoiceManager.setVideoTrackByID(r,e)}catch(e){throw new Error("player: unknown video track")}},u.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod;if(e.isDirectFile&&null!==this._priv_mediaElementTrackChoiceManager)return this._priv_mediaElementTrackChoiceManager.disableVideoTrack();if(null!==this._priv_trackChoiceManager&&null!==t)return this._priv_trackChoiceManager.disableVideoTrack(t)}},u.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},u.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},u.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},u.setPreferredAudioTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredAudioTracks` argument. Should have been an Array.");this._priv_preferredAudioTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredAudioTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t)},u.setPreferredTextTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredTextTracks` argument. Should have been an Array.");this._priv_preferredTextTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredTextTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredTextTracks(e,t)},u.setPreferredVideoTracks=function(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))throw new Error("Invalid `setPreferredVideoTracks` argument. Should have been an Array.");this._priv_preferredVideoTracks=e,null!==this._priv_trackChoiceManager?this._priv_trackChoiceManager.setPreferredVideoTracks(e,t):null!==this._priv_mediaElementTrackChoiceManager&&this._priv_mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t)},u.getImageTrackData=function(){return(0,ue.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},u.getMinimumPosition=function(){if(null===this._priv_contentInfos)return null;if(this._priv_contentInfos.isDirectFile)return 0;var e=this._priv_contentInfos.manifest;return null!==e?e.getMinimumSafePosition():null},u.getMaximumPosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;if(t){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration}return null!==n?n.isDynamic||null===this.videoElement?n.getMaximumSafePosition():this.videoElement.duration:null},u.__priv_getSegmentBufferContent=function(e){if(null===this._priv_contentInfos||null===this._priv_contentInfos.segmentBuffersStore)return null;var t=this._priv_contentInfos.segmentBuffersStore.getStatus(e);return"initialized"===t.type?t.value.getInventory():null},u._priv_cleanUpCurrentContentState=function(){var e,t=this;j.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),this._priv_contentInfos=null,this._priv_trackChoiceManager=null,null===(e=this._priv_mediaElementTrackChoiceManager)||void 0===e||e.dispose(),this._priv_mediaElementTrackChoiceManager=null,this._priv_contentEventsMemory={};var n=function(){null!==t.videoElement&&(j.Z.debug("Unlocking `contentLock`. Next content can begin."),t._priv_contentLock.setValue(!1))};(0,re.Z)(this.videoElement)?n():ge(this.videoElement).then((function(){j.Z.debug("API: DRM session cleaned-up with success!"),n()}),(function(e){j.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),n()}))},u._priv_onPlaybackEvent=function(e){switch(e.type){case"inband-events":var t=e.value;return void this.trigger("inbandEvents",t);case"stream-event":this.trigger("streamEvent",e.value);break;case"stream-event-skip":this.trigger("streamEventSkip",e.value);break;case"activePeriodChanged":this._priv_onActivePeriodChanged(e.value);break;case"periodStreamReady":this._priv_onPeriodStreamReady(e.value);break;case"periodStreamCleared":this._priv_onPeriodStreamCleared(e.value);break;case"reloading-media-source":this._priv_onReloadingMediaSource();break;case"representationChange":this._priv_onRepresentationChange(e.value);break;case"adaptationChange":this._priv_onAdaptationChange(e.value);break;case"bitrateEstimationChange":this._priv_onBitrateEstimationChange(e.value);break;case"manifestReady":this._priv_onManifestReady(e.value);break;case"warning":this._priv_onPlaybackWarning(e.value);break;case"loaded":if(null===this._priv_contentInfos)return void j.Z.error("API: Loaded event while no content is loaded");this._priv_contentInfos.segmentBuffersStore=e.value.segmentBuffersStore;break;case"decipherabilityUpdate":this.trigger("decipherabilityUpdate",e.value);break;case"added-segment":if(null===this._priv_contentInfos)return void j.Z.error("API: Added segment while no content is loaded");var n=e.value,r=n.content,i=n.segmentData;if("image"===r.adaptation.type&&!(0,re.Z)(i)&&"bif"===i.type){var a=i.data;this._priv_contentInfos.thumbnails=a,this.trigger("imageTrackUpdate",{data:this._priv_contentInfos.thumbnails})}}},u._priv_onPlaybackError=function(e){var t=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});t.fatal=!0,null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),this._priv_currentError=t,j.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),this._priv_setPlayerState("STOPPED"),this._priv_currentError===t&&this.trigger("error",t)},u._priv_onPlaybackWarning=function(e){var t=(0,$.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});j.Z.warn("API: Sending warning:",t),this.trigger("warning",t)},u._priv_onManifestReady=function(e){var t=this,n=e.manifest,r=this._priv_contentInfos;if(null!==r){r.manifest=n,this._priv_reloadingMetadata.manifest=n;var i=r.initialAudioTrack,a=r.initialTextTrack;this._priv_trackChoiceManager=new pr({preferTrickModeTracks:this._priv_preferTrickModeTracks});var o=void 0===i?this._priv_preferredAudioTracks:[i];this._priv_trackChoiceManager.setPreferredAudioTracks(o,!0);var s=void 0===a?this._priv_preferredTextTracks:[a];this._priv_trackChoiceManager.setPreferredTextTracks(s,!0),this._priv_trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),n.addEventListener("manifestUpdate",(function(){null!==t._priv_trackChoiceManager&&t._priv_trackChoiceManager.update()}),r.currentContentCanceller.signal)}else j.Z.error("API: The manifest is loaded but no content is.")},u._priv_onActivePeriodChanged=function(e){var t,n,r,i,a,o,s=e.period;if(null!==this._priv_contentInfos){if(this._priv_contentInfos.currentPeriod=s,this._priv_contentEventsMemory.periodChange!==s&&(this._priv_contentEventsMemory.periodChange=s,this.trigger("periodChange",s)),this.trigger("availableAudioTracksChange",this.getAvailableAudioTracks()),this.trigger("availableTextTracksChange",this.getAvailableTextTracks()),this.trigger("availableVideoTracksChange",this.getAvailableVideoTracks()),null!==this._priv_trackChoiceManager){var u=this._priv_trackChoiceManager.getChosenAudioTrack(s),l=this._priv_trackChoiceManager.getChosenTextTrack(s),c=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("audioTrackChange",u),this.trigger("textTrackChange",l),this.trigger("videoTrackChange",c)}else this.trigger("audioTrackChange",null),this.trigger("textTrackChange",null),this.trigger("videoTrackChange",null);this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates()),this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates());var d=null!==(r=null===(n=null===(t=this._priv_getCurrentRepresentations())||void 0===t?void 0:t.audio)||void 0===n?void 0:n.bitrate)&&void 0!==r?r:-1;this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",d);var f=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.video)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",f)}else j.Z.error("API: The active period changed but no content is loaded")},u._priv_onPeriodStreamReady=function(e){var t=e.type,n=e.period,r=e.adaptation$;switch(t){case"video":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new video period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialVideoTrack(n));break;case"audio":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialAudioTrack(n));break;case"text":null===this._priv_trackChoiceManager?(j.Z.error("API: TrackChoiceManager not instanciated for a new "+t+" period"),r.next(null)):(this._priv_trackChoiceManager.addPeriod(t,n,r),this._priv_trackChoiceManager.setInitialTextTrack(n));break;default:var i=n.adaptations[t];!(0,re.Z)(i)&&i.length>0?r.next(i[0]):r.next(null)}},u._priv_onPeriodStreamCleared=function(e){var t=e.type,n=e.period;switch(t){case"audio":case"text":case"video":null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.removePeriod(t,n)}if(null!==this._priv_contentInfos){var r=this._priv_contentInfos,i=r.activeAdaptations,a=r.activeRepresentations;if(!(0,re.Z)(i)&&!(0,re.Z)(i[n.id])){var o=i[n.id];delete o[t],0===Object.keys(o).length&&delete i[n.id]}if(!(0,re.Z)(a)&&!(0,re.Z)(a[n.id])){var s=a[n.id];delete s[t],0===Object.keys(s).length&&delete a[n.id]}}},u._priv_onReloadingMediaSource=function(){null!==this._priv_contentInfos&&(this._priv_contentInfos.segmentBuffersStore=null),null!==this._priv_trackChoiceManager&&this._priv_trackChoiceManager.resetPeriods()},u._priv_onAdaptationChange=function(e){var t=e.type,n=e.adaptation,r=e.period;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeAdaptations&&(this._priv_contentInfos.activeAdaptations={});var i,a=this._priv_contentInfos,o=a.activeAdaptations,s=a.currentPeriod,u=o[r.id];if((0,re.Z)(u))o[r.id]=((i={})[t]=n,i);else u[t]=n;if(null!==this._priv_trackChoiceManager&&null!==s&&!(0,re.Z)(r)&&r.id===s.id)switch(t){case"audio":var l=this._priv_trackChoiceManager.getChosenAudioTrack(s);this.trigger("audioTrackChange",l);var c=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",c);break;case"text":var d=this._priv_trackChoiceManager.getChosenTextTrack(s);this.trigger("textTrackChange",d);break;case"video":var f=this._priv_trackChoiceManager.getChosenVideoTrack(s);this.trigger("videoTrackChange",f);var v=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",v)}}else j.Z.error("API: The adaptations changed but no content is loaded")},u._priv_onRepresentationChange=function(e){var t,n=e.type,r=e.period,i=e.representation;if(null!==this._priv_contentInfos){null===this._priv_contentInfos.activeRepresentations&&(this._priv_contentInfos.activeRepresentations={});var a,o=this._priv_contentInfos,s=o.activeRepresentations,u=o.currentPeriod,l=s[r.id];if((0,re.Z)(l))s[r.id]=((a={})[n]=i,a);else l[n]=i;var c=null!==(t=null==i?void 0:i.bitrate)&&void 0!==t?t:-1;(0,re.Z)(r)||null===u||u.id!==r.id||("video"===n?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c):"audio"===n&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c))}else j.Z.error("API: The representations changed but no content is loaded")},u._priv_onBitrateEstimationChange=function(e){var t=e.type,n=e.bitrate;void 0!==n&&(this._priv_bitrateInfos.lastBitrates[t]=n),this.trigger("bitrateEstimationChange",{type:t,bitrate:n})},u._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},u._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,j.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},u._priv_triggerPositionUpdate=function(e){var t;if(null!==this._priv_contentInfos){var n=this._priv_contentInfos,r=n.isDirectFile,i=n.manifest;if((r||null!==i)&&!(0,re.Z)(e)){var a=null!==i?i.getMaximumSafePosition():void 0,o={position:e.position,duration:e.duration,playbackRate:e.playbackRate,maximumBufferTime:a,bufferGap:void 0!==e.bufferGap&&isFinite(e.bufferGap)?e.bufferGap:0};if(null!==i&&i.isLive&&e.position>0){var s=null!==(t=i.availabilityStartTime)&&void 0!==t?t:0;o.wallClockTime=e.position+s;var u=i.getLivePosition();void 0!==u&&(o.liveGap=u-e.position)}else if(r&&null!==this.videoElement){var l=K(this.videoElement);void 0!==l&&(o.wallClockTime=l+e.position)}this.trigger("positionUpdate",o)}}else j.Z.warn("API: Cannot perform time update: no content loaded.")},u._priv_triggerAvailableBitratesChangeEvent=function(e,t){var n=this._priv_contentEventsMemory[e];void 0!==n&&(0,te.Z)(t,n)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},u._priv_triggerCurrentBitrateChangeEvent=function(e,t){t!==this._priv_contentEventsMemory[e]&&(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},u._priv_getCurrentRepresentations=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.currentPeriod,n=e.activeRepresentations;return null===t||null===n||(0,re.Z)(n[t.id])?null:n[t.id]},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return Q.ZB}},{key:"ErrorCodes",get:function(){return Q.SM}},{key:"LogLevel",get:function(){return j.Z.getLevel()},set:function(e){j.Z.setLevel(e)}}]),r}(ne.Z);Mr.version="3.29.0";var Cr=Mr,Pr=n(7273);!function(){Pr.Z.ContentDecryptor=n(1266).ZP,Pr.Z.imageBuffer=n(7127).Z,Pr.Z.imageParser=n(3203).Z,Pr.Z.transports.smooth=n(2339).Z,Pr.Z.transports.dash=n(85).Z,Pr.Z.dashParsers.js=n(4541).Z,Pr.Z.nativeTextTracksBuffer=n(9059).Z,Pr.Z.nativeTextTracksParsers.vtt=n(9405).Z,Pr.Z.nativeTextTracksParsers.ttml=n(1570).Z,Pr.Z.nativeTextTracksParsers.sami=n(1812).Z,Pr.Z.nativeTextTracksParsers.srt=n(8057).Z,Pr.Z.htmlTextTracksBuffer=n(5192).Z,Pr.Z.htmlTextTracksParsers.sami=n(5734).Z,Pr.Z.htmlTextTracksParsers.ttml=n(7439).Z,Pr.Z.htmlTextTracksParsers.srt=n(8675).Z,Pr.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(8969).Z,t=n(6796).Z;Pr.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&j.Z.setLevel("DEBUG");var Dr=Cr}(),r=r.default}()}));