rx-player 3.33.0 → 3.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/VERSION +1 -1
- package/dist/_esm5.processed/core/api/public_api.js +2 -2
- package/dist/_esm5.processed/manifest/manifest.js +1 -0
- package/dist/_esm5.processed/utils/retry_promise_with_backoff.d.ts +11 -0
- package/dist/_esm5.processed/utils/retry_promise_with_backoff.js +18 -4
- package/dist/mpd-parser.wasm +0 -0
- package/dist/rx-player.d.ts +1 -1
- package/dist/rx-player.js +24 -9
- package/dist/rx-player.min.d.ts +1 -1
- package/dist/rx-player.min.js +1 -1
- package/package.json +6 -6
- package/.editorconfig +0 -22
- package/.eslintrc.js +0 -406
- package/.github/workflows/checks.yml +0 -101
- package/.github/workflows/perfs.yml +0 -22
- package/.github/workflows/sonarcloud_analysis.yml +0 -20
- package/CONTRIBUTING.md +0 -272
- package/FILES.md +0 -283
- package/jest.config.js +0 -73
- package/manifest.mpd +0 -149
- package/scripts/README.md +0 -11
- package/scripts/build/constants.d.ts +0 -53
- package/scripts/build/generate_build.js +0 -190
- package/scripts/build/templates/experimental/features/index.d.ts +0 -16
- package/scripts/build/templates/experimental/features/index.js +0 -16
- package/scripts/build/templates/experimental/index.d.ts +0 -16
- package/scripts/build/templates/experimental/index.js +0 -16
- package/scripts/build/templates/experimental/tools/VideoThumbnailLoader/index.d.ts +0 -18
- package/scripts/build/templates/experimental/tools/VideoThumbnailLoader/index.js +0 -18
- package/scripts/build/templates/experimental/tools/index.d.ts +0 -16
- package/scripts/build/templates/experimental/tools/index.js +0 -16
- package/scripts/build/templates/features/index.d.ts +0 -16
- package/scripts/build/templates/features/index.js +0 -16
- package/scripts/build/templates/logger/index.d.ts +0 -17
- package/scripts/build/templates/logger/index.js +0 -17
- package/scripts/build/templates/minimal/index.d.ts +0 -17
- package/scripts/build/templates/minimal/index.js +0 -17
- package/scripts/build/templates/tools/TextTrackRenderer.d.ts +0 -18
- package/scripts/build/templates/tools/TextTrackRenderer.js +0 -18
- package/scripts/build/templates/tools/index.d.ts +0 -16
- package/scripts/build/templates/tools/index.js +0 -16
- package/scripts/build/templates/tools/string-utils.d.ts +0 -18
- package/scripts/build/templates/tools/string-utils.js +0 -18
- package/scripts/build/templates/types/index.d.ts +0 -16
- package/scripts/build/templates/types/index.js +0 -15
- package/scripts/canal-release.patch +0 -316
- package/scripts/check_nodejs_import_compatibility.js +0 -60
- package/scripts/deploy_new_demo +0 -123
- package/scripts/fast_demo_build.js +0 -129
- package/scripts/generate_certificate +0 -19
- package/scripts/generate_demo_list.js +0 -105
- package/scripts/generate_documentation_list.js +0 -109
- package/scripts/generate_full_demo.js +0 -201
- package/scripts/generate_standalone_demo.js +0 -82
- package/scripts/launch_static_server.js +0 -163
- package/scripts/list-npm-scripts.js +0 -207
- package/scripts/make-dev-releases +0 -90
- package/scripts/report_build_sizes +0 -96
- package/scripts/run_standalone_demo.js +0 -27
- package/scripts/start_demo_web_server.js +0 -44
- package/scripts/update-version +0 -48
- package/scripts/update_gh-pages_demo +0 -132
- package/scripts/update_gh-pages_doc +0 -106
- package/scripts/utils/display_webpack_errors.js +0 -33
- package/scripts/utils/get_human_readable_hours.js +0 -14
- package/scripts/wasm-strip.js +0 -359
- package/sonar-project.properties +0 -7
- package/src/README.md +0 -136
- package/src/compat/README.md +0 -29
- package/src/compat/__tests__/add_text_track.test.ts +0 -176
- package/src/compat/__tests__/browser_compatibility_types.test.ts +0 -152
- package/src/compat/__tests__/browser_version.test.ts +0 -84
- package/src/compat/__tests__/can_patch_isobmff.test.ts +0 -50
- package/src/compat/__tests__/can_rely_on_video_visibility_and_size.test.ts +0 -78
- package/src/compat/__tests__/can_reuse_media_keys.test.ts +0 -31
- package/src/compat/__tests__/change_source_buffer_type.test.ts +0 -60
- package/src/compat/__tests__/clear_element_src.test.ts +0 -252
- package/src/compat/__tests__/enable_audio_track.test.ts +0 -341
- package/src/compat/__tests__/fullscreen.test.ts +0 -286
- package/src/compat/__tests__/is_codec_supported.test.ts +0 -78
- package/src/compat/__tests__/is_offline.test.ts +0 -65
- package/src/compat/__tests__/is_seeking_approximate.test.ts +0 -48
- package/src/compat/__tests__/is_vtt_cue.test.ts +0 -71
- package/src/compat/__tests__/make_vtt_cue.test.ts +0 -97
- package/src/compat/__tests__/patch_webkit_source_buffer.test.ts +0 -144
- package/src/compat/__tests__/remove_cue.test.ts +0 -229
- package/src/compat/__tests__/should_favour_custom_safari_EME.test.ts +0 -128
- package/src/compat/__tests__/should_reload_media_source_on_decipherability_update.test.ts +0 -50
- package/src/compat/__tests__/should_renew_media_key_system_access.test.ts +0 -55
- package/src/compat/__tests__/should_unset_media_keys.test.ts +0 -53
- package/src/compat/__tests__/should_validate_metadata.test.ts +0 -53
- package/src/compat/__tests__/should_wait_for_data_before_loaded.test.ts +0 -121
- package/src/compat/__tests__/should_wait_for_have_enough_data.test.ts +0 -36
- package/src/compat/add_class_name.ts +0 -41
- package/src/compat/add_text_track.ts +0 -58
- package/src/compat/browser_compatibility_types.ts +0 -222
- package/src/compat/browser_detection.ts +0 -172
- package/src/compat/browser_version.ts +0 -44
- package/src/compat/can_patch_isobmff.ts +0 -30
- package/src/compat/can_rely_on_video_visibility_and_size.ts +0 -52
- package/src/compat/can_reuse_media_keys.ts +0 -20
- package/src/compat/change_source_buffer_type.ts +0 -66
- package/src/compat/clear_element_src.ts +0 -55
- package/src/compat/eme/close_session.ts +0 -111
- package/src/compat/eme/constants.ts +0 -21
- package/src/compat/eme/custom_key_system_access.ts +0 -67
- package/src/compat/eme/custom_media_keys/ie11_media_keys.ts +0 -186
- package/src/compat/eme/custom_media_keys/index.ts +0 -28
- package/src/compat/eme/custom_media_keys/moz_media_keys_constructor.ts +0 -88
- package/src/compat/eme/custom_media_keys/ms_media_keys_constructor.ts +0 -69
- package/src/compat/eme/custom_media_keys/old_webkit_media_keys.ts +0 -235
- package/src/compat/eme/custom_media_keys/types.ts +0 -67
- package/src/compat/eme/custom_media_keys/webkit_media_keys.ts +0 -308
- package/src/compat/eme/custom_media_keys/webkit_media_keys_constructor.ts +0 -50
- package/src/compat/eme/eme-api-implementation.ts +0 -318
- package/src/compat/eme/generate_key_request.ts +0 -162
- package/src/compat/eme/get_init_data.ts +0 -159
- package/src/compat/eme/get_uuid_kid_from_keystatus_kid.ts +0 -37
- package/src/compat/eme/get_webkit_fairplay_initdata.ts +0 -75
- package/src/compat/eme/index.ts +0 -47
- package/src/compat/eme/load_session.ts +0 -67
- package/src/compat/enable_audio_track.ts +0 -33
- package/src/compat/event_listeners.ts +0 -566
- package/src/compat/fullscreen.ts +0 -87
- package/src/compat/get_start_date.ts +0 -48
- package/src/compat/has_issues_with_high_media_source_duration.ts +0 -27
- package/src/compat/index.ts +0 -87
- package/src/compat/is_codec_supported.ts +0 -40
- package/src/compat/is_debug_mode_enabled.ts +0 -12
- package/src/compat/is_node.ts +0 -18
- package/src/compat/is_offline.ts +0 -44
- package/src/compat/is_seeking_approximate.ts +0 -32
- package/src/compat/is_vtt_cue.ts +0 -30
- package/src/compat/make_vtt_cue.ts +0 -51
- package/src/compat/on_height_width_change.ts +0 -119
- package/src/compat/patch_webkit_source_buffer.ts +0 -89
- package/src/compat/remove_cue.ts +0 -64
- package/src/compat/should_favour_custom_safari_EME.ts +0 -34
- package/src/compat/should_prevent_seeking_at_0_initially.ts +0 -19
- package/src/compat/should_reload_media_source_on_decipherability_update.ts +0 -32
- package/src/compat/should_renew_media_key_system_access.ts +0 -26
- package/src/compat/should_unset_media_keys.ts +0 -27
- package/src/compat/should_validate_metadata.ts +0 -27
- package/src/compat/should_wait_for_data_before_loaded.ts +0 -35
- package/src/compat/should_wait_for_have_enough_data.ts +0 -17
- package/src/config.ts +0 -32
- package/src/core/README.md +0 -56
- package/src/core/adaptive/README.md +0 -147
- package/src/core/adaptive/__tests__/buffer_based_chooser.test.ts +0 -548
- package/src/core/adaptive/adaptive_representation_selector.ts +0 -916
- package/src/core/adaptive/buffer_based_chooser.ts +0 -264
- package/src/core/adaptive/guess_based_chooser.ts +0 -309
- package/src/core/adaptive/index.ts +0 -45
- package/src/core/adaptive/network_analyzer.ts +0 -419
- package/src/core/adaptive/utils/__tests__/bandwith_estimator.test.ts +0 -134
- package/src/core/adaptive/utils/__tests__/ewma.test.ts +0 -79
- package/src/core/adaptive/utils/__tests__/filter_by_bitrate.test.ts +0 -56
- package/src/core/adaptive/utils/__tests__/filter_by_width.test.ts +0 -60
- package/src/core/adaptive/utils/__tests__/get_buffer_levels.test.ts +0 -48
- package/src/core/adaptive/utils/__tests__/select_optimal_representation.test.ts +0 -243
- package/src/core/adaptive/utils/bandwidth_estimator.ts +0 -88
- package/src/core/adaptive/utils/ewma.ts +0 -59
- package/src/core/adaptive/utils/filter_by_bitrate.ts +0 -46
- package/src/core/adaptive/utils/filter_by_width.ts +0 -49
- package/src/core/adaptive/utils/get_buffer_levels.ts +0 -50
- package/src/core/adaptive/utils/last_estimate_storage.ts +0 -79
- package/src/core/adaptive/utils/pending_requests_store.ts +0 -147
- package/src/core/adaptive/utils/representation_score_calculator.ts +0 -168
- package/src/core/adaptive/utils/select_optimal_representation.ts +0 -54
- package/src/core/api/README.md +0 -36
- package/src/core/api/__tests__/option_utils.test.ts +0 -1668
- package/src/core/api/__tests__/public_api.test.ts +0 -857
- package/src/core/api/__tests__/utils.test.ts +0 -195
- package/src/core/api/debug/buffer_graph.ts +0 -244
- package/src/core/api/debug/buffer_size_graph.ts +0 -130
- package/src/core/api/debug/constants.ts +0 -2
- package/src/core/api/debug/index.ts +0 -3
- package/src/core/api/debug/modules/general_info.ts +0 -213
- package/src/core/api/debug/modules/segment_buffer_content.ts +0 -155
- package/src/core/api/debug/modules/segment_buffer_size.ts +0 -48
- package/src/core/api/debug/render.ts +0 -40
- package/src/core/api/debug/utils.ts +0 -103
- package/src/core/api/index.ts +0 -27
- package/src/core/api/option_utils.ts +0 -700
- package/src/core/api/playback_observer.ts +0 -994
- package/src/core/api/public_api.ts +0 -3247
- package/src/core/api/tracks_management/__tests__/media_element_track_choice_manager.test.ts +0 -184
- package/src/core/api/tracks_management/media_element_track_choice_manager.ts +0 -975
- package/src/core/api/tracks_management/track_choice_manager.ts +0 -1280
- package/src/core/api/utils.ts +0 -216
- package/src/core/decrypt/README.md +0 -22
- package/src/core/decrypt/__tests__/__global__/get_license.test.ts +0 -422
- package/src/core/decrypt/__tests__/__global__/init_data.test.ts +0 -677
- package/src/core/decrypt/__tests__/__global__/media_key_system_access.test.ts +0 -528
- package/src/core/decrypt/__tests__/__global__/media_keys.test.ts +0 -343
- package/src/core/decrypt/__tests__/__global__/server_certificate.test.ts +0 -264
- package/src/core/decrypt/__tests__/__global__/utils.ts +0 -491
- package/src/core/decrypt/attach_media_keys.ts +0 -121
- package/src/core/decrypt/clear_on_stop.ts +0 -47
- package/src/core/decrypt/content_decryptor.ts +0 -1246
- package/src/core/decrypt/create_or_load_session.ts +0 -133
- package/src/core/decrypt/create_session.ts +0 -214
- package/src/core/decrypt/dispose_decryption_resources.ts +0 -54
- package/src/core/decrypt/find_key_system.ts +0 -376
- package/src/core/decrypt/get_key_system_configuration.ts +0 -51
- package/src/core/decrypt/get_media_keys.ts +0 -147
- package/src/core/decrypt/index.ts +0 -36
- package/src/core/decrypt/init_media_keys.ts +0 -60
- package/src/core/decrypt/session_events_listener.ts +0 -386
- package/src/core/decrypt/set_server_certificate.ts +0 -105
- package/src/core/decrypt/types.ts +0 -404
- package/src/core/decrypt/utils/__tests__/are_init_values_compatible.test.ts +0 -261
- package/src/core/decrypt/utils/__tests__/clean_old_loaded_sessions.test.ts +0 -158
- package/src/core/decrypt/utils/__tests__/clean_old_stored_persistent_info.test.ts +0 -133
- package/src/core/decrypt/utils/are_init_values_compatible.ts +0 -140
- package/src/core/decrypt/utils/check_key_statuses.ts +0 -193
- package/src/core/decrypt/utils/clean_old_loaded_sessions.ts +0 -45
- package/src/core/decrypt/utils/clean_old_stored_persistent_info.ts +0 -48
- package/src/core/decrypt/utils/get_drm_system_id.ts +0 -42
- package/src/core/decrypt/utils/init_data_values_container.ts +0 -119
- package/src/core/decrypt/utils/is_session_usable.ts +0 -62
- package/src/core/decrypt/utils/key_id_comparison.ts +0 -57
- package/src/core/decrypt/utils/key_session_record.ts +0 -174
- package/src/core/decrypt/utils/loaded_sessions_store.ts +0 -505
- package/src/core/decrypt/utils/media_keys_infos_store.ts +0 -85
- package/src/core/decrypt/utils/persistent_sessions_store.ts +0 -358
- package/src/core/decrypt/utils/serializable_bytes.ts +0 -59
- package/src/core/decrypt/utils/server_certificate_store.ts +0 -133
- package/src/core/fetchers/README.md +0 -84
- package/src/core/fetchers/cdn_prioritizer.ts +0 -207
- package/src/core/fetchers/index.ts +0 -38
- package/src/core/fetchers/manifest/index.ts +0 -28
- package/src/core/fetchers/manifest/manifest_fetcher.ts +0 -798
- package/src/core/fetchers/segment/__tests__/task_prioritizer.test.ts +0 -763
- package/src/core/fetchers/segment/index.ts +0 -28
- package/src/core/fetchers/segment/prioritized_segment_fetcher.ts +0 -113
- package/src/core/fetchers/segment/segment_fetcher.ts +0 -482
- package/src/core/fetchers/segment/segment_fetcher_creator.ts +0 -129
- package/src/core/fetchers/segment/task_prioritizer.ts +0 -455
- package/src/core/fetchers/utils/error_selector.ts +0 -38
- package/src/core/fetchers/utils/schedule_request.ts +0 -493
- package/src/core/init/README.md +0 -81
- package/src/core/init/directfile_content_initializer.ts +0 -310
- package/src/core/init/index.ts +0 -22
- package/src/core/init/media_source_content_initializer.ts +0 -878
- package/src/core/init/types.ts +0 -266
- package/src/core/init/utils/__tests__/are_same_stream_events.test.ts +0 -84
- package/src/core/init/utils/__tests__/refresh_scheduled_events_list.test.ts +0 -94
- package/src/core/init/utils/content_time_boundaries_observer.ts +0 -646
- package/src/core/init/utils/create_media_source.ts +0 -139
- package/src/core/init/utils/create_stream_playback_observer.ts +0 -132
- package/src/core/init/utils/end_of_stream.ts +0 -108
- package/src/core/init/utils/get_initial_time.ts +0 -165
- package/src/core/init/utils/get_loaded_reference.ts +0 -82
- package/src/core/init/utils/initial_seek_and_play.ts +0 -237
- package/src/core/init/utils/initialize_content_decryption.ts +0 -172
- package/src/core/init/utils/media_source_duration_updater.ts +0 -349
- package/src/core/init/utils/rebuffering_controller.ts +0 -642
- package/src/core/init/utils/stream_events_emitter/are_same_stream_events.ts +0 -42
- package/src/core/init/utils/stream_events_emitter/index.ts +0 -22
- package/src/core/init/utils/stream_events_emitter/refresh_scheduled_events_list.ts +0 -74
- package/src/core/init/utils/stream_events_emitter/stream_events_emitter.ts +0 -252
- package/src/core/init/utils/stream_events_emitter/types.ts +0 -46
- package/src/core/init/utils/throw_on_media_error.ts +0 -74
- package/src/core/segment_buffers/README.md +0 -219
- package/src/core/segment_buffers/garbage_collector.ts +0 -177
- package/src/core/segment_buffers/implementations/audio_video/audio_video_segment_buffer.ts +0 -650
- package/src/core/segment_buffers/implementations/audio_video/index.ts +0 -18
- package/src/core/segment_buffers/implementations/image/image_segment_buffer.ts +0 -152
- package/src/core/segment_buffers/implementations/image/index.ts +0 -18
- package/src/core/segment_buffers/implementations/index.ts +0 -20
- package/src/core/segment_buffers/implementations/text/html/__tests__/utils.test.ts +0 -343
- package/src/core/segment_buffers/implementations/text/html/html_text_segment_buffer.ts +0 -527
- package/src/core/segment_buffers/implementations/text/html/index.ts +0 -24
- package/src/core/segment_buffers/implementations/text/html/parsers.ts +0 -49
- package/src/core/segment_buffers/implementations/text/html/text_track_cues_store.ts +0 -391
- package/src/core/segment_buffers/implementations/text/html/types.ts +0 -23
- package/src/core/segment_buffers/implementations/text/html/update_proportional_elements.ts +0 -93
- package/src/core/segment_buffers/implementations/text/html/utils.ts +0 -139
- package/src/core/segment_buffers/implementations/text/native/index.ts +0 -19
- package/src/core/segment_buffers/implementations/text/native/native_text_segment_buffer.ts +0 -340
- package/src/core/segment_buffers/implementations/text/native/parsers.ts +0 -47
- package/src/core/segment_buffers/implementations/types.ts +0 -386
- package/src/core/segment_buffers/implementations/utils/manual_time_ranges.ts +0 -80
- package/src/core/segment_buffers/index.ts +0 -67
- package/src/core/segment_buffers/inventory/buffered_history.ts +0 -131
- package/src/core/segment_buffers/inventory/index.ts +0 -30
- package/src/core/segment_buffers/inventory/segment_inventory.ts +0 -1111
- package/src/core/segment_buffers/inventory/types.ts +0 -35
- package/src/core/segment_buffers/segment_buffers_store.ts +0 -383
- package/src/core/stream/README.md +0 -59
- package/src/core/stream/adaptation/adaptation_stream.ts +0 -378
- package/src/core/stream/adaptation/index.ts +0 -20
- package/src/core/stream/adaptation/types.ts +0 -199
- package/src/core/stream/adaptation/utils/create_representation_estimator.ts +0 -114
- package/src/core/stream/index.ts +0 -38
- package/src/core/stream/orchestrator/README.md +0 -349
- package/src/core/stream/orchestrator/get_time_ranges_for_content.ts +0 -70
- package/src/core/stream/orchestrator/index.ts +0 -30
- package/src/core/stream/orchestrator/stream_orchestrator.ts +0 -664
- package/src/core/stream/period/index.ts +0 -20
- package/src/core/stream/period/period_stream.ts +0 -469
- package/src/core/stream/period/types.ts +0 -132
- package/src/core/stream/period/utils/get_adaptation_switch_strategy.ts +0 -287
- package/src/core/stream/representation/README.md +0 -16
- package/src/core/stream/representation/index.ts +0 -20
- package/src/core/stream/representation/representation_stream.ts +0 -474
- package/src/core/stream/representation/types.ts +0 -292
- package/src/core/stream/representation/utils/append_segment_to_buffer.ts +0 -77
- package/src/core/stream/representation/utils/check_for_discontinuity.ts +0 -305
- package/src/core/stream/representation/utils/downloading_queue.ts +0 -603
- package/src/core/stream/representation/utils/force_garbage_collection.ts +0 -113
- package/src/core/stream/representation/utils/get_buffer_status.ts +0 -322
- package/src/core/stream/representation/utils/get_needed_segments.ts +0 -617
- package/src/core/stream/representation/utils/get_segment_priority.ts +0 -43
- package/src/core/stream/representation/utils/push_init_segment.ts +0 -85
- package/src/core/stream/representation/utils/push_media_segment.ts +0 -113
- package/src/default_config.ts +0 -1293
- package/src/errors/README.md +0 -6
- package/src/errors/__tests__/assertion_error.test.ts +0 -26
- package/src/errors/__tests__/encrypted_media_error.test.ts +0 -45
- package/src/errors/__tests__/error_message.test.ts +0 -23
- package/src/errors/__tests__/format_error.test.ts +0 -62
- package/src/errors/__tests__/is_known_error.test.ts +0 -65
- package/src/errors/__tests__/media_error.test.ts +0 -55
- package/src/errors/__tests__/network_error.test.ts +0 -84
- package/src/errors/__tests__/other_error.test.ts +0 -53
- package/src/errors/__tests__/request_error.test.ts +0 -45
- package/src/errors/assertion_error.ts +0 -40
- package/src/errors/custom_loader_error.ts +0 -57
- package/src/errors/encrypted_media_error.ts +0 -71
- package/src/errors/error_codes.ts +0 -149
- package/src/errors/error_message.ts +0 -30
- package/src/errors/format_error.ts +0 -39
- package/src/errors/index.ts +0 -52
- package/src/errors/is_known_error.ts +0 -35
- package/src/errors/media_error.ts +0 -118
- package/src/errors/network_error.ts +0 -74
- package/src/errors/other_error.ts +0 -50
- package/src/errors/request_error.ts +0 -76
- package/src/experimental/README.md +0 -16
- package/src/experimental/features/__tests__/dash_wasm.test.ts +0 -44
- package/src/experimental/features/__tests__/debug_element.test.ts +0 -12
- package/src/experimental/features/__tests__/index.test.ts +0 -19
- package/src/experimental/features/__tests__/local.test.ts +0 -35
- package/src/experimental/features/__tests__/metaplaylist.test.ts +0 -35
- package/src/experimental/features/dash_wasm.ts +0 -41
- package/src/experimental/features/debug_element.ts +0 -13
- package/src/experimental/features/index.ts +0 -20
- package/src/experimental/features/local.ts +0 -28
- package/src/experimental/features/metaplaylist.ts +0 -28
- package/src/experimental/index.ts +0 -5
- package/src/experimental/tools/VideoThumbnailLoader/features/dash.ts +0 -23
- package/src/experimental/tools/VideoThumbnailLoader/features/metaplaylist.ts +0 -23
- package/src/experimental/tools/VideoThumbnailLoader/index.ts +0 -25
- package/src/experimental/tools/VideoThumbnailLoader/load_and_push_segment.ts +0 -77
- package/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +0 -75
- package/src/experimental/tools/VideoThumbnailLoader/remove_buffer_around_time.ts +0 -54
- package/src/experimental/tools/VideoThumbnailLoader/types.ts +0 -39
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader.ts +0 -423
- package/src/experimental/tools/VideoThumbnailLoader/video_thumbnail_loader_error.ts +0 -34
- package/src/experimental/tools/createMetaplaylist/get_duration_from_manifest.ts +0 -141
- package/src/experimental/tools/createMetaplaylist/index.ts +0 -72
- package/src/experimental/tools/index.ts +0 -27
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/capabilities.test.ts +0 -37
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/DRMInfos.test.ts +0 -140
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/HDCPPolicy.test.ts +0 -153
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/decodingInfos.test.ts +0 -405
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/defaultCodecFinder.test.ts +0 -136
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaContentType.test.ts +0 -294
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/probers/mediaDisplayInfos.test.ts +0 -189
- package/src/experimental/tools/mediaCapabilitiesProber/__tests__/utils.test.ts +0 -361
- package/src/experimental/tools/mediaCapabilitiesProber/api/index.ts +0 -184
- package/src/experimental/tools/mediaCapabilitiesProber/api/probeMediaConfiguration.ts +0 -136
- package/src/experimental/tools/mediaCapabilitiesProber/capabilities.ts +0 -169
- package/src/experimental/tools/mediaCapabilitiesProber/index.ts +0 -18
- package/src/experimental/tools/mediaCapabilitiesProber/log.ts +0 -21
- package/src/experimental/tools/mediaCapabilitiesProber/probers/DRMInfos.ts +0 -67
- package/src/experimental/tools/mediaCapabilitiesProber/probers/HDCPPolicy.ts +0 -89
- package/src/experimental/tools/mediaCapabilitiesProber/probers/decodingInfo.ts +0 -100
- package/src/experimental/tools/mediaCapabilitiesProber/probers/defaultCodecsFinder.ts +0 -66
- package/src/experimental/tools/mediaCapabilitiesProber/probers/index.ts +0 -44
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentType.ts +0 -66
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/format.ts +0 -100
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaContentTypeWithFeatures/index.ts +0 -105
- package/src/experimental/tools/mediaCapabilitiesProber/probers/mediaDisplayInfos.ts +0 -54
- package/src/experimental/tools/mediaCapabilitiesProber/types.ts +0 -75
- package/src/experimental/tools/mediaCapabilitiesProber/utils.ts +0 -107
- package/src/experimental/tools/parseBIFThumbnails.ts +0 -39
- package/src/features/README.md +0 -11
- package/src/features/__tests__/add_features.test.ts +0 -69
- package/src/features/__tests__/initialize_features.test.ts +0 -674
- package/src/features/add_features.ts +0 -37
- package/src/features/features_object.ts +0 -37
- package/src/features/index.ts +0 -40
- package/src/features/initialize_features.ts +0 -136
- package/src/features/list/__tests__/bif_parser.test.ts +0 -30
- package/src/features/list/__tests__/dash.test.ts +0 -41
- package/src/features/list/__tests__/directfile.test.ts +0 -35
- package/src/features/list/__tests__/eme.test.ts +0 -28
- package/src/features/list/__tests__/html_sami_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_srt_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_text_buffer.test.ts +0 -29
- package/src/features/list/__tests__/html_ttml_parser.test.ts +0 -33
- package/src/features/list/__tests__/html_vtt_parser.test.ts +0 -33
- package/src/features/list/__tests__/image_buffer.test.ts +0 -28
- package/src/features/list/__tests__/index.test.ts +0 -55
- package/src/features/list/__tests__/native_sami_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_srt_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_text_buffer.test.ts +0 -29
- package/src/features/list/__tests__/native_ttml_parser.test.ts +0 -33
- package/src/features/list/__tests__/native_vtt_parser.test.ts +0 -33
- package/src/features/list/__tests__/smooth.test.ts +0 -36
- package/src/features/list/bif_parser.ts +0 -31
- package/src/features/list/dash.ts +0 -36
- package/src/features/list/directfile.ts +0 -35
- package/src/features/list/eme.ts +0 -29
- package/src/features/list/html_sami_parser.ts +0 -31
- package/src/features/list/html_srt_parser.ts +0 -31
- package/src/features/list/html_text_buffer.ts +0 -29
- package/src/features/list/html_ttml_parser.ts +0 -31
- package/src/features/list/html_vtt_parser.ts +0 -31
- package/src/features/list/image_buffer.ts +0 -29
- package/src/features/list/index.ts +0 -32
- package/src/features/list/native_sami_parser.ts +0 -32
- package/src/features/list/native_srt_parser.ts +0 -32
- package/src/features/list/native_text_buffer.ts +0 -30
- package/src/features/list/native_ttml_parser.ts +0 -32
- package/src/features/list/native_vtt_parser.ts +0 -32
- package/src/features/list/smooth.ts +0 -32
- package/src/features/types.ts +0 -183
- package/src/index.ts +0 -38
- package/src/log.ts +0 -22
- package/src/manifest/README.md +0 -55
- package/src/manifest/__tests__/adaptation.test.ts +0 -485
- package/src/manifest/__tests__/manifest.test.ts +0 -428
- package/src/manifest/__tests__/period.test.ts +0 -769
- package/src/manifest/__tests__/representation.test.ts +0 -297
- package/src/manifest/__tests__/update_period_in_place.test.ts +0 -1074
- package/src/manifest/__tests__/update_periods.test.ts +0 -845
- package/src/manifest/adaptation.ts +0 -294
- package/src/manifest/index.ts +0 -67
- package/src/manifest/manifest.ts +0 -811
- package/src/manifest/period.ts +0 -211
- package/src/manifest/representation.ts +0 -451
- package/src/manifest/representation_index/__tests__/static.test.ts +0 -74
- package/src/manifest/representation_index/index.ts +0 -31
- package/src/manifest/representation_index/static.ts +0 -158
- package/src/manifest/representation_index/types.ts +0 -433
- package/src/manifest/types.ts +0 -33
- package/src/manifest/update_period_in_place.ts +0 -142
- package/src/manifest/update_periods.ts +0 -201
- package/src/manifest/utils.ts +0 -60
- package/src/minimal.ts +0 -34
- package/src/parsers/README.md +0 -12
- package/src/parsers/containers/isobmff/constants.ts +0 -24
- package/src/parsers/containers/isobmff/create_box.ts +0 -81
- package/src/parsers/containers/isobmff/drm/index.ts +0 -17
- package/src/parsers/containers/isobmff/drm/playready.ts +0 -45
- package/src/parsers/containers/isobmff/get_box.ts +0 -278
- package/src/parsers/containers/isobmff/index.ts +0 -51
- package/src/parsers/containers/isobmff/read.ts +0 -105
- package/src/parsers/containers/isobmff/take_pssh_out.ts +0 -101
- package/src/parsers/containers/isobmff/utils.ts +0 -555
- package/src/parsers/containers/matroska/index.ts +0 -21
- package/src/parsers/containers/matroska/utils.ts +0 -313
- package/src/parsers/images/bif.ts +0 -128
- package/src/parsers/manifest/dash/common/__tests__/attach_trickmode_track.test.ts +0 -65
- package/src/parsers/manifest/dash/common/__tests__/convert_supplemental_codecs.test.ts +0 -37
- package/src/parsers/manifest/dash/common/__tests__/flatten_overlapping_period.test.ts +0 -162
- package/src/parsers/manifest/dash/common/__tests__/get_clock_offset.test.ts +0 -65
- package/src/parsers/manifest/dash/common/__tests__/get_http_utc-timing_url.test.ts +0 -165
- package/src/parsers/manifest/dash/common/__tests__/get_periods_time_infos.test.ts +0 -118
- package/src/parsers/manifest/dash/common/__tests__/manifest_bounds_calculator.test.ts +0 -290
- package/src/parsers/manifest/dash/common/__tests__/parse_availability_start_time.test.ts +0 -63
- package/src/parsers/manifest/dash/common/attach_trickmode_track.ts +0 -55
- package/src/parsers/manifest/dash/common/convert_supplemental_codecs.ts +0 -32
- package/src/parsers/manifest/dash/common/flatten_overlapping_periods.ts +0 -87
- package/src/parsers/manifest/dash/common/get_clock_offset.ts +0 -41
- package/src/parsers/manifest/dash/common/get_hdr_information.ts +0 -94
- package/src/parsers/manifest/dash/common/get_http_utc-timing_url.ts +0 -46
- package/src/parsers/manifest/dash/common/get_minimum_and_maximum_positions.ts +0 -39
- package/src/parsers/manifest/dash/common/get_periods_time_infos.ts +0 -91
- package/src/parsers/manifest/dash/common/index.ts +0 -40
- package/src/parsers/manifest/dash/common/indexes/__tests__/tokens.test.ts +0 -60
- package/src/parsers/manifest/dash/common/indexes/base.ts +0 -444
- package/src/parsers/manifest/dash/common/indexes/get_init_segment.ts +0 -55
- package/src/parsers/manifest/dash/common/indexes/get_segments_from_timeline.ts +0 -148
- package/src/parsers/manifest/dash/common/indexes/index.ts +0 -39
- package/src/parsers/manifest/dash/common/indexes/list.ts +0 -338
- package/src/parsers/manifest/dash/common/indexes/template.ts +0 -652
- package/src/parsers/manifest/dash/common/indexes/timeline/__tests__/parse_s_element.test.ts +0 -115
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_elements.ts +0 -54
- package/src/parsers/manifest/dash/common/indexes/timeline/construct_timeline_from_previous_timeline.ts +0 -102
- package/src/parsers/manifest/dash/common/indexes/timeline/convert_element_to_index_segment.ts +0 -66
- package/src/parsers/manifest/dash/common/indexes/timeline/find_first_common_start_time.ts +0 -153
- package/src/parsers/manifest/dash/common/indexes/timeline/index.ts +0 -21
- package/src/parsers/manifest/dash/common/indexes/timeline/parse_s_element.ts +0 -72
- package/src/parsers/manifest/dash/common/indexes/timeline/timeline_representation_index.ts +0 -1049
- package/src/parsers/manifest/dash/common/indexes/tokens.ts +0 -127
- package/src/parsers/manifest/dash/common/indexes/utils.ts +0 -32
- package/src/parsers/manifest/dash/common/infer_adaptation_type.ts +0 -142
- package/src/parsers/manifest/dash/common/manifest_bounds_calculator.ts +0 -165
- package/src/parsers/manifest/dash/common/parse_adaptation_sets.ts +0 -569
- package/src/parsers/manifest/dash/common/parse_availability_start_time.ts +0 -35
- package/src/parsers/manifest/dash/common/parse_mpd.ts +0 -399
- package/src/parsers/manifest/dash/common/parse_periods.ts +0 -363
- package/src/parsers/manifest/dash/common/parse_representation_index.ts +0 -199
- package/src/parsers/manifest/dash/common/parse_representations.ts +0 -352
- package/src/parsers/manifest/dash/common/resolve_base_urls.ts +0 -58
- package/src/parsers/manifest/dash/index.ts +0 -22
- package/src/parsers/manifest/dash/js-parser/__tests__/parse_from_document.test.ts +0 -45
- package/src/parsers/manifest/dash/js-parser/index.ts +0 -18
- package/src/parsers/manifest/dash/js-parser/node_parsers/AdaptationSet.ts +0 -381
- package/src/parsers/manifest/dash/js-parser/node_parsers/BaseURL.ts +0 -35
- package/src/parsers/manifest/dash/js-parser/node_parsers/ContentComponent.ts +0 -49
- package/src/parsers/manifest/dash/js-parser/node_parsers/ContentProtection.ts +0 -94
- package/src/parsers/manifest/dash/js-parser/node_parsers/EventStream.ts +0 -117
- package/src/parsers/manifest/dash/js-parser/node_parsers/Initialization.ts +0 -48
- package/src/parsers/manifest/dash/js-parser/node_parsers/MPD.ts +0 -180
- package/src/parsers/manifest/dash/js-parser/node_parsers/Period.ts +0 -152
- package/src/parsers/manifest/dash/js-parser/node_parsers/Representation.ts +0 -234
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentBase.ts +0 -112
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentList.ts +0 -50
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentTemplate.ts +0 -98
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentTimeline.ts +0 -35
- package/src/parsers/manifest/dash/js-parser/node_parsers/SegmentURL.ts +0 -63
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/AdaptationSet.test.ts +0 -407
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentComponent.test.ts +0 -67
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/ContentProtection.test.ts +0 -223
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/Initialization.test.ts +0 -139
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentTimeline.test.ts +0 -119
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/SegmentURL.test.ts +0 -205
- package/src/parsers/manifest/dash/js-parser/node_parsers/__tests__/utils.test.ts +0 -218
- package/src/parsers/manifest/dash/js-parser/node_parsers/utils.ts +0 -384
- package/src/parsers/manifest/dash/js-parser/parse_from_document.ts +0 -129
- package/src/parsers/manifest/dash/node_parser_types.ts +0 -431
- package/src/parsers/manifest/dash/parsers_types.ts +0 -91
- package/src/parsers/manifest/dash/wasm-parser/Cargo.lock +0 -25
- package/src/parsers/manifest/dash/wasm-parser/Cargo.toml +0 -16
- package/src/parsers/manifest/dash/wasm-parser/README.md +0 -267
- package/src/parsers/manifest/dash/wasm-parser/index.ts +0 -21
- package/src/parsers/manifest/dash/wasm-parser/rs/errors.rs +0 -28
- package/src/parsers/manifest/dash/wasm-parser/rs/events.rs +0 -373
- package/src/parsers/manifest/dash/wasm-parser/rs/lib.rs +0 -85
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/attributes.rs +0 -414
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/mod.rs +0 -472
- package/src/parsers/manifest/dash/wasm-parser/rs/processor/s_element.rs +0 -72
- package/src/parsers/manifest/dash/wasm-parser/rs/reader.rs +0 -17
- package/src/parsers/manifest/dash/wasm-parser/rs/reportable.rs +0 -147
- package/src/parsers/manifest/dash/wasm-parser/rs/utils.rs +0 -217
- package/src/parsers/manifest/dash/wasm-parser/ts/dash-wasm-parser.ts +0 -477
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/AdaptationSet.ts +0 -343
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/BaseURL.ts +0 -38
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentComponent.ts +0 -53
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/ContentProtection.ts +0 -62
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/EventStream.ts +0 -144
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/MPD.ts +0 -183
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Period.ts +0 -180
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Representation.ts +0 -215
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/Scheme.ts +0 -44
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentBase.ts +0 -115
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentList.ts +0 -61
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentTemplate.ts +0 -133
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/SegmentUrl.ts +0 -70
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/XLink.ts +0 -66
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/index.ts +0 -17
- package/src/parsers/manifest/dash/wasm-parser/ts/generators/root.ts +0 -66
- package/src/parsers/manifest/dash/wasm-parser/ts/parsers_stack.ts +0 -80
- package/src/parsers/manifest/dash/wasm-parser/ts/types.ts +0 -298
- package/src/parsers/manifest/dash/wasm-parser/ts/utils.ts +0 -47
- package/src/parsers/manifest/index.ts +0 -17
- package/src/parsers/manifest/local/index.ts +0 -25
- package/src/parsers/manifest/local/parse_local_manifest.ts +0 -164
- package/src/parsers/manifest/local/representation_index.ts +0 -246
- package/src/parsers/manifest/local/types.ts +0 -291
- package/src/parsers/manifest/metaplaylist/index.ts +0 -28
- package/src/parsers/manifest/metaplaylist/metaplaylist_parser.ts +0 -335
- package/src/parsers/manifest/metaplaylist/representation_index.ts +0 -251
- package/src/parsers/manifest/smooth/create_parser.ts +0 -699
- package/src/parsers/manifest/smooth/get_codecs.ts +0 -55
- package/src/parsers/manifest/smooth/index.ts +0 -26
- package/src/parsers/manifest/smooth/parse_C_nodes.ts +0 -69
- package/src/parsers/manifest/smooth/parse_protection_node.ts +0 -72
- package/src/parsers/manifest/smooth/representation_index.ts +0 -704
- package/src/parsers/manifest/smooth/utils/add_segment_infos.ts +0 -77
- package/src/parsers/manifest/smooth/utils/parseBoolean.ts +0 -31
- package/src/parsers/manifest/smooth/utils/reduceChildren.ts +0 -36
- package/src/parsers/manifest/smooth/utils/tokens.ts +0 -46
- package/src/parsers/manifest/types.ts +0 -395
- package/src/parsers/manifest/utils/__tests__/get_first_time_from_adaptations.test.ts +0 -161
- package/src/parsers/manifest/utils/__tests__/get_last_time_from_adaptation.test.ts +0 -161
- package/src/parsers/manifest/utils/__tests__/index_helpers.test.ts +0 -55
- package/src/parsers/manifest/utils/__tests__/update_segment_timeline.test.ts +0 -546
- package/src/parsers/manifest/utils/check_manifest_ids.ts +0 -83
- package/src/parsers/manifest/utils/clear_timeline_from_position.ts +0 -74
- package/src/parsers/manifest/utils/get_first_time_from_adaptation.ts +0 -48
- package/src/parsers/manifest/utils/get_last_time_from_adaptation.ts +0 -50
- package/src/parsers/manifest/utils/get_maximum_positions.ts +0 -87
- package/src/parsers/manifest/utils/get_minimum_position.ts +0 -80
- package/src/parsers/manifest/utils/index_helpers.ts +0 -204
- package/src/parsers/manifest/utils/update_segment_timeline.ts +0 -141
- package/src/parsers/texttracks/index.ts +0 -21
- package/src/parsers/texttracks/sami/html.ts +0 -219
- package/src/parsers/texttracks/sami/native.ts +0 -192
- package/src/parsers/texttracks/srt/__tests__/find_end_of_cue_block.test.ts +0 -99
- package/src/parsers/texttracks/srt/__tests__/get_cue_blocks.test.ts +0 -119
- package/src/parsers/texttracks/srt/__tests__/parse_cue.test.ts +0 -123
- package/src/parsers/texttracks/srt/__tests__/parse_timestamp.test.ts +0 -36
- package/src/parsers/texttracks/srt/find_end_of_cue_block.ts +0 -46
- package/src/parsers/texttracks/srt/get_cue_blocks.ts +0 -49
- package/src/parsers/texttracks/srt/html.ts +0 -182
- package/src/parsers/texttracks/srt/native.ts +0 -74
- package/src/parsers/texttracks/srt/parse_cue.ts +0 -76
- package/src/parsers/texttracks/srt/parse_timestamp.ts +0 -37
- package/src/parsers/texttracks/ttml/__tests__/resolve_styles_inheritance.test.ts +0 -248
- package/src/parsers/texttracks/ttml/get_parameters.ts +0 -106
- package/src/parsers/texttracks/ttml/get_styling.ts +0 -146
- package/src/parsers/texttracks/ttml/get_time_delimiters.ts +0 -49
- package/src/parsers/texttracks/ttml/html/__tests__/__global__/html_ttml_parser.test.test.ts +0 -190
- package/src/parsers/texttracks/ttml/html/__tests__/generate_css_test_outline.test.ts +0 -32
- package/src/parsers/texttracks/ttml/html/__tests__/ttml_color_to_css_color.test.ts +0 -62
- package/src/parsers/texttracks/ttml/html/apply_default_ttml_paragraph_style.ts +0 -67
- package/src/parsers/texttracks/ttml/html/apply_extent.ts +0 -65
- package/src/parsers/texttracks/ttml/html/apply_font_size.ts +0 -62
- package/src/parsers/texttracks/ttml/html/apply_line_height.ts +0 -50
- package/src/parsers/texttracks/ttml/html/apply_origin.ts +0 -64
- package/src/parsers/texttracks/ttml/html/apply_padding.ts +0 -141
- package/src/parsers/texttracks/ttml/html/create_element.ts +0 -549
- package/src/parsers/texttracks/ttml/html/generate_css_test_outline.ts +0 -46
- package/src/parsers/texttracks/ttml/html/index.ts +0 -23
- package/src/parsers/texttracks/ttml/html/parse_cue.ts +0 -65
- package/src/parsers/texttracks/ttml/html/parse_ttml_to_div.ts +0 -58
- package/src/parsers/texttracks/ttml/html/ttml_color_to_css_color.ts +0 -68
- package/src/parsers/texttracks/ttml/native/index.ts +0 -23
- package/src/parsers/texttracks/ttml/native/parse_cue.ts +0 -245
- package/src/parsers/texttracks/ttml/native/parse_ttml_to_vtt.ts +0 -39
- package/src/parsers/texttracks/ttml/parse_ttml.ts +0 -206
- package/src/parsers/texttracks/ttml/regexps.ts +0 -65
- package/src/parsers/texttracks/ttml/resolve_styles_inheritance.ts +0 -84
- package/src/parsers/texttracks/ttml/time_parsing.ts +0 -156
- package/src/parsers/texttracks/ttml/xml_utils.ts +0 -166
- package/src/parsers/texttracks/types.ts +0 -34
- package/src/parsers/texttracks/webvtt/__tests__/get_cue_blocks.test.ts +0 -218
- package/src/parsers/texttracks/webvtt/__tests__/get_style_blocks.test.ts +0 -65
- package/src/parsers/texttracks/webvtt/__tests__/parse_cue_block.test.ts +0 -249
- package/src/parsers/texttracks/webvtt/__tests__/parse_timestamp.test.ts +0 -39
- package/src/parsers/texttracks/webvtt/__tests__/utils.test.ts +0 -401
- package/src/parsers/texttracks/webvtt/get_cue_blocks.ts +0 -51
- package/src/parsers/texttracks/webvtt/get_style_blocks.ts +0 -56
- package/src/parsers/texttracks/webvtt/html/__tests__/convert_payload_to_html.test.ts +0 -106
- package/src/parsers/texttracks/webvtt/html/__tests__/create_default_style_elements.test.ts +0 -44
- package/src/parsers/texttracks/webvtt/html/__tests__/create_style_attribute.test.ts +0 -139
- package/src/parsers/texttracks/webvtt/html/__tests__/create_styled_element.test.ts +0 -140
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_style_block.test.ts +0 -345
- package/src/parsers/texttracks/webvtt/html/__tests__/parse_webvtt_to_div.test.ts +0 -181
- package/src/parsers/texttracks/webvtt/html/__tests__/to_html.test.ts +0 -234
- package/src/parsers/texttracks/webvtt/html/convert_payload_to_html.ts +0 -46
- package/src/parsers/texttracks/webvtt/html/create_default_style_elements.ts +0 -26
- package/src/parsers/texttracks/webvtt/html/create_style_attribute.ts +0 -222
- package/src/parsers/texttracks/webvtt/html/create_styled_element.ts +0 -95
- package/src/parsers/texttracks/webvtt/html/index.ts +0 -25
- package/src/parsers/texttracks/webvtt/html/parse_style_block.ts +0 -76
- package/src/parsers/texttracks/webvtt/html/parse_webvtt_to_div.ts +0 -67
- package/src/parsers/texttracks/webvtt/html/to_html.ts +0 -96
- package/src/parsers/texttracks/webvtt/native/index.ts +0 -23
- package/src/parsers/texttracks/webvtt/native/parse_vtt_to_cues.ts +0 -70
- package/src/parsers/texttracks/webvtt/native/set_settings_on_cue.ts +0 -95
- package/src/parsers/texttracks/webvtt/native/to_native_cue.ts +0 -34
- package/src/parsers/texttracks/webvtt/parse_cue_block.ts +0 -128
- package/src/parsers/texttracks/webvtt/parse_timestamp.ts +0 -40
- package/src/parsers/texttracks/webvtt/utils.ts +0 -135
- package/src/public_types.ts +0 -846
- package/src/tools/README.md +0 -4
- package/src/tools/TextTrackRenderer/index.ts +0 -28
- package/src/tools/TextTrackRenderer/text_track_renderer.ts +0 -107
- package/src/tools/index.ts +0 -20
- package/src/tools/string_utils.ts +0 -24
- package/src/transports/README.md +0 -276
- package/src/transports/dash/add_segment_integrity_checks_to_loader.ts +0 -98
- package/src/transports/dash/construct_segment_url.ts +0 -28
- package/src/transports/dash/extract_complete_chunks.ts +0 -66
- package/src/transports/dash/get_events_out_of_emsgs.ts +0 -105
- package/src/transports/dash/image_pipelines.ts +0 -122
- package/src/transports/dash/index.ts +0 -23
- package/src/transports/dash/init_segment_loader.ts +0 -114
- package/src/transports/dash/low_latency_segment_loader.ts +0 -87
- package/src/transports/dash/manifest_parser.ts +0 -325
- package/src/transports/dash/pipelines.ts +0 -72
- package/src/transports/dash/segment_loader.ts +0 -249
- package/src/transports/dash/segment_parser.ts +0 -194
- package/src/transports/dash/text_loader.ts +0 -120
- package/src/transports/dash/text_parser.ts +0 -234
- package/src/transports/index.ts +0 -17
- package/src/transports/local/index.ts +0 -18
- package/src/transports/local/pipelines.ts +0 -100
- package/src/transports/local/segment_loader.ts +0 -198
- package/src/transports/local/segment_parser.ts +0 -101
- package/src/transports/local/text_parser.ts +0 -185
- package/src/transports/metaplaylist/README.md +0 -94
- package/src/transports/metaplaylist/index.ts +0 -23
- package/src/transports/metaplaylist/manifest_loader.ts +0 -62
- package/src/transports/metaplaylist/pipelines.ts +0 -425
- package/src/transports/smooth/extract_timings_infos.ts +0 -142
- package/src/transports/smooth/index.ts +0 -23
- package/src/transports/smooth/isobmff/__tests__/create_boxes.test.ts +0 -231
- package/src/transports/smooth/isobmff/create_audio_init_segment.ts +0 -84
- package/src/transports/smooth/isobmff/create_boxes.ts +0 -481
- package/src/transports/smooth/isobmff/create_init_segment.ts +0 -100
- package/src/transports/smooth/isobmff/create_traf_box.ts +0 -40
- package/src/transports/smooth/isobmff/create_video_init_segment.ts +0 -78
- package/src/transports/smooth/isobmff/get_aaces_header.ts +0 -62
- package/src/transports/smooth/isobmff/index.ts +0 -32
- package/src/transports/smooth/isobmff/parse_tfrf.ts +0 -57
- package/src/transports/smooth/isobmff/parse_tfxd.ts +0 -38
- package/src/transports/smooth/isobmff/patch_segment.ts +0 -171
- package/src/transports/smooth/pipelines.ts +0 -533
- package/src/transports/smooth/segment_loader.ts +0 -288
- package/src/transports/smooth/utils.ts +0 -106
- package/src/transports/types.ts +0 -809
- package/src/transports/utils/__tests__/byte_range.test.ts +0 -35
- package/src/transports/utils/__tests__/check_isobmff_integrity.test.ts +0 -148
- package/src/transports/utils/__tests__/find_complete_box.test.ts +0 -138
- package/src/transports/utils/__tests__/infer_segment_container.test.ts +0 -227
- package/src/transports/utils/byte_range.ts +0 -25
- package/src/transports/utils/call_custom_manifest_loader.ts +0 -147
- package/src/transports/utils/check_isobmff_integrity.ts +0 -50
- package/src/transports/utils/find_complete_box.ts +0 -63
- package/src/transports/utils/generate_manifest_loader.ts +0 -97
- package/src/transports/utils/get_isobmff_timing_infos.ts +0 -86
- package/src/transports/utils/infer_segment_container.ts +0 -56
- package/src/transports/utils/parse_text_track.ts +0 -176
- package/src/typings/README.md +0 -7
- package/src/typings/globals.d.ts +0 -83
- package/src/typings/next-tick.d.ts +0 -23
- package/src/utils/README.md +0 -5
- package/src/utils/__tests__/are_arrays_of_numbers_equal.test.ts +0 -86
- package/src/utils/__tests__/are_codecs_compatible.test.ts +0 -88
- package/src/utils/__tests__/array_find.test.ts +0 -113
- package/src/utils/__tests__/array_find_index.test.ts +0 -113
- package/src/utils/__tests__/array_includes.test.ts +0 -151
- package/src/utils/__tests__/assert.test.ts +0 -237
- package/src/utils/__tests__/assert_unreachable.test.ts +0 -40
- package/src/utils/__tests__/base64.test.ts +0 -147
- package/src/utils/__tests__/byte_parsing.test.ts +0 -267
- package/src/utils/__tests__/deep_merge.test.ts +0 -48
- package/src/utils/__tests__/event_emitter.test.ts +0 -579
- package/src/utils/__tests__/flat_map.test.ts +0 -71
- package/src/utils/__tests__/get_fuzzed_delay.test.ts +0 -32
- package/src/utils/__tests__/hash_buffer.test.ts +0 -105
- package/src/utils/__tests__/id_generator.test.ts +0 -80
- package/src/utils/__tests__/initialization_segment_cache.test.ts +0 -245
- package/src/utils/__tests__/is_non_empty_string.test.ts +0 -41
- package/src/utils/__tests__/is_null_or_undefined.test.ts +0 -33
- package/src/utils/__tests__/list_to_map.test.ts +0 -46
- package/src/utils/__tests__/logger.test.ts +0 -214
- package/src/utils/__tests__/noop.test.ts +0 -23
- package/src/utils/__tests__/object_assign.test.ts +0 -56
- package/src/utils/__tests__/object_values.test.ts +0 -26
- package/src/utils/__tests__/ranges.test.ts +0 -907
- package/src/utils/__tests__/resolve_url.test.ts +0 -100
- package/src/utils/__tests__/simple_set.test.ts +0 -57
- package/src/utils/__tests__/sorted_list.test.ts +0 -335
- package/src/utils/__tests__/starts_with.test.ts +0 -65
- package/src/utils/__tests__/string_parsing.test.ts +0 -267
- package/src/utils/__tests__/uniq.test.ts +0 -134
- package/src/utils/__tests__/warn_once.test.ts +0 -38
- package/src/utils/__tests__/weak_map_memory.test.ts +0 -188
- package/src/utils/are_arrays_of_numbers_equal.ts +0 -39
- package/src/utils/are_codecs_compatible.ts +0 -51
- package/src/utils/array_find.ts +0 -55
- package/src/utils/array_find_index.ts +0 -54
- package/src/utils/array_includes.ts +0 -93
- package/src/utils/assert.ts +0 -65
- package/src/utils/assert_unreachable.ts +0 -45
- package/src/utils/base64.ts +0 -153
- package/src/utils/byte_parsing.ts +0 -256
- package/src/utils/cancellable_sleep.ts +0 -41
- package/src/utils/create_cancellable_promise.ts +0 -69
- package/src/utils/deep_merge.ts +0 -49
- package/src/utils/event_emitter.ts +0 -147
- package/src/utils/flat_map.ts +0 -50
- package/src/utils/get_fuzzed_delay.ts +0 -27
- package/src/utils/hash_buffer.ts +0 -42
- package/src/utils/id_generator.ts +0 -35
- package/src/utils/initialization_segment_cache.ts +0 -68
- package/src/utils/is_non_empty_string.ts +0 -23
- package/src/utils/is_null_or_undefined.ts +0 -27
- package/src/utils/languages/ISO_639-1_to_ISO_639-3.ts +0 -207
- package/src/utils/languages/ISO_639-2_to_ISO_639-3.ts +0 -43
- package/src/utils/languages/__tests__/normalize.test.ts +0 -290
- package/src/utils/languages/index.ts +0 -29
- package/src/utils/languages/normalize.ts +0 -152
- package/src/utils/list_to_map.ts +0 -32
- package/src/utils/logger.ts +0 -100
- package/src/utils/noop.ts +0 -26
- package/src/utils/object_assign.ts +0 -60
- package/src/utils/object_values.ts +0 -31
- package/src/utils/ranges.ts +0 -499
- package/src/utils/reference.ts +0 -390
- package/src/utils/request/fetch.ts +0 -250
- package/src/utils/request/index.ts +0 -38
- package/src/utils/request/xhr.ts +0 -287
- package/src/utils/resolve_url.ts +0 -126
- package/src/utils/retry_promise_with_backoff.ts +0 -95
- package/src/utils/simple_set.ts +0 -67
- package/src/utils/sleep.ts +0 -14
- package/src/utils/slice_uint8array.ts +0 -53
- package/src/utils/sorted_list.ts +0 -240
- package/src/utils/starts_with.ts +0 -42
- package/src/utils/string_parsing.ts +0 -414
- package/src/utils/task_canceller.ts +0 -367
- package/src/utils/uniq.ts +0 -49
- package/src/utils/warn_once.ts +0 -34
- package/src/utils/weak_map_memory.ts +0 -89
- package/src/utils/wrapInPromise.ts +0 -24
- package/tsconfig.json +0 -28
- package/tsconfig.modules.json +0 -36
package/dist/rx-player.min.js
CHANGED
|
@@ -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,{$u:function(){return h},GQ:function(){return y},SB:function(){return f},YM:function(){return l},fq:function(){return u},kD:function(){return s},lV:function(){return g},l_:function(){return m},op:function(){return v},vS:function(){return c},vU:function(){return d},yS:function(){return p}});var r,i,a,o=n(2203),s=!1,u=!1,l=!1,d=!1,c=!1,f=!1,v=!1,p=!1,h=!1,m=!1,g=!1,y=!1;o.Z||(void 0!==window.MSInputMethodContext&&void 0!==document.documentMode?(u=!0,l=!0):"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)?l=!0:-1!==navigator.userAgent.toLowerCase().indexOf("edg/")?s=!0:-1!==navigator.userAgent.toLowerCase().indexOf("firefox")?d=!0:"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)?f=!0:(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())||/Safari\/(\d+)/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&-1!==(null===(a=navigator.vendor)||void 0===a?void 0:a.indexOf("Apple"))&&!/Chrome\/(\d+)/.test(navigator.userAgent)&&!/Chromium\/(\d+)/.test(navigator.userAgent))&&(c=!0),/SamsungBrowser/.test(navigator.userAgent)&&(v=!0),-1!==navigator.userAgent.indexOf("PlayStation 5")?g=!0:/Tizen/.test(navigator.userAgent)?p=!0:/[Ww]eb[O0]S/.test(navigator.userAgent)?(h=!0,/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent)||/[Cc]hr[o0]me\/87/.test(navigator.userAgent)||(/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent)||/[Cc]hr[o0]me\/79/.test(navigator.userAgent))):/[Pp]anasonic/.test(navigator.userAgent)?m=!0:-1!==navigator.userAgent.indexOf("Xbox")&&(y=!0))},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")}},3038:function(e,t,n){"use strict";n.d(t,{Dl:function(){return x},M4:function(){return P},N8:function(){return k},O0:function(){return y},Q$:function(){return M},Q4:function(){return S},RV:function(){return I},S1:function(){return f},XR:function(){return p},bQ:function(){return C},it:function(){return g},k6:function(){return E},kJ:function(){return b},kk:function(){return Z},qo:function(){return R},u_:function(){return T},w0:function(){return m},x6:function(){return A},y4:function(){return w},zU:function(){return _}});var r=n(6872),i=n(6923),a=n(1946),o=n(8894),s=n(5095),u=n(2203),l=["","webkit","moz","ms"],d=u.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function c(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 f(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((void 0===t?l:t).map((function(e){return e+n})))}),[])}(e,t);return function(e,t,a){if(!a.isCancelled()){if(e instanceof HTMLElement){if(void 0===n&&(n=c(e,r)),!(0,i.Z)(n))return void 0;e.addEventListener(n,t),a.register((function(){void 0!==n&&e.removeEventListener(n,t)}))}r.forEach((function(n){var r=!1;"function"==typeof e.addEventListener?e.addEventListener(n,t):(r=!0,e["on"+n]=t),a.register((function(){"function"==typeof e.removeEventListener&&e.removeEventListener(n,t),r&&delete e["on"+n]}))}))}}}function v(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,i.Z)(t)?t+"Hidden":"hidden",a=(0,i.Z)(t)?t+"visibilitychange":"visibilitychange",o=document[r],u=new s.Z(!o,e);return D(document,a,(function(){var e=!document[r];u.setValueIfChanged(e)}),e),u}function p(e){var t,n=v(e),i=new s.Z(!0,e);return e.register((function(){clearTimeout(t),t=void 0})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=r.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){i.setValueIfChanged(!1)}),n)}i.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),i}function h(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function m(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=new s.Z({isEnabled:r,pipWindow:null},t);return D(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),i}var a=document.pictureInPictureElement===n,o=new s.Z({isEnabled:a,pipWindow:null},t);return D(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),D(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),o}function g(e,t){var n,i=v(t),a=new s.Z(!0,t);return t.register((function(){clearTimeout(n),n=void 0})),i.onUpdate(o,{clearSignal:t}),e.onUpdate(o,{clearSignal:t}),o(),a;function o(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||i.getValue())a.setValueIfChanged(!0);else{var t=r.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){a.setValueIfChanged(!1)}),t)}}}function y(e,t,n){var r=new s.Z(e.clientWidth*d,n),i=o.Z;t.onUpdate(l,{clearSignal:n}),D(window,"resize",l,n);var u=window.setInterval(l,2e4);return l(),n.register((function(){i(),clearInterval(u)})),r;function l(){i();var n=t.getValue();if(n.isEnabled)if((0,a.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var s=n.pipWindow,u=h(e,s),l=function(){r.setValueIfChanged(h(e,s)*d)};s.addEventListener("resize",l),i=function(){s.removeEventListener("resize",l),i=o.Z},r.setValueIfChanged(u*d)}else r.setValueIfChanged(e.clientWidth*d)}}f(["loadedmetadata"]),f(["timeupdate"]);var _=f(["fullscreenchange","FullscreenChange"],l.concat("MS")),b=f(["addtrack"]),S=f(["removetrack"]),T=f(["sourceopen","webkitsourceopen"]),E=f(["sourceclose","webkitsourceclose"]),k=f(["sourceended","webkitsourceended"]),w=f(["update"]),A=f(["removesourcebuffer"]),I=f(["keymessage","message"]),Z=f(["keyadded","ready"]),x=f(["keyerror","error"]),R=f(["keystatuseschange"]),M=f(["seeking"]),C=f(["seeked"]),P=f(["ended"]);function D(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)}},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},MINIMUM_MAX_BUFFER_AHEAD:{text:120},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_ENTER_BUFFER_BASED_ALGO:10,ABR_EXIT_BUFFER_BASED_ALGO:5,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},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_VIDEO_CODECS:['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'],EME_DEFAULT_AUDIO_CODECS:['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"],EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_DEFAULT_PLAYREADY_ROBUSTNESSES:["3000","2000"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready.recommendation","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 d;(0,i.Z)(e,((d={})[u]=s[u],d))}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 c}});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 d={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:d,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 d="forced"===a.kind||void 0,c={language:a.language,forced:d,label:a.label,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function d(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 c=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?d(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,label:t.label,forced:t.forced,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=d(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=d(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}}},245:function(e,t,n){"use strict";n.d(t,{M:function(){return a},Z:function(){return i}});var r=n(770);function i(e){var t=r.Z.getState(e);return null===t?null:[t.mediaKeySystemAccess.keySystem,t.mediaKeySystemAccess.getConfiguration()]}function a(e){var t=r.Z.getState(e);return null==t?null:t.keySystemOptions.type}},3380:function(e,t,n){"use strict";n.d(t,{ZP:function(){return It}});var r,i=n(5861),a=n(4578),o=n(4687),s=n.n(o),u=n(3714),l=n(811),d=n(1946),c=n(3666),f=n(3038),v=n(2203);if(!v.Z){var p=window.WebKitMediaKeys;void 0!==p&&"function"==typeof p.isTypeSupported&&"function"==typeof p.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=p)}var h,m=n(1656),g=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,m.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}();if(!v.Z){var y=window.MSMediaKeys;void 0!==y&&void 0!==y.prototype&&"function"==typeof y.isTypeSupported&&"function"==typeof y.prototype.createSession&&(h=y)}var _=n(1959),b=n(288);function S(e){try{var t=e();return"object"==typeof t&&null!==t&&"function"==typeof t.then?t:Promise.resolve(t)}catch(e){return Promise.reject(e)}}var T,E=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._sessionClosingCanceller=new b.ZP,n.closed=new Promise((function(e){n._sessionClosingCanceller.signal.register((function(){return 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,a.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),f.RV(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"message",e)}),n._sessionClosingCanceller.signal),f.kk(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyadded",e)}),n._sessionClosingCanceller.signal),f.Dl(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyerror",e)}),n._sessionClosingCanceller.signal),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._sessionClosingCanceller.cancel(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,m.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}(_.Z),k=function(){function e(e){if(void 0===h)throw new Error("No MSMediaKeys API.");this._mediaKeys=new h(e)}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){t._videoElement=e,void 0!==t._videoElement.msSetMediaKeys&&t._videoElement.msSetMediaKeys(t._mediaKeys)}))},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new E(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!v.Z){var w=window.MozMediaKeys;void 0!==w&&void 0!==w.prototype&&"function"==typeof w.isTypeSupported&&"function"==typeof w.prototype.createSession&&(T=w)}var A=n(9689),I=n(8894),Z=n(3635);function x(e){return"function"==typeof e.webkitGenerateKeyRequest}var R=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=I.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,a.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,Z.uR)(i)),o=(0,A.K)(a.keys[0].k),s=(0,A.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}(_.Z),M=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){if(!x(e))throw new Error("Video not attached to the MediaKeys");t._videoElement=e}))},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new R(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var C=n(9252),P=n(6968);function D(e,t){var n=e;return S((function(){if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");n.webkitSetMediaKeys(t)}))}var N=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=I.Z,i._closeSession=I.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,a.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(a=n._keyType,(0,C.Z)(a,"com.apple.fps")){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,P.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,Z.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,Z.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,P.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,P.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,m.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}(_.Z),O=function(){function e(e){if(void 0===r)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new r(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 D(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 N(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();function L(){if(void 0===r)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:r.isTypeSupported,createCustomMediaKeys:function(e){return new O(e)},setMediaKeys:function(e,t){if(null===t)return D(e,t);if(!(t instanceof O))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}var U=function(e){var t,n,i,a=B;if("standard"!==e&&("auto"!==e||(c.vS||c.SB)&&void 0!==r)||!v.Z&&(0,d.Z)(navigator.requestMediaKeySystemAccess)){var o,s;if("webkit"===e&&void 0!==r){n=(0,f.S1)(["needkey"]);var p=L();o=p.isTypeSupported,s=p.createCustomMediaKeys,a=p.setMediaKeys,i="webkit"}else if(x(HTMLVideoElement.prototype)){n=(0,f.S1)(["needkey"]);var m={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 M(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof M))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}};o=m.isTypeSupported,s=m.createCustomMediaKeys,a=m.setMediaKeys,i="older-webkit"}else if(void 0!==r){n=(0,f.S1)(["needkey"]);var y=L();o=y.isTypeSupported,s=y.createCustomMediaKeys,a=y.setMediaKeys,i="webkit"}else if(c.fq&&void 0!==h){n=(0,f.S1)(["encrypted","needkey"]);var _={isTypeSupported:function(e,t){if(void 0===h)throw new Error("No MSMediaKeys API.");return void 0!==t?h.isTypeSupported(e,t):h.isTypeSupported(e)},createCustomMediaKeys:function(e){return new k(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof k))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}};o=_.isTypeSupported,s=_.createCustomMediaKeys,a=_.setMediaKeys,i="ms"}else if(void 0!==T){n=(0,f.S1)(["encrypted","needkey"]);var b={isTypeSupported:function(e,t){if(void 0===T)throw new Error("No MozMediaKeys API.");return void 0!==t?T.isTypeSupported(e,t):T.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===T)throw new Error("No MozMediaKeys API.");return new T(e)},setMediaKeys:function(e,t){return S((function(){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)}))}};o=b.isTypeSupported,s=b.createCustomMediaKeys,a=b.setMediaKeys,i="moz"}else{n=(0,f.S1)(["encrypted","needkey"]);var E=window.MediaKeys,w=function(){if(void 0===E)throw new u.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===E.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.")}};o=function(e){return w(),(0,l.Z)("function"==typeof E.isTypeSupported),E.isTypeSupported(e)},s=function(e){return w(),new E(e)},i="unknown"}t=function(e,t){if(!o(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,u=r.initDataTypes,l=r.distinctiveIdentifier,d=!0;if(d=(d=d&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var c={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(c.videoCapabilities=i),void 0!==a&&(c.audioCapabilities=a);var f=s(e);return Promise.resolve(new g(e,f,c))}}return Promise.reject(new Error("Unsupported configuration"))}}else t=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)},n=(0,f.S1)(["encrypted"]),i="standard";return{requestMediaKeySystemAccess:t,onEncrypted:n,setMediaKeys:a,implementation:i}}("auto");function B(e,t){try{var n,r=e;return"function"==typeof r.setMediaKeys?n=r.setMediaKeys(t):"function"==typeof r.webkitSetMediaKeys?n=r.webkitSetMediaKeys(t):"function"==typeof r.mozSetMediaKeys?n=r.mozSetMediaKeys(t):"function"==typeof r.msSetMediaKeys&&null!==t&&(n=r.msSetMediaKeys(t)),"object"==typeof n&&null!==n&&"function"==typeof n.then?n:Promise.resolve(n)}catch(e){return Promise.reject(e)}}var F=U,V=n(3887),z=n(6490),K=n(4791),G=(0,P.pX)((0,Z.tG)("pssh"),0);function W(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,K.Z)(t.data,r.data))return!0}return!1}function H(e){var t=e.initData,n=e.initDataType;if(null==t)return V.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,P.pX)(e,n+4)!==G)return V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,P.pX)(new Uint8Array(e),n);if(n+r>e.length)return V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,z.Y)(i,8),data:i};W(t,a)?V.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:r}}var j=n(6872),q=n(5157),Y=n(5389),X=n(3274),Q=n(7714),$=n(770);function J(e){return $.Z.setState(e,null),F.setMediaKeys(e,null).then((function(){V.Z.info("DRM: MediaKeys disabled with success")})).catch((function(e){V.Z.error("DRM: Could not disable MediaKeys",e instanceof Error?e:"Unknown Error")}))}function ee(){return(ee=(0,i.Z)(s().mark((function e(t,n,r){var i,a,o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.emeImplementation,a=n.keySystemOptions,o=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,d=$.Z.getState(t),c=null!==d&&d.loadedSessionsStore!==o?d.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,c;case 5:if(!r.isCancelled()){e.next=7;break}throw r.cancellationError;case 7:if($.Z.setState(t,{emeImplementation:i,keySystemOptions:a,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:o}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:V.Z.info("DRM: Attaching MediaKeys to the media element"),i.setMediaKeys(t,l).then((function(){V.Z.info("DRM: MediaKeys attached with success")})).catch((function(e){V.Z.error("DRM: Could not set MediaKeys",e instanceof Error?e:"Unknown Error")}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,Q.Z)(n,"expired")?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,Q.Z)(n,"internal-error")?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(V.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function ne(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?re(i,t):null===a?(V.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),re(i,t)):function(e,t,n,r){return ie.apply(this,arguments)}(i,a,t,r)}function re(e,t){V.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function ie(){return ie=(0,i.Z)(s().mark((function e(t,n,r,a){var o,u,l,d,c,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return f=(0,i.Z)(s().mark((function e(){var i,u;return s().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 V.Z.info("DRM: Removing previous persistent session."),null!==(i=n.get(r))&&n.delete(i.sessionId),e.prev=5,e.next=8,t.closeSession(o.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===o.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(o.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return u=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:u});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),f.apply(this,arguments)},c=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(V.Z.info("DRM: Creating persistent MediaKeySession"),o=t.createSession(r,"persistent-license"),null!==(u=n.getAndReuse(r))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:o});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(o.mediaKeySession,u.sessionId);case 12:if(l=e.sent){e.next=19;break}return V.Z.warn("DRM: No data stored for the loaded session"),n.delete(u.sessionId),t.removeSessionWithoutClosingIt(o.mediaKeySession),d=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!l||!te(o.mediaKeySession)){e.next=23;break}return n.add(r,r.keyIds,o.mediaKeySession),V.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:o});case 23:return V.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",c());case 27:return e.prev=27,e.t0=e.catch(9),V.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",c());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),ie.apply(this,arguments)}function ae(e,t){return oe.apply(this,arguments)}function oe(){return(oe=(0,i.Z)(s().mark((function e(t,n){var r,i,a,o,u;return s().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(V.Z.info("DRM: LSS cache limit exceeded",n,t.getLength()),r=[],i=t.getAll().slice(),a=i.length-n,o=0;o<a;o++)u=i[o],r.push(t.closeSession(u.mediaKeySession));return e.next=9,Promise.all(r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e,t,n,r,i){return ue.apply(this,arguments)}function ue(){return(ue=(0,i.Z)(s().mark((function e(t,n,r,i,a){var o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,u=n.loadedSessionsStore,l=n.persistentSessionsStore,null===(d=u.reuse(t))){e.next=11;break}if(!te(o=d.mediaKeySession)){e.next=10;break}return V.Z.info("DRM: Reuse loaded session",o.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:o,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==l&&""!==d.mediaKeySession.sessionId&&l.delete(d.mediaKeySession.sessionId);case 11:if(null===o){e.next=16;break}return e.next=14,u.closeSession(o);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,ae(u,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,ne(n,t,r,a);case 22:return c=e.sent,e.abrupt("return",{type:c.type,value:{mediaKeySession:c.value.mediaKeySession,sessionType:c.value.sessionType,keySessionRecord:c.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var le=n(9592);function de(e,t,n){var r=t.getConfiguration();if(c.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 ce(e,t,n){var r=["temporary"],i="optional",a="optional";!0===n.persistentLicense&&(i="required",r.push("persistent-license")),!0===n.persistentStateRequired&&(i="required"),!0===n.distinctiveIdentifierRequired&&(a="required");var o,s,u=j.Z.getCurrent(),l=u.EME_DEFAULT_AUDIO_CODECS,c=u.EME_DEFAULT_VIDEO_CODECS,f=u.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,v=u.EME_DEFAULT_PLAYREADY_ROBUSTNESSES;o=(0,d.Z)(n.videoRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.videoRobustnesses,s=(0,d.Z)(n.audioRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.audioRobustnesses,0===o.length&&o.push(void 0),0===s.length&&s.push(void 0);var p={initDataTypes:["cenc"],videoCapabilities:(0,le.Z)(o,(function(e){return c.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),audioCapabilities:(0,le.Z)(s,(function(e){return l.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),distinctiveIdentifier:a,persistentState:i,sessionTypes:r};return[p,Object.assign(Object.assign({},p),{audioCapabilities:void 0,videoCapabilities:void 0})]}function fe(e,t,n){V.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var r=$.Z.getState(e);if(null!==r&&F.implementation===r.emeImplementation.implementation){var a=de(t,r.mediaKeySystemAccess,r.keySystemOptions);if(null!==a)return V.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var o=t.reduce((function(e,t){var n,r=j.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=j.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,Q.Z)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return u(0);function u(e){return l.apply(this,arguments)}function l(){return(l=(0,i.Z)(s().mark((function e(t){var r,i,a,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=o.length)){e.next=2;break}throw new q.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=F.requestMediaKeySystemAccess){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=o[t],i=r.keyName,a=r.keyType,l=r.keySystemOptions,d=ce(i,a,l),V.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+o.length),e.prev=7,e.next=10,F.requestMediaKeySystemAccess(a,d);case 10:return c=e.sent,V.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:c}});case 15:if(e.prev=15,e.t0=e.catch(7),V.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",u(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var ve=n(2297);function pe(e,t,n){var r;V.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){V.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,P.pX)(e,i+4)!==G)throw V.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,P.pX)(new Uint8Array(e),i);if(i+a>e.length)throw V.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,ve.Xj)(o),u=null===s?void 0:o[s[1]];V.Z.info("Compat: CENC PSSH found with version",u),void 0===u?V.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,P.zo)(n,o):1===u?(V.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):V.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,P.zo)(r,o);i+=a}if(i!==e.length)throw V.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,P.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 V.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}var he=100;function me(e,t){return ge.apply(this,arguments)}function ge(){return(ge=(0,i.Z)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.info("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,he);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=n(7864);function _e(e){var t=new b.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,i.Z)(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,ye.Z)(1e3,t.signal);case 3:return e.next=5,r();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof b.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",V.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function r(){return a.apply(this,arguments)}function a(){return(a=(0,i.Z)(s().mark((function n(){return s().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,ye.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)}}function be(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}function Te(e,t){for(var n,r,i=function(){var e=r.value;if(!t.some((function(t){return(0,K.Z)(t,e)})))return{v:!1}},a=be(e);!(r=a()).done;)if(n=i())return n.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 ke(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 ke(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 ke(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 we=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;){var r=t.value;if((0,K.Z)(r,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&&Te(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return Te(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?Te(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function Ae(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 Ze=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new we(e);V.Z.debug("DRM-LSS: calling `createSession`",t);var i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,d.Z)(i.closed)||i.closed.then((function(){V.Z.info("DRM-LSS: session was closed, removing it.",i.sessionId);var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){V.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),this._storage.push(Object.assign({},a)),V.Z.debug("DRM-LSS: MediaKeySession added",a.sessionType,this._storage.length),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),V.Z.debug("DRM-LSS: Reusing session:",n.mediaKeySession.sessionId,n.sessionType),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,i.Z)(s().mark((function e(t,n,r){var i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Ae(this._storage);case 1:if((o=a()).done){e.next=8;break}if((u=o.value).mediaKeySession!==t){e.next=6;break}return i=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return V.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",pe(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,pe(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,i.Z)(s().mark((function e(t,n){var r,i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Ae(this._storage);case 1:if((a=i()).done){e.next=8;break}if((o=a.value).mediaKeySession!==t){e.next=6;break}return r=o,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return V.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",me(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,me(t,n);case 17:u=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",u);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",u);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,i.Z)(s().mark((function e(t){var n,r,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Ae(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 V.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,i.Z)(s().mark((function e(){var t,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,V.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,l.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 V.Z.debug("DRM-LSS: Removing session without closing it",e.sessionId),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,i.Z)(s().mark((function e(t){var n;return s().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"}),xe(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 xe(e){return Re.apply(this,arguments)}function Re(){return(Re=(0,i.Z)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,_e(t);case 4:return V.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),V.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)}function Me(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}var Ce=n(6923),Pe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,A.J)(this.initData)},e.decode=function(e){return(0,A.K)(e)},e}();function De(e,t){var n,r;return null!==(r=null!==(n=Ne(e,t))&&void 0!==n?n:Ne(t,e))&&void 0!==r&&r}function Ne(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?Pe.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?Pe.decode(a.data):a.data.initData;if(!(0,K.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?Pe.decode(u.data):u.data.initData,c=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?Pe.decode(l.data):l.data.initData;if(!(0,K.Z)(d,c))return!1;break}}if(r===t.length)return null}return!0}}return null}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 Le(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 Le(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 Le(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=function(){function e(e){!function(e){(0,l.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){V.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,d.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;V.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else V.Z.info("DRM-PSS: Add new session",i);var u=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new Pe(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:u,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new Pe(e)})),values:u,initDataType:e.type}),this._save()}else V.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];V.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else V.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){V.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(V.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:Me(t)}}return n}for(var i,a=function(){var n=t._entries[o];if(n.initDataType===e.type)switch(n.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,r=(0,A.J)(e),i=Oe(n.keyIds);!(t=i()).done;){var a=t.value;if("string"==typeof a){if(r===a)return!0}else if((0,K.Z)(a.initData,e))return!0}return!1})))return{v:o}}else if(De(e.values.getFormattedValues(),n.values))return{v:o};break;case 3:if(De(e.values.getFormattedValues(),n.values))return{v:o};break;case 2:var i=r(),a=i.initData,s=i.initDataHash;if(n.initDataHash===s)try{var u="string"==typeof n.initData?Pe.decode(n.initData):n.initData.initData;if((0,K.Z)(u,a))return{v:o}}catch(e){V.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var l=r(),d=l.initData,c=l.initDataHash;if(n.initDataHash===c){if(void 0===n.initData.length)return{v:o};if((0,K.Z)(n.initData,d))return{v:o}}break;default:var f=r().initDataHash;if(n.initData===f)return{v:o}}},o=0;o<this._entries.length;o++)if(i=a())return i.v;return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){V.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var Be=new WeakMap,Fe={prepare:function(e){Be.set(e,null)},set:function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=Me(n);Be.set(e,{hash:r,serverCertificate:n})},hasOne:function(e){var t=Be.get(e);return void 0!==t&&(null!==t||void 0)},has:function(e,t){var n=Be.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(Me(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 Ve(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new q.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return V.Z.debug("DRM: Set the given license storage"),new Ue(t)}function ze(e,t,n){return Ke.apply(this,arguments)}function Ke(){return(Ke=(0,i.Z)(s().mark((function e(t,n,r){var i,a,o,u,l,f,v,p,h,m;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(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,o=a.options,u=a.mediaKeySystemAccess,l=$.Z.getState(t),f=Ve(o),c.$u||c.l_||null===l||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(v=l.mediaKeys,p=l.loadedSessionsStore,!1!==Fe.hasOne(v)&&((0,d.Z)(o.serverCertificate)||!Fe.has(v,o.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:u,stores:{loadedSessionsStore:p,persistentSessionsStore:f},options:o});case 12:return e.next=14,Ge(u);case 14:return h=e.sent,V.Z.info("DRM: MediaKeys created with success"),m=new Ze(h),e.abrupt("return",{mediaKeys:h,mediaKeySystemAccess:u,stores:{loadedSessionsStore:m,persistentSessionsStore:f},options:o});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e){return We.apply(this,arguments)}function We(){return(We=(0,i.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.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 q.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function He(){return(He=(0,i.Z)(s().mark((function e(t,n,r){var i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ze(t,n,r);case 2:if(i=e.sent,a=i.mediaKeys,!(null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys)){e.next=13;break}if(V.Z.debug("DRM: Disabling old MediaKeys"),!c.$u){e.next=12;break}return e.next=10,J(t);case 10:e.next=13;break;case 12:J(t).catch(I.Z);case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var je=n(7326),qe=n(2146),Ye=n(2572),Xe=n(5440);var Qe=n(7904),$e=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(r),t.prototype),r.reason=n,r}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),Je={EXPIRED:"expired",INTERNAL_ERROR:"internal-error",OUTPUT_RESTRICTED:"output-restricted"};function et(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],d=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],f=function(e,t){return-1!==e.indexOf("playready")&&(c.YM||c.kD)?(0,Z.wO)(t):t}(n,new Uint8Array(r[1])),v={keyId:f.buffer,keyStatus:i};switch(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: key status update ("+(0,Z.ci)(f)+"): "+i),i){case Je.EXPIRED:var p=new q.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new $e(p);case"fallback":u.push(f);break;default:"continue"===s||void 0===s?l.push(f):(0,Qe.Z)(s)}d.push(v);break;case Je.INTERNAL_ERROR:if(!0!==a.keyInternalError)throw new q.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;case Je.OUTPUT_RESTRICTED:if(!0!==a.keyOutputRestricted)throw new q.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;default:l.push(f)}})),d.length>0&&(r=new q.Z("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:d})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var tt=f.Dl,nt=f.RV,rt=f.qo;function it(e,t,n,r,a){V.Z.info("DRM: Binding session events",e.sessionId);var o=t.getLicenseConfig,u=void 0===o?{}:o,l=new b.ZP;return l.linkToSignal(a),(0,d.Z)(e.closed)||e.closed.then((function(){return l.cancel()})).catch((function(e){a.isCancelled()||(l.cancel(),r.onError(e))})),tt(e,(function(e){l.cancel(),r.onError(new q.Z("KEY_ERROR",e.type))}),l.signal),rt(e,(function(e){(function(e){return c.apply(this,arguments)})(e).catch((function(e){a.isCancelled()||l.isUsed()&&e instanceof b.XG||(l.cancel(),r.onError(e))}))}),l.signal),nt(e,(function(n){var a,o=n,c=new Uint8Array(o.message),f=(0,Ce.Z)(o.messageType)?o.messageType:"license-request";V.Z.info("DRM: Received message event, type "+f,e.sessionId),function(e,t,n){var r=t.baseDelay,a=t.maxDelay,o=t.totalRetry,u=t.shouldRetry,l=t.onRetry,c=0;return f();function f(){return v.apply(this,arguments)}function v(){return(v=(0,i.Z)(s().mark((function t(){var i,v,p,h;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===n.cancellationError){t.next=2;break}throw n.cancellationError;case 2:return t.prev=2,t.next=5,e();case 5:return i=t.sent,t.abrupt("return",i);case 9:if(t.prev=9,t.t0=t.catch(2),null===n.cancellationError){t.next=13;break}throw n.cancellationError;case 13:if(!(!(0,d.Z)(u)&&!u(t.t0)||c++>=o)){t.next=15;break}throw t.t0;case 15:return"function"==typeof l&&l(t.t0,c),v=Math.min(r*Math.pow(2,c-1),a),p=(0,Ye.Z)(v),t.next=20,(0,Xe.Z)(p);case 20:return h=f(),t.abrupt("return",h);case 22:case"end":return t.stop()}}),t,null,[[2,9]])})))).apply(this,arguments)}}((function(){return function(e,n){var r;return new Promise((function(i,a){try{V.Z.debug("DRM: Calling `getLicense`",n);var o=t.getLicense(e,n),s=(0,d.Z)(u.timeout)?1e4:u.timeout;s>=0&&(r=setTimeout((function(){a(new lt('"getLicense" timeout exceeded ('+s+" ms)"))}),s)),Promise.resolve(o).then(l,c)}catch(e){c(e)}function l(e){void 0!==r&&clearTimeout(r),i(e)}function c(e){void 0!==r&&clearTimeout(r),a(e)}}))}(c,f)}),{totalRetry:null!=(a=u.retry)?a:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof lt||(0,d.Z)(e)||!0!==e.noRetry},onRetry:function(e){return r.onWarning(at(e))}},l.signal).then((function(t){if(l.isUsed())return Promise.resolve();if((0,d.Z)(t))V.Z.info("DRM: No license given, skipping session.update");else try{return ot(e,t)}catch(e){l.cancel(),r.onError(e)}})).catch((function(e){if(!l.isUsed()){l.cancel();var t=at(e);if(!(0,d.Z)(e))if(!0===e.fallbackOnLastTry)return V.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),void r.onError(new ut(t));r.onError(t)}}))}),l.signal),void f();function c(){return c=(0,i.Z)(s().mark((function n(r){var o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=function(){return(u=(0,i.Z)(s().mark((function n(){var i,o;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!l.isUsed()){n.next=2;break}return n.abrupt("return");case 2:if("function"!=typeof t.onKeyStatusesChange){n.next=24;break}return n.prev=3,n.next=6,t.onKeyStatusesChange(r,e);case 6:if(i=n.sent,!l.isUsed()){n.next=9;break}return n.abrupt("return");case 9:n.next=18;break;case 11:if(n.prev=11,n.t0=n.catch(3),!a.isCancelled()){n.next=15;break}return n.abrupt("return");case 15:throw o=new q.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error"),!(0,d.Z)(n.t0)&&(0,Ce.Z)(n.t0.message)&&(o.message=n.t0.message),o;case 18:if(!(0,d.Z)(i)){n.next=22;break}V.Z.info("DRM: No license given, skipping session.update"),n.next=24;break;case 22:return n.next=24,ot(e,i);case 24:case"end":return n.stop()}}),n,null,[[3,11]])})))).apply(this,arguments)},o=function(){return u.apply(this,arguments)},V.Z.info("DRM: keystatuseschange event received",e.sessionId),n.next=5,Promise.all([o(),Promise.resolve(f())]);case 5:case"end":return n.stop()}}),n)}))),c.apply(this,arguments)}function f(){if(!l.isUsed()&&0!==e.keyStatuses.size){var i=et(e,t,n),a=i.warning,o=i.blacklistedKeyIds,s=i.whitelistedKeyIds;void 0!==a&&(r.onWarning(a),l.isUsed())||r.onKeyUpdate({whitelistedKeyIds:s,blacklistedKeyIds:o})}}}function at(e){if(e instanceof lt)return new q.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new q.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,d.Z)(e)&&(0,Ce.Z)(e.message)&&(t.message=e.message),t}function ot(e,t){return st.apply(this,arguments)}function st(){return(st=(0,i.Z)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.info("DRM: Updating MediaKeySession with message"),e.prev=1,e.next=4,t.update(n);case 4:e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.toString():"`session.update` failed",new q.Z("KEY_UPDATE_ERROR",r);case 10:V.Z.info("DRM: MediaKeySession update succeeded.");case 11:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}var ut=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(r),t.prototype),r.sessionError=n,r}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),lt=function(e){function t(t){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(n),ut.prototype),n.message=t,n}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),dt=n(9822);function ct(e,t){return ft.apply(this,arguments)}function ft(){return(ft=(0,i.Z)(s().mark((function e(t,n){var r,i;return s().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),V.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 q.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function vt(e,t){return pt.apply(this,arguments)}function pt(){return(pt=(0,i.Z)(s().mark((function e(t,n){var r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==Fe.hasOne(t)){e.next=3;break}return V.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 V.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 V.Z.info("DRM: Setting server certificate on the MediaKeys"),Fe.prepare(t),e.prev=8,e.next=11,ct(t,n);case 11:return r=e.sent,Fe.set(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,dt.Z)(e.t0)?e.t0:new q.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)}var ht=n(4339);function mt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;V.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var gt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return P.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 De(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:Me(n)}}))),this._lazyFormattedValues},e}();function yt(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 _t(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 _t(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 _t(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 bt=function(e){function t(t,n){var r;r=e.call(this)||this,V.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new b.ZP;return r._currentSessions=[],r._canceller=i,r._initDataQueue=[],r._stateData={state:ht.u.Initializing,isMediaKeysAttached:0,isInitDataQueueLocked:!0,data:null},r.error=null,F.onEncrypted(t,(function(e){V.Z.debug("DRM: Encrypted event received from media element.");var t=H(e);null!==t&&r.onInitializationData(t)}),i.signal),function(e,t,n){return He.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,d.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,C.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,C.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,C.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===ht.u.Initializing&&(r._stateData={state:ht.u.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:0,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,a.Z)(t,e),t.hasEmeApis=function(){return!(0,d.Z)(F.requestMediaKeySystemAccess)};var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==ht.u.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(0===this._stateData.isMediaKeysAttached){var t=this._stateData.data,n=t.mediaElement,r=t.mediaKeysInfo,a=r.options,o=r.mediaKeys,u=r.mediaKeySystemAccess,l=r.stores;if(!(!0===a.disableMediaKeysAttachmentLock)||(this._stateData={state:ht.u.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:1,data:{mediaKeysInfo:r,mediaElement:n}},this.trigger("stateChange",this._stateData.state),!this._isStopped())){this._stateData.isMediaKeysAttached=1;var c={emeImplementation:F,loadedSessionsStore:l.loadedSessionsStore,mediaKeySystemAccess:u,mediaKeys:o,keySystemOptions:a};V.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return ee.apply(this,arguments)}(n,c,this._canceller.signal).then((0,i.Z)(s().mark((function t(){var n,i,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._stateData.isMediaKeysAttached=2,n=a.serverCertificate,(0,d.Z)(n)){t.next=7;break}return t.next=5,vt(o,n);case 5:"error"===(i=t.sent).type&&e.trigger("warning",i.value);case 7:if(!e._isStopped()){t.next=9;break}return t.abrupt("return");case 9:u=e._stateData.state,e._stateData={state:ht.u.ReadyForContent,isMediaKeysAttached:2,isInitDataQueueLocked:!1,data:{mediaKeysData:r}},u!==ht.u.ReadyForContent&&e.trigger("stateChange",ht.u.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 13:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)}))}}else V.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.")},n.dispose=function(){this.removeEventListener(),this._stateData={state:ht.u.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 gt(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,i.Z)(s().mark((function e(t,n){var r,i,a,o,u,l,d,c,f,v,p,h,m,g,y,_,b,S,T,E,k,w,A,I,x,R,M,C,P,D,N,O,L,U=this;return s().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===(o=(0,X.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(u=t.keyIds)){e.next=10;break}return void 0===t.content?V.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):Et(t.content.manifest,t),e.abrupt("return");case 10:return o.record.associateKeyIds(u),void 0!==t.content&&(V.Z.hasLevel("DEBUG")&&(l=u.reduce((function(e,t){return e+", "+(0,Z.ci)(t)}),""),V.Z.debug("DRM: Blacklisting new key ids",l)),Tt(t.content.manifest,[],u,[])),e.abrupt("return");case 13:e.next=42;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=42;break}d=t.content.period,c=this._currentSessions.filter((function(e){return"created-session"===e.source})),At(f=new Set,d),v=yt(c);case 21:if((p=v()).done){e.next=42;break}h=p.value,m=Array.from(f),g=0,y=m;case 25:if(!(g<y.length)){e.next=40;break}if(_=y[g],!h.record.isAssociatedWithKeyId(_)){e.next=37;break}h.record.associateKeyIds(f.values()),b=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=T.value,h.keyStatuses.whitelisted.some((function(e){return(0,K.Z)(e,t)}))||h.keyStatuses.blacklisted.some((function(e){return(0,K.Z)(e,t)}))||h.keyStatuses.blacklisted.push(t);case 2:case"end":return e.stop()}}),e)})),S=yt(m);case 31:if((T=S()).done){e.next=35;break}return e.delegateYield(b(),"t0",33);case 33:e.next=31;break;case 35:return Tt(t.content.manifest,h.keyStatuses.whitelisted,h.keyStatuses.blacklisted,[]),e.abrupt("return");case 37:g++,e.next=25;break;case 40:e.next=21;break;case 42:return this._lockInitDataQueue(),!0!==a.persistentLicense?E="temporary":St(r)?E="persistent-license":(V.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),E="temporary"),k=j.Z.getCurrent(),w=k.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,A=k.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,I="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:w,e.next=48,se(t,i,E,I,this._canceller.signal);case 48:if(x=e.sent,!this._isStopped()){e.next=51;break}return e.abrupt("return");case 51:if(R={record:x.value.keySessionRecord,source:x.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(R),M=x.value,C=M.mediaKeySession,P=M.sessionType,D=!1,it(C,a,r.keySystem,{onKeyUpdate:function(e){var n=kt(t,R.record,a.singleLicensePer,"created-session"===R.source,e.whitelistedKeyIds,e.blacklistedKeyIds);if(R.record.associateKeyIds(n.whitelisted),R.record.associateKeyIds(n.blacklisted),R.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==R.record.getAssociatedKeyIds().length&&"persistent-license"===P&&null!==i.persistentSessionsStore&&!D){var r=i.persistentSessionsStore;mt(r,A-1),r.add(t,R.record.getAssociatedKeyIds(),C),D=!0}void 0!==t.content&&Tt(t.content.manifest,n.whitelisted,n.blacklisted,[]),U._unlockInitDataQueue()},onWarning:function(e){U.trigger("warning",e)},onError:function(e){var n;if(e instanceof $e){V.Z.warn("DRM: A session's closing condition has been triggered"),U._lockInitDataQueue();var r=U._currentSessions.indexOf(R);return r>=0&&U._currentSessions.splice(r),void 0!==t.content&&Tt(t.content.manifest,[],[],R.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(C.sessionId),i.loadedSessionsStore.closeSession(C).catch((function(e){var t=e instanceof Error?e:"unknown error";V.Z.warn("DRM: failed to close expired session",t)})).then((function(){return U._unlockInitDataQueue()})).catch((function(e){return U._onFatalError(e)})),void(U._isStopped()||U.trigger("warning",e.reason))}if(e instanceof ut){if(R.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;V.Z.info("DRM: blacklisting Representations based on protection data."),Et(a,t)}U._unlockInitDataQueue()}else U._onFatalError(e)}},this._canceller.signal),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==x.type){e.next=72;break}return N=t.values.constructRequestData(),e.prev=59,e.next=62,i.loadedSessionsStore.generateLicenseRequest(C,t.type,N);case 62:e.next=72;break;case 64:if(e.prev=64,e.t1=e.catch(59),null!==(O=i.loadedSessionsStore.getEntryForSession(C))&&"none"===O.closingStatus.type){e.next=71;break}return(L=this._currentSessions.indexOf(R))>=0&&this._currentSessions.splice(L,1),e.abrupt("return",Promise.resolve());case 71:throw new q.Z("KEY_GENERATE_REQUEST_ERROR",e.t1 instanceof Error?e.t1.toString():"Unknown error");case 72:return e.abrupt("return",Promise.resolve());case 73:case"end":return e.stop()}}),e,this,[[59,64]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,X.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,d.Z)(a))return void 0===e.type||void 0===e.content?(V.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(V.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),Et(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,i=function(){var e=r.value;if(t.some((function(t){return(0,K.Z)(t,e)})))return{v:!0}},a=be(e);!(r=a()).done;)if(n=i())return n.v;return!1}(e.keyIds,s)}else{var u=i.keyStatuses.whitelisted;o=!Te(e.keyIds,u)}if(o)return void 0===e.content?(V.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(V.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),Tt(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return V.Z.debug("DRM: Init data already processed. Skipping it."),!0;var l=this._currentSessions.indexOf(i);return-1===l?V.Z.error("DRM: Unable to remove processed init data: not found."):(V.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(l,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:ht.u.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===ht.u.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===ht.u.Disposed||this._stateData.state===ht.u.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(){2===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):V.Z.error("DRM: Trying to unlock in the wrong state")},t}(_.Z);function St(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,Q.Z)(t,"persistent-license")}function Tt(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=yt(i);!(a=o()).done;){for(var s,u=a.value,l=yt(n);!(s=l()).done;){var d=s.value;if((0,K.Z)(d,u.keyId))return!1}for(var c,f=yt(t);!(c=f()).done;){var v=c.value;if((0,K.Z)(v,u.keyId))return!0}for(var p,h=yt(r);!(p=h()).done;){var m=p.value;if((0,K.Z)(m,u.keyId))return}}return e.decipherable}))}function Et(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i,a,o=function(){var e=a.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,K.Z)(e.data,t.data)}))})))return{v:!1}},s=yt(null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[]);!(a=s()).done;)if(i=o())return i.v;return e.decipherable}))}function kt(e,t,n,r,i,a){for(var o,s,u=[].concat(i,a),l=function(){var e=s.value;u.some((function(t){return(0,K.Z)(t,e)}))||(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,Z.ci)(e)),u.push(e))},d=yt(t.getAssociatedKeyIds());!(s=d()).done;)l();if(void 0!==n&&"init-data"!==n){var c=e.keyIds,f=e.content;if(void 0!==c){var v=c.filter((function(e){return!u.some((function(t){return(0,K.Z)(t,e)}))}));v.length>0&&(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: init data keys missing in the license, blacklisting them",v.map((function(e){return(0,Z.ci)(e)})).join(", ")),u.push.apply(u,v))}if(r&&void 0!==f)if("content"===n){for(var p,h=new Set,m=yt(f.manifest.periods);!(p=m()).done;){At(h,p.value)}wt(h,u)}else if("periods"===n)for(var g,y=yt(f.manifest.periods);!(g=y()).done;){var _=g.value,b=new Set;if(At(b,_),(null===(o=e.content)||void 0===o?void 0:o.period.id)===_.id)wt(b,u);else for(var S=Array.from(b),T=function(){var e=k[E];if(u.some((function(t){return(0,K.Z)(t,e)})))return wt(b,u),1},E=0,k=S;E<k.length&&!T();E++);}}return{whitelisted:i,blacklisted:u.slice(i.length)}}function wt(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return(0,K.Z)(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function At(e,t){for(var n,r=yt(t.getAdaptations());!(n=r()).done;)for(var i,a=yt(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=yt(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}var It=bt},4339:function(e,t,n){"use strict";var r;n.d(t,{u:function(){return r}}),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"}(r||(r={}))},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)}}},9372:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(4578),i=n(5767),a=n(3887),o=n(811),s=n(1946),u=n(5095),l=n(288),d=n(9420),c=n(379),f=n(9016),v=n(7794),p=n(6199),h=n(4576),m=function(e){function t(t){var n;return(n=e.call(this)||this)._settings=t,n._initCanceller=new l.ZP,n}(0,r.Z)(t,e);var n=t.prototype;return n.prepare=function(){},n.start=function(e,t){var n=this,r=this._initCanceller.signal,s=this._settings,l=s.keySystems,d=s.speed,c=s.url;(0,i.Z)(e);var f=new u.Z(null);f.finish();var m=(0,v.Z)(e,l,f,{onError:function(e){return n._onFatalError(e)},onWarning:function(e){return n.trigger("warning",e)}},r);(0,h.Z)(e,(function(e){return n._onFatalError(e)}),r);var g=new p.Z(t,null,d);g.addEventListener("stalled",(function(e){return n.trigger("stalled",e)})),g.addEventListener("unstalled",(function(){return n.trigger("unstalled",null)})),g.addEventListener("warning",(function(e){return n.trigger("warning",e)})),r.register((function(){g.destroy()})),g.start(),m.onUpdate((function(s,u){"uninitialized"!==s.initializationState.type&&(u(),a.Z.info("Setting URL to HTMLMediaElement",c),e.src=c,r.register((function(){a.Z.info("Init: Removing directfile src from media element",e.src),(0,i.Z)(e)})),"awaiting-media-link"===s.initializationState.type?(s.initializationState.value.isMediaLinked.setValue(!0),m.onUpdate((function(r,i){"initialized"===r.initializationState.type&&(i(),n._seekAndPlay(e,t))}),{emitCurrentValue:!0,clearSignal:r})):((0,o.Z)("initialized"===s.initializationState.type),n._seekAndPlay(e,t)))}),{emitCurrentValue:!0,clearSignal:r})},n.updateContentUrls=function(e,t){throw new Error("Cannot update content URL of directfile contents")},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.cancel(),this.trigger("error",e)},n._seekAndPlay=function(e,t){var n=this,r=this._initCanceller.signal,i=this._settings,o=i.autoPlay,u=i.startAt;(0,f.Z)(e,t,(function(){a.Z.debug("Init: Calculating initial time");var t=function(e,t){if((0,s.Z)(t))return 0;if(!(0,s.Z)(t.position))return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if("number"==typeof t.fromLastPosition)return(0,s.Z)(n)||!isFinite(n)?(a.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0):Math.max(0,n+t.fromLastPosition);if("number"==typeof t.fromLivePosition){var r=e.seekable.length>0?e.seekable.end(0):n;return(0,s.Z)(r)?(a.Z.warn("startAt.fromLivePosition set but no known live position, beginning at 0."),0):Math.max(0,r+t.fromLivePosition)}if(null!=t.percentage){if((0,s.Z)(n)||!isFinite(n))return a.Z.warn("startAt.percentage set but no known duration, beginning at 0."),0;var i=t.percentage;return i>=100?n:i<=0?0:n*(+i/100)}return 0}(e,u);return a.Z.debug("Init: Initial time calculated:",t),t}),o,(function(e){return n.trigger("warning",e)}),!0,r).autoPlayResult.then((function(){return(0,c.Z)(t,e,!0,r).onUpdate((function(e,t){e&&(t(),n.trigger("loaded",{segmentBuffersStore:null}))}),{emitCurrentValue:!0,clearSignal:r})})).catch((function(e){r.isCancelled()||n._onFatalError(e)}))},t}(d.K)},7117:function(e,t,n){"use strict";n.d(t,{Z:function(){return tn}});var r=n(5861),i=n(4578),a=n(4687),o=n.n(a);var s=n(6872),u=n(3714),l=n(3887),d=n(811),c=n(7733),f=n(8026),v=n(5095),p=n(288),h=n(8894),m=n(2829),g=n(5138);function y(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 _=function(){function e(e){this._levelsMap=y(e).map((function(e){return e+4})),this._bitrates=e,this._lastUnsuitableQualityTimestamp=void 0,this._blockRaiseDelay=6e3,l.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}var t=e.prototype;return t.onAddedSegment=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null!=i){for(var s,u=-1,d=0;d<n.length;d++){var c=n[d];if(c===i)u=d;else if(c>i)break}if(u<0||n.length!==t.length)return l.Z.error("ABR: Current Bitrate not found in the calculated levels"),void(this._currentEstimate=n[0]);void 0!==a&&(s=0===o?a.score:a.score/o);var f=isFinite(r)?r:0,v=performance.now();if(f<t[u]||void 0!==s&&s<1&&1===(null==a?void 0:a.confidenceLevel)){if((void 0===this._lastUnsuitableQualityTimestamp?-1:v-this._lastUnsuitableQualityTimestamp)<this._blockRaiseDelay+9e3){var p=this._blockRaiseDelay+3e3;this._blockRaiseDelay=Math.min(p,15e3),l.Z.debug("ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality",this._blockRaiseDelay)}else{var h=this._blockRaiseDelay-1e3;this._blockRaiseDelay=Math.max(6e3,h),l.Z.debug("ABR: Lowering quality in BufferBasedChooser",this._blockRaiseDelay)}this._lastUnsuitableQualityTimestamp=v;for(var m=(0,g.Z)(n,(function(e){return e===i}))-1;m>=0;m--)if(f>=t[m])return void(this._currentEstimate=n[m]);this._currentEstimate=n[0]}else if(void 0!==this._lastUnsuitableQualityTimestamp&&v-this._lastUnsuitableQualityTimestamp<this._blockRaiseDelay||void 0===s||s<1.15||1!==(null==a?void 0:a.confidenceLevel))this._currentEstimate=i;else{var y=t[u],_=function(){for(var e=u+1;e<t.length;e++)if(t[e]>y)return e}();if(void 0!==_)if(r>=t[_])return l.Z.debug("ABR: Raising quality in BufferBasedChooser",n[_]),void(this._currentEstimate=n[_]);this._currentEstimate=i}}else this._currentEstimate=n[0]},t.getLastEstimate=function(){return this._currentEstimate},e}(),b=n(3274),S=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 T(e){if(!(e.progress.length<5)){for(var t=new S(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 E(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var k=function(){function e(e,t){var n=s.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,u=this._config,d=e.bufferGap,c=e.position,f=e.duration,v=isFinite(d)?d:0,p=s.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(f)||v+c.last<f-p?!this._inStarvationMode&&v<=u.starvationGap?(l.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&v>=u.outOfStarvationGap&&(l.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(l.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 d=l[0],c=performance.now(),f=1.5*d.content.segment.duration;if(f=Math.min(f,3e3),f=Math.max(f,12e3),!(c-d.requestTimestamp<f)){var v=d.progress.length>0?d.progress[d.progress.length-1]:void 0,p=T(d);if(void 0!==v&&void 0!==p){var h=E(v,p);if((c-v.timestamp)/1e3<=h&&h-u/o>2500)return p}if(d.content.segment.complete){var m=d.content.segment.duration,g=(c-d.requestTimestamp)/1e3;if(null!=n&&!(g<=(1.5*m+2)/o)){var y=m/g,_=n.bitrate*Math.min(.7,y);return void 0===i||_<i?_:void 0}}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(l.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?u.starvationBitrateFactor:u.regularBitrateFactor):null!=i?i*(this._inStarvationMode?u.starvationBitrateFactor:u.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)&&function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,b.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=T(a);if(void 0===s||void 0===u)return!0;var l=E(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode)},e}();function w(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 A(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 A(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 A(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 I=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 d=Z(e,n);if(null!==d)return d}return null}if(this._isLastGuessValidated(s,r,u)&&(l.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,g.Z)(e,(function(e){return e.id===t.id}));if(n<0)return l.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=Z(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n.score,i=n.confidenceLevel;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.score<1.01)return!0;if((void 0===t||t.score<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=w(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 d=T(u);if(void 0!==d&&d<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n.confidenceLevel&&n.score>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function Z(e,t){var n=e.length,r=(0,g.Z)(e,(function(e){return e.id===t.id}));if(r<0)return l.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var x=function(){function e(){var e=s.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new S(t),this._slowEWMA=new S(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<s.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=s.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=s.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new S(t),this._slowEWMA=new S(n),this._bytesSampled=0},e}();var R=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}(),M=n(1679),C=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):l.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&l.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,M.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),P=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 S(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(l.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{score:n.getEstimate(),confidenceLevel:r>=5&&i>=10?1:0}}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function D(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,g.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var N=new v.Z(-1);N.finish();var O=new v.Z(0);O.finish();var L=new v.Z(1/0);L.finish();var U=new v.Z(void 0);U.finish();var B=new v.Z(1/0);B.finish();var F=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,u=e.lowLatencyMode;return function(e,d,c,f,y){var S,T,E,w,A,Z,M,F=e.adaptation.type,V=function(e){var n=t[e];if(null==n){l.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new x;return t[e]=r,r}return n}(F),z=null!==(S=n[F])&&void 0!==S?S:N,K=null!==(T=r[F])&&void 0!==T?T:O,G=null!==(E=i[F])&&void 0!==E?E:L,W=null!==(w=a[F])&&void 0!==w?w:0;return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,u=e.lowLatencyMode,d=e.manualBitrate,c=e.maxAutoBitrate,f=e.minAutoBitrate,y=e.playbackObserver,S=e.representations,T=new P,E=new k(null!=o?o:0,u),w=new C,A=h.Z,Z={metrics:L,requestBegin:U,requestProgress:B,requestEnd:F,addedSegment:function(e){A(e)}},x=new p.ZP;x.linkToSignal(t);var M=N(S.getValue(),x.signal);return S.onUpdate(O,{clearSignal:t}),{estimates:M,callbacks:Z};function N(e,t){if(0===e.length)return new v.Z({representation:null,bitrate:void 0,knownStableBitrate:void 0,manual:!1,urgent:!0});if(1===e.length)return new v.Z({bitrate:void 0,representation:e[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var o=!1,p=new _(e.map((function(e){return e.bitrate}))),S=new R,k=new I(T,S),Z=y.getReference().getValue(),x=new v.Z(C());return y.listen((function(e){Z=e,M()}),{includeLastObservation:!1,clearSignal:t}),A=function(e){if(null!==Z){var t=Z,n=t.position,r=t.speed,i=e.buffered,a=(0,m.L7)(i,n.last),o=e.content.representation,s=T.getEstimate(o),u={bufferGap:a,currentBitrate:o.bitrate,currentScore:s,speed:r};p.onAddedSegment(u),M()}},t.register((function(){A=h.Z})),d.onUpdate(M,{clearSignal:t}),f.onUpdate(M,{clearSignal:t}),c.onUpdate(M,{clearSignal:t}),a.limitWidth.onUpdate(M,{clearSignal:t}),a.limitWidth.onUpdate(M,{clearSignal:t}),x;function M(){x.setValue(C())}function C(){var t=d.getValue();if(t>=0)return{representation:D(e,t,0,1/0),bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0};var v=Z,h=v.bufferGap,m=v.position,y=v.maximumPosition,_=a.limitWidth.getValue(),A=a.throttleBitrate.getValue(),I=i.getValue(),x=f.getValue(),R=c.getValue(),M=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,g.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){var n,r;return(null!==(n=e.width)&&void 0!==n?n:0)-(null!==(r=t.width)&&void 0!==r?r:0)})),r=(0,b.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}(e,_,A),C=w.getRequests(),P=E.getBandwidthEstimate(Z,n,I,C,S.bandwidth),N=P.bandwidthEstimate,O=P.bitrateChosen,L=T.getLastStableRepresentation(),U=null===L?void 0:L.bitrate/(Z.speed>0?Z.speed:1),B=s.Z.getCurrent(),F=B.ABR_ENTER_BUFFER_BASED_ALGO,V=B.ABR_EXIT_BUFFER_BASED_ALGO;o&&h<=V?o=!1:!o&&isFinite(h)&&h>=F&&(o=!0);var z=D(M,O,x,R),K=p.getLastEstimate(),G=z.bitrate,W=null;o&&void 0!==K&&K>G&&(G=(W=D(M,K,x,R)).bitrate);var H=null;return u&&null!==I&&r.manifest.isDynamic&&y-m.last<40&&(H=k.getGuess(e,Z,I,G,C)),null!==H&&H.bitrate>G?(l.Z.debug("ABR: Choosing representation with guess-based estimation.",H.bitrate,H.id),S.update(H,N,2),{bitrate:N,representation:H,urgent:null===I||H.bitrate<I.bitrate,manual:!1,knownStableBitrate:U}):null!==W?(l.Z.debug("ABR: Choosing representation with buffer-based estimation.",W.bitrate,W.id),S.update(W,N,0),{bitrate:N,representation:W,urgent:E.isUrgent(W.bitrate,I,C,Z),manual:!1,knownStableBitrate:U}):(l.Z.debug("ABR: Choosing representation with bandwidth estimation.",z.bitrate,z.id),S.update(z,N,1),{bitrate:N,representation:z,urgent:E.isUrgent(z.bitrate,I,C,Z),manual:!1,knownStableBitrate:U})}}function O(){var e=S.getValue();x.cancel(),(x=new p.ZP).linkToSignal(t),N(e,x.signal).onUpdate((function(e){M.setValue(e)}),{clearSignal:x.signal,emitCurrentValue:!0})}function L(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;T.addSample(s,t/1e3,u)}}function U(e){w.add(e)}function B(e){w.addProgress(e)}function F(e){w.remove(e.id)}}({bandwidthEstimator:V,context:e,currentRepresentation:d,filters:{limitWidth:null!==(A=o.limitWidth[F])&&void 0!==A?A:U,throttleBitrate:null!==(M=null!==(Z=o.throttleBitrate[F])&&void 0!==Z?Z:o.throttle[F])&&void 0!==M?M:B},initialBitrate:W,manualBitrate:z,minAutoBitrate:K,maxAutoBitrate:G,playbackObserver:f,representations:c,lowLatencyMode:u},y)}},V=n(245),z=n(8750),K=n(1989),G=n(1959),W=n(1946),H=n(9105),j=n(9362);function q(e){return e instanceof H.Z?new j.Z("PIPELINE_LOAD_ERROR",e):(0,z.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var Y=n(5992),X=n(7839),Q=n(9822),$=n(7864),J=n(2572);function ee(e){return e instanceof H.Z?e.type===Y.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===Y.br.TIMEOUT||e.type===Y.br.ERROR_EVENT:e instanceof X.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,Q.Z)(e)&&"INTEGRITY_ERROR"===e.code}function te(e){return e instanceof H.Z?e.type===Y.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof X.Z&&e.isOfflineError}function ne(e,t,n,r,i){return re.apply(this,arguments)}function re(){return re=(0,r.Z)(o().mark((function e(t,n,i,a,s){var u,d,c,f,v,m,g,y,_,b,S,T,E,k;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=function(e){var t;if(0===m.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=m.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=m.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]},E=function(e,t){var r=m.get(e);if(void 0===r||void 0===r.blockedUntil)return _(e);var i=performance.now(),a=r.blockedUntil-i;if(a<=0)return _(e);var o=new p.ZP,u=o.linkToSignal(s);return new Promise((function(r,i){function l(e){u(),r(e)}function d(e){u(),i(e)}null==n||n.addEventListener("priorityChange",(function(){var n=y();if(s.isCancelled())throw s.cancellationError;if(void 0===n)return d(t);n!==e&&(o.cancel(),E(n,t).then(l,d))}),o.signal),(0,$.Z)(a,o.signal).then((function(){return _(e).then(l,d)}),h.Z)}))},T=function(){return(T=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=y(),!s.isCancelled()){e.next=3;break}throw s.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(v(t),!s.isCancelled()){e.next=8;break}throw s.cancellationError;case 8:return e.abrupt("return",E(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},S=function(e){return T.apply(this,arguments)},b=function(){return(b=(0,r.Z)(o().mark((function e(t){var r,a,l,v,h,g,y;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i(t,s);case 3:return r=e.sent,e.abrupt("return",r);case 7:if(e.prev=7,e.t0=e.catch(0),!p.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),o=e.t0,a=te(o)?2:1,void 0===(l=m.get(t))?(l={errorCounter:1,lastErrorType:a,blockedUntil:void 0,isBlacklisted:!1},m.set(t,l)):a!==l.lastErrorType?(l.errorCounter=1,l.lastErrorType=a):l.errorCounter++,ee(e.t0)){e.next=19;break}return l.blockedUntil=void 0,l.isBlacklisted=!0,e.abrupt("return",S(e.t0));case 19:return v=2===a?f:c,l.errorCounter>v?(l.blockedUntil=void 0,l.isBlacklisted=!0):(h=l.errorCounter,g=Math.min(u*Math.pow(2,h-1),d),y=(0,J.Z)(g),l.blockedUntil=performance.now()+y),e.abrupt("return",S(e.t0));case 22:case"end":return e.stop()}var o}),e,null,[[0,7]])})))).apply(this,arguments)},_=function(e){return b.apply(this,arguments)},y=function(){if(null===t){var e=m.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return k(t);var r=n.getCdnPreferenceForResource(t);return k(r)},null===s.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(s.cancellationError));case 9:if(u=a.baseDelay,d=a.maxDelay,c=a.maxRetryRegular,f=a.maxRetryOffline,v=a.onRetry,null!==t&&0===t.length&&l.Z.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),m=new Map,void 0!==(g=y())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",_(g));case 16:case"end":return e.stop()}}),e)}))),re.apply(this,arguments)}function ie(e,t,n){return ne(null,null,e,t,n)}function ae(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 oe(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 oe(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 oe(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 se=function(e){function t(t,n,r){var i;return(i=e.call(this)||this).scheduleManualRefresh=h.Z,i._manifestUrls=t,i._pipelines=n.manifest,i._settings=r,i._canceller=new p.ZP,i._isStarted=!1,i._isRefreshPending=!1,i._consecutiveUnsafeMode=0,i._prioritizedContentUrl=null,i}(0,i.Z)(t,e);var n=t.prototype;return n.dispose=function(){this._canceller.cancel(),this.removeEventListener()},n.start=function(){var e=this;if(!this._isStarted){this._isStarted=!0;var t=this._settings.initialManifest;(t instanceof K.ZP?Promise.resolve({manifest:t}):void 0!==t?this.parse(t,{previousManifest:null,unsafeMode:!1},void 0):this._fetchManifest(void 0).then((function(e){return e.parse({previousManifest:null,unsafeMode:!1})}))).then((function(t){e.trigger("manifestReady",t.manifest),e._canceller.isUsed()||e._recursivelyRefreshManifest(t.manifest,t)})).catch((function(t){return e._onFatalError(t)}))}},n.updateContentUrls=function(e,t){var n;this._prioritizedContentUrl=null!==(n=null==e?void 0:e[0])&&void 0!==n?n:void 0,t&&this.scheduleManualRefresh({enablePartialRefresh:!1,delay:0,canUseUnsafeMode:!1})},n._fetchManifest=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a,u,l,c,f,v,p,h=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=function(e){var t=a.loadManifest,n=(0,W.Z)(i.requestTimeout)?s.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:i.requestTimeout;n<0&&(n=void 0);return ie((function(){return t(e,{timeout:n},r)}),l,r)},v=function(e){var t=a.resolveManifestUrl;(0,d.Z)(void 0!==t);return ie((function(){return t(e,r)}),l,r)},r=this._canceller.signal,i=this._settings,a=this._pipelines,u=null!=t?t:null===(n=this._manifestUrls)||void 0===n?void 0:n[0],l=this._getBackoffSetting((function(e){h.trigger("warning",q(e))})),c=void 0===a.resolveManifestUrl?p(u):v(u).then(p),e.prev=8,e.next=11,c;case 11:return f=e.sent,e.abrupt("return",{parse:function(e){return h._parseLoadedManifest(f,e,u)}});case 15:throw e.prev=15,e.t0=e.catch(8),q(e.t0);case 18:case"end":return e.stop()}}),e,this,[[8,15]])})));return function(t){return e.apply(this,arguments)}}(),n.parse=function(e,t,n){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t,n)},n._parseLoadedManifest=function(){var e=(0,r.Z)(o().mark((function e(t,n,i){var a,s,u,d,c,f,v,p,h,m,g,y,_,b,S,T,E=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T=function(e){S(e.contentWarnings);var t=performance.now()-s;return l.Z.info("MF: Manifest parsed in "+t+"ms"),{manifest:e,sendingTime:c,receivedTime:f,parsingTime:t}},S=function(e){for(var t,n=ae(e);!(t=n()).done;){var r=t.value;if(u.isCancelled())return;var i=(0,z.Z)(r,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});d("warning",i)}},b=function(){return(b=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ie(t,v,u);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),q(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},_=function(e){return b.apply(this,arguments)},s=performance.now(),u=this._canceller.signal,d=this.trigger.bind(this),c=t.sendingTime,f=t.receivedTime,v=this._getBackoffSetting((function(e){E.trigger("warning",q(e))})),p=null!=i?i:null===(a=this._manifestUrls)||void 0===a?void 0:a[0],h={externalClockOffset:n.externalClockOffset,unsafeMode:n.unsafeMode,previousManifest:n.previousManifest,originalUrl:p},e.prev=11,m=this._pipelines.parseManifest(t,h,S,u,_),m instanceof Promise){e.next=17;break}return e.abrupt("return",T(m.manifest));case 17:return e.next=19,m;case 19:return g=e.sent,y=g.manifest,e.abrupt("return",T(y));case 22:e.next=28;break;case 24:throw e.prev=24,e.t0=e.catch(11),(0,z.Z)(e.t0,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});case 28:case"end":return e.stop()}}),e,this,[[11,24]])})));return function(t,n,r){return e.apply(this,arguments)}}(),n._getBackoffSetting=function(e){var t=s.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,u=o.lowLatencyMode,l=o.maxRetryRegular,d=o.maxRetryOffline;return{onRetry:e,baseDelay:u?i.LOW_LATENCY:i.REGULAR,maxDelay:u?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=l?l:n,maxRetryOffline:null!=d?d:r}},n._recursivelyRefreshManifest=function(e,t){var n=this,r=t.sendingTime,i=t.parsingTime,a=t.updatingTime,o=s.Z.getCurrent(),u=o.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,d=o.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,c=void 0!==i?i+(null!=a?a:0):void 0,f=this._consecutiveUnsafeMode>0?this._consecutiveUnsafeMode<u:void 0!==c&&c>=d,v=void 0===r?0:performance.now()-r,m=Math.max(this._settings.minimumManifestUpdateInterval-v,0),g=new p.ZP;if(g.linkToSignal(this._canceller.signal),this.scheduleManualRefresh=function(t){var i=t.enablePartialRefresh,a=t.delay,o=t.canUseUnsafeMode&&f,s=void 0===r?0:performance.now()-r,u=Math.max(n._settings.minimumManifestUpdateInterval-s,0),l=setTimeout((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:i,unsafeMode:o})}),Math.max((null!=a?a:0)-s,u));g.signal.register((function(){clearTimeout(l)}))},null!==e.expired){var y=setTimeout((function(){var t;null===(t=e.expired)||void 0===t||t.then((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),h.Z)}),m);g.signal.register((function(){clearTimeout(y)}))}if(void 0!==e.lifetime&&e.lifetime>=0){var _,b=1e3*e.lifetime-v;void 0===c?_=b:e.lifetime<3&&c>=100?(_=Math.min(Math.max(3e3-v,Math.max(b,0)+c),6*b),l.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",b,_)):c>=1e3*e.lifetime/10?(_=Math.min(Math.max(b,0)+c,6*b),l.Z.info("MUS: Manifest took too long to parse. Postponing next request",_,_)):_=b;var S=setTimeout((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),Math.max(_,m));g.signal.register((function(){clearTimeout(S)}))}},n._triggerNextManifestRefresh=function(e,t){var n,r,i=this,a=t.enablePartialRefresh,o=t.unsafeMode,u=e.updateUrl;null!==this._prioritizedContentUrl?(n=!0,r=this._prioritizedContentUrl,this._prioritizedContentUrl=null):r=(n=!a||void 0===u)?e.getUrl():u;var d=e.clockOffset;o?(this._consecutiveUnsafeMode+=1,l.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(this._consecutiveUnsafeMode)+" consecutive time.")):this._consecutiveUnsafeMode>0&&(l.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(this._consecutiveUnsafeMode)+" consecutive times."),this._consecutiveUnsafeMode=0),this._isRefreshPending||(this._isRefreshPending=!0,this._fetchManifest(r).then((function(t){return t.parse({externalClockOffset:d,previousManifest:e,unsafeMode:o})})).then((function(t){i._isRefreshPending=!1;var r=t.manifest,a=t.sendingTime,o=t.parsingTime,u=performance.now();if(n)e.replace(r);else try{e.update(r)}catch(t){var d=t instanceof Error?t.message:"unknown error";l.Z.warn("MUS: Attempt to update Manifest failed: "+d,"Re-downloading the Manifest fully");var c=s.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,f=void 0===a?0:performance.now()-a,v=Math.max(i._settings.minimumManifestUpdateInterval-f,0),p=h.Z,m=setTimeout((function(){p(),i._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:!1})}),Math.max(c-f,v));return void(p=i._canceller.signal.register((function(){clearTimeout(m)})))}var g=performance.now()-u;i._recursivelyRefreshManifest(e,{sendingTime:a,parsingTime:o,updatingTime:g})})).catch((function(e){i._isRefreshPending=!1,i._onFatalError(e)})))},n._onFatalError=function(e){this._canceller.isUsed()||(this.trigger("error",e),this.dispose())},t}(G.Z);var ue=se;function le(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 ce=function(e){function t(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=le(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,i.Z)(t,e);var n=t.prototype;return n.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},n.downgradeCdn=function(e){var t=this,n=fe(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=s.Z.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=fe(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},n._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)},n._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},t}(G.Z);function fe(e,t){return 0===e.length?-1:void 0!==t.id?(0,g.Z)(e,(function(e){return e.id===t.id})):(0,g.Z)(e,(function(e){return e.baseUrl===t.baseUrl}))}var ve=n(520),pe=n(7714),he=n(908),me=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}(),ge=(0,he.Z)();var ye=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(0,c.Z)(r,(function(o,s){return i={hasEnded:!1,priority:t,trigger:function(){if(!i.hasEnded){var e=function(){u(),a._endTask(i)},t=new p.ZP,u=t.linkToSignal(r);i.interrupter=t,t.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(t.signal).then((function(t){n.beforeEnded(),e(),o(t)})).catch((function(n){!r.isCancelled()&&t.isUsed()&&n instanceof p.FU||function(t){e(),s(t)}(n)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i),function(){return a._endTask(i)}}))},t._endTask=function(e){e.hasEnded=!0;var t=_e(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=_e(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=_e(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=_e(e,this._pendingTasks);if(i<0)l.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?(l.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=_e(e.taskFn,this._pendingTasks);n<0?l.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 _e(e,t){return(0,g.Z)(t,(function(t){return t.taskFn===e}))}var be=function(){function e(e,t,n){var r=new ce(n),i=s.Z.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new ye({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,i,a,u=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=s.Z.getCurrent(),u=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,l=o.DEFAULT_REQUEST_TIMEOUT,d=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,f=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:u,maxRetryOffline:null!=r?r:d,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?f.LOW_LATENCY:f.REGULAR,requestTimeout:(0,W.Z)(a)?l:a}}(e,this._backoffOptions),d=function(e,t,n,i,a){var s={timeout:a.requestTimeout<0?void 0:a.requestTimeout},u=(0,pe.Z)(["audio","video"],e)?new me:void 0,d=t.loadSegment,c=t.parseSegment;return function(){var e=(0,r.Z)(o().mark((function e(t,r,v){var h,m,g,y,_,b,S,T,E,k,w,A,I,Z,x,R,M,C;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C=function(){var e;E||!(0,W.Z)(b)&&void 0!==b.size&&void 0!==b.requestDuration&&S.length>0&&S.every((function(e){return e}))&&(E=!0,null===(e=i.onMetrics)||void 0===e||e.call(i,{size:b.size,requestDuration:b.requestDuration,content:t,segmentDuration:T}))},M=function(e){r.onRetry(q(e))},R=function(e,n){S.push(!1);var r=S.length-1;return function(i){var a={data:e,isChunked:n};try{var o=c(a,t,i);return S[r]||(T=void 0!==T&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?T+o.chunkInfos.duration:void 0,S[r]=!0,C()),o}catch(e){throw(0,z.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},x=function(e){return d(e,t,s,v,k)},Z=function(){var e;void 0===b&&(l.Z.debug("SF: Segment request cancelled",y),b=null,null===(e=i.onRequestEnd)||void 0===e||e.call(i,{id:_}))},y=(0,ve.K)(t),_=ge(),S=[],T=0,E=!1,k={onProgress:function(e){var t;void 0===b&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=i.onProgress)||void 0===t||t.call(i,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:_}))},onNewChunk:function(e){r.onChunk(R(e,!0))}},null===(w=void 0!==u?u.get(t):null)){e.next=16;break}return l.Z.debug("SF: Found wanted segment in cache",y),r.onChunk(R(w,!1)),e.abrupt("return",Promise.resolve());case 16:return l.Z.debug("SF: Beginning request",y),null===(h=i.onRequestBegin)||void 0===h||h.call(i,{requestTimestamp:performance.now(),id:_,content:t}),v.register(Z),e.prev=19,e.next=22,ne(t.representation.cdnMetadata,n,x,(0,f.Z)({onRetry:M},a),v);case 22:"segment-loaded"===(A=e.sent).resultType?(I=A.resultData.responseData,void 0!==u&&u.add(t,A.resultData.responseData),r.onChunk(R(I,!1))):"segment-created"===A.resultType&&r.onChunk(R(A.resultData,!1)),l.Z.debug("SF: Segment request ended with success",y),r.onAllChunksReceived(),"segment-created"!==A.resultType?(b=A.resultData,C()):b=null,v.isCancelled()||null===(m=i.onRequestEnd)||void 0===m||m.call(i,{id:_}),v.deregister(Z),e.next=41;break;case 31:if(e.prev=31,e.t0=e.catch(19),v.deregister(Z),b=null,!(e.t0 instanceof p.FU)){e.next=38;break}throw l.Z.debug("SF: Segment request aborted",y),e.t0;case 38:throw l.Z.debug("SF: Segment request failed",y),null===(g=i.onRequestEnd)||void 0===g||g.call(i,{id:_}),q(e.t0);case 41:case"end":return e.stop()}}),e,null,[[19,31]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,u);return n=this._prioritizer,i=d,a=new WeakMap,{createRequest:function(e,t,r,o){var s=function(t){return i(e,r,t)},u=n.create(s,t,r,o);return a.set(u,s),u},updatePriority:function(e,t){var r=a.get(e);void 0!==r?n.updatePriority(r,t):l.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Se=be,Te=n(7874),Ee=n(7326);var ke=n(7904),we=n(9612);function Ae(e){}var Ie=function(e){function t(t,n,r){var i;i=e.call(this)||this,l.Z.info("AVSB: calling `mediaSource.addSourceBuffer`",n);var a=r.addSourceBuffer(n);i._canceller=new p.ZP,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegmentUniqueId=null,i.codec=n,i._initSegmentsMap=new Map;var o=i._onPendingTaskError.bind((0,Ee.Z)(i)),u=i._flush.bind((0,Ee.Z)(i)),d=s.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,c=setInterval(u,d);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",u),i._canceller.signal.register((function(){clearInterval(c),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",u)})),i}(0,i.Z)(t,e);var n=t.prototype;return n.declareInitSegment=function(e,t){Ae(t),this._initSegmentsMap.set(e,t)},n.freeInitSegment=function(e){this._initSegmentsMap.delete(e)},n.pushChunk=function(e,t){return Ae(e.data.chunk),l.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,ve.K)(e.inventoryInfos)),this._addToQueue({type:we.f.Push,value:e},t)},n.removeBuffer=function(e,t,n){return l.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:we.f.Remove,value:{start:e,end:t}},n)},n.endOfSegment=function(e,t){return l.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,ve.K)(e)),this._addToQueue({type:we.f.EndOfSegment,value:e},t)},n.getBufferedRanges=function(){return this._sourceBuffer.buffered},n.getPendingOperations=function(){var e=function(e){switch(e.type){case we.f.Push:case we.f.Remove:case we.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},n.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new p.FU),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new p.FU)}if("open"===this._mediaSource.readyState)try{l.Z.debug("AVSB: Calling `abort` on the SourceBuffer"),this._sourceBuffer.abort()}catch(e){l.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},n._onPendingTaskError=function(e){if(this._lastInitSegmentUniqueId=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer"),n=this._pendingTask;n.type===we.f.Push&&0===n.data.length&&null!==n.inventoryData&&this._segmentInventory.insertChunk(n.inventoryData,!1),this._pendingTask=null,n.reject(t)}},n._addToQueue=function(e,t){var n=this;return(0,c.Z)(t,(function(t,r){var i=0===n._queue.length&&null===n._pendingTask,a=(0,f.Z)({resolve:t,reject:r},e);return n._queue.push(a),i&&n._flush(),function(){var e=n._queue.indexOf(a);e>=0&&n._queue.splice(e,1),a.resolve=h.Z,a.reject=h.Z}}))},n._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==we.f.Push||0===e.data.length){switch(e.type){case we.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData,!0);break;case we.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case we.f.Remove:this.synchronizeInventory();break;default:(0,ke.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!==we.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,f.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._lastInitSegmentUniqueId=null,void n.reject(a)}this._pendingTask=(0,f.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case we.f.EndOfSegment:return l.Z.debug("AVSB: Acknowledging complete segment",(0,ve.K)(this._pendingTask.value)),void this._flush();case we.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();l.Z.debug("AVSB: pushing segment",this.bufferType,(0,ve.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case we.f.Remove:var s=this._pendingTask.value,u=s.start,d=s.end;l.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,d),this._sourceBuffer.remove(u,d);break;default:(0,ke.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},n._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(l.Z.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return l.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:l.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;l.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0])this._sourceBuffer.appendWindowStart>0&&(l.Z.debug("AVSB: re-setting `appendWindowStart` to `0`"),this._sourceBuffer.appendWindowStart=0);else if(i[0]!==this._sourceBuffer.appendWindowStart){if(i[0]>=this._sourceBuffer.appendWindowEnd){var s=i[0]+1;l.Z.debug("AVSB: pre-updating `appendWindowEnd`",s),this._sourceBuffer.appendWindowEnd=s}l.Z.debug("AVSB: setting `appendWindowStart`",i[0]),this._sourceBuffer.appendWindowStart=i[0]}if(void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(l.Z.debug("AVSB: re-setting `appendWindowEnd` to `Infinity`"),this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(l.Z.debug("AVSB: setting `appendWindowEnd`",i[1]),this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegmentUniqueId&&(a||!this._isLastInitSegment(e.initSegmentUniqueId))){var u=this._initSegmentsMap.get(e.initSegmentUniqueId);if(void 0===u)throw new Error("Invalid initialization segment uniqueId");t.push(u),this._lastInitSegmentUniqueId=e.initSegmentUniqueId}return null!==e.chunk&&t.push(e.chunk),t},n._isLastInitSegment=function(e){return null!==this._lastInitSegmentUniqueId&&this._lastInitSegmentUniqueId===e},t}(we.C),Ze=["audio","video","text","image"];function xe(e){return"audio"===e||"video"===e}var Re=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return xe(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==Te.Z.nativeTextTracksBuffer&&null==Te.Z.htmlTextTracksBuffer||e.push("text"),null!=Te.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():(0,c.Z)(e,(function(e){var n,r=function(){var e=t._onNativeBufferAddedOrDisabled.indexOf(n);e>=0&&t._onNativeBufferAddedOrDisabled.splice(e,1)};return n=function(){t._areNativeBuffersUsable()&&(r(),e())},t._onNativeBufferAddedOrDisabled.push(n),r}))},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 l.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(xe(e)){if(null!=i)return i instanceof Ie&&i.codec!==t?l.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):l.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;l.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Ie(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return l.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(l.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==Te.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new Te.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==Te.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new Te.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==Te.Z.imageBuffer)throw new Error("Image buffer feature not activated");return l.Z.info("SB: Creating a new image SegmentBuffer"),r=new Te.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw l.Z.error("SB: Unknown buffer type:",e),new u.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?(l.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):l.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Ze.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}(),Me=n(7473),Ce=n.n(Me),Pe=n(3146),De=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 Ne(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 Oe.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.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 Oe(){return(Oe=(0,r.Z)(o().mark((function e(t,n,r,i,a){var s,u,d,c,f,v,p,h;return o().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:s=[],u=(0,m.F_)(t.getBufferedRanges(),n),d=u.innerRange,c=u.outerRanges,f=function(){if(isFinite(i)){for(var e=0;e<c.length;e++){var t=c[e];n+i<=t.start?s.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&s.push({start:n+i,end:t.end})}null!=d&&n+i<d.end&&s.push({start:n+i,end:d.end})}},function(){if(isFinite(r)){for(var e=0;e<c.length;e++){var t=c[e];n-r>=t.end?s.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&s.push({start:t.start,end:n-r})}null!=d&&n-r>d.start&&s.push({start:d.start,end:n-r})}}(),f(),v=0,p=s;case 9:if(!(v<p.length)){e.next=20;break}if(!((h=p[v]).start<h.end)){e.next=17;break}if(l.Z.debug("GC: cleaning range from SegmentBuffer",h.start,h.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(h.start,h.end,a);case 17:v++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Le=function(e){function t(t,n,r,i){var a;return(a=e.call(this)||this)._content=t,a._currentCanceller=null,a._downloadQueue=n,a._initSegmentRequest=null,a._mediaSegmentRequest=null,a._segmentFetcher=r,a._initSegmentInfoRef=new v.Z(void 0),a._mediaSegmentAwaitingInitMetadata=null,i||a._initSegmentInfoRef.setValue(null),a}(0,i.Z)(t,e);var n=t.prototype;return n.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},n.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},n.start=function(){var e=this;null===this._currentCanceller&&(this._currentCanceller=new p.ZP,this._downloadQueue.onUpdate((function(t){var n=t.segmentQueue;if(!(n.length>0&&n[0].segment.id===e._mediaSegmentAwaitingInitMetadata)){var r=e._mediaSegmentRequest;if(0===n.length){if(null===r)return;return l.Z.debug("Stream: no more media segment to request. Cancelling queue.",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()}if(null===r)return l.Z.debug("Stream: Media segments now need to be requested. Starting queue.",e._content.adaptation.type,n.length),void e._restartMediaSegmentDownloadingQueue();var i=n[0];return r.segment.id!==i.segment.id?(l.Z.debug("Stream: Next media segment changed, cancelling previous",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()):void(r.priority!==i.priority&&(l.Z.debug("Stream: Priority of next media segment changed, updating",e._content.adaptation.type,r.priority,i.priority),e._segmentFetcher.updatePriority(r.request,i.priority)))}}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}),this._downloadQueue.onUpdate((function(t){var n,r=e._initSegmentRequest;null===t.initSegment||null===r?(null===(n=t.initSegment)||void 0===n?void 0:n.segment.id)!==(null==r?void 0:r.segment.id)&&(null===t.initSegment&&l.Z.debug("Stream: no more init segment to request. Cancelling queue.",e._content.adaptation.type),e._restartInitSegmentDownloadingQueue(t.initSegment)):t.initSegment.priority!==r.priority&&e._segmentFetcher.updatePriority(r.request,t.initSegment.priority)}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}))},n.stop=function(){var e;null===(e=this._currentCanceller)||void 0===e||e.cancel(),this._currentCanceller=null},n._restartMediaSegmentDownloadingQueue=function(){var e=this;null!==this._mediaSegmentRequest&&this._mediaSegmentRequest.canceller.cancel();!function t(n){if(null!==e._currentCanceller&&e._currentCanceller.isUsed())e._mediaSegmentRequest=null;else{if(void 0===n)return e._mediaSegmentRequest=null,void e.trigger("emptyQueue",null);var r=new p.ZP,i=null===e._currentCanceller?h.Z:r.linkToSignal(e._currentCanceller.signal),a=n.segment,o=n.priority,s=(0,f.Z)({segment:a},e._content),u=!1,c=!1;r.signal.register((function(){e._mediaSegmentRequest=null,u||(e._mediaSegmentAwaitingInitMetadata===a.id&&(e._mediaSegmentAwaitingInitMetadata=null),u=!0,c=!1)}));var v=function(t){(0,d.Z)("media"===t.segmentType,"Should have loaded a media segment."),e.trigger("parsedMediaSegment",(0,f.Z)({},t,{segment:a}))},m=function(){var n=e._downloadQueue.getValue().segmentQueue;if(0===n.length)return u=!0,void e.trigger("emptyQueue",null);n[0].segment.id===a.id&&n.shift(),u=!0,t(n[0])},g=e._segmentFetcher.createRequest(s,o,{onRetry:function(t){e.trigger("requestRetry",{segment:a,error:t})},beforeInterrupted:function(){l.Z.info("Stream: segment request interrupted temporarly.",a.id,a.time)},onChunk:function(t){var n=e._initSegmentInfoRef.getValue();void 0!==n?v(t(null!=n?n:void 0)):(c=!0,e._initSegmentInfoRef.waitUntilDefined((function(e){v(t(null!=e?e:void 0))}),{clearSignal:r.signal}))},onAllChunksReceived:function(){c?(e._mediaSegmentAwaitingInitMetadata=a.id,e._initSegmentInfoRef.waitUntilDefined((function(){e._mediaSegmentAwaitingInitMetadata=null,c=!1,e.trigger("fullyLoadedSegment",a)}),{clearSignal:r.signal})):e.trigger("fullyLoadedSegment",a)},beforeEnded:function(){i(),e._mediaSegmentRequest=null,c?e._initSegmentInfoRef.waitUntilDefined(m,{clearSignal:r.signal}):m()}},r.signal);g.catch((function(t){i(),u||(u=!0,e.stop(),e.trigger("error",t))})),e._mediaSegmentRequest={segment:a,priority:o,request:g,canceller:r}}}(this._downloadQueue.getValue().segmentQueue[0])},n._restartInitSegmentDownloadingQueue=function(e){var t=this;if((null===this._currentCanceller||!this._currentCanceller.isUsed())&&(null!==this._initSegmentRequest&&this._initSegmentRequest.canceller.cancel(),null!==e)){var n=new p.ZP,r=null===this._currentCanceller?h.Z:n.linkToSignal(this._currentCanceller.signal),i=e.segment,a=e.priority,o=(0,f.Z)({segment:i},this._content),s=!1,u=this._segmentFetcher.createRequest(o,a,{onRetry:function(e){t.trigger("requestRetry",{segment:i,error:e})},beforeInterrupted:function(){l.Z.info("Stream: init segment request interrupted temporarly.",i.id)},beforeEnded:function(){r(),t._initSegmentRequest=null,s=!0},onChunk:function(e){var n,r=e(void 0);(0,d.Z)("init"===r.segmentType,"Should have loaded an init segment."),t.trigger("parsedInitSegment",(0,f.Z)({},r,{segment:i})),"init"===r.segmentType&&t._initSegmentInfoRef.setValue(null!==(n=r.initTimescale)&&void 0!==n?n:null)},onAllChunksReceived:function(){t.trigger("fullyLoadedSegment",i)}},n.signal);u.catch((function(e){r(),s||(s=!0,t.stop(),t.trigger("error",e))})),n.signal.register((function(){t._initSegmentRequest=null,s||(s=!0)})),this._initSegmentRequest={segment:i,priority:a,request:u,canceller:n}}},t}(G.Z);function Ue(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 d=s.index.checkDiscontinuity(t.start);if(null!==d)return{start:void 0,end:d}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n)){var f=c.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,f)?(l.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:f}):null}var v=function(e,t,n){if(n<=0)return l.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!==v){var p=i[v-1],h=i[v];if(null===n||h.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(p.infos.segment.end,h.infos.segment.time))return null;var m=p.bufferedEnd,g=h.bufferedStart;return l.Z.debug("RS: future discontinuity encountered",o.type,m,g),{start:m,end:g}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var y=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!==y){var _=i[y];if(void 0!==_.bufferedEnd&&_.bufferedEnd<a.end)return l.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,_.bufferedEnd,a.end),{start:_.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var b=i.length-1;b>=0;b--){var S=i[b];if(void 0===S.bufferedStart)break;if(S.bufferedStart<t.end){if(void 0!==S.bufferedEnd&&S.bufferedEnd<t.end){var T=s.index.checkDiscontinuity(t.end);if(null!==T)return{start:S.bufferedEnd,end:T}}return null}}}return null}function Be(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,u=e.segmentsBeingPushed,d=e.maxBufferSize,c=n.adaptation,v=n.representation,p=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,u,d),h=v.index.getSegments(o.start,o.end-o.start),m=t.filter((function(e){return!Ve(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],u=null;if(function(e,t,n){var r=s.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return l.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 l.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}(u=a(e.infos),e.bufferedStart))return!1;l.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=s.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return l.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 l.Z.info("Stream: The end of the wanted segment has been garbage collected",e.end,e.bufferedEnd),!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}(u=null!=u?u:a(e.infos),e.bufferedEnd))return!1;l.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),g=s.Z.getCurrent(),y=g.MINIMUM_SEGMENT_SIZE,_=g.MIN_BUFFER_AHEAD,b=!1,S=Math.min(1/60,y),T=!1,E=[],k=h.filter((function(e){var t=(0,f.Z)({segment:e},n);if(u.length>0&&u.some((function(e){return(0,ve.z)(t,e)})))return!1;var s=e.duration,d=e.time,h=e.end;if(e.isInit)return!0;if(b)return E.push(e),!1;if(e.complete&&s<y)return!1;if(u.length>0&&u.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-S>d)&&(!(a.end+S<h)&&!Ve(e,t,r,i))})))return!1;for(var g=0;g<m.length;g++){var k=m[g];if(k.infos.period.id===n.period.id){var w=k.infos.segment;if(d-w.time>-S&&w.end-h>-S)return!1}}var A=s*n.representation.bitrate;if(p-A<0&&(T=!0,d>o.start+_))return b=!0,E.push(e),!1;var I=a(t);if(I.length>1){var Z=I[I.length-1],x=I[I.length-2];if(null===Z.buffered&&null===x.buffered)return l.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."+c.type,v.id,e.time),!1}for(var R=0;R<m.length;R++){var M=m[R];if(M.end+S>d){var C=M.start>d+S||Fe(m,R).end<h-S;return C&&(p-=A),C}}return p-=A,!0}));return{segmentsToLoad:k,segmentsOnHold:E,isBufferFull:T}}function Fe(e,t){for(var n=t+1,r=s.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 Ve(e,t,n,r){var i=s.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=s.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 ze(e,t){for(var n=e-t,r=s.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Ke(e,t,n,r,i,a,o){o.synchronizeInventory();var u=e.representation,l=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,d=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,W.Z)(u)&&Re.isNative(e.adaptation.type)&&t>=u&&l.isInitialized()&&!l.isStillAwaitingFutureSegments()&&function(e,t,n){var r,i=e.getPeriodAfter(t);return t.containsTime(n,i)&&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 d,c=i+n;d=!(!s.index.isInitialized()||s.index.isStillAwaitingFutureSegments()||void 0===o.end)&&(void 0===u?c>=o.end:null===u||c>=u);return{start:Math.max(i,o.start),end:Math.min(c,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:d}}(e,l,i),c=u.index.shouldRefresh(d.start,d.end),f=o.getPendingOperations().filter((function(e){return e.type===we.f.EndOfSegment})).map((function(e){return e.value})),v=function(e,t){for(var n=s.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],u=t.length-1;u>=0;u--){var l=t[u],d=l.infos.representation;if(1===l.status&&!1!==d.decipherable&&d.isSupported){var c=l.infos.segment,f=c.time/c.timescale;((c.complete?f+c.duration/c.timescale:l.end)>i&&f<a||l.end>i&&l.start<a)&&o.unshift(l)}}return o}({start:Math.max(d.start-.5,0),end:d.end+.5},o.getInventory()),p=Be({content:e,bufferedSegments:v,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:d,segmentsBeingPushed:f,maxBufferSize:a}),h=p.segmentsToLoad,m=p.segmentsOnHold,g=p.isBufferFull,y=h.map((function(e){return{priority:ze(e.time,l),segment:e}})),_=u.index.isInitialized()&&!u.index.isStillAwaitingFutureSegments()&&d.hasReachedPeriodEnd&&0===y.length&&0===m.length,b=null;return f.length>0&&(b=Math.min.apply(Math,f.map((function(e){return e.segment.time})))),m.length>0&&(b=null!==b?Math.min(b,m[0].time):m[0].time),y.length>0&&(b=null!==b?Math.min(b,y[0].segment.time):y[0].segment.time),{imminentDiscontinuity:Ue(e,d,b,_,v),hasFinishedLoading:_,neededSegments:y,isBufferFull:g,shouldRefreshManifest:c}}function Ge(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 We(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 We(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 We(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 He(e,t,n){return je.apply(this,arguments)}function je(){return(je=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,d,c,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=s.Z.getCurrent().BUFFER_GC_GAPS.CALM,a=s.Z.getCurrent().BUFFER_GC_GAPS.BEEFY,l.Z.warn("Stream: Running garbage collector"),u=n.getBufferedRanges(),0===(d=qe(t,u,i)).length&&(d=qe(t,u,a)),l.Z.hasLevel("DEBUG")&&l.Z.debug("Stream: GC cleaning",d.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),c=Ge(d);case 8:if((f=c()).done){e.next=16;break}if(v=f.value,p=v.start,h=v.end,!(p<h)){e.next=14;break}return e.next=14,n.removeBuffer(p,h,r);case 14:e.next=8;break;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e,t,n){for(var r=(0,m.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&&(l.Z.hasLevel("DEBUG")&&l.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 Ye(e,t,n,r){return Xe.apply(this,arguments)}function Xe(){return(Xe=(0,r.Z)(o().mark((function e(t,n,r,i){var a,s,l,d,c,f;return o().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 21:e.next=27;break;case 5:if(e.prev=5,e.t0=e.catch(0),!(i.isCancelled()&&e.t0 instanceof p.FU)){e.next=11;break}throw e.t0;case 11:if(e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=14;break}throw s=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new u.Z("BUFFER_APPEND_ERROR",s,{adaptation:r.inventoryInfos.adaptation});case 14:return l=t.getReference().getValue(),d=l.position,c=null!==(a=d.pending)&&void 0!==a?a:d.last,e.prev=16,e.next=19,He(c,n,i);case 19:return e.next=21,n.pushChunk(r,i);case 23:throw e.prev=23,e.t1=e.catch(16),f=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new u.Z("BUFFER_FULL_ERROR",f,{adaptation:r.inventoryInfos.adaptation});case 27:case"end":return e.stop()}}),e,null,[[0,5],[16,23]])})))).apply(this,arguments)}function Qe(){return Qe=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u,l,d,c,v,p;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.segment,u=t.segmentData,l=t.segmentBuffer,null===n.cancellationError){e.next=3;break}throw n.cancellationError;case 3:return d=i.representation.getMimeTypeString(),c={initSegmentUniqueId:a,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:d},v=(0,f.Z)({segment:s,chunkSize:void 0,start:0,end:0},i),e.next=8,Ye(r,l,{data:c,inventoryInfos:v},n);case 8:return p=l.getBufferedRanges(),e.abrupt("return",{content:i,segment:s,buffered:p,segmentData:u});case 10:case"end":return e.stop()}}),e)}))),Qe.apply(this,arguments)}function $e(){return $e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,d,c,v,p,h,m,g,y,_,b,S,T,E,k,w,A,I,Z;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,u=t.parsedSegment,l=t.segment,d=t.segmentBuffer,null!==u.chunkData){e.next=3;break}return e.abrupt("return",null);case 3:if(null===n.cancellationError){e.next=5;break}throw n.cancellationError;case 5:return p=u.chunkData,h=u.chunkInfos,m=u.chunkOffset,g=u.chunkSize,y=u.appendWindow,_=i.representation.getMimeTypeString(),b=s.Z.getCurrent(),S=b.APPEND_WINDOW_SECURITIES,T=[void 0!==y[0]?Math.max(0,y[0]-S.START):void 0,void 0!==y[1]?y[1]+S.END:void 0],E={initSegmentUniqueId:a,chunk:p,timestampOffset:m,appendWindow:T,codec:_},k=null!==(c=null==h?void 0:h.time)&&void 0!==c?c:l.time,w=null!==(v=null==h?void 0:h.duration)&&void 0!==v?v:l.duration,A=k+w,void 0!==T[0]&&(k=Math.max(k,T[0])),void 0!==T[1]&&(A=Math.min(A,T[1])),I=(0,f.Z)({segment:l,chunkSize:g,start:k,end:A},i),e.next=18,Ye(r,d,{data:E,inventoryInfos:I},n);case 18:return Z=d.getBufferedRanges(),e.abrupt("return",{content:i,segment:l,buffered:Z,segmentData:p});case 20:case"end":return e.stop()}}),e)}))),$e.apply(this,arguments)}var Je=function(e,t,n){var r=e.content,i=e.options,a=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,d=e.terminate,c=r.period,h=r.adaptation,m=r.representation,g=i.bufferGoal,y=i.maxBufferSize,_=i.drmSystemId,b=i.fastSwitchThreshold,S=h.type,T=new p.ZP;T.linkToSignal(n);var E=new p.ZP;E.linkToSignal(T.signal);var k={segment:m.index.getInitSegment(),uniqueId:null,isLoaded:!1};T.signal.register((function(){null!==k.uniqueId&&o.freeInitSegment(k.uniqueId)}));var w=new v.Z({initSegment:null,segmentQueue:[]},E.signal),A=null!==k.segment;A||(k.isLoaded=!0);var I=!1;if(void 0!==_){var Z=m.getEncryptionData(_);if(Z.length>0&&Z.every((function(e){return void 0!==e.keyIds}))&&(I=!0,t.encryptionDataEncountered(Z.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}var x=new Le(r,w,u,A);return x.addEventListener("error",(function(e){E.signal.isCancelled()||(T.cancel(),t.error(e))})),x.addEventListener("parsedInitSegment",M),x.addEventListener("parsedMediaSegment",M),x.addEventListener("emptyQueue",R),x.addEventListener("requestRetry",(function(e){if(t.warning(e.error),!E.signal.isCancelled()){var n=e.segment,r=m.index;!1===r.isSegmentStillAvailable(n)?R():r.canBeOutOfSyncError(e.error,n)&&t.manifestMightBeOufOfSync()}})),x.addEventListener("fullyLoadedSegment",(function(e){o.endOfSegment((0,f.Z)({segment:e},r),T.signal).catch(C)})),x.start(),E.signal.register((function(){x.removeEventListener(),x.stop()})),a.listen(R,{includeLastObservation:!1,clearSignal:E.signal}),r.manifest.addEventListener("manifestUpdate",R,E.signal),g.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),y.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),d.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),void R();function R(){var e,n;if(!E.isUsed()){var i=a.getReference().getValue(),u=null!==(e=i.position.pending)&&void 0!==e?e:i.position.last,f=Ke(r,u,a,b.getValue(),g.getValue(),y.getValue(),o),v=f.neededSegments,p=null;if(m.index.isInitialized()){if(v.length>0&&!k.isLoaded&&null!==k.segment){var h=v[0].priority;p={segment:k.segment,priority:h}}}else if(null===k.segment)l.Z.warn("Stream: Uninitialized index without an initialization segment");else if(k.isLoaded)l.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var _=null!==(n=i.position.pending)&&void 0!==n?n:i.position.last;p={segment:k.segment,priority:ze(c.start,_)}}var A=d.getValue();if(null===A)w.setValue({initSegment:p,segmentQueue:v});else{if(A.urgent)return l.Z.debug("Stream: Urgent switch, terminate now.",S),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),E.cancel(),void t.terminating();var I=v[0],Z=x.getRequestedInitSegment(),R=x.getRequestedMediaSegment(),M=null===R||void 0===I||R.id!==I.segment.id?[]:[I],P=null===Z?null:p;if(w.setValue({initSegment:P,segmentQueue:M}),0===M.length&&null===P)return l.Z.debug("Stream: No request left, terminate",S),w.finish(),E.cancel(),void t.terminating()}if(t.streamStatusUpdate({period:c,position:i.position.last,bufferType:S,imminentDiscontinuity:f.imminentDiscontinuity,isEmptyStream:!1,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}),!E.signal.isCancelled()){var D=s.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(f.isBufferFull){var N=Math.max(0,u-D);N>0&&o.removeBuffer(0,N,T.signal).catch(C)}f.shouldRefreshManifest&&t.needsManifestRefresh()}}}function M(e){if(!T.isUsed())if("init"===e.segmentType){if(k.isLoaded=!0,!I){var n=m.getAllEncryptionData();if(n.length>0&&(t.encryptionDataEncountered(n.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}if(null!==e.initializationData){var i=m.uniqueId;k.uniqueId=i,o.declareInitSegment(i,e.initializationData),function(e,t){return Qe.apply(this,arguments)}({playbackObserver:a,content:r,initSegmentUniqueId:i,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o},T.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(C)}R()}else{var s=e.inbandEvents,u=e.needsManifestRefresh,l=e.protectionDataUpdate;if(!I&&l){var d=m.getAllEncryptionData();if(d.length>0&&(t.encryptionDataEncountered(d.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}if(!0===u&&(t.needsManifestRefresh(),T.isUsed()))return;if(void 0!==s&&s.length>0&&(t.inbandEvent(s),T.isUsed()))return;var c=k.uniqueId;(function(e,t){return $e.apply(this,arguments)})({playbackObserver:a,content:r,initSegmentUniqueId:c,parsedSegment:e,segment:e.segment,segmentBuffer:o},T.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(C)}}function C(e){T.isUsed()&&e instanceof p.FU||(T.cancel(),t.error(e))}};var et=function(e,t,n){var r=e.playbackObserver,i=e.content,a=e.options,o=e.representationEstimator,d=e.segmentBuffer,c=e.segmentFetcherCreator,m=e.wantedBufferAhead,g=e.maxVideoBufferSize,y="direct"===a.manualBitrateSwitchingMode,_=i.manifest,b=i.period,S=i.adaptation,T=new p.ZP;T.linkToSignal(n);var E,k=new Map,w=new v.Z(null,T.signal),A=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,l=new v.Z([],a);p(),o.addEventListener("decipherabilityUpdate",p);var d=a.register(h),c=t(e,n,l,r,a),f=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:f};function p(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new u.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played",{adaptation:s});return h(),void i(t)}var n=l.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||l.setValue(e)}function h(){o.removeEventListener("decipherabilityUpdate",p),void 0!==d&&d()}}(i,o,w,r,(function(e){T.cancel(),t.error(e)}),T.signal),I=A.estimateRef,Z=A.abrCallbacks,x=c.createSegmentFetcher(S.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics});function R(e,t,n,i){var o=new p.ZP;o.linkToSignal(T.signal);var s=(0,v.l)(m,(function(t){return t*function(e){var t=k.get(e.id),n=void 0!==t?t:1;void 0===t&&k.set(e.id,n);return n}(e)}),o.signal),u="video"===S.type?g:new v.Z(1/0);l.Z.info("Stream: changing representation",S.type,e.id,e.bitrate);var c=(0,f.Z)({},i,{error:function(r){var a,o=(0,z.Z)(r,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"!==o.code)i.error(r);else{var s=m.getValue(),u=.7*(null!==(a=k.get(e.id))&&void 0!==a?a:1);if(u<=.05||s*u<=2)throw o;k.set(e.id,u),(0,$.Z)(4e3,T.signal).then((function(){return R(e,t,n,i)})).catch(h.Z)}},terminating:function(){o.cancel(),i.terminating()}});Je({playbackObserver:r,content:{representation:e,adaptation:S,period:b,manifest:_},segmentBuffer:d,segmentFetcher:x,terminate:t,options:{bufferGoal:s,maxBufferSize:u,drmSystemId:a.drmSystemId,fastSwitchThreshold:n}},c,T.signal)}I.onUpdate((function(e){var n=e.bitrate;void 0!==n&&n!==E&&(E=n,l.Z.debug("Stream: new "+S.type+" bitrate estimate",n),t.bitrateEstimationChange({type:S.type,bitrate:n}))}),{emitCurrentValue:!0,clearSignal:T.signal}),function e(n){var r=new p.ZP;r.linkToSignal(T.signal);var i=I.getValue(),o=i.representation,u=i.manual;if(null===o)return;if(y&&u&&!n){var d=s.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return Ce()((function(){if(!r.isUsed()&&I.getValue().manual){var e=d.bitrateSwitch;return t.waitingMediaSourceReload({bufferType:S.type,period:b,timeOffset:e,stayInPeriod:!0})}}))}var c=new v.Z(null,r.signal);I.onUpdate((function(e){if(null!==e.representation&&e.representation.id!==o.id)return e.urgent?(l.Z.info("Stream: urgent Representation switch",S.type),c.setValue({urgent:!0})):(l.Z.info("Stream: slow Representation switch",S.type),c.setValue({urgent:!1}))}),{clearSignal:r.signal,emitCurrentValue:!0});var f=new v.Z(0);a.enableFastSwitching&&I.onUpdate((function(e){f.setValueIfChanged(null==e?void 0:e.knownStableBitrate)}),{clearSignal:r.signal,emitCurrentValue:!0});var h={type:S.type,period:b,representation:o};if(w.setValue(o),T.isUsed())return;if(t.representationChange(h),T.isUsed())return;var m={streamStatusUpdate:t.streamStatusUpdate,encryptionDataEncountered:t.encryptionDataEncountered,manifestMightBeOufOfSync:t.manifestMightBeOufOfSync,needsManifestRefresh:t.needsManifestRefresh,inbandEvent:t.inbandEvent,warning:t.warning,error:function(e){T.cancel(),t.error(e)},addedSegment:function(e){Z.addedSegment(e),T.isUsed()||t.addedSegment(e)},terminating:function(){if(!r.isUsed())return r.cancel(),e(!1)}};R(o,c,f,m)}(!0)},tt=n(9252);var nt=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,b.Z)(i,(function(e){return(0,tt.Z)(e,"codecs=")})),l=(0,b.Z)(s,(function(e){return(0,tt.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7);return d.split(".")[0]===c.split(".")[0]};function rt(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return nt(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,m.JN)(a),u=t.start,l=null==t.end?1/0:t.end,d=(0,m.tn)(o,[{start:u,end:l}]);if(0===d.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 f=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),v=(0,m.uH)(d,f);if(0===v.length)return{type:"continue",value:void 0};var p=r.currentTime,h=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===h)&&(0,m.Ti)({start:u,end:l},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return nt(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,m.A1)(f,p))return{type:"needs-reload",value:void 0};var g="audio"===n.type&&"direct"===h,y=[],_=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!==_&&(void 0===_.bufferedEnd||t.start-_.bufferedEnd<1)&&y.push({start:0,end:t.start+1});var b=n.type,S=s.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,T=S[b].before;null==T&&(T=0);var E=S[b].after;if(null==E&&(E=0),g||y.push({start:p-T,end:p+E}),void 0!==t.end){var k=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!==k&&(void 0===k.bufferedStart||k.bufferedStart-t.end<1)&&y.push({start:t.end-1,end:Number.MAX_VALUE})}var w=(0,m.uH)(v,y);return 0===w.length?{type:"continue",value:void 0}:g?{type:"flush-buffer",value:w}:{type:"clean-buffer",value:w}}function it(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 at(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 at(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 at(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 ot(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return l.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 u.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played",{adaptation:e})}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}function st(e,t,n,r,i,a){var o=r.period,s=!1;function u(){var r=e.getReference().getValue(),a=t.getValue(),u=r.position.last;void 0!==o.end&&u+a>=o.end&&(l.Z.debug('Stream: full "empty" AdaptationStream',n),s=!0),i.streamStatusUpdate({period:o,bufferType:n,position:u,imminentDiscontinuity:null,isEmptyStream:!0,hasFinishedLoading:s,neededSegments:[]})}t.onUpdate(u,{emitCurrentValue:!1,clearSignal:a}),e.listen(u,{includeLastObservation:!1,clearSignal:a}),u()}var ut=function(e,t,n){var i=e.bufferType,a=e.content,u=e.garbageCollectors,d=e.playbackObserver,c=e.representationEstimator,h=e.segmentFetcherCreator,g=e.segmentBuffersStore,y=e.options,_=e.wantedBufferAhead,b=e.maxVideoBufferSize,S=a.period,T=new v.Z(void 0,n);if(t.periodStreamReady({type:i,period:S,adaptationRef:T}),!n.isCancelled()){var E,k=!0;T.onUpdate((function(e){(0,r.Z)(o().mark((function r(){var a,c,f,v,h,m,b,T,I,Z,x,R,M,C,P,D;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==e){r.next=2;break}return r.abrupt("return");case 2:if((c=new p.ZP).linkToSignal(n),null==E||E.cancel(),E=c,null!==e){r.next=34;break}if(l.Z.info("Stream: Set no "+i+" Adaptation. P:",S.start),"initialized"!==(f=g.getStatus(i)).type){r.next=26;break}if(l.Z.info("Stream: Clearing previous "+i+" SegmentBuffer"),!Re.isNative(i)){r.next=15;break}return r.abrupt("return",A(0,!0,c.signal));case 15:if(v=null!==(a=S.end)&&void 0!==a?a:1/0,!(S.start>v)){r.next=20;break}l.Z.warn("Stream: Can't free buffer: period's start is after its end"),r.next=24;break;case 20:return r.next=22,f.value.removeBuffer(S.start,v,c.signal);case 22:if(!c.isUsed()){r.next=24;break}return r.abrupt("return");case 24:r.next=30;break;case 26:if("uninitialized"!==f.type){r.next=30;break}if(g.disableSegmentBuffer(i),!c.isUsed()){r.next=30;break}return r.abrupt("return");case 30:if(t.adaptationChange({type:i,adaptation:null,period:S}),!c.isUsed()){r.next=33;break}return r.abrupt("return");case 33:return r.abrupt("return",st(d,_,i,{period:S},t,c.signal));case 34:if(h=s.Z.getCurrent(),m=h.DELTA_POSITION_AFTER_RELOAD,b=k?0:"audio"===i?m.trackSwitch.audio:"video"===i?m.trackSwitch.video:m.trackSwitch.other,k=!1,!Re.isNative(i)||"disabled"!==g.getStatus(i).type){r.next=39;break}return r.abrupt("return",A(b,!0,c.signal));case 39:if(l.Z.info("Stream: Updating "+i+" adaptation","A: "+e.id,"P: "+S.start),t.adaptationChange({type:i,adaptation:e,period:S}),!c.isUsed()){r.next=43;break}return r.abrupt("return");case 43:if(T=d.getReadyState(),I=ot(g,i,e,y),Z={currentTime:d.getCurrentTime(),readyState:T},"needs-reload"!==(x=rt(I,S,e,Z,y)).type){r.next=49;break}return r.abrupt("return",A(b,!0,c.signal));case 49:return r.next=51,g.waitForUsableBuffers(c.signal);case 51:if(!c.isUsed()){r.next=53;break}return r.abrupt("return");case 53:if("flush-buffer"!==x.type&&"clean-buffer"!==x.type){r.next=67;break}R=it(x.value);case 55:if((M=R()).done){r.next=63;break}return C=M.value,P=C.start,D=C.end,r.next=59,I.removeBuffer(P,D,c.signal);case 59:if(!c.isUsed()){r.next=61;break}return r.abrupt("return");case 61:r.next=55;break;case 63:if("flush-buffer"!==x.type){r.next=67;break}if(t.needsBufferFlush(),!c.isUsed()){r.next=67;break}return r.abrupt("return");case 67:u.get(I)(c.signal),w(e,I,c.signal);case 69:case"end":return r.stop()}}),r)})))().catch((function(e){e instanceof p.FU||(null==E||E.cancel(),t.error(e))}))}),{clearSignal:n,emitCurrentValue:!0})}function w(e,n,r){var o=a.manifest,s=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=new v.Z(i(),n);return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,m.L7)(r,n.position.last);return(0,f.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(d,n);et({content:{manifest:o,period:S,adaptation:e},options:y,playbackObserver:s,representationEstimator:c,segmentBuffer:n,segmentFetcherCreator:h,wantedBufferAhead:_,maxVideoBufferSize:b},Object.assign(Object.assign({},t),{error:function(e){if(!Re.isNative(i)){l.Z.error("Stream: "+i+" Stream crashed. Aborting it.",e instanceof Error?e:""),g.disposeSegmentBuffer(i);var n=(0,z.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});if(t.warning(n),r.isCancelled())return;return st(d,_,i,{period:S},t,r)}l.Z.error("Stream: "+i+" Stream crashed. Stopping playback.",e instanceof Error?e:""),t.error(e)}}),r)}function A(e,n,r){Ce()((function(){d.listen((function(){t.waitingMediaSourceReload({bufferType:i,period:S,timeOffset:e,stayInPeriod:n})}),{includeLastObservation:!0,clearSignal:r})}))}};function lt(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n,r=[],i=e.getInventory(),a=function(){var e=i[o];if(t.some((function(t){return e.infos.period.id===t.period.id&&e.infos.adaptation.id===t.adaptation.id&&e.infos.representation.id===t.representation.id}))){var n=e.bufferedStart,a=e.bufferedEnd;if(void 0===n||void 0===a)return l.Z.warn("SO: No buffered start or end found from a segment."),{v:[{start:0,end:Number.MAX_VALUE}]};var s=r[r.length-1];void 0!==s&&s.end===n?s.end=a:r.push({start:n,end:a})}},o=0;o<i.length;o++)if(n=a())return n.v;return r}function dt(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 ct(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 ct(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 ct(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 ft(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 vt=function(e,t,n,i,a,d,c,f){for(var h,m=e.manifest,g=e.initialPeriod,y=d.maxBufferAhead,_=d.maxBufferBehind,b=d.wantedBufferAhead,S=d.maxVideoBufferSize,T=s.Z.getCurrent(),E=T.MINIMUM_MAX_BUFFER_AHEAD,k=T.MAXIMUM_MAX_BUFFER_AHEAD,w=T.MAXIMUM_MAX_BUFFER_BEHIND,A=new De((function(e){var n,r,i=e.bufferType,a=null!==(n=w[i])&&void 0!==n?n:1/0,o=null!==(r=k[i])&&void 0!==r?r:1/0;return function(n){Ne({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,v.l)(_,(function(e){return Math.min(e,a)}),n),maxBufferAhead:(0,v.l)(y,(function(e){var t,n=Math.max(e,null!==(t=E[i])&&void 0!==t?t:0);return Math.min(n,o)}),n)},n)}})),I=dt(i.getBufferTypes());!(h=I()).done;){Z(h.value,g)}function Z(e,n){var a=new Pe.Z((function(e,t){return e.start-t.start})),s=!1,d=new p.ZP;return d.linkToSignal(f),t.listen((function(t){var n,r,i=t.position,o=null!==(n=i.pending)&&void 0!==n?n:i.last;if(s&&function(e){var t=a.head(),n=a.last();if(null==t||null==n)return!0;return t.start>e||(null==n.end?1/0:n.end)<e}(o)){for(l.Z.info("Stream: Destroying all PeriodStreams due to out of bounds situation",e,o),s=!1;a.length()>0;){var u=a.get(a.length()-1);a.removeElement(u),c.periodStreamCleared({type:e,period:u})}d.cancel(),(d=new p.ZP).linkToSignal(f);var h=null!==(r=m.getPeriodForTime(o))&&void 0!==r?r:m.getNextPeriod(o);if(void 0===h)return l.Z.warn("Stream: The wanted position is not found in the Manifest."),void(s=!0);v(h)}}),{clearSignal:f,includeLastObservation:!0}),m.addEventListener("decipherabilityUpdate",(function(e){(function(e){return h.apply(this,arguments)})(e).catch((function(e){d.cancel(),c.error(e)}))}),f),v(n);function v(t){var n=Object.assign(Object.assign({},c),{waitingMediaSourceReload:function(e){var t=a.head();void 0===t||t.id!==e.period.id?c.lockedStream({bufferType:e.bufferType,period:e.period}):c.needsMediaSourceReload({timeOffset:e.timeOffset,minimumPosition:e.stayInPeriod?e.period.start:void 0,maximumPosition:e.stayInPeriod?e.period.end:void 0})},periodStreamReady:function(e){s=!0,a.add(e.period),c.periodStreamReady(e)},periodStreamCleared:function(e){a.removeElement(e.period),c.periodStreamCleared(e)},error:function(e){d.cancel(),c.error(e)}});x(e,t,n,d.signal)}function h(){return h=(0,r.Z)(o().mark((function n(r){var h,g,y,_,b,S,T,E,k,w,A,I,Z;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h=i.getStatus(e),0!==(g=r.filter((function(t){return t.adaptation.type===e}))).length&&"initialized"===h.type&&!g.every((function(e){return!0===e.representation.decipherable}))){n.next=4;break}return n.abrupt("return");case 4:for(y=h.value,_=g.filter((function(e){return void 0===e.representation.decipherable})),b=g.filter((function(e){return!1===e.representation.decipherable})),S=lt(y,b),T=lt(y,_),s=!1,l.Z.info("Stream: Destroying all PeriodStreams for decipherability matters",e);a.length()>0;)E=a.get(a.length()-1),a.removeElement(E),c.periodStreamCleared({type:e,period:E});d.cancel(),(d=new p.ZP).linkToSignal(f),k=0,w=[].concat(S,T);case 16:if(!(k<w.length)){n.next=26;break}if(A=w[k],I=A.start,Z=A.end,!(I<Z)){n.next=23;break}if(!f.isCancelled()){n.next=21;break}return n.abrupt("return");case 21:return n.next=23,y.removeBuffer(I,Z,f);case 23:k++,n.next=16;break;case 26:Ce()((function(){var e;if(!f.isCancelled()){var n=t.getReference().getValue();if(ft(n,S)){if(c.needsDecipherabilityFlush(),f.isCancelled())return}else if(ft(n,T)&&(c.needsBufferFlush(),f.isCancelled()))return;var r=null!==(e=n.position.pending)&&void 0!==e?e:n.position.last,i=m.getPeriodForTime(r);null!=i?v(i):c.error(new u.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest."))}}));case 27:case"end":return n.stop()}}),n)}))),h.apply(this,arguments)}}function x(e,r,o,s){l.Z.info("Stream: Creating new Stream for",e,r.start);var u=null,c=new p.ZP;c.linkToSignal(s),t.listen((function(t,n){var i,a,s=t.position,u=null!==(i=s.pending)&&void 0!==i?i:s.last;if(void 0!==r.end&&u>=r.end){var d=m.getPeriodAfter(r);if(r.containsTime(u,d))return;l.Z.info("Stream: Destroying PeriodStream as the current playhead moved above it",e,r.start,null!==(a=s.pending)&&void 0!==a?a:s.last,r.end),n(),o.periodStreamCleared({type:e,period:r}),c.cancel()}}),{clearSignal:s,includeLastObservation:!0});var f={bufferType:e,content:{manifest:m,period:r},garbageCollectors:A,maxVideoBufferSize:S,segmentFetcherCreator:a,segmentBuffersStore:i,options:d,playbackObserver:t,representationEstimator:n,wantedBufferAhead:b},v=Object.assign(Object.assign({},o),{streamStatusUpdate:function(t){if(t.hasFinishedLoading){var n=m.getPeriodAfter(r);null!==n&&function(t){if(null!==u){if(u.period.id===t.id)return;l.Z.warn("Stream: Creating next `PeriodStream` while one was already created.",e,t.id,u.period.id),o.periodStreamCleared({type:e,period:u.period}),u.canceller.cancel()}var n=new p.ZP;n.linkToSignal(s),u={canceller:n,period:t},x(e,t,o,u.canceller.signal)}(n)}else null!==u&&(l.Z.info("Stream: Destroying next PeriodStream due to current one being active",e,u.period.start),o.periodStreamCleared({type:e,period:u.period}),u.canceller.cancel(),u=null);o.streamStatusUpdate(t)},error:function(e){null!==u&&(u.canceller.cancel(),u=null),c.cancel(),o.error(e)}});ut(f,v,c.signal)}},pt=vt,ht=n(9420);function mt(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 gt(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 gt(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 gt(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 yt=function(e){function t(t,n,r){var i;(i=e.call(this)||this)._canceller=new p.ZP,i._manifest=t,i._activeStreams=new Map,i._allBufferTypes=r,i._lastCurrentPeriodId=null;var a=new _t(t);i._maximumPositionCalculator=a;var o=i._canceller.signal;return n.listen((function(e){var n,r=e.position,o=null!==(n=r.pending)&&void 0!==n?n:r.last;if(o<t.getMinimumSafePosition()){var s=new u.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");i.trigger("warning",s)}else if(o>a.getMaximumAvailablePosition()){var l=new u.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");i.trigger("warning",l)}}),{includeLastObservation:!0,clearSignal:o}),t.addEventListener("manifestUpdate",(function(){i.trigger("endingPositionChange",i._getManifestEndTime()),o.isCancelled()||i._checkEndOfStream()}),o),i}(0,i.Z)(t,e);var n=t.prototype;return n.getCurrentEndingTime=function(){return this._getManifestEndTime()},n.onAdaptationChange=function(e,t,n){if(this._manifest.isLastPeriodKnown){var r=this._manifest.periods[this._manifest.periods.length-1];if(t.id===(null==r?void 0:r.id)&&("audio"===e||"video"===e)){"audio"===e?this._maximumPositionCalculator.updateLastAudioAdaptation(n):this._maximumPositionCalculator.updateLastVideoAdaptation(n);var i=this._maximumPositionCalculator.getEndingPosition(),a=void 0!==i?{isEnd:!0,endingPosition:i}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()};this.trigger("endingPositionChange",a)}}this._canceller.isUsed()||null===n&&this._addActivelyLoadedPeriod(t,e)},n.onRepresentationChange=function(e,t){this._addActivelyLoadedPeriod(t,e)},n.onPeriodCleared=function(e,t){this._removeActivelyLoadedPeriod(t,e)},n.onLastSegmentFinishedLoading=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod||(t.hasFinishedLoadingLastPeriod=!0,this._checkEndOfStream())},n.onLastSegmentLoadingResume=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod&&(t.hasFinishedLoadingLastPeriod=!1,this._checkEndOfStream())},n.dispose=function(){this.removeEventListener(),this._canceller.cancel()},n._addActivelyLoadedPeriod=function(e,t){var n=this._lazilyCreateActiveStreamInfo(t);n.activePeriods.has(e)||(n.activePeriods.add(e),this._checkCurrentPeriod())},n._removeActivelyLoadedPeriod=function(e,t){var n=this._activeStreams.get(t);void 0!==n&&n.activePeriods.has(e)&&(n.activePeriods.removeElement(e),this._checkCurrentPeriod())},n._checkCurrentPeriod=function(){var e=this;if(0!==this._allBufferTypes.length){var t=this._activeStreams.get(this._allBufferTypes[0]);if(void 0!==t)for(var n,r,i=function(){for(var t=r.value,n=!0,i=1;i<e._allBufferTypes.length;i++){var a=e._activeStreams.get(e._allBufferTypes[i]);if(void 0===a)return{v:void 0};if(!a.activePeriods.toArray().some((function(e){return e.id===t.id}))){n=!1;break}}if(n)return e._lastCurrentPeriodId!==t.id&&(e._lastCurrentPeriodId=t.id,e.trigger("periodChange",t)),{v:void 0}},a=mt(t.activePeriods.toArray());!(r=a()).done;)if(n=i())return n.v}},n._getManifestEndTime=function(){var e=this._maximumPositionCalculator.getEndingPosition();return void 0!==e?{isEnd:!0,endingPosition:e}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()}},n._lazilyCreateActiveStreamInfo=function(e){var t=this._activeStreams.get(e);return void 0===t&&(t={activePeriods:new Pe.Z((function(e,t){return e.start-t.start})),hasFinishedLoadingLastPeriod:!1},this._activeStreams.set(e,t)),t},n._checkEndOfStream=function(){var e=this;this._manifest.isLastPeriodKnown&&(this._allBufferTypes.every((function(t){var n=e._activeStreams.get(t);return void 0!==n&&n.hasFinishedLoadingLastPeriod}))?this.trigger("endOfStream",null):this.trigger("resumeStream",null))},t}(G.Z),_t=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(){if(this._manifest.isDynamic)return 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 e=bt(this._lastVideoAdaptation);return"number"!=typeof e?this._manifest.getMaximumSafePosition():e}if(null===this._lastVideoAdaptation){var t=bt(this._lastAudioAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}var n=bt(this._lastAudioAdaptation),r=bt(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?this._manifest.getMaximumSafePosition():Math.min(n,r)},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=St(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=St(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=St(this._lastAudioAdaptation),r=St(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function bt(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,W.Z)(r)?a:Math.min(r,a))}return r}function St(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,W.Z)(r)?a:Math.min(r,a))}return r}var Tt=n(5767),Et=n(3774),kt=n(3038),wt=n(6923);function At(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&&(l.Z.info("Init: Aborting SourceBuffer before removing"),o.abort()),l.Z.info("Init: Removing SourceBuffer from mediaSource"),t.removeSourceBuffer(o)}catch(e){l.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&l.Z.warn("Init: Not all SourceBuffers could have been removed.")}if(l.Z.info("Init: Clearing HTMLMediaElement's src"),(0,Tt.Z)(e),null!==n)try{l.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){l.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function It(e,t){return(0,c.Z)(t,(function(n){var r=function(e,t){if(null==Et.J)throw new u.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,wt.Z)(e.src)?e.src:null;At(e,null,n),l.Z.info("Init: Creating MediaSource");var r=new Et.J,i=URL.createObjectURL(r);return l.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.register((function(){At(e,r,i)})),r}(e,t);kt.u_(r,(function(){l.Z.info("Init: MediaSource opened"),n(r)}),t)}))}function Zt(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 xt(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 xt(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 xt(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 Rt=kt.x6,Mt=kt.u_,Ct=kt.y4;function Pt(e,t){if(l.Z.debug("Init: Trying to call endOfStream"),"open"===e.readyState){var n=e.sourceBuffers,r=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(n);if(0===r.length)return l.Z.info("Init: Triggering end of stream"),void e.endOfStream();l.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var i=new p.ZP;i.linkToSignal(t);for(var a,o=Zt(r);!(a=o()).done;){var s=a.value;Ct(s,(function(){i.cancel(),Pt(e,t)}),i.signal)}Rt(n,(function(){i.cancel(),Pt(e,t)}),i.signal)}else l.Z.debug("Init: MediaSource not open, cancel endOfStream")}function Dt(e,t,n){var r;if(!(0,W.Z)(n)){var i=e.getMinimumSafePosition(),a=e.getMaximumSafePosition();if(!(0,W.Z)(n.position))return l.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,a),i);if(!(0,W.Z)(n.wallClockTime)){l.Z.debug("Init: using startAt.wallClockTime");var o=void 0===e.availabilityStartTime?0:e.availabilityStartTime,u=n.wallClockTime-o;return Math.max(Math.min(u,a),i)}if(!(0,W.Z)(n.fromFirstPosition)){l.Z.debug("Init: using startAt.fromFirstPosition");var d=n.fromFirstPosition;return d<=0?i:Math.min(a,i+d)}if(!(0,W.Z)(n.fromLastPosition)){l.Z.debug("Init: using startAt.fromLastPosition");var c=n.fromLastPosition;return c>=0?a:Math.max(i,a+c)}if(!(0,W.Z)(n.fromLivePosition)){l.Z.debug("Init: using startAt.fromLivePosition");var f=null!==(r=e.getLivePosition())&&void 0!==r?r:a,v=n.fromLivePosition;return v>=0?f:Math.max(i,f+v)}if(!(0,W.Z)(n.percentage)){l.Z.debug("Init: using startAt.percentage");var p=n.percentage;return p>100?a:p<0?i:i+(a-i)*(+p/100)}}var h=e.getMinimumSafePosition();if(e.isLive){var m,g=e.suggestedPresentationDelay,y=e.clockOffset,_=e.getMaximumSafePosition(),b=s.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===y)l.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),m=_;else{l.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var S=void 0===e.availabilityStartTime?0:e.availabilityStartTime,T=(performance.now()+y)/1e3-S;m=Math.min(_,T)}var E=void 0!==g?g:t?b.LOW_LATENCY:b.DEFAULT;return l.Z.debug("Init: "+m+" defined as the live time, applying a live gap of "+E),Math.max(m-E,h)}return l.Z.info("Init: starting at the minimum available position:",h),h}var Nt=n(379),Ot=n(9016),Lt=n(7794),Ut=n(3666);var Bt=31536e3,Ft=function(){function e(e){this._mediaSource=e,this._currentMediaSourceDurationUpdateCanceller=null}var t=e.prototype;return t.updateDuration=function(e,t){null!==this._currentMediaSourceDurationUpdateCanceller&&this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=new p.ZP;var n=this._mediaSource,r=this._currentMediaSourceDurationUpdateCanceller.signal,i=function(e,t){var n=new v.Z("open"===e.readyState,t);return(0,kt.u_)(e,(function(){l.Z.debug("Init: Reacting to MediaSource open in duration updater"),n.setValueIfChanged(!0)}),t),(0,kt.N8)(e,(function(){l.Z.debug("Init: Reacting to MediaSource ended in duration updater"),n.setValueIfChanged(!1)}),t),(0,kt.k6)(e,(function(){l.Z.debug("Init: Reacting to MediaSource close in duration updater"),n.setValueIfChanged(!1)}),t),n}(n,r),a=new p.ZP;a.linkToSignal(r),i.onUpdate((function(){if(a.cancel(),!i.getValue())return;(a=new p.ZP).linkToSignal(r);var o=function(e,t){if(0===e.length){var n=new v.Z(!1);return n.finish(),n}var r=new v.Z(!1,t);o();for(var i=function(){var n=e[a];n.addEventListener("updatestart",o),n.addEventListener("update",o),t.register((function(){n.removeEventListener("updatestart",o),n.removeEventListener("update",o)}))},a=0;a<e.length;a++)i();return r;function o(){for(var t=0;t<e.length;t++){if(e[t].updating)return void r.setValueIfChanged(!0)}r.setValueIfChanged(!1)}}(n.sourceBuffers,a.signal),s=new p.ZP;return s.linkToSignal(a.signal),o.onUpdate((function(r){s.cancel(),(s=new p.ZP).linkToSignal(a.signal),r||zt(n,e,t,s.signal)}),{clearSignal:a.signal,emitCurrentValue:!0})}),{emitCurrentValue:!0,clearSignal:r})},t.stopUpdating=function(){null!==this._currentMediaSourceDurationUpdateCanceller&&(this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=null)},e}();function Vt(e,t,n){var r=t;n||(r=Ut.lV?1/0:Kt(t));for(var i=0,a=0;a<e.sourceBuffers.length;a++){var o=e.sourceBuffers[a],s=o.buffered.length;s>0&&(i=Math.max(o.buffered.end(s-1)))}if(r===e.duration)return"success";if(i>r){if(i<e.duration)try{l.Z.info("Init: Updating duration to what is currently buffered",i),e.duration=i}catch(e){return l.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var u=e.duration;try{if(l.Z.info("Init: Updating duration",r),e.duration=r,"open"===e.readyState&&!isFinite(r)){var d=Kt(t);l.Z.info("Init: calling `mediaSource.setLiveSeekableRange`",d),e.setLiveSeekableRange(0,d)}}catch(e){return l.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var c=Math.abs(e.duration-r);return c>=.1?c<Math.abs(e.duration-u)?"partial":"failed":"success"}function zt(e,t,n,r){if("success"!==Vt(e,t,n))var i=setTimeout((function(){a(),zt(e,t,n,r)}),2e3),a=r.register((function(){clearTimeout(i)}))}function Kt(e){return Math.max(Math.pow(2,32),e+Bt)}var Gt=n(6199);var Wt=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var Ht=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(Wt(u,{id:a,start:r,end:i}))return void n.push(u)}var l=o.value.element,d={type:o.type,value:Object.assign(Object.assign({},o.value),{element:l})};if(void 0===i){var c={start:r,id:a,data:d,publicEvent:{start:r,data:d}};n.push(c)}else{var f={start:r,end:i,id:a,data:d,publicEvent:{start:r,end:i,data:d}};n.push(f)}}))}return n};function jt(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 qt(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 qt(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 qt(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 Yt=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._manifest=t,i._mediaElement=n,i._playbackObserver=r,i._canceller=null,i._scheduledEventsRef=new v.Z([]),i._eventsBeingPlayed=new WeakMap,i}(0,i.Z)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(null===this._canceller){this._canceller=new p.ZP;var t=this._canceller.signal,n=this._playbackObserver,r=this._mediaElement,i=!1,a=new p.ZP;a.linkToSignal(t),this._manifest.addEventListener("manifestUpdate",(function(){var t=e._scheduledEventsRef.getValue();e._scheduledEventsRef.setValue(Ht(t,e._manifest))}),this._canceller.signal),this._scheduledEventsRef.setValue(Ht([],this._manifest)),this._scheduledEventsRef.onUpdate((function(o){if(0!==o.length){if(!i){i=!0;var u=f(),l=function(){var t=f();e._emitStreamEvents(e._scheduledEventsRef.getValue(),u,t,a.signal),u=t},d=s.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL,c=setInterval(l,d);n.listen(l,{includeLastObservation:!1,clearSignal:a.signal}),a.signal.register((function(){clearInterval(c)}))}}else i&&(a.cancel(),(a=new p.ZP).linkToSignal(t),i=!1);function f(){var e=n.getReference().getValue().seeking;return{currentTime:r.currentTime,isSeeking:e}}}),{emitCurrentValue:!0,clearSignal:t})}},n.stop=function(){null!==this._canceller&&(this._canceller.cancel(),this._canceller=null)},n._emitStreamEvents=function(e,t,n,r){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],c=d.start,f=Xt(d)?d.end:void 0;this._eventsBeingPlayed.has(d)?(c>o||void 0!==f&&o>=f)&&(Xt(d)&&u.push(d.publicEvent),this._eventsBeingPlayed.delete(d)):c<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:d.publicEvent}),this._eventsBeingPlayed.set(d,!0)):i<c&&o>=(null!=f?f:c)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),Xt(d)&&u.push(d.publicEvent)))}if(s.length>0)for(var v,p=jt(s);!(v=p()).done;){var h=v.value;if("stream-event"===h.type?this.trigger("event",h.value):this.trigger("eventSkip",h.value),r.isCancelled())return}if(u.length>0)for(var m,g=jt(u);!(m=g()).done;){var y=m.value;if("function"==typeof y.onExit&&y.onExit(),r.isCancelled())return}},t}(G.Z);function Xt(e){return void 0!==e.end}var Qt=Yt,$t=n(4576);function Jt(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 en(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 en(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 en(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 tn=function(e){function t(t){var n;(n=e.call(this)||this)._settings=t,n._initCanceller=new p.ZP,n._initialManifestProm=null;var r=void 0===t.url?void 0:[t.url];return n._manifestFetcher=new ue(r,t.transport,t.manifestRequestSettings),n}(0,i.Z)(t,e);var n=t.prototype;return n.prepare=function(){var e=this;null===this._initialManifestProm&&(this._initialManifestProm=(0,c.Z)(this._initCanceller.signal,(function(t,n){e._manifestFetcher.addEventListener("warning",(function(t){return e.trigger("warning",t)})),e._manifestFetcher.addEventListener("error",(function(t){e.trigger("error",t),n(t)})),e._manifestFetcher.addEventListener("manifestReady",(function(e){t(e)}))})),this._manifestFetcher.start(),this._initCanceller.signal.register((function(){e._manifestFetcher.dispose()})))},n.start=function(e,t){var n=this;this.prepare(),(0,$t.Z)(e,(function(e){return n._onFatalError(e)}),this._initCanceller.signal);var r=new v.Z(null,this._initCanceller.signal);this._initializeMediaSourceAndDecryption(e,r).then((function(i){return n._onInitialMediaSourceReady(e,i.mediaSource,t,i.drmSystemId,r,i.unlinkMediaSource)})).catch((function(e){n._onFatalError(e)}))},n.updateContentUrls=function(e,t){this._manifestFetcher.updateContentUrls(e,t)},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.isUsed()||(this._initCanceller.cancel(),this.trigger("error",e))},n._initializeMediaSourceAndDecryption=function(e,t){var n=this,r=this._initCanceller;return(0,c.Z)(r.signal,(function(i){var a=n._settings.keySystems,o=(0,Lt.Z)(e,a,t,{onWarning:function(e){return n.trigger("warning",e)},onError:function(e){return n._onFatalError(e)}},r.signal);o.onUpdate((function(t,a){if("uninitialized"!==t.initializationState.type){a();var s=new p.ZP;s.linkToSignal(r.signal),It(e,s.signal).then((function(e){var n=o.getValue();if("awaiting-media-link"===n.initializationState.type)n.initializationState.value.isMediaLinked.setValue(!0),o.onUpdate((function(t,n){if("initialized"===t.initializationState.type)return n(),void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})}),{emitCurrentValue:!0,clearSignal:r.signal});else if("initialized"===t.initializationState.type)return void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})})).catch((function(e){s.isUsed()||n._onFatalError(e)}))}}),{emitCurrentValue:!0,clearSignal:r.signal})}))},n._onInitialMediaSourceReady=function(){var e=(0,r.Z)(o().mark((function e(t,n,r,i,a,s){var u,c,v,h,m,g,y,_,b,S,T,E,k,w,A,I,Z,x,R,M,C,P=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C=function(e,n,i,o){x({mediaElement:t,playbackObserver:r,mediaSource:e,initialTime:n,autoPlay:i,manifest:k,representationEstimator:A,segmentFetcherCreator:Z,speed:y,protectionRef:a,bufferOptions:I},(function(e){if(o.cancel(),T.isUsed())return;if(R("reloadingMediaSource",e),T.isUsed())return;var n=new p.ZP;n.linkToSignal(T.signal),It(t,n.signal).then((function(t){C(t,e.position,e.autoPlay,n)})).catch((function(e){n.isUsed()||M(e)}))}),o.signal)},u=this._settings,c=u.adaptiveOptions,v=u.autoPlay,h=u.bufferOptions,m=u.lowLatencyMode,g=u.segmentRequestOptions,y=u.speed,_=u.startAt,b=u.textTrackOptions,S=u.transport,T=this._initCanceller,(0,d.Z)(null!==this._initialManifestProm),E=this._initialManifestProm,e.prev=5,e.next=8,E;case 8:k=e.sent,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return");case 14:if(k.addEventListener("manifestUpdate",(function(){P.trigger("manifestUpdate",null)}),T.signal),k.addEventListener("decipherabilityUpdate",(function(e){P.trigger("decipherabilityUpdate",e)}),T.signal),l.Z.debug("Init: Calculating initial time"),w=Dt(k,m,_),l.Z.debug("Init: Initial time calculated:",w),A=F(c),I=(0,f.Z)({textTrackOptions:b,drmSystemId:i},h),Z=new Se(S,g,T.signal),this.trigger("manifestReady",k),!T.isUsed()){e.next=25;break}return e.abrupt("return");case 25:x=this._startBufferingOnMediaSource.bind(this),R=this.trigger.bind(this),M=this._onFatalError.bind(this),C(n,w,v,s);case 29:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}(),n._startBufferingOnMediaSource=function(e,t,n){var r,i=this,a=e.autoPlay,o=e.bufferOptions,l=e.initialTime,d=e.manifest,c=e.mediaElement,f=e.mediaSource,h=e.playbackObserver,m=e.protectionRef,g=e.representationEstimator,y=e.segmentFetcherCreator,_=e.speed,b=null!==(r=d.getPeriodForTime(l))&&void 0!==r?r:d.getNextPeriod(l);if(void 0===b){var S=new u.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return this._onFatalError(S)}var T=new Re(c,f);n.register((function(){T.disposeAll()}));var E=(0,Ot.Z)(c,h,l,a,(function(e){return i.trigger("warning",e)}),!0,n),k=E.autoPlayResult,w=E.initialPlayPerformed,A=E.initialSeekPerformed;if(!n.isCancelled()){w.onUpdate((function(e,t){if(e){t();var r=new Qt(d,c,h);r.addEventListener("event",(function(e){i.trigger("streamEvent",e)}),n),r.addEventListener("eventSkip",(function(e){i.trigger("streamEventSkip",e)}),n),r.start(),n.register((function(){r.stop()}))}}),{clearSignal:n,emitCurrentValue:!0});var I=function(e,t,n){var r=t.autoPlay,i=t.initialPlayPerformed,a=t.initialSeekPerformed,o=t.manifest,s=t.speed,u=t.startTime;return e.deriveReadOnlyObserver((function(e,t){var l=new p.ZP;l.linkToSignal(t),l.linkToSignal(n);var d=new v.Z(c(),l.signal);return s.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),e.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),d;function c(){var t,n=e.getValue(),l=s.getValue();if(a.getValue()){if(!o.isDynamic||o.isLastPeriodKnown){var d=o.periods[o.periods.length-1];void 0!==d&&void 0!==d.end&&n.position>d.end&&(t=d.end-1)}}else t=u;return{maximumPosition:o.getMaximumSafePosition(),position:{last:n.position,pending:t},duration:n.duration,paused:{last:n.paused,pending:i.getValue()||!r===n.paused?void 0:!r},readyState:n.readyState,speed:l}}function f(){d.setValue(c())}}))}(h,{autoPlay:a,manifest:d,initialPlayPerformed:w,initialSeekPerformed:A,speed:_,startTime:l},n),Z=this._createRebufferingController(h,d,_,n),x=this._createContentTimeBoundariesObserver(d,f,I,T,n);k.then((function(){(0,Nt.Z)(h,c,!1,n).onUpdate((function(e,t){e&&(t(),i.trigger("loaded",{segmentBuffersStore:T}))}),{emitCurrentValue:!0,clearSignal:n})})).catch((function(e){n.isCancelled()||i._onFatalError(e)}));var R=this;pt({manifest:d,initialPeriod:b},I,g,T,y,o,{needsBufferFlush:function(){var e=c.currentTime+.001;h.setCurrentTime(e),h.listen((function(t,n){(null!==t.currentRange||t.position>e+.1)&&(n(),h.setCurrentTime(t.position+.001))}),{includeLastObservation:!1,clearSignal:n})},streamStatusUpdate:function(e){var t=e.period,r=e.bufferType,i=e.imminentDiscontinuity,a=e.position;Z.updateDiscontinuityInfo({period:t,bufferType:r,discontinuity:i,position:a}),n.isCancelled()||d.isLastPeriodKnown&&e.period.id===d.periods[d.periods.length-1].id&&(e.hasFinishedLoading||e.isEmptyStream?x.onLastSegmentFinishedLoading(e.bufferType):x.onLastSegmentLoadingResume(e.bufferType))},needsManifestRefresh:function(){return R._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!0,canUseUnsafeMode:!0})},manifestMightBeOufOfSync:function(){var e=s.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;R._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!1,canUseUnsafeMode:!1,delay:e})},lockedStream:function(e){return Z.onLockedStream(e.bufferType,e.period)},adaptationChange:function(e){R.trigger("adaptationChange",e),n.isCancelled()||x.onAdaptationChange(e.type,e.period,e.adaptation)},representationChange:function(e){R.trigger("representationChange",e),n.isCancelled()||x.onRepresentationChange(e.type,e.period)},inbandEvent:function(e){return R.trigger("inbandEvents",e)},warning:function(e){return R.trigger("warning",e)},periodStreamReady:function(e){return R.trigger("periodStreamReady",e)},periodStreamCleared:function(e){x.onPeriodCleared(e.type,e.period),n.isCancelled()||R.trigger("periodStreamCleared",e)},bitrateEstimationChange:function(e){return R.trigger("bitrateEstimationChange",e)},addedSegment:function(e){return R.trigger("addedSegment",e)},needsMediaSourceReload:function(e){var n,r,i=I.getReference().getValue(),a=null!==(n=i.position.pending)&&void 0!==n?n:I.getCurrentTime(),o=null!==(r=i.paused.pending)&&void 0!==r?r:I.getIsPaused(),s=a+e.timeOffset;void 0!==e.minimumPosition&&(s=Math.max(e.minimumPosition,s)),void 0!==e.maximumPosition&&(s=Math.min(e.maximumPosition,s)),t({position:s,autoPlay:!o})},needsDecipherabilityFlush:function(){var e,n,r,i,a=(0,V.Z)(c);if(void 0===(i=null==a?void 0:a[0])||i.indexOf("widevine")<0){var o=I.getReference().getValue(),s=null!==(e=o.position.pending)&&void 0!==e?e:I.getCurrentTime(),u=null!==(n=o.paused.pending)&&void 0!==n?n:I.getIsPaused();t({position:s,autoPlay:!u})}else{var l=I.getReference().getValue(),d=null!==(r=l.position.pending)&&void 0!==r?r:I.getCurrentTime();d+.001<l.duration?h.setCurrentTime(c.currentTime+.001):h.setCurrentTime(d)}},encryptionDataEncountered:function(e){for(var t,r=Jt(e);!(t=r()).done;){var i=t.value;if(m.setValue(i),n.isCancelled())return}},error:function(e){return R._onFatalError(e)}},n)}},n._createContentTimeBoundariesObserver=function(e,t,n,r,i){var a=this,o=new Ft(t);i.register((function(){o.stopUpdating()}));var s=null,u=new yt(e,n,r.getBufferTypes());i.register((function(){u.dispose()})),u.addEventListener("warning",(function(e){return a.trigger("warning",e)})),u.addEventListener("periodChange",(function(e){a.trigger("activePeriodChanged",{period:e})})),u.addEventListener("endingPositionChange",(function(e){return o.updateDuration(e.endingPosition,e.isEnd)})),u.addEventListener("endOfStream",(function(){null===s&&((s=new p.ZP).linkToSignal(i),l.Z.debug("Init: end-of-stream order received."),function(e,t){var n=new p.ZP;n.linkToSignal(t),Mt(e,(function(){l.Z.debug("Init: MediaSource re-opened while end-of-stream is active"),n.cancel(),(n=new p.ZP).linkToSignal(t),Pt(e,n.signal)}),t),Pt(e,n.signal)}(t,s.signal))})),u.addEventListener("resumeStream",(function(){null!==s&&(l.Z.debug("Init: resume-stream order received."),s.cancel(),s=null)}));var d=u.getCurrentEndingTime();return o.updateDuration(d.endingPosition,d.isEnd),u},n._createRebufferingController=function(e,t,n,r){var i=this,a=new Gt.Z(e,t,n);return a.addEventListener("stalled",(function(e){return i.trigger("stalled",e)})),a.addEventListener("unstalled",(function(){return i.trigger("unstalled",null)})),a.addEventListener("warning",(function(e){return i.trigger("warning",e)})),r.register((function(){return a.destroy()})),a.start(),a},t}(ht.K)},9420:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(4578),i=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t}(n(1959).Z)},379:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(3666);var i=n(1669),a=n(5095),o=n(288);function s(e,t,n,s){var u=new o.ZP;u.linkToSignal(s);var l=new a.Z(!1,u.signal);return e.listen((function(e){if(null===e.rebuffering&&null===e.freezing&&0!==e.readyState){if(!function(e,t){return!e||!r.SB||t}(n,t.hasAttribute("playsinline"))&&t.duration>0)return l.setValue(!0),void u.cancel();var a=r.lV?4:3;return e.readyState>=a&&(null!==e.currentRange||e.ended)&&(!(0,i.Z)()||t.duration>0)?(l.setValue(!0),void u.cancel()):void 0}}),{includeLastObservation:!0,clearSignal:u.signal}),l}},9016:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1669),i=n(3774),a=n(3666);var o=n(3714),s=n(3887),u=n(5095);function l(e,t,n,l,d,c,f){var v,p,h=new Promise((function(e,t){v=e,p=t})),m=new u.Z(!1,f),g=new u.Z(!1,f);e.addEventListener("loadedmetadata",_);var y=f.register((function(t){e.removeEventListener("loadedmetadata",_),p(t)}));return e.readyState>=i.c.HAVE_METADATA&&_(),{autoPlayResult:h,initialPlayPerformed:g,initialSeekPerformed:m};function _(){e.removeEventListener("loadedmetadata",_);var i=!1,u=function(e){s.Z.info("Init: Set initial time",e),t.setCurrentTime(e),i=!0,m.setValue(!0),m.finish()},h="function"==typeof n?n():n;if((a.GQ||a.YM)&&0===h?(m.setValue(!0),m.finish()):c&&a.SB?setTimeout((function(){u(h)}),0):u(h),(0,r.Z)()&&0===e.duration){var b=new o.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");d(b)}if(!f.isCancelled()){var S=i;t.listen((function(t,n){i&&t.seeking?S=!1:!S&&!t.seeking&&null===t.rebuffering&&t.readyState>=1&&(n(),function(){var t,n;if(s.Z.info("Init: Can begin to play content"),!l)return e.autoplay&&s.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),g.setValue(!0),g.finish(),y(),v({type:"skipped"});if(e.ended)return s.Z.warn("Init: autoplay is enabled but the video is ended. Skipping autoplay to prevent video to start again"),g.setValue(!0),g.finish(),y(),v({type:"skipped"});try{n=null!==(t=e.play())&&void 0!==t?t:Promise.resolve()}catch(e){return y(),p(e)}n.then((function(){if(!f.isCancelled())return g.setValue(!0),g.finish(),y(),v({type:"autoplay"})})).catch((function(e){if(y(),!f.isCancelled()){if(e instanceof Error&&"NotAllowedError"===e.name){s.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies.");var t=new o.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");if(d(t),f.isCancelled())return;return v({type:"autoplay-blocked"})}p(e)}}))}())}),{includeLastObservation:!0,clearSignal:f})}}}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5157),i=n(7874),a=n(3887),o=n(5095),s=n(288),u=n(4339);function l(e,t,n,l,d){if(0===t.length)return h("No `keySystems` option given.");if(null===i.Z.decrypt)return h("EME feature not activated.");var c=new s.ZP;c.linkToSignal(d);var f=new o.Z({initializationState:{type:"uninitialized",value:null},drmSystemId:void 0},d),v=i.Z.decrypt;if(!v.hasEmeApis())return h("EME API not available on the current page.");a.Z.debug("Init: Creating ContentDecryptor");var p=new v(e,t);return p.addEventListener("stateChange",(function(e){if(e===u.u.WaitingForAttachment){var t=new o.Z(!1);t.onUpdate((function(t,n){t&&(n(),e===u.u.WaitingForAttachment&&p.attach())}),{clearSignal:c.signal}),f.setValue({initializationState:{type:"awaiting-media-link",value:{isMediaLinked:t}},drmSystemId:p.systemId})}else e===u.u.ReadyForContent&&(f.setValue({initializationState:{type:"initialized",value:null},drmSystemId:p.systemId}),p.removeEventListener("stateChange"))})),p.addEventListener("error",(function(e){c.cancel(),l.onError(e)})),p.addEventListener("warning",(function(e){l.onWarning(e)})),n.onUpdate((function(e){null!==e&&p.onInitializationData(e)}),{clearSignal:c.signal}),c.signal.register((function(){p.dispose()})),f;function h(e){n.onUpdate((function(t,n){if(null!==t){n();var i=new r.Z("MEDIA_IS_ENCRYPTED_ERROR",e);l.onError(i)}}),{clearSignal:d});var t=new o.Z({initializationState:{type:"initialized",value:null},drmSystemId:void 0});return t.finish(),t}}},6199:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(3666).yS,a=n(6872),o=n(3714),s=n(3887),u=n(1959),l=n(2829),d=n(288),c=1/60,f=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._playbackObserver=t,i._manifest=n,i._speed=r,i._discontinuitiesStore=[],i._isStarted=!1,i._canceller=new d.ZP,i}(0,r.Z)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(!this._isStarted){var t;this._isStarted=!0;var n=null,r=new h(this._playbackObserver,this._speed);this._canceller.signal.register((function(){r.dispose()}));var o=null;this._playbackObserver.listen((function(u){var d,f,v=e._discontinuitiesStore,h=u.buffered,m=u.position,g=u.readyState,y=u.rebuffering,_=u.freezing,b=a.Z.getCurrent(),S=b.BUFFER_DISCONTINUITY_THRESHOLD,T=b.FORCE_DISCONTINUITY_SEEK_DELAY,E=b.FREEZING_STALLED_DELAY,k=b.UNFREEZING_SEEK_DELAY,w=b.UNFREEZING_DELTA_POSITION;if(!u.seeking&&i&&null===n&&null!==t&&u.position<t){s.Z.debug("Init: the device appeared to have seeked back by itself.");var A=performance.now();n=A}if(t=u.seeking?Math.max(null!==(d=u.pendingInternalSeek)&&void 0!==d?d:0,u.position):null,null!==_){var I=performance.now();if(I-(null===o?_.timestamp:o.attemptTimestamp)>k&&(s.Z.warn("Init: trying to seek to un-freeze player"),e._playbackObserver.setCurrentTime(e._playbackObserver.getCurrentTime()+w),o={attemptTimestamp:I}),I-_.timestamp>E)return null===y||null!==n?r.stopRebuffering():r.startRebuffering(),void e.trigger("stalled","freezing")}else o=null;if(null===y)return r.stopRebuffering(),1===g?(f=u.seeking?null!==u.pendingInternalSeek?"internal-seek":"seeking":"not-ready",void e.trigger("stalled",f)):void e.trigger("unstalled",null);var Z="seeking"===y.reason&&null!==u.pendingInternalSeek?"internal-seek":y.reason;if(null!==n){var x=performance.now();if(x-n<T)return r.stopRebuffering(),s.Z.debug("Init: letting the device get out of a stall by itself"),void e.trigger("stalled",Z);s.Z.warn("Init: ignored stall for too long, checking discontinuity",x-n)}if(n=null,r.startRebuffering(),null!==e._manifest){var R=y.position;if(null!=R&&e._speed.getValue()>0){var M=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 u=e[i],l=u.discontinuity,d=u.position,f=l.start,v=l.end;if(n>=(null!=f?f:d)-c)if(null===v){var p=t.getPeriodAfter(a);null!==p?o=p.start+c:s.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<v+c&&(o=v+c);void 0!==o&&(s.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(v,e._manifest,R);if(null!==M){var C=M+.001;if(!(C<=e._playbackObserver.getCurrentTime()))return s.Z.warn("SA: skippable discontinuity found in the stream",m,C),e._playbackObserver.setCurrentTime(C),void e.trigger("warning",p(R,C));s.Z.info("Init: position to seek already reached, no seeking",e._playbackObserver.getCurrentTime(),C)}}var P=null!=R?R:m,D=(0,l.XS)(h,P);if(e._speed.getValue()>0&&D<S){var N=P+D+c;if(e._playbackObserver.getCurrentTime()<N)return s.Z.warn("Init: discontinuity encountered inferior to the threshold",P,N,S),e._playbackObserver.setCurrentTime(N),void e.trigger("warning",p(P,N))}for(var O=e._manifest.periods.length-2;O>=0;O--){var L=e._manifest.periods[O];if(void 0!==L.end&&L.end<=P){if(e._manifest.periods[O+1].start>P&&e._manifest.periods[O+1].start>e._playbackObserver.getCurrentTime()){var U=e._manifest.periods[O+1];return e._playbackObserver.setCurrentTime(U.start),void e.trigger("warning",p(P,U.start))}break}}e.trigger("stalled",Z)}else e.trigger("stalled",Z)}),{includeLastObservation:!0,clearSignal:this._canceller.signal})}},n.updateDiscontinuityInfo=function(e){this._isStarted||this.start();var t=this._playbackObserver.getReference().getValue();!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;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return void(v(t)?e[a]=t:e.splice(a,1))}else if(e[a].period.start>r.start)return void(v(t)&&e.splice(a,0,t));v(t)&&e.push(t)}(this._discontinuitiesStore,e,t)},n.onLockedStream=function(e,t){var n;this._isStarted||this.start();var r=this._playbackObserver.getReference().getValue();if(!(!r.rebuffering||r.paused||this._speed.getValue()<=0||"audio"!==e&&"video"!==e)){var i=r.position,a=null!==(n=r.rebuffering.position)&&void 0!==n?n:i,o=t.start;i<o&&Math.abs(a-o)<1&&(s.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),this._playbackObserver.setCurrentTime(o+.001))}},n.destroy=function(){this._canceller.cancel()},t}(u.Z);function v(e){return null!==e.discontinuity}function p(e,t){return new o.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var h=function(){function e(e,t){this._speedUpdateCanceller=new d.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(),s.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 d.ZP,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){s.Z.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},4576:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3714),i=n(1946);function a(e,t,n){function a(){var n,a,o=e.error;switch((0,i.Z)(o)||(n=o.code,a=o.message),n){case 1:return a=null!=a?a:"The fetching of the associated resource was aborted by the user's request.",t(new r.Z("MEDIA_ERR_ABORTED",a));case 2:return a=null!=a?a:"A network error occurred which prevented the media from being successfully fetched",t(new r.Z("MEDIA_ERR_NETWORK",a));case 3:return a=null!=a?a:"An error occurred while trying to decode the media resource",t(new r.Z("MEDIA_ERR_DECODE",a));case 4:return a=null!=a?a:"The media resource has been found to be unsuitable.",t(new r.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",a));default:return a=null!=a?a:"The HTMLMediaElement errored due to an unknown reason.",t(new r.Z("MEDIA_ERR_UNKNOWN",a))}}n.isCancelled()||(e.addEventListener("error",a),n.register((function(){e.removeEventListener("error",a)})))}},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.declareInitSegment=function(e){i.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){i.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=null!==(t=a[0])&&void 0!==t?t:0,c=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(d,f),h=Math.min(c,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0)}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 k}});var r=n(4578),i=n(3038),a=n(3887),o=n(5095),s=n(2203).Z?void 0:window.ResizeObserver;var u=n(6872),l=n(288),d=n(9612),c=n(4309),f=n(7874);function v(e,t,n){return void 0===n&&(n=.2),Math.abs(e-t)<=Math.min(n,.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);if(0===n.length&&a.length>0)for(var s=0;s<a.length;s++)(v(e,a[s].start,.001)||v(e,a[s].end,.001))&&n.push(a[s].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},a=Math.abs(t-n)/5;function o(e){var t=r[e];void 0===t||v(i.end,t.end,a)?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 s=0;s<r.length;s++){var u=r[s];if(t<u.end){if(v(t,u.start,a)){if(v(n,u.end,a))return void(r[s]=i);if(n<u.end)return u.cues=h(u.cues,n),u.start=n,void r.splice(s,0,i);do{r.splice(s,1),u=r[s]}while(void 0!==u&&n>u.end);return void o(s)}if(t<u.start){if(n<u.start)return void r.splice(s,0,i);if(v(n,u.start,a))return u.start=n,void r.splice(s,0,i);if(v(n,u.end,a))return void r.splice(s,1,i);if(n<u.end)return u.cues=h(u.cues,n),u.start=n,void r.splice(s,0,i);do{r.splice(s,1),u=r[s]}while(void 0!==u&&n>u.end);return void o(s)}if(v(u.end,n,a))return u.cues=p(u.cues,t),u.end=t,void r.splice(s+1,0,i);if(u.end>n){var l=m(u,t,n),d=l[0],c=l[1];return this._cuesBuffer[s]=d,r.splice(s+1,0,i),void r.splice(s+2,0,c)}u.cues=p(u.cues,t),u.end=t;var f=s+1;for(u=r[f];void 0!==u&&n>u.end;)r.splice(f,1),u=r[f];return void o(f)}}if(r.length){var g=r[r.length-1];v(g.end,t,a)&&(g.end=t)}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 d=s.getAttribute("data-proportional-height");null===d||isNaN(+d)||(s.style.height=String(+d*i[1])+"px");var c=s.getAttribute("data-proportional-line-height");null===c||isNaN(+c)||(s.style.lineHeight=String(+c*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,S=i.Q$;function T(e,t){try{e.removeChild(t)}catch(e){a.Z.warn("HTSB: Can't remove text track: not in the element.")}}function E(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 k=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 c.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.declareInitSegment=function(e){a.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=s.start,c=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!==d)u=Math.max(m,d);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!==c)l=Math.min(g,c);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,!0),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++)T(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++)T(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=E(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var d=this._currentCues.filter((function(e){return null!==e.resolution}));if(d.length>0){this._sizeUpdateCanceller=new l.ZP,this._sizeUpdateCanceller.linkToSignal(this._canceller.signal);var c=u.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=new o.Z({height:i,width:u},n),d=i,c=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===d&&r===c||(d=n,c=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===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,c,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<d.length;r++){var i=d[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).linkToSignal(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)}S(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}(d.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});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 d=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.declareInitSegment=function(e){a.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=s.end,c=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,c,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!==d)g=Math.min(h,d);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],S=this._track.cues;null!==S&&S.length>0&&b.startTime<S[S.length-1].startTime&&this._removeData(b.startTime,1/0);for(var T=0;T<y.length;T++)this._track.addCue(y[T])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0)}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 y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520);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}var u=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=o(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 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 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 c=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 u(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e,t){var n,a,o,s,u,d,c;void 0===t&&(t=!1);for(var f=this._inventory,v=0,m=f[0],g=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,y=null==m?void 0:m.infos.adaptation.type,_=e.length,b=0;b<_;b++){if(void 0===m)return;var S=e.start(b),T=e.end(b);if(T-S<g)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",y,S,T);else{for(var E=v;void 0!==m&&(null!==(n=m.bufferedEnd)&&void 0!==n?n:m.end)-S<g;)m=f[++v];var k=null,w=v-E;if(w>0){var A=f[E+w-1];k={end:null!==(a=A.bufferedEnd)&&void 0!==a?a:A.end,precizeEnd:A.precizeEnd},i.Z.debug("SI: "+w+" segments GCed.",y);for(var I,Z=l(f.splice(E,w));!(I=Z()).done;){var x=I.value;void 0===x.bufferedStart&&void 0===x.bufferedEnd&&2!==x.status&&this._bufferedHistory.addBufferedSegment(x.infos,null)}v=E}if(void 0===m)return;if(T-(null!==(o=m.bufferedStart)&&void 0!==o?o:m.start)>=g){if(p(m,S,k,y),v===f.length-1)return void h(m,T,y);for(var R=null!==(s=(m=f[++v]).bufferedStart)&&void 0!==s?s:m.start,M=null!==(u=m.bufferedEnd)&&void 0!==u?u:m.end,C=b<_-1?e.start(b+1):void 0;void 0!==m&&T-R>=g&&(void 0===C||T-R>=M-C);){var P=f[v-1];void 0===P.bufferedEnd&&(P.bufferedEnd=m.precizeStart?m.start:P.end,i.Z.debug("SI: calculating buffered end of contiguous segment",y,P.bufferedEnd,P.end)),m.bufferedStart=P.bufferedEnd,void 0!==(m=f[++v])&&(R=null!==(d=m.bufferedStart)&&void 0!==d?d:m.start,M=null!==(c=m.bufferedEnd)&&void 0!==c?c:m.end)}}var D=f[v-1];void 0!==D&&h(D,T,y)}}if(null!=m){i.Z.debug("SI: last segments have been GCed",y,v,f.length);for(var N,O=l(f.splice(v,f.length-v));!(N=O()).done;){var L=N.value;void 0===L.bufferedStart&&void 0===L.bufferedEnd&&2!==L.status&&this._bufferedHistory.addBufferedSegment(L.infos,null)}}!t&&void 0!==y&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+y+" 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 d,c=l.infos.period.id,f=l.infos.representation.id,v=n[c],p=void 0;if(void 0===v)p=o(l.infos),n[c]=((d={})[f]=p,d);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,t){var n=e.period,r=e.adaptation,a=e.representation,o=e.segment,s=e.chunkSize,u=e.start,l=e.end;if(!o.isInit){var d=r.type;if(u>=l)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",d,u,l);else{for(var c=this._inventory,f={status:t?0:2,chunkSize:s,splitted:!1,start:u,end:l,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:o,period:n,adaptation:r,representation:a}},v=c.length-1;v>=0;v--){var p=c[v];if(p.start<=u){if(p.end<=u){for(i.Z.debug("SI: Pushing segment strictly after previous one.",d,u,p.end),this._inventory.splice(v+1,0,f),v+=2;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}if(p.start===u){if(p.end<=l){for(i.Z.debug("SI: Segment pushed replace another one",d,u,l,p.end),this._inventory.splice(v,1,f),v+=1;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",d,u,l,p.end),c.splice(v,0,f),p.start=f.end,p.bufferedStart=void 0,void(p.precizeStart=p.precizeStart&&f.precizeEnd)}if(p.end<=f.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",d,u,l,p.start,p.end),this._inventory.splice(v+1,0,f),p.end=f.start,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&f.precizeStart,v+=2;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",d,u,l,p.start,p.end);var h={status:p.status,chunkSize:p.chunkSize,splitted:!0,start:f.end,end:p.end,precizeStart:p.precizeStart&&p.precizeEnd&&f.precizeEnd,precizeEnd:p.precizeEnd,bufferedStart:void 0,bufferedEnd:p.end,infos:p.infos};return p.end=f.start,p.splitted=!0,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&f.precizeStart,c.splice(v+1,0,f),void c.splice(v+2,0,h)}}var m=this._inventory[0];if(void 0===m)return i.Z.debug("SI: first segment pushed",d,u,l),void this._inventory.push(f);if(!(m.start>=l)){if(m.end<=l){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",d,u,l,m.start,m.end),this._inventory.splice(0,1,f);c.length>1&&c[1].start<f.end;){if(c[1].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[1].start),c[1].start=f.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",d,u,l,m.start,m.end),m.start=l,m.bufferedStart=void 0,m.precizeStart=f.precizeEnd,void this._inventory.splice(0,0,f)}i.Z.debug("SI: Segment pushed comes before all previous ones",d,u,l,m.start),this._inventory.splice(0,0,f)}}},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,d=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var c=n[o].chunkSize;void 0!==d&&void 0!==c&&(d+=c),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),0===this._inventory[u].status&&(this._inventory[u].status=1),this._inventory[u].chunkSize=d,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=l(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?2!==y.status&&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 f(e){if(void 0===e.bufferedStart||1!==e.status)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 v(e){if(void 0===e.bufferedEnd||1!==e.status)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 p(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&&f(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,f(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,f(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),e.bufferedStart=e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(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&&v(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,v(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 m,g=c,y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(e){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges(),e)},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"}(m||(m={}))},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}()},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,a){var u;u=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(u),t.prototype),u.name="MediaError",u.type=o.ZB.MEDIA_ERROR,u.code=n,u.message=(0,s.Z)(u.name,u.code,i),u.fatal=!1;var l=null==a?void 0:a.adaptation;if(void 0!==l)switch(l.type){case"audio":u.trackInfo={type:"audio",track:l.toAudioTrack()};break;case"video":u.trackInfo={type:"video",track:l.toVideoTrack()};break;case"text":u.trackInfo={type:"text",track:l.toTextTrack()}}return u}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;switch(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,a){case"TIMEOUT":s.message="The request timed out";break;case"ERROR_EVENT":s.message="An error prevented the request to be performed successfully";break;case"PARSE_ERROR":s.message="An error happened while formatting the response data";break;case"ERROR_HTTP_CODE":s.message="An HTTP status code indicating failure was received: "+String(s.status)}return 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},createDebugElement:null,directfile:null,decrypt:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,mediaSourceInit: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 h},Z:function(){return m}});var r=n(3887),i=n(3274),a=n(1946),o=n(7829);var s="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}))},u=n(3774);function l(e){return null!=u.J&&("function"!=typeof u.J.isTypeSupported||u.J.isTypeSupported(e))}var d=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 f(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 f(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 f(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 v=(0,n(908).Z)(),p=function(){function e(e,t){var n;if(this.id=e.id,this.uniqueId=v(),this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.isSpatialAudio&&(this.isSpatialAudio=e.isSpatialAudio),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,"audio"===t.type||"video"===t.type){if(this.isSupported=!1,void 0!==e.supplementalCodecs)l((null!==(n=this.mimeType)&&void 0!==n?n:"")+';codecs="'+e.supplementalCodecs+'"')&&(this.codec=e.supplementalCodecs,this.isSupported=!0);if(!this.isSupported){var i=this.getMimeTypeString(),a=l(i);a||r.Z.info("Unsupported Representation",i,this.id,this.bitrate),this.isSupported=a}}else this.isSupported=!0}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 i=!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 a=this.contentProtections.keyIds;if(void 0===a)this.contentProtections.keyIds=[{keyId:t}];else{for(var o,s=!1,u=c(a);!(o=u()).done;){var l=o.value;(0,d.Z)(l.keyId,t)&&(s=!0)}s||(r.Z.warn("Manifest: found unanounced key id."),a.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,d.Z)(m.data,p[g].data))break;r.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),i=!0)}return i}return this.contentProtections.initData.push({type:e,values:n}),!0},t.toAudioRepresentation=function(){return{id:this.id,isSpatialAudio:this.isSpatialAudio,bitrate:this.bitrate,codec:this.codec}},t.toVideoRepresentation=function(){return{id:this.id,bitrate:this.bitrate,frameRate:this.frameRate,width:this.width,height:this.height,codec:this.codec,hdrInfo:this.hdrInfo}},e}(),h=["audio","video","text","image"],m=function(){function e(t,n){void 0===n&&(n={});var i=t.trickModeTracks,s=n,u=s.representationFilter,l=s.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,o.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.forcedSubtitles&&(this.isForcedSubtitles=t.forcedSubtitles),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==i&&i.length>0&&(this.trickModeTracks=i.map((function(t){return new e(t)})));for(var d=t.representations,c=[],f=!1,v=0;v<d.length;v++){var h=new p(d[v],{type:this.type});(0,a.Z)(u)||u(h,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted})?(c.push(h),!f&&h.isSupported&&(f=!0)):r.Z.debug("Filtering Representation due to representationFilter",this.type,"Adaptation: "+this.id,"Representation: "+h.id,"("+h.bitrate+")")}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=f,this.manuallyAdded=!0===l}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 s(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,i.Z)(this.representations,(function(t){var n=t.id;return e===n}))},t.toAudioTrack=function(){var e,t,n={language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",audioDescription:!0===this.isAudioDescription,id:this.id,representations:this.representations.map((function(e){return e.toAudioRepresentation()})),label:this.label};return!0===this.isDub&&(n.dub=!0),n},t.toTextTrack=function(){var e,t;return{language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",closedCaption:!0===this.isClosedCaption,id:this.id,label:this.label,forced:this.isForcedSubtitles}},t.toVideoTrack=function(){var e=void 0!==this.trickModeTracks?this.trickModeTracks.map((function(e){var t=e.representations.map((function(e){return e.toVideoRepresentation()})),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,t={id:this.id,representations:this.representations.map((function(e){return e.toVideoRepresentation()})),label:this.label};return!0===this.isSignInterpreted&&(t.signInterpreted=!0),!0===this.isTrickModeTrack&&(t.isTrickModeTrack=!0),void 0!==e&&(t.trickModeTracks=e),t},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w}});var r,i=n(4578),a=n(3714),o=n(3887),s=n(3274),u=n(1959),l=n(908),d=n(9829),c=n(8806),f=n(8999),v=n(1679),p=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 f.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.",{adaptation:r});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,v.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,s.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,t){return e>=this.start&&(void 0===this.end||e<this.end)||e===this.end&&(null===t||t.start>this.end)},e}(),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.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(){o.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){o.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){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 _(e,t,n){var i={updatedAdaptations:[],removedAdaptations:[],addedAdaptations:[]};e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var a=e.getAdaptations(),s=t.getAdaptations(),u=function(e){var t=a[e],u=(0,m.Z)(s,(function(e){return e.id===t.id}));if(-1===u){o.Z.warn('Manifest: Adaptation "'+a[e].id+'" not found when merging.');var d=a.splice(e,1)[0];e--,i.removedAdaptations.push(d)}else{var c=s.splice(u,1)[0],f=[],v=[],p=[];i.updatedAdaptations.push({adaptation:t,updatedRepresentations:f,addedRepresentations:v,removedRepresentations:p});for(var h,g=t.representations,y=c.representations.slice(),_=function(e){var t=g[e],i=(0,m.Z)(y,(function(e){return e.id===t.id}));if(-1===i){o.Z.warn('Manifest: Representation "'+g[e].id+'" not found when merging.');var a=g.splice(e,1)[0];e--,p.push(a)}else{var s=y.splice(i,1)[0];f.push(t),t.cdnMetadata=s.cdnMetadata,n===r.Full?t.index._replace(s.index):t.index._update(s.index)}b=e},b=0;b<g.length;b++)_(b);if(y.length>0)o.Z.warn("Manifest: "+y.length+" new Representations found when merging."),(h=t.representations).push.apply(h,y),v.push.apply(v,y)}l=e},l=0;l<a.length;l++)u(l);if(s.length>0){o.Z.warn("Manifest: "+s.length+" new Adaptations found when merging.");for(var d,c=g(s);!(d=c()).done;){var f=d.value,v=e.adaptations[f.type];void 0===v?e.adaptations[f.type]=[f]:v.push(f),i.addedAdaptations.push(f)}}return i}function b(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 T=(0,l.Z)(),E=(0,l.Z)(),k=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,d=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=E(),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 p(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=d,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,s.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){for(var t=null,n=this.periods.length-1;n>=0;n--){var r=this.periods[n];if(r.containsTime(e,t))return r;t=r}},n.getNextPeriod=function(e){return(0,s.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,s.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=b(e.periods);!(n=i()).done;)for(var a,s=n.value,u=b(s.getAdaptations());!(a=u()).done;)for(var l,d=a.value,c=b(d.representations);!(l=c()).done;){var f=l.value,v=t(f);v!==f.decipherable&&(r.push({manifest:e,period:s,adaptation:d,representation:f}),f.decipherable=v,o.Z.debug('Decipherability changed for "'+f.id+'"',"("+f.bitrate+")",String(f.decipherable)))}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,s.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-"+T(),o="gen-image-rep-"+T(),s=(0,d.$)(r),u=r.substring(0,s),l=r.substring(s),c=new f.Z({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:l})}]},{isManuallyAdded:!0});if(c.representations.length>0&&!c.isSupported){var v=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:c});t.contentWarnings.push(v)}return c}));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,l=n.closedCaption,c=null!=s?[s]:null!=u?u:[],v=(0,d.$)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(c.map((function(e){var n="gen-text-ada-"+T(),o="gen-text-rep-"+T(),s=new f.Z({id:n,type:"text",language:e,closedCaption:l,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.",{adaptation:s});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){var n;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,n=function(e,t){for(var n={updatedPeriods:[],addedPeriods:[],removedPeriods:[]},i=0,a=0;a<t.length;a++){for(var s=t[a],u=i,l=e[u];null!=l&&l.id!==s.id;)l=e[++u];if(null!=l){var d,c,f=_(l,s,r.Full);n.updatedPeriods.push({period:l,result:f});var v=t.slice(i,a),p=u-i,h=e.splice.apply(e,[i,p].concat(v));(d=n.removedPeriods).push.apply(d,h),(c=n.addedPeriods).push.apply(c,v),i=a+1}}if(i>e.length)return o.Z.error("Manifest: error when updating Periods"),n;if(i<e.length){var m,g=e.splice(i,e.length-i);(m=n.removedPeriods).push.apply(m,g)}var y,b=t.slice(i,t.length);return b.length>0&&(e.push.apply(e,b),(y=n.addedPeriods).push.apply(y,b)),n}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],n=function(e,t){var n,i={updatedPeriods:[],addedPeriods:[],removedPeriods:[]};if(0===e.length)return e.splice.apply(e,[0,0].concat(t)),(n=i.addedPeriods).push.apply(n,t),i;if(0===t.length)return i;var s=e[e.length-1];if(s.start<t[0].start){var u;if(s.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");return e.push.apply(e,t),(u=i.addedPeriods).push.apply(u,t),i}var l=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(l<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");var d=_(e[l],t[0],r.Partial);i.updatedPeriods.push({period:e[l],result:d});for(var c=l+1,f=1;f<t.length;f++){for(var v=t[f],p=-1,h=c;h<e.length;h++)if(v.id===e[h].id){p=h;break}if(p<0){for(var g,y=-1,b=c;b<e.length;b++)if(v.start<e[b].start){y=b;break}var S=y-c,T=e.splice(c,S,v);i.addedPeriods.push(v),(g=i.removedPeriods).push.apply(g,T)}else{if(p>c){var E;o.Z.warn("Manifest: old Periods not found in new when updating, removing");var k=e.splice(c,p-c);(E=i.removedPeriods).push.apply(E,k),p=c}var w=_(e[p],v,r.Full);i.updatedPeriods.push({period:e[p],result:w})}c++}if(c<e.length){var A;o.Z.warn("Manifest: Ending Periods not found in new when updating, removing");var I=e.splice(c,e.length-c);(A=i.removedPeriods).push.apply(A,I)}return i}(this.periods,e.periods);for(var i=this.getMinimumSafePosition();this.periods.length>0;){var s=this.periods[0];if(void 0===s.end||s.end>i)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",n)},t}(u.Z);var w=k},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.uniqueId===t.representation.uniqueId}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 c},lp:function(){return d},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 d(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 c(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 d=(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===d&&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 d=i(n,s[0],s[2]),c=u(d,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:d}),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 c},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 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}function c(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,d=(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 c=[];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,c.push({time:l,duration:h,timescale:d,range:[r,r+p-1]}),l+=h,r+=p}return c}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,d=(0,s.t_)(o,1953658222);if(null===d)return;var c=0,f=d[c];if(c+=1,f>1)return;var p=(0,i.QI)(d,c);c+=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,S=(2048&p)>0,T=(0,i.pX)(d,c);c+=4,g&&(c+=4),y&&(c+=4);for(var E=T,k=0;E-- >0;)h?(k+=(0,i.pX)(d,c),c+=4):k+=m,_&&(c+=4),b&&(c+=4),S&&(c+=4);r+=k}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 d=4,c=(0,a.DM)(o,d),f=c.end,v=c.string;d=f;var p=(0,a.DM)(o,d),h=p.end,m=p.string;d=h;var g=(0,i.pX)(o,d);d+=4;var y=(0,i.pX)(o,d);d+=4;var _=(0,i.pX)(o,d);d+=4;var b=(0,i.pX)(o,d);d+=4;var S={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(d,s)};t.push(S)}}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 d=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var c=(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===c)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var S=(0,r.dN)(e,t);t+=4;var T=(0,r.dN)(e,t);if(t+=4,null!==b){var E=b.timestamp*f,k=f,w=e.slice(b.offset,T);y.push({index:_,duration:k,ts:E,data:w}),_++}if(4294967295===S)break;b={timestamp:S,offset:T}}return{fileFormat:"BIF",version:d,imageCount:c,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,d=t.representationBitrate,c=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,d),h=void 0===e.media?null:(0,s.zA)(e.media,l,d),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,endNumber:e.endNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._manifestBoundsCalculator=t.manifestBoundsCalculator,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=c}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._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},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.isStillAwaitingFutureSegments=function(){return!1},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,s){for(var u,l,d,c=a.getEstimatedMaximumPosition(null!==(u=e.availabilityTimeOffset)&&void 0!==u?u:0),f=Math.min(t+n,null!=c?c:1/0),v=(0,r.gT)(t,e),p=(0,r.gT)(f,e),h=e.timeline,m=e.timescale,g=e.segmentUrlTemplate,y=e.startNumber,_=e.endNumber,b=null!=y?y:1,S=[],T=h.length,E=0;E<T;E++){var k=h[E],w=k.duration,A=k.start,I=k.range,Z=void 0;Z=void 0===c?o:Math.min(c*m,null!=o?o:1/0);for(var x=(0,r.KF)(k,h[E+1],Z),R=!1!==e.availabilityTimeComplete||E!==T-1&&0!==x,M=(l=w,d=void 0,(d=v-A)>0?Math.floor(d/l):0),C=A+M*w;C<p&&M<=x;){var P=b+M;if(void 0!==_&&P>_)break;var D=null===g?null:(0,i.QB)(C,P)(g),N=C-e.indexTimeOffset,O=w;N<0&&(O=w+N,N=0);var L={id:String(C),time:N/m,end:(N+O)/m,duration:O/m,isInit:!1,range:I,timescale:1,url:D,number:P,timestampOffset:-e.indexTimeOffset/m,complete:R,privateInfos:{isEMSGWhitelisted:s}};S.push(L),C=A+ ++M*w}if(C>=p)return S;if(b+=x+1,void 0!==_&&b>_)return S}return S}},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)}))}}},1707:function(e,t,n){"use strict";n.d(t,{Z:function(){return qe}});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 d(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 c(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=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(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=d(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=d(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=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null,this._serverTimestampOffset=e.serverTimestampOffset,this._availabilityStartTime=e.availabilityStartTime}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.getEstimatedMinimumSegmentTime=function(){var e;if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var t=null!==(e=this.getEstimatedLiveEdge())&&void 0!==e?e:this.getEstimatedMaximumPosition(0);return void 0!==t?t-this._timeShiftBufferDepth:void 0},t.getEstimatedLiveEdge=function(){if(this._isDynamic&&void 0!==this._serverTimestampOffset)return(performance.now()+this._serverTimestampOffset)/1e3-this._availabilityStartTime},t.getEstimatedMaximumPosition=function(e){if(!this._isDynamic)return this._lastPosition;var t=this.getEstimatedLiveEdge();return void 0!==t&&e!==1/0?t+e:void 0!==this._positionTime&&void 0!==this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}();var p=n(9592),h=n(908),m=n(1679),g=n(3635);var y=n(8999),_=n(5138),b=n(7714),S=n(6923);function T(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 k=function(e,t){for(var n,r=T(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=T(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,d=T(y.r);!(u=d()).done;){var c=e[u.value];if(void 0!==c)for(var f,v=T(c);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},w=["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)(w,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 d=e[l].attributes,c=d.mimeType,f=d.codecs;if(void 0!==c){var v=i(c,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var I=n(8026),Z=/[, ]+/g;var x=n(7403),R=n(3911),M=n(1915),C=n(4784),P=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,d=null!==(n=e.timescale)&&void 0!==n?n:1,c=l-i*d,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,C.zA)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,C.zA)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:d,duration:e.duration,indexTimeOffset:c,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,M.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,R.PZ)(s,t,a),l=u[0],d=u[1],c=Math.min(i.length-1,Math.floor(d/r)),f=[],v=Math.floor(l/r);v<=c;){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.isStillAwaitingFutureSegments=function(){return!1},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}(),D=n(9362),N=n(811),O=n(8232),L=n(5505),U=n(6394);function B(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 V(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 z(e){for(var t=[],n=0;n<e.length;n++)t.push(V(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],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,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-d;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(p+1)}else d+=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;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(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'),z(e);var d=t.slice(i);if(s>0){var c=d[0];c.start+=c.duration*s,d[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e);var f=d[d.length-1],v=V(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.'),z(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(V(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 d.concat(h)}var G=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.availabilityTimeOffset,u=n.manifestBoundsCalculator,l=n.isDynamic,d=n.isLastPeriod,c=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=d,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,C.zA)(t.initialization.media,c,f),b=void 0===t.media?null:(0,C.zA)(t.media,c,f);y=void 0===s&&void 0===o?1/0:null!=s?s:0,this._index={availabilityTimeComplete:null==o||o,availabilityTimeOffset:y,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:_,range:t.initialization.range},segmentUrlTemplate:b,startNumber:t.startNumber,endNumber:t.endNumber,timeline:void 0===t.timeline?null:W(t.timeline,t.startNumber,t.endNumber),timescale:m},this._scaledPeriodStart=(0,R.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,R.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.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.endNumber,o=n.timeline,s=n.timescale,u=n.indexTimeOffset;return(0,U.Z)({segmentUrlTemplate:r,startNumber:i,endNumber:a,timeline:o,timescale:s,indexTimeOffset:u},e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},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,R.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){var e;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null===t)return null;var n=Math.min(t.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,R.zG)(n,this._index)},t.getEnd=function(){var e;if(!this._isDynamic||this._isLastPeriod){if(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._index.timeline.length<=0)return null;var t=this._index.timeline[this._index.timeline.length-1],n=Math.min((0,R.jH)(t,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,R.zG)(n,this._index)}},t.awaitSegmentBetween=function(e,t){var n,r;if((0,N.Z)(e<=t),!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var i=this._index,a=i.timescale,o=i.timeline,s=B(a),u=(0,R.gT)(t,this._index),l=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==l&&Math.min(l.end,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0)+s>=Math.min(u,null!==(r=this._scaledPeriodEnd)&&void 0!==r?r:1/0))return!1;var d=(0,R.gT)(e,this._index);if(o.length>0&&null!==l&&!l.isLastOfTimeline){var c=o[o.length-1];if(d<(0,R.jH)(c,null,this._scaledPeriodEnd)+s+s)return!0}return!!this._isLastPeriod&&(void 0===this._scaledPeriodEnd?u+s>this._scaledPeriodStart&&void 0:d-s<this._scaledPeriodEnd&&u+s>this._scaledPeriodStart)},t.isSegmentStillAvailable=function(e){return!!e.isInit||(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),function(e,t,n,r){var i=H(t,n,r);if(null===i)return!1;for(var a=0;a<t.timeline.length;a++){if(i.timelineIdx<a)return!1;var o=t.timeline[a],s=(o.start-t.indexTimeOffset)/t.timescale;if(s>e.time)return!1;if(s===e.time)return void 0===o.range?void 0===e.range:null!=e.range&&o.range[0]===e.range[0]&&o.range[1]===e.range[1];if(o.repeatCount>=0&&void 0!==o.duration){var u=(s-o.start)/o.duration-1;return u%1==0&&u<=i.newRepeatCount}}return!1}(e,this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd))},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,R._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof D.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._index.availabilityTimeOffset=e._index.availabilityTimeOffset,this._index.availabilityTimeComplete=e._index.availabilityTimeComplete,this._index.endNumber=e._index.endNumber,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isStillAwaitingFutureSegments=function(){var e;if(!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index.timeline;if(0===t.length){if(void 0!==this._scaledPeriodEnd){var n=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==n&&(0,R.gT)(n,this._index)>this._scaledPeriodEnd)return!1}return this._isLastPeriod}var r=B(this._index.timescale),i=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==i&&!i.isLastOfTimeline){var a=Math.min(i.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return!(void 0!==this._scaledPeriodEnd&&a+r>=this._scaledPeriodEnd)}if(!this._isLastPeriod)return!1;if(void 0===this._scaledPeriodEnd)return!0;var o=t[t.length-1];return(0,R.jH)(o,null,this._scaledPeriodEnd)+r<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.getEstimatedMinimumSegmentTime();if(null!=e){var t=(0,R.gT)(e,this._index),n=(0,O.Z)(this._index.timeline,t);void 0!==this._index.startNumber?this._index.startNumber+=n:void 0!==this._index.endNumber&&(this._index.startNumber=n+1)}}},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?W(z(e),this._index.startNumber,this._index.endNumber):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,W(K(e,t),this._index.startNumber,this._index.endNumber))},e}();function W(e,t,n){if(void 0===n)return e;for(var r=null!=t?t:1,i=0;i<e.length;i++){var a=e[i];if((r+=a.repeatCount+1)>n){if(r===n+1)return e.slice(0,i+1);var o=e.slice(0,i),s=Object.assign({},a),u=r-a.repeatCount-1;return s.repeatCount=Math.max(0,n-u),o.push(s),o}}return e}function H(e,t,n){if(e.timeline.length<=0)return null;if(e.availabilityTimeOffset===1/0){var r=e.timeline.length-1,i=e.timeline[r];return{isLastOfTimeline:!0,timelineIdx:r,newRepeatCount:i.repeatCount,end:(0,R.jH)(i,null,n)}}var a=t.getEstimatedMaximumPosition(e.availabilityTimeOffset);if(void 0===a){var o=e.timeline.length-1,s=e.timeline[o];return{isLastOfTimeline:!0,timelineIdx:o,newRepeatCount:s.repeatCount,end:(0,R.jH)(s,null,n)}}for(var u=e.timeline.length-1;u>=e.timeline.length;u--){var l=e.timeline[u],d=l.start+l.duration;if((0,R.zG)(d,e)<=a){var c=(0,R.jH)(l,e.timeline[u+1],n);if((0,R.zG)(c,e)<=a)return{isLastOfTimeline:u===e.timeline.length-1,timelineIdx:u,newRepeatCount:l.repeatCount,end:d};var f=(0,R.gT)(a,e)-l.start,v=Math.floor(f/l.duration);return(0,N.Z)(v>=1),{isLastOfTimeline:!1,timelineIdx:u,newRepeatCount:v-1,end:l.start+v*l.duration}}}return null}var j=G,q=function(){function e(e,t){var n,r,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=i,this._manifestBoundsCalculator=a;var v=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,p=v-u*f;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var h=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,C.zA)(e.initialization.media,l,d),m=void 0===e.media?null:(0,C.zA)(e.media,l,d);this._index={duration:e.duration,timescale:f,indexRange:e.indexRange,indexTimeOffset:p,initialization:null==e.initialization?void 0:{url:h,range:e.initialization.range},url:m,presentationTimeOffset:v,startNumber:e.startNumber,endNumber:e.endNumber},this._isDynamic=o,this._periodStart=u,this._scaledRelativePeriodEnd=void 0===s?void 0:(s-u)*f,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.endNumber,o=n.timescale,s=n.url,u=this._periodStart*o,l=this._scaledRelativePeriodEnd,d=e*o-u,c=(e+t)*o-u,f=this._getFirstSegmentStart(),v=this._getLastSegmentStart();if(null==f||null==v)return[];var p=Math.max(f,d),h=Math.min(v,c);if(h+r<=p)return[];for(var m=[],g=null!=i?i:1,y=Math.floor(p/r),_=y*r;_<=h;_+=r){var b=y+g;if(void 0!==a&&b>a)return m;var S=null!=l&&_+r>l?l-_:r,T=_+u,E=_+this._index.presentationTimeOffset,k=null===s?null:(0,C.QB)(E,b)(s),w={id:String(b),number:b,time:T/o,end:(T+S)/o,duration:S/o,timescale:1,isInit:!1,scaledDuration:S/o,url:k,timestampOffset:-n.indexTimeOffset/o,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};m.push(w),y++}return m},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e=this._getLastSegmentStart();if((0,i.Z)(e))return e;var t=this._estimateRelativeScaledEnd();return Math.min(e+this._index.duration,null!=t?t:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();var e=this._estimateRelativeScaledEnd();if(void 0!==e){var t=this._index.timescale;return(e+this._periodStart*t)/t}},t.awaitSegmentBetween=function(e,t){if((0,N.Z)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=B(n),a=this._periodStart*n,o=e*n-a,s=t*n-a,u=this._getLastSegmentStart();if((0,i.Z)(u)){var l=this._estimateRelativeScaledEnd();return void 0===l?s+r>=0:s+r>=0&&o<l-r}var d=u+this._index.duration,c=this._estimateRelativeScaledEnd();return void 0===c?s>d-r:s>d-r&&o<c-r},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.isStillAwaitingFutureSegments=function(){if(!this._isDynamic)return!1;var e=this._estimateRelativeScaledEnd();if(void 0===e)return!0;var t=this._index.timescale,n=this._getLastSegmentStart();return!!(0,i.Z)(n)||n+this._index.duration+B(t)<e},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,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(){var e;if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var t=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0!==t&&t<this._periodStart)return null}var n=this._index,r=n.duration,i=n.timescale,a=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime();if(void 0!==a){var o=a>this._periodStart?(a-this._periodStart)*i:0;return Math.floor(o/r)*r}},t._getLastSegmentStart=function(){var e,t,n=this._index,r=n.duration,i=n.timescale,o=n.endNumber,s=n.startNumber,u=void 0===s?1:s;if(this._isDynamic){var l=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==l&&void 0!==this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<l-this._periodStart*this._index.timescale){var d=Math.ceil(this._scaledRelativePeriodEnd/r);return void 0!==o&&o-u+1<d&&(d=o-u+1),(d-1)*r}var c=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0===c)return;var f=(c-this._periodStart)*i;if(f<0)return null;var v=Math.floor(f/r);return void 0!==o&&o-u+1<v&&(v=o-u+1),v<=0?null:(v-1)*r}var p=null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:0,h=Math.ceil(p/r);void 0!==o&&o-u+1<h&&(h=o-u+1);var m=(h-1)*r,g=a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*i;return void 0!==o||p-m>g||h<2?m:(h-2)*r},t._estimateRelativeScaledEnd=function(){var e,t;if(void 0!==this._index.endNumber){var n=this._index.endNumber-(null!==(e=this._index.startNumber)&&void 0!==e?e:1)+1;return Math.max(Math.min(n*this._index.duration,null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:1/0),0)}if(void 0!==this._scaledRelativePeriodEnd)return Math.max(this._scaledRelativePeriodEnd,0)},e}();function Y(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],d=(0,u.Z)(o.url,l.url);i.push({url:d,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}function X(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 Q(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 Q(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 Q(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){var t=e.adaptationProfiles,n=e.essentialProperties,r=e.supplementalProperties,i=e.manifestProfiles,a=e.codecs;if(-1!==((null!=t?t:"")+(null!=i?i:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&("hvc1.2.4.L153.B0"===a||"hev1.2.4.L153.B0"===a))return{colorDepth:10,eotf:"pq",colorSpace:"rec2020"};var o=(0,s.Z)([].concat(null!=n?n:[],null!=r?r:[]),(function(e){return"urn:mpeg:mpegB:cicp:TransferCharacteristics"===e.schemeIdUri}));if(void 0!==o)switch(o.value){case"15":return;case"16":return{eotf:"pq"};case"18":return{eotf:"hlg"}}return void 0!==a&&/^vp(08|09|10)/.exec(a)?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}}(a):void 0}function J(e,t,n){for(var r,i,a,u,l,d,c=[],f=function(){for(var e=d.value,f=void 0!==e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(void 0!==e.attributes.height?"-"+e.attributes.height:"")+(void 0!==e.attributes.width?"-"+e.attributes.width:"")+(void 0!==e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(void 0!==e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===f}));)f+="-dup";var v,p=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(f))&&void 0!==i?i:null,h=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),m=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete;void 0===e.attributes.availabilityTimeOffset&&void 0===n.availabilityTimeOffset||(v=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+(null!==(l=n.availabilityTimeOffset)&&void 0!==l?l:0));var g,y=function(e,t){var n,r,i,a=t.availabilityTimeOffset,o=t.manifestBoundsCalculator,s=t.isDynamic,u=t.end,l=t.start,d=t.receivedTime,c=t.unsafelyBaseOnPreviousRepresentation,f=t.inbandEventStreams,v={availabilityTimeComplete:void 0,availabilityTimeOffset:a,unsafelyBaseOnPreviousRepresentation:c,isEMSGWhitelisted:function(e){return void 0!==f&&f.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:o,isDynamic:s,periodEnd:u,periodStart:l,receivedTime:d,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id};if(void 0!==e.children.segmentBase){var p=e.children.segmentBase;i=new x.Z(p,v)}else if(void 0!==e.children.segmentList){var h=e.children.segmentList;i=new P(h,v)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var m=t.parentSegmentTemplates.slice(),g=e.children.segmentTemplate;void 0!==g&&m.push(g);var y=I.Z.apply(void 0,[{}].concat(m));void 0===y.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(v.availabilityTimeOffset=(null!==(n=y.availabilityTimeOffset)&&void 0!==n?n:0)+(null!==(r=t.availabilityTimeOffset)&&void 0!==r?r:0)),i=j.isTimelineIndexArgument(y)?new j(y,v):new q(y,v)}else{var _=t.adaptation.children;if(void 0!==_.segmentBase){var b=_.segmentBase;i=new x.Z(b,v)}else if(void 0!==_.segmentList){var S=_.segmentList;i=new P(S,v)}else i=new q({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},v)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:v,availabilityTimeComplete:m,unsafelyBaseOnPreviousRepresentation:p,adaptation:t,inbandEventStreams:h}));void 0===e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var _,b,T,E=Y(n.baseURLs,e.children.baseURLs),k={bitrate:g,cdnMetadata:0===E.length?[{baseUrl:"",id:void 0}]:E.map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:y,id:f};void 0!==e.children.supplementalProperties&&(0,s.Z)(e.children.supplementalProperties,(function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===e.schemeIdUri&&"JOC"===e.value}))&&(k.isSpatialAudio=!0),void 0!==e.attributes.codecs?_=e.attributes.codecs:void 0!==t.attributes.codecs&&(_=t.attributes.codecs),void 0!==_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,k.codecs=_),void 0!==e.attributes.supplementalCodecs?b=e.attributes.supplementalCodecs:void 0!==t.attributes.supplementalCodecs&&(b=t.attributes.supplementalCodecs),void 0!==b&&(k.supplementalCodecs=(T=b,(0,S.Z)(T)?T.trim().replace(Z,", "):"")),void 0!==e.attributes.frameRate?k.frameRate=e.attributes.frameRate:void 0!==t.attributes.frameRate&&(k.frameRate=t.attributes.frameRate),void 0!==e.attributes.height?k.height=e.attributes.height:void 0!==t.attributes.height&&(k.height=t.attributes.height),void 0!==e.attributes.mimeType?k.mimeType=e.attributes.mimeType:void 0!==t.attributes.mimeType&&(k.mimeType=t.attributes.mimeType),void 0!==e.attributes.width?k.width=e.attributes.width:void 0!==t.attributes.width&&(k.width=t.attributes.width);var w=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&w.push.apply(w,e.children.contentProtections),w.length>0){var A=w.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=X(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,d=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===d)e.initData.push({type:"cenc",values:a});else(l=d.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(A.initData).length>0||void 0!==A.keyIds&&A.keyIds.length>0)&&(k.contentProtections=A)}k.hdrInfo=$({adaptationProfiles:t.attributes.profiles,supplementalProperties:t.children.supplementalProperties,essentialProperties:t.children.essentialProperties,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(k)},v=X(e);!(d=v()).done;)f();return c}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}function ne(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 re(e,t){if(void 0!==e&&e.some((function(e){return"urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value})))return!0;if(void 0!==t&&t.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&"caption"===e.value})))return!0;return!1}function ie(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ae(e,t){if((0,S.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isForcedSubtitle,i=t.isAudioDescription,a=t.isSignInterpreted,o=t.isTrickModeTrack,s=t.type;return(0,S.Z)(e.attributes.language)&&(s+="-"+e.attributes.language),!0===n&&(s+="-cc"),!0===r&&(s+="-cc"),!0===i&&(s+="-ad"),!0===a&&(s+="-si"),o&&(s+="-trickMode"),(0,S.Z)(e.attributes.contentType)&&(s+="-"+e.attributes.contentType),(0,S.Z)(e.attributes.codecs)&&(s+="-"+e.attributes.codecs),(0,S.Z)(e.attributes.mimeType)&&(s+="-"+e.attributes.mimeType),(0,S.Z)(e.attributes.frameRate)&&(s+="-"+e.attributes.frameRate),s}function oe(e){if(null!=e.children.supplementalProperties)for(var t,n=ee(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 se(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 ue(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 le(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 le(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 le(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 de=(0,h.Z)();function ce(e,t){var n,r,a,u,l=[],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 c=t.isDynamic,f=t.manifestBoundsCalculator;c||(0,i.Z)(t.duration)||f.setLastPosition(t.duration);for(var v=function(){var v,T=h===e.length-1,E=e[h],w=t.xlinkInfos.get(E),I=Y(t.baseURLs,E.children.baseURLs),Z=d[h],x=Z.periodStart,R=Z.periodDuration,M=Z.periodEnd;for((0,i.Z)(E.attributes.id)?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),v="gen-dash-period-"+de()):v=E.attributes.id;l.some((function(e){return e.id===v}));)v+="-dup";var C=void 0!==w?w.receivedTime:t.receivedTime,P=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(v))&&void 0!==r?r:null,D=E.attributes.availabilityTimeComplete,N=E.attributes.availabilityTimeOffset,O=t.manifestProfiles,L=E.children.segmentTemplate,U={availabilityTimeComplete:D,availabilityTimeOffset:N,baseURLs:I,manifestBoundsCalculator:f,end:M,isDynamic:c,isLastPeriod:T,manifestProfiles:O,receivedTime:C,segmentTemplate:L,start:x,unsafelyBaseOnPreviousPeriod:P},B=function(e,t){for(var n,r,i,a,u,l,d,c={video:[],audio:[],text:[],image:[]},f=[],v={},p=[],h=0;h<e.length;h++){var m=e[h],g=m.children,T=g.essentialProperties,E=g.roles,w=g.label,I=Array.isArray(E)&&E.some((function(e){return"main"===e.value}))&&E.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),Z=m.children.representations,x=null!==(n=m.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,R=void 0;void 0===m.attributes.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(R=(null!==(r=m.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+(null!==(i=t.availabilityTimeOffset)&&void 0!==i?i:0));var M=m.attributes.mimeType,C=m.attributes.codecs,P=A(Z,(0,S.Z)(M)?M:null,(0,S.Z)(C)?C:null,null!=g.roles?g.roles:null);if(void 0!==P){var D=null!==(a=m.attributes.selectionPriority)&&void 0!==a?a:1,N=m.attributes.id,O=oe(m),L=[];void 0!==t.segmentTemplate&&L.push(t.segmentTemplate),void 0!==m.children.segmentTemplate&&L.push(m.children.segmentTemplate);var U={availabilityTimeComplete:x,availabilityTimeOffset:R,baseURLs:Y(t.baseURLs,g.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:L,receivedTime:t.receivedTime,start:t.start,unsafelyBaseOnPreviousAdaptation:null},B=Array.isArray(T)?(0,s.Z)(T,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,F=null===(u=null==B?void 0:B.value)||void 0===u?void 0:u.split(" "),V=void 0!==F,z=g.accessibilities,K=void 0;void 0!==E&&E.some((function(e){return"dub"===e.value}))&&(K=!0);var G=void 0;G="text"===P&&re(z,E);var W=void 0;"text"===P&&void 0!==E&&E.some((function(e){return"forced-subtitle"===e.value||"forced_subtitle"===e.value}))&&(W=!0);var H=void 0;"audio"!==P?H=!1:void 0!==z&&(H=z.some(ne));var j=void 0;"video"!==P?j=!1:void 0!==z&&(j=z.some(ie));for(var q=ae(m,{isAudioDescription:H,isForcedSubtitle:W,isClosedCaption:G,isSignInterpreted:j,isTrickModeTrack:V,type:P});(0,b.Z)(p,q);)q+="-dup";var X=q;p.push(q),U.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation(q))&&void 0!==d?d:null;var Q={id:q,representations:J(Z,m,U),type:P,isTrickModeTrack:V};if(null!=m.attributes.language&&(Q.language=m.attributes.language),null!=G&&(Q.closedCaption=G),null!=H&&(Q.audioDescription=H),!0===K&&(Q.isDub=!0),void 0!==W&&(Q.forcedSubtitles=W),!0===j&&(Q.isSignInterpreted=!0),void 0!==w&&(Q.label=w),void 0!==F)f.push({adaptation:Q,trickModeAttachedAdaptationIds:F});else{for(var $,te=-1,ue=function(){var e=$.value,t=v[e];if(void 0!==t&&t.newID!==X&&(0,b.Z)(t.adaptationSetSwitchingIDs,N)){te=(0,_.Z)(c[P],(function(t){return t[0].id===e}));var n,r=c[P][te];if(void 0!==r&&r[0].audioDescription===Q.audioDescription&&r[0].closedCaption===Q.closedCaption&&r[0].language===Q.language)return o.Z.info('DASH Parser: merging "switchable" AdaptationSets',N,e),(n=r[0].representations).push.apply(n,Q.representations),r[1]={priority:Math.max(D,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(h,r[1].indexInMpd)},1}},le=ee(O);!($=le()).done&&!ue(););te<0&&c[P].push([Q,{priority:D,isMainAdaptation:I,indexInMpd:h}])}null!=N&&null==v[N]&&(v[N]={newID:X,adaptationSetSwitchingIDs:O})}}var de=y.r.reduce((function(e,t){var n=c[t];return n.length>0&&(n.sort(se),e[t]=n.map((function(e){return e[0]}))),e}),{});return c.video.sort(se),k(de,f),de}(E.children.adaptations,U),F=(null!==(a=t.xmlNamespaces)&&void 0!==a?a:[]).concat(null!==(u=E.attributes.namespaces)&&void 0!==u?u:[]),V=function(e,t,n){for(var r,i,a,o=[],s=ue(e);!(a=s()).done;)for(var u,l=a.value,d=l.attributes,c=d.schemeIdUri,f=void 0===c?"":c,v=d.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ue(l.children.events);!(u=m()).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,S=void 0;if(y.eventStreamData instanceof Element)S=y.eventStreamData;else{var T=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");T+=">";var E=(0,g.uR)(new Uint8Array(y.eventStreamData));S=(new DOMParser).parseFromString(T+E+"</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:S}}})}}return o}(E.children.eventStreams,x,F),z={id:v,start:x,end:M,duration:R,adaptations:B,streamEvents:V};if(l.unshift(z),!f.lastPositionIsKnown()){var K=function(e){for(var t,n=null,r=!0,a=(0,m.Z)(e).filter((function(e){return!(0,i.Z)(e)})),o=ue((0,p.Z)(a,(function(e){return e})));!(t=o()).done;)for(var s,u=ue(t.value.representations);!(s=u()).done;){var l=s.value.index.getLastAvailablePosition();null!==l&&(r=!1,"number"==typeof l&&(n=(0,i.Z)(n)?l:Math.max(n,l)))}if(!(0,i.Z)(n))return n;if(r)return null;return}(B);if(c)if("number"==typeof K){var G=performance.now()/1e3;f.setLastPosition(K,G)}else{var W=fe(t,x);if(void 0!==W){var H=W[0],j=W[1];f.setLastPosition(H,j)}}else"number"==typeof K&&f.setLastPosition(K)}},h=e.length-1;h>=0;h--)v();if(t.isDynamic&&!f.lastPositionIsKnown()){var T=fe(t,0);if(void 0!==T){var E=T[0],w=T[1];f.setLastPosition(E,w)}}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(),0!==t.length);)i=t[t.length-1];t.push(r)}return t}(l)}function fe(e,t){if((0,i.Z)(e.clockOffset)){var n=Date.now()/1e3;if(n>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[n-e.availabilityStartTime,performance.now()/1e3]}else{var r=e.clockOffset/1e3-e.availabilityStartTime,a=performance.now()/1e3,s=a+r;if(s>=t)return[s,a]}}function ve(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 pe(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 pe(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 pe(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 he=function e(t,n,r,i,d){void 0===d&&(d=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?l(m.value):void 0,y=null==g||isNaN(g)?void 0:g;if(null!=y&&!0!==i)n.externalClockOffset=y;else if(h&&!0!==i){var _=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!=_&&_.length>0)return{type:"needs-clock",value:{url:_,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=[],S=0;S<c.periods.length;S++){var T=c.periods[S].attributes,E=T.xlinkHref,k=T.xlinkActuate;null!=E&&"onLoad"===k&&b.push({index:S,ressource:E})}return 0===b.length?function(e,t,n,r){var i,s,l,d,c,p,h=e.children,m=e.attributes,g="dynamic"===m.type,y=void 0!==t.url?[{url:t.url.substring(0,(0,u.$)(t.url))}]:[],_=Y(y,h.baseURLs),b=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),S=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,k=t.externalClockOffset,w=new v({availabilityStartTime:b,isDynamic:g,timeShiftBufferDepth:S,serverTimestampOffset:k}),A={aggressiveMode:t.aggressiveMode,availabilityStartTime:b,baseURLs:_,clockOffset:T,duration:m.duration,isDynamic:g,manifestBoundsCalculator:w,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:S,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},I=ce(h.periods,A),Z=m.duration,x=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(d=0===m.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var R=f(I),M=R.minimumSafePosition,C=R.maximumSafePosition,P=R.maximumUnsafePosition,D=performance.now();if(g){var N;if(void 0!==C)N=C;else if(void 0===k)o.Z.warn("DASH Parser: use system clock to define maximum position"),N=Date.now()/1e3-b;else N=(performance.now()+k)/1e3-b;var O=w.getEstimatedLiveEdge();void 0===O&&(O=void 0!==P?P:N),p={isLinear:!0,maximumSafePosition:N,livePosition:O,time:D},c=M,null!==(x=null!=S?S:null)&&void 0!==c&&O-c>x&&(x=O-c)}else{c=void 0!==M?M:void 0!==(null===(i=I[0])||void 0===i?void 0:i.start)?I[0].start:0;var L=null!=Z?Z:1/0;if(void 0!==I[I.length-1]){var U=I[I.length-1],B=null!==(s=U.end)&&void 0!==s?s:void 0!==U.duration?U.start+U.duration:void 0;void 0!==B&&B<L&&(L=B)}void 0!==C&&C<L&&(L=C),p={isLinear:!1,maximumSafePosition:L,livePosition:void 0,time:D}}var F=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=I[I.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration),V={availabilityStartTime:b,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:F,periods:I,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:c,timeshiftDepth:x,maximumTimeData:p},lifetime:d,uris:null==t.url?h.locations:[t.url].concat(h.locations)};return{type:"done",value:{parsed:V,warnings:n}}}(t,n,r,d):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(a){if(a.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=b[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=ve(f);!(g=y()).done;){var _=g.value;d.set(_,{receivedTime:p,sendingTime:h,url:m})}(s=c.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,d)}}}};function me(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function ge(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 ye=n(7326),_e=n(4578),be=n(2146),Se=n(9689),Te=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Ee=/([0-9]+)-([0-9]+)/;function ke(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new De("`"+t+'` property is not a boolean value but "'+e+'"')]}function we(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ae(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ie(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ze(e,t){var n=Date.parse(e);return isNaN(n)?[null,new De("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,S.Z)(e))return[0,new De("`"+t+"` property is empty")];var n=Te.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,S.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,S.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,S.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,S.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,S.Z)(n[10])?n[10]:"0")+parseFloat((0,S.Z)(n[12])?n[12]:"0"),null]}function Re(e,t){var n=Ee.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Me(e,t){try{return[(0,Se.K)(e),null]}catch(n){return[null,new De("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Ce(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 Pe(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 De=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,ye.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,_e.Z)(t,e),t}((0,be.Z)(Error));function Ne(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=Me(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,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Pe(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:Re,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Le(e){for(var t={},n=[],r=Pe(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=Oe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var d=0;d<e.attributes.length;d++){var c=e.attributes[d];switch(c.name){case"timescale":r(c.value,{asKey:"timescale",parser:we,dashName:"timescale"});break;case"presentationTimeOffset":r(c.value,{asKey:"presentationTimeOffset",parser:Ae,dashName:"presentationTimeOffset"});break;case"indexRange":r(c.value,{asKey:"indexRange",parser:Re,dashName:"indexRange"});break;case"indexRangeExact":r(c.value,{asKey:"indexRangeExact",parser:ke,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(c.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(c.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"});break;case"duration":r(c.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"startNumber":r(c.value,{asKey:"startNumber",parser:we,dashName:"startNumber"});break;case"endNumber":r(c.value,{asKey:"endNumber",parser:we,dashName:"endNumber"})}}return[t,n]}function Ue(e){for(var t={},n=[],r=Pe(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:Re,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Re,dashName:"mediaRange"})}}return[t,n]}function Be(e){for(var t=Le(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=Ue(s),l=u[0],d=u[1];i.push(l),r=r.concat(d)}}return[(0,I.Z)(n,{list:i}),r]}function Fe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ve(e){for(var t,n=Le(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=Fe(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Pe(s,i),l=0;l<e.attributes.length;l++){var d=e.attributes[l];switch(d.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:d.value});break;case"index":s.index=d.value;break;case"availabilityTimeOffset":u(d.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(d.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"});break;case"media":s.media=d.value;break;case"bitstreamSwitching":u(d.value,{asKey:"bitstreamSwitching",parser:ke,dashName:"bitstreamSwitching"})}}return[s,i]}function ze(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=me(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(Ce(a));break;case"SegmentBase":var l=Le(a),d=l[0],c=l[1];t.segmentBase=d,c.length>0&&(r=r.concat(c));break;case"SegmentList":var f=Be(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ve(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ne(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_);break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ce(a)]:t.supplementalProperties.push(Ce(a))}}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=Pe(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:we,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ke,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:we,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Ae,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Ae,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:we,dashName:"qualityRanking"});break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:we,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new De("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ke(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=[Ce(a)]:t.accessibilities.push(Ce(a));break;case"BaseURL":var o=me(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=ge(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Ce(a)]:t.essentialProperties.push(Ce(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ce(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var d=ze(a),c=d[0],f=d[1];t.representations.push(c),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Ce(a)]:t.roles.push(Ce(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ce(a)]:t.supplementalProperties.push(Ce(a));break;case"SegmentBase":var v=Le(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Be(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Ve(a),b=_[0],S=_[1];t.segmentTemplate=b,S.length>0&&(r=r.concat(S));break;case"ContentProtection":var T=Ne(a),E=T[0],k=T[1];k.length>0&&(r=r.concat(k)),void 0!==E&&n.push(E)}}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=Pe(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:we,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:we,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:we,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:we,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:we,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:we,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:we,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:we,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Ie,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Ie,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ke,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ke,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:we,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Ae,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Ae,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:we,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ge(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Pe(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:we,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=We(s),l=u[0],d=u[1];t.children.events.push(l),d.length>0&&(n=n.concat(d))}}return[t,n]}function We(e){for(var t={eventStreamData:e},n=[],r=Pe(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:we,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}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=me(s),l=u[0],d=u[1];void 0!==l&&n.push(l),i=i.concat(d);break;case"AdaptationSet":var c=Ke(s),f=c[0],v=c[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Ge(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ve(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=Pe(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:ke,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 je(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=me(s),l=u[0],d=u[1];void 0!==l&&t.push(l),a=a.concat(d);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var c=He(s),f=c[0],v=c[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Ce(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=Pe(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:Ze,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ze,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ze,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 qe=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=je(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 d="<root>"+o.data+"</root>",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(he(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 d=r[u+1];if(void 0===d)return null;var c=d.start;return i>=a(l,d,n)&&i<c?s(c,e):null}},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 d=n-u;return e.splice.apply(e,[u,d].concat(t)),!1}if(l<o){var c=e[u];if(c.start+c.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===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(c.start+c.duration*(c.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-c.start)/c.duration-1;if(f%1==0&&c.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=c.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 d,c,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(;d=f.exec(e),c=v.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var b=e.slice(d.index,c.index),S=u.exec(b);if(!Array.isArray(S))throw new Error("parse error (sync time attribute)");var T=+S[1];if(isNaN(T))throw new Error("parse error (sync time attribute NaN)");E(b.split("\n"),T/1e3)}return p;function E(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if(" "===d)p[p.length-1].end=n;else{var c=document.createElement("DIV");c.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=d.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),c.appendChild(f),p.push({element:c,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 d(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,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=d(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(;c=v.exec(e),f=p.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var b=e.slice(c.index,f.index),S=l.exec(b);if(null===S)throw new Error("parse error (sync time attribute)");var T=+S[1];if(isNaN(T))throw new Error("parse error (sync time attribute NaN)");E(b.split("\n"),T/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 E(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&(" "===c?h[h.length-1].end=n:h.push({text:(i=c,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 d=o(l);null!=d&&s.push(d)}}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 d=e(a);d.style.fontWeight="bold",r.appendChild(d)}else if("I"===a.nodeName){var c=e(a);c.style.fontStyle="italic",r.appendChild(c)}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,d=e.split(/\r\n|\n|\r/),c=(0,i.Z)(d),f=[],v=0;v<c.length;v++){var p=(0,a.Z)(c[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),d=i(a);return void 0===l||void 0===d?null:{start:l+t,end:d+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={},l=e.slice(),d=function(){var e=t[c];if(void 0!==e){var s,d;if(e.nodeType===Node.ELEMENT_NODE)for(var f=e,v=0;v<=f.attributes.length-1;v++){var p=f.attributes[v],h=p.name;if("style"===h)s=p.value;else if("region"===h)d=p.value;else{var m=h.substring(4);if((0,i.Z)(l,m)&&(u[m]=p.value,l.splice(v,1),0===l.length))return{v:u}}}if((0,a.Z)(s)){var g=(0,r.Z)(n,(function(e){return e.id===s}));if(void 0!==g)for(var y=0;y<=l.length-1;y++){var _=l[y];if(!(0,a.Z)(u[_])&&(0,a.Z)(g.style[_])){if(u[_]=g.style[_],l.splice(y,1),0===l.length)return{v:u};y--}}}if((0,a.Z)(d)){var b=(0,r.Z)(o,(function(e){return e.id===d}));if(void 0!==b)for(var S=0;S<=l.length-1;S++){var T=l[S];if(!(0,a.Z)(u[T])&&(0,a.Z)(b.style[T])){if(u[T]=b.style[T],l.splice(S,1),0===l.length)return{v:u};S--}}}}},c=0;c<=t.length-1;c++)if(s=d())return s.v;return u}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,o+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 k}});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),d=n(8026),c=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 d=m(o[0]),c=o[1];e.style.textShadow=h(d,c)}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 S=t.textDecoration;if((0,l.Z)(S))switch(S){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=S}var T=t.fontFamily;if((0,l.Z)(T))switch(T){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=T}var E=t.fontStyle;(0,l.Z)(E)&&(e.style.fontStyle=E);var k=t.fontWeight;(0,l.Z)(k)&&(e.style.fontWeight=k);var w=t.fontSize;(0,l.Z)(w)?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,w):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var I=t.unicodeBidi;if((0,l.Z)(I))switch(I){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var Z=t.visibility;(0,l.Z)(Z)&&(e.style.visibility=Z),"none"===t.display&&(e.style.display="none");var x=t.wrapOption;e.style.whiteSpace="noWrap"===x?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 d=p.eT.exec(n[3]);if(null!==d)if("px"===d[2]||"%"===d[2]||"em"===d[2]){var c=d[1]+d[2];e.style.paddingLeft=c}else"c"===d[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",d[1])):v.Z.warn("TTML Parser: unhandled padding unit:",d[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 d=t.opacity;(0,l.Z)(d)&&(e.style.opacity=d);var c=t.visibility;(0,l.Z)(c)&&(e.style.visibility=c),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1");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(),r=n.split(" ");if("auto"!==n){var i=p.eT.exec(r[0]);null!==i&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.lineHeight=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",i[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",i[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 S(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 T(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,c.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,c.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=S(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,T=(0,d.Z)({},i,(0,c.U)(g,[p],n,t));u.push.apply(u,e(p,T,[p].concat(a),b))}}return u}(e,(0,d.Z)({},r),[],i)}(e,n,r,i,s),T=0;T<y.length;T++)h.appendChild(y[T]);return v.appendChild(h),v}function E(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 d=n.cellResolution,c=(0,s.Z)(t,n);return{start:c.start+u,end:c.end+u,element:T(t,r,i,a,o,{cellResolution:d,shouldTrimWhiteSpace:l})}}var k=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=E(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),d={left:"start",center:"center",right:"end",start:"start",end:"end"},c={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 d=u.trim();u=d=d.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c: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=c[a];e.positionAlign=void 0===s?"":s;var l=d[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),d=n(7714);var c=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,c.H)(p),m=(0,c.vU)(p),g=(0,c.DM)(p),y=(0,c.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"),d={columns:32,rows:15};if(null!==l){var c=s.exec(l);if(null===c||c.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(c[1],10),v=parseInt(c[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):d={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 S=/^(\d+) (\d+)$/g.exec(a);null!==S&&(g=p*(Number(S[1])/Number(S[2])))}return{cellResolution:d,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],S=0;S<=m.length-1;S++){var T=m[S];if(T instanceof Element){var E=T.getAttribute("xml:id");if(null!==E){var k=T.getAttribute("style"),w=null===k?[]:k.split(" ");b.push({id:E,style:(0,u.b)(T),extendsStyles:w})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(){var i=r.extendsStyles[u],s=(0,l.Z)(e,(function(e){return e.id===i}));if(s<0)o.Z.warn("TTML Parser: unknown style inheritance: "+i);else{var c=e[s];(0,d.Z)(t,s)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(c,s),r.style=(0,a.Z)({},c.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s();r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=function(){var e=g[Z];if(e instanceof Element){var t=e.getAttribute("xml:id");if(null!==t){var n=(0,u.b)(e),o=e.getAttribute("style");if((0,i.Z)(o)){var s=(0,r.Z)(b,(function(e){return e.id===o}));void 0!==s&&(n=(0,a.Z)({},s.style,n))}A.push({id:t,style:n,extendsStyles:[]})}}},Z=0;Z<=g.length-1;Z++)I();for(var x=(0,u.U)(f,null!==h?[h]:[],b,A),R="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,M=0;M<y.length;M++){var C=y[M];if(C instanceof Element){var P=(0,c.jF)(C),D=(0,a.Z)({},x,(0,u.U)(f,[C].concat(P),b,A)),N=C.getAttribute("xml:space"),O=(0,i.Z)(N)?"default"===N:R,L={paragraph:C,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:D,ttParams:_,shouldTrimWhiteSpace:O};null!==L&&n.push(L)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return c},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return d},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)%$/,d=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,c=/^#([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 d(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 d},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 I}});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=function(r){var o=e[r];if(Array.isArray(/::cue {/.exec(o)))for(o=e[++r];(0,i.Z)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)n+=o,o=e[++r];else{for(var s=[],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);(0,i.Z)(o)&&Array.isArray(u);)s.push(u[1]),o=e[++r],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);for(var l="";(0,i.Z)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)l+=o,o=e[++r];s.forEach((function(e){void 0===t[e]?t[e]=l:t[e]+=l}))}a=r},a=1;a<e.length;a++)r(a)})),{classes:t,global:n}}var l=n(7714);function d(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 c=e.nodeName.toLowerCase().split("."),f=[];if(c.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=d(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=d(e.childNodes[y],t);n.appendChild(_)}}return n}var c=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,c.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: "+E(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+T(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=w(e.position);if(null!==n)return n;var r=T(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?T(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:S(e.line)}},b=function(e){return w(e)},S=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]},T=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},E=function(e){return k(e,100)},k=function(e,t){var n=w(e);return null!==n?n:t},w=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 c=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);c.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(d(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(c),c.appendChild(v),{start:n,end:r,element:u}}var I=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),d=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),c=(0,r.Z)(n,l),f=u(d),v=0;v<c.length;v++){var p=(0,o.Z)(c[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 c}});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 d=n(7253);var c=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,c,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,c=void 0,f=void 0,u=(s=g).start,c=s.end,f=s.payload.join("\n"),(0,d.Z)(u,c,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 ce}});var r=n(7874),i=n(8791),a=n(5861),o=n(4687),s=n.n(o),u=n(4597),l=n(9829);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,l.Z)(e.baseUrl,t.url)}function c(e,t,n,r,i){return f.apply(this,arguments)}function f(){return(f=(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 v(e,t){var n,i=t.segment,a=t.period,o=e.data,s=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(s)throw new Error("Image data should not be downloaded in chunks");var u=null!==(n=i.timestampOffset)&&void 0!==n?n:0;return null===o||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(o)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}var p=n(6872),h=n(8750),m=n(3887),g=n(1989),y=n(8026),_=n(3635);function b(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,d){var c,f=a.responseData,v=o.externalClockOffset,b=null!==(c=a.url)&&void 0!==c?c:o.originalUrl,S=null!=i?i:v,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:b,referenceDateTime:n,externalClockOffset:S},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return m.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var k=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,_.tG)(e).buffer;if(e instanceof Document)return(0,_.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}(k)?"initialized"===E.wasm.status?(m.Z.debug("DASH: Running WASM MPD Parser."),A(E.wasm.runWasmParser(k,T))):(m.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(m.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(m.Z.debug("DASH: Running WASM MPD Parser."),A(E.wasm.runWasmParser(k,T)))}))):(m.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,_.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(E.js(e,T))}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 g.ZP(t.value.parsed,e),url:b};var n=t.value,r=n.urls.map((function(e){return d((function(){var t=p.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,y.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,y.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,h.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,y.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 S=n(7839),T=n(9105),E=n(5992),k=n(1946),w="function"==typeof Headers?Headers:null,A="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,k.Z)(A)&&!(0,k.Z)(w)}var Z=n(8806),x=n(281);function R(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 M=n(288),C=n(4460);function P(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new M.ZP,d=l.linkToSignal(i);function c(){l.signal.deregister(u),d()}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(c(),!l.isUsed()){if("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"===R(n.adaptation.type,n.representation)&&(0,C.Z)(new Uint8Array(e),n.segment.isInit)}}}var D=n(6968);function N(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,x.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,x.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,x.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.ZP)({url:e,headers:{Range:(0,x.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,D.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 O=n(8766);function L(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,x.Z)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,k.Z)(e.headers))if((0,k.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}m.Z.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,d=performance.now(),c=(0,k.Z)(A)?null:new A;function f(){(0,k.Z)(c)?m.Z.warn("Fetch: AbortController API not available."):c.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)(c)?null:c.signal,fetch(e.url,p).then((function(t){if((0,k.Z)(o)||clearTimeout(o),t.status>=300)throw m.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,k.Z)(t.body))throw new T.Z(t.url,t.status,E.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 c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,o,c,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(),c={url:t.url,currentTime:o,duration:o-d,sendingTime:d,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(c),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-d,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:d,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 m.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw m.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.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,O.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,D.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,O.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,D.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,D.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 N(e,t.segment,r,a,i);var o=R(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return L(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,x.Z)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),F=n(4644),V=408125543,z=357149030,K=2807729,G=17545,W=475249515,H=187,j=179,q=183,Y=241;function X(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=ee(n,o);if(null==s)return null;var u=s.value,l=o+s.length,d=te(n,l);if(null==d)return null;var c=l+d.length,f=c+d.value;if(u===e)return[c,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return X(e,t.slice(v+1,t.length),n,[c,f])}o=f}return null}function Q(e,t){var n=X(K,[V,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/ne(e,n[0],r)}function $(e,t){var n=X(G,[V,z],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 ee(e,t){var n=J(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.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 te(e,t){var n=J(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.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 ne(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 re=n(7403);function ie(e,t,n,r){var i=(0,F.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,F.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&m.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 ae(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,_.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 oe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a,o=n.period,s=n.adaptation,u=n.representation,l=n.segment,d=n.manifest,c=e.data,f=e.isChunked,v=[o.start,o.end];if(null===c)return l.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=c instanceof Uint8Array?c:new Uint8Array(c),h=R(s.type,u),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,B.Z)(p);l.isInit&&(y=null!==(i=(0,F.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=u._addProtectionData("cenc",y,_))}if(!l.isInit){var b=m?ie(p,f,l,r):null,S=null!==(a=l.timestampOffset)&&void 0!==a?a:0;if(m){var T=(0,F.s9)(p);if(void 0!==T){var E=ae(T.filter((function(e){return void 0!==l.privateInfos&&void 0!==l.privateInfos.isEMSGWhitelisted&&l.privateInfos.isEMSGWhitelisted(e)})),d.publishTime);if(void 0!==E){var w=E.needsManifestRefresh,A=E.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:S,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:S,protectionDataUpdate:g,appendWindow:v}}var I=l.indexRange,Z=null;if("webm"===h)Z=function(e,t){var n=X(V,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=Q(e,r);if(null==a)return null;var o=$(e,r);if(null==o)return null;var s=X(W,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var d=X(H,[],e,[l,s[1]]);if(null==d)break;var c=X(j,[],e,[d[0],d[1]]);if(null==c)return null;var f=ne(e,c[0],c[1]-c[0]),v=X(Y,[q],e,[d[0],d[1]]);if(null==v)return null;var p=ne(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=d[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&&(Z=(0,F.Wf)(p,Array.isArray(I)?I[0]:0),!0===t&&null!==Z&&Z.length>0)){var x=Z[Z.length-1];Array.isArray(x.range)&&(x.range[1]=1/0)}u.index instanceof re.Z&&null!==Z&&Z.length>0&&u.index.initializeIndex(Z);var M=m?(0,F.LD)(p):"webm"===h?Q(p,0):void 0,C=(0,k.Z)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var se=n(6807);function ue(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):m.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),d=function(e){var t=(0,se.Le)(e);return null===t?"":(0,_.uR)(t)}(t);return{data:d,type:l,language:s.language,start:i,end:a}}function le(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?m.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 de(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,l=e.data,d=e.isChunked;if(null===l)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 c=R(o.type,s);if("webm"===c)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===c?function(e,t,n,r,i){var a,o=n.period,s=n.representation,u=n.segment,l=u.isInit,d=u.indexRange,c="string"==typeof e?(0,_.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,F.Wf)(c,Array.isArray(d)?d[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,F.LD)(c);return s.index instanceof re.Z&&null!==f&&f.length>0&&s.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=ie(c,t,u,r),m=ue(n,c,h,t),g=null!==(a=u.timestampOffset)&&void 0!==a?a:0;return{segmentType:"media",chunkData:m,chunkSize:c.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[o.start,o.end]}}(l,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,_.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:le(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(l,d,n)}}var ce=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=b(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:P(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 d=!1,c=n(u,{reject:function(e){var t,n,r;if(!d&&!a.isCancelled()){d=!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 S.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){d||a.isCancelled()||(d=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){d||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){d||a.isCancelled()||(d=!0,a.deregister(f),U(s,r,t,i,o,a).then(e,l))}});function f(e){d||(d=!0,"function"==typeof c&&c(),l(e))}a.register(f)}))}}(e),o=oe(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:P(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 N(f,l,r,i,a);var v=R(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return L(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,x.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,x.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:de(e)},image:{loadSegment:c,parseSegment:v}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(4687),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),d=n(9362),c=n(811),f=n(8232),v=n(3911),p=n(5505);function h(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 m(e,t){return e.replace(/\{start time\}/g,String(t))}function g(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function y(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 _=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,d=this._isAggressiveMode,c=[],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],_=h.duration,b=h.start,S=y(h,s[p+1]),T=g(b,i,_),E=b+T*_,k=d?0:_;E<a&&T<=S&&(null==v||E+k<=v);){var w=E,A=null!=n?n+T:void 0,I={id:String(E),isInit:!1,time:w/u,end:(w+_)/u,duration:_/u,timescale:1,number:A,url:m(l,w),complete:!0,privateInfos:{smoothMediaSegment:{time:w,duration:_}}};c.push(I),E=b+ ++T*_}if(E>=a)return c;null!=n&&(n+=S+1)}return c},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,c.Z)(e<=t),this.isStillAwaitingFutureSegments())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();for(var t=this._index,n=t.timeline,r=t.timescale,i=0;i<n.length;i++){var a=n[i],o=a.start/r;if(o>e.time)return!1;if(o===e.time)return!0;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},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof d.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 d=t[l],c=(0,v.jH)(d,null);if(c===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(c>u){if(d.duration!==o.duration)return;var f=u-d.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%d.duration!=0)return;var p=f/d.duration-1,h=d.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,p.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isStillAwaitingFutureSegments=function(){return this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)h(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}(),b=n(8999),S=n(7714),T=n(6968),E=n(6923),k=n(8026),w=n(9829),A=n(3635),I=n(2689),Z={};function x(e){if(null!=Z[e])return Z[e];var t=(0,A.tG)(e);return Z[e]=t,t}function R(e,t){var n=t.length+8;return n<=I.s?(0,T.zo)((0,T.kh)(n),x(e),t):(0,T.zo)((0,T.kh)(1),x(e),(0,T.el)(n+8),t)}function M(e,t){return R(e,T.zo.apply(void 0,t))}function C(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,S.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,C(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,S.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,C(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,S.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,C(e),i.push(r)}else i.push(n)}))}))}))}))}var P=n(9689);function D(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,T.zo)([8,1,18,16],e)}]}function N(e,t){if(void 0===t&&(t=D),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,P.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,T.qb)(e,8),n=(0,A.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,A.wO)((0,P.K)(i));return(0,A.ci)(a).toLowerCase()}(r),a=(0,A.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}function O(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var L={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},U={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var B=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=O(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,O(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"),d=r("PacketSize"),c=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===U[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,E.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?U[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};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===U[m]||void 0===h)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,E.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:b,customAttributes:n,mimeType:void 0!==m?U[m]:m,codecPrivateData:h,codecs:S,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var T=r("CodecPrivateData"),k=r("FourCC"),w=r("Bitrate");return{bitrate:void 0===w||isNaN(parseInt(w,10))?0:parseInt(w,10),customAttributes:n,mimeType:void 0!==k?U[k]:k,codecPrivateData:null!=T?T:""};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,d=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,S.Z)(b.r,h)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),w=r.getAttribute("Url"),I=null===w?"":w;var Z,x=O(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:[]}),M=x.qualityLevels,C=x.cNodes,P={timeline:(Z=C,Z.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 d=Z[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,E.Z)(c)?+c: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,c.Z)(0!==M.length,"Adaptation should have at least one playable representation.");var D=m+((0,E.Z)(y)?"_"+y:""),N=M.map((function(t){var n,r,i,a,s={timeline:P.timeline,timescale:P.timescale,media:(n=I,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,E.Z)(t.mimeType)?t.mimeType:L[m],v=t.codecs,p=D+"_"+(null!=m?m+"-":"")+(null!=c?c+"-":"")+(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,b=new _(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:d,segmentPrivateInfos:g,timeShiftBufferDepth:l}),S=(0,k.Z)({},t,{index:b,cdnMetadata:[{baseUrl:o}],mimeType:c,codecs:v,id:p});if(h.length>0||void 0!==a){var w=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 R("pssh",(0,T.zo)([n,0,0,0],(0,A.nr)(e),(0,T.kh)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(w.length>0){var Z=[{type:"cenc",values:w}];S.contentProtections={keyIds:h,initData:Z}}else S.contentProtections={keyIds:h,initData:[]}}return S}));if("ADVT"===g)return null;var U={id:D,type:m,representations:N,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(U.closedCaption=!0),U}return function(n,r,a){var s="";if(void 0!==r){var u=(0,w.$)(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 d=l.getAttribute("MajorVersion"),c=l.getAttribute("MinorVersion");if(null===d||null===c||!/^[2]-[0-2]$/.test(d+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,E.Z)(p)?isNaN(+p)?1e7:+p:1e7,m=O(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(N(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 S,T,k,A,I,Z,x,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,P=void 0!==R.video?R.video[0]:void 0,D=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==P||void 0!==D){var L=[],U=[];if(void 0!==P){var B=P.representations[0];if(void 0!==B){var F=B.index.getFirstAvailablePosition(),V=B.index.getLastAvailablePosition();null!=F&&L.push(F),null!=V&&U.push(V)}}if(void 0!==D){var z=D.representations[0];if(void 0!==z){var K=z.index.getFirstAvailablePosition(),G=z.index.getLastAvailablePosition();null!=K&&L.push(K),null!=G&&U.push(G)}}L.length>0&&(I=Math.max.apply(Math,L)),U.length>0&&(Z=Math.min.apply(Math,U),x=Math.max.apply(Math,U))}var W=l.getAttribute("Duration"),H=null!==W&&0!=+W?+W/h:void 0;if(_){S=e.suggestedPresentationDelay,T=t,k=null!=I?I:T;var j=x;void 0===j&&(j=Date.now()/1e3-T);var q=Z;void 0===q&&(q=j),A={isLinear:!0,maximumSafePosition:q,livePosition:j,time:performance.now()},M=null!=v?v:null}else{k=null!=I?I:0,A={isLinear:!1,maximumSafePosition:void 0!==Z?Z:void 0!==H?k+H:1/0,livePosition:void 0,time:performance.now()}}var Y=_?0:k,X=_?void 0:A.maximumSafePosition,Q={availabilityStartTime:void 0===T?0:T,clockOffset:i,isLive:_,isDynamic:_,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:k,timeshiftDepth:M,maximumTimeData:A},periods:[{adaptations:R,duration:void 0!==X?X-Y:H,end:X,id:"gen-smooth-period-0",start:Y}],suggestedPresentationDelay:S,transportType:"smooth",uris:null==r?[]:[r]};return C(Q),Q}},F=B,V=n(4597),z=n(8806),K=n(4460),G=n(8791),W=n(4644),H=n(2297);function j(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.XA)(e);null!==c?(u=function(e){var t=(0,H.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,T.pV)(t,16*a+5),o=(0,T.pV)(t,16*a+5+8)):(s=(0,T.pX)(t,8*a+5),o=(0,T.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(c),o=function(e){var t=(0,H.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,T.pV)(t,12),time:(0,T.pV)(t,4)}}(c)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)d.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:d,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:d,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,W.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:d,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var q=n(3666);function Y(e,t){return R("schm",(0,T.zo)(4,(0,A.tG)(e),(0,T.kh)(t)))}function X(e){return R("frma",(0,A.tG)(e))}function Q(e){var t=[7,[e.length]];return R("stsd",T.zo.apply(void 0,t.concat(e)))}function $(e,t,n){return R("tenc",(0,T.zo)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(R("senc",i),function(e){if(0===e.length)return R("saiz",new Uint8Array(0));var t=(0,T.pX)(e,0),n=(0,T.pX)(e,4),r=new Uint8Array(n+9);r.set((0,T.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,T.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return R("saiz",r)}(i),function(e,t,n,r){return R("saio",(0,T.zo)(4,[0,0,0,1],(0,T.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),M("traf",a)}function ee(e,t){var n=(0,H.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,H.iz)(r,1835427940),a=(0,H.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,H.Qy)(a,1952868452),s=(0,H.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 d=function(e){return R("tfdt",(0,T.zo)([1,0,0,0],(0,T.el)(e)))}(t),c=function(e,t){var n=(1&e[t+3])>0;if(n)return e;var r=new Uint8Array(e.length+4);return r.set(e.subarray(0,t+8),0),r[t+3]=1|r[t+3],r.set([0,0,0,0],t+8),r.set(e.subarray(t+8,e.length),t+12),(0,W.J6)(r)}(l,s[1]-s[0]),f=J(u,d,c,i,(0,H.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=M("moof",[i,f]),p=(0,H.Qy)(v,1836019558),h=(0,H.Qy)(f,1953653094),m=(0,H.Qy)(c,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+d.length+(m[1]-m[0])+8,y=n[2]-n[0],_=v.length-y,b=(0,H.Qy)(e,1835295092);if(null===b)throw new Error("Smooth: Invalid ISOBMFF given");if(!q.YM&&(0===_||_<=-8)){var S=b[1];return v.set((0,T.kh)(S),g),e.set(v,n[0]),_<=-8&&e.set(R("free",new Uint8Array(-_-8)),v.length),e}var E=b[1]+_;v.set((0,T.kh)(E),g);var k=new Uint8Array(e.length+_),w=e.subarray(0,n[0]),A=e.subarray(n[2],e.length);return k.set(w,0),k.set(v,w.length),k.set(A,w.length+v.length),k}var te=n(7839),ne=n(281);function re(e,t,n,r,i,a){var o,s,u,l=M("stbl",[n,R("stts",new Uint8Array(8)),R("stsc",new Uint8Array(8)),R("stsz",new Uint8Array(12)),R("stco",new Uint8Array(8))]),d=function(e){return R("dref",(0,T.zo)(7,[1],e))}(R("url ",new Uint8Array([0,0,0,1]))),c=M("dinf",[d]),f=M("minf",[r,c,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 R("hdlr",(0,T.zo)(8,(0,A.tG)(t),12,(0,A.tG)(n),1))}(t),p=function(e){return R("mdhd",(0,T.zo)(12,(0,T.kh)(e),8))}(e),h=M("mdia",[p,v,f]),m=function(e,t,n){return R("tkhd",(0,T.zo)((0,T.kh)(7),8,(0,T.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,T.XT)(e),2,(0,T.XT)(t),2))}(i,a,1),g=M("trak",[m,h]),y=M("mvex",[(o=1,R("trex",(0,T.zo)(4,(0,T.kh)(o),[0,0,0,1],12)))]),_=function(e,t){return R("mvhd",(0,T.zo)(12,(0,T.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,T.XT)(t+1)))}(e,1),b=function(e,t,n){return M("moov",[e,t,n])}(_,y,g),S=(s="isom",u=["isom","iso2","iso6","avc1","dash"],R("ftyp",T.zo.apply(void 0,[(0,A.tG)(s),[0,0,0,1]].concat(u.map(A.tG)))));return(0,T.zo)(S,b)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,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 R("avcC",(0,T.zo)([1,i,a,o,252|r,225],(0,T.XT)(e.length),e,[1],(0,T.XT)(t.length),t))}((0,A.nr)(l),(0,A.nr)(d),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return R("avc1",(0,T.zo)(6,(0,T.XT)(1),16,(0,T.XT)(e),(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),6,[0,1,i.length],(0,A.tG)(i),31-i.length,(0,T.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);c=Q([p])}else{var h=M("schi",[$(1,8,s)]),m=Y("cenc",65536),g=function(e,t,n,r,i,a,o,s){return R("encv",(0,T.zo)(6,(0,T.XT)(1),16,(0,T.XT)(e),(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),6,[0,1,i.length],(0,A.tG)(i),31-i.length,(0,T.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,M("sinf",[X("avc1"),m,h]));c=Q([g])}return re(e,"video",c,((f=new Uint8Array(12))[3]=1,R("vmhd",f)),t,n)}var ae=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function oe(e,t,n,r,i,a,o){var s,u,l,d=function(e,t){return R("esds",(0,T.zo)(4,[3,25],(0,T.XT)(e),[0,4,17,64,21],11,[5,2],(0,A.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&ae.indexOf(s))<<4)|31&u)<<3,(0,A.ci)((0,T.XT)(l))):a),c=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return R("mp4a",(0,T.zo)(6,(0,T.XT)(e),8,(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),(0,T.XT)(i),2,a))}(1,t,n,r,i,d);return Q([e])}var a=M("schi",[$(1,8,o)]),s=Y("cenc",65536),u=M("sinf",[X("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return R("enca",(0,T.zo)(6,(0,T.XT)(e),8,(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),(0,T.XT)(i),2,a,o))}(1,t,n,r,i,d,u);return Q([l])}();return re(e,"audio",c,R("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,E.Z)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ce(e,t){return null===e?null:null===t.url?e.baseUrl:(0,w.Z)(e.baseUrl,t.url)}function fe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ne.Z)(s)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,K.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var ve=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,d=r.adaptation,c=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(d.type){case"video":var y=c.width,_=void 0===y?0:y,b=c.height;f=ie(h,_,void 0===b?0:b,72,72,4,p,g.keyId);break;case"audio":var S=v.channels,T=void 0===S?0:S,E=v.bitsPerSample,k=void 0===E?0:E,w=v.packetSize,A=void 0===w?0:w,I=v.samplingRate;f=oe(h,T,k,A,void 0===I?0:I,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 Z={adaptation:d,manifest:u,period:l,representation:c,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?fe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,d=n(Z,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled()){l=!0,a.deregister(c);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 te.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(c),de(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,K.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(c),fe(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 c(e){l||((l=!0)||"function"!=typeof d||d(),u(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(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 _&&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 me=function(e){var t=F(e),n=ve(e),i={customManifestLoader:e.manifestLoader},d={loadSegment:function(e,t,r,i,a){var o=ce(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 d=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var c=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:c,protectionDataUpdate:!1}}var f=void 0!==n?j(d,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=ee(d,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},c={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ce(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):de(s)?(0,V.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,K.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.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,d=t.representation,c=t.segment,f=u.language,v=de(d),p=d.mimeType,h=void 0===p?"":p,m=d.codec,g=void 0===m?"":m,y=e.data,_=e.isChunked;if(c.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,S,T,E,k=null;if(v){var w;i=(w="string"==typeof y?(0,A.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var I=void 0!==n?j(w,_,n,c,o.isLive):null;a=null==I?void 0:I.nextSegments,null===(k=null!==(r=null==I?void 0:I.chunkInfos)&&void 0!==r?r:null)?_?s.Z.warn("Smooth: Unavailable time data for current text track."):(b=c.time,S=c.end):(b=k.time,S=void 0!==k.duration?k.time+k.duration:c.end);var Z=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===Z||"stpp.ttml.im1t"===Z)E="ttml";else{if("wvtt"!==Z)throw new Error("could not find a text-track parser for the type "+h);E="vtt"}var x=(0,l.Le)(w);T=null===x?"":(0,A.uR)(x)}else{var R;if(b=c.time,S=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,R=(0,A.uR)(M)}else R=y;switch(h){case"application/x-sami":case"application/smil":E="sami";break;case"application/ttml+xml":E="ttml";break;case"text/vtt":E="vtt"}if(void 0===E){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);E="srt"}T=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,c),{segmentType:"media",chunkData:{type:E,data:T,start:b,end:S,language:f},chunkSize:i,chunkInfos:k,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;pe.test(e)?((0,z.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:le(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=ue.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return le(function(e){return se.test(e)?((0,z.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(se,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,G.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,d=t(l,a,o);return{manifest:new u.ZP(d,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:d,video:d,text:c,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=ce(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,V.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,d=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled()){l=!0,i.deregister(c);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.",d=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(d)}},resolve:function(e){if(!l&&!i.isCancelled()){l=!0,i.deregister(c);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(c),t(n,r,i).then(o,s))}},{timeout:r.timeout});function c(e){l||(l=!0,"function"==typeof d&&d(),s(e))}i.register(c)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;if(e===t)return!0;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),d=0,c=0;d<u;d+=4,c+=3)a=o(n.charCodeAt(d))<<18|o(n.charCodeAt(d+1))<<12|o(n.charCodeAt(d+2))<<6|o(n.charCodeAt(d+3)),l[c]=a>>16,l[c+1]=a>>8&255,l[c+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 d(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 c(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])}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},dN:function(){return f},el:function(){return d},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return c},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(7733);function i(e,t){return(0,r.Z)(t,(function(t){var n=setTimeout((function(){return t()}),e);return function(){return clearTimeout(n)}}))}},7733:function(e,t,n){"use strict";function r(e,t){var n;return new Promise((function(r,i){if(null!==e.cancellationError)return i(e.cancellationError);var a=!1;function o(e){void 0!==n&&n(),i(e)}n=t((function(t){e.deregister(o),a=!0,r(t)}),(function(t){e.deregister(o),a=!0,i(t)})),a||e.register(o)}))}n.d(t,{Z:function(){return r}})},1959:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946),a=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,i.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,i.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){r.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}()},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 i}});var r=.3;function i(e){return e*((2*Math.random()-1)*r+1)}},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 d},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 d=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 s},DD:function(){return m},F_:function(){return p},JN:function(){return c},L7:function(){return g},Ti:function(){return u},XS:function(){return v},at:function(){return h},kR:function(){return y},rx:function(){return f},tn:function(){return b},uH:function(){return S}});var r=1/60;function i(e,t){return Math.abs(e-t)<r}function a(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function o(e,t){return e.end<=t.start}function s(e,t){for(var n=0;n<e.length;n++)if(u(e[n],t))return!0;return!1}function u(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function l(e,t){return u(e,t.start)||e.start<t.end&&t.end<e.end||u(t,e.start)}function d(e,t){return i(t.start,e.end)||i(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 f(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 v(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 p(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 h(e,t){var n=f(e,t);return null!==n?n.end-n.start:0}function m(e,t){var n=f(e,t);return null!==n?t-n.start:0}function g(e,t){var n=f(e,t);return null!==n?n.end-t:1/0}function y(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var i=e[r],s=l(n,i),u=d(n,i);if(s||u)n=a(n,i),e.splice(r--,1);else if(0===r){if(o(n,e[0]))break}else if(o(e[r-1],n)&&o(n,i))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(d(n,r)){var i=a(n,r);e.splice(--t,2,i)}}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 _(e,t){for(var n=[],r=0;r<t.length;r++)l(e,t[r])&&n.push(t[r]);return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=_(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 S(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=_(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,d=0;d<a.length;d++)a[d].start>l&&n.push({start:l,end:a[d].start}),l=a[d].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 u}});var r=n(5138),i=n(8894);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}var s=function(){function e(e,t){var n=this;this._value=e,this._listeners=[],this._isFinished=!1,this._onFinishCbs=[],void 0!==t&&(this._deregisterCancellation=t.register((function(){return n.finish()})))}var t=e.prototype;return t.getValue=function(){return this._value},t.setValue=function(e){if(!this._isFinished&&(this._value=e,0!==this._listeners.length))for(var t,n=a(this._listeners.slice());!(t=n()).done;){var r=t.value;try{r.hasBeenCleared||r.trigger(e,r.complete)}catch(e){}}},t.setValueIfChanged=function(e){e!==this._value&&this.setValue(e)},t.onUpdate=function(e,t){var n=this,r=function e(){if(void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.deregister(e),!i.hasBeenCleared){i.hasBeenCleared=!0;var r=n._listeners.indexOf(i);r>=0&&n._listeners.splice(r,1)}},i={trigger:e,complete:r,hasBeenCleared:!1};this._listeners.push(i),!0===(null==t?void 0:t.emitCurrentValue)&&e(this._value,r),this._isFinished||i.hasBeenCleared?r():void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.register(r)},t.waitUntilDefined=function(e,t){var n=this;this.onUpdate((function(t,r){void 0!==t&&(r(),e(n._value))}),{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:!0})},t._onFinished=function(e,t){var n=this;if(t.isCancelled())return i.Z;var a=function(){var e=(0,r.Z)(n._onFinishCbs,(function(e){return e.trigger===o}));e>=0&&(n._onFinishCbs[e].hasBeenCleared=!0,n._onFinishCbs.splice(e,1))},o=function(){a(),e()},s=t.register(a);return this._onFinishCbs.push({trigger:o,hasBeenCleared:!1}),s},t.finish=function(){void 0!==this._deregisterCancellation&&this._deregisterCancellation(),this._isFinished=!0;for(var e,t=a(this._listeners.slice());!(e=t()).done;){var n=e.value;try{n.hasBeenCleared||(n.complete(),n.hasBeenCleared=!0)}catch(e){}}if(this._listeners.length=0,this._onFinishCbs.length>0){for(var r,i=a(this._onFinishCbs.slice());!(r=i()).done;){var o=r.value;try{o.hasBeenCleared||(o.trigger(),o.hasBeenCleared=!0)}catch(e){}}this._onFinishCbs.length=0}},e}();function u(e,t,n){var r=new s(t(e.getValue()),n);return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),e._onFinished((function(){r.finish()}),n),r}t.Z=s},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,d=t.url,c=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",d,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){_(),o(new r.Z(d,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.Z)(c)){var h=c;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(d,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){_(),o(new r.Z(d,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:d,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,c=p.responseType,f=(0,i.Z)(p.responseURL)?p.responseURL:d;if(t="json"===c?"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(d,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:c,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.Z(d,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{$:function(){return o},Z:function(){return a}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var a=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof a&&""!==a&&(r.test(a)?t=a:("/"===a[0]&&(a=a.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+a))}return function(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("/")}(t)}function o(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?o(e.substring(0,i)):t+1}},5440:function(e,t,n){"use strict";function r(e){return new Promise((function(t){setTimeout(t,e)}))}n.d(t,{Z:function(){return r}})},3146:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3274),i=n(7714),a=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.toArray=function(){return this._array.slice()},t.findFirst=function(e){return(0,r.Z)(this._array,e)},t.has=function(e){return(0,i.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}()},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 c},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 d=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(d),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var c=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(c),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 d(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function c(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"+d(l,4):"%"+d(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],d=new Uint8Array(16);return d[0]=a,d[1]=r,d[2]=n,d[3]=t,d[4]=s,d[5]=o,d[6]=l,d[7]=u,d.set(e.subarray(8,16),8),d}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:c(e.subarray(t,n))}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},XG:function(){return d},ZP:function(){return l}});var r=n(7326),i=n(4578),a=n(2146),o=n(3887),s=n(811),u=n(8894),l=function(){function e(){var e,t=(e=u.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this._isUsed=!1,this._trigger=n,this.signal=new d(r)}var t=e.prototype;return t.isUsed=function(){return this._isUsed},t.linkToSignal=function(e){var t=this,n=e.register((function(){t.cancel()}));return this.signal.register(n),n},t.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}(),d=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;)try{var n=t._listeners.pop();null==n||n(e)}catch(e){o.Z.error("Error while calling clean up listener",e instanceof Error?e.toString():"Unknown error")}}))}var t=e.prototype;return t.isCancelled=function(){return this._isCancelled},t.register=function(e){var t=this;return this._isCancelled?((0,s.Z)(null!==this.cancellationError),e(this.cancellationError),u.Z):(this._listeners.push(e),function(){return t.deregister(e)})},t.deregister=function(e){for(var t=this._listeners.length-1;t>=0;t--)this._listeners[t]===e&&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}()},7061:function(e,t,n){var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new P(r||[]);return s(a,"_invoke",{value:x(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=v;var h="suspendedStart",m="suspendedYield",g="executing",y="completed",_={};function b(){}function S(){}function T(){}var E={};f(E,l,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(D([])));w&&w!==a&&o.call(w,l)&&(E=w);var A=T.prototype=b.prototype=Object.create(E);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function Z(e,t){function n(i,a,s,u){var l=p(e[i],e,a);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==r(c)&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(c).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value: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 x(e,n,r){var i=h;return function(a,o){if(i===g)throw new Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=R(s,r);if(u){if(u===_)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=g;var l=p(e,n,r);if("normal"===l.type){if(i=r.done?y:m,l.arg===_)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function R(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var a=p(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,_;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function M(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return S.prototype=T,s(A,"constructor",{value:T,configurable:!0}),s(T,"constructor",{value:S,configurable:!0}),S.displayName=f(T,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,f(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},n.awrap=function(e){return{__await:e}},I(Z.prototype),f(Z.prototype,d,(function(){return this})),n.AsyncIterator=Z,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new Z(v(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},I(A),f(A,c,"Generator"),f(A,l,(function(){return this})),f(A,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},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 n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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&&o.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 a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(a)},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),_},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),C(n),_}},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;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},n}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}})},1656:function(e,t,n){"use strict";function r(e){return r="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},r(e)}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}function a(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,i(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return o}})},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 o}});var i=n(9611);function a(e,t,n){return a=function(){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}}()?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},a.apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return o=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,o)}function o(){return a(e,arguments,r(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(o,e)},o(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 be}});var e=n(1656),t=n(4578),i=n(3038);function a(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 o(){if(s()){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 s(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var u=n(3666),l=n(3887);function d(){if(!u.vU)return!0;var e=function(){if(!u.vU)return l.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 c=n(6872),f=n(8750),v=n(3714),p=n(5992),h=n(1946),m=n(7273);var g=n(7874),y=n(4791),_=n(7714),b=n(811),S=n(1959),T=n(908),E=n(8026),k=n(2829),w=n(5095),A=n(288),I=n(8806),Z=n(5861),x=n(4687),R=n.n(x),M=n(5440),C=n(770);function P(e){return D.apply(this,arguments)}function D(){return(D=(0,Z.Z)(R().mark((function e(t){var n,r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=C.Z.getState(t))){e.next=3;break}return e.abrupt("return",void 0);case 3:return l.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,C.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:return e.abrupt("return",Promise.race([n.emeImplementation.setMediaKeys(t,null).catch((function(e){l.Z.error("DRM: Could not reset MediaKeys",e instanceof Error?e:"Unknown Error")})),(0,M.Z)(1e3)]));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var N=n(245);function O(e){if(l.Z.info("DRM: Clearing-up DRM session."),u.fq)return l.Z.info("DRM: disposing current MediaKeys."),P(e);var t=C.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(l.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(l.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var L=n(5553);function U(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 B(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 B(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 B(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=n(8894),V=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],z=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new A.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),l.Z.info("API: Seeking internally",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 F.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return W(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=c.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=G(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=c.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,d=t.bufferGap,f=t.currentRange,v=t.duration,p=t.paused,h=t.readyState,m=t.ended,g=e.rebuffering,y=e.event,_=e.position,b=function(e,t,n,r,i){var a=c.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,f,m,v,o),S=h>=1&&"loadedmetadata"!==u&&null===g&&!(b||m),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(S)d===1/0?(r=!0,T=l):void 0===d?h<3&&(r=!0,T=void 0):d<=E&&(r=!0,T=l+d);else if(null!==g){var k=K(g,o);!0!==r&&null!==g&&h>1&&(b||m||void 0!==d&&isFinite(d)&&d>k)||void 0===d&&h>=3?i=!0:void 0===d?T=void 0:d===1/0?T=l:d<=k&&(T=l+d)}}else S&&(!p&&"timeupdate"===u&&"timeupdate"===y&&l===_||"seeking"===u&&(d===1/0||void 0===d&&h<3))?r=!0:null!==g&&("seeking"!==u&&l!==_||"canplay"===u||void 0===d&&h>=3||void 0!==d&&d<1/0&&(d>K(g,o)||b||m))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==g)return w="seeking"===u||null!==g&&"seeking"===g.reason||t.seeking?"seeking":1===h?"not-ready":"buffering",null!==g&&g.reason===w?{reason:g.reason,timestamp:g.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),d=function(e,t){var n=c.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),f=(0,E.Z)({},{rebuffering:u,freezing:d,pendingInternalSeek:s},o);return l.Z.hasLevel("DEBUG")&&l.Z.debug("API: current media element state tick","event",f.event,"position",f.position,"seeking",f.seeking,"internalSeek",f.pendingInternalSeek,"rebuffering",null!==f.rebuffering,"freezing",null!==f.freezing,"ended",f.ended,"paused",f.paused,"playbackRate",f.playbackRate,"readyState",f.readyState),f},s=new w.Z(o("init"),this._canceller.signal),u=function(t){var n=o(t);l.Z.hasLevel("DEBUG")&&l.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 d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i<e.length-1){var c=e.start(i+1),f=" ~"+(c-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<c){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)},d=this._lowLatencyMode?i:this._withMediaSource?r:a,f=setInterval(p,d),v=V.map((function(e){function n(){clearInterval(f),f=setInterval(p,d),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(f),v.forEach((function(e){return e()})),s.finish()})),s;function p(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,E.Z)(G(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function K(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=c.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 G(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,d=e.playbackRate,c=e.readyState,f=e.seeking;return!n&&0===a.length&&c>=3?(r=void 0,i=void 0):i=null!==(r=(0,k.rx)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:d,readyState:c,seeking:f,event:t}}function W(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 W(this,e,n)}}}var H=n(3274),j=n(7829),q=n(3146);function Y(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,j.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function X(e){return e.map((function(e){return null===e?e:{normalized:(0,j.ZP)(e.language),forced:e.forced,closedCaption:e.closedCaption}}))}var Q=function(){function e(e){this._periods=new q.Z((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=ie(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void l.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptationRef:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptationRef: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)):l.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else l.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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.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.adaptationRef.setValue(null);else if(void 0!==i&&(0,_.Z)(r,i))n.adaptationRef.setValue(i);else{var a=J(r,Y(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.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.adaptationRef.setValue(null);else if(void 0!==i&&(0,_.Z)(r,i))n.adaptationRef.setValue(i);else{var a=te(r,X(this._preferredTextTracks),this._audioChoiceMemory.get(e));this._textChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.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,_.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=re(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptationRef.setValue(null);var o=ae(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptationRef.setValue(o)},t.setAudioTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.audio:null;if((0,h.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,H.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.adaptationRef.setValue(i))},t.setTextTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.text:null;if((0,h.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,H.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.adaptationRef.setValue(i))},t.setVideoTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,H.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ae(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptationRef.setValue(a)},t.disableTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptationRef.setValue(null))},t.disableVideoTrack=function(e){var t=ie(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.adaptationRef.setValue(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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.Z)(n))return null;var r=this._audioChoiceMemory.get(e);return(0,h.Z)(r)?null:r.toAudioTrack()},t.getChosenTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,h.Z)(r)?null:r.toTextTrack()},t.getChosenVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.Z)(n))return null;var r=this._videoChoiceMemory.get(e);return(0,h.Z)(r)?null:r.adaptation.toVideoTrack()},t.getAvailableAudioTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,h.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.Z)(e.toAudioTrack(),{active:t})}))},t.getAvailableTextTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,h.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.Z)(e.toTextTrack(),{active:t})}))},t.getAvailableVideoTracks=function(e){var t,n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.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=null!==a&&a===e.id,n=e.toVideoTrack(),r=void 0!==n.trickModeTracks?n.trickModeTracks.map((function(e){var t=null!==a&&a===e.id;return(0,E.Z)(e,{active:t})})):[],i=(0,E.Z)(n,{active:t});return void 0!==r&&(i.trickModeTracks=r),i}))},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=Y(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.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,_.Z)(s,u))n(r+1);else{var l=J(s,t);e._audioChoiceMemory.set(a,l),o.adaptationRef.setValue(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=X(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.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,_.Z)(s,u))n(r+1);else{var l=te(s,t,e._audioChoiceMemory.get(a));e._textChoiceMemory.set(a,l),o.adaptationRef.setValue(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,h.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,_.Z)(s,u.baseAdaptation)){var l=ae(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptationRef.setValue(l),n(0))}var d=re(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptationRef.setValue(null),n(0);var c=ae(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptationRef.setValue(c),n(0)}n(r+1)}}}(0)},e}();function $(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 J(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),a=(0,H.Z)(e,i);if(void 0!==a)return a}return e[0]}function ee(e){return function(t){var n;return(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)&&(!0===e.forced?!0===t.isForcedSubtitles:!0!==t.isForcedSubtitles)}}function te(e,t,n){var r;if(0===e.length)return null;for(var i=0;i<t.length;i++){var a=t[i];if(null===a)return null;var o=ee(a),s=(0,H.Z)(e,o);if(void 0!==s)return s}var u=e.filter((function(e){return!0===e.isForcedSubtitles}));if(u.length>0){if(null!=n){var l=(0,H.Z)(u,(function(e){return e.normalizedLanguage===n.normalizedLanguage}));if(void 0!==l)return l}return null!==(r=(0,H.Z)(u,(function(e){return void 0===e.normalizedLanguage})))&&void 0!==r?r:null}return null}function ne(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 re(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=ne(r),a=(0,H.Z)(e,i);if(void 0!==a)return a}return e[0]}function ie(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ae(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}function oe(e,t){var n=c.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"}function se(e){return"LOADING"!==e&&"RELOADING"!==e&&"STOPPED"!==e}function ue(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 le(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 le(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 le(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 de=(0,T.Z)(),ce=i.XR,fe=i.w0,ve=i.it,pe=i.O0,he=i.zU,me=i.kJ,ge=i.Q4,ye=function(n){function r(e){var t,r,i;void 0===e&&(e={}),t=n.call(this)||this;var a=function(e){var t,n,r,i,a,o,s,u,l,d,f,v,p,m,g,y,_=c.Z.getCurrent(),b=_.DEFAULT_INITIAL_BITRATES,S=_.DEFAULT_LIMIT_VIDEO_WIDTH,T=_.DEFAULT_MIN_BITRATES,E=_.DEFAULT_MAX_BITRATES,k=_.DEFAULT_MAX_BUFFER_AHEAD,w=_.DEFAULT_MAX_BUFFER_BEHIND,A=_.DEFAULT_MAX_VIDEO_BUFFER_SIZE,Z=_.DEFAULT_STOP_AT_END,x=_.DEFAULT_THROTTLE_WHEN_HIDDEN,R=_.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,M=_.DEFAULT_WANTED_BUFFER_AHEAD;if((0,h.Z)(e.maxBufferAhead))t=k;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,h.Z)(e.maxBufferBehind))n=w;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,h.Z)(e.wantedBufferAhead))r=M;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,h.Z)(e.maxVideoBufferSize))i=A;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var C=(0,h.Z)(e.limitVideoWidth)?S:!!e.limitVideoWidth;if((0,h.Z)(e.throttleWhenHidden)?a=x:((0,I.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,h.Z)(e.throttleVideoBitrateWhenHidden)?R:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,I.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,I.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,I.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,h.Z)(e.videoElement))d=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");d=e.videoElement}if((0,h.Z)(e.initialVideoBitrate))f=b.video;else if(f=Number(e.initialVideoBitrate),isNaN(f))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,h.Z)(e.initialAudioBitrate))v=b.audio;else if(v=Number(e.initialAudioBitrate),isNaN(v))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,h.Z)(e.minVideoBitrate))m=T.video;else if(m=Number(e.minVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,h.Z)(e.minAudioBitrate))p=T.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,h.Z)(e.maxVideoBitrate))y=E.video;else{if(y=Number(e.maxVideoBitrate),isNaN(y))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(m>y)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+y+'", is inferior to the set minVideoBitrate, "'+m+'"')}if((0,h.Z)(e.maxAudioBitrate))g=E.audio;else{if(g=Number(e.maxAudioBitrate),isNaN(g))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>g)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+g+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:C,videoElement:d,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:v,initialVideoBitrate:f,minAudioBitrate:p,minVideoBitrate:m,maxAudioBitrate:g,maxVideoBitrate:y,stopAtEnd:(0,h.Z)(e.stopAtEnd)?Z:!!e.stopAtEnd}}(e),o=a.initialAudioBitrate,s=a.initialVideoBitrate,u=a.limitVideoWidth,d=a.minAudioBitrate,f=a.minVideoBitrate,v=a.maxAudioBitrate,p=a.maxBufferAhead,m=a.maxBufferBehind,g=a.maxVideoBitrate,y=a.preferredAudioTracks,_=a.preferredTextTracks,b=a.preferredVideoTracks,S=a.throttleWhenHidden,T=a.throttleVideoBitrateWhenHidden,E=a.videoElement,k=a.wantedBufferAhead,Z=a.maxVideoBufferSize,x=a.stopAtEnd,R=c.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;E.preload="auto",t.version="3.33.0",t.log=l.Z,t.state="STOPPED",t.videoElement=E;var M=new A.ZP;t._destroyCanceller=M,t._priv_pictureInPictureRef=fe(E,M.signal),he(E,(function(){t.trigger("fullscreenChange",t.isFullscreen())}),M.signal);for(var C=[],P=0;P<(null===(r=E.textTracks)||void 0===r?void 0:r.length);P++){var D=null===(i=E.textTracks)||void 0===i?void 0:i[P];(0,h.Z)(D)||C.push(D)}var N=function(e){for(var n=e.target,r=[],i=0;i<n.length;i++){var a=n[i];r.push(a)}var o=C;if(C=r,o.length===r.length){for(var s=0;s<o.length;s++)if(o[s]!==r[s])return void t._priv_onNativeTextTracksNext(r)}else t._priv_onNativeTextTracksNext(r)};return(0,h.Z)(E.textTracks)||(me(E.textTracks,N,M.signal),ge(E.textTracks,N,M.signal)),t._priv_speed=new w.Z(E.playbackRate,t._destroyCanceller.signal),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=new w.Z(!1,t._destroyCanceller.signal),t._priv_bufferOptions={wantedBufferAhead:new w.Z(k,t._destroyCanceller.signal),maxBufferAhead:new w.Z(p,t._destroyCanceller.signal),maxBufferBehind:new w.Z(m,t._destroyCanceller.signal),maxVideoBufferSize:new w.Z(Z,t._destroyCanceller.signal)},t._priv_bitrateInfos={lastBitrates:{audio:o,video:s},minAutoBitrates:{audio:new w.Z(d,t._destroyCanceller.signal),video:new w.Z(f,t._destroyCanceller.signal)},maxAutoBitrates:{audio:new w.Z(v,t._destroyCanceller.signal),video:new w.Z(g,t._destroyCanceller.signal)},manualBitrates:{audio:new w.Z(-1,t._destroyCanceller.signal),video:new w.Z(-1,t._destroyCanceller.signal)}},t._priv_throttleWhenHidden=S,t._priv_throttleVideoBitrateWhenHidden=T,t._priv_limitVideoWidth=u,t._priv_mutedMemory=R,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=x,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t._priv_lastAutoPlay=!1,t}(0,t.Z)(r,n),r.addFeatures=function(e){!function(e){for(var t=0;t<e.length;t++){var n=e[t];if("function"==typeof n)n(m.Z);else{if((0,h.Z)(n)||"function"!=typeof n._addFeature)throw new Error("Unrecognized feature");n._addFeature(m.Z)}}}(e)};var i=r.prototype;return i.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},i.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},i.dispose=function(){this.stop(),null!==this.videoElement&&P(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.Z.error("API: Could not dispose decryption resources: "+t)})),this._destroyCanceller.cancel(),this._priv_reloadingMetadata={},this.videoElement=null},i.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,d,f,v,p,m,g,y,b=c.Z.getCurrent(),S=b.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,T=b.DEFAULT_AUTO_PLAY,k=b.DEFAULT_CODEC_SWITCHING_BEHAVIOR,w=b.DEFAULT_ENABLE_FAST_SWITCHING,A=b.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,Z=b.DEFAULT_SHOW_NATIVE_SUBTITLE,x=b.DEFAULT_TEXT_TRACK_MODE;if((0,h.Z)(e))throw new Error("No option set on loadVideo");if((0,h.Z)(e.url)){if((0,h.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,h.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 f=String(e.url);if((0,h.Z)(e.transport))throw new Error("No transport set on loadVideo");v=String(e.transport),(0,h.Z)(null===(r=e.transportOptions)||void 0===r?void 0:r.aggressiveMode)||(0,I.Z)("`transportOptions.aggressiveMode` is deprecated and won't be present in the next major version. Please open an issue if you still need this.");var R=(0,h.Z)(e.autoPlay)?T:!!e.autoPlay;if((0,h.Z)(e.keySystems))p=[];else for(var M,C=U(p=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(M=C()).done;){var P=M.value;if("string"!=typeof P.type||"function"!=typeof P.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback");(0,h.Z)(P.onKeyStatusesChange)||(0,I.Z)("`keySystems[].onKeyStatusesChange` is deprecated and won't be present in the next major version. Please open an issue if you still need this."),(0,h.Z)(P.throwOnLicenseExpiration)||(0,I.Z)("`keySystems[].throwOnLicenseExpiration` is deprecated and won't be present in the next major version. Please open an issue if you still need this.")}var D=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,N="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},O=null===(i=e.transportOptions)||void 0===i?void 0:i.initialManifest,B=null!==(o=null===(a=e.transportOptions)||void 0===a?void 0:a.minimumManifestUpdateInterval)&&void 0!==o?o:0,F=(0,h.Z)(e.audioTrackSwitchingMode)?S:e.audioTrackSwitchingMode;(0,_.Z)(["seamless","direct","reload"],F)||(l.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+S+" strategy will be used as default"),F=S);var V=(0,h.Z)(e.onCodecSwitch)?k:e.onCodecSwitch;(0,_.Z)(["continue","reload"],V)||(l.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+k+" will be used as default"),V=k);var z=(0,E.Z)({},N,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:D});if(delete z.initialManifest,delete z.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,I.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var K,G=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],W=U(G);!(K=W()).done;){var H=K.value;if("string"!=typeof H.language||"string"!=typeof H.mimeType||"string"!=typeof H.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}z.supplementaryTextTracks=G}if(void 0!==e.supplementaryImageTracks){(0,I.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var j,q=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],Y=U(q);!(j=Y()).done;){var X=j.value;if("string"!=typeof X.mimeType||"string"!=typeof X.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}z.supplementaryImageTracks=q}if((0,h.Z)(null===(s=e.transportOptions)||void 0===s?void 0:s.manifestUpdateUrl)||(0,I.Z)("`manifestUpdateUrl` API is deprecated, please open an issue if you still rely on this."),(0,h.Z)(e.textTrackMode))m=x;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");m=e.textTrackMode}(0,h.Z)(e.defaultAudioTrack)||(0,I.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var Q=(0,L.iH)(e.defaultAudioTrack);(0,h.Z)(e.defaultTextTrack)||(0,I.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var $=(0,L.Y1)(e.defaultTextTrack),J=!Z;(0,h.Z)(e.hideNativeSubtitle)||((0,I.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),J=!!e.hideNativeSubtitle);var ee=null!==(u=e.manualBitrateSwitchingMode)&&void 0!==u?u:A,te=(0,h.Z)(e.enableFastSwitching)?w:e.enableFastSwitching;if("html"===m){if((0,h.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.");g=e.textTrackElement}else(0,h.Z)(e.textTrackElement)||l.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,h.Z)(e.startAt))if("wallClockTime"in e.startAt&&e.startAt.wallClockTime instanceof Date){var ne=e.startAt.wallClockTime.getTime()/1e3;y=(0,E.Z)({},e.startAt,{wallClockTime:ne})}else y=e.startAt;return{autoPlay:R,defaultAudioTrack:Q,defaultTextTrack:$,enableFastSwitching:te,hideNativeSubtitle:J,keySystems:p,initialManifest:O,lowLatencyMode:D,manualBitrateSwitchingMode:ee,audioTrackSwitchingMode:F,minimumManifestUpdateInterval:B,networkConfig:null!==(d=e.networkConfig)&&void 0!==d?d:{},onCodecSwitch:V,startAt:y,textTrackElement:g,textTrackMode:m,transport:v,transportOptions:z,url:f}}(e);l.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t),this._priv_lastAutoPlay=t.autoPlay},i.reload=function(e){var t,n,r,i,a,o,s=this._priv_reloadingMetadata,u=s.options,l=s.manifest,d=s.reloadPosition,c=s.reloadInPause;if(void 0===u)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.");if(!Array.isArray(null==e?void 0:e.keySystems)&&void 0!==(null==e?void 0:e.keySystems))throw new Error("API: reload - Invalid 'keySystems' option format.");if(void 0!==(null==e?void 0:e.autoPlay)&&"boolean"!=typeof e.autoPlay)throw new Error("API: reload - Invalid 'autoPlay' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))i={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===d)throw new Error("Can't reload to a relative position when previous content was not loaded.");i={position:e.reloadAt.relative+d}}else void 0!==d&&(i={position:d});void 0!==(null==e?void 0:e.autoPlay)?a=e.autoPlay:void 0!==c&&(a=!c),void 0!==(null==e?void 0:e.keySystems)?o=e.keySystems:void 0!==(null===(r=this._priv_reloadingMetadata.options)||void 0===r?void 0:r.keySystems)&&(o=this._priv_reloadingMetadata.options.keySystems);var f=Object.assign(Object.assign({},u),{initialManifest:l});void 0!==i&&(f.startAt=i),void 0!==a&&(f.autoPlay=a),void 0!==o&&(f.keySystems=o),this._priv_initializeContentPlayback(f)},i.createDebugElement=function(e){if(null===g.Z.createDebugElement)throw new Error("Feature `DEBUG_ELEMENT` not added to the RxPlayer");var t=new A.ZP;return g.Z.createDebugElement(e,this,t.signal),{dispose:function(){t.cancel()}}},i._priv_initializeContentPlayback=function(e){var t=this,n=e.autoPlay,r=e.audioTrackSwitchingMode,i=e.defaultAudioTrack,a=e.defaultTextTrack,o=e.enableFastSwitching,s=e.initialManifest,u=e.keySystems,c=e.lowLatencyMode,v=e.manualBitrateSwitchingMode,p=e.minimumManifestUpdateInterval,m=e.networkConfig,y=e.onCodecSwitch,b=e.startAt,S=e.transport,T=e.transportOptions,k=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var I,Z="directfile"===S,x=new A.ZP,R=this.videoElement,M=null;if(Z){if(null===g.Z.directfile)throw this.stop(),this._priv_currentError=null,new Error("DirectFile feature not activated in your build.");if((0,h.Z)(k))throw new Error("No URL for a DirectFile content");if(M=this._priv_initializeMediaElementTrackChoiceManager(i,a,x.signal),x.isUsed())return;I=new g.Z.directfile.initDirectFile({autoPlay:n,keySystems:u,speed:this._priv_speed,startAt:b,url:k})}else{var C=g.Z.transports[S];if("function"!=typeof C)throw this.stop(),this._priv_currentError=null,new Error('transport "'+S+'" not supported');if(null===g.Z.mediaSourceInit)throw new Error("MediaSource streaming not supported");var P=C(T),D=m.offlineRetry,N=m.segmentRetry,O=m.manifestRetry,L=m.manifestRequestTimeout,U=m.segmentRequestTimeout,B={lowLatencyMode:c,maxRetryRegular:O,maxRetryOffline:D,requestTimeout:L,minimumManifestUpdateInterval:p,initialManifest:s},F=d(),V={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(F?V.throttle={video:(0,w.l)(ce(x.signal),(function(e){return e?1/0:0}),x.signal)}:l.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(F?V.throttleBitrate={video:(0,w.l)(ve(this._priv_pictureInPictureRef,x.signal),(function(e){return e?1/0:0}),x.signal)}:l.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(F?V.limitWidth={video:pe(R,this._priv_pictureInPictureRef,x.signal)}:l.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var K={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:c,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:V},G="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},W=(0,E.Z)({audioTrackSwitchingMode:r,enableFastSwitching:o,manualBitrateSwitchingMode:v,onCodecSwitch:y},this._priv_bufferOptions),H={lowLatencyMode:c,maxRetryRegular:N,requestTimeout:U,maxRetryOffline:D};I=new g.Z.mediaSourceInit({adaptiveOptions:K,autoPlay:n,bufferOptions:W,keySystems:u,lowLatencyMode:c,manifestRequestSettings:B,transport:P,segmentRequestOptions:H,speed:this._priv_speed,startAt:b,textTrackOptions:G,url:k})}var j={contentId:de(),originalUrl:k,currentContentCanceller:x,initializer:I,isDirectFile:Z,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:i,initialTextTrack:a,trackChoiceManager:null,mediaElementTrackChoiceManager:M};I.addEventListener("error",(function(e){var n=(0,f.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});n.fatal=!0,j.currentContentCanceller.cancel(),t._priv_cleanUpCurrentContentState(),t._priv_currentError=n,l.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),t._priv_setPlayerState("STOPPED"),t._priv_currentError===n&&t.trigger("error",n)})),I.addEventListener("warning",(function(e){var n=(0,f.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});l.Z.warn("API: Sending warning:",n),t.trigger("warning",n)})),I.addEventListener("reloadingMediaSource",(function(e){j.segmentBuffersStore=null,null!==j.trackChoiceManager&&j.trackChoiceManager.resetPeriods(),t._priv_lastAutoPlay=e.autoPlay})),I.addEventListener("inbandEvents",(function(e){return t.trigger("inbandEvents",e)})),I.addEventListener("streamEvent",(function(e){return t.trigger("streamEvent",e)})),I.addEventListener("streamEventSkip",(function(e){return t.trigger("streamEventSkip",e)})),I.addEventListener("decipherabilityUpdate",(function(e){return t.trigger("decipherabilityUpdate",e)})),I.addEventListener("activePeriodChanged",(function(e){return t._priv_onActivePeriodChanged(j,e)})),I.addEventListener("periodStreamReady",(function(e){return t._priv_onPeriodStreamReady(j,e)})),I.addEventListener("periodStreamCleared",(function(e){return t._priv_onPeriodStreamCleared(j,e)})),I.addEventListener("representationChange",(function(e){return t._priv_onRepresentationChange(j,e)})),I.addEventListener("adaptationChange",(function(e){return t._priv_onAdaptationChange(j,e)})),I.addEventListener("bitrateEstimationChange",(function(e){return t._priv_onBitrateEstimationChange(e)})),I.addEventListener("manifestReady",(function(e){return t._priv_onManifestReady(j,e)})),I.addEventListener("loaded",(function(e){j.segmentBuffersStore=e.segmentBuffersStore})),I.addEventListener("addedSegment",(function(e){var n=e.content,r=e.segmentData;if("image"===n.adaptation.type&&!(0,h.Z)(r)&&"bif"===r.type){var i=r.data;j.thumbnails=i,t.trigger("imageTrackUpdate",{data:j.thumbnails})}})),I.prepare(),this.stop();var q=new z(R,{withMediaSource:!Z,lowLatencyMode:c});x.signal.register((function(){q.stop()}));var Y=function(e,t,n,r){var i=new w.Z("LOADING",r);e.addEventListener("loaded",(function(){if("LOADING"===i.getValue()){if(i.setValue("LOADED"),!r.isCancelled()){var e=oe(t,null);"PAUSED"!==e&&i.setValue(e)}}else i.setValueIfChanged(oe(t,null))}),r),e.addEventListener("reloadingMediaSource",(function(){se(i.getValue())&&i.setValueIfChanged("RELOADING")}),r);var a=null;return e.addEventListener("stalled",(function(e){e!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,e)),a=e)}),r),e.addEventListener("unstalled",(function(){null!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,null)),a=null)}),r),n.listen((function(e){se(i.getValue())&&(0,_.Z)(["seeking","ended","play","pause"],e.event)&&i.setValueIfChanged(oe(t,a))}),{clearSignal:r}),i}(I,R,q,x.signal);x.signal.register((function(){I.dispose()}));var X=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":t._priv_reloadingMetadata.reloadInPause=!0,t._priv_reloadingMetadata.reloadPosition=q.getReference().getValue().position;break;default:var n=q.getReference().getValue();t._priv_reloadingMetadata.reloadInPause=n.paused,t._priv_reloadingMetadata.reloadPosition=n.position}},Q=null,$=function(e){null!==Q&&(Q.cancel(),Q=null),Y.onUpdate((function(n,r){var i,a,o,s;se(n)&&(r(),null!==Q&&Q.cancel(),(Q=new A.ZP).linkToSignal(x.signal),e!==!R.paused&&(R.paused?t.trigger("pause",null):t.trigger("play",null)),i=R,a=function(){return t.trigger("play",null)},o=function(){return t.trigger("pause",null)},(s=x.signal).isCancelled()||null===i||(i.addEventListener("play",a),i.addEventListener("pause",o),s.register((function(){i.removeEventListener("play",a),i.removeEventListener("pause",o)}))))}),{emitCurrentValue:!1,clearSignal:x.signal})};$(n),I.addEventListener("reloadingMediaSource",(function(e){$(e.autoPlay)}));var J=null;Y.onUpdate((function(e){X(e),t._priv_setPlayerState(e),x.isUsed()||(null!==J?se(t.state)||(J.cancel(),J=null):se(t.state)&&((J=new A.ZP).linkToSignal(x.signal),function(e,t,n,r,i){if(!i.isCancelled()&&null!==e){var a=t.getReference().getValue().seeking;a&&(n(),i.isCancelled())||t.listen((function(e){"seeking"===e.event?(a=!0,n()):a&&"seeked"===e.event&&(a=!1,r())}),{includeLastObservation:!0,clearSignal:i})}}(R,q,(function(){return t.trigger("seeking",null)}),(function(){return t.trigger("seeked",null)}),J.signal)),"ENDED"===t.state&&t._priv_stopAtEnd&&t.stop())}),{emitCurrentValue:!0,clearSignal:x.signal}),q.listen((function(e){X(t.state),t._priv_triggerPositionUpdate(j,e)}),{clearSignal:x.signal}),this._priv_currentError=null,this._priv_contentInfos=j,x.signal.register((function(){I.removeEventListener()})),this._priv_contentLock.onUpdate((function(e,t){e||(t(),I.start(R,q))}),{emitCurrentValue:!0,clearSignal:x.signal})},i.getError=function(){return this._priv_currentError},i.getManifest=function(){return(0,I.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},i.getCurrentAdaptations=function(){if((0,I.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,h.Z)(n[t.id])?null:n[t.id]},i.getCurrentRepresentations=function(){return(0,I.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},i.getVideoElement=function(){return this.videoElement},i.getNativeTextTrack=function(){if((0,I.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},i.getPlayerState=function(){return this.state},i.isContentLoaded=function(){return!(0,_.Z)(["LOADING","RELOADING","STOPPED"],this.state)},i.isBuffering=function(){return(0,_.Z)(["BUFFERING","SEEKING","LOADING","RELOADING"],this.state)},i.isPaused=function(){return!this.videoElement||((0,_.Z)(["LOADING","RELOADING"],this.state)?!this._priv_lastAutoPlay:this.videoElement.paused)},i.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},i.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},i.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.originalUrl;return t?r:null!==n?n.getUrl():void 0}},i.updateContentUrls=function(e,t){if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=!0===(null==t?void 0:t.refresh);this._priv_contentInfos.initializer.updateContentUrls(e,n)},i.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},i.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.L7)(e.buffered,e.currentTime)},i.getVideoLoadedTime=function(){if((0,I.Z)("`getVideoLoadedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.at)(e.buffered,e.currentTime)},i.getVideoPlayedTime=function(){if((0,I.Z)("`getVideoPlayedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.DD)(e.buffered,e.currentTime)},i.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=a(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},i.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},i.getLastStoredContentPosition=function(){return this._priv_reloadingMetadata.reloadPosition},i.getPlaybackRate=function(){return this._priv_speed.getValue()},i.setPlaybackRate=function(e,t){var n;e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var r=null==t?void 0:t.preferTrickModeTracks;if("boolean"==typeof r){this._priv_preferTrickModeTracks=r;var i=null===(n=this._priv_contentInfos)||void 0===n?void 0:n.trackChoiceManager;(0,h.Z)(i)||(r&&!i.isTrickModeEnabled()?i.enableVideoTrickModeTracks():!r&&i.isTrickModeEnabled()&&i.disableVideoTrickModeTracks())}},i.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,h.Z)(r.video)?[]:r.video.getAvailableBitrates()},i.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,h.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},i.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},i.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},i.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.Z)(e.video))return e.video.bitrate},i.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.Z)(e.audio))return e.audio.bitrate},i.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},i.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},i.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},i.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},i.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,h.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new v.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},i.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},i.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,o=r.manifest;if(!i&&null===o)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var s=e,u=this.videoElement.currentTime;if((0,h.Z)(s.relative))if((0,h.Z)(s.position)){if((0,h.Z)(s.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==o)n=s.wallClockTime-(null!==(t=o.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var d=a(this.videoElement);void 0!==d&&(n=s.wallClockTime-d)}void 0===n&&(n=s.wallClockTime)}else n=s.position;else n=u+s.relative}if(void 0===n)throw new Error("invalid time given");return l.Z.info("API: API Seek to",n),this.videoElement.currentTime=n,n},i.isFullscreen=function(){return(0,I.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),s()},i.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,I.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(!s()){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):o()},i.exitFullscreen=function(){(0,I.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),o()},i.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},i.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))},i.isMute=function(){return 0===this.getVolume()},i.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},i.unMute=function(){var e=c.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},i.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},i.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},i.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)},i.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)},i.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)},i.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)},i.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},i.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},i.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},i.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},i.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},i.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},i.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},i.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},i.getCurrentKeySystem=function(){if((0,I.Z)("`getCurrentKeySystem` is deprecated.Please use the `getKeySystemConfiguration` method instead."),null===this.videoElement)throw new Error("Disposed player");return(0,N.M)(this.videoElement)},i.getKeySystemConfiguration=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=(0,N.Z)(this.videoElement);return null===e?null:{keySystem:e[0],configuration:e[1]}},i.getAvailableAudioTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableAudioTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableAudioTracks(n)},i.getAvailableTextTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableTextTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableTextTracks(n)},i.getAvailableVideoTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableVideoTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableVideoTracks(n)},i.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenAudioTrack()}if(null!==r&&null!==t)return r.getChosenAudioTrack(t)}},i.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenTextTrack()}if(null!==r&&null!==t)return r.getChosenTextTrack(t)}},i.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenVideoTrack()}if(null!==r&&null!==t)return r.getChosenVideoTrack(t)}},i.setAudioTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setAudioTrackByID(n,e)}catch(e){throw new Error("player: unknown audio track")}},i.setTextTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setTextTrackByID(n,e)}catch(e){throw new Error("player: unknown text track")}},i.disableTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n)null==i||i.disableTextTrack();else if(null!==r&&null!==t)return r.disableTextTrack(t)}},i.setVideoTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setVideoTrackByID(n,e)}catch(e){throw new Error("player: unknown video track")}},i.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n&&null!==i)return i.disableVideoTrack();if(null!==r&&null!==t)return r.disableVideoTrack(t)}},i.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},i.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},i.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t):null==n||n.trackChoiceManager.setPreferredAudioTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredTextTracks(e,t):null==n||n.trackChoiceManager.setPreferredTextTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t):null==n||n.trackChoiceManager.setPreferredVideoTracks(e,t)},i.getImageTrackData=function(){return(0,I.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},i.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},i.getLivePosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?void 0:!0!==(null==n?void 0:n.isLive)?null:n.getLivePosition()},i.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},i.__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.synchronizeInventory(!0),t.value.getInventory()):null},i._priv_cleanUpCurrentContentState=function(){var e,t,n=this;l.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),null===(t=null===(e=this._priv_contentInfos)||void 0===e?void 0:e.mediaElementTrackChoiceManager)||void 0===t||t.dispose(),this._priv_contentInfos=null,this._priv_contentEventsMemory={};var r=function(){null!==n.videoElement&&(l.Z.debug("Unlocking `contentLock`. Next content can begin."),n._priv_contentLock.setValue(!1))};(0,h.Z)(this.videoElement)?r():O(this.videoElement).then((function(){l.Z.debug("API: DRM session cleaned-up with success!"),r()}),(function(e){l.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),r()}))},i._priv_onManifestReady=function(e,t){var n,r=this;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.manifest=t;var i=e.currentContentCanceller.signal;this._priv_reloadingMetadata.manifest=t;var a=e.initialAudioTrack,o=e.initialTextTrack;e.trackChoiceManager=new Q({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===a?this._priv_preferredAudioTracks:[a];e.trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===o?this._priv_preferredTextTracks:[o];e.trackChoiceManager.setPreferredTextTracks(u,!0),e.trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),t.addEventListener("manifestUpdate",(function(t){var n,a,o;null!==e.trackChoiceManager&&e.trackChoiceManager.update();var s=null!==(a=null===(n=r._priv_contentInfos)||void 0===n?void 0:n.currentPeriod)&&void 0!==a?a:void 0,u=null===(o=r._priv_contentInfos)||void 0===o?void 0:o.trackChoiceManager;if(void 0!==s&&!(0,h.Z)(u))for(var l,d=ue(t.updatedPeriods);!(l=d()).done;){var c=l.value;if(c.period.id===s.id&&(c.result.addedAdaptations.length>0||c.result.removedAdaptations.length>0)){var f=u.getAvailableAudioTracks(s);r._priv_triggerEventIfNotStopped("availableAudioTracksChange",null!=f?f:[],i);var v=u.getAvailableTextTracks(s);r._priv_triggerEventIfNotStopped("availableTextTracksChange",null!=v?v:[],i);var p=u.getAvailableVideoTracks(s);r._priv_triggerEventIfNotStopped("availableVideoTracksChange",null!=p?p:[],i)}return}}),e.currentContentCanceller.signal)}},i._priv_onActivePeriodChanged=function(e,t){var n,r,i,a,o,s,u,l,d=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.currentPeriod=d;var c=e.currentContentCanceller.signal;this._priv_contentEventsMemory.periodChange!==d&&(this._priv_contentEventsMemory.periodChange=d,this._priv_triggerEventIfNotStopped("periodChange",d,c)),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",this.getAvailableAudioTracks(),c),this._priv_triggerEventIfNotStopped("availableTextTracksChange",this.getAvailableTextTracks(),c),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",this.getAvailableVideoTracks(),c);var f=null===(r=this._priv_contentInfos)||void 0===r?void 0:r.trackChoiceManager;if((0,h.Z)(f))this._priv_triggerEventIfNotStopped("audioTrackChange",null,c),this._priv_triggerEventIfNotStopped("textTrackChange",null,c),this._priv_triggerEventIfNotStopped("videoTrackChange",null,c);else{var v=f.getChosenAudioTrack(d);this._priv_triggerEventIfNotStopped("audioTrackChange",v,c);var p=f.getChosenTextTrack(d);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);var m=f.getChosenVideoTrack(d);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c)}if(this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates(),c),!e.currentContentCanceller.isUsed()&&(this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates(),c),!e.currentContentCanceller.isUsed())){var g=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.audio)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;if(this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",g,c),!e.currentContentCanceller.isUsed()){var y=null!==(l=null===(u=null===(s=this._priv_getCurrentRepresentations())||void 0===s?void 0:s.video)||void 0===u?void 0:u.bitrate)&&void 0!==l?l:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",y,c)}}}},i._priv_onPeriodStreamReady=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=t.adaptationRef,o=e.trackChoiceManager;switch(r){case"video":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new video period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialVideoTrack(i));break;case"audio":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialAudioTrack(i));break;case"text":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialTextTrack(i));break;default:var s=i.adaptations[r];!(0,h.Z)(s)&&s.length>0?a.setValue(s[0]):a.setValue(null)}}},i._priv_onPeriodStreamCleared=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=e.trackChoiceManager;switch(r){case"audio":case"text":case"video":(0,h.Z)(a)||a.removePeriod(r,i)}var o=e.activeAdaptations,s=e.activeRepresentations;if(!(0,h.Z)(o)&&!(0,h.Z)(o[i.id])){var u=o[i.id];delete u[r],0===Object.keys(u).length&&delete o[i.id]}if(!(0,h.Z)(s)&&!(0,h.Z)(s[i.id])){var l=s[i.id];delete l[r],0===Object.keys(l).length&&delete s[i.id]}}},i._priv_onAdaptationChange=function(e,t){var n,r=t.type,i=t.adaptation,a=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeAdaptations&&(e.activeAdaptations={});var o,s=e.activeAdaptations,u=e.currentPeriod,l=s[a.id];if((0,h.Z)(l))s[a.id]=((o={})[r]=i,o);else l[r]=i;var d=e.trackChoiceManager,c=e.currentContentCanceller.signal;if(null!==d&&null!==u&&!(0,h.Z)(a)&&a.id===u.id)switch(r){case"audio":var f=d.getChosenAudioTrack(u);this._priv_triggerEventIfNotStopped("audioTrackChange",f,c);var v=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",v,c);break;case"text":var p=d.getChosenTextTrack(u);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);break;case"video":var m=d.getChosenVideoTrack(u);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c);var g=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",g,c)}}},i._priv_onRepresentationChange=function(e,t){var n,r,i=t.type,a=t.period,o=t.representation;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeRepresentations&&(e.activeRepresentations={});var s,u=e.activeRepresentations,l=e.currentPeriod,d=u[a.id];if((0,h.Z)(d))u[a.id]=((s={})[i]=o,s);else d[i]=o;var c=null!==(r=null==o?void 0:o.bitrate)&&void 0!==r?r:-1;if(!(0,h.Z)(a)&&null!==l&&l.id===a.id){var f=this._priv_contentInfos.currentContentCanceller.signal;"video"===i?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c,f):"audio"===i&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c,f)}}},i._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})},i._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},i._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,l.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},i._priv_triggerPositionUpdate=function(e,t){var n,r;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var i=e.isDirectFile,o=e.manifest;if((i||null!==o)&&!(0,h.Z)(t)){var s=null!==o?o.getMaximumSafePosition():void 0,u={position:t.position,duration:t.duration,playbackRate:t.playbackRate,maximumBufferTime:s,bufferGap:void 0!==t.bufferGap&&isFinite(t.bufferGap)?t.bufferGap:0};if(null!==o&&o.isLive&&t.position>0){var l=null!==(r=o.availabilityStartTime)&&void 0!==r?r:0;u.wallClockTime=t.position+l;var d=o.getLivePosition();void 0!==d&&(u.liveGap=d-t.position)}else if(i&&null!==this.videoElement){var c=a(this.videoElement);void 0!==c&&(u.wallClockTime=c+t.position)}this.trigger("positionUpdate",u)}}},i._priv_triggerAvailableBitratesChangeEvent=function(e,t,n){var r=this._priv_contentEventsMemory[e];n.isCancelled()||void 0!==r&&(0,y.Z)(t,r)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._priv_triggerCurrentBitrateChangeEvent=function(e,t,n){n.isCancelled()||t===this._priv_contentEventsMemory[e]||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._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,h.Z)(n[t.id])?null:n[t.id]},i._priv_triggerEventIfNotStopped=function(e,t,n){n.isCancelled()||this.trigger(e,t)},i._priv_initializeMediaElementTrackChoiceManager=function(e,t,n){var r,i,a,o=this;(0,b.Z)(null!==g.Z.directfile,"Initializing `MediaElementTrackChoiceManager` without Directfile feature"),(0,b.Z)(null!==this.videoElement,"Initializing `MediaElementTrackChoiceManager` on a disposed RxPlayer");var s=new g.Z.directfile.mediaElementTrackChoiceManager(this.videoElement),u=void 0===e?this._priv_preferredAudioTracks:[e];s.setPreferredAudioTracks(u,!0);var l=void 0===t?this._priv_preferredTextTracks:[t];return s.setPreferredTextTracks(l,!0),s.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",s.getAvailableAudioTracks(),n),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",s.getAvailableVideoTracks(),n),this._priv_triggerEventIfNotStopped("availableTextTracksChange",s.getAvailableTextTracks(),n),this._priv_triggerEventIfNotStopped("audioTrackChange",null!==(r=s.getChosenAudioTrack())&&void 0!==r?r:null,n),this._priv_triggerEventIfNotStopped("textTrackChange",null!==(i=s.getChosenTextTrack())&&void 0!==i?i:null,n),this._priv_triggerEventIfNotStopped("videoTrackChange",null!==(a=s.getChosenVideoTrack())&&void 0!==a?a:null,n),s.addEventListener("availableVideoTracksChange",(function(e){return o.trigger("availableVideoTracksChange",e)})),s.addEventListener("availableAudioTracksChange",(function(e){return o.trigger("availableAudioTracksChange",e)})),s.addEventListener("availableTextTracksChange",(function(e){return o.trigger("availableTextTracksChange",e)})),s.addEventListener("audioTrackChange",(function(e){return o.trigger("audioTrackChange",e)})),s.addEventListener("videoTrackChange",(function(e){return o.trigger("videoTrackChange",e)})),s.addEventListener("textTrackChange",(function(e){return o.trigger("textTrackChange",e)})),s},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return p.ZB}},{key:"ErrorCodes",get:function(){return p.SM}},{key:"LogLevel",get:function(){return l.Z.getLevel()},set:function(e){l.Z.setLevel(e)}}]),r}(S.Z);ye.version="3.33.0";var _e=ye;!function(){m.Z.mediaSourceInit=n(7117).Z,m.Z.decrypt=n(3380).ZP,m.Z.imageBuffer=n(7127).Z,m.Z.imageParser=n(3203).Z,m.Z.transports.smooth=n(2339).Z,m.Z.transports.dash=n(85).Z,m.Z.dashParsers.js=n(1707).Z,m.Z.nativeTextTracksBuffer=n(9059).Z,m.Z.nativeTextTracksParsers.vtt=n(9405).Z,m.Z.nativeTextTracksParsers.ttml=n(1570).Z,m.Z.nativeTextTracksParsers.sami=n(1812).Z,m.Z.nativeTextTracksParsers.srt=n(8057).Z,m.Z.htmlTextTracksBuffer=n(5192).Z,m.Z.htmlTextTracksParsers.sami=n(5734).Z,m.Z.htmlTextTracksParsers.ttml=n(7439).Z,m.Z.htmlTextTracksParsers.srt=n(8675).Z,m.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(9372).Z,t=n(6796).Z;m.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&l.Z.setLevel("DEBUG");var be=_e}(),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,{$u:function(){return h},GQ:function(){return y},SB:function(){return f},YM:function(){return l},fq:function(){return u},kD:function(){return s},lV:function(){return g},l_:function(){return m},op:function(){return v},vS:function(){return c},vU:function(){return d},yS:function(){return p}});var r,i,a,o=n(2203),s=!1,u=!1,l=!1,d=!1,c=!1,f=!1,v=!1,p=!1,h=!1,m=!1,g=!1,y=!1;o.Z||(void 0!==window.MSInputMethodContext&&void 0!==document.documentMode?(u=!0,l=!0):"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/(Trident|Edge)\//.test(navigator.userAgent)?l=!0:-1!==navigator.userAgent.toLowerCase().indexOf("edg/")?s=!0:-1!==navigator.userAgent.toLowerCase().indexOf("firefox")?d=!0:"string"==typeof navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)?f=!0:(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())||/Safari\/(\d+)/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&-1!==(null===(a=navigator.vendor)||void 0===a?void 0:a.indexOf("Apple"))&&!/Chrome\/(\d+)/.test(navigator.userAgent)&&!/Chromium\/(\d+)/.test(navigator.userAgent))&&(c=!0),/SamsungBrowser/.test(navigator.userAgent)&&(v=!0),-1!==navigator.userAgent.indexOf("PlayStation 5")?g=!0:/Tizen/.test(navigator.userAgent)?p=!0:/[Ww]eb[O0]S/.test(navigator.userAgent)?(h=!0,/[Ww]eb[O0]S.TV-2022/.test(navigator.userAgent)||/[Cc]hr[o0]me\/87/.test(navigator.userAgent)||(/[Ww]eb[O0]S.TV-2021/.test(navigator.userAgent)||/[Cc]hr[o0]me\/79/.test(navigator.userAgent))):/[Pp]anasonic/.test(navigator.userAgent)?m=!0:-1!==navigator.userAgent.indexOf("Xbox")&&(y=!0))},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")}},3038:function(e,t,n){"use strict";n.d(t,{Dl:function(){return x},M4:function(){return P},N8:function(){return k},O0:function(){return y},Q$:function(){return M},Q4:function(){return S},RV:function(){return I},S1:function(){return f},XR:function(){return p},bQ:function(){return C},it:function(){return g},k6:function(){return E},kJ:function(){return b},kk:function(){return Z},qo:function(){return R},u_:function(){return T},w0:function(){return m},x6:function(){return A},y4:function(){return w},zU:function(){return _}});var r=n(6872),i=n(6923),a=n(1946),o=n(8894),s=n(5095),u=n(2203),l=["","webkit","moz","ms"],d=u.Z||null==window.devicePixelRatio||0===window.devicePixelRatio?1:window.devicePixelRatio;function c(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 f(e,t){var n,r=function(e,t){return e.reduce((function(e,n){return e.concat((void 0===t?l:t).map((function(e){return e+n})))}),[])}(e,t);return function(e,t,a){if(!a.isCancelled()){if(e instanceof HTMLElement){if(void 0===n&&(n=c(e,r)),!(0,i.Z)(n))return void 0;e.addEventListener(n,t),a.register((function(){void 0!==n&&e.removeEventListener(n,t)}))}r.forEach((function(n){var r=!1;"function"==typeof e.addEventListener?e.addEventListener(n,t):(r=!0,e["on"+n]=t),a.register((function(){"function"==typeof e.removeEventListener&&e.removeEventListener(n,t),r&&delete e["on"+n]}))}))}}}function v(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,i.Z)(t)?t+"Hidden":"hidden",a=(0,i.Z)(t)?t+"visibilitychange":"visibilitychange",o=document[r],u=new s.Z(!o,e);return D(document,a,(function(){var e=!document[r];u.setValueIfChanged(e)}),e),u}function p(e){var t,n=v(e),i=new s.Z(!0,e);return e.register((function(){clearTimeout(t),t=void 0})),n.onUpdate((function(e){if(clearTimeout(t),t=void 0,!e){var n=r.Z.getCurrent().INACTIVITY_DELAY;t=window.setTimeout((function(){i.setValueIfChanged(!1)}),n)}i.setValueIfChanged(!0)}),{clearSignal:e,emitCurrentValue:!0}),i}function h(e,t){var n=t.width,r=t.height/(e.clientHeight/e.clientWidth);return Math.min(n,r)}function m(e,t){var n=e;if(!0===n.webkitSupportsPresentationMode&&"function"==typeof n.webkitSetPresentationMode){var r="picture-in-picture"===n.webkitPresentationMode,i=new s.Z({isEnabled:r,pipWindow:null},t);return D(n,"webkitpresentationmodechanged",(function(){var e="picture-in-picture"===n.webkitPresentationMode;i.setValue({isEnabled:e,pipWindow:null})}),t),i}var a=document.pictureInPictureElement===n,o=new s.Z({isEnabled:a,pipWindow:null},t);return D(n,"enterpictureinpicture",(function(e){var t;o.setValue({isEnabled:!0,pipWindow:null!==(t=e.pictureInPictureWindow)&&void 0!==t?t:null})}),t),D(n,"leavepictureinpicture",(function(){o.setValue({isEnabled:!1,pipWindow:null})}),t),o}function g(e,t){var n,i=v(t),a=new s.Z(!0,t);return t.register((function(){clearTimeout(n),n=void 0})),i.onUpdate(o,{clearSignal:t}),e.onUpdate(o,{clearSignal:t}),o(),a;function o(){if(clearTimeout(n),n=void 0,e.getValue().isEnabled||i.getValue())a.setValueIfChanged(!0);else{var t=r.Z.getCurrent().INACTIVITY_DELAY;n=window.setTimeout((function(){a.setValueIfChanged(!1)}),t)}}}function y(e,t,n){var r=new s.Z(e.clientWidth*d,n),i=o.Z;t.onUpdate(l,{clearSignal:n}),D(window,"resize",l,n);var u=window.setInterval(l,2e4);return l(),n.register((function(){i(),clearInterval(u)})),r;function l(){i();var n=t.getValue();if(n.isEnabled)if((0,a.Z)(n.pipWindow))r.setValueIfChanged(1/0);else{var s=n.pipWindow,u=h(e,s),l=function(){r.setValueIfChanged(h(e,s)*d)};s.addEventListener("resize",l),i=function(){s.removeEventListener("resize",l),i=o.Z},r.setValueIfChanged(u*d)}else r.setValueIfChanged(e.clientWidth*d)}}f(["loadedmetadata"]),f(["timeupdate"]);var _=f(["fullscreenchange","FullscreenChange"],l.concat("MS")),b=f(["addtrack"]),S=f(["removetrack"]),T=f(["sourceopen","webkitsourceopen"]),E=f(["sourceclose","webkitsourceclose"]),k=f(["sourceended","webkitsourceended"]),w=f(["update"]),A=f(["removesourcebuffer"]),I=f(["keymessage","message"]),Z=f(["keyadded","ready"]),x=f(["keyerror","error"]),R=f(["keystatuseschange"]),M=f(["seeking"]),C=f(["seeked"]),P=f(["ended"]);function D(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)}},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},MINIMUM_MAX_BUFFER_AHEAD:{text:120},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_ENTER_BUFFER_BASED_ALGO:10,ABR_EXIT_BUFFER_BASED_ALGO:5,ABR_MINIMUM_TOTAL_BYTES:15e4,ABR_MINIMUM_CHUNK_SIZE:16e3,ABR_STARVATION_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},ABR_REGULAR_FACTOR:{DEFAULT:.72,LOW_LATENCY:.72},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_VIDEO_CODECS:['video/mp4;codecs="avc1.4d401e"','video/mp4;codecs="avc1.42e01e"','video/webm;codecs="vp8"'],EME_DEFAULT_AUDIO_CODECS:['audio/mp4;codecs="mp4a.40.2"',"audio/webm;codecs=opus"],EME_DEFAULT_WIDEVINE_ROBUSTNESSES:["HW_SECURE_ALL","HW_SECURE_DECODE","HW_SECURE_CRYPTO","SW_SECURE_DECODE","SW_SECURE_CRYPTO"],EME_DEFAULT_PLAYREADY_ROBUSTNESSES:["3000","2000"],EME_KEY_SYSTEMS:{clearkey:["webkit-org.w3.clearkey","org.w3.clearkey"],widevine:["com.widevine.alpha"],playready:["com.microsoft.playready.recommendation","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 d;(0,i.Z)(e,((d={})[u]=s[u],d))}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 c}});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 d={language:a.language,id:l,normalized:(0,o.ZP)(a.language),audioDescription:"descriptions"===a.kind||"description"===a.kind,representations:[]};n.push({track:d,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 d="forced"===a.kind||void 0,c={language:a.language,forced:d,label:a.label,id:l,normalized:(0,o.ZP)(a.language),closedCaption:"captions"===a.kind};n.push({track:c,nativeTrack:a})}return n}function d(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 c=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?d(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,label:t.label,forced:t.forced,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=d(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=d(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}}},245:function(e,t,n){"use strict";n.d(t,{M:function(){return a},Z:function(){return i}});var r=n(770);function i(e){var t=r.Z.getState(e);return null===t?null:[t.mediaKeySystemAccess.keySystem,t.mediaKeySystemAccess.getConfiguration()]}function a(e){var t=r.Z.getState(e);return null==t?null:t.keySystemOptions.type}},3380:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Zt}});var r,i=n(5861),a=n(4578),o=n(4687),s=n.n(o),u=n(3714),l=n(811),d=n(1946),c=n(3666),f=n(3038),v=n(2203);if(!v.Z){var p=window.WebKitMediaKeys;void 0!==p&&"function"==typeof p.isTypeSupported&&"function"==typeof p.prototype.createSession&&"function"==typeof HTMLMediaElement.prototype.webkitSetMediaKeys&&(r=p)}var h,m=n(1656),g=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,m.Z)(e,[{key:"keySystem",get:function(){return this._keyType}}]),e}();if(!v.Z){var y=window.MSMediaKeys;void 0!==y&&void 0!==y.prototype&&"function"==typeof y.isTypeSupported&&"function"==typeof y.prototype.createSession&&(h=y)}var _=n(1959),b=n(288);function S(e){try{var t=e();return"object"==typeof t&&null!==t&&"function"==typeof t.then?t:Promise.resolve(t)}catch(e){return Promise.reject(e)}}var T,E=function(e){function t(t){var n;return(n=e.call(this)||this).expiration=NaN,n.keyStatuses=new Map,n._mk=t,n._sessionClosingCanceller=new b.ZP,n.closed=new Promise((function(e){n._sessionClosingCanceller.signal.register((function(){return 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,a.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),f.RV(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"message",e)}),n._sessionClosingCanceller.signal),f.kk(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyadded",e)}),n._sessionClosingCanceller.signal),f.Dl(n._ss,(function(e){var t;n.trigger(null!==(t=e.type)&&void 0!==t?t:"keyerror",e)}),n._sessionClosingCanceller.signal),e()}))},n.close=function(){var e=this;return new Promise((function(t){null!=e._ss&&(e._ss.close(),e._ss=void 0),e._sessionClosingCanceller.cancel(),t()}))},n.load=function(){return Promise.resolve(!1)},n.remove=function(){return Promise.resolve()},(0,m.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}(_.Z),k=function(){function e(e){if(void 0===h)throw new Error("No MSMediaKeys API.");this._mediaKeys=new h(e)}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){t._videoElement=e,void 0!==t._videoElement.msSetMediaKeys&&t._videoElement.msSetMediaKeys(t._mediaKeys)}))},t.createSession=function(){if(void 0===this._videoElement||void 0===this._mediaKeys)throw new Error("Video not attached to the MediaKeys");return new E(this._mediaKeys)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();if(!v.Z){var w=window.MozMediaKeys;void 0!==w&&void 0!==w.prototype&&"function"==typeof w.isTypeSupported&&"function"==typeof w.prototype.createSession&&(T=w)}var A=n(9689),I=n(8894),Z=n(3635);function x(e){return"function"==typeof e.webkitGenerateKeyRequest}var R=function(e){function t(t,n){var r;(r=e.call(this)||this)._vid=t,r._key=n,r.sessionId="",r._closeSession=I.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,a.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,Z.uR)(i)),o=(0,A.K)(a.keys[0].k),s=(0,A.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}(_.Z),M=function(){function e(e){this._keySystem=e}var t=e.prototype;return t._setVideo=function(e){var t=this;return S((function(){if(!x(e))throw new Error("Video not attached to the MediaKeys");t._videoElement=e}))},t.createSession=function(){if(null==this._videoElement)throw new Error("Video not attached to the MediaKeys");return new R(this._videoElement,this._keySystem)},t.setServerCertificate=function(){throw new Error("Server certificate is not implemented in your browser")},e}();var C=n(9252),P=n(6968);function D(e,t){var n=e;return S((function(){if(void 0===n.webkitSetMediaKeys)throw new Error("No webKitMediaKeys API.");n.webkitSetMediaKeys(t)}))}var N=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=I.Z,i._closeSession=I.Z,i.closed=new Promise((function(e){i._closeSession=e})),i.keyStatuses=new Map,i.expiration=NaN,i}(0,a.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(a=n._keyType,(0,C.Z)(a,"com.apple.fps")){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,P.dN)(n,0)+4!==n.length)throw new Error("Unsupported WebKit initData.");var i=(0,Z.wV)(n),a=i.indexOf("skd://"),o=a>-1?i.substring(a+6):i,s=(0,Z.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,P.O_)(s.byteLength),u),u+=4,l.set(s,u),u+=s.byteLength,l.set((0,P.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,m.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}(_.Z),O=function(){function e(e){if(void 0===r)throw new Error("No WebKitMediaKeys API.");this._keyType=e,this._mediaKeys=new r(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 D(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 N(this._videoElement,this._keyType,this._serverCertificate)},t.setServerCertificate=function(e){return this._serverCertificate=e,Promise.resolve()},e}();function L(){if(void 0===r)throw new Error("No WebKitMediaKeys API.");return{isTypeSupported:r.isTypeSupported,createCustomMediaKeys:function(e){return new O(e)},setMediaKeys:function(e,t){if(null===t)return D(e,t);if(!(t instanceof O))throw new Error("Custom setMediaKeys is supposed to be called with webkit custom MediaKeys.");return t._setVideo(e)}}}var U=function(e){var t,n,i,a=B;if("standard"!==e&&("auto"!==e||(c.vS||c.SB)&&void 0!==r)||!v.Z&&(0,d.Z)(navigator.requestMediaKeySystemAccess)){var o,s;if("webkit"===e&&void 0!==r){n=(0,f.S1)(["needkey"]);var p=L();o=p.isTypeSupported,s=p.createCustomMediaKeys,a=p.setMediaKeys,i="webkit"}else if(x(HTMLVideoElement.prototype)){n=(0,f.S1)(["needkey"]);var m={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 M(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof M))throw new Error("Custom setMediaKeys is supposed to be called with old webkit custom MediaKeys.");return t._setVideo(e)}};o=m.isTypeSupported,s=m.createCustomMediaKeys,a=m.setMediaKeys,i="older-webkit"}else if(void 0!==r){n=(0,f.S1)(["needkey"]);var y=L();o=y.isTypeSupported,s=y.createCustomMediaKeys,a=y.setMediaKeys,i="webkit"}else if(c.fq&&void 0!==h){n=(0,f.S1)(["encrypted","needkey"]);var _={isTypeSupported:function(e,t){if(void 0===h)throw new Error("No MSMediaKeys API.");return void 0!==t?h.isTypeSupported(e,t):h.isTypeSupported(e)},createCustomMediaKeys:function(e){return new k(e)},setMediaKeys:function(e,t){if(null===t)return Promise.resolve(void 0);if(!(t instanceof k))throw new Error("Custom setMediaKeys is supposed to be called with IE11 custom MediaKeys.");return t._setVideo(e)}};o=_.isTypeSupported,s=_.createCustomMediaKeys,a=_.setMediaKeys,i="ms"}else if(void 0!==T){n=(0,f.S1)(["encrypted","needkey"]);var b={isTypeSupported:function(e,t){if(void 0===T)throw new Error("No MozMediaKeys API.");return void 0!==t?T.isTypeSupported(e,t):T.isTypeSupported(e)},createCustomMediaKeys:function(e){if(void 0===T)throw new Error("No MozMediaKeys API.");return new T(e)},setMediaKeys:function(e,t){return S((function(){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)}))}};o=b.isTypeSupported,s=b.createCustomMediaKeys,a=b.setMediaKeys,i="moz"}else{n=(0,f.S1)(["encrypted","needkey"]);var E=window.MediaKeys,w=function(){if(void 0===E)throw new u.Z("MEDIA_KEYS_NOT_SUPPORTED","No `MediaKeys` implementation found in the current browser.");if(void 0===E.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.")}};o=function(e){return w(),(0,l.Z)("function"==typeof E.isTypeSupported),E.isTypeSupported(e)},s=function(e){return w(),new E(e)},i="unknown"}t=function(e,t){if(!o(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,u=r.initDataTypes,l=r.distinctiveIdentifier,d=!0;if(d=(d=d&&(null==u||u.some((function(e){return"cenc"===e}))))&&"required"!==l){var c={initDataTypes:["cenc"],distinctiveIdentifier:"not-allowed",persistentState:"required",sessionTypes:["temporary","persistent-license"]};void 0!==i&&(c.videoCapabilities=i),void 0!==a&&(c.audioCapabilities=a);var f=s(e);return Promise.resolve(new g(e,f,c))}}return Promise.reject(new Error("Unsupported configuration"))}}else t=function(){var e;return(e=navigator).requestMediaKeySystemAccess.apply(e,arguments)},n=(0,f.S1)(["encrypted"]),i="standard";return{requestMediaKeySystemAccess:t,onEncrypted:n,setMediaKeys:a,implementation:i}}("auto");function B(e,t){try{var n,r=e;return"function"==typeof r.setMediaKeys?n=r.setMediaKeys(t):"function"==typeof r.webkitSetMediaKeys?n=r.webkitSetMediaKeys(t):"function"==typeof r.mozSetMediaKeys?n=r.mozSetMediaKeys(t):"function"==typeof r.msSetMediaKeys&&null!==t&&(n=r.msSetMediaKeys(t)),"object"==typeof n&&null!==n&&"function"==typeof n.then?n:Promise.resolve(n)}catch(e){return Promise.reject(e)}}var F=U,V=n(3887),z=n(6490),K=n(4791),G=(0,P.pX)((0,Z.tG)("pssh"),0);function W(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,K.Z)(t.data,r.data))return!0}return!1}function H(e){var t=e.initData,n=e.initDataType;if(null==t)return V.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,P.pX)(e,n+4)!==G)return V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var r=(0,P.pX)(new Uint8Array(e),n);if(n+r>e.length)return V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}];var i=e.subarray(n,n+r),a={systemId:(0,z.Y)(i,8),data:i};W(t,a)?V.Z.warn("Compat: Duplicated PSSH found in initialization data, removing it."):t.push(a),n+=r}return n!==e.length?(V.Z.warn("Compat: Unrecognized initialization data. Use as is."),[{systemId:void 0,data:e}]):t}(new Uint8Array(t));return{type:n,values:r}}var j=n(6872),q=n(5157),Y=n(5389),X=n(3274),Q=n(7714),$=n(770);function J(e){return $.Z.setState(e,null),F.setMediaKeys(e,null).then((function(){V.Z.info("DRM: MediaKeys disabled with success")})).catch((function(e){V.Z.error("DRM: Could not disable MediaKeys",e instanceof Error?e:"Unknown Error")}))}function ee(){return(ee=(0,i.Z)(s().mark((function e(t,n,r){var i,a,o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.emeImplementation,a=n.keySystemOptions,o=n.loadedSessionsStore,u=n.mediaKeySystemAccess,l=n.mediaKeys,d=$.Z.getState(t),c=null!==d&&d.loadedSessionsStore!==o?d.loadedSessionsStore.closeAllSessions():Promise.resolve(),e.next=5,c;case 5:if(!r.isCancelled()){e.next=7;break}throw r.cancellationError;case 7:if($.Z.setState(t,{emeImplementation:i,keySystemOptions:a,mediaKeySystemAccess:u,mediaKeys:l,loadedSessionsStore:o}),t.mediaKeys!==l){e.next=10;break}return e.abrupt("return");case 10:V.Z.info("DRM: Attaching MediaKeys to the media element"),i.setMediaKeys(t,l).then((function(){V.Z.info("DRM: MediaKeys attached with success")})).catch((function(e){V.Z.error("DRM: Could not set MediaKeys",e instanceof Error?e:"Unknown Error")}));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e){if(""===e.sessionId)return!1;var t=e.keyStatuses,n=[];return t.forEach((function(e){n.push(e)})),n.length<=0?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has an empty keyStatuses",e.sessionId),!1):(0,Q.Z)(n,"expired")?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has an expired key",e.sessionId),!1):(0,Q.Z)(n,"internal-error")?(V.Z.debug("DRM: isSessionUsable: MediaKeySession given has a key with an internal-error",e.sessionId),!1):(V.Z.debug("DRM: isSessionUsable: MediaKeySession is usable",e.sessionId),!0)}function ne(e,t,n,r){var i=e.loadedSessionsStore,a=e.persistentSessionsStore;return"temporary"===n?re(i,t):null===a?(V.Z.warn("DRM: Cannot create persistent MediaKeySession, PersistentSessionsStore not created."),re(i,t)):function(e,t,n,r){return ie.apply(this,arguments)}(i,a,t,r)}function re(e,t){V.Z.info("DRM: Creating a new temporary session");var n=e.createSession(t,"temporary");return Promise.resolve({type:"created-session",value:n})}function ie(){return ie=(0,i.Z)(s().mark((function e(t,n,r,a){var o,u,l,d,c,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=function(){return f=(0,i.Z)(s().mark((function e(){var i,u;return s().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 V.Z.info("DRM: Removing previous persistent session."),null!==(i=n.get(r))&&n.delete(i.sessionId),e.prev=5,e.next=8,t.closeSession(o.mediaKeySession);case 8:e.next=15;break;case 10:if(e.prev=10,e.t0=e.catch(5),""===o.mediaKeySession.sessionId){e.next=14;break}throw e.t0;case 14:t.removeSessionWithoutClosingIt(o.mediaKeySession);case 15:if(null===a.cancellationError){e.next=17;break}throw a.cancellationError;case 17:return u=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:u});case 19:case"end":return e.stop()}}),e,null,[[5,10]])}))),f.apply(this,arguments)},c=function(){return f.apply(this,arguments)},null===a.cancellationError){e.next=4;break}throw a.cancellationError;case 4:if(V.Z.info("DRM: Creating persistent MediaKeySession"),o=t.createSession(r,"persistent-license"),null!==(u=n.getAndReuse(r))){e.next=9;break}return e.abrupt("return",{type:"created-session",value:o});case 9:return e.prev=9,e.next=12,t.loadPersistentSession(o.mediaKeySession,u.sessionId);case 12:if(l=e.sent){e.next=19;break}return V.Z.warn("DRM: No data stored for the loaded session"),n.delete(u.sessionId),t.removeSessionWithoutClosingIt(o.mediaKeySession),d=t.createSession(r,"persistent-license"),e.abrupt("return",{type:"created-session",value:d});case 19:if(!l||!te(o.mediaKeySession)){e.next=23;break}return n.add(r,r.keyIds,o.mediaKeySession),V.Z.info("DRM: Succeeded to load persistent session."),e.abrupt("return",{type:"loaded-persistent-session",value:o});case 23:return V.Z.warn("DRM: Previous persistent session not usable anymore."),e.abrupt("return",c());case 27:return e.prev=27,e.t0=e.catch(9),V.Z.warn("DRM: Unable to load persistent session: "+(e.t0 instanceof Error?e.t0.toString():"Unknown Error")),e.abrupt("return",c());case 31:case"end":return e.stop()}}),e,null,[[9,27]])}))),ie.apply(this,arguments)}function ae(e,t){return oe.apply(this,arguments)}function oe(){return(oe=(0,i.Z)(s().mark((function e(t,n){var r,i,a,o,u;return s().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(V.Z.info("DRM: LSS cache limit exceeded",n,t.getLength()),r=[],i=t.getAll().slice(),a=i.length-n,o=0;o<a;o++)u=i[o],r.push(t.closeSession(u.mediaKeySession));return e.next=9,Promise.all(r);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e,t,n,r,i){return ue.apply(this,arguments)}function ue(){return(ue=(0,i.Z)(s().mark((function e(t,n,r,i,a){var o,u,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,u=n.loadedSessionsStore,l=n.persistentSessionsStore,null===(d=u.reuse(t))){e.next=11;break}if(!te(o=d.mediaKeySession)){e.next=10;break}return V.Z.info("DRM: Reuse loaded session",o.sessionId),e.abrupt("return",{type:"loaded-open-session",value:{mediaKeySession:o,sessionType:d.sessionType,keySessionRecord:d.keySessionRecord}});case 10:null!==l&&""!==d.mediaKeySession.sessionId&&l.delete(d.mediaKeySession.sessionId);case 11:if(null===o){e.next=16;break}return e.next=14,u.closeSession(o);case 14:if(null===a.cancellationError){e.next=16;break}throw a.cancellationError;case 16:return e.next=18,ae(u,i);case 18:if(null===a.cancellationError){e.next=20;break}throw a.cancellationError;case 20:return e.next=22,ne(n,t,r,a);case 22:return c=e.sent,e.abrupt("return",{type:c.type,value:{mediaKeySession:c.value.mediaKeySession,sessionType:c.value.sessionType,keySessionRecord:c.value.keySessionRecord}});case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var le=n(9592);function de(e,t,n){var r=t.getConfiguration();if(c.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 ce(e,t,n){var r=["temporary"],i="optional",a="optional";!0===n.persistentLicense&&(i="required",r.push("persistent-license")),!0===n.persistentStateRequired&&(i="required"),!0===n.distinctiveIdentifierRequired&&(a="required");var o,s,u=j.Z.getCurrent(),l=u.EME_DEFAULT_AUDIO_CODECS,c=u.EME_DEFAULT_VIDEO_CODECS,f=u.EME_DEFAULT_WIDEVINE_ROBUSTNESSES,v=u.EME_DEFAULT_PLAYREADY_ROBUSTNESSES;o=(0,d.Z)(n.videoRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.videoRobustnesses,s=(0,d.Z)(n.audioRobustnesses)?"widevine"===e?f:"com.microsoft.playready.recommendation"===t?v:[]:n.audioRobustnesses,0===o.length&&o.push(void 0),0===s.length&&s.push(void 0);var p={initDataTypes:["cenc"],videoCapabilities:(0,le.Z)(o,(function(e){return c.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),audioCapabilities:(0,le.Z)(s,(function(e){return l.map((function(t){return void 0===e?{contentType:t}:{contentType:t,robustness:e}}))})),distinctiveIdentifier:a,persistentState:i,sessionTypes:r};return[p,Object.assign(Object.assign({},p),{audioCapabilities:void 0,videoCapabilities:void 0})]}function fe(e,t,n){V.Z.info("DRM: Searching for compatible MediaKeySystemAccess");var r=$.Z.getState(e);if(null!==r&&F.implementation===r.emeImplementation.implementation){var a=de(t,r.mediaKeySystemAccess,r.keySystemOptions);if(null!==a)return V.Z.info("DRM: Found cached compatible keySystem"),Promise.resolve({type:"reuse-media-key-system-access",value:{mediaKeySystemAccess:a.keySystemAccess,options:a.keySystemOptions}})}var o=t.reduce((function(e,t){var n,r=j.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=j.Z.getCurrent().EME_KEY_SYSTEMS,n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if((0,Q.Z)(t[i],e))return i}}(t.type);n=[{keyName:i,keyType:t.type,keySystemOptions:t}]}return e.concat(n)}),[]);return u(0);function u(e){return l.apply(this,arguments)}function l(){return(l=(0,i.Z)(s().mark((function e(t){var r,i,a,l,d,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t>=o.length)){e.next=2;break}throw new q.Z("INCOMPATIBLE_KEYSYSTEMS","No key system compatible with your wanted configuration has been found in the current browser.");case 2:if(null!=F.requestMediaKeySystemAccess){e.next=4;break}throw new Error("requestMediaKeySystemAccess is not implemented in your browser.");case 4:return r=o[t],i=r.keyName,a=r.keyType,l=r.keySystemOptions,d=ce(i,a,l),V.Z.debug("DRM: Request keysystem access "+a+","+(t+1)+" of "+o.length),e.prev=7,e.next=10,F.requestMediaKeySystemAccess(a,d);case 10:return c=e.sent,V.Z.info("DRM: Found compatible keysystem",a,t+1),e.abrupt("return",{type:"create-media-key-system-access",value:{options:l,mediaKeySystemAccess:c}});case 15:if(e.prev=15,e.t0=e.catch(7),V.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",u(t+1));case 21:case"end":return e.stop()}}),e,null,[[7,15]])})))).apply(this,arguments)}}var ve=n(2297);function pe(e,t,n){var r;V.Z.debug("Compat: Calling generateRequest on the MediaKeySession");try{r=function(e){V.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,P.pX)(e,i+4)!==G)throw V.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");var a=(0,P.pX)(new Uint8Array(e),i);if(i+a>e.length)throw V.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,ve.Xj)(o),u=null===s?void 0:o[s[1]];V.Z.info("Compat: CENC PSSH found with version",u),void 0===u?V.Z.warn("Compat: could not read version of CENC PSSH"):t===(1===u)?n=(0,P.zo)(n,o):1===u?(V.Z.warn("Compat: cenc version 1 encountered, removing every other cenc pssh box."),n=o,t=!0):V.Z.warn("Compat: filtering out cenc pssh box with wrong version",u)}else r=(0,P.zo)(r,o);i+=a}if(i!==e.length)throw V.Z.warn("Compat: unrecognized initialization data. Cannot patch it."),new Error("Compat: unrecognized initialization data. Cannot patch it.");return(0,P.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 V.Z.warn('Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value.',t),e.generateRequest("cenc",r)}))}var he=100;function me(e,t){return ge.apply(this,arguments)}function ge(){return(ge=(0,i.Z)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.info("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,he);function i(){clearTimeout(n),t.removeEventListener("keystatuseschange",i),e(r)}})));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=n(7864);function _e(e){var t=new b.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,i.Z)(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,ye.Z)(1e3,t.signal);case 3:return e.next=5,r();case 5:e.next=13;break;case 7:if(e.prev=7,e.t0=e.catch(0),!(e.t0 instanceof b.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",V.Z.error("DRM: "+n);case 13:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function r(){return a.apply(this,arguments)}function a(){return(a=(0,i.Z)(s().mark((function n(){return s().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,ye.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)}}function be(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}function Te(e,t){for(var n,r,i=function(){var e=r.value;if(!t.some((function(t){return(0,K.Z)(t,e)})))return{v:!1}},a=be(e);!(r=a()).done;)if(n=i())return n.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 ke(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 ke(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 ke(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 we=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;){var r=t.value;if((0,K.Z)(r,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&&Te(t,this._keyIds))return!0;if(void 0!==this._initializationData.keyIds)return Te(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?Te(e.keyIds,this._initializationData.keyIds):this._initializationData.type===e.type&&this._initializationData.values.isCompatibleWith(e.values)},e}();function Ae(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 Ze=function(){function e(e){this._mediaKeys=e,this._storage=[]}var t=e.prototype;return t.createSession=function(e,t){var n=this,r=new we(e);V.Z.debug("DRM-LSS: calling `createSession`",t);var i=this._mediaKeys.createSession(t),a={mediaKeySession:i,sessionType:t,keySessionRecord:r,isGeneratingRequest:!1,isLoadingPersistentSession:!1,closingStatus:{type:"none"}};return(0,d.Z)(i.closed)||i.closed.then((function(){V.Z.info("DRM-LSS: session was closed, removing it.",i.sessionId);var e=n.getIndex(r);e>=0&&n._storage[e].mediaKeySession===i&&n._storage.splice(e,1)})).catch((function(e){V.Z.warn("DRM-LSS: MediaKeySession.closed rejected: "+e)})),this._storage.push(Object.assign({},a)),V.Z.debug("DRM-LSS: MediaKeySession added",a.sessionType,this._storage.length),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),V.Z.debug("DRM-LSS: Reusing session:",n.mediaKeySession.sessionId,n.sessionType),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,i.Z)(s().mark((function e(t,n,r){var i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=Ae(this._storage);case 1:if((o=a()).done){e.next=8;break}if((u=o.value).mediaKeySession!==t){e.next=6;break}return i=u,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==i){e.next=11;break}return V.Z.error("DRM-LSS: generateRequest error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",pe(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,pe(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,i.Z)(s().mark((function e(t,n){var r,i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=Ae(this._storage);case 1:if((a=i()).done){e.next=8;break}if((o=a.value).mediaKeySession!==t){e.next=6;break}return r=o,e.abrupt("break",8);case 6:e.next=1;break;case 8:if(void 0!==r){e.next=11;break}return V.Z.error("DRM-LSS: loadPersistentSession error. No MediaKeySession found with the given initData and initDataType"),e.abrupt("return",me(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,me(t,n);case 17:u=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",u);case 29:return r.isLoadingPersistentSession=!1,"awaiting"===r.closingStatus.type&&r.closingStatus.start(),e.abrupt("return",u);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,i.Z)(s().mark((function e(t){var n,r,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Ae(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 V.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,i.Z)(s().mark((function e(){var t,n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._storage,V.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,l.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 V.Z.debug("DRM-LSS: Removing session without closing it",e.sessionId),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,i.Z)(s().mark((function e(t){var n;return s().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"}),xe(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 xe(e){return Re.apply(this,arguments)}function Re(){return(Re=(0,i.Z)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.debug("DRM: Trying to close a MediaKeySession",t.sessionId),e.prev=1,e.next=4,_e(t);case 4:return V.Z.debug("DRM: Succeeded to close MediaKeySession"),e.abrupt("return");case 8:return e.prev=8,e.t0=e.catch(1),V.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)}function Me(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e[n],t&=t;return t}var Ce=n(6923),Pe=function(){function e(e){this.initData=e}return e.prototype.toJSON=function(){return(0,A.J)(this.initData)},e.decode=function(e){return(0,A.K)(e)},e}();function De(e,t){var n,r;return null!==(r=null!==(n=Ne(e,t))&&void 0!==n?n:Ne(t,e))&&void 0!==r&&r}function Ne(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?Pe.decode(n.data):n.data.initData,s=a.data instanceof Uint8Array?a.data:"string"==typeof a.data?Pe.decode(a.data):a.data.initData;if(!(0,K.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?Pe.decode(u.data):u.data.initData,c=l.data instanceof Uint8Array?l.data:"string"==typeof l.data?Pe.decode(l.data):l.data.initData;if(!(0,K.Z)(d,c))return!1;break}}if(r===t.length)return null}return!0}}return null}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 Le(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 Le(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 Le(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=function(){function e(e){!function(e){(0,l.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){V.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,d.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;V.Z.info("DRM-PSS: Updating session info.",i),this._entries.splice(a,1)}else V.Z.info("DRM-PSS: Add new session",i);var u=e.values.getFormattedValues().map((function(e){var t=e.systemId,n=e.data;return{systemId:t,hash:e.hash,data:new Pe(n)}}));void 0===t?this._entries.push({version:3,sessionId:i,values:u,initDataType:e.type}):this._entries.push({version:4,sessionId:i,keyIds:t.map((function(e){return new Pe(e)})),values:u,initDataType:e.type}),this._save()}else V.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];V.Z.warn("DRM-PSS: Delete session from store",r.sessionId),this._entries.splice(t,1),this._save()}else V.Z.warn("DRM-PSS: initData to delete not found.")},t.deleteOldSessions=function(e){V.Z.info("DRM-PSS: Deleting last "+e+" sessions."),e<=0||(e<=this._entries.length?this._entries.splice(0,e):(V.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:Me(t)}}return n}for(var i,a=function(){var n=t._entries[o];if(n.initDataType===e.type)switch(n.version){case 4:if(void 0!==e.keyIds){if(e.keyIds.every((function(e){for(var t,r=(0,A.J)(e),i=Oe(n.keyIds);!(t=i()).done;){var a=t.value;if("string"==typeof a){if(r===a)return!0}else if((0,K.Z)(a.initData,e))return!0}return!1})))return{v:o}}else if(De(e.values.getFormattedValues(),n.values))return{v:o};break;case 3:if(De(e.values.getFormattedValues(),n.values))return{v:o};break;case 2:var i=r(),a=i.initData,s=i.initDataHash;if(n.initDataHash===s)try{var u="string"==typeof n.initData?Pe.decode(n.initData):n.initData.initData;if((0,K.Z)(u,a))return{v:o}}catch(e){V.Z.warn("DRM-PSS: Could not decode initialization data.",e instanceof Error?e:"")}break;case 1:var l=r(),d=l.initData,c=l.initDataHash;if(n.initDataHash===c){if(void 0===n.initData.length)return{v:o};if((0,K.Z)(n.initData,d))return{v:o}}break;default:var f=r().initDataHash;if(n.initData===f)return{v:o}}},o=0;o<this._entries.length;o++)if(i=a())return i.v;return-1},t._save=function(){try{this._storage.save(this._entries)}catch(e){V.Z.warn("DRM-PSS: Could not save licenses in localStorage")}},e}();var Be=new WeakMap,Fe={prepare:function(e){Be.set(e,null)},set:function(e,t){var n=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:t.buffer),r=Me(n);Be.set(e,{hash:r,serverCertificate:n})},hasOne:function(e){var t=Be.get(e);return void 0!==t&&(null!==t||void 0)},has:function(e,t){var n=Be.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(Me(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 Ve(e){if(!0!==e.persistentLicense)return null;var t=e.licenseStorage;if(null==t)throw new q.Z("INVALID_KEY_SYSTEM","No license storage found for persistent license.");return V.Z.debug("DRM: Set the given license storage"),new Ue(t)}function ze(e,t,n){return Ke.apply(this,arguments)}function Ke(){return(Ke=(0,i.Z)(s().mark((function e(t,n,r){var i,a,o,u,l,f,v,p,h,m;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(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,o=a.options,u=a.mediaKeySystemAccess,l=$.Z.getState(t),f=Ve(o),c.$u||c.l_||null===l||"reuse-media-key-system-access"!==i.type){e.next=12;break}if(v=l.mediaKeys,p=l.loadedSessionsStore,!1!==Fe.hasOne(v)&&((0,d.Z)(o.serverCertificate)||!Fe.has(v,o.serverCertificate))){e.next=12;break}return e.abrupt("return",{mediaKeys:v,mediaKeySystemAccess:u,stores:{loadedSessionsStore:p,persistentSessionsStore:f},options:o});case 12:return e.next=14,Ge(u);case 14:return h=e.sent,V.Z.info("DRM: MediaKeys created with success"),m=new Ze(h),e.abrupt("return",{mediaKeys:h,mediaKeySystemAccess:u,stores:{loadedSessionsStore:m,persistentSessionsStore:f},options:o});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(e){return We.apply(this,arguments)}function We(){return(We=(0,i.Z)(s().mark((function e(t){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.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 q.Z("CREATE_MEDIA_KEYS_ERROR",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function He(){return(He=(0,i.Z)(s().mark((function e(t,n,r){var i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ze(t,n,r);case 2:if(i=e.sent,a=i.mediaKeys,!(null!==t.mediaKeys&&void 0!==t.mediaKeys&&a!==t.mediaKeys)){e.next=13;break}if(V.Z.debug("DRM: Disabling old MediaKeys"),!c.$u){e.next=12;break}return e.next=10,J(t);case 10:e.next=13;break;case 12:J(t).catch(I.Z);case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var je=n(7326),qe=n(2146),Ye=n(2572),Xe=n(5440);function Qe(e,t,n){var r=e*Math.pow(2,t-1),i=(0,Ye.Z)(r);return Math.min(i,n)}var $e=n(7904),Je=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(r),t.prototype),r.reason=n,r}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),et={EXPIRED:"expired",INTERNAL_ERROR:"internal-error",OUTPUT_RESTRICTED:"output-restricted"};function tt(e,t,n){var r,i=t.fallbackOn,a=void 0===i?{}:i,o=t.throwOnLicenseExpiration,s=t.onKeyExpiration,u=[],l=[],d=[];return e.keyStatuses.forEach((function(e,t){var r="string"==typeof e?[e,t]:[t,e],i=r[0],f=function(e,t){return-1!==e.indexOf("playready")&&(c.YM||c.kD)?(0,Z.wO)(t):t}(n,new Uint8Array(r[1])),v={keyId:f.buffer,keyStatus:i};switch(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: key status update ("+(0,Z.ci)(f)+"): "+i),i){case et.EXPIRED:var p=new q.Z("KEY_STATUS_CHANGE_ERROR","A decryption key expired ("+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});if("error"===s||void 0===s&&!1===o)throw p;switch(s){case"close-session":throw new Je(p);case"fallback":u.push(f);break;default:"continue"===s||void 0===s?l.push(f):(0,$e.Z)(s)}d.push(v);break;case et.INTERNAL_ERROR:if(!0!==a.keyInternalError)throw new q.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;case et.OUTPUT_RESTRICTED:if(!0!==a.keyOutputRestricted)throw new q.Z("KEY_STATUS_CHANGE_ERROR",'A "'+i+'" status has been encountered ('+(0,Z.ci)(f)+")",{keyStatuses:[v].concat(d)});d.push(v),u.push(f);break;default:l.push(f)}})),d.length>0&&(r=new q.Z("KEY_STATUS_CHANGE_ERROR","One or several problematic key statuses have been encountered",{keyStatuses:d})),{warning:r,blacklistedKeyIds:u,whitelistedKeyIds:l}}var nt=f.Dl,rt=f.RV,it=f.qo;function at(e,t,n,r,a){V.Z.info("DRM: Binding session events",e.sessionId);var o=t.getLicenseConfig,u=void 0===o?{}:o,l=new b.ZP;return l.linkToSignal(a),(0,d.Z)(e.closed)||e.closed.then((function(){return l.cancel()})).catch((function(e){a.isCancelled()||(l.cancel(),r.onError(e))})),nt(e,(function(e){l.cancel(),r.onError(new q.Z("KEY_ERROR",e.type))}),l.signal),it(e,(function(e){(function(e){return c.apply(this,arguments)})(e).catch((function(e){a.isCancelled()||l.isUsed()&&e instanceof b.XG||(l.cancel(),r.onError(e))}))}),l.signal),rt(e,(function(n){var a,o=n,c=new Uint8Array(o.message),f=(0,Ce.Z)(o.messageType)?o.messageType:"license-request";V.Z.info("DRM: Received message event, type "+f,e.sessionId),function(e,t,n){var r=t.baseDelay,a=t.maxDelay,o=t.totalRetry,u=t.shouldRetry,l=t.onRetry,c=0;return f();function f(){return v.apply(this,arguments)}function v(){return(v=(0,i.Z)(s().mark((function t(){var i,v,p;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===n.cancellationError){t.next=2;break}throw n.cancellationError;case 2:return t.prev=2,t.next=5,e();case 5:return i=t.sent,t.abrupt("return",i);case 9:if(t.prev=9,t.t0=t.catch(2),null===n.cancellationError){t.next=13;break}throw n.cancellationError;case 13:if(!(!(0,d.Z)(u)&&!u(t.t0)||c++>=o)){t.next=15;break}throw t.t0;case 15:return"function"==typeof l&&l(t.t0,c),v=Qe(r,c,a),t.next=19,(0,Xe.Z)(v);case 19:return p=f(),t.abrupt("return",p);case 21:case"end":return t.stop()}}),t,null,[[2,9]])})))).apply(this,arguments)}}((function(){return function(e,n){var r;return new Promise((function(i,a){try{V.Z.debug("DRM: Calling `getLicense`",n);var o=t.getLicense(e,n),s=(0,d.Z)(u.timeout)?1e4:u.timeout;s>=0&&(r=setTimeout((function(){a(new dt('"getLicense" timeout exceeded ('+s+" ms)"))}),s)),Promise.resolve(o).then(l,c)}catch(e){c(e)}function l(e){void 0!==r&&clearTimeout(r),i(e)}function c(e){void 0!==r&&clearTimeout(r),a(e)}}))}(c,f)}),{totalRetry:null!=(a=u.retry)?a:2,baseDelay:200,maxDelay:3e3,shouldRetry:function(e){return e instanceof dt||(0,d.Z)(e)||!0!==e.noRetry},onRetry:function(e){return r.onWarning(ot(e))}},l.signal).then((function(t){if(l.isUsed())return Promise.resolve();if((0,d.Z)(t))V.Z.info("DRM: No license given, skipping session.update");else try{return st(e,t)}catch(e){l.cancel(),r.onError(e)}})).catch((function(e){if(!l.isUsed()){l.cancel();var t=ot(e);if(!(0,d.Z)(e))if(!0===e.fallbackOnLastTry)return V.Z.warn("DRM: Last `getLicense` attempt failed. Blacklisting the current session."),void r.onError(new lt(t));r.onError(t)}}))}),l.signal),void f();function c(){return c=(0,i.Z)(s().mark((function n(r){var o,u;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=function(){return(u=(0,i.Z)(s().mark((function n(){var i,o;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!l.isUsed()){n.next=2;break}return n.abrupt("return");case 2:if("function"!=typeof t.onKeyStatusesChange){n.next=24;break}return n.prev=3,n.next=6,t.onKeyStatusesChange(r,e);case 6:if(i=n.sent,!l.isUsed()){n.next=9;break}return n.abrupt("return");case 9:n.next=18;break;case 11:if(n.prev=11,n.t0=n.catch(3),!a.isCancelled()){n.next=15;break}return n.abrupt("return");case 15:throw o=new q.Z("KEY_STATUS_CHANGE_ERROR","Unknown `onKeyStatusesChange` error"),!(0,d.Z)(n.t0)&&(0,Ce.Z)(n.t0.message)&&(o.message=n.t0.message),o;case 18:if(!(0,d.Z)(i)){n.next=22;break}V.Z.info("DRM: No license given, skipping session.update"),n.next=24;break;case 22:return n.next=24,st(e,i);case 24:case"end":return n.stop()}}),n,null,[[3,11]])})))).apply(this,arguments)},o=function(){return u.apply(this,arguments)},V.Z.info("DRM: keystatuseschange event received",e.sessionId),n.next=5,Promise.all([o(),Promise.resolve(f())]);case 5:case"end":return n.stop()}}),n)}))),c.apply(this,arguments)}function f(){if(!l.isUsed()&&0!==e.keyStatuses.size){var i=tt(e,t,n),a=i.warning,o=i.blacklistedKeyIds,s=i.whitelistedKeyIds;void 0!==a&&(r.onWarning(a),l.isUsed())||r.onKeyUpdate({whitelistedKeyIds:s,blacklistedKeyIds:o})}}}function ot(e){if(e instanceof dt)return new q.Z("KEY_LOAD_TIMEOUT","The license server took too much time to respond.");var t=new q.Z("KEY_LOAD_ERROR","An error occured when calling `getLicense`.");return!(0,d.Z)(e)&&(0,Ce.Z)(e.message)&&(t.message=e.message),t}function st(e,t){return ut.apply(this,arguments)}function ut(){return(ut=(0,i.Z)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V.Z.info("DRM: Updating MediaKeySession with message"),e.prev=1,e.next=4,t.update(n);case 4:e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(1),r=e.t0 instanceof Error?e.t0.toString():"`session.update` failed",new q.Z("KEY_UPDATE_ERROR",r);case 10:V.Z.info("DRM: MediaKeySession update succeeded.");case 11:case"end":return e.stop()}}),e,null,[[1,6]])})))).apply(this,arguments)}var lt=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(r),t.prototype),r.sessionError=n,r}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),dt=function(e){function t(t){var n;return n=e.call(this)||this,Object.setPrototypeOf((0,je.Z)(n),lt.prototype),n.message=t,n}return(0,a.Z)(t,e),t}((0,qe.Z)(Error)),ct=n(9822);function ft(e,t){return vt.apply(this,arguments)}function vt(){return(vt=(0,i.Z)(s().mark((function e(t,n){var r,i;return s().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),V.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 q.Z("LICENSE_SERVER_CERTIFICATE_ERROR",i);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function pt(e,t){return ht.apply(this,arguments)}function ht(){return(ht=(0,i.Z)(s().mark((function e(t,n){var r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!0!==Fe.hasOne(t)){e.next=3;break}return V.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 V.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 V.Z.info("DRM: Setting server certificate on the MediaKeys"),Fe.prepare(t),e.prev=8,e.next=11,ft(t,n);case 11:return r=e.sent,Fe.set(t,n),e.abrupt("return",{type:"success",value:r});case 16:return e.prev=16,e.t0=e.catch(8),i=(0,ct.Z)(e.t0)?e.t0:new q.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)}var mt=n(4339);function gt(e,t){if(!(isNaN(t)||t<0||t>=e.getLength())){var n=e.getLength(),r=n-t;V.Z.info("DRM: Too many stored persistent sessions, removing some.",n,r),e.deleteOldSessions(r)}}var yt=function(){function e(e){this._innerValues=e,this._lazyFormattedValues=null}var t=e.prototype;return t.constructRequestData=function(){return P.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 De(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:Me(n)}}))),this._lazyFormattedValues},e}();function _t(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 bt(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 bt(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 bt(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 St=function(e){function t(t,n){var r;r=e.call(this)||this,V.Z.debug("DRM: Starting ContentDecryptor logic.");var i=new b.ZP;return r._currentSessions=[],r._canceller=i,r._initDataQueue=[],r._stateData={state:mt.u.Initializing,isMediaKeysAttached:0,isInitDataQueueLocked:!0,data:null},r.error=null,F.onEncrypted(t,(function(e){V.Z.debug("DRM: Encrypted event received from media element.");var t=H(e);null!==t&&r.onInitializationData(t)}),i.signal),function(e,t,n){return He.apply(this,arguments)}(t,n,i.signal).then((function(e){var n,i,a=e.options,o=e.mediaKeySystemAccess;((0,d.Z)(a.licenseStorage)||!0===a.licenseStorage.disableRetroCompatibility)&&(i=o.keySystem,n=(0,C.Z)(i,"com.microsoft.playready")||"com.chromecast.playready"===i||"com.youtube.playready"===i?"9a04f07998404286ab92e65be0885f95":"com.widevine.alpha"===i?"edef8ba979d64acea3c827dcd51d21ed":(0,C.Z)(i,"com.apple.fps")?"94ce86fb07ff4f43adb893d2fa968ca2":(0,C.Z)(i,"com.nagra.")?"adb41c242dbf4a6d958b4457c0d27b95":void 0),r.systemId=n,r._stateData.state===mt.u.Initializing&&(r._stateData={state:mt.u.WaitingForAttachment,isInitDataQueueLocked:!0,isMediaKeysAttached:0,data:{mediaKeysInfo:e,mediaElement:t}},r.trigger("stateChange",r._stateData.state))})).catch((function(e){r._onFatalError(e)})),r}(0,a.Z)(t,e),t.hasEmeApis=function(){return!(0,d.Z)(F.requestMediaKeySystemAccess)};var n=t.prototype;return n.getState=function(){return this._stateData.state},n.attach=function(){var e=this;if(this._stateData.state!==mt.u.WaitingForAttachment)throw new Error("`attach` should only be called when in the WaitingForAttachment state");if(0===this._stateData.isMediaKeysAttached){var t=this._stateData.data,n=t.mediaElement,r=t.mediaKeysInfo,a=r.options,o=r.mediaKeys,u=r.mediaKeySystemAccess,l=r.stores;if(!(!0===a.disableMediaKeysAttachmentLock)||(this._stateData={state:mt.u.ReadyForContent,isInitDataQueueLocked:!0,isMediaKeysAttached:1,data:{mediaKeysInfo:r,mediaElement:n}},this.trigger("stateChange",this._stateData.state),!this._isStopped())){this._stateData.isMediaKeysAttached=1;var c={emeImplementation:F,loadedSessionsStore:l.loadedSessionsStore,mediaKeySystemAccess:u,mediaKeys:o,keySystemOptions:a};V.Z.debug("DRM: Attaching current MediaKeys"),function(e,t,n){return ee.apply(this,arguments)}(n,c,this._canceller.signal).then((0,i.Z)(s().mark((function t(){var n,i,u;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e._stateData.isMediaKeysAttached=2,n=a.serverCertificate,(0,d.Z)(n)){t.next=7;break}return t.next=5,pt(o,n);case 5:"error"===(i=t.sent).type&&e.trigger("warning",i.value);case 7:if(!e._isStopped()){t.next=9;break}return t.abrupt("return");case 9:u=e._stateData.state,e._stateData={state:mt.u.ReadyForContent,isMediaKeysAttached:2,isInitDataQueueLocked:!1,data:{mediaKeysData:r}},u!==mt.u.ReadyForContent&&e.trigger("stateChange",mt.u.ReadyForContent),e._isStopped()||e._processCurrentInitDataQueue();case 13:case"end":return t.stop()}}),t)})))).catch((function(t){e._onFatalError(t)}))}}else V.Z.warn("DRM: ContentDecryptor's `attach` method called more than once.")},n.dispose=function(){this.removeEventListener(),this._stateData={state:mt.u.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 yt(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,i.Z)(s().mark((function e(t,n){var r,i,a,o,u,l,d,c,f,v,p,h,m,g,y,_,b,S,T,E,k,w,A,I,x,R,M,C,P,D,N,O,L,U=this;return s().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===(o=(0,X.Z)(this._currentSessions,(function(e){return"created-session"===e.source})))){e.next=13;break}if(void 0!==(u=t.keyIds)){e.next=10;break}return void 0===t.content?V.Z.warn("DRM: Unable to fallback from a non-decipherable quality."):kt(t.content.manifest,t),e.abrupt("return");case 10:return o.record.associateKeyIds(u),void 0!==t.content&&(V.Z.hasLevel("DEBUG")&&(l=u.reduce((function(e,t){return e+", "+(0,Z.ci)(t)}),""),V.Z.debug("DRM: Blacklisting new key ids",l)),Et(t.content.manifest,[],u,[])),e.abrupt("return");case 13:e.next=42;break;case 15:if("periods"!==a.singleLicensePer||void 0===t.content){e.next=42;break}d=t.content.period,c=this._currentSessions.filter((function(e){return"created-session"===e.source})),It(f=new Set,d),v=_t(c);case 21:if((p=v()).done){e.next=42;break}h=p.value,m=Array.from(f),g=0,y=m;case 25:if(!(g<y.length)){e.next=40;break}if(_=y[g],!h.record.isAssociatedWithKeyId(_)){e.next=37;break}h.record.associateKeyIds(f.values()),b=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=T.value,h.keyStatuses.whitelisted.some((function(e){return(0,K.Z)(e,t)}))||h.keyStatuses.blacklisted.some((function(e){return(0,K.Z)(e,t)}))||h.keyStatuses.blacklisted.push(t);case 2:case"end":return e.stop()}}),e)})),S=_t(m);case 31:if((T=S()).done){e.next=35;break}return e.delegateYield(b(),"t0",33);case 33:e.next=31;break;case 35:return Et(t.content.manifest,h.keyStatuses.whitelisted,h.keyStatuses.blacklisted,[]),e.abrupt("return");case 37:g++,e.next=25;break;case 40:e.next=21;break;case 42:return this._lockInitDataQueue(),!0!==a.persistentLicense?E="temporary":Tt(r)?E="persistent-license":(V.Z.warn('DRM: Cannot create "persistent-license" session: not supported'),E="temporary"),k=j.Z.getCurrent(),w=k.EME_DEFAULT_MAX_SIMULTANEOUS_MEDIA_KEY_SESSIONS,A=k.EME_MAX_STORED_PERSISTENT_SESSION_INFORMATION,I="number"==typeof a.maxSessionCacheSize?a.maxSessionCacheSize:w,e.next=48,se(t,i,E,I,this._canceller.signal);case 48:if(x=e.sent,!this._isStopped()){e.next=51;break}return e.abrupt("return");case 51:if(R={record:x.value.keySessionRecord,source:x.type,keyStatuses:{whitelisted:[],blacklisted:[]},blacklistedSessionError:null},this._currentSessions.push(R),M=x.value,C=M.mediaKeySession,P=M.sessionType,D=!1,at(C,a,r.keySystem,{onKeyUpdate:function(e){var n=wt(t,R.record,a.singleLicensePer,"created-session"===R.source,e.whitelistedKeyIds,e.blacklistedKeyIds);if(R.record.associateKeyIds(n.whitelisted),R.record.associateKeyIds(n.blacklisted),R.keyStatuses={whitelisted:n.whitelisted,blacklisted:n.blacklisted},0!==R.record.getAssociatedKeyIds().length&&"persistent-license"===P&&null!==i.persistentSessionsStore&&!D){var r=i.persistentSessionsStore;gt(r,A-1),r.add(t,R.record.getAssociatedKeyIds(),C),D=!0}void 0!==t.content&&Et(t.content.manifest,n.whitelisted,n.blacklisted,[]),U._unlockInitDataQueue()},onWarning:function(e){U.trigger("warning",e)},onError:function(e){var n;if(e instanceof Je){V.Z.warn("DRM: A session's closing condition has been triggered"),U._lockInitDataQueue();var r=U._currentSessions.indexOf(R);return r>=0&&U._currentSessions.splice(r),void 0!==t.content&&Et(t.content.manifest,[],[],R.record.getAssociatedKeyIds()),null===(n=i.persistentSessionsStore)||void 0===n||n.delete(C.sessionId),i.loadedSessionsStore.closeSession(C).catch((function(e){var t=e instanceof Error?e:"unknown error";V.Z.warn("DRM: failed to close expired session",t)})).then((function(){return U._unlockInitDataQueue()})).catch((function(e){return U._onFatalError(e)})),void(U._isStopped()||U.trigger("warning",e.reason))}if(e instanceof lt){if(R.blacklistedSessionError=e,void 0!==t.content){var a=t.content.manifest;V.Z.info("DRM: blacklisting Representations based on protection data."),kt(a,t)}U._unlockInitDataQueue()}else U._onFatalError(e)}},this._canceller.signal),void 0!==a.singleLicensePer&&"init-data"!==a.singleLicensePer||this._unlockInitDataQueue(),"created-session"!==x.type){e.next=72;break}return N=t.values.constructRequestData(),e.prev=59,e.next=62,i.loadedSessionsStore.generateLicenseRequest(C,t.type,N);case 62:e.next=72;break;case 64:if(e.prev=64,e.t1=e.catch(59),null!==(O=i.loadedSessionsStore.getEntryForSession(C))&&"none"===O.closingStatus.type){e.next=71;break}return(L=this._currentSessions.indexOf(R))>=0&&this._currentSessions.splice(L,1),e.abrupt("return",Promise.resolve());case 71:throw new q.Z("KEY_GENERATE_REQUEST_ERROR",e.t1 instanceof Error?e.t1.toString():"Unknown error");case 72:return e.abrupt("return",Promise.resolve());case 73:case"end":return e.stop()}}),e,this,[[59,64]])})));return function(t,n){return e.apply(this,arguments)}}(),n._tryToUseAlreadyCreatedSession=function(e,t){var n=t.stores,r=t.options,i=(0,X.Z)(this._currentSessions,(function(t){return t.record.isCompatibleWith(e)}));if(void 0===i)return!1;var a=i.blacklistedSessionError;if(!(0,d.Z)(a))return void 0===e.type||void 0===e.content?(V.Z.error("DRM: This initialization data has already been blacklisted but the current content is not known."),!0):(V.Z.info("DRM: This initialization data has already been blacklisted. Blacklisting the related content."),kt(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,i=function(){var e=r.value;if(t.some((function(t){return(0,K.Z)(t,e)})))return{v:!0}},a=be(e);!(r=a()).done;)if(n=i())return n.v;return!1}(e.keyIds,s)}else{var u=i.keyStatuses.whitelisted;o=!Te(e.keyIds,u)}if(o)return void 0===e.content?(V.Z.error("DRM: Cannot forbid key id, the content is unknown."),!0):(V.Z.info("DRM: Current initialization data is linked to blacklisted keys. Marking Representations as not decipherable"),Et(e.content.manifest,[],e.keyIds,[]),!0)}if(null!==n.loadedSessionsStore.reuse(e))return V.Z.debug("DRM: Init data already processed. Skipping it."),!0;var l=this._currentSessions.indexOf(i);return-1===l?V.Z.error("DRM: Unable to remove processed init data: not found."):(V.Z.debug("DRM: A session from a processed init data is not available anymore. Re-processing it."),this._currentSessions.splice(l,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:mt.u.Error,isMediaKeysAttached:void 0,isInitDataQueueLocked:void 0,data:null},this._canceller.cancel(),this.trigger("error",t),this._stateData.state===mt.u.Error&&this.trigger("stateChange",this._stateData.state)}},n._isStopped=function(){return this._stateData.state===mt.u.Disposed||this._stateData.state===mt.u.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(){2===this._stateData.isMediaKeysAttached?(this._stateData.isInitDataQueueLocked=!1,this._processCurrentInitDataQueue()):V.Z.error("DRM: Trying to unlock in the wrong state")},t}(_.Z);function Tt(e){var t=e.getConfiguration().sessionTypes;return void 0!==t&&(0,Q.Z)(t,"persistent-license")}function Et(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=_t(i);!(a=o()).done;){for(var s,u=a.value,l=_t(n);!(s=l()).done;){var d=s.value;if((0,K.Z)(d,u.keyId))return!1}for(var c,f=_t(t);!(c=f()).done;){var v=c.value;if((0,K.Z)(v,u.keyId))return!0}for(var p,h=_t(r);!(p=h()).done;){var m=p.value;if((0,K.Z)(m,u.keyId))return}}return e.decipherable}))}function kt(e,t){e.updateRepresentationsDeciperability((function(e){var n,r;if(!1===e.decipherable)return!1;for(var i,a,o=function(){var e=a.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,K.Z)(e.data,t.data)}))})))return{v:!1}},s=_t(null!==(r=null===(n=e.contentProtections)||void 0===n?void 0:n.initData)&&void 0!==r?r:[]);!(a=s()).done;)if(i=o())return i.v;return e.decipherable}))}function wt(e,t,n,r,i,a){for(var o,s,u=[].concat(i,a),l=function(){var e=s.value;u.some((function(t){return(0,K.Z)(t,e)}))||(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: KeySessionRecord's key missing in the license, blacklisting it",(0,Z.ci)(e)),u.push(e))},d=_t(t.getAssociatedKeyIds());!(s=d()).done;)l();if(void 0!==n&&"init-data"!==n){var c=e.keyIds,f=e.content;if(void 0!==c){var v=c.filter((function(e){return!u.some((function(t){return(0,K.Z)(t,e)}))}));v.length>0&&(V.Z.hasLevel("DEBUG")&&V.Z.debug("DRM: init data keys missing in the license, blacklisting them",v.map((function(e){return(0,Z.ci)(e)})).join(", ")),u.push.apply(u,v))}if(r&&void 0!==f)if("content"===n){for(var p,h=new Set,m=_t(f.manifest.periods);!(p=m()).done;){It(h,p.value)}At(h,u)}else if("periods"===n)for(var g,y=_t(f.manifest.periods);!(g=y()).done;){var _=g.value,b=new Set;if(It(b,_),(null===(o=e.content)||void 0===o?void 0:o.period.id)===_.id)At(b,u);else for(var S=Array.from(b),T=function(){var e=k[E];if(u.some((function(t){return(0,K.Z)(t,e)})))return At(b,u),1},E=0,k=S;E<k.length&&!T();E++);}}return{whitelisted:i,blacklisted:u.slice(i.length)}}function At(e,t){for(var n=Array.from(e.values()),r=function(){var e=a[i];t.some((function(t){return(0,K.Z)(t,e)}))||t.push(e)},i=0,a=n;i<a.length;i++)r()}function It(e,t){for(var n,r=_t(t.getAdaptations());!(n=r()).done;)for(var i,a=_t(n.value.representations);!(i=a()).done;){var o=i.value;if(void 0!==o.contentProtections&&void 0!==o.contentProtections.keyIds)for(var s,u=_t(o.contentProtections.keyIds);!(s=u()).done;){var l=s.value;e.add(l.keyId)}}}var Zt=St},4339:function(e,t,n){"use strict";var r;n.d(t,{u:function(){return r}}),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"}(r||(r={}))},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)}}},9372:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(4578),i=n(5767),a=n(3887),o=n(811),s=n(1946),u=n(5095),l=n(288),d=n(9420),c=n(379),f=n(9016),v=n(7794),p=n(6199),h=n(4576),m=function(e){function t(t){var n;return(n=e.call(this)||this)._settings=t,n._initCanceller=new l.ZP,n}(0,r.Z)(t,e);var n=t.prototype;return n.prepare=function(){},n.start=function(e,t){var n=this,r=this._initCanceller.signal,s=this._settings,l=s.keySystems,d=s.speed,c=s.url;(0,i.Z)(e);var f=new u.Z(null);f.finish();var m=(0,v.Z)(e,l,f,{onError:function(e){return n._onFatalError(e)},onWarning:function(e){return n.trigger("warning",e)}},r);(0,h.Z)(e,(function(e){return n._onFatalError(e)}),r);var g=new p.Z(t,null,d);g.addEventListener("stalled",(function(e){return n.trigger("stalled",e)})),g.addEventListener("unstalled",(function(){return n.trigger("unstalled",null)})),g.addEventListener("warning",(function(e){return n.trigger("warning",e)})),r.register((function(){g.destroy()})),g.start(),m.onUpdate((function(s,u){"uninitialized"!==s.initializationState.type&&(u(),a.Z.info("Setting URL to HTMLMediaElement",c),e.src=c,r.register((function(){a.Z.info("Init: Removing directfile src from media element",e.src),(0,i.Z)(e)})),"awaiting-media-link"===s.initializationState.type?(s.initializationState.value.isMediaLinked.setValue(!0),m.onUpdate((function(r,i){"initialized"===r.initializationState.type&&(i(),n._seekAndPlay(e,t))}),{emitCurrentValue:!0,clearSignal:r})):((0,o.Z)("initialized"===s.initializationState.type),n._seekAndPlay(e,t)))}),{emitCurrentValue:!0,clearSignal:r})},n.updateContentUrls=function(e,t){throw new Error("Cannot update content URL of directfile contents")},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.cancel(),this.trigger("error",e)},n._seekAndPlay=function(e,t){var n=this,r=this._initCanceller.signal,i=this._settings,o=i.autoPlay,u=i.startAt;(0,f.Z)(e,t,(function(){a.Z.debug("Init: Calculating initial time");var t=function(e,t){if((0,s.Z)(t))return 0;if(!(0,s.Z)(t.position))return t.position;if(null!=t.wallClockTime)return t.wallClockTime;if(null!=t.fromFirstPosition)return t.fromFirstPosition;var n=e.duration;if("number"==typeof t.fromLastPosition)return(0,s.Z)(n)||!isFinite(n)?(a.Z.warn("startAt.fromLastPosition set but no known duration, beginning at 0."),0):Math.max(0,n+t.fromLastPosition);if("number"==typeof t.fromLivePosition){var r=e.seekable.length>0?e.seekable.end(0):n;return(0,s.Z)(r)?(a.Z.warn("startAt.fromLivePosition set but no known live position, beginning at 0."),0):Math.max(0,r+t.fromLivePosition)}if(null!=t.percentage){if((0,s.Z)(n)||!isFinite(n))return a.Z.warn("startAt.percentage set but no known duration, beginning at 0."),0;var i=t.percentage;return i>=100?n:i<=0?0:n*(+i/100)}return 0}(e,u);return a.Z.debug("Init: Initial time calculated:",t),t}),o,(function(e){return n.trigger("warning",e)}),!0,r).autoPlayResult.then((function(){return(0,c.Z)(t,e,!0,r).onUpdate((function(e,t){e&&(t(),n.trigger("loaded",{segmentBuffersStore:null}))}),{emitCurrentValue:!0,clearSignal:r})})).catch((function(e){r.isCancelled()||n._onFatalError(e)}))},t}(d.K)},7117:function(e,t,n){"use strict";n.d(t,{Z:function(){return tn}});var r=n(5861),i=n(4578),a=n(4687),o=n.n(a);var s=n(6872),u=n(3714),l=n(3887),d=n(811),c=n(7733),f=n(8026),v=n(5095),p=n(288),h=n(8894),m=n(2829),g=n(5138);function y(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 _=function(){function e(e){this._levelsMap=y(e).map((function(e){return e+4})),this._bitrates=e,this._lastUnsuitableQualityTimestamp=void 0,this._blockRaiseDelay=6e3,l.Z.debug("ABR: Steps for buffer based chooser.",this._levelsMap.map((function(t,n){return"bufferLevel: "+t+", bitrate: "+e[n]})).join(" ,"))}var t=e.prototype;return t.onAddedSegment=function(e){var t=this._levelsMap,n=this._bitrates,r=e.bufferGap,i=e.currentBitrate,a=e.currentScore,o=e.speed;if(null!=i){for(var s,u=-1,d=0;d<n.length;d++){var c=n[d];if(c===i)u=d;else if(c>i)break}if(u<0||n.length!==t.length)return l.Z.error("ABR: Current Bitrate not found in the calculated levels"),void(this._currentEstimate=n[0]);void 0!==a&&(s=0===o?a.score:a.score/o);var f=isFinite(r)?r:0,v=performance.now();if(f<t[u]||void 0!==s&&s<1&&1===(null==a?void 0:a.confidenceLevel)){if((void 0===this._lastUnsuitableQualityTimestamp?-1:v-this._lastUnsuitableQualityTimestamp)<this._blockRaiseDelay+9e3){var p=this._blockRaiseDelay+3e3;this._blockRaiseDelay=Math.min(p,15e3),l.Z.debug("ABR: Incrementing blocking raise in BufferBasedChooser due to unstable quality",this._blockRaiseDelay)}else{var h=this._blockRaiseDelay-1e3;this._blockRaiseDelay=Math.max(6e3,h),l.Z.debug("ABR: Lowering quality in BufferBasedChooser",this._blockRaiseDelay)}this._lastUnsuitableQualityTimestamp=v;for(var m=(0,g.Z)(n,(function(e){return e===i}))-1;m>=0;m--)if(f>=t[m])return void(this._currentEstimate=n[m]);this._currentEstimate=n[0]}else if(void 0!==this._lastUnsuitableQualityTimestamp&&v-this._lastUnsuitableQualityTimestamp<this._blockRaiseDelay||void 0===s||s<1.15||1!==(null==a?void 0:a.confidenceLevel))this._currentEstimate=i;else{var y=t[u],_=function(){for(var e=u+1;e<t.length;e++)if(t[e]>y)return e}();if(void 0!==_)if(r>=t[_])return l.Z.debug("ABR: Raising quality in BufferBasedChooser",n[_]),void(this._currentEstimate=n[_]);this._currentEstimate=i}}else this._currentEstimate=n[0]},t.getLastEstimate=function(){return this._currentEstimate},e}(),b=n(3274),S=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 T(e){if(!(e.progress.length<5)){for(var t=new S(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 E(e,t){var n=8*(e.totalSize-e.size);return Math.max(n/t,0)}var k=function(){function e(e,t){var n=s.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,u=this._config,d=e.bufferGap,c=e.position,f=e.duration,v=isFinite(d)?d:0,p=s.Z.getCurrent().ABR_STARVATION_DURATION_DELTA;return isNaN(f)||v+c.last<f-p?!this._inStarvationMode&&v<=u.starvationGap?(l.Z.info("ABR: enter starvation mode."),this._inStarvationMode=!0):this._inStarvationMode&&v>=u.outOfStarvationGap&&(l.Z.info("ABR: exit starvation mode."),this._inStarvationMode=!1):this._inStarvationMode&&(l.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 d=l[0],c=performance.now(),f=1.5*d.content.segment.duration;if(f=Math.min(f,3e3),f=Math.max(f,12e3),!(c-d.requestTimestamp<f)){var v=d.progress.length>0?d.progress[d.progress.length-1]:void 0,p=T(d);if(void 0!==v&&void 0!==p){var h=E(v,p);if((c-v.timestamp)/1e3<=h&&h-u/o>2500)return p}if(d.content.segment.complete){var m=d.content.segment.duration,g=(c-d.requestTimestamp)/1e3;if(null!=n&&!(g<=(1.5*m+2)/o)){var y=m/g,_=n.bitrate*Math.min(.7,y);return void 0===i||_<i?_:void 0}}}}}}(r,e,n,this._lowLatencyMode,i),null!=o&&(l.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?u.starvationBitrateFactor:u.regularBitrateFactor):null!=i?i*(this._inStarvationMode?u.starvationBitrateFactor:u.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)&&function(e,t,n){if(n)return!0;var r=isFinite(e.bufferGap)?e.bufferGap:0,i=e.position.last+r,a=(0,b.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=T(a);if(void 0===s||void 0===u)return!0;var l=E(s,u);return(o-s.timestamp)/1e3>1.2*l||l-r/e.speed>-1.5}(r,n,this._lowLatencyMode)},e}();function w(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 A(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 A(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 A(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 I=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 d=Z(e,n);if(null!==d)return d}return null}if(this._isLastGuessValidated(s,r,u)&&(l.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,g.Z)(e,(function(e){return e.id===t.id}));if(n<0)return l.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=Z(e,n);if(null!==c)return c}return n},t._canGuessHigher=function(e,t,n){var r=n.score,i=n.confidenceLevel;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.score<1.01)return!0;if((void 0===t||t.score<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=w(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 d=T(u);if(void 0!==d&&d<.8*e.bitrate)return!0}}return!1},t._isLastGuessValidated=function(e,t,n){return void 0!==n&&1===n.confidenceLevel&&n.score>1.5||t>=e.bitrate&&(null===this._lastMaintanableBitrate||this._lastMaintanableBitrate<e.bitrate)},e}();function Z(e,t){var n=e.length,r=(0,g.Z)(e,(function(e){return e.id===t.id}));if(r<0)return l.Z.error("ABR: Current Representation not found."),null;for(;++r<n;)if(e[r].bitrate>t.bitrate)return e[r];return null}var x=function(){function e(){var e=s.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new S(t),this._slowEWMA=new S(n),this._bytesSampled=0}var t=e.prototype;return t.addSample=function(e,t){if(!(t<s.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=s.Z.getCurrent().ABR_MINIMUM_TOTAL_BYTES;if(!(this._bytesSampled<e))return Math.min(this._fastEWMA.getEstimate(),this._slowEWMA.getEstimate())},t.reset=function(){var e=s.Z.getCurrent(),t=e.ABR_FAST_EMA,n=e.ABR_SLOW_EMA;this._fastEWMA=new S(t),this._slowEWMA=new S(n),this._bytesSampled=0},e}();var R=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}(),M=n(1679),C=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):l.Z.warn("ABR: progress for a request not added")},t.remove=function(e){null==this._currentRequests[e]&&l.Z.warn("ABR: can't remove unknown request"),delete this._currentRequests[e]},t.getRequests=function(){return(0,M.Z)(this._currentRequests).filter((function(e){return null!=e})).sort((function(e,t){return e.content.segment.time-t.content.segment.time}))},e}(),P=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 S(5)).addSample(t,i),this._currentRepresentationData={representation:e,ewma:r,loadedDuration:n,loadedSegments:0}),r.getEstimate()>1&&this._lastRepresentationWithGoodScore!==e&&(l.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{score:n.getEstimate(),confidenceLevel:r>=5&&i>=10?1:0}}},t.getLastStableRepresentation=function(){return this._lastRepresentationWithGoodScore},e}();function D(e,t,n,r){var i=t<=n?n:t>=r?r:t,a=(0,g.Z)(e,(function(e){return e.bitrate>i}));return-1===a?e[e.length-1]:0===a?e[0]:e[a-1]}var N=new v.Z(-1);N.finish();var O=new v.Z(0);O.finish();var L=new v.Z(1/0);L.finish();var U=new v.Z(void 0);U.finish();var B=new v.Z(1/0);B.finish();var F=function(e){var t={},n=e.manualBitrates,r=e.minAutoBitrates,i=e.maxAutoBitrates,a=e.initialBitrates,o=e.throttlers,u=e.lowLatencyMode;return function(e,d,c,f,y){var S,T,E,w,A,Z,M,F=e.adaptation.type,V=function(e){var n=t[e];if(null==n){l.Z.debug("ABR: Creating new BandwidthEstimator for ",e);var r=new x;return t[e]=r,r}return n}(F),z=null!==(S=n[F])&&void 0!==S?S:N,K=null!==(T=r[F])&&void 0!==T?T:O,G=null!==(E=i[F])&&void 0!==E?E:L,W=null!==(w=a[F])&&void 0!==w?w:0;return function(e,t){var n=e.bandwidthEstimator,r=e.context,i=e.currentRepresentation,a=e.filters,o=e.initialBitrate,u=e.lowLatencyMode,d=e.manualBitrate,c=e.maxAutoBitrate,f=e.minAutoBitrate,y=e.playbackObserver,S=e.representations,T=new P,E=new k(null!=o?o:0,u),w=new C,A=h.Z,Z={metrics:L,requestBegin:U,requestProgress:B,requestEnd:F,addedSegment:function(e){A(e)}},x=new p.ZP;x.linkToSignal(t);var M=N(S.getValue(),x.signal);return S.onUpdate(O,{clearSignal:t}),{estimates:M,callbacks:Z};function N(e,t){if(0===e.length)return new v.Z({representation:null,bitrate:void 0,knownStableBitrate:void 0,manual:!1,urgent:!0});if(1===e.length)return new v.Z({bitrate:void 0,representation:e[0],manual:!1,urgent:!0,knownStableBitrate:void 0});var o=!1,p=new _(e.map((function(e){return e.bitrate}))),S=new R,k=new I(T,S),Z=y.getReference().getValue(),x=new v.Z(C());return y.listen((function(e){Z=e,M()}),{includeLastObservation:!1,clearSignal:t}),A=function(e){if(null!==Z){var t=Z,n=t.position,r=t.speed,i=e.buffered,a=(0,m.L7)(i,n.last),o=e.content.representation,s=T.getEstimate(o),u={bufferGap:a,currentBitrate:o.bitrate,currentScore:s,speed:r};p.onAddedSegment(u),M()}},t.register((function(){A=h.Z})),d.onUpdate(M,{clearSignal:t}),f.onUpdate(M,{clearSignal:t}),c.onUpdate(M,{clearSignal:t}),a.limitWidth.onUpdate(M,{clearSignal:t}),a.limitWidth.onUpdate(M,{clearSignal:t}),x;function M(){x.setValue(C())}function C(){var t=d.getValue();if(t>=0)return{representation:D(e,t,0,1/0),bitrate:void 0,knownStableBitrate:void 0,manual:!0,urgent:!0};var v=Z,h=v.bufferGap,m=v.position,y=v.maximumPosition,_=a.limitWidth.getValue(),A=a.throttleBitrate.getValue(),I=i.getValue(),x=f.getValue(),R=c.getValue(),M=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,g.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){var n,r;return(null!==(n=e.width)&&void 0!==n?n:0)-(null!==(r=t.width)&&void 0!==r?r:0)})),r=(0,b.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}(e,_,A),C=w.getRequests(),P=E.getBandwidthEstimate(Z,n,I,C,S.bandwidth),N=P.bandwidthEstimate,O=P.bitrateChosen,L=T.getLastStableRepresentation(),U=null===L?void 0:L.bitrate/(Z.speed>0?Z.speed:1),B=s.Z.getCurrent(),F=B.ABR_ENTER_BUFFER_BASED_ALGO,V=B.ABR_EXIT_BUFFER_BASED_ALGO;o&&h<=V?o=!1:!o&&isFinite(h)&&h>=F&&(o=!0);var z=D(M,O,x,R),K=p.getLastEstimate(),G=z.bitrate,W=null;o&&void 0!==K&&K>G&&(G=(W=D(M,K,x,R)).bitrate);var H=null;return u&&null!==I&&r.manifest.isDynamic&&y-m.last<40&&(H=k.getGuess(e,Z,I,G,C)),null!==H&&H.bitrate>G?(l.Z.debug("ABR: Choosing representation with guess-based estimation.",H.bitrate,H.id),S.update(H,N,2),{bitrate:N,representation:H,urgent:null===I||H.bitrate<I.bitrate,manual:!1,knownStableBitrate:U}):null!==W?(l.Z.debug("ABR: Choosing representation with buffer-based estimation.",W.bitrate,W.id),S.update(W,N,0),{bitrate:N,representation:W,urgent:E.isUrgent(W.bitrate,I,C,Z),manual:!1,knownStableBitrate:U}):(l.Z.debug("ABR: Choosing representation with bandwidth estimation.",z.bitrate,z.id),S.update(z,N,1),{bitrate:N,representation:z,urgent:E.isUrgent(z.bitrate,I,C,Z),manual:!1,knownStableBitrate:U})}}function O(){var e=S.getValue();x.cancel(),(x=new p.ZP).linkToSignal(t),N(e,x.signal).onUpdate((function(e){M.setValue(e)}),{clearSignal:x.signal,emitCurrentValue:!0})}function L(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;T.addSample(s,t/1e3,u)}}function U(e){w.add(e)}function B(e){w.addProgress(e)}function F(e){w.remove(e.id)}}({bandwidthEstimator:V,context:e,currentRepresentation:d,filters:{limitWidth:null!==(A=o.limitWidth[F])&&void 0!==A?A:U,throttleBitrate:null!==(M=null!==(Z=o.throttleBitrate[F])&&void 0!==Z?Z:o.throttle[F])&&void 0!==M?M:B},initialBitrate:W,manualBitrate:z,minAutoBitrate:K,maxAutoBitrate:G,playbackObserver:f,representations:c,lowLatencyMode:u},y)}},V=n(245),z=n(8750),K=n(1989),G=n(1959),W=n(1946),H=n(9105),j=n(9362);function q(e){return e instanceof H.Z?new j.Z("PIPELINE_LOAD_ERROR",e):(0,z.Z)(e,{defaultCode:"PIPELINE_LOAD_ERROR",defaultReason:"Unknown error when fetching the Manifest"})}var Y=n(5992),X=n(7839),Q=n(9822),$=n(7864),J=n(2572);function ee(e){return e instanceof H.Z?e.type===Y.br.ERROR_HTTP_CODE?e.status>=500||404===e.status||415===e.status||412===e.status:e.type===Y.br.TIMEOUT||e.type===Y.br.ERROR_EVENT:e instanceof X.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,Q.Z)(e)&&"INTEGRITY_ERROR"===e.code}function te(e){return e instanceof H.Z?e.type===Y.br.ERROR_EVENT&&!1===navigator.onLine:e instanceof X.Z&&e.isOfflineError}function ne(e,t,n,r,i){return re.apply(this,arguments)}function re(){return re=(0,r.Z)(o().mark((function e(t,n,i,a,s){var u,d,c,f,v,m,g,y,_,b,S,T,E,k;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=function(e){var t;if(0===m.size)return e[0];var n=performance.now();return null===(t=e.filter((function(e){var t;return!0!==(null===(t=m.get(e))||void 0===t?void 0:t.isBlacklisted)})).reduce((function(e,t){var r,i=null===(r=m.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]},E=function(e,t){var r=m.get(e);if(void 0===r||void 0===r.blockedUntil)return _(e);var i=performance.now(),a=r.blockedUntil-i;if(a<=0)return _(e);var o=new p.ZP,u=o.linkToSignal(s);return new Promise((function(r,i){function l(e){u(),r(e)}function d(e){u(),i(e)}null==n||n.addEventListener("priorityChange",(function(){var n=y();if(s.isCancelled())throw s.cancellationError;if(void 0===n)return d(t);n!==e&&(o.cancel(),E(n,t).then(l,d))}),o.signal),(0,$.Z)(a,o.signal).then((function(){return _(e).then(l,d)}),h.Z)}))},T=function(){return(T=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=y(),!s.isCancelled()){e.next=3;break}throw s.cancellationError;case 3:if(void 0!==n){e.next=5;break}throw t;case 5:if(v(t),!s.isCancelled()){e.next=8;break}throw s.cancellationError;case 8:return e.abrupt("return",E(n,t));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)},S=function(e){return T.apply(this,arguments)},b=function(){return(b=(0,r.Z)(o().mark((function e(t){var r,a,l,v,h,g,y;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i(t,s);case 3:return r=e.sent,e.abrupt("return",r);case 7:if(e.prev=7,e.t0=e.catch(0),!p.ZP.isCancellationError(e.t0)){e.next=11;break}throw e.t0;case 11:if(null!==t&&null!==n&&n.downgradeCdn(t),o=e.t0,a=te(o)?2:1,void 0===(l=m.get(t))?(l={errorCounter:1,lastErrorType:a,blockedUntil:void 0,isBlacklisted:!1},m.set(t,l)):a!==l.lastErrorType?(l.errorCounter=1,l.lastErrorType=a):l.errorCounter++,ee(e.t0)){e.next=19;break}return l.blockedUntil=void 0,l.isBlacklisted=!0,e.abrupt("return",S(e.t0));case 19:return v=2===a?f:c,l.errorCounter>v?(l.blockedUntil=void 0,l.isBlacklisted=!0):(h=l.errorCounter,g=Math.min(u*Math.pow(2,h-1),d),y=(0,J.Z)(g),l.blockedUntil=performance.now()+y),e.abrupt("return",S(e.t0));case 22:case"end":return e.stop()}var o}),e,null,[[0,7]])})))).apply(this,arguments)},_=function(e){return b.apply(this,arguments)},y=function(){if(null===t){var e=m.get(null);if(void 0!==e&&e.isBlacklisted)return;return null}if(null===n)return k(t);var r=n.getCdnPreferenceForResource(t);return k(r)},null===s.cancellationError){e.next=9;break}return e.abrupt("return",Promise.reject(s.cancellationError));case 9:if(u=a.baseDelay,d=a.maxDelay,c=a.maxRetryRegular,f=a.maxRetryOffline,v=a.onRetry,null!==t&&0===t.length&&l.Z.warn("Fetchers: no CDN given to `scheduleRequestWithCdns`."),m=new Map,void 0!==(g=y())){e.next=15;break}throw new Error("No CDN to request");case 15:return e.abrupt("return",_(g));case 16:case"end":return e.stop()}}),e)}))),re.apply(this,arguments)}function ie(e,t,n){return ne(null,null,e,t,n)}function ae(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 oe(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 oe(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 oe(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 se=function(e){function t(t,n,r){var i;return(i=e.call(this)||this).scheduleManualRefresh=h.Z,i._manifestUrls=t,i._pipelines=n.manifest,i._settings=r,i._canceller=new p.ZP,i._isStarted=!1,i._isRefreshPending=!1,i._consecutiveUnsafeMode=0,i._prioritizedContentUrl=null,i}(0,i.Z)(t,e);var n=t.prototype;return n.dispose=function(){this._canceller.cancel(),this.removeEventListener()},n.start=function(){var e=this;if(!this._isStarted){this._isStarted=!0;var t=this._settings.initialManifest;(t instanceof K.ZP?Promise.resolve({manifest:t}):void 0!==t?this.parse(t,{previousManifest:null,unsafeMode:!1},void 0):this._fetchManifest(void 0).then((function(e){return e.parse({previousManifest:null,unsafeMode:!1})}))).then((function(t){e.trigger("manifestReady",t.manifest),e._canceller.isUsed()||e._recursivelyRefreshManifest(t.manifest,t)})).catch((function(t){return e._onFatalError(t)}))}},n.updateContentUrls=function(e,t){var n;this._prioritizedContentUrl=null!==(n=null==e?void 0:e[0])&&void 0!==n?n:void 0,t&&this.scheduleManualRefresh({enablePartialRefresh:!1,delay:0,canUseUnsafeMode:!1})},n._fetchManifest=function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i,a,u,l,c,f,v,p,h=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=function(e){var t=a.loadManifest,n=(0,W.Z)(i.requestTimeout)?s.Z.getCurrent().DEFAULT_REQUEST_TIMEOUT:i.requestTimeout;n<0&&(n=void 0);return ie((function(){return t(e,{timeout:n},r)}),l,r)},v=function(e){var t=a.resolveManifestUrl;(0,d.Z)(void 0!==t);return ie((function(){return t(e,r)}),l,r)},r=this._canceller.signal,i=this._settings,a=this._pipelines,u=null!=t?t:null===(n=this._manifestUrls)||void 0===n?void 0:n[0],l=this._getBackoffSetting((function(e){h.trigger("warning",q(e))})),c=void 0===a.resolveManifestUrl?p(u):v(u).then(p),e.prev=8,e.next=11,c;case 11:return f=e.sent,e.abrupt("return",{parse:function(e){return h._parseLoadedManifest(f,e,u)}});case 15:throw e.prev=15,e.t0=e.catch(8),q(e.t0);case 18:case"end":return e.stop()}}),e,this,[[8,15]])})));return function(t){return e.apply(this,arguments)}}(),n.parse=function(e,t,n){return this._parseLoadedManifest({responseData:e,size:void 0,requestDuration:void 0},t,n)},n._parseLoadedManifest=function(){var e=(0,r.Z)(o().mark((function e(t,n,i){var a,s,u,d,c,f,v,p,h,m,g,y,_,b,S,T,E=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T=function(e){S(e.contentWarnings);var t=performance.now()-s;return l.Z.info("MF: Manifest parsed in "+t+"ms"),{manifest:e,sendingTime:c,receivedTime:f,parsingTime:t}},S=function(e){for(var t,n=ae(e);!(t=n()).done;){var r=t.value;if(u.isCancelled())return;var i=(0,z.Z)(r,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});d("warning",i)}},b=function(){return(b=(0,r.Z)(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ie(t,v,u);case 3:return n=e.sent,e.abrupt("return",n);case 7:throw e.prev=7,e.t0=e.catch(0),q(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},_=function(e){return b.apply(this,arguments)},s=performance.now(),u=this._canceller.signal,d=this.trigger.bind(this),c=t.sendingTime,f=t.receivedTime,v=this._getBackoffSetting((function(e){E.trigger("warning",q(e))})),p=null!=i?i:null===(a=this._manifestUrls)||void 0===a?void 0:a[0],h={externalClockOffset:n.externalClockOffset,unsafeMode:n.unsafeMode,previousManifest:n.previousManifest,originalUrl:p},e.prev=11,m=this._pipelines.parseManifest(t,h,S,u,_),m instanceof Promise){e.next=17;break}return e.abrupt("return",T(m.manifest));case 17:return e.next=19,m;case 19:return g=e.sent,y=g.manifest,e.abrupt("return",T(y));case 22:e.next=28;break;case 24:throw e.prev=24,e.t0=e.catch(11),(0,z.Z)(e.t0,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown error when parsing the Manifest"});case 28:case"end":return e.stop()}}),e,this,[[11,24]])})));return function(t,n,r){return e.apply(this,arguments)}}(),n._getBackoffSetting=function(e){var t=s.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,u=o.lowLatencyMode,l=o.maxRetryRegular,d=o.maxRetryOffline;return{onRetry:e,baseDelay:u?i.LOW_LATENCY:i.REGULAR,maxDelay:u?a.LOW_LATENCY:a.REGULAR,maxRetryRegular:null!=l?l:n,maxRetryOffline:null!=d?d:r}},n._recursivelyRefreshManifest=function(e,t){var n=this,r=t.sendingTime,i=t.parsingTime,a=t.updatingTime,o=s.Z.getCurrent(),u=o.MAX_CONSECUTIVE_MANIFEST_PARSING_IN_UNSAFE_MODE,d=o.MIN_MANIFEST_PARSING_TIME_TO_ENTER_UNSAFE_MODE,c=void 0!==i?i+(null!=a?a:0):void 0,f=this._consecutiveUnsafeMode>0?this._consecutiveUnsafeMode<u:void 0!==c&&c>=d,v=void 0===r?0:performance.now()-r,m=Math.max(this._settings.minimumManifestUpdateInterval-v,0),g=new p.ZP;if(g.linkToSignal(this._canceller.signal),this.scheduleManualRefresh=function(t){var i=t.enablePartialRefresh,a=t.delay,o=t.canUseUnsafeMode&&f,s=void 0===r?0:performance.now()-r,u=Math.max(n._settings.minimumManifestUpdateInterval-s,0),l=setTimeout((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:i,unsafeMode:o})}),Math.max((null!=a?a:0)-s,u));g.signal.register((function(){clearTimeout(l)}))},null!==e.expired){var y=setTimeout((function(){var t;null===(t=e.expired)||void 0===t||t.then((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),h.Z)}),m);g.signal.register((function(){clearTimeout(y)}))}if(void 0!==e.lifetime&&e.lifetime>=0){var _,b=1e3*e.lifetime-v;void 0===c?_=b:e.lifetime<3&&c>=100?(_=Math.min(Math.max(3e3-v,Math.max(b,0)+c),6*b),l.Z.info("MUS: Manifest update rythm is too frequent. Postponing next request.",b,_)):c>=1e3*e.lifetime/10?(_=Math.min(Math.max(b,0)+c,6*b),l.Z.info("MUS: Manifest took too long to parse. Postponing next request",_,_)):_=b;var S=setTimeout((function(){g.cancel(),n._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:f})}),Math.max(_,m));g.signal.register((function(){clearTimeout(S)}))}},n._triggerNextManifestRefresh=function(e,t){var n,r,i=this,a=t.enablePartialRefresh,o=t.unsafeMode,u=e.updateUrl;null!==this._prioritizedContentUrl?(n=!0,r=this._prioritizedContentUrl,this._prioritizedContentUrl=null):r=(n=!a||void 0===u)?e.getUrl():u;var d=e.clockOffset;o?(this._consecutiveUnsafeMode+=1,l.Z.info('Init: Refreshing the Manifest in "unsafeMode" for the '+String(this._consecutiveUnsafeMode)+" consecutive time.")):this._consecutiveUnsafeMode>0&&(l.Z.info('Init: Not parsing the Manifest in "unsafeMode" anymore after '+String(this._consecutiveUnsafeMode)+" consecutive times."),this._consecutiveUnsafeMode=0),this._isRefreshPending||(this._isRefreshPending=!0,this._fetchManifest(r).then((function(t){return t.parse({externalClockOffset:d,previousManifest:e,unsafeMode:o})})).then((function(t){i._isRefreshPending=!1;var r=t.manifest,a=t.sendingTime,o=t.parsingTime,u=performance.now();if(n)e.replace(r);else try{e.update(r)}catch(t){var d=t instanceof Error?t.message:"unknown error";l.Z.warn("MUS: Attempt to update Manifest failed: "+d,"Re-downloading the Manifest fully");var c=s.Z.getCurrent().FAILED_PARTIAL_UPDATE_MANIFEST_REFRESH_DELAY,f=void 0===a?0:performance.now()-a,v=Math.max(i._settings.minimumManifestUpdateInterval-f,0),p=h.Z,m=setTimeout((function(){p(),i._triggerNextManifestRefresh(e,{enablePartialRefresh:!1,unsafeMode:!1})}),Math.max(c-f,v));return void(p=i._canceller.signal.register((function(){clearTimeout(m)})))}var g=performance.now()-u;i._recursivelyRefreshManifest(e,{sendingTime:a,parsingTime:o,updatingTime:g})})).catch((function(e){i._isRefreshPending=!1,i._onFatalError(e)})))},n._onFatalError=function(e){this._canceller.isUsed()||(this.trigger("error",e),this.dispose())},t}(G.Z);var ue=se;function le(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 ce=function(e){function t(t){var n;return(n=e.call(this)||this)._downgradedCdnList={metadata:[],timeouts:[]},t.register((function(){for(var e,t=le(n._downgradedCdnList.timeouts);!(e=t()).done;){var r=e.value;clearTimeout(r)}n._downgradedCdnList={metadata:[],timeouts:[]}})),n}(0,i.Z)(t,e);var n=t.prototype;return n.getCdnPreferenceForResource=function(e){return e.length<=1?e:this._innerGetCdnPreferenceForResource(e)},n.downgradeCdn=function(e){var t=this,n=fe(this._downgradedCdnList.metadata,e);n>=0&&this._removeIndexFromDowngradeList(n);var r=s.Z.getCurrent().DEFAULT_CDN_DOWNGRADE_TIME;this._downgradedCdnList.metadata.push(e);var i=window.setTimeout((function(){var n=fe(t._downgradedCdnList.metadata,e);n>=0&&t._removeIndexFromDowngradeList(n),t.trigger("priorityChange",null)}),r);this._downgradedCdnList.timeouts.push(i),this.trigger("priorityChange",null)},n._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)},n._removeIndexFromDowngradeList=function(e){this._downgradedCdnList.metadata.splice(e,1);var t=this._downgradedCdnList.timeouts.splice(e,1);clearTimeout(t[0])},t}(G.Z);function fe(e,t){return 0===e.length?-1:void 0!==t.id?(0,g.Z)(e,(function(e){return e.id===t.id})):(0,g.Z)(e,(function(e){return e.baseUrl===t.baseUrl}))}var ve=n(520),pe=n(7714),he=n(908),me=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}(),ge=(0,he.Z)();var ye=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(0,c.Z)(r,(function(o,s){return i={hasEnded:!1,priority:t,trigger:function(){if(!i.hasEnded){var e=function(){u(),a._endTask(i)},t=new p.ZP,u=t.linkToSignal(r);i.interrupter=t,t.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(t.signal).then((function(t){n.beforeEnded(),e(),o(t)})).catch((function(n){!r.isCancelled()&&t.isUsed()&&n instanceof p.FU||function(t){e(),s(t)}(n)}))}},taskFn:e,interrupter:null},a._canBeStartedNow(i)?(i.trigger(),a._isRunningHighPriorityTasks()&&a._interruptCancellableTasks()):a._waitingQueue.push(i),function(){return a._endTask(i)}}))},t._endTask=function(e){e.hasEnded=!0;var t=_e(e.taskFn,this._waitingQueue);if(t>=0)this._waitingQueue.splice(t,1);else{var n=_e(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=_e(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=_e(e,this._pendingTasks);if(i<0)l.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?(l.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=_e(e.taskFn,this._pendingTasks);n<0?l.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 _e(e,t){return(0,g.Z)(t,(function(t){return t.taskFn===e}))}var be=function(){function e(e,t,n){var r=new ce(n),i=s.Z.getCurrent(),a=i.MIN_CANCELABLE_PRIORITY,o=i.MAX_HIGH_PRIORITY_LEVEL;this._transport=e,this._prioritizer=new ye({prioritySteps:{high:o,low:a}}),this._cdnPrioritizer=r,this._backoffOptions=t}return e.prototype.createSegmentFetcher=function(e,t){var n,i,a,u=function(e,t){var n=t.maxRetryRegular,r=t.maxRetryOffline,i=t.lowLatencyMode,a=t.requestTimeout,o=s.Z.getCurrent(),u=o.DEFAULT_MAX_REQUESTS_RETRY_ON_ERROR,l=o.DEFAULT_REQUEST_TIMEOUT,d=o.DEFAULT_MAX_REQUESTS_RETRY_ON_OFFLINE,c=o.INITIAL_BACKOFF_DELAY_BASE,f=o.MAX_BACKOFF_DELAY_BASE;return{maxRetryRegular:"image"===e?0:null!=n?n:u,maxRetryOffline:null!=r?r:d,baseDelay:i?c.LOW_LATENCY:c.REGULAR,maxDelay:i?f.LOW_LATENCY:f.REGULAR,requestTimeout:(0,W.Z)(a)?l:a}}(e,this._backoffOptions),d=function(e,t,n,i,a){var s={timeout:a.requestTimeout<0?void 0:a.requestTimeout},u=(0,pe.Z)(["audio","video"],e)?new me:void 0,d=t.loadSegment,c=t.parseSegment;return function(){var e=(0,r.Z)(o().mark((function e(t,r,v){var h,m,g,y,_,b,S,T,E,k,w,A,I,Z,x,R,M,C;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C=function(){var e;E||!(0,W.Z)(b)&&void 0!==b.size&&void 0!==b.requestDuration&&S.length>0&&S.every((function(e){return e}))&&(E=!0,null===(e=i.onMetrics)||void 0===e||e.call(i,{size:b.size,requestDuration:b.requestDuration,content:t,segmentDuration:T}))},M=function(e){r.onRetry(q(e))},R=function(e,n){S.push(!1);var r=S.length-1;return function(i){var a={data:e,isChunked:n};try{var o=c(a,t,i);return S[r]||(T=void 0!==T&&"media"===o.segmentType&&null!==o.chunkInfos&&void 0!==o.chunkInfos.duration?T+o.chunkInfos.duration:void 0,S[r]=!0,C()),o}catch(e){throw(0,z.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"Unknown parsing error"})}}},x=function(e){return d(e,t,s,v,k)},Z=function(){var e;void 0===b&&(l.Z.debug("SF: Segment request cancelled",y),b=null,null===(e=i.onRequestEnd)||void 0===e||e.call(i,{id:_}))},y=(0,ve.K)(t),_=ge(),S=[],T=0,E=!1,k={onProgress:function(e){var t;void 0===b&&void 0!==e.totalSize&&e.size<e.totalSize&&(null===(t=i.onProgress)||void 0===t||t.call(i,{duration:e.duration,size:e.size,totalSize:e.totalSize,timestamp:performance.now(),id:_}))},onNewChunk:function(e){r.onChunk(R(e,!0))}},null===(w=void 0!==u?u.get(t):null)){e.next=16;break}return l.Z.debug("SF: Found wanted segment in cache",y),r.onChunk(R(w,!1)),e.abrupt("return",Promise.resolve());case 16:return l.Z.debug("SF: Beginning request",y),null===(h=i.onRequestBegin)||void 0===h||h.call(i,{requestTimestamp:performance.now(),id:_,content:t}),v.register(Z),e.prev=19,e.next=22,ne(t.representation.cdnMetadata,n,x,(0,f.Z)({onRetry:M},a),v);case 22:"segment-loaded"===(A=e.sent).resultType?(I=A.resultData.responseData,void 0!==u&&u.add(t,A.resultData.responseData),r.onChunk(R(I,!1))):"segment-created"===A.resultType&&r.onChunk(R(A.resultData,!1)),l.Z.debug("SF: Segment request ended with success",y),r.onAllChunksReceived(),"segment-created"!==A.resultType?(b=A.resultData,C()):b=null,v.isCancelled()||null===(m=i.onRequestEnd)||void 0===m||m.call(i,{id:_}),v.deregister(Z),e.next=41;break;case 31:if(e.prev=31,e.t0=e.catch(19),v.deregister(Z),b=null,!(e.t0 instanceof p.FU)){e.next=38;break}throw l.Z.debug("SF: Segment request aborted",y),e.t0;case 38:throw l.Z.debug("SF: Segment request failed",y),null===(g=i.onRequestEnd)||void 0===g||g.call(i,{id:_}),q(e.t0);case 41:case"end":return e.stop()}}),e,null,[[19,31]])})));return function(t,n,r){return e.apply(this,arguments)}}()}(e,this._transport[e],this._cdnPrioritizer,t,u);return n=this._prioritizer,i=d,a=new WeakMap,{createRequest:function(e,t,r,o){var s=function(t){return i(e,r,t)},u=n.create(s,t,r,o);return a.set(u,s),u},updatePriority:function(e,t){var r=a.get(e);void 0!==r?n.updatePriority(r,t):l.Z.warn("Fetchers: Cannot update the priority of a request: task not found.")}}},e}(),Se=be,Te=n(7874),Ee=n(7326);var ke=n(7904),we=n(9612);function Ae(e){}var Ie=function(e){function t(t,n,r){var i;i=e.call(this)||this,l.Z.info("AVSB: calling `mediaSource.addSourceBuffer`",n);var a=r.addSourceBuffer(n);i._canceller=new p.ZP,i.bufferType=t,i._mediaSource=r,i._sourceBuffer=a,i._queue=[],i._pendingTask=null,i._lastInitSegmentUniqueId=null,i.codec=n,i._initSegmentsMap=new Map;var o=i._onPendingTaskError.bind((0,Ee.Z)(i)),u=i._flush.bind((0,Ee.Z)(i)),d=s.Z.getCurrent().SOURCE_BUFFER_FLUSHING_INTERVAL,c=setInterval(u,d);return i._sourceBuffer.addEventListener("error",o),i._sourceBuffer.addEventListener("updateend",u),i._canceller.signal.register((function(){clearInterval(c),i._sourceBuffer.removeEventListener("error",o),i._sourceBuffer.removeEventListener("updateend",u)})),i}(0,i.Z)(t,e);var n=t.prototype;return n.declareInitSegment=function(e,t){Ae(t),this._initSegmentsMap.set(e,t)},n.freeInitSegment=function(e){this._initSegmentsMap.delete(e)},n.pushChunk=function(e,t){return Ae(e.data.chunk),l.Z.debug("AVSB: receiving order to push data to the SourceBuffer",this.bufferType,(0,ve.K)(e.inventoryInfos)),this._addToQueue({type:we.f.Push,value:e},t)},n.removeBuffer=function(e,t,n){return l.Z.debug("AVSB: receiving order to remove data from the SourceBuffer",this.bufferType,e,t),this._addToQueue({type:we.f.Remove,value:{start:e,end:t}},n)},n.endOfSegment=function(e,t){return l.Z.debug("AVSB: receiving order for validating end of segment",this.bufferType,(0,ve.K)(e)),this._addToQueue({type:we.f.EndOfSegment,value:e},t)},n.getBufferedRanges=function(){return this._sourceBuffer.buffered},n.getPendingOperations=function(){var e=function(e){switch(e.type){case we.f.Push:case we.f.Remove:case we.f.EndOfSegment:return{type:e.type,value:e.value}}},t=this._queue.map(e);return null===this._pendingTask?t:[e(this._pendingTask)].concat(t)},n.dispose=function(){for(this._canceller.cancel(),null!==this._pendingTask&&(this._pendingTask.reject(new p.FU),this._pendingTask=null);this._queue.length>0;){var e=this._queue.shift();void 0!==e&&e.reject(new p.FU)}if("open"===this._mediaSource.readyState)try{l.Z.debug("AVSB: Calling `abort` on the SourceBuffer"),this._sourceBuffer.abort()}catch(e){l.Z.warn("AVSB: Failed to abort a "+this.bufferType+" SourceBuffer:",e instanceof Error?e:"")}},n._onPendingTaskError=function(e){if(this._lastInitSegmentUniqueId=null,null!==this._pendingTask){var t=e instanceof Error?e:new Error("An unknown error occured when doing operations on the SourceBuffer"),n=this._pendingTask;n.type===we.f.Push&&0===n.data.length&&null!==n.inventoryData&&this._segmentInventory.insertChunk(n.inventoryData,!1),this._pendingTask=null,n.reject(t)}},n._addToQueue=function(e,t){var n=this;return(0,c.Z)(t,(function(t,r){var i=0===n._queue.length&&null===n._pendingTask,a=(0,f.Z)({resolve:t,reject:r},e);return n._queue.push(a),i&&n._flush(),function(){var e=n._queue.indexOf(a);e>=0&&n._queue.splice(e,1),a.resolve=h.Z,a.reject=h.Z}}))},n._flush=function(){if(!this._sourceBuffer.updating){if(null!==this._pendingTask){var e=this._pendingTask;if(e.type!==we.f.Push||0===e.data.length){switch(e.type){case we.f.Push:null!==e.inventoryData&&this._segmentInventory.insertChunk(e.inventoryData,!0);break;case we.f.EndOfSegment:this._segmentInventory.completeSegment(e.value,this.getBufferedRanges());break;case we.f.Remove:this.synchronizeInventory();break;default:(0,ke.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!==we.f.Push)this._pendingTask=n;else{var r,i=n.value;try{r=this._preparePushOperation(i.data)}catch(e){this._pendingTask=(0,f.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._lastInitSegmentUniqueId=null,void n.reject(a)}this._pendingTask=(0,f.Z)({data:r,inventoryData:i.inventoryInfos},n)}}try{switch(this._pendingTask.type){case we.f.EndOfSegment:return l.Z.debug("AVSB: Acknowledging complete segment",(0,ve.K)(this._pendingTask.value)),void this._flush();case we.f.Push:var o=this._pendingTask.data.shift();if(void 0===o)return void this._flush();l.Z.debug("AVSB: pushing segment",this.bufferType,(0,ve.K)(this._pendingTask.inventoryData)),this._sourceBuffer.appendBuffer(o);break;case we.f.Remove:var s=this._pendingTask.value,u=s.start,d=s.end;l.Z.debug("AVSB: removing data from SourceBuffer",this.bufferType,u,d),this._sourceBuffer.remove(u,d);break;default:(0,ke.Z)(this._pendingTask)}}catch(e){this._onPendingTaskError(e)}}},n._preparePushOperation=function(e){var t=[],n=e.codec,r=e.timestampOffset,i=e.appendWindow,a=!1;if(void 0!==n&&n!==this.codec&&(l.Z.debug("AVSB: updating codec",n),a=function(e,t){if("function"==typeof e.changeType){try{e.changeType(t)}catch(e){return l.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:l.Z.debug("AVSB: could not update codec",n,this.codec)),this._sourceBuffer.timestampOffset!==r){var o=r;l.Z.debug("AVSB: updating timestampOffset",this.bufferType,this._sourceBuffer.timestampOffset,o),this._sourceBuffer.timestampOffset=o}if(void 0===i[0])this._sourceBuffer.appendWindowStart>0&&(l.Z.debug("AVSB: re-setting `appendWindowStart` to `0`"),this._sourceBuffer.appendWindowStart=0);else if(i[0]!==this._sourceBuffer.appendWindowStart){if(i[0]>=this._sourceBuffer.appendWindowEnd){var s=i[0]+1;l.Z.debug("AVSB: pre-updating `appendWindowEnd`",s),this._sourceBuffer.appendWindowEnd=s}l.Z.debug("AVSB: setting `appendWindowStart`",i[0]),this._sourceBuffer.appendWindowStart=i[0]}if(void 0===i[1]?this._sourceBuffer.appendWindowEnd!==1/0&&(l.Z.debug("AVSB: re-setting `appendWindowEnd` to `Infinity`"),this._sourceBuffer.appendWindowEnd=1/0):i[1]!==this._sourceBuffer.appendWindowEnd&&(l.Z.debug("AVSB: setting `appendWindowEnd`",i[1]),this._sourceBuffer.appendWindowEnd=i[1]),null!==e.initSegmentUniqueId&&(a||!this._isLastInitSegment(e.initSegmentUniqueId))){var u=this._initSegmentsMap.get(e.initSegmentUniqueId);if(void 0===u)throw new Error("Invalid initialization segment uniqueId");t.push(u),this._lastInitSegmentUniqueId=e.initSegmentUniqueId}return null!==e.chunk&&t.push(e.chunk),t},n._isLastInitSegment=function(e){return null!==this._lastInitSegmentUniqueId&&this._lastInitSegmentUniqueId===e},t}(we.C),Ze=["audio","video","text","image"];function xe(e){return"audio"===e||"video"===e}var Re=function(){function e(e,t){this._mediaElement=e,this._mediaSource=t,this._initializedSegmentBuffers={},this._onNativeBufferAddedOrDisabled=[]}e.isNative=function(e){return xe(e)};var t=e.prototype;return t.getBufferTypes=function(){var e=this.getNativeBufferTypes();return null==Te.Z.nativeTextTracksBuffer&&null==Te.Z.htmlTextTracksBuffer||e.push("text"),null!=Te.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():(0,c.Z)(e,(function(e){var n,r=function(){var e=t._onNativeBufferAddedOrDisabled.indexOf(n);e>=0&&t._onNativeBufferAddedOrDisabled.splice(e,1)};return n=function(){t._areNativeBuffersUsable()&&(r(),e())},t._onNativeBufferAddedOrDisabled.push(n),r}))},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 l.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(xe(e)){if(null!=i)return i instanceof Ie&&i.codec!==t?l.Z.warn("SB: Reusing native SegmentBuffer with codec",i.codec,"for codec",t):l.Z.info("SB: Reusing native SegmentBuffer with codec",t),i;l.Z.info("SB: Adding native SegmentBuffer with codec",t);var a=new Ie(e,t,this._mediaSource);return this._initializedSegmentBuffers[e]=a,this._onNativeBufferAddedOrDisabled.forEach((function(e){return e()})),a}if(null!=i)return l.Z.info("SB: Reusing a previous custom SegmentBuffer for the type",e),i;if("text"===e){if(l.Z.info("SB: Creating a new text SegmentBuffer"),"html"===n.textTrackMode){if(null==Te.Z.htmlTextTracksBuffer)throw new Error("HTML Text track feature not activated");r=new Te.Z.htmlTextTracksBuffer(this._mediaElement,n.textTrackElement)}else{if(null==Te.Z.nativeTextTracksBuffer)throw new Error("Native Text track feature not activated");r=new Te.Z.nativeTextTracksBuffer(this._mediaElement,!0===n.hideNativeSubtitle)}return this._initializedSegmentBuffers.text=r,r}if("image"===e){if(null==Te.Z.imageBuffer)throw new Error("Image buffer feature not activated");return l.Z.info("SB: Creating a new image SegmentBuffer"),r=new Te.Z.imageBuffer,this._initializedSegmentBuffers.image=r,r}throw l.Z.error("SB: Unknown buffer type:",e),new u.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?(l.Z.info("SB: Aborting SegmentBuffer",e),t.dispose(),delete this._initializedSegmentBuffers[e]):l.Z.warn("SB: Trying to dispose a SegmentBuffer that does not exist")},t.disposeAll=function(){var e=this;Ze.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}(),Me=n(7473),Ce=n.n(Me),Pe=n(3146),De=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 Ne(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 Oe.apply(this,arguments)})(r,n,a.getValue(),o.getValue(),t).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.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 Oe(){return(Oe=(0,r.Z)(o().mark((function e(t,n,r,i,a){var s,u,d,c,f,v,p,h;return o().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:s=[],u=(0,m.F_)(t.getBufferedRanges(),n),d=u.innerRange,c=u.outerRanges,f=function(){if(isFinite(i)){for(var e=0;e<c.length;e++){var t=c[e];n+i<=t.start?s.push(t):n<=t.start&&n+i<t.end&&n+i>t.start&&s.push({start:n+i,end:t.end})}null!=d&&n+i<d.end&&s.push({start:n+i,end:d.end})}},function(){if(isFinite(r)){for(var e=0;e<c.length;e++){var t=c[e];n-r>=t.end?s.push(t):n>=t.end&&n-r>t.start&&n-r<t.end&&s.push({start:t.start,end:n-r})}null!=d&&n-r>d.start&&s.push({start:d.start,end:n-r})}}(),f(),v=0,p=s;case 9:if(!(v<p.length)){e.next=20;break}if(!((h=p[v]).start<h.end)){e.next=17;break}if(l.Z.debug("GC: cleaning range from SegmentBuffer",h.start,h.end),null===a.cancellationError){e.next=15;break}throw a.cancellationError;case 15:return e.next=17,t.removeBuffer(h.start,h.end,a);case 17:v++,e.next=9;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Le=function(e){function t(t,n,r,i){var a;return(a=e.call(this)||this)._content=t,a._currentCanceller=null,a._downloadQueue=n,a._initSegmentRequest=null,a._mediaSegmentRequest=null,a._segmentFetcher=r,a._initSegmentInfoRef=new v.Z(void 0),a._mediaSegmentAwaitingInitMetadata=null,i||a._initSegmentInfoRef.setValue(null),a}(0,i.Z)(t,e);var n=t.prototype;return n.getRequestedInitSegment=function(){return null===this._initSegmentRequest?null:this._initSegmentRequest.segment},n.getRequestedMediaSegment=function(){return null===this._mediaSegmentRequest?null:this._mediaSegmentRequest.segment},n.start=function(){var e=this;null===this._currentCanceller&&(this._currentCanceller=new p.ZP,this._downloadQueue.onUpdate((function(t){var n=t.segmentQueue;if(!(n.length>0&&n[0].segment.id===e._mediaSegmentAwaitingInitMetadata)){var r=e._mediaSegmentRequest;if(0===n.length){if(null===r)return;return l.Z.debug("Stream: no more media segment to request. Cancelling queue.",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()}if(null===r)return l.Z.debug("Stream: Media segments now need to be requested. Starting queue.",e._content.adaptation.type,n.length),void e._restartMediaSegmentDownloadingQueue();var i=n[0];return r.segment.id!==i.segment.id?(l.Z.debug("Stream: Next media segment changed, cancelling previous",e._content.adaptation.type),void e._restartMediaSegmentDownloadingQueue()):void(r.priority!==i.priority&&(l.Z.debug("Stream: Priority of next media segment changed, updating",e._content.adaptation.type,r.priority,i.priority),e._segmentFetcher.updatePriority(r.request,i.priority)))}}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}),this._downloadQueue.onUpdate((function(t){var n,r=e._initSegmentRequest;null===t.initSegment||null===r?(null===(n=t.initSegment)||void 0===n?void 0:n.segment.id)!==(null==r?void 0:r.segment.id)&&(null===t.initSegment&&l.Z.debug("Stream: no more init segment to request. Cancelling queue.",e._content.adaptation.type),e._restartInitSegmentDownloadingQueue(t.initSegment)):t.initSegment.priority!==r.priority&&e._segmentFetcher.updatePriority(r.request,t.initSegment.priority)}),{emitCurrentValue:!0,clearSignal:this._currentCanceller.signal}))},n.stop=function(){var e;null===(e=this._currentCanceller)||void 0===e||e.cancel(),this._currentCanceller=null},n._restartMediaSegmentDownloadingQueue=function(){var e=this;null!==this._mediaSegmentRequest&&this._mediaSegmentRequest.canceller.cancel();!function t(n){if(null!==e._currentCanceller&&e._currentCanceller.isUsed())e._mediaSegmentRequest=null;else{if(void 0===n)return e._mediaSegmentRequest=null,void e.trigger("emptyQueue",null);var r=new p.ZP,i=null===e._currentCanceller?h.Z:r.linkToSignal(e._currentCanceller.signal),a=n.segment,o=n.priority,s=(0,f.Z)({segment:a},e._content),u=!1,c=!1;r.signal.register((function(){e._mediaSegmentRequest=null,u||(e._mediaSegmentAwaitingInitMetadata===a.id&&(e._mediaSegmentAwaitingInitMetadata=null),u=!0,c=!1)}));var v=function(t){(0,d.Z)("media"===t.segmentType,"Should have loaded a media segment."),e.trigger("parsedMediaSegment",(0,f.Z)({},t,{segment:a}))},m=function(){var n=e._downloadQueue.getValue().segmentQueue;if(0===n.length)return u=!0,void e.trigger("emptyQueue",null);n[0].segment.id===a.id&&n.shift(),u=!0,t(n[0])},g=e._segmentFetcher.createRequest(s,o,{onRetry:function(t){e.trigger("requestRetry",{segment:a,error:t})},beforeInterrupted:function(){l.Z.info("Stream: segment request interrupted temporarly.",a.id,a.time)},onChunk:function(t){var n=e._initSegmentInfoRef.getValue();void 0!==n?v(t(null!=n?n:void 0)):(c=!0,e._initSegmentInfoRef.waitUntilDefined((function(e){v(t(null!=e?e:void 0))}),{clearSignal:r.signal}))},onAllChunksReceived:function(){c?(e._mediaSegmentAwaitingInitMetadata=a.id,e._initSegmentInfoRef.waitUntilDefined((function(){e._mediaSegmentAwaitingInitMetadata=null,c=!1,e.trigger("fullyLoadedSegment",a)}),{clearSignal:r.signal})):e.trigger("fullyLoadedSegment",a)},beforeEnded:function(){i(),e._mediaSegmentRequest=null,c?e._initSegmentInfoRef.waitUntilDefined(m,{clearSignal:r.signal}):m()}},r.signal);g.catch((function(t){i(),u||(u=!0,e.stop(),e.trigger("error",t))})),e._mediaSegmentRequest={segment:a,priority:o,request:g,canceller:r}}}(this._downloadQueue.getValue().segmentQueue[0])},n._restartInitSegmentDownloadingQueue=function(e){var t=this;if((null===this._currentCanceller||!this._currentCanceller.isUsed())&&(null!==this._initSegmentRequest&&this._initSegmentRequest.canceller.cancel(),null!==e)){var n=new p.ZP,r=null===this._currentCanceller?h.Z:n.linkToSignal(this._currentCanceller.signal),i=e.segment,a=e.priority,o=(0,f.Z)({segment:i},this._content),s=!1,u=this._segmentFetcher.createRequest(o,a,{onRetry:function(e){t.trigger("requestRetry",{segment:i,error:e})},beforeInterrupted:function(){l.Z.info("Stream: init segment request interrupted temporarly.",i.id)},beforeEnded:function(){r(),t._initSegmentRequest=null,s=!0},onChunk:function(e){var n,r=e(void 0);(0,d.Z)("init"===r.segmentType,"Should have loaded an init segment."),t.trigger("parsedInitSegment",(0,f.Z)({},r,{segment:i})),"init"===r.segmentType&&t._initSegmentInfoRef.setValue(null!==(n=r.initTimescale)&&void 0!==n?n:null)},onAllChunksReceived:function(){t.trigger("fullyLoadedSegment",i)}},n.signal);u.catch((function(e){r(),s||(s=!0,t.stop(),t.trigger("error",e))})),n.signal.register((function(){t._initSegmentRequest=null,s||(s=!0)})),this._initSegmentRequest={segment:i,priority:a,request:u,canceller:n}}},t}(G.Z);function Ue(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 d=s.index.checkDiscontinuity(t.start);if(null!==d)return{start:void 0,end:d}}return null}var c=i[u];if(void 0!==c.bufferedStart&&c.bufferedStart>t.start&&(null===n||c.infos.segment.end<=n)){var f=c.bufferedStart;return r||!1===s.index.awaitSegmentBetween(t.start,f)?(l.Z.debug("RS: current discontinuity encountered",o.type,c.bufferedStart),{start:void 0,end:f}):null}var v=function(e,t,n){if(n<=0)return l.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!==v){var p=i[v-1],h=i[v];if(null===n||h.infos.segment.end<=n){if(!r&&!1!==s.index.awaitSegmentBetween(p.infos.segment.end,h.infos.segment.time))return null;var m=p.bufferedEnd,g=h.bufferedStart;return l.Z.debug("RS: future discontinuity encountered",o.type,m,g),{start:m,end:g}}}if(null===n){if(r&&void 0!==a.end){if(t.end<a.end)return null;var y=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!==y){var _=i[y];if(void 0!==_.bufferedEnd&&_.bufferedEnd<a.end)return l.Z.debug("RS: discontinuity encountered at the end of the current period",o.type,_.bufferedEnd,a.end),{start:_.bufferedEnd,end:null}}}if(void 0!==a.end&&t.end>=a.end)return null;for(var b=i.length-1;b>=0;b--){var S=i[b];if(void 0===S.bufferedStart)break;if(S.bufferedStart<t.end){if(void 0!==S.bufferedEnd&&S.bufferedEnd<t.end){var T=s.index.checkDiscontinuity(t.end);if(null!==T)return{start:S.bufferedEnd,end:T}}return null}}}return null}function Be(e){var t=e.bufferedSegments,n=e.content,r=e.currentPlaybackTime,i=e.fastSwitchThreshold,a=e.getBufferedHistory,o=e.neededRange,u=e.segmentsBeingPushed,d=e.maxBufferSize,c=n.adaptation,v=n.representation,p=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,u,d),h=v.index.getSegments(o.start,o.end-o.start),m=t.filter((function(e){return!Ve(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],u=null;if(function(e,t,n){var r=s.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedStart)return l.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 l.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}(u=a(e.infos),e.bufferedStart))return!1;l.Z.debug("Stream: skipping segment gc-ed at the start",e.start,e.bufferedStart)}if(function(e,t,n){var r=s.Z.getCurrent().MAX_TIME_MISSING_FROM_COMPLETE_SEGMENT;if(void 0===e.bufferedEnd)return l.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 l.Z.info("Stream: The end of the wanted segment has been garbage collected",e.end,e.bufferedEnd),!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}(u=null!=u?u:a(e.infos),e.bufferedEnd))return!1;l.Z.debug("Stream: skipping segment gc-ed at the end",e.end,e.bufferedEnd)}return!0})),g=s.Z.getCurrent(),y=g.MINIMUM_SEGMENT_SIZE,_=g.MIN_BUFFER_AHEAD,b=!1,S=Math.min(1/60,y),T=!1,E=[],k=h.filter((function(e){var t=(0,f.Z)({segment:e},n);if(u.length>0&&u.some((function(e){return(0,ve.z)(t,e)})))return!1;var s=e.duration,d=e.time,h=e.end;if(e.isInit)return!0;if(b)return E.push(e),!1;if(e.complete&&s<y)return!1;if(u.length>0&&u.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-S>d)&&(!(a.end+S<h)&&!Ve(e,t,r,i))})))return!1;for(var g=0;g<m.length;g++){var k=m[g];if(k.infos.period.id===n.period.id){var w=k.infos.segment;if(d-w.time>-S&&w.end-h>-S)return!1}}var A=s*n.representation.bitrate;if(p-A<0&&(T=!0,d>o.start+_))return b=!0,E.push(e),!1;var I=a(t);if(I.length>1){var Z=I[I.length-1],x=I[I.length-2];if(null===Z.buffered&&null===x.buffered)return l.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."+c.type,v.id,e.time),!1}for(var R=0;R<m.length;R++){var M=m[R];if(M.end+S>d){var C=M.start>d+S||Fe(m,R).end<h-S;return C&&(p-=A),C}}return p-=A,!0}));return{segmentsToLoad:k,segmentsOnHold:E,isBufferFull:T}}function Fe(e,t){for(var n=t+1,r=s.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 Ve(e,t,n,r){var i=s.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=s.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 ze(e,t){for(var n=e-t,r=s.Z.getCurrent().SEGMENT_PRIORITIES_STEPS,i=0;i<r.length;i++)if(n<r[i])return i;return r.length}function Ke(e,t,n,r,i,a,o){o.synchronizeInventory();var u=e.representation,l=n.getIsPaused()||n.getPlaybackRate()<=0?t-.1:t,d=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,W.Z)(u)&&Re.isNative(e.adaptation.type)&&t>=u&&l.isInitialized()&&!l.isStillAwaitingFutureSegments()&&function(e,t,n){var r,i=e.getPeriodAfter(t);return t.containsTime(n,i)&&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 d,c=i+n;d=!(!s.index.isInitialized()||s.index.isStillAwaitingFutureSegments()||void 0===o.end)&&(void 0===u?c>=o.end:null===u||c>=u);return{start:Math.max(i,o.start),end:Math.min(c,null!==(r=o.end)&&void 0!==r?r:1/0),hasReachedPeriodEnd:d}}(e,l,i),c=u.index.shouldRefresh(d.start,d.end),f=o.getPendingOperations().filter((function(e){return e.type===we.f.EndOfSegment})).map((function(e){return e.value})),v=function(e,t){for(var n=s.Z.getCurrent().MINIMUM_SEGMENT_SIZE,r=Math.max(1/60,n),i=e.start+r,a=e.end-r,o=[],u=t.length-1;u>=0;u--){var l=t[u],d=l.infos.representation;if(1===l.status&&!1!==d.decipherable&&d.isSupported){var c=l.infos.segment,f=c.time/c.timescale;((c.complete?f+c.duration/c.timescale:l.end)>i&&f<a||l.end>i&&l.start<a)&&o.unshift(l)}}return o}({start:Math.max(d.start-.5,0),end:d.end+.5},o.getInventory()),p=Be({content:e,bufferedSegments:v,currentPlaybackTime:n.getCurrentTime(),fastSwitchThreshold:r,getBufferedHistory:o.getSegmentHistory.bind(o),neededRange:d,segmentsBeingPushed:f,maxBufferSize:a}),h=p.segmentsToLoad,m=p.segmentsOnHold,g=p.isBufferFull,y=h.map((function(e){return{priority:ze(e.time,l),segment:e}})),_=u.index.isInitialized()&&!u.index.isStillAwaitingFutureSegments()&&d.hasReachedPeriodEnd&&0===y.length&&0===m.length,b=null;return f.length>0&&(b=Math.min.apply(Math,f.map((function(e){return e.segment.time})))),m.length>0&&(b=null!==b?Math.min(b,m[0].time):m[0].time),y.length>0&&(b=null!==b?Math.min(b,y[0].segment.time):y[0].segment.time),{imminentDiscontinuity:Ue(e,d,b,_,v),hasFinishedLoading:_,neededSegments:y,isBufferFull:g,shouldRefreshManifest:c}}function Ge(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 We(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 We(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 We(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 He(e,t,n){return je.apply(this,arguments)}function je(){return(je=(0,r.Z)(o().mark((function e(t,n,r){var i,a,u,d,c,f,v,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=s.Z.getCurrent().BUFFER_GC_GAPS.CALM,a=s.Z.getCurrent().BUFFER_GC_GAPS.BEEFY,l.Z.warn("Stream: Running garbage collector"),u=n.getBufferedRanges(),0===(d=qe(t,u,i)).length&&(d=qe(t,u,a)),l.Z.hasLevel("DEBUG")&&l.Z.debug("Stream: GC cleaning",d.map((function(e){return"start: "+e.start+" - end "+e.end})).join(", ")),c=Ge(d);case 8:if((f=c()).done){e.next=16;break}if(v=f.value,p=v.start,h=v.end,!(p<h)){e.next=14;break}return e.next=14,n.removeBuffer(p,h,r);case 14:e.next=8;break;case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qe(e,t,n){for(var r=(0,m.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&&(l.Z.hasLevel("DEBUG")&&l.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 Ye(e,t,n,r){return Xe.apply(this,arguments)}function Xe(){return(Xe=(0,r.Z)(o().mark((function e(t,n,r,i){var a,s,l,d,c,f;return o().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 21:e.next=27;break;case 5:if(e.prev=5,e.t0=e.catch(0),!(i.isCancelled()&&e.t0 instanceof p.FU)){e.next=11;break}throw e.t0;case 11:if(e.t0 instanceof Error&&"QuotaExceededError"===e.t0.name){e.next=14;break}throw s=e.t0 instanceof Error?e.t0.toString():"An unknown error happened when pushing content",new u.Z("BUFFER_APPEND_ERROR",s,{adaptation:r.inventoryInfos.adaptation});case 14:return l=t.getReference().getValue(),d=l.position,c=null!==(a=d.pending)&&void 0!==a?a:d.last,e.prev=16,e.next=19,He(c,n,i);case 19:return e.next=21,n.pushChunk(r,i);case 23:throw e.prev=23,e.t1=e.catch(16),f=e.t1 instanceof Error?e.t1.toString():"Could not clean the buffer",new u.Z("BUFFER_FULL_ERROR",f,{adaptation:r.inventoryInfos.adaptation});case 27:case"end":return e.stop()}}),e,null,[[0,5],[16,23]])})))).apply(this,arguments)}function Qe(){return Qe=(0,r.Z)(o().mark((function e(t,n){var r,i,a,s,u,l,d,c,v,p;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,s=t.segment,u=t.segmentData,l=t.segmentBuffer,null===n.cancellationError){e.next=3;break}throw n.cancellationError;case 3:return d=i.representation.getMimeTypeString(),c={initSegmentUniqueId:a,chunk:null,timestampOffset:0,appendWindow:[void 0,void 0],codec:d},v=(0,f.Z)({segment:s,chunkSize:void 0,start:0,end:0},i),e.next=8,Ye(r,l,{data:c,inventoryInfos:v},n);case 8:return p=l.getBufferedRanges(),e.abrupt("return",{content:i,segment:s,buffered:p,segmentData:u});case 10:case"end":return e.stop()}}),e)}))),Qe.apply(this,arguments)}function $e(){return $e=(0,r.Z)(o().mark((function e(t,n){var r,i,a,u,l,d,c,v,p,h,m,g,y,_,b,S,T,E,k,w,A,I,Z;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.playbackObserver,i=t.content,a=t.initSegmentUniqueId,u=t.parsedSegment,l=t.segment,d=t.segmentBuffer,null!==u.chunkData){e.next=3;break}return e.abrupt("return",null);case 3:if(null===n.cancellationError){e.next=5;break}throw n.cancellationError;case 5:return p=u.chunkData,h=u.chunkInfos,m=u.chunkOffset,g=u.chunkSize,y=u.appendWindow,_=i.representation.getMimeTypeString(),b=s.Z.getCurrent(),S=b.APPEND_WINDOW_SECURITIES,T=[void 0!==y[0]?Math.max(0,y[0]-S.START):void 0,void 0!==y[1]?y[1]+S.END:void 0],E={initSegmentUniqueId:a,chunk:p,timestampOffset:m,appendWindow:T,codec:_},k=null!==(c=null==h?void 0:h.time)&&void 0!==c?c:l.time,w=null!==(v=null==h?void 0:h.duration)&&void 0!==v?v:l.duration,A=k+w,void 0!==T[0]&&(k=Math.max(k,T[0])),void 0!==T[1]&&(A=Math.min(A,T[1])),I=(0,f.Z)({segment:l,chunkSize:g,start:k,end:A},i),e.next=18,Ye(r,d,{data:E,inventoryInfos:I},n);case 18:return Z=d.getBufferedRanges(),e.abrupt("return",{content:i,segment:l,buffered:Z,segmentData:p});case 20:case"end":return e.stop()}}),e)}))),$e.apply(this,arguments)}var Je=function(e,t,n){var r=e.content,i=e.options,a=e.playbackObserver,o=e.segmentBuffer,u=e.segmentFetcher,d=e.terminate,c=r.period,h=r.adaptation,m=r.representation,g=i.bufferGoal,y=i.maxBufferSize,_=i.drmSystemId,b=i.fastSwitchThreshold,S=h.type,T=new p.ZP;T.linkToSignal(n);var E=new p.ZP;E.linkToSignal(T.signal);var k={segment:m.index.getInitSegment(),uniqueId:null,isLoaded:!1};T.signal.register((function(){null!==k.uniqueId&&o.freeInitSegment(k.uniqueId)}));var w=new v.Z({initSegment:null,segmentQueue:[]},E.signal),A=null!==k.segment;A||(k.isLoaded=!0);var I=!1;if(void 0!==_){var Z=m.getEncryptionData(_);if(Z.length>0&&Z.every((function(e){return void 0!==e.keyIds}))&&(I=!0,t.encryptionDataEncountered(Z.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}var x=new Le(r,w,u,A);return x.addEventListener("error",(function(e){E.signal.isCancelled()||(T.cancel(),t.error(e))})),x.addEventListener("parsedInitSegment",M),x.addEventListener("parsedMediaSegment",M),x.addEventListener("emptyQueue",R),x.addEventListener("requestRetry",(function(e){if(t.warning(e.error),!E.signal.isCancelled()){var n=e.segment,r=m.index;!1===r.isSegmentStillAvailable(n)?R():r.canBeOutOfSyncError(e.error,n)&&t.manifestMightBeOufOfSync()}})),x.addEventListener("fullyLoadedSegment",(function(e){o.endOfSegment((0,f.Z)({segment:e},r),T.signal).catch(C)})),x.start(),E.signal.register((function(){x.removeEventListener(),x.stop()})),a.listen(R,{includeLastObservation:!1,clearSignal:E.signal}),r.manifest.addEventListener("manifestUpdate",R,E.signal),g.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),y.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),d.onUpdate(R,{emitCurrentValue:!1,clearSignal:E.signal}),void R();function R(){var e,n;if(!E.isUsed()){var i=a.getReference().getValue(),u=null!==(e=i.position.pending)&&void 0!==e?e:i.position.last,f=Ke(r,u,a,b.getValue(),g.getValue(),y.getValue(),o),v=f.neededSegments,p=null;if(m.index.isInitialized()){if(v.length>0&&!k.isLoaded&&null!==k.segment){var h=v[0].priority;p={segment:k.segment,priority:h}}}else if(null===k.segment)l.Z.warn("Stream: Uninitialized index without an initialization segment");else if(k.isLoaded)l.Z.warn("Stream: Uninitialized index with an already loaded initialization segment");else{var _=null!==(n=i.position.pending)&&void 0!==n?n:i.position.last;p={segment:k.segment,priority:ze(c.start,_)}}var A=d.getValue();if(null===A)w.setValue({initSegment:p,segmentQueue:v});else{if(A.urgent)return l.Z.debug("Stream: Urgent switch, terminate now.",S),w.setValue({initSegment:null,segmentQueue:[]}),w.finish(),E.cancel(),void t.terminating();var I=v[0],Z=x.getRequestedInitSegment(),R=x.getRequestedMediaSegment(),M=null===R||void 0===I||R.id!==I.segment.id?[]:[I],P=null===Z?null:p;if(w.setValue({initSegment:P,segmentQueue:M}),0===M.length&&null===P)return l.Z.debug("Stream: No request left, terminate",S),w.finish(),E.cancel(),void t.terminating()}if(t.streamStatusUpdate({period:c,position:i.position.last,bufferType:S,imminentDiscontinuity:f.imminentDiscontinuity,isEmptyStream:!1,hasFinishedLoading:f.hasFinishedLoading,neededSegments:f.neededSegments}),!E.signal.isCancelled()){var D=s.Z.getCurrent().UPTO_CURRENT_POSITION_CLEANUP;if(f.isBufferFull){var N=Math.max(0,u-D);N>0&&o.removeBuffer(0,N,T.signal).catch(C)}f.shouldRefreshManifest&&t.needsManifestRefresh()}}}function M(e){if(!T.isUsed())if("init"===e.segmentType){if(k.isLoaded=!0,!I){var n=m.getAllEncryptionData();if(n.length>0&&(t.encryptionDataEncountered(n.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}if(null!==e.initializationData){var i=m.uniqueId;k.uniqueId=i,o.declareInitSegment(i,e.initializationData),function(e,t){return Qe.apply(this,arguments)}({playbackObserver:a,content:r,initSegmentUniqueId:i,segment:e.segment,segmentData:e.initializationData,segmentBuffer:o},T.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(C)}R()}else{var s=e.inbandEvents,u=e.needsManifestRefresh,l=e.protectionDataUpdate;if(!I&&l){var d=m.getAllEncryptionData();if(d.length>0&&(t.encryptionDataEncountered(d.map((function(e){return(0,f.Z)({content:r},e)}))),T.isUsed()))return}if(!0===u&&(t.needsManifestRefresh(),T.isUsed()))return;if(void 0!==s&&s.length>0&&(t.inbandEvent(s),T.isUsed()))return;var c=k.uniqueId;(function(e,t){return $e.apply(this,arguments)})({playbackObserver:a,content:r,initSegmentUniqueId:c,parsedSegment:e,segment:e.segment,segmentBuffer:o},T.signal).then((function(e){null!==e&&t.addedSegment(e)})).catch(C)}}function C(e){T.isUsed()&&e instanceof p.FU||(T.cancel(),t.error(e))}};var et=function(e,t,n){var r=e.playbackObserver,i=e.content,a=e.options,o=e.representationEstimator,d=e.segmentBuffer,c=e.segmentFetcherCreator,m=e.wantedBufferAhead,g=e.maxVideoBufferSize,y="direct"===a.manualBitrateSwitchingMode,_=i.manifest,b=i.period,S=i.adaptation,T=new p.ZP;T.linkToSignal(n);var E,k=new Map,w=new v.Z(null,T.signal),A=function(e,t,n,r,i,a){var o=e.manifest,s=e.adaptation,l=new v.Z([],a);p(),o.addEventListener("decipherabilityUpdate",p);var d=a.register(h),c=t(e,n,l,r,a),f=c.estimates;return{abrCallbacks:c.callbacks,estimateRef:f};function p(){var e=s.getPlayableRepresentations();if(0===e.length){var t=new u.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+s.type+" Adaptation can be played",{adaptation:s});return h(),void i(t)}var n=l.getValue();n.length===e.length&&n.every((function(t,n){return t.id===e[n].id}))||l.setValue(e)}function h(){o.removeEventListener("decipherabilityUpdate",p),void 0!==d&&d()}}(i,o,w,r,(function(e){T.cancel(),t.error(e)}),T.signal),I=A.estimateRef,Z=A.abrCallbacks,x=c.createSegmentFetcher(S.type,{onRequestBegin:Z.requestBegin,onRequestEnd:Z.requestEnd,onProgress:Z.requestProgress,onMetrics:Z.metrics});function R(e,t,n,i){var o=new p.ZP;o.linkToSignal(T.signal);var s=(0,v.l)(m,(function(t){return t*function(e){var t=k.get(e.id),n=void 0!==t?t:1;void 0===t&&k.set(e.id,n);return n}(e)}),o.signal),u="video"===S.type?g:new v.Z(1/0);l.Z.info("Stream: changing representation",S.type,e.id,e.bitrate);var c=(0,f.Z)({},i,{error:function(r){var a,o=(0,z.Z)(r,{defaultCode:"NONE",defaultReason:"Unknown `RepresentationStream` error"});if("BUFFER_FULL_ERROR"!==o.code)i.error(r);else{var s=m.getValue(),u=.7*(null!==(a=k.get(e.id))&&void 0!==a?a:1);if(u<=.05||s*u<=2)throw o;k.set(e.id,u),(0,$.Z)(4e3,T.signal).then((function(){return R(e,t,n,i)})).catch(h.Z)}},terminating:function(){o.cancel(),i.terminating()}});Je({playbackObserver:r,content:{representation:e,adaptation:S,period:b,manifest:_},segmentBuffer:d,segmentFetcher:x,terminate:t,options:{bufferGoal:s,maxBufferSize:u,drmSystemId:a.drmSystemId,fastSwitchThreshold:n}},c,T.signal)}I.onUpdate((function(e){var n=e.bitrate;void 0!==n&&n!==E&&(E=n,l.Z.debug("Stream: new "+S.type+" bitrate estimate",n),t.bitrateEstimationChange({type:S.type,bitrate:n}))}),{emitCurrentValue:!0,clearSignal:T.signal}),function e(n){var r=new p.ZP;r.linkToSignal(T.signal);var i=I.getValue(),o=i.representation,u=i.manual;if(null===o)return;if(y&&u&&!n){var d=s.Z.getCurrent().DELTA_POSITION_AFTER_RELOAD;return Ce()((function(){if(!r.isUsed()&&I.getValue().manual){var e=d.bitrateSwitch;return t.waitingMediaSourceReload({bufferType:S.type,period:b,timeOffset:e,stayInPeriod:!0})}}))}var c=new v.Z(null,r.signal);I.onUpdate((function(e){if(null!==e.representation&&e.representation.id!==o.id)return e.urgent?(l.Z.info("Stream: urgent Representation switch",S.type),c.setValue({urgent:!0})):(l.Z.info("Stream: slow Representation switch",S.type),c.setValue({urgent:!1}))}),{clearSignal:r.signal,emitCurrentValue:!0});var f=new v.Z(0);a.enableFastSwitching&&I.onUpdate((function(e){f.setValueIfChanged(null==e?void 0:e.knownStableBitrate)}),{clearSignal:r.signal,emitCurrentValue:!0});var h={type:S.type,period:b,representation:o};if(w.setValue(o),T.isUsed())return;if(t.representationChange(h),T.isUsed())return;var m={streamStatusUpdate:t.streamStatusUpdate,encryptionDataEncountered:t.encryptionDataEncountered,manifestMightBeOufOfSync:t.manifestMightBeOufOfSync,needsManifestRefresh:t.needsManifestRefresh,inbandEvent:t.inbandEvent,warning:t.warning,error:function(e){T.cancel(),t.error(e)},addedSegment:function(e){Z.addedSegment(e),T.isUsed()||t.addedSegment(e)},terminating:function(){if(!r.isUsed())return r.cancel(),e(!1)}};R(o,c,f,m)}(!0)},tt=n(9252);var nt=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,b.Z)(i,(function(e){return(0,tt.Z)(e,"codecs=")})),l=(0,b.Z)(s,(function(e){return(0,tt.Z)(e,"codecs=")}));if(void 0===u||void 0===l)return!1;var d=u.substring(7),c=l.substring(7);return d.split(".")[0]===c.split(".")[0]};function rt(e,t,n,r,i){if(void 0!==e.codec&&"reload"===i.onCodecSwitch&&!function(e,t){return e.getPlayableRepresentations().some((function(e){return nt(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,m.JN)(a),u=t.start,l=null==t.end?1/0:t.end,d=(0,m.tn)(o,[{start:u,end:l}]);if(0===d.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 f=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),v=(0,m.uH)(d,f);if(0===v.length)return{type:"continue",value:void 0};var p=r.currentTime,h=i.audioTrackSwitchingMode;if(("video"===n.type||"audio"===n.type&&"reload"===h)&&(0,m.Ti)({start:u,end:l},p)&&(r.readyState>1||!n.getPlayableRepresentations().some((function(t){var n;return nt(t.getMimeTypeString(),null!==(n=e.codec)&&void 0!==n?n:"")})))&&!(0,m.A1)(f,p))return{type:"needs-reload",value:void 0};var g="audio"===n.type&&"direct"===h,y=[],_=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!==_&&(void 0===_.bufferedEnd||t.start-_.bufferedEnd<1)&&y.push({start:0,end:t.start+1});var b=n.type,S=s.Z.getCurrent().ADAPTATION_SWITCH_BUFFER_PADDINGS,T=S[b].before;null==T&&(T=0);var E=S[b].after;if(null==E&&(E=0),g||y.push({start:p-T,end:p+E}),void 0!==t.end){var k=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!==k&&(void 0===k.bufferedStart||k.bufferedStart-t.end<1)&&y.push({start:t.end-1,end:Number.MAX_VALUE})}var w=(0,m.uH)(v,y);return 0===w.length?{type:"continue",value:void 0}:g?{type:"flush-buffer",value:w}:{type:"clean-buffer",value:w}}function it(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 at(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 at(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 at(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 ot(e,t,n,r){var i=e.getStatus(t);if("initialized"===i.type)return l.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 u.Z("NO_PLAYABLE_REPRESENTATION","No Representation in the chosen "+e.type+" Adaptation can be played",{adaptation:e})}return t[0].getMimeTypeString()}(n),o="text"===t?r.textTrackOptions:void 0;return e.createSegmentBuffer(t,a,o)}function st(e,t,n,r,i,a){var o=r.period,s=!1;function u(){var r=e.getReference().getValue(),a=t.getValue(),u=r.position.last;void 0!==o.end&&u+a>=o.end&&(l.Z.debug('Stream: full "empty" AdaptationStream',n),s=!0),i.streamStatusUpdate({period:o,bufferType:n,position:u,imminentDiscontinuity:null,isEmptyStream:!0,hasFinishedLoading:s,neededSegments:[]})}t.onUpdate(u,{emitCurrentValue:!1,clearSignal:a}),e.listen(u,{includeLastObservation:!1,clearSignal:a}),u()}var ut=function(e,t,n){var i=e.bufferType,a=e.content,u=e.garbageCollectors,d=e.playbackObserver,c=e.representationEstimator,h=e.segmentFetcherCreator,g=e.segmentBuffersStore,y=e.options,_=e.wantedBufferAhead,b=e.maxVideoBufferSize,S=a.period,T=new v.Z(void 0,n);if(t.periodStreamReady({type:i,period:S,adaptationRef:T}),!n.isCancelled()){var E,k=!0;T.onUpdate((function(e){(0,r.Z)(o().mark((function r(){var a,c,f,v,h,m,b,T,I,Z,x,R,M,C,P,D;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==e){r.next=2;break}return r.abrupt("return");case 2:if((c=new p.ZP).linkToSignal(n),null==E||E.cancel(),E=c,null!==e){r.next=34;break}if(l.Z.info("Stream: Set no "+i+" Adaptation. P:",S.start),"initialized"!==(f=g.getStatus(i)).type){r.next=26;break}if(l.Z.info("Stream: Clearing previous "+i+" SegmentBuffer"),!Re.isNative(i)){r.next=15;break}return r.abrupt("return",A(0,!0,c.signal));case 15:if(v=null!==(a=S.end)&&void 0!==a?a:1/0,!(S.start>v)){r.next=20;break}l.Z.warn("Stream: Can't free buffer: period's start is after its end"),r.next=24;break;case 20:return r.next=22,f.value.removeBuffer(S.start,v,c.signal);case 22:if(!c.isUsed()){r.next=24;break}return r.abrupt("return");case 24:r.next=30;break;case 26:if("uninitialized"!==f.type){r.next=30;break}if(g.disableSegmentBuffer(i),!c.isUsed()){r.next=30;break}return r.abrupt("return");case 30:if(t.adaptationChange({type:i,adaptation:null,period:S}),!c.isUsed()){r.next=33;break}return r.abrupt("return");case 33:return r.abrupt("return",st(d,_,i,{period:S},t,c.signal));case 34:if(h=s.Z.getCurrent(),m=h.DELTA_POSITION_AFTER_RELOAD,b=k?0:"audio"===i?m.trackSwitch.audio:"video"===i?m.trackSwitch.video:m.trackSwitch.other,k=!1,!Re.isNative(i)||"disabled"!==g.getStatus(i).type){r.next=39;break}return r.abrupt("return",A(b,!0,c.signal));case 39:if(l.Z.info("Stream: Updating "+i+" adaptation","A: "+e.id,"P: "+S.start),t.adaptationChange({type:i,adaptation:e,period:S}),!c.isUsed()){r.next=43;break}return r.abrupt("return");case 43:if(T=d.getReadyState(),I=ot(g,i,e,y),Z={currentTime:d.getCurrentTime(),readyState:T},"needs-reload"!==(x=rt(I,S,e,Z,y)).type){r.next=49;break}return r.abrupt("return",A(b,!0,c.signal));case 49:return r.next=51,g.waitForUsableBuffers(c.signal);case 51:if(!c.isUsed()){r.next=53;break}return r.abrupt("return");case 53:if("flush-buffer"!==x.type&&"clean-buffer"!==x.type){r.next=67;break}R=it(x.value);case 55:if((M=R()).done){r.next=63;break}return C=M.value,P=C.start,D=C.end,r.next=59,I.removeBuffer(P,D,c.signal);case 59:if(!c.isUsed()){r.next=61;break}return r.abrupt("return");case 61:r.next=55;break;case 63:if("flush-buffer"!==x.type){r.next=67;break}if(t.needsBufferFlush(),!c.isUsed()){r.next=67;break}return r.abrupt("return");case 67:u.get(I)(c.signal),w(e,I,c.signal);case 69:case"end":return r.stop()}}),r)})))().catch((function(e){e instanceof p.FU||(null==E||E.cancel(),t.error(e))}))}),{clearSignal:n,emitCurrentValue:!0})}function w(e,n,r){var o=a.manifest,s=function(e,t){return e.deriveReadOnlyObserver((function(e,n){var r=new v.Z(i(),n);return e.onUpdate(a,{clearSignal:n,emitCurrentValue:!1}),r;function i(){var n=e.getValue(),r=t.getBufferedRanges(),i=(0,m.L7)(r,n.position.last);return(0,f.Z)({},n,{bufferGap:i})}function a(){r.setValue(i())}}))}(d,n);et({content:{manifest:o,period:S,adaptation:e},options:y,playbackObserver:s,representationEstimator:c,segmentBuffer:n,segmentFetcherCreator:h,wantedBufferAhead:_,maxVideoBufferSize:b},Object.assign(Object.assign({},t),{error:function(e){if(!Re.isNative(i)){l.Z.error("Stream: "+i+" Stream crashed. Aborting it.",e instanceof Error?e:""),g.disposeSegmentBuffer(i);var n=(0,z.Z)(e,{defaultCode:"NONE",defaultReason:"Unknown `AdaptationStream` error"});if(t.warning(n),r.isCancelled())return;return st(d,_,i,{period:S},t,r)}l.Z.error("Stream: "+i+" Stream crashed. Stopping playback.",e instanceof Error?e:""),t.error(e)}}),r)}function A(e,n,r){Ce()((function(){d.listen((function(){t.waitingMediaSourceReload({bufferType:i,period:S,timeOffset:e,stayInPeriod:n})}),{includeLastObservation:!0,clearSignal:r})}))}};function lt(e,t){if(0===t.length)return[];e.synchronizeInventory();for(var n,r=[],i=e.getInventory(),a=function(){var e=i[o];if(t.some((function(t){return e.infos.period.id===t.period.id&&e.infos.adaptation.id===t.adaptation.id&&e.infos.representation.id===t.representation.id}))){var n=e.bufferedStart,a=e.bufferedEnd;if(void 0===n||void 0===a)return l.Z.warn("SO: No buffered start or end found from a segment."),{v:[{start:0,end:Number.MAX_VALUE}]};var s=r[r.length-1];void 0!==s&&s.end===n?s.end=a:r.push({start:n,end:a})}},o=0;o<i.length;o++)if(n=a())return n.v;return r}function dt(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 ct(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 ct(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 ct(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 ft(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 vt=function(e,t,n,i,a,d,c,f){for(var h,m=e.manifest,g=e.initialPeriod,y=d.maxBufferAhead,_=d.maxBufferBehind,b=d.wantedBufferAhead,S=d.maxVideoBufferSize,T=s.Z.getCurrent(),E=T.MINIMUM_MAX_BUFFER_AHEAD,k=T.MAXIMUM_MAX_BUFFER_AHEAD,w=T.MAXIMUM_MAX_BUFFER_BEHIND,A=new De((function(e){var n,r,i=e.bufferType,a=null!==(n=w[i])&&void 0!==n?n:1/0,o=null!==(r=k[i])&&void 0!==r?r:1/0;return function(n){Ne({segmentBuffer:e,playbackObserver:t,maxBufferBehind:(0,v.l)(_,(function(e){return Math.min(e,a)}),n),maxBufferAhead:(0,v.l)(y,(function(e){var t,n=Math.max(e,null!==(t=E[i])&&void 0!==t?t:0);return Math.min(n,o)}),n)},n)}})),I=dt(i.getBufferTypes());!(h=I()).done;){Z(h.value,g)}function Z(e,n){var a=new Pe.Z((function(e,t){return e.start-t.start})),s=!1,d=new p.ZP;return d.linkToSignal(f),t.listen((function(t){var n,r,i=t.position,o=null!==(n=i.pending)&&void 0!==n?n:i.last;if(s&&function(e){var t=a.head(),n=a.last();if(null==t||null==n)return!0;return t.start>e||(null==n.end?1/0:n.end)<e}(o)){for(l.Z.info("Stream: Destroying all PeriodStreams due to out of bounds situation",e,o),s=!1;a.length()>0;){var u=a.get(a.length()-1);a.removeElement(u),c.periodStreamCleared({type:e,period:u})}d.cancel(),(d=new p.ZP).linkToSignal(f);var h=null!==(r=m.getPeriodForTime(o))&&void 0!==r?r:m.getNextPeriod(o);if(void 0===h)return l.Z.warn("Stream: The wanted position is not found in the Manifest."),void(s=!0);v(h)}}),{clearSignal:f,includeLastObservation:!0}),m.addEventListener("decipherabilityUpdate",(function(e){(function(e){return h.apply(this,arguments)})(e).catch((function(e){d.cancel(),c.error(e)}))}),f),v(n);function v(t){var n=Object.assign(Object.assign({},c),{waitingMediaSourceReload:function(e){var t=a.head();void 0===t||t.id!==e.period.id?c.lockedStream({bufferType:e.bufferType,period:e.period}):c.needsMediaSourceReload({timeOffset:e.timeOffset,minimumPosition:e.stayInPeriod?e.period.start:void 0,maximumPosition:e.stayInPeriod?e.period.end:void 0})},periodStreamReady:function(e){s=!0,a.add(e.period),c.periodStreamReady(e)},periodStreamCleared:function(e){a.removeElement(e.period),c.periodStreamCleared(e)},error:function(e){d.cancel(),c.error(e)}});x(e,t,n,d.signal)}function h(){return h=(0,r.Z)(o().mark((function n(r){var h,g,y,_,b,S,T,E,k,w,A,I,Z;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h=i.getStatus(e),0!==(g=r.filter((function(t){return t.adaptation.type===e}))).length&&"initialized"===h.type&&!g.every((function(e){return!0===e.representation.decipherable}))){n.next=4;break}return n.abrupt("return");case 4:for(y=h.value,_=g.filter((function(e){return void 0===e.representation.decipherable})),b=g.filter((function(e){return!1===e.representation.decipherable})),S=lt(y,b),T=lt(y,_),s=!1,l.Z.info("Stream: Destroying all PeriodStreams for decipherability matters",e);a.length()>0;)E=a.get(a.length()-1),a.removeElement(E),c.periodStreamCleared({type:e,period:E});d.cancel(),(d=new p.ZP).linkToSignal(f),k=0,w=[].concat(S,T);case 16:if(!(k<w.length)){n.next=26;break}if(A=w[k],I=A.start,Z=A.end,!(I<Z)){n.next=23;break}if(!f.isCancelled()){n.next=21;break}return n.abrupt("return");case 21:return n.next=23,y.removeBuffer(I,Z,f);case 23:k++,n.next=16;break;case 26:Ce()((function(){var e;if(!f.isCancelled()){var n=t.getReference().getValue();if(ft(n,S)){if(c.needsDecipherabilityFlush(),f.isCancelled())return}else if(ft(n,T)&&(c.needsBufferFlush(),f.isCancelled()))return;var r=null!==(e=n.position.pending)&&void 0!==e?e:n.position.last,i=m.getPeriodForTime(r);null!=i?v(i):c.error(new u.Z("MEDIA_TIME_NOT_FOUND","The wanted position is not found in the Manifest."))}}));case 27:case"end":return n.stop()}}),n)}))),h.apply(this,arguments)}}function x(e,r,o,s){l.Z.info("Stream: Creating new Stream for",e,r.start);var u=null,c=new p.ZP;c.linkToSignal(s),t.listen((function(t,n){var i,a,s=t.position,u=null!==(i=s.pending)&&void 0!==i?i:s.last;if(void 0!==r.end&&u>=r.end){var d=m.getPeriodAfter(r);if(r.containsTime(u,d))return;l.Z.info("Stream: Destroying PeriodStream as the current playhead moved above it",e,r.start,null!==(a=s.pending)&&void 0!==a?a:s.last,r.end),n(),o.periodStreamCleared({type:e,period:r}),c.cancel()}}),{clearSignal:s,includeLastObservation:!0});var f={bufferType:e,content:{manifest:m,period:r},garbageCollectors:A,maxVideoBufferSize:S,segmentFetcherCreator:a,segmentBuffersStore:i,options:d,playbackObserver:t,representationEstimator:n,wantedBufferAhead:b},v=Object.assign(Object.assign({},o),{streamStatusUpdate:function(t){if(t.hasFinishedLoading){var n=m.getPeriodAfter(r);null!==n&&function(t){if(null!==u){if(u.period.id===t.id)return;l.Z.warn("Stream: Creating next `PeriodStream` while one was already created.",e,t.id,u.period.id),o.periodStreamCleared({type:e,period:u.period}),u.canceller.cancel()}var n=new p.ZP;n.linkToSignal(s),u={canceller:n,period:t},x(e,t,o,u.canceller.signal)}(n)}else null!==u&&(l.Z.info("Stream: Destroying next PeriodStream due to current one being active",e,u.period.start),o.periodStreamCleared({type:e,period:u.period}),u.canceller.cancel(),u=null);o.streamStatusUpdate(t)},error:function(e){null!==u&&(u.canceller.cancel(),u=null),c.cancel(),o.error(e)}});ut(f,v,c.signal)}},pt=vt,ht=n(9420);function mt(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 gt(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 gt(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 gt(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 yt=function(e){function t(t,n,r){var i;(i=e.call(this)||this)._canceller=new p.ZP,i._manifest=t,i._activeStreams=new Map,i._allBufferTypes=r,i._lastCurrentPeriodId=null;var a=new _t(t);i._maximumPositionCalculator=a;var o=i._canceller.signal;return n.listen((function(e){var n,r=e.position,o=null!==(n=r.pending)&&void 0!==n?n:r.last;if(o<t.getMinimumSafePosition()){var s=new u.Z("MEDIA_TIME_BEFORE_MANIFEST","The current position is behind the earliest time announced in the Manifest.");i.trigger("warning",s)}else if(o>a.getMaximumAvailablePosition()){var l=new u.Z("MEDIA_TIME_AFTER_MANIFEST","The current position is after the latest time announced in the Manifest.");i.trigger("warning",l)}}),{includeLastObservation:!0,clearSignal:o}),t.addEventListener("manifestUpdate",(function(){i.trigger("endingPositionChange",i._getManifestEndTime()),o.isCancelled()||i._checkEndOfStream()}),o),i}(0,i.Z)(t,e);var n=t.prototype;return n.getCurrentEndingTime=function(){return this._getManifestEndTime()},n.onAdaptationChange=function(e,t,n){if(this._manifest.isLastPeriodKnown){var r=this._manifest.periods[this._manifest.periods.length-1];if(t.id===(null==r?void 0:r.id)&&("audio"===e||"video"===e)){"audio"===e?this._maximumPositionCalculator.updateLastAudioAdaptation(n):this._maximumPositionCalculator.updateLastVideoAdaptation(n);var i=this._maximumPositionCalculator.getEndingPosition(),a=void 0!==i?{isEnd:!0,endingPosition:i}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()};this.trigger("endingPositionChange",a)}}this._canceller.isUsed()||null===n&&this._addActivelyLoadedPeriod(t,e)},n.onRepresentationChange=function(e,t){this._addActivelyLoadedPeriod(t,e)},n.onPeriodCleared=function(e,t){this._removeActivelyLoadedPeriod(t,e)},n.onLastSegmentFinishedLoading=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod||(t.hasFinishedLoadingLastPeriod=!0,this._checkEndOfStream())},n.onLastSegmentLoadingResume=function(e){var t=this._lazilyCreateActiveStreamInfo(e);t.hasFinishedLoadingLastPeriod&&(t.hasFinishedLoadingLastPeriod=!1,this._checkEndOfStream())},n.dispose=function(){this.removeEventListener(),this._canceller.cancel()},n._addActivelyLoadedPeriod=function(e,t){var n=this._lazilyCreateActiveStreamInfo(t);n.activePeriods.has(e)||(n.activePeriods.add(e),this._checkCurrentPeriod())},n._removeActivelyLoadedPeriod=function(e,t){var n=this._activeStreams.get(t);void 0!==n&&n.activePeriods.has(e)&&(n.activePeriods.removeElement(e),this._checkCurrentPeriod())},n._checkCurrentPeriod=function(){var e=this;if(0!==this._allBufferTypes.length){var t=this._activeStreams.get(this._allBufferTypes[0]);if(void 0!==t)for(var n,r,i=function(){for(var t=r.value,n=!0,i=1;i<e._allBufferTypes.length;i++){var a=e._activeStreams.get(e._allBufferTypes[i]);if(void 0===a)return{v:void 0};if(!a.activePeriods.toArray().some((function(e){return e.id===t.id}))){n=!1;break}}if(n)return e._lastCurrentPeriodId!==t.id&&(e._lastCurrentPeriodId=t.id,e.trigger("periodChange",t)),{v:void 0}},a=mt(t.activePeriods.toArray());!(r=a()).done;)if(n=i())return n.v}},n._getManifestEndTime=function(){var e=this._maximumPositionCalculator.getEndingPosition();return void 0!==e?{isEnd:!0,endingPosition:e}:{isEnd:!1,endingPosition:this._maximumPositionCalculator.getMaximumAvailablePosition()}},n._lazilyCreateActiveStreamInfo=function(e){var t=this._activeStreams.get(e);return void 0===t&&(t={activePeriods:new Pe.Z((function(e,t){return e.start-t.start})),hasFinishedLoadingLastPeriod:!1},this._activeStreams.set(e,t)),t},n._checkEndOfStream=function(){var e=this;this._manifest.isLastPeriodKnown&&(this._allBufferTypes.every((function(t){var n=e._activeStreams.get(t);return void 0!==n&&n.hasFinishedLoadingLastPeriod}))?this.trigger("endOfStream",null):this.trigger("resumeStream",null))},t}(G.Z),_t=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(){if(this._manifest.isDynamic)return 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 e=bt(this._lastVideoAdaptation);return"number"!=typeof e?this._manifest.getMaximumSafePosition():e}if(null===this._lastVideoAdaptation){var t=bt(this._lastAudioAdaptation);return"number"!=typeof t?this._manifest.getMaximumSafePosition():t}var n=bt(this._lastAudioAdaptation),r=bt(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?this._manifest.getMaximumSafePosition():Math.min(n,r)},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=St(this._lastVideoAdaptation))&&void 0!==e?e:void 0;if(null===this._lastVideoAdaptation)return null!==(t=St(this._lastAudioAdaptation))&&void 0!==t?t:void 0;var n=St(this._lastAudioAdaptation),r=St(this._lastVideoAdaptation);return"number"!=typeof n||"number"!=typeof r?void 0:Math.min(n,r)}},e}();function bt(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,W.Z)(r)?a:Math.min(r,a))}return r}function St(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,W.Z)(r)?a:Math.min(r,a))}return r}var Tt=n(5767),Et=n(3774),kt=n(3038),wt=n(6923);function At(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&&(l.Z.info("Init: Aborting SourceBuffer before removing"),o.abort()),l.Z.info("Init: Removing SourceBuffer from mediaSource"),t.removeSourceBuffer(o)}catch(e){l.Z.warn("Init: Error while disposing SourceBuffer",e instanceof Error?e:"")}}i.length>0&&l.Z.warn("Init: Not all SourceBuffers could have been removed.")}if(l.Z.info("Init: Clearing HTMLMediaElement's src"),(0,Tt.Z)(e),null!==n)try{l.Z.debug("Init: Revoking previous URL"),URL.revokeObjectURL(n)}catch(e){l.Z.warn("Init: Error while revoking the media source URL",e instanceof Error?e:"")}}function It(e,t){return(0,c.Z)(t,(function(n){var r=function(e,t){if(null==Et.J)throw new u.Z("MEDIA_SOURCE_NOT_SUPPORTED","No MediaSource Object was found in the current browser.");var n=(0,wt.Z)(e.src)?e.src:null;At(e,null,n),l.Z.info("Init: Creating MediaSource");var r=new Et.J,i=URL.createObjectURL(r);return l.Z.info("Init: Attaching MediaSource URL to the media element",i),e.src=i,t.register((function(){At(e,r,i)})),r}(e,t);kt.u_(r,(function(){l.Z.info("Init: MediaSource opened"),n(r)}),t)}))}function Zt(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 xt(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 xt(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 xt(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 Rt=kt.x6,Mt=kt.u_,Ct=kt.y4;function Pt(e,t){if(l.Z.debug("Init: Trying to call endOfStream"),"open"===e.readyState){var n=e.sourceBuffers,r=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r.updating&&t.push(r)}return t}(n);if(0===r.length)return l.Z.info("Init: Triggering end of stream"),void e.endOfStream();l.Z.debug("Init: Waiting SourceBuffers to be updated before calling endOfStream.");var i=new p.ZP;i.linkToSignal(t);for(var a,o=Zt(r);!(a=o()).done;){var s=a.value;Ct(s,(function(){i.cancel(),Pt(e,t)}),i.signal)}Rt(n,(function(){i.cancel(),Pt(e,t)}),i.signal)}else l.Z.debug("Init: MediaSource not open, cancel endOfStream")}function Dt(e,t,n){var r;if(!(0,W.Z)(n)){var i=e.getMinimumSafePosition(),a=e.getMaximumSafePosition();if(!(0,W.Z)(n.position))return l.Z.debug("Init: using startAt.minimumPosition"),Math.max(Math.min(n.position,a),i);if(!(0,W.Z)(n.wallClockTime)){l.Z.debug("Init: using startAt.wallClockTime");var o=void 0===e.availabilityStartTime?0:e.availabilityStartTime,u=n.wallClockTime-o;return Math.max(Math.min(u,a),i)}if(!(0,W.Z)(n.fromFirstPosition)){l.Z.debug("Init: using startAt.fromFirstPosition");var d=n.fromFirstPosition;return d<=0?i:Math.min(a,i+d)}if(!(0,W.Z)(n.fromLastPosition)){l.Z.debug("Init: using startAt.fromLastPosition");var c=n.fromLastPosition;return c>=0?a:Math.max(i,a+c)}if(!(0,W.Z)(n.fromLivePosition)){l.Z.debug("Init: using startAt.fromLivePosition");var f=null!==(r=e.getLivePosition())&&void 0!==r?r:a,v=n.fromLivePosition;return v>=0?f:Math.max(i,f+v)}if(!(0,W.Z)(n.percentage)){l.Z.debug("Init: using startAt.percentage");var p=n.percentage;return p>100?a:p<0?i:i+(a-i)*(+p/100)}}var h=e.getMinimumSafePosition();if(e.isLive){var m,g=e.suggestedPresentationDelay,y=e.clockOffset,_=e.getMaximumSafePosition(),b=s.Z.getCurrent().DEFAULT_LIVE_GAP;if(void 0===y)l.Z.info("Init: no clock offset found for a live content, starting close to maximum available position"),m=_;else{l.Z.info("Init: clock offset found for a live content, checking if we can start close to it");var S=void 0===e.availabilityStartTime?0:e.availabilityStartTime,T=(performance.now()+y)/1e3-S;m=Math.min(_,T)}var E=void 0!==g?g:t?b.LOW_LATENCY:b.DEFAULT;return l.Z.debug("Init: "+m+" defined as the live time, applying a live gap of "+E),Math.max(m-E,h)}return l.Z.info("Init: starting at the minimum available position:",h),h}var Nt=n(379),Ot=n(9016),Lt=n(7794),Ut=n(3666);var Bt=31536e3,Ft=function(){function e(e){this._mediaSource=e,this._currentMediaSourceDurationUpdateCanceller=null}var t=e.prototype;return t.updateDuration=function(e,t){null!==this._currentMediaSourceDurationUpdateCanceller&&this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=new p.ZP;var n=this._mediaSource,r=this._currentMediaSourceDurationUpdateCanceller.signal,i=function(e,t){var n=new v.Z("open"===e.readyState,t);return(0,kt.u_)(e,(function(){l.Z.debug("Init: Reacting to MediaSource open in duration updater"),n.setValueIfChanged(!0)}),t),(0,kt.N8)(e,(function(){l.Z.debug("Init: Reacting to MediaSource ended in duration updater"),n.setValueIfChanged(!1)}),t),(0,kt.k6)(e,(function(){l.Z.debug("Init: Reacting to MediaSource close in duration updater"),n.setValueIfChanged(!1)}),t),n}(n,r),a=new p.ZP;a.linkToSignal(r),i.onUpdate((function(){if(a.cancel(),!i.getValue())return;(a=new p.ZP).linkToSignal(r);var o=function(e,t){if(0===e.length){var n=new v.Z(!1);return n.finish(),n}var r=new v.Z(!1,t);o();for(var i=function(){var n=e[a];n.addEventListener("updatestart",o),n.addEventListener("update",o),t.register((function(){n.removeEventListener("updatestart",o),n.removeEventListener("update",o)}))},a=0;a<e.length;a++)i();return r;function o(){for(var t=0;t<e.length;t++){if(e[t].updating)return void r.setValueIfChanged(!0)}r.setValueIfChanged(!1)}}(n.sourceBuffers,a.signal),s=new p.ZP;return s.linkToSignal(a.signal),o.onUpdate((function(r){s.cancel(),(s=new p.ZP).linkToSignal(a.signal),r||zt(n,e,t,s.signal)}),{clearSignal:a.signal,emitCurrentValue:!0})}),{emitCurrentValue:!0,clearSignal:r})},t.stopUpdating=function(){null!==this._currentMediaSourceDurationUpdateCanceller&&(this._currentMediaSourceDurationUpdateCanceller.cancel(),this._currentMediaSourceDurationUpdateCanceller=null)},e}();function Vt(e,t,n){var r=t;n||(r=Ut.lV?1/0:Kt(t));for(var i=0,a=0;a<e.sourceBuffers.length;a++){var o=e.sourceBuffers[a],s=o.buffered.length;s>0&&(i=Math.max(o.buffered.end(s-1)))}if(r===e.duration)return"success";if(i>r){if(i<e.duration)try{l.Z.info("Init: Updating duration to what is currently buffered",i),e.duration=i}catch(e){return l.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}return"partial"}var u=e.duration;try{if(l.Z.info("Init: Updating duration",r),e.duration=r,"open"===e.readyState&&!isFinite(r)){var d=Kt(t);l.Z.info("Init: calling `mediaSource.setLiveSeekableRange`",d),e.setLiveSeekableRange(0,d)}}catch(e){return l.Z.warn("Duration Updater: Can't update duration on the MediaSource.",e instanceof Error?e:""),"failed"}var c=Math.abs(e.duration-r);return c>=.1?c<Math.abs(e.duration-u)?"partial":"failed":"success"}function zt(e,t,n,r){if("success"!==Vt(e,t,n))var i=setTimeout((function(){a(),zt(e,t,n,r)}),2e3),a=r.register((function(){clearTimeout(i)}))}function Kt(e){return Math.max(Math.pow(2,32),e+Bt)}var Gt=n(6199);var Wt=function(e,t){return e.id===t.id&&e.start===t.start&&e.end===t.end};var Ht=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(Wt(u,{id:a,start:r,end:i}))return void n.push(u)}var l=o.value.element,d={type:o.type,value:Object.assign(Object.assign({},o.value),{element:l})};if(void 0===i){var c={start:r,id:a,data:d,publicEvent:{start:r,data:d}};n.push(c)}else{var f={start:r,end:i,id:a,data:d,publicEvent:{start:r,end:i,data:d}};n.push(f)}}))}return n};function jt(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 qt(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 qt(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 qt(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 Yt=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._manifest=t,i._mediaElement=n,i._playbackObserver=r,i._canceller=null,i._scheduledEventsRef=new v.Z([]),i._eventsBeingPlayed=new WeakMap,i}(0,i.Z)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(null===this._canceller){this._canceller=new p.ZP;var t=this._canceller.signal,n=this._playbackObserver,r=this._mediaElement,i=!1,a=new p.ZP;a.linkToSignal(t),this._manifest.addEventListener("manifestUpdate",(function(){var t=e._scheduledEventsRef.getValue();e._scheduledEventsRef.setValue(Ht(t,e._manifest))}),this._canceller.signal),this._scheduledEventsRef.setValue(Ht([],this._manifest)),this._scheduledEventsRef.onUpdate((function(o){if(0!==o.length){if(!i){i=!0;var u=f(),l=function(){var t=f();e._emitStreamEvents(e._scheduledEventsRef.getValue(),u,t,a.signal),u=t},d=s.Z.getCurrent().STREAM_EVENT_EMITTER_POLL_INTERVAL,c=setInterval(l,d);n.listen(l,{includeLastObservation:!1,clearSignal:a.signal}),a.signal.register((function(){clearInterval(c)}))}}else i&&(a.cancel(),(a=new p.ZP).linkToSignal(t),i=!1);function f(){var e=n.getReference().getValue().seeking;return{currentTime:r.currentTime,isSeeking:e}}}),{emitCurrentValue:!0,clearSignal:t})}},n.stop=function(){null!==this._canceller&&(this._canceller.cancel(),this._canceller=null)},n._emitStreamEvents=function(e,t,n,r){for(var i=t.currentTime,a=n.isSeeking,o=n.currentTime,s=[],u=[],l=0;l<e.length;l++){var d=e[l],c=d.start,f=Xt(d)?d.end:void 0;this._eventsBeingPlayed.has(d)?(c>o||void 0!==f&&o>=f)&&(Xt(d)&&u.push(d.publicEvent),this._eventsBeingPlayed.delete(d)):c<=o&&void 0!==f&&o<f?(s.push({type:"stream-event",value:d.publicEvent}),this._eventsBeingPlayed.set(d,!0)):i<c&&o>=(null!=f?f:c)&&(a?s.push({type:"stream-event-skip",value:d.publicEvent}):(s.push({type:"stream-event",value:d.publicEvent}),Xt(d)&&u.push(d.publicEvent)))}if(s.length>0)for(var v,p=jt(s);!(v=p()).done;){var h=v.value;if("stream-event"===h.type?this.trigger("event",h.value):this.trigger("eventSkip",h.value),r.isCancelled())return}if(u.length>0)for(var m,g=jt(u);!(m=g()).done;){var y=m.value;if("function"==typeof y.onExit&&y.onExit(),r.isCancelled())return}},t}(G.Z);function Xt(e){return void 0!==e.end}var Qt=Yt,$t=n(4576);function Jt(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 en(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 en(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 en(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 tn=function(e){function t(t){var n;(n=e.call(this)||this)._settings=t,n._initCanceller=new p.ZP,n._initialManifestProm=null;var r=void 0===t.url?void 0:[t.url];return n._manifestFetcher=new ue(r,t.transport,t.manifestRequestSettings),n}(0,i.Z)(t,e);var n=t.prototype;return n.prepare=function(){var e=this;null===this._initialManifestProm&&(this._initialManifestProm=(0,c.Z)(this._initCanceller.signal,(function(t,n){e._manifestFetcher.addEventListener("warning",(function(t){return e.trigger("warning",t)})),e._manifestFetcher.addEventListener("error",(function(t){e.trigger("error",t),n(t)})),e._manifestFetcher.addEventListener("manifestReady",(function(e){t(e)}))})),this._manifestFetcher.start(),this._initCanceller.signal.register((function(){e._manifestFetcher.dispose()})))},n.start=function(e,t){var n=this;this.prepare(),(0,$t.Z)(e,(function(e){return n._onFatalError(e)}),this._initCanceller.signal);var r=new v.Z(null,this._initCanceller.signal);this._initializeMediaSourceAndDecryption(e,r).then((function(i){return n._onInitialMediaSourceReady(e,i.mediaSource,t,i.drmSystemId,r,i.unlinkMediaSource)})).catch((function(e){n._onFatalError(e)}))},n.updateContentUrls=function(e,t){this._manifestFetcher.updateContentUrls(e,t)},n.dispose=function(){this._initCanceller.cancel()},n._onFatalError=function(e){this._initCanceller.isUsed()||(this._initCanceller.cancel(),this.trigger("error",e))},n._initializeMediaSourceAndDecryption=function(e,t){var n=this,r=this._initCanceller;return(0,c.Z)(r.signal,(function(i){var a=n._settings.keySystems,o=(0,Lt.Z)(e,a,t,{onWarning:function(e){return n.trigger("warning",e)},onError:function(e){return n._onFatalError(e)}},r.signal);o.onUpdate((function(t,a){if("uninitialized"!==t.initializationState.type){a();var s=new p.ZP;s.linkToSignal(r.signal),It(e,s.signal).then((function(e){var n=o.getValue();if("awaiting-media-link"===n.initializationState.type)n.initializationState.value.isMediaLinked.setValue(!0),o.onUpdate((function(t,n){if("initialized"===t.initializationState.type)return n(),void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})}),{emitCurrentValue:!0,clearSignal:r.signal});else if("initialized"===t.initializationState.type)return void i({mediaSource:e,drmSystemId:t.drmSystemId,unlinkMediaSource:s})})).catch((function(e){s.isUsed()||n._onFatalError(e)}))}}),{emitCurrentValue:!0,clearSignal:r.signal})}))},n._onInitialMediaSourceReady=function(){var e=(0,r.Z)(o().mark((function e(t,n,r,i,a,s){var u,c,v,h,m,g,y,_,b,S,T,E,k,w,A,I,Z,x,R,M,C,P=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C=function(e,n,i,o){x({mediaElement:t,playbackObserver:r,mediaSource:e,initialTime:n,autoPlay:i,manifest:k,representationEstimator:A,segmentFetcherCreator:Z,speed:y,protectionRef:a,bufferOptions:I},(function(e){if(o.cancel(),T.isUsed())return;if(R("reloadingMediaSource",e),T.isUsed())return;var n=new p.ZP;n.linkToSignal(T.signal),It(t,n.signal).then((function(t){C(t,e.position,e.autoPlay,n)})).catch((function(e){n.isUsed()||M(e)}))}),o.signal)},u=this._settings,c=u.adaptiveOptions,v=u.autoPlay,h=u.bufferOptions,m=u.lowLatencyMode,g=u.segmentRequestOptions,y=u.speed,_=u.startAt,b=u.textTrackOptions,S=u.transport,T=this._initCanceller,(0,d.Z)(null!==this._initialManifestProm),E=this._initialManifestProm,e.prev=5,e.next=8,E;case 8:k=e.sent,e.next=14;break;case 11:return e.prev=11,e.t0=e.catch(5),e.abrupt("return");case 14:if(k.addEventListener("manifestUpdate",(function(){P.trigger("manifestUpdate",null)}),T.signal),k.addEventListener("decipherabilityUpdate",(function(e){P.trigger("decipherabilityUpdate",e)}),T.signal),l.Z.debug("Init: Calculating initial time"),w=Dt(k,m,_),l.Z.debug("Init: Initial time calculated:",w),A=F(c),I=(0,f.Z)({textTrackOptions:b,drmSystemId:i},h),Z=new Se(S,g,T.signal),this.trigger("manifestReady",k),!T.isUsed()){e.next=25;break}return e.abrupt("return");case 25:x=this._startBufferingOnMediaSource.bind(this),R=this.trigger.bind(this),M=this._onFatalError.bind(this),C(n,w,v,s);case 29:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n,r,i,a,o){return e.apply(this,arguments)}}(),n._startBufferingOnMediaSource=function(e,t,n){var r,i=this,a=e.autoPlay,o=e.bufferOptions,l=e.initialTime,d=e.manifest,c=e.mediaElement,f=e.mediaSource,h=e.playbackObserver,m=e.protectionRef,g=e.representationEstimator,y=e.segmentFetcherCreator,_=e.speed,b=null!==(r=d.getPeriodForTime(l))&&void 0!==r?r:d.getNextPeriod(l);if(void 0===b){var S=new u.Z("MEDIA_STARTING_TIME_NOT_FOUND","Wanted starting time not found in the Manifest.");return this._onFatalError(S)}var T=new Re(c,f);n.register((function(){T.disposeAll()}));var E=(0,Ot.Z)(c,h,l,a,(function(e){return i.trigger("warning",e)}),!0,n),k=E.autoPlayResult,w=E.initialPlayPerformed,A=E.initialSeekPerformed;if(!n.isCancelled()){w.onUpdate((function(e,t){if(e){t();var r=new Qt(d,c,h);r.addEventListener("event",(function(e){i.trigger("streamEvent",e)}),n),r.addEventListener("eventSkip",(function(e){i.trigger("streamEventSkip",e)}),n),r.start(),n.register((function(){r.stop()}))}}),{clearSignal:n,emitCurrentValue:!0});var I=function(e,t,n){var r=t.autoPlay,i=t.initialPlayPerformed,a=t.initialSeekPerformed,o=t.manifest,s=t.speed,u=t.startTime;return e.deriveReadOnlyObserver((function(e,t){var l=new p.ZP;l.linkToSignal(t),l.linkToSignal(n);var d=new v.Z(c(),l.signal);return s.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),e.onUpdate(f,{clearSignal:l.signal,emitCurrentValue:!1}),d;function c(){var t,n=e.getValue(),l=s.getValue();if(a.getValue()){if(!o.isDynamic||o.isLastPeriodKnown){var d=o.periods[o.periods.length-1];void 0!==d&&void 0!==d.end&&n.position>d.end&&(t=d.end-1)}}else t=u;return{maximumPosition:o.getMaximumSafePosition(),position:{last:n.position,pending:t},duration:n.duration,paused:{last:n.paused,pending:i.getValue()||!r===n.paused?void 0:!r},readyState:n.readyState,speed:l}}function f(){d.setValue(c())}}))}(h,{autoPlay:a,manifest:d,initialPlayPerformed:w,initialSeekPerformed:A,speed:_,startTime:l},n),Z=this._createRebufferingController(h,d,_,n),x=this._createContentTimeBoundariesObserver(d,f,I,T,n);k.then((function(){(0,Nt.Z)(h,c,!1,n).onUpdate((function(e,t){e&&(t(),i.trigger("loaded",{segmentBuffersStore:T}))}),{emitCurrentValue:!0,clearSignal:n})})).catch((function(e){n.isCancelled()||i._onFatalError(e)}));var R=this;pt({manifest:d,initialPeriod:b},I,g,T,y,o,{needsBufferFlush:function(){var e=c.currentTime+.001;h.setCurrentTime(e),h.listen((function(t,n){(null!==t.currentRange||t.position>e+.1)&&(n(),h.setCurrentTime(t.position+.001))}),{includeLastObservation:!1,clearSignal:n})},streamStatusUpdate:function(e){var t=e.period,r=e.bufferType,i=e.imminentDiscontinuity,a=e.position;Z.updateDiscontinuityInfo({period:t,bufferType:r,discontinuity:i,position:a}),n.isCancelled()||d.isLastPeriodKnown&&e.period.id===d.periods[d.periods.length-1].id&&(e.hasFinishedLoading||e.isEmptyStream?x.onLastSegmentFinishedLoading(e.bufferType):x.onLastSegmentLoadingResume(e.bufferType))},needsManifestRefresh:function(){return R._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!0,canUseUnsafeMode:!0})},manifestMightBeOufOfSync:function(){var e=s.Z.getCurrent().OUT_OF_SYNC_MANIFEST_REFRESH_DELAY;R._manifestFetcher.scheduleManualRefresh({enablePartialRefresh:!1,canUseUnsafeMode:!1,delay:e})},lockedStream:function(e){return Z.onLockedStream(e.bufferType,e.period)},adaptationChange:function(e){R.trigger("adaptationChange",e),n.isCancelled()||x.onAdaptationChange(e.type,e.period,e.adaptation)},representationChange:function(e){R.trigger("representationChange",e),n.isCancelled()||x.onRepresentationChange(e.type,e.period)},inbandEvent:function(e){return R.trigger("inbandEvents",e)},warning:function(e){return R.trigger("warning",e)},periodStreamReady:function(e){return R.trigger("periodStreamReady",e)},periodStreamCleared:function(e){x.onPeriodCleared(e.type,e.period),n.isCancelled()||R.trigger("periodStreamCleared",e)},bitrateEstimationChange:function(e){return R.trigger("bitrateEstimationChange",e)},addedSegment:function(e){return R.trigger("addedSegment",e)},needsMediaSourceReload:function(e){var n,r,i=I.getReference().getValue(),a=null!==(n=i.position.pending)&&void 0!==n?n:I.getCurrentTime(),o=null!==(r=i.paused.pending)&&void 0!==r?r:I.getIsPaused(),s=a+e.timeOffset;void 0!==e.minimumPosition&&(s=Math.max(e.minimumPosition,s)),void 0!==e.maximumPosition&&(s=Math.min(e.maximumPosition,s)),t({position:s,autoPlay:!o})},needsDecipherabilityFlush:function(){var e,n,r,i,a=(0,V.Z)(c);if(void 0===(i=null==a?void 0:a[0])||i.indexOf("widevine")<0){var o=I.getReference().getValue(),s=null!==(e=o.position.pending)&&void 0!==e?e:I.getCurrentTime(),u=null!==(n=o.paused.pending)&&void 0!==n?n:I.getIsPaused();t({position:s,autoPlay:!u})}else{var l=I.getReference().getValue(),d=null!==(r=l.position.pending)&&void 0!==r?r:I.getCurrentTime();d+.001<l.duration?h.setCurrentTime(c.currentTime+.001):h.setCurrentTime(d)}},encryptionDataEncountered:function(e){for(var t,r=Jt(e);!(t=r()).done;){var i=t.value;if(m.setValue(i),n.isCancelled())return}},error:function(e){return R._onFatalError(e)}},n)}},n._createContentTimeBoundariesObserver=function(e,t,n,r,i){var a=this,o=new Ft(t);i.register((function(){o.stopUpdating()}));var s=null,u=new yt(e,n,r.getBufferTypes());i.register((function(){u.dispose()})),u.addEventListener("warning",(function(e){return a.trigger("warning",e)})),u.addEventListener("periodChange",(function(e){a.trigger("activePeriodChanged",{period:e})})),u.addEventListener("endingPositionChange",(function(e){return o.updateDuration(e.endingPosition,e.isEnd)})),u.addEventListener("endOfStream",(function(){null===s&&((s=new p.ZP).linkToSignal(i),l.Z.debug("Init: end-of-stream order received."),function(e,t){var n=new p.ZP;n.linkToSignal(t),Mt(e,(function(){l.Z.debug("Init: MediaSource re-opened while end-of-stream is active"),n.cancel(),(n=new p.ZP).linkToSignal(t),Pt(e,n.signal)}),t),Pt(e,n.signal)}(t,s.signal))})),u.addEventListener("resumeStream",(function(){null!==s&&(l.Z.debug("Init: resume-stream order received."),s.cancel(),s=null)}));var d=u.getCurrentEndingTime();return o.updateDuration(d.endingPosition,d.isEnd),u},n._createRebufferingController=function(e,t,n,r){var i=this,a=new Gt.Z(e,t,n);return a.addEventListener("stalled",(function(e){return i.trigger("stalled",e)})),a.addEventListener("unstalled",(function(){return i.trigger("unstalled",null)})),a.addEventListener("warning",(function(e){return i.trigger("warning",e)})),r.register((function(){return a.destroy()})),a.start(),a},t}(ht.K)},9420:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(4578),i=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t}(n(1959).Z)},379:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(3666);var i=n(1669),a=n(5095),o=n(288);function s(e,t,n,s){var u=new o.ZP;u.linkToSignal(s);var l=new a.Z(!1,u.signal);return e.listen((function(e){if(null===e.rebuffering&&null===e.freezing&&0!==e.readyState){if(!function(e,t){return!e||!r.SB||t}(n,t.hasAttribute("playsinline"))&&t.duration>0)return l.setValue(!0),void u.cancel();var a=r.lV?4:3;return e.readyState>=a&&(null!==e.currentRange||e.ended)&&(!(0,i.Z)()||t.duration>0)?(l.setValue(!0),void u.cancel()):void 0}}),{includeLastObservation:!0,clearSignal:u.signal}),l}},9016:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1669),i=n(3774),a=n(3666);var o=n(3714),s=n(3887),u=n(5095);function l(e,t,n,l,d,c,f){var v,p,h=new Promise((function(e,t){v=e,p=t})),m=new u.Z(!1,f),g=new u.Z(!1,f);e.addEventListener("loadedmetadata",_);var y=f.register((function(t){e.removeEventListener("loadedmetadata",_),p(t)}));return e.readyState>=i.c.HAVE_METADATA&&_(),{autoPlayResult:h,initialPlayPerformed:g,initialSeekPerformed:m};function _(){e.removeEventListener("loadedmetadata",_);var i=!1,u=function(e){s.Z.info("Init: Set initial time",e),t.setCurrentTime(e),i=!0,m.setValue(!0),m.finish()},h="function"==typeof n?n():n;if((a.GQ||a.YM)&&0===h?(m.setValue(!0),m.finish()):c&&a.SB?setTimeout((function(){u(h)}),0):u(h),(0,r.Z)()&&0===e.duration){var b=new o.Z("MEDIA_ERR_NOT_LOADED_METADATA","Cannot load automatically: your browser falsely announced having loaded the content.");d(b)}if(!f.isCancelled()){var S=i;t.listen((function(t,n){i&&t.seeking?S=!1:!S&&!t.seeking&&null===t.rebuffering&&t.readyState>=1&&(n(),function(){var t,n;if(s.Z.info("Init: Can begin to play content"),!l)return e.autoplay&&s.Z.warn("Init: autoplay is enabled on HTML media element. Media will play as soon as possible."),g.setValue(!0),g.finish(),y(),v({type:"skipped"});if(e.ended)return s.Z.warn("Init: autoplay is enabled but the video is ended. Skipping autoplay to prevent video to start again"),g.setValue(!0),g.finish(),y(),v({type:"skipped"});try{n=null!==(t=e.play())&&void 0!==t?t:Promise.resolve()}catch(e){return y(),p(e)}n.then((function(){if(!f.isCancelled())return g.setValue(!0),g.finish(),y(),v({type:"autoplay"})})).catch((function(e){if(y(),!f.isCancelled()){if(e instanceof Error&&"NotAllowedError"===e.name){s.Z.warn("Init: Media element can't play. It may be due to browser auto-play policies.");var t=new o.Z("MEDIA_ERR_BLOCKED_AUTOPLAY","Cannot trigger auto-play automatically: your browser does not allow it.");if(d(t),f.isCancelled())return;return v({type:"autoplay-blocked"})}p(e)}}))}())}),{includeLastObservation:!0,clearSignal:f})}}}},7794:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5157),i=n(7874),a=n(3887),o=n(5095),s=n(288),u=n(4339);function l(e,t,n,l,d){if(0===t.length)return h("No `keySystems` option given.");if(null===i.Z.decrypt)return h("EME feature not activated.");var c=new s.ZP;c.linkToSignal(d);var f=new o.Z({initializationState:{type:"uninitialized",value:null},drmSystemId:void 0},d),v=i.Z.decrypt;if(!v.hasEmeApis())return h("EME API not available on the current page.");a.Z.debug("Init: Creating ContentDecryptor");var p=new v(e,t);return p.addEventListener("stateChange",(function(e){if(e===u.u.WaitingForAttachment){var t=new o.Z(!1);t.onUpdate((function(t,n){t&&(n(),e===u.u.WaitingForAttachment&&p.attach())}),{clearSignal:c.signal}),f.setValue({initializationState:{type:"awaiting-media-link",value:{isMediaLinked:t}},drmSystemId:p.systemId})}else e===u.u.ReadyForContent&&(f.setValue({initializationState:{type:"initialized",value:null},drmSystemId:p.systemId}),p.removeEventListener("stateChange"))})),p.addEventListener("error",(function(e){c.cancel(),l.onError(e)})),p.addEventListener("warning",(function(e){l.onWarning(e)})),n.onUpdate((function(e){null!==e&&p.onInitializationData(e)}),{clearSignal:c.signal}),c.signal.register((function(){p.dispose()})),f;function h(e){n.onUpdate((function(t,n){if(null!==t){n();var i=new r.Z("MEDIA_IS_ENCRYPTED_ERROR",e);l.onError(i)}}),{clearSignal:d});var t=new o.Z({initializationState:{type:"initialized",value:null},drmSystemId:void 0});return t.finish(),t}}},6199:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(4578),i=n(3666).yS,a=n(6872),o=n(3714),s=n(3887),u=n(1959),l=n(2829),d=n(288),c=1/60,f=function(e){function t(t,n,r){var i;return(i=e.call(this)||this)._playbackObserver=t,i._manifest=n,i._speed=r,i._discontinuitiesStore=[],i._isStarted=!1,i._canceller=new d.ZP,i}(0,r.Z)(t,e);var n=t.prototype;return n.start=function(){var e=this;if(!this._isStarted){var t;this._isStarted=!0;var n=null,r=new h(this._playbackObserver,this._speed);this._canceller.signal.register((function(){r.dispose()}));var o=null;this._playbackObserver.listen((function(u){var d,f,v=e._discontinuitiesStore,h=u.buffered,m=u.position,g=u.readyState,y=u.rebuffering,_=u.freezing,b=a.Z.getCurrent(),S=b.BUFFER_DISCONTINUITY_THRESHOLD,T=b.FORCE_DISCONTINUITY_SEEK_DELAY,E=b.FREEZING_STALLED_DELAY,k=b.UNFREEZING_SEEK_DELAY,w=b.UNFREEZING_DELTA_POSITION;if(!u.seeking&&i&&null===n&&null!==t&&u.position<t){s.Z.debug("Init: the device appeared to have seeked back by itself.");var A=performance.now();n=A}if(t=u.seeking?Math.max(null!==(d=u.pendingInternalSeek)&&void 0!==d?d:0,u.position):null,null!==_){var I=performance.now();if(I-(null===o?_.timestamp:o.attemptTimestamp)>k&&(s.Z.warn("Init: trying to seek to un-freeze player"),e._playbackObserver.setCurrentTime(e._playbackObserver.getCurrentTime()+w),o={attemptTimestamp:I}),I-_.timestamp>E)return null===y||null!==n?r.stopRebuffering():r.startRebuffering(),void e.trigger("stalled","freezing")}else o=null;if(null===y)return r.stopRebuffering(),1===g?(f=u.seeking?null!==u.pendingInternalSeek?"internal-seek":"seeking":"not-ready",void e.trigger("stalled",f)):void e.trigger("unstalled",null);var Z="seeking"===y.reason&&null!==u.pendingInternalSeek?"internal-seek":y.reason;if(null!==n){var x=performance.now();if(x-n<T)return r.stopRebuffering(),s.Z.debug("Init: letting the device get out of a stall by itself"),void e.trigger("stalled",Z);s.Z.warn("Init: ignored stall for too long, checking discontinuity",x-n)}if(n=null,r.startRebuffering(),null!==e._manifest){var R=y.position;if(null!=R&&e._speed.getValue()>0){var M=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 u=e[i],l=u.discontinuity,d=u.position,f=l.start,v=l.end;if(n>=(null!=f?f:d)-c)if(null===v){var p=t.getPeriodAfter(a);null!==p?o=p.start+c:s.Z.warn("Init: discontinuity at Period's end but no next Period")}else n<v+c&&(o=v+c);void 0!==o&&(s.Z.info("Init: discontinuity found",n,o),r=null!==r&&r>o?r:o)}}return r}(v,e._manifest,R);if(null!==M){var C=M+.001;if(!(C<=e._playbackObserver.getCurrentTime()))return s.Z.warn("SA: skippable discontinuity found in the stream",m,C),e._playbackObserver.setCurrentTime(C),void e.trigger("warning",p(R,C));s.Z.info("Init: position to seek already reached, no seeking",e._playbackObserver.getCurrentTime(),C)}}var P=null!=R?R:m,D=(0,l.XS)(h,P);if(e._speed.getValue()>0&&D<S){var N=P+D+c;if(e._playbackObserver.getCurrentTime()<N)return s.Z.warn("Init: discontinuity encountered inferior to the threshold",P,N,S),e._playbackObserver.setCurrentTime(N),void e.trigger("warning",p(P,N))}for(var O=e._manifest.periods.length-2;O>=0;O--){var L=e._manifest.periods[O];if(void 0!==L.end&&L.end<=P){if(e._manifest.periods[O+1].start>P&&e._manifest.periods[O+1].start>e._playbackObserver.getCurrentTime()){var U=e._manifest.periods[O+1];return e._playbackObserver.setCurrentTime(U.start),void e.trigger("warning",p(P,U.start))}break}}e.trigger("stalled",Z)}else e.trigger("stalled",Z)}),{includeLastObservation:!0,clearSignal:this._canceller.signal})}},n.updateDiscontinuityInfo=function(e){this._isStarted||this.start();var t=this._playbackObserver.getReference().getValue();!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;for(var a=0;a<e.length;a++)if(e[a].period.id===r.id){if(e[a].bufferType===i)return void(v(t)?e[a]=t:e.splice(a,1))}else if(e[a].period.start>r.start)return void(v(t)&&e.splice(a,0,t));v(t)&&e.push(t)}(this._discontinuitiesStore,e,t)},n.onLockedStream=function(e,t){var n;this._isStarted||this.start();var r=this._playbackObserver.getReference().getValue();if(!(!r.rebuffering||r.paused||this._speed.getValue()<=0||"audio"!==e&&"video"!==e)){var i=r.position,a=null!==(n=r.rebuffering.position)&&void 0!==n?n:i,o=t.start;i<o&&Math.abs(a-o)<1&&(s.Z.warn("Init: rebuffering because of a future locked stream.\nTrying to unlock by seeking to the next Period"),this._playbackObserver.setCurrentTime(o+.001))}},n.destroy=function(){this._canceller.cancel()},t}(u.Z);function v(e){return null!==e.discontinuity}function p(e,t){return new o.Z("DISCONTINUITY_ENCOUNTERED","A discontinuity has been encountered at position "+String(e)+", seeked at position "+String(t))}var h=function(){function e(e,t){this._speedUpdateCanceller=new d.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(),s.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 d.ZP,this._updateSpeed())},t.dispose=function(){this._speedUpdateCanceller.cancel(),this._isDisposed=!0},t._updateSpeed=function(){var e=this;this._speed.onUpdate((function(t){s.Z.info("Init: Resume playback speed",t),e._playbackObserver.setPlaybackRate(t)}),{clearSignal:this._speedUpdateCanceller.signal,emitCurrentValue:!0})},e}()},4576:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3714),i=n(1946);function a(e,t,n){function a(){var n,a,o=e.error;switch((0,i.Z)(o)||(n=o.code,a=o.message),n){case 1:return a=null!=a?a:"The fetching of the associated resource was aborted by the user's request.",t(new r.Z("MEDIA_ERR_ABORTED",a));case 2:return a=null!=a?a:"A network error occurred which prevented the media from being successfully fetched",t(new r.Z("MEDIA_ERR_NETWORK",a));case 3:return a=null!=a?a:"An error occurred while trying to decode the media resource",t(new r.Z("MEDIA_ERR_DECODE",a));case 4:return a=null!=a?a:"The media resource has been found to be unsuitable.",t(new r.Z("MEDIA_ERR_SRC_NOT_SUPPORTED",a));default:return a=null!=a?a:"The HTMLMediaElement errored due to an unknown reason.",t(new r.Z("MEDIA_ERR_UNKNOWN",a))}}n.isCancelled()||(e.addEventListener("error",a),n.register((function(){e.removeEventListener("error",a)})))}},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.declareInitSegment=function(e){i.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){i.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=null!==(t=a[0])&&void 0!==t?t:0,c=null!==(n=a[1])&&void 0!==n?n:1/0,f=s/l,v=u/l,p=Math.max(d,f),h=Math.min(c,v);try{this._buffered.insert(p,h),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0)}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 k}});var r=n(4578),i=n(3038),a=n(3887),o=n(5095),s=n(2203).Z?void 0:window.ResizeObserver;var u=n(6872),l=n(288),d=n(9612),c=n(4309),f=n(7874);function v(e,t,n){return void 0===n&&(n=.2),Math.abs(e-t)<=Math.min(n,.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);if(0===n.length&&a.length>0)for(var s=0;s<a.length;s++)(v(e,a[s].start,.001)||v(e,a[s].end,.001))&&n.push(a[s].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},a=Math.abs(t-n)/5;function o(e){var t=r[e];void 0===t||v(i.end,t.end,a)?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 s=0;s<r.length;s++){var u=r[s];if(t<u.end){if(v(t,u.start,a)){if(v(n,u.end,a))return void(r[s]=i);if(n<u.end)return u.cues=h(u.cues,n),u.start=n,void r.splice(s,0,i);do{r.splice(s,1),u=r[s]}while(void 0!==u&&n>u.end);return void o(s)}if(t<u.start){if(n<u.start)return void r.splice(s,0,i);if(v(n,u.start,a))return u.start=n,void r.splice(s,0,i);if(v(n,u.end,a))return void r.splice(s,1,i);if(n<u.end)return u.cues=h(u.cues,n),u.start=n,void r.splice(s,0,i);do{r.splice(s,1),u=r[s]}while(void 0!==u&&n>u.end);return void o(s)}if(v(u.end,n,a))return u.cues=p(u.cues,t),u.end=t,void r.splice(s+1,0,i);if(u.end>n){var l=m(u,t,n),d=l[0],c=l[1];return this._cuesBuffer[s]=d,r.splice(s+1,0,i),void r.splice(s+2,0,c)}u.cues=p(u.cues,t),u.end=t;var f=s+1;for(u=r[f];void 0!==u&&n>u.end;)r.splice(f,1),u=r[f];return void o(f)}}if(r.length){var g=r[r.length-1];v(g.end,t,a)&&(g.end=t)}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 d=s.getAttribute("data-proportional-height");null===d||isNaN(+d)||(s.style.height=String(+d*i[1])+"px");var c=s.getAttribute("data-proportional-line-height");null===c||isNaN(+c)||(s.style.lineHeight=String(+c*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,S=i.Q$;function T(e,t){try{e.removeChild(t)}catch(e){a.Z.warn("HTSB: Can't remove text track: not in the element.")}}function E(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 k=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 c.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.declareInitSegment=function(e){a.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=s.start,c=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!==d)u=Math.max(m,d);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!==c)l=Math.min(g,c);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,!0),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++)T(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++)T(this._textTrackElement,this._currentCues[t].element);this._currentCues=[];for(var n=0;n<e.length;n++){var r=e[n],i=E(r);this._currentCues.push({element:r,resolution:i}),this._textTrackElement.appendChild(r)}var d=this._currentCues.filter((function(e){return null!==e.resolution}));if(d.length>0){this._sizeUpdateCanceller=new l.ZP,this._sizeUpdateCanceller.linkToSignal(this._canceller.signal);var c=u.Z.getCurrent().TEXT_TRACK_SIZE_CHECKS_INTERVAL,f=function(e,t,n){var r=e.getBoundingClientRect(),i=r.height,u=r.width,l=new o.Z({height:i,width:u},n),d=i,c=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===d&&r===c||(d=n,c=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===d&&r===c||(d=n,c=r,l.setValue({height:n,width:r}))}),t);n.register((function(){clearInterval(v)}))}return l}(this._textTrackElement,c,this._sizeUpdateCanceller.signal);f.onUpdate((function(e){for(var t=e.height,n=e.width,r=0;r<d.length;r++){var i=d[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).linkToSignal(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)}S(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}(d.C)},9059:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});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 d=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.declareInitSegment=function(e){a.Z.warn("ISB: Declaring initialization segment for image SegmentBuffer",e)},n.freeInitSegment=function(e){a.Z.warn("ISB: Freeing initialization segment for image SegmentBuffer",e)},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,d=s.end,c=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,c,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!==d)g=Math.min(h,d);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],S=this._track.cues;null!==S&&S.length>0&&b.startTime<S[S.length-1].startTime&&this._removeData(b.startTime,1/0);for(var T=0;T<y.length;T++)this._track.addCue(y[T])}this._buffered.insert(m,g),null!==e.inventoryInfos&&this._segmentInventory.insertChunk(e.inventoryInfos,!0)}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 y},f:function(){return m}});var r=n(6872),i=n(3887),a=n(520);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}var u=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=o(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 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 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 c=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 u(t,n)}var t=e.prototype;return t.reset=function(){this._inventory.length=0},t.synchronizeBuffered=function(e,t){var n,a,o,s,u,d,c;void 0===t&&(t=!1);for(var f=this._inventory,v=0,m=f[0],g=r.Z.getCurrent().MINIMUM_SEGMENT_SIZE,y=null==m?void 0:m.infos.adaptation.type,_=e.length,b=0;b<_;b++){if(void 0===m)return;var S=e.start(b),T=e.end(b);if(T-S<g)i.Z.warn("SI: skipped TimeRange when synchronizing because it was too small",y,S,T);else{for(var E=v;void 0!==m&&(null!==(n=m.bufferedEnd)&&void 0!==n?n:m.end)-S<g;)m=f[++v];var k=null,w=v-E;if(w>0){var A=f[E+w-1];k={end:null!==(a=A.bufferedEnd)&&void 0!==a?a:A.end,precizeEnd:A.precizeEnd},i.Z.debug("SI: "+w+" segments GCed.",y);for(var I,Z=l(f.splice(E,w));!(I=Z()).done;){var x=I.value;void 0===x.bufferedStart&&void 0===x.bufferedEnd&&2!==x.status&&this._bufferedHistory.addBufferedSegment(x.infos,null)}v=E}if(void 0===m)return;if(T-(null!==(o=m.bufferedStart)&&void 0!==o?o:m.start)>=g){if(p(m,S,k,y),v===f.length-1)return void h(m,T,y);for(var R=null!==(s=(m=f[++v]).bufferedStart)&&void 0!==s?s:m.start,M=null!==(u=m.bufferedEnd)&&void 0!==u?u:m.end,C=b<_-1?e.start(b+1):void 0;void 0!==m&&T-R>=g&&(void 0===C||T-R>=M-C);){var P=f[v-1];void 0===P.bufferedEnd&&(P.bufferedEnd=m.precizeStart?m.start:P.end,i.Z.debug("SI: calculating buffered end of contiguous segment",y,P.bufferedEnd,P.end)),m.bufferedStart=P.bufferedEnd,void 0!==(m=f[++v])&&(R=null!==(d=m.bufferedStart)&&void 0!==d?d:m.start,M=null!==(c=m.bufferedEnd)&&void 0!==c?c:m.end)}}var D=f[v-1];void 0!==D&&h(D,T,y)}}if(null!=m){i.Z.debug("SI: last segments have been GCed",y,v,f.length);for(var N,O=l(f.splice(v,f.length-v));!(N=O()).done;){var L=N.value;void 0===L.bufferedStart&&void 0===L.bufferedEnd&&2!==L.status&&this._bufferedHistory.addBufferedSegment(L.infos,null)}}!t&&void 0!==y&&i.Z.hasLevel("DEBUG")&&i.Z.debug("SI: current "+y+" 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 d,c=l.infos.period.id,f=l.infos.representation.id,v=n[c],p=void 0;if(void 0===v)p=o(l.infos),n[c]=((d={})[f]=p,d);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,t){var n=e.period,r=e.adaptation,a=e.representation,o=e.segment,s=e.chunkSize,u=e.start,l=e.end;if(!o.isInit){var d=r.type;if(u>=l)i.Z.warn("SI: Invalid chunked inserted: starts before it ends",d,u,l);else{for(var c=this._inventory,f={status:t?0:2,chunkSize:s,splitted:!1,start:u,end:l,precizeStart:!1,precizeEnd:!1,bufferedStart:void 0,bufferedEnd:void 0,infos:{segment:o,period:n,adaptation:r,representation:a}},v=c.length-1;v>=0;v--){var p=c[v];if(p.start<=u){if(p.end<=u){for(i.Z.debug("SI: Pushing segment strictly after previous one.",d,u,p.end),this._inventory.splice(v+1,0,f),v+=2;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}if(p.start===u){if(p.end<=l){for(i.Z.debug("SI: Segment pushed replace another one",d,u,l,p.end),this._inventory.splice(v,1,f),v+=1;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}return i.Z.debug("SI: Segment pushed ends before another with the same start",d,u,l,p.end),c.splice(v,0,f),p.start=f.end,p.bufferedStart=void 0,void(p.precizeStart=p.precizeStart&&f.precizeEnd)}if(p.end<=f.end){for(i.Z.debug("SI: Segment pushed updates end of previous one",d,u,l,p.start,p.end),this._inventory.splice(v+1,0,f),p.end=f.start,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&f.precizeStart,v+=2;v<c.length&&c[v].start<f.end;){if(c[v].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[v].start),c[v].start=f.end,c[v].bufferedStart=void 0,void(c[v].precizeStart=c[v].precizeStart&&f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[v].start,c[v].end),c.splice(v,1)}return}i.Z.warn("SI: Segment pushed is contained in a previous one",d,u,l,p.start,p.end);var h={status:p.status,chunkSize:p.chunkSize,splitted:!0,start:f.end,end:p.end,precizeStart:p.precizeStart&&p.precizeEnd&&f.precizeEnd,precizeEnd:p.precizeEnd,bufferedStart:void 0,bufferedEnd:p.end,infos:p.infos};return p.end=f.start,p.splitted=!0,p.bufferedEnd=void 0,p.precizeEnd=p.precizeEnd&&f.precizeStart,c.splice(v+1,0,f),void c.splice(v+2,0,h)}}var m=this._inventory[0];if(void 0===m)return i.Z.debug("SI: first segment pushed",d,u,l),void this._inventory.push(f);if(!(m.start>=l)){if(m.end<=l){for(i.Z.debug("SI: Segment pushed starts before and completely recovers the previous first one",d,u,l,m.start,m.end),this._inventory.splice(0,1,f);c.length>1&&c[1].start<f.end;){if(c[1].end>f.end)return i.Z.debug("SI: Segment pushed updates the start of the next one",d,f.end,c[1].start),c[1].start=f.end,c[1].bufferedStart=void 0,void(c[1].precizeStart=f.precizeEnd);i.Z.debug("SI: Segment pushed removes the next one",d,u,l,c[1].start,c[1].end),c.splice(1,1)}return}return i.Z.debug("SI: Segment pushed start of the next one",d,u,l,m.start,m.end),m.start=l,m.bufferedStart=void 0,m.precizeStart=f.precizeEnd,void this._inventory.splice(0,0,f)}i.Z.debug("SI: Segment pushed comes before all previous ones",d,u,l,m.start),this._inventory.splice(0,0,f)}}},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,d=n[o].chunkSize;for(o+=1;o<n.length&&(0,a.z)(n[o].infos,e);){var c=n[o].chunkSize;void 0!==d&&void 0!==c&&(d+=c),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),0===this._inventory[u].status&&(this._inventory[u].status=1),this._inventory[u].chunkSize=d,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=l(r);!(m=g()).done;){var y=m.value;void 0!==y.bufferedStart&&void 0!==y.bufferedEnd?2!==y.status&&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 f(e){if(void 0===e.bufferedStart||1!==e.status)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 v(e){if(void 0===e.bufferedEnd||1!==e.status)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 p(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&&f(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,f(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,f(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),e.bufferedStart=e.start):(i.Z.debug("SI: Segment appears immediately garbage collected at the start",a,e.bufferedStart,t),e.bufferedStart=t)}function h(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&&v(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,v(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 m,g=c,y=function(){function e(){this._segmentInventory=new g}var t=e.prototype;return t.synchronizeInventory=function(e){this._segmentInventory.synchronizeBuffered(this.getBufferedRanges(),e)},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"}(m||(m={}))},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}()},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,a){var u;u=e.call(this)||this,Object.setPrototypeOf((0,r.Z)(u),t.prototype),u.name="MediaError",u.type=o.ZB.MEDIA_ERROR,u.code=n,u.message=(0,s.Z)(u.name,u.code,i),u.fatal=!1;var l=null==a?void 0:a.adaptation;if(void 0!==l)switch(l.type){case"audio":u.trackInfo={type:"audio",track:l.toAudioTrack()};break;case"video":u.trackInfo={type:"video",track:l.toVideoTrack()};break;case"text":u.trackInfo={type:"text",track:l.toTextTrack()}}return u}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;switch(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,a){case"TIMEOUT":s.message="The request timed out";break;case"ERROR_EVENT":s.message="An error prevented the request to be performed successfully";break;case"PARSE_ERROR":s.message="An error happened while formatting the response data";break;case"ERROR_HTTP_CODE":s.message="An HTTP status code indicating failure was received: "+String(s.status)}return 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},createDebugElement:null,directfile:null,decrypt:null,htmlTextTracksBuffer:null,htmlTextTracksParsers:{},imageBuffer:null,imageParser:null,mediaSourceInit: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 h},Z:function(){return m}});var r=n(3887),i=n(3274),a=n(1946),o=n(7829);var s="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}))},u=n(3774);function l(e){return null!=u.J&&("function"!=typeof u.J.isTypeSupported||u.J.isTypeSupported(e))}var d=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 f(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 f(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 f(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 v=(0,n(908).Z)(),p=function(){function e(e,t){var n;if(this.id=e.id,this.uniqueId=v(),this.bitrate=e.bitrate,this.codec=e.codecs,void 0!==e.isSpatialAudio&&(this.isSpatialAudio=e.isSpatialAudio),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,"audio"===t.type||"video"===t.type){if(this.isSupported=!1,void 0!==e.supplementalCodecs)l((null!==(n=this.mimeType)&&void 0!==n?n:"")+';codecs="'+e.supplementalCodecs+'"')&&(this.codec=e.supplementalCodecs,this.isSupported=!0);if(!this.isSupported){var i=this.getMimeTypeString(),a=l(i);a||r.Z.info("Unsupported Representation",i,this.id,this.bitrate),this.isSupported=a}}else this.isSupported=!0}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 i=!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 a=this.contentProtections.keyIds;if(void 0===a)this.contentProtections.keyIds=[{keyId:t}];else{for(var o,s=!1,u=c(a);!(o=u()).done;){var l=o.value;(0,d.Z)(l.keyId,t)&&(s=!0)}s||(r.Z.warn("Manifest: found unanounced key id."),a.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,d.Z)(m.data,p[g].data))break;r.Z.warn("Manifest: different init data for the same system ID")}g===p.length&&(p.push(m),i=!0)}return i}return this.contentProtections.initData.push({type:e,values:n}),!0},t.toAudioRepresentation=function(){return{id:this.id,isSpatialAudio:this.isSpatialAudio,bitrate:this.bitrate,codec:this.codec}},t.toVideoRepresentation=function(){return{id:this.id,bitrate:this.bitrate,frameRate:this.frameRate,width:this.width,height:this.height,codec:this.codec,hdrInfo:this.hdrInfo}},e}(),h=["audio","video","text","image"],m=function(){function e(t,n){void 0===n&&(n={});var i=t.trickModeTracks,s=n,u=s.representationFilter,l=s.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,o.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.forcedSubtitles&&(this.isForcedSubtitles=t.forcedSubtitles),void 0!==t.isSignInterpreted&&(this.isSignInterpreted=t.isSignInterpreted),void 0!==t.label&&(this.label=t.label),void 0!==i&&i.length>0&&(this.trickModeTracks=i.map((function(t){return new e(t)})));for(var d=t.representations,c=[],f=!1,v=0;v<d.length;v++){var h=new p(d[v],{type:this.type});(0,a.Z)(u)||u(h,{bufferType:this.type,language:this.language,normalizedLanguage:this.normalizedLanguage,isClosedCaption:this.isClosedCaption,isDub:this.isDub,isAudioDescription:this.isAudioDescription,isSignInterpreted:this.isSignInterpreted})?(c.push(h),!f&&h.isSupported&&(f=!0)):r.Z.debug("Filtering Representation due to representationFilter",this.type,"Adaptation: "+this.id,"Representation: "+h.id,"("+h.bitrate+")")}c.sort((function(e,t){return e.bitrate-t.bitrate})),this.representations=c,this.isSupported=f,this.manuallyAdded=!0===l}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 s(e)},t.getPlayableRepresentations=function(){return this.representations.filter((function(e){return e.isSupported&&!1!==e.decipherable}))},t.getRepresentation=function(e){return(0,i.Z)(this.representations,(function(t){var n=t.id;return e===n}))},t.toAudioTrack=function(){var e,t,n={language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",audioDescription:!0===this.isAudioDescription,id:this.id,representations:this.representations.map((function(e){return e.toAudioRepresentation()})),label:this.label};return!0===this.isDub&&(n.dub=!0),n},t.toTextTrack=function(){var e,t;return{language:null!==(e=this.language)&&void 0!==e?e:"",normalized:null!==(t=this.normalizedLanguage)&&void 0!==t?t:"",closedCaption:!0===this.isClosedCaption,id:this.id,label:this.label,forced:this.isForcedSubtitles}},t.toVideoTrack=function(){var e=void 0!==this.trickModeTracks?this.trickModeTracks.map((function(e){var t=e.representations.map((function(e){return e.toVideoRepresentation()})),n={id:e.id,representations:t,isTrickModeTrack:!0};return!0===e.isSignInterpreted&&(n.signInterpreted=!0),n})):void 0,t={id:this.id,representations:this.representations.map((function(e){return e.toVideoRepresentation()})),label:this.label};return!0===this.isSignInterpreted&&(t.signInterpreted=!0),!0===this.isTrickModeTrack&&(t.isTrickModeTrack=!0),void 0!==e&&(t.trickModeTracks=e),t},e}()},1989:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w}});var r,i=n(4578),a=n(3714),o=n(3887),s=n(3274),u=n(1959),l=n(908),d=n(9829),c=n(8806),f=n(8999),v=n(1679),p=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 f.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.",{adaptation:r});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,v.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,s.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,t){return e>=this.start&&(void 0===this.end||e<this.end)||e===this.end&&(null===t||t.start>this.end)},e}(),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.isStillAwaitingFutureSegments=function(){return!1},t.isInitialized=function(){return!0},t._replace=function(){o.Z.warn("Tried to replace a static RepresentationIndex")},t._update=function(){o.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){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 _(e,t,n){var i={updatedAdaptations:[],removedAdaptations:[],addedAdaptations:[]};e.start=t.start,e.end=t.end,e.duration=t.duration,e.streamEvents=t.streamEvents;for(var a=e.getAdaptations(),s=t.getAdaptations(),u=function(e){var t=a[e],u=(0,m.Z)(s,(function(e){return e.id===t.id}));if(-1===u){o.Z.warn('Manifest: Adaptation "'+a[e].id+'" not found when merging.');var d=a.splice(e,1)[0];e--,i.removedAdaptations.push(d)}else{var c=s.splice(u,1)[0],f=[],v=[],p=[];i.updatedAdaptations.push({adaptation:t,updatedRepresentations:f,addedRepresentations:v,removedRepresentations:p});for(var h,g=t.representations,y=c.representations.slice(),_=function(e){var t=g[e],i=(0,m.Z)(y,(function(e){return e.id===t.id}));if(-1===i){o.Z.warn('Manifest: Representation "'+g[e].id+'" not found when merging.');var a=g.splice(e,1)[0];e--,p.push(a)}else{var s=y.splice(i,1)[0];f.push(t),t.cdnMetadata=s.cdnMetadata,n===r.Full?t.index._replace(s.index):t.index._update(s.index)}b=e},b=0;b<g.length;b++)_(b);if(y.length>0)o.Z.warn("Manifest: "+y.length+" new Representations found when merging."),(h=t.representations).push.apply(h,y),v.push.apply(v,y)}l=e},l=0;l<a.length;l++)u(l);if(s.length>0){o.Z.warn("Manifest: "+s.length+" new Adaptations found when merging.");for(var d,c=g(s);!(d=c()).done;){var f=d.value,v=e.adaptations[f.type];void 0===v?e.adaptations[f.type]=[f]:v.push(f),i.addedAdaptations.push(f)}}return i}function b(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 T=(0,l.Z)(),E=(0,l.Z)(),k=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,d=n.manifestUpdateUrl;return r.contentWarnings=[],r.id=E(),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 p(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=d,r.lifetime=t.lifetime,r.clockOffset=t.clockOffset,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,s.Z)(this.periods,(function(t){return e===t.id}))},n.getPeriodForTime=function(e){for(var t=null,n=this.periods.length-1;n>=0;n--){var r=this.periods[n];if(r.containsTime(e,t))return r;t=r}},n.getNextPeriod=function(e){return(0,s.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,s.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=b(e.periods);!(n=i()).done;)for(var a,s=n.value,u=b(s.getAdaptations());!(a=u()).done;)for(var l,d=a.value,c=b(d.representations);!(l=c()).done;){var f=l.value,v=t(f);v!==f.decipherable&&(r.push({manifest:e,period:s,adaptation:d,representation:f}),f.decipherable=v,o.Z.debug('Decipherability changed for "'+f.id+'"',"("+f.bitrate+")",String(f.decipherable)))}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,s.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-"+T(),o="gen-image-rep-"+T(),s=(0,d.$)(r),u=r.substring(0,s),l=r.substring(s),c=new f.Z({id:i,type:"image",representations:[{bitrate:0,cdnMetadata:[{baseUrl:u}],id:o,mimeType:n,index:new h({media:l})}]},{isManuallyAdded:!0});if(c.representations.length>0&&!c.isSupported){var v=new a.Z("MANIFEST_INCOMPATIBLE_CODECS_ERROR","An Adaptation contains only incompatible codecs.",{adaptation:c});t.contentWarnings.push(v)}return c}));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,l=n.closedCaption,c=null!=s?[s]:null!=u?u:[],v=(0,d.$)(o),p=o.substring(0,v),m=o.substring(v);return e.concat(c.map((function(e){var n="gen-text-ada-"+T(),o="gen-text-rep-"+T(),s=new f.Z({id:n,type:"text",language:e,closedCaption:l,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.",{adaptation:s});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){var n;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,n=function(e,t){for(var n={updatedPeriods:[],addedPeriods:[],removedPeriods:[]},i=0,a=0;a<t.length;a++){for(var s=t[a],u=i,l=e[u];null!=l&&l.id!==s.id;)l=e[++u];if(null!=l){var d,c,f=_(l,s,r.Full);n.updatedPeriods.push({period:l,result:f});var v=t.slice(i,a),p=u-i,h=e.splice.apply(e,[i,p].concat(v));(d=n.removedPeriods).push.apply(d,h),(c=n.addedPeriods).push.apply(c,v),i=a+1}}if(i>e.length)return o.Z.error("Manifest: error when updating Periods"),n;if(i<e.length){var m,g=e.splice(i,e.length-i);(m=n.removedPeriods).push.apply(m,g)}var y,b=t.slice(i,t.length);return b.length>0&&(e.push.apply(e,b),(y=n.addedPeriods).push.apply(y,b)),n}(this.periods,e.periods);else{this._timeBounds.maximumTimeData=e._timeBounds.maximumTimeData,this.updateUrl=e.uris[0],n=function(e,t){var n,i={updatedPeriods:[],addedPeriods:[],removedPeriods:[]};if(0===e.length)return e.splice.apply(e,[0,0].concat(t)),(n=i.addedPeriods).push.apply(n,t),i;if(0===t.length)return i;var s=e[e.length-1];if(s.start<t[0].start){var u;if(s.end!==t[0].start)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: not enough data");return e.push.apply(e,t),(u=i.addedPeriods).push.apply(u,t),i}var l=(0,m.Z)(e,(function(e){return e.id===t[0].id}));if(l<0)throw new a.Z("MANIFEST_UPDATE_ERROR","Cannot perform partial update: incoherent data");var d=_(e[l],t[0],r.Partial);i.updatedPeriods.push({period:e[l],result:d});for(var c=l+1,f=1;f<t.length;f++){for(var v=t[f],p=-1,h=c;h<e.length;h++)if(v.id===e[h].id){p=h;break}if(p<0){for(var g,y=-1,b=c;b<e.length;b++)if(v.start<e[b].start){y=b;break}var S=y-c,T=e.splice(c,S,v);i.addedPeriods.push(v),(g=i.removedPeriods).push.apply(g,T)}else{if(p>c){var E;o.Z.warn("Manifest: old Periods not found in new when updating, removing");var k=e.splice(c,p-c);(E=i.removedPeriods).push.apply(E,k),p=c}var w=_(e[p],v,r.Full);i.updatedPeriods.push({period:e[p],result:w})}c++}if(c<e.length){var A;o.Z.warn("Manifest: Ending Periods not found in new when updating, removing");var I=e.splice(c,e.length-c);(A=i.removedPeriods).push.apply(A,I)}return i}(this.periods,e.periods);for(var i=this.getMinimumSafePosition();this.periods.length>0;){var s=this.periods[0];if(void 0===s.end||s.end>i)break;this.periods.shift()}}this.adaptations=void 0===this.periods[0]?{}:this.periods[0].adaptations,this.trigger("manifestUpdate",n)},t}(u.Z);var w=k},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.uniqueId===t.representation.uniqueId}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 c},lp:function(){return d},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 d(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 c(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 d=(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===d&&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 d=i(n,s[0],s[2]),c=u(d,s[1]-s[0]);void 0!==c&&a.push({systemId:c,data:d}),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 c},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 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}function c(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,d=(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 c=[];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,c.push({time:l,duration:h,timescale:d,range:[r,r+p-1]}),l+=h,r+=p}return c}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,d=(0,s.t_)(o,1953658222);if(null===d)return;var c=0,f=d[c];if(c+=1,f>1)return;var p=(0,i.QI)(d,c);c+=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,S=(2048&p)>0,T=(0,i.pX)(d,c);c+=4,g&&(c+=4),y&&(c+=4);for(var E=T,k=0;E-- >0;)h?(k+=(0,i.pX)(d,c),c+=4):k+=m,_&&(c+=4),b&&(c+=4),S&&(c+=4);r+=k}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 d=4,c=(0,a.DM)(o,d),f=c.end,v=c.string;d=f;var p=(0,a.DM)(o,d),h=p.end,m=p.string;d=h;var g=(0,i.pX)(o,d);d+=4;var y=(0,i.pX)(o,d);d+=4;var _=(0,i.pX)(o,d);d+=4;var b=(0,i.pX)(o,d);d+=4;var S={schemeIdUri:v,value:m,timescale:g,presentationTimeDelta:y,eventDuration:_,id:b,messageData:o.subarray(d,s)};t.push(S)}}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 d=[o,s,u,l].join(".");if(s>0)throw new Error("Unhandled version: "+s);var c=(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===c)throw new Error("bif: no images to parse");for(var _=0,b=null;t<n;){var S=(0,r.dN)(e,t);t+=4;var T=(0,r.dN)(e,t);if(t+=4,null!==b){var E=b.timestamp*f,k=f,w=e.slice(b.offset,T);y.push({index:_,duration:k,ts:E,data:w}),_++}if(4294967295===S)break;b={timestamp:S,offset:T}}return{fileFormat:"BIF",version:d,imageCount:c,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,d=t.representationBitrate,c=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,d),h=void 0===e.media?null:(0,s.zA)(e.media,l,d),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,endNumber:e.endNumber,timeline:null!==(a=e.timeline)&&void 0!==a?a:[],timescale:f},this._manifestBoundsCalculator=t.manifestBoundsCalculator,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=c}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._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},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.isStillAwaitingFutureSegments=function(){return!1},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,s){for(var u,l,d,c=a.getEstimatedMaximumPosition(null!==(u=e.availabilityTimeOffset)&&void 0!==u?u:0),f=Math.min(t+n,null!=c?c:1/0),v=(0,r.gT)(t,e),p=(0,r.gT)(f,e),h=e.timeline,m=e.timescale,g=e.segmentUrlTemplate,y=e.startNumber,_=e.endNumber,b=null!=y?y:1,S=[],T=h.length,E=0;E<T;E++){var k=h[E],w=k.duration,A=k.start,I=k.range,Z=void 0;Z=void 0===c?o:Math.min(c*m,null!=o?o:1/0);for(var x=(0,r.KF)(k,h[E+1],Z),R=!1!==e.availabilityTimeComplete||E!==T-1&&0!==x,M=(l=w,d=void 0,(d=v-A)>0?Math.floor(d/l):0),C=A+M*w;C<p&&M<=x;){var P=b+M;if(void 0!==_&&P>_)break;var D=null===g?null:(0,i.QB)(C,P)(g),N=C-e.indexTimeOffset,O=w;N<0&&(O=w+N,N=0);var L={id:String(C),time:N/m,end:(N+O)/m,duration:O/m,isInit:!1,range:I,timescale:1,url:D,number:P,timestampOffset:-e.indexTimeOffset/m,complete:R,privateInfos:{isEMSGWhitelisted:s}};S.push(L),C=A+ ++M*w}if(C>=p)return S;if(b+=x+1,void 0!==_&&b>_)return S}return S}},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)}))}}},1707:function(e,t,n){"use strict";n.d(t,{Z:function(){return qe}});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 d(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 c(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=c(r);if(void 0===u)return;a=u}if(void 0!==i){var l=c(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=d(r);if(void 0===u)return{safe:void 0,unsafe:void 0};a=u}if(void 0!==i){var l=d(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=function(){function e(e){this._isDynamic=e.isDynamic,this._timeShiftBufferDepth=e.isDynamic&&void 0!==e.timeShiftBufferDepth?e.timeShiftBufferDepth:null,this._serverTimestampOffset=e.serverTimestampOffset,this._availabilityStartTime=e.availabilityStartTime}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.getEstimatedMinimumSegmentTime=function(){var e;if(!this._isDynamic||null===this._timeShiftBufferDepth)return 0;var t=null!==(e=this.getEstimatedLiveEdge())&&void 0!==e?e:this.getEstimatedMaximumPosition(0);return void 0!==t?t-this._timeShiftBufferDepth:void 0},t.getEstimatedLiveEdge=function(){if(this._isDynamic&&void 0!==this._serverTimestampOffset)return(performance.now()+this._serverTimestampOffset)/1e3-this._availabilityStartTime},t.getEstimatedMaximumPosition=function(e){if(!this._isDynamic)return this._lastPosition;var t=this.getEstimatedLiveEdge();return void 0!==t&&e!==1/0?t+e:void 0!==this._positionTime&&void 0!==this._lastPosition?Math.max(this._lastPosition-this._positionTime+performance.now()/1e3,0):this._lastPosition},e}();var p=n(9592),h=n(908),m=n(1679),g=n(3635);var y=n(8999),_=n(5138),b=n(7714),S=n(6923);function T(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 k=function(e,t){for(var n,r=T(t);!(n=r()).done;)for(var i,a=n.value,o=a.adaptation,s=T(a.trickModeAttachedAdaptationIds);!(i=s()).done;)for(var u,l=i.value,d=T(y.r);!(u=d()).done;){var c=e[u.value];if(void 0!==c)for(var f,v=T(c);!(f=v()).done;){var p=f.value;p.id===l&&(void 0===p.trickModeTracks&&(p.trickModeTracks=[]),p.trickModeTracks.push(o))}}},w=["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)(w,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 d=e[l].attributes,c=d.mimeType,f=d.codecs;if(void 0!==c){var v=i(c,r);if(void 0!==v)return v}if(void 0!==f){var p=a(f);if(void 0!==p)return p}}}var I=n(8026),Z=/[, ]+/g;var x=n(7403),R=n(3911),M=n(1915),C=n(4784),P=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,d=null!==(n=e.timescale)&&void 0!==n?n:1,c=l-i*d,f=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,C.zA)(e.initialization.media,o,s),v=e.list.map((function(e){return{url:void 0===e.media?null:(0,C.zA)(e.media,o,s),mediaRange:e.mediaRange}}));this._index={list:v,timescale:d,duration:e.duration,indexTimeOffset:c,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,M.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,R.PZ)(s,t,a),l=u[0],d=u[1],c=Math.min(i.length-1,Math.floor(d/r)),f=[],v=Math.floor(l/r);v<=c;){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.isStillAwaitingFutureSegments=function(){return!1},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}(),D=n(9362),N=n(811),O=n(8232),L=n(5505),U=n(6394);function B(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 V(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 z(e){for(var t=[],n=0;n<e.length;n++)t.push(V(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],d=i;;){var c=l.getAttribute("d"),f=null===c?null:parseInt(c,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-d;if(h%f==0&&h/f<=p)return{repeatNumberInPrevSegments:0,repeatNumberInNewElements:h/f,prevSegmentsIdx:0,newElementsIdx:u}}d+=f*(p+1)}else d+=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;d=g}if(d===n)return{newElementsIdx:u,prevSegmentsIdx:0,repeatNumberInPrevSegments:0,repeatNumberInNewElements:0};if(d>i)return null}}(t,e);if(null===r)return o.Z.warn('DASH: Cannot perform "based" update. Common segment not found.'),z(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'),z(e);var d=t.slice(i);if(s>0){var c=d[0];c.start+=c.duration*s,d[0].repeatCount-=s}if(u>0&&0!==a)return o.Z.info('DASH: Cannot perform "based" update. The new timeline has a different form.'),z(e);var f=d[d.length-1],v=V(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.'),z(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(V(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 d.concat(h)}var G=function(){function e(t,n){var r,i,a;if(!e.isTimelineIndexArgument(t))throw new Error("The given index is not compatible with a TimelineRepresentationIndex.");var o=n.availabilityTimeComplete,s=n.availabilityTimeOffset,u=n.manifestBoundsCalculator,l=n.isDynamic,d=n.isLastPeriod,c=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=d,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,C.zA)(t.initialization.media,c,f),b=void 0===t.media?null:(0,C.zA)(t.media,c,f);y=void 0===s&&void 0===o?1/0:null!=s?s:0,this._index={availabilityTimeComplete:null==o||o,availabilityTimeOffset:y,indexRange:t.indexRange,indexTimeOffset:g,initialization:null==t.initialization?void 0:{url:_,range:t.initialization.range},segmentUrlTemplate:b,startNumber:t.startNumber,endNumber:t.endNumber,timeline:void 0===t.timeline?null:W(t.timeline,t.startNumber,t.endNumber),timescale:m},this._scaledPeriodStart=(0,R.gT)(v,this._index),this._scaledPeriodEnd=void 0===p?void 0:(0,R.gT)(p,this._index)}var t=e.prototype;return t.getInitSegment=function(){return(0,M.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.endNumber,o=n.timeline,s=n.timescale,u=n.indexTimeOffset;return(0,U.Z)({segmentUrlTemplate:r,startNumber:i,endNumber:a,timeline:o,timescale:s,indexTimeOffset:u},e,t,this._manifestBoundsCalculator,this._scaledPeriodEnd,this._isEMSGWhitelisted)},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,R.zG)(Math.max(this._scaledPeriodStart,e[0].start),this._index)},t.getLastAvailablePosition=function(){var e;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null===t)return null;var n=Math.min(t.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,R.zG)(n,this._index)},t.getEnd=function(){var e;if(!this._isDynamic||this._isLastPeriod){if(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),this._index.timeline.length<=0)return null;var t=this._index.timeline[this._index.timeline.length-1],n=Math.min((0,R.jH)(t,null,this._scaledPeriodEnd),null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return(0,R.zG)(n,this._index)}},t.awaitSegmentBetween=function(e,t){var n,r;if((0,N.Z)(e<=t),!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var i=this._index,a=i.timescale,o=i.timeline,s=B(a),u=(0,R.gT)(t,this._index),l=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==l&&Math.min(l.end,null!==(n=this._scaledPeriodEnd)&&void 0!==n?n:1/0)+s>=Math.min(u,null!==(r=this._scaledPeriodEnd)&&void 0!==r?r:1/0))return!1;var d=(0,R.gT)(e,this._index);if(o.length>0&&null!==l&&!l.isLastOfTimeline){var c=o[o.length-1];if(d<(0,R.jH)(c,null,this._scaledPeriodEnd)+s+s)return!0}return!!this._isLastPeriod&&(void 0===this._scaledPeriodEnd?u+s>this._scaledPeriodStart&&void 0:d-s<this._scaledPeriodEnd&&u+s>this._scaledPeriodStart)},t.isSegmentStillAvailable=function(e){return!!e.isInit||(this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline()),function(e,t,n,r){var i=H(t,n,r);if(null===i)return!1;for(var a=0;a<t.timeline.length;a++){if(i.timelineIdx<a)return!1;var o=t.timeline[a],s=(o.start-t.indexTimeOffset)/t.timescale;if(s>e.time)return!1;if(s===e.time)return void 0===o.range?void 0===e.range:null!=e.range&&o.range[0]===e.range[0]&&o.range[1]===e.range[1];if(o.repeatCount>=0&&void 0!==o.duration){var u=(s-o.start)/o.duration-1;return u%1==0&&u<=i.newRepeatCount}}return!1}(e,this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd))},t.checkDiscontinuity=function(e){this._refreshTimeline();var t=this._index.timeline;return null===t&&(t=this._getTimeline(),this._index.timeline=t),(0,R._j)({timeline:t,timescale:this._index.timescale,indexTimeOffset:this._index.indexTimeOffset},e,this._scaledPeriodEnd)},t.canBeOutOfSyncError=function(e){return!!this._isDynamic&&(e instanceof D.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._index.availabilityTimeOffset=e._index.availabilityTimeOffset,this._index.availabilityTimeComplete=e._index.availabilityTimeComplete,this._index.endNumber=e._index.endNumber,this._isDynamic=e._isDynamic,this._scaledPeriodStart=e._scaledPeriodStart,this._scaledPeriodEnd=e._scaledPeriodEnd,this._lastUpdate=e._lastUpdate,this._isLastPeriod=e._isLastPeriod},t.isStillAwaitingFutureSegments=function(){var e;if(!this._isDynamic)return!1;this._refreshTimeline(),null===this._index.timeline&&(this._index.timeline=this._getTimeline());var t=this._index.timeline;if(0===t.length){if(void 0!==this._scaledPeriodEnd){var n=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==n&&(0,R.gT)(n,this._index)>this._scaledPeriodEnd)return!1}return this._isLastPeriod}var r=B(this._index.timescale),i=H(this._index,this._manifestBoundsCalculator,this._scaledPeriodEnd);if(null!==i&&!i.isLastOfTimeline){var a=Math.min(i.end,null!==(e=this._scaledPeriodEnd)&&void 0!==e?e:1/0);return!(void 0!==this._scaledPeriodEnd&&a+r>=this._scaledPeriodEnd)}if(!this._isLastPeriod)return!1;if(void 0===this._scaledPeriodEnd)return!0;var o=t[t.length-1];return(0,R.jH)(o,null,this._scaledPeriodEnd)+r<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.getEstimatedMinimumSegmentTime();if(null!=e){var t=(0,R.gT)(e,this._index),n=(0,O.Z)(this._index.timeline,t);void 0!==this._index.startNumber?this._index.startNumber+=n:void 0!==this._index.endNumber&&(this._index.startNumber=n+1)}}},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?W(z(e),this._index.startNumber,this._index.endNumber):(null===this._unsafelyBaseOnPreviousIndex._index.timeline?(t=this._unsafelyBaseOnPreviousIndex._getTimeline(),this._unsafelyBaseOnPreviousIndex._index.timeline=t):t=this._unsafelyBaseOnPreviousIndex._index.timeline,this._unsafelyBaseOnPreviousIndex=null,W(K(e,t),this._index.startNumber,this._index.endNumber))},e}();function W(e,t,n){if(void 0===n)return e;for(var r=null!=t?t:1,i=0;i<e.length;i++){var a=e[i];if((r+=a.repeatCount+1)>n){if(r===n+1)return e.slice(0,i+1);var o=e.slice(0,i),s=Object.assign({},a),u=r-a.repeatCount-1;return s.repeatCount=Math.max(0,n-u),o.push(s),o}}return e}function H(e,t,n){if(e.timeline.length<=0)return null;if(e.availabilityTimeOffset===1/0){var r=e.timeline.length-1,i=e.timeline[r];return{isLastOfTimeline:!0,timelineIdx:r,newRepeatCount:i.repeatCount,end:(0,R.jH)(i,null,n)}}var a=t.getEstimatedMaximumPosition(e.availabilityTimeOffset);if(void 0===a){var o=e.timeline.length-1,s=e.timeline[o];return{isLastOfTimeline:!0,timelineIdx:o,newRepeatCount:s.repeatCount,end:(0,R.jH)(s,null,n)}}for(var u=e.timeline.length-1;u>=e.timeline.length;u--){var l=e.timeline[u],d=l.start+l.duration;if((0,R.zG)(d,e)<=a){var c=(0,R.jH)(l,e.timeline[u+1],n);if((0,R.zG)(c,e)<=a)return{isLastOfTimeline:u===e.timeline.length-1,timelineIdx:u,newRepeatCount:l.repeatCount,end:d};var f=(0,R.gT)(a,e)-l.start,v=Math.floor(f/l.duration);return(0,N.Z)(v>=1),{isLastOfTimeline:!1,timelineIdx:u,newRepeatCount:v-1,end:l.start+v*l.duration}}}return null}var j=G,q=function(){function e(e,t){var n,r,i=t.availabilityTimeOffset,a=t.manifestBoundsCalculator,o=t.isDynamic,s=t.periodEnd,u=t.periodStart,l=t.representationId,d=t.representationBitrate,c=t.isEMSGWhitelisted,f=null!==(n=e.timescale)&&void 0!==n?n:1;this._availabilityTimeOffset=i,this._manifestBoundsCalculator=a;var v=null!=e.presentationTimeOffset?e.presentationTimeOffset:0,p=v-u*f;if(void 0===e.duration)throw new Error("Invalid SegmentTemplate: no duration");var h=void 0===(null===(r=e.initialization)||void 0===r?void 0:r.media)?null:(0,C.zA)(e.initialization.media,l,d),m=void 0===e.media?null:(0,C.zA)(e.media,l,d);this._index={duration:e.duration,timescale:f,indexRange:e.indexRange,indexTimeOffset:p,initialization:null==e.initialization?void 0:{url:h,range:e.initialization.range},url:m,presentationTimeOffset:v,startNumber:e.startNumber,endNumber:e.endNumber},this._isDynamic=o,this._periodStart=u,this._scaledRelativePeriodEnd=void 0===s?void 0:(s-u)*f,this._isEMSGWhitelisted=c}var t=e.prototype;return t.getInitSegment=function(){return(0,M.Z)(this._index,this._isEMSGWhitelisted)},t.getSegments=function(e,t){var n=this._index,r=n.duration,i=n.startNumber,a=n.endNumber,o=n.timescale,s=n.url,u=this._periodStart*o,l=this._scaledRelativePeriodEnd,d=e*o-u,c=(e+t)*o-u,f=this._getFirstSegmentStart(),v=this._getLastSegmentStart();if(null==f||null==v)return[];var p=Math.max(f,d),h=Math.min(v,c);if(h+r<=p)return[];for(var m=[],g=null!=i?i:1,y=Math.floor(p/r),_=y*r;_<=h;_+=r){var b=y+g;if(void 0!==a&&b>a)return m;var S=null!=l&&_+r>l?l-_:r,T=_+u,E=_+this._index.presentationTimeOffset,k=null===s?null:(0,C.QB)(E,b)(s),w={id:String(b),number:b,time:T/o,end:(T+S)/o,duration:S/o,timescale:1,isInit:!1,scaledDuration:S/o,url:k,timestampOffset:-n.indexTimeOffset/o,complete:!0,privateInfos:{isEMSGWhitelisted:this._isEMSGWhitelisted}};m.push(w),y++}return m},t.getFirstAvailablePosition=function(){var e=this._getFirstSegmentStart();return null==e?e:e/this._index.timescale+this._periodStart},t.getLastAvailablePosition=function(){var e=this._getLastSegmentStart();if((0,i.Z)(e))return e;var t=this._estimateRelativeScaledEnd();return Math.min(e+this._index.duration,null!=t?t:1/0)/this._index.timescale+this._periodStart},t.getEnd=function(){if(!this._isDynamic)return this.getLastAvailablePosition();var e=this._estimateRelativeScaledEnd();if(void 0!==e){var t=this._index.timescale;return(e+this._periodStart*t)/t}},t.awaitSegmentBetween=function(e,t){if((0,N.Z)(e<=t),!this._isDynamic)return!1;var n=this._index.timescale,r=B(n),a=this._periodStart*n,o=e*n-a,s=t*n-a,u=this._getLastSegmentStart();if((0,i.Z)(u)){var l=this._estimateRelativeScaledEnd();return void 0===l?s+r>=0:s+r>=0&&o<l-r}var d=u+this._index.duration,c=this._estimateRelativeScaledEnd();return void 0===c?s>d-r:s>d-r&&o<c-r},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.isStillAwaitingFutureSegments=function(){if(!this._isDynamic)return!1;var e=this._estimateRelativeScaledEnd();if(void 0===e)return!0;var t=this._index.timescale,n=this._getLastSegmentStart();return!!(0,i.Z)(n)||n+this._index.duration+B(t)<e},t.isInitialized=function(){return!0},t._replace=function(e){this._index=e._index,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(){var e;if(!this._isDynamic)return 0;if(0===this._scaledRelativePeriodEnd||void 0===this._scaledRelativePeriodEnd){var t=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0!==t&&t<this._periodStart)return null}var n=this._index,r=n.duration,i=n.timescale,a=this._manifestBoundsCalculator.getEstimatedMinimumSegmentTime();if(void 0!==a){var o=a>this._periodStart?(a-this._periodStart)*i:0;return Math.floor(o/r)*r}},t._getLastSegmentStart=function(){var e,t,n=this._index,r=n.duration,i=n.timescale,o=n.endNumber,s=n.startNumber,u=void 0===s?1:s;if(this._isDynamic){var l=this._manifestBoundsCalculator.getEstimatedLiveEdge();if(void 0!==l&&void 0!==this._scaledRelativePeriodEnd&&this._scaledRelativePeriodEnd<l-this._periodStart*this._index.timescale){var d=Math.ceil(this._scaledRelativePeriodEnd/r);return void 0!==o&&o-u+1<d&&(d=o-u+1),(d-1)*r}var c=this._manifestBoundsCalculator.getEstimatedMaximumPosition(null!==(e=this._availabilityTimeOffset)&&void 0!==e?e:0);if(void 0===c)return;var f=(c-this._periodStart)*i;if(f<0)return null;var v=Math.floor(f/r);return void 0!==o&&o-u+1<v&&(v=o-u+1),v<=0?null:(v-1)*r}var p=null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:0,h=Math.ceil(p/r);void 0!==o&&o-u+1<h&&(h=o-u+1);var m=(h-1)*r,g=a.Z.getCurrent().MINIMUM_SEGMENT_SIZE*i;return void 0!==o||p-m>g||h<2?m:(h-2)*r},t._estimateRelativeScaledEnd=function(){var e,t;if(void 0!==this._index.endNumber){var n=this._index.endNumber-(null!==(e=this._index.startNumber)&&void 0!==e?e:1)+1;return Math.max(Math.min(n*this._index.duration,null!==(t=this._scaledRelativePeriodEnd)&&void 0!==t?t:1/0),0)}if(void 0!==this._scaledRelativePeriodEnd)return Math.max(this._scaledRelativePeriodEnd,0)},e}();function Y(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],d=(0,u.Z)(o.url,l.url);i.push({url:d,serviceLocation:null!==(n=l.serviceLocation)&&void 0!==n?n:o.serviceLocation})}return i}function X(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 Q(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 Q(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 Q(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){var t=e.adaptationProfiles,n=e.essentialProperties,r=e.supplementalProperties,i=e.manifestProfiles,a=e.codecs;if(-1!==((null!=t?t:"")+(null!=i?i:"")).indexOf("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&("hvc1.2.4.L153.B0"===a||"hev1.2.4.L153.B0"===a))return{colorDepth:10,eotf:"pq",colorSpace:"rec2020"};var o=(0,s.Z)([].concat(null!=n?n:[],null!=r?r:[]),(function(e){return"urn:mpeg:mpegB:cicp:TransferCharacteristics"===e.schemeIdUri}));if(void 0!==o)switch(o.value){case"15":return;case"16":return{eotf:"pq"};case"18":return{eotf:"hlg"}}return void 0!==a&&/^vp(08|09|10)/.exec(a)?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}}(a):void 0}function J(e,t,n){for(var r,i,a,u,l,d,c=[],f=function(){for(var e=d.value,f=void 0!==e.attributes.id?e.attributes.id:String(e.attributes.bitrate)+(void 0!==e.attributes.height?"-"+e.attributes.height:"")+(void 0!==e.attributes.width?"-"+e.attributes.width:"")+(void 0!==e.attributes.mimeType?"-"+e.attributes.mimeType:"")+(void 0!==e.attributes.codecs?"-"+e.attributes.codecs:"");c.some((function(e){return e.id===f}));)f+="-dup";var v,p=null!==(i=null===(r=n.unsafelyBaseOnPreviousAdaptation)||void 0===r?void 0:r.getRepresentation(f))&&void 0!==i?i:null,h=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),m=null!==(a=e.attributes.availabilityTimeComplete)&&void 0!==a?a:n.availabilityTimeComplete;void 0===e.attributes.availabilityTimeOffset&&void 0===n.availabilityTimeOffset||(v=(null!==(u=e.attributes.availabilityTimeOffset)&&void 0!==u?u:0)+(null!==(l=n.availabilityTimeOffset)&&void 0!==l?l:0));var g,y=function(e,t){var n,r,i,a=t.availabilityTimeOffset,o=t.manifestBoundsCalculator,s=t.isDynamic,u=t.end,l=t.start,d=t.receivedTime,c=t.unsafelyBaseOnPreviousRepresentation,f=t.inbandEventStreams,v={availabilityTimeComplete:void 0,availabilityTimeOffset:a,unsafelyBaseOnPreviousRepresentation:c,isEMSGWhitelisted:function(e){return void 0!==f&&f.some((function(t){return t.schemeIdUri===e.schemeIdUri}))},isLastPeriod:t.isLastPeriod,manifestBoundsCalculator:o,isDynamic:s,periodEnd:u,periodStart:l,receivedTime:d,representationBitrate:e.attributes.bitrate,representationId:e.attributes.id};if(void 0!==e.children.segmentBase){var p=e.children.segmentBase;i=new x.Z(p,v)}else if(void 0!==e.children.segmentList){var h=e.children.segmentList;i=new P(h,v)}else if(void 0!==e.children.segmentTemplate||t.parentSegmentTemplates.length>0){var m=t.parentSegmentTemplates.slice(),g=e.children.segmentTemplate;void 0!==g&&m.push(g);var y=I.Z.apply(void 0,[{}].concat(m));void 0===y.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(v.availabilityTimeOffset=(null!==(n=y.availabilityTimeOffset)&&void 0!==n?n:0)+(null!==(r=t.availabilityTimeOffset)&&void 0!==r?r:0)),i=j.isTimelineIndexArgument(y)?new j(y,v):new q(y,v)}else{var _=t.adaptation.children;if(void 0!==_.segmentBase){var b=_.segmentBase;i=new x.Z(b,v)}else if(void 0!==_.segmentList){var S=_.segmentList;i=new P(S,v)}else i=new q({duration:Number.MAX_VALUE,timescale:1,startNumber:0,media:""},v)}return i}(e,(0,I.Z)({},n,{availabilityTimeOffset:v,availabilityTimeComplete:m,unsafelyBaseOnPreviousRepresentation:p,adaptation:t,inbandEventStreams:h}));void 0===e.attributes.bitrate?(o.Z.warn("DASH: No usable bitrate found in the Representation."),g=0):g=e.attributes.bitrate;var _,b,T,E=Y(n.baseURLs,e.children.baseURLs),k={bitrate:g,cdnMetadata:0===E.length?[{baseUrl:"",id:void 0}]:E.map((function(e){return{baseUrl:e.url,id:e.serviceLocation}})),index:y,id:f};void 0!==e.children.supplementalProperties&&(0,s.Z)(e.children.supplementalProperties,(function(e){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"===e.schemeIdUri&&"JOC"===e.value}))&&(k.isSpatialAudio=!0),void 0!==e.attributes.codecs?_=e.attributes.codecs:void 0!==t.attributes.codecs&&(_=t.attributes.codecs),void 0!==_&&(_="mp4a.40.02"===_?"mp4a.40.2":_,k.codecs=_),void 0!==e.attributes.supplementalCodecs?b=e.attributes.supplementalCodecs:void 0!==t.attributes.supplementalCodecs&&(b=t.attributes.supplementalCodecs),void 0!==b&&(k.supplementalCodecs=(T=b,(0,S.Z)(T)?T.trim().replace(Z,", "):"")),void 0!==e.attributes.frameRate?k.frameRate=e.attributes.frameRate:void 0!==t.attributes.frameRate&&(k.frameRate=t.attributes.frameRate),void 0!==e.attributes.height?k.height=e.attributes.height:void 0!==t.attributes.height&&(k.height=t.attributes.height),void 0!==e.attributes.mimeType?k.mimeType=e.attributes.mimeType:void 0!==t.attributes.mimeType&&(k.mimeType=t.attributes.mimeType),void 0!==e.attributes.width?k.width=e.attributes.width:void 0!==t.attributes.width&&(k.width=t.attributes.width);var w=void 0!==t.children.contentProtections?t.children.contentProtections:[];if(void 0!==e.children.contentProtections&&w.push.apply(w,e.children.contentProtections),w.length>0){var A=w.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=X(t.children.cencPssh);!(i=o()).done;){var u=i.value;a.push({systemId:n,data:u})}if(a.length>0){var l,d=(0,s.Z)(e.initData,(function(e){return"cenc"===e.type}));if(void 0===d)e.initData.push({type:"cenc",values:a});else(l=d.values).push.apply(l,a)}}return e}),{keyIds:void 0,initData:[]});(Object.keys(A.initData).length>0||void 0!==A.keyIds&&A.keyIds.length>0)&&(k.contentProtections=A)}k.hdrInfo=$({adaptationProfiles:t.attributes.profiles,supplementalProperties:t.children.supplementalProperties,essentialProperties:t.children.essentialProperties,manifestProfiles:n.manifestProfiles,codecs:_}),c.push(k)},v=X(e);!(d=v()).done;)f();return c}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}function ne(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 re(e,t){if(void 0!==e&&e.some((function(e){return"urn:tva:metadata:cs:AudioPurposeCS:2007"===e.schemeIdUri&&"2"===e.value})))return!0;if(void 0!==t&&t.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri&&"caption"===e.value})))return!0;return!1}function ie(e){return void 0!==e&&("urn:mpeg:dash:role:2011"===e.schemeIdUri&&"sign"===e.value)}function ae(e,t){if((0,S.Z)(e.attributes.id))return e.attributes.id;var n=t.isClosedCaption,r=t.isForcedSubtitle,i=t.isAudioDescription,a=t.isSignInterpreted,o=t.isTrickModeTrack,s=t.type;return(0,S.Z)(e.attributes.language)&&(s+="-"+e.attributes.language),!0===n&&(s+="-cc"),!0===r&&(s+="-cc"),!0===i&&(s+="-ad"),!0===a&&(s+="-si"),o&&(s+="-trickMode"),(0,S.Z)(e.attributes.contentType)&&(s+="-"+e.attributes.contentType),(0,S.Z)(e.attributes.codecs)&&(s+="-"+e.attributes.codecs),(0,S.Z)(e.attributes.mimeType)&&(s+="-"+e.attributes.mimeType),(0,S.Z)(e.attributes.frameRate)&&(s+="-"+e.attributes.frameRate),s}function oe(e){if(null!=e.children.supplementalProperties)for(var t,n=ee(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 se(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 ue(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 le(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 le(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 le(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 de=(0,h.Z)();function ce(e,t){var n,r,a,u,l=[],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 c=t.isDynamic,f=t.manifestBoundsCalculator;c||(0,i.Z)(t.duration)||f.setLastPosition(t.duration);for(var v=function(){var v,T=h===e.length-1,E=e[h],w=t.xlinkInfos.get(E),I=Y(t.baseURLs,E.children.baseURLs),Z=d[h],x=Z.periodStart,R=Z.periodDuration,M=Z.periodEnd;for((0,i.Z)(E.attributes.id)?(o.Z.warn("DASH: No usable id found in the Period. Generating one."),v="gen-dash-period-"+de()):v=E.attributes.id;l.some((function(e){return e.id===v}));)v+="-dup";var C=void 0!==w?w.receivedTime:t.receivedTime,P=null!==(r=null===(n=t.unsafelyBaseOnPreviousManifest)||void 0===n?void 0:n.getPeriod(v))&&void 0!==r?r:null,D=E.attributes.availabilityTimeComplete,N=E.attributes.availabilityTimeOffset,O=t.manifestProfiles,L=E.children.segmentTemplate,U={availabilityTimeComplete:D,availabilityTimeOffset:N,baseURLs:I,manifestBoundsCalculator:f,end:M,isDynamic:c,isLastPeriod:T,manifestProfiles:O,receivedTime:C,segmentTemplate:L,start:x,unsafelyBaseOnPreviousPeriod:P},B=function(e,t){for(var n,r,i,a,u,l,d,c={video:[],audio:[],text:[],image:[]},f=[],v={},p=[],h=0;h<e.length;h++){var m=e[h],g=m.children,T=g.essentialProperties,E=g.roles,w=g.label,I=Array.isArray(E)&&E.some((function(e){return"main"===e.value}))&&E.some((function(e){return"urn:mpeg:dash:role:2011"===e.schemeIdUri})),Z=m.children.representations,x=null!==(n=m.attributes.availabilityTimeComplete)&&void 0!==n?n:t.availabilityTimeComplete,R=void 0;void 0===m.attributes.availabilityTimeOffset&&void 0===t.availabilityTimeOffset||(R=(null!==(r=m.attributes.availabilityTimeOffset)&&void 0!==r?r:0)+(null!==(i=t.availabilityTimeOffset)&&void 0!==i?i:0));var M=m.attributes.mimeType,C=m.attributes.codecs,P=A(Z,(0,S.Z)(M)?M:null,(0,S.Z)(C)?C:null,null!=g.roles?g.roles:null);if(void 0!==P){var D=null!==(a=m.attributes.selectionPriority)&&void 0!==a?a:1,N=m.attributes.id,O=oe(m),L=[];void 0!==t.segmentTemplate&&L.push(t.segmentTemplate),void 0!==m.children.segmentTemplate&&L.push(m.children.segmentTemplate);var U={availabilityTimeComplete:x,availabilityTimeOffset:R,baseURLs:Y(t.baseURLs,g.baseURLs),manifestBoundsCalculator:t.manifestBoundsCalculator,end:t.end,isDynamic:t.isDynamic,isLastPeriod:t.isLastPeriod,manifestProfiles:t.manifestProfiles,parentSegmentTemplates:L,receivedTime:t.receivedTime,start:t.start,unsafelyBaseOnPreviousAdaptation:null},B=Array.isArray(T)?(0,s.Z)(T,(function(e){return"http://dashif.org/guidelines/trickmode"===e.schemeIdUri})):void 0,F=null===(u=null==B?void 0:B.value)||void 0===u?void 0:u.split(" "),V=void 0!==F,z=g.accessibilities,K=void 0;void 0!==E&&E.some((function(e){return"dub"===e.value}))&&(K=!0);var G=void 0;G="text"===P&&re(z,E);var W=void 0;"text"===P&&void 0!==E&&E.some((function(e){return"forced-subtitle"===e.value||"forced_subtitle"===e.value}))&&(W=!0);var H=void 0;"audio"!==P?H=!1:void 0!==z&&(H=z.some(ne));var j=void 0;"video"!==P?j=!1:void 0!==z&&(j=z.some(ie));for(var q=ae(m,{isAudioDescription:H,isForcedSubtitle:W,isClosedCaption:G,isSignInterpreted:j,isTrickModeTrack:V,type:P});(0,b.Z)(p,q);)q+="-dup";var X=q;p.push(q),U.unsafelyBaseOnPreviousAdaptation=null!==(d=null===(l=t.unsafelyBaseOnPreviousPeriod)||void 0===l?void 0:l.getAdaptation(q))&&void 0!==d?d:null;var Q={id:q,representations:J(Z,m,U),type:P,isTrickModeTrack:V};if(null!=m.attributes.language&&(Q.language=m.attributes.language),null!=G&&(Q.closedCaption=G),null!=H&&(Q.audioDescription=H),!0===K&&(Q.isDub=!0),void 0!==W&&(Q.forcedSubtitles=W),!0===j&&(Q.isSignInterpreted=!0),void 0!==w&&(Q.label=w),void 0!==F)f.push({adaptation:Q,trickModeAttachedAdaptationIds:F});else{for(var $,te=-1,ue=function(){var e=$.value,t=v[e];if(void 0!==t&&t.newID!==X&&(0,b.Z)(t.adaptationSetSwitchingIDs,N)){te=(0,_.Z)(c[P],(function(t){return t[0].id===e}));var n,r=c[P][te];if(void 0!==r&&r[0].audioDescription===Q.audioDescription&&r[0].closedCaption===Q.closedCaption&&r[0].language===Q.language)return o.Z.info('DASH Parser: merging "switchable" AdaptationSets',N,e),(n=r[0].representations).push.apply(n,Q.representations),r[1]={priority:Math.max(D,r[1].priority),isMainAdaptation:I||r[1].isMainAdaptation,indexInMpd:Math.min(h,r[1].indexInMpd)},1}},le=ee(O);!($=le()).done&&!ue(););te<0&&c[P].push([Q,{priority:D,isMainAdaptation:I,indexInMpd:h}])}null!=N&&null==v[N]&&(v[N]={newID:X,adaptationSetSwitchingIDs:O})}}var de=y.r.reduce((function(e,t){var n=c[t];return n.length>0&&(n.sort(se),e[t]=n.map((function(e){return e[0]}))),e}),{});return c.video.sort(se),k(de,f),de}(E.children.adaptations,U),F=(null!==(a=t.xmlNamespaces)&&void 0!==a?a:[]).concat(null!==(u=E.attributes.namespaces)&&void 0!==u?u:[]),V=function(e,t,n){for(var r,i,a,o=[],s=ue(e);!(a=s()).done;)for(var u,l=a.value,d=l.attributes,c=d.schemeIdUri,f=void 0===c?"":c,v=d.timescale,p=void 0===v?1:v,h=n.concat(null!==(r=l.attributes.namespaces)&&void 0!==r?r:[]),m=ue(l.children.events);!(u=m()).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,S=void 0;if(y.eventStreamData instanceof Element)S=y.eventStreamData;else{var T=h.reduce((function(e,t){return e+"xmlns:"+t.key+'="'+t.value+'" '}),"<toremove ");T+=">";var E=(0,g.uR)(new Uint8Array(y.eventStreamData));S=(new DOMParser).parseFromString(T+E+"</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:S}}})}}return o}(E.children.eventStreams,x,F),z={id:v,start:x,end:M,duration:R,adaptations:B,streamEvents:V};if(l.unshift(z),!f.lastPositionIsKnown()){var K=function(e){for(var t,n=null,r=!0,a=(0,m.Z)(e).filter((function(e){return!(0,i.Z)(e)})),o=ue((0,p.Z)(a,(function(e){return e})));!(t=o()).done;)for(var s,u=ue(t.value.representations);!(s=u()).done;){var l=s.value.index.getLastAvailablePosition();null!==l&&(r=!1,"number"==typeof l&&(n=(0,i.Z)(n)?l:Math.max(n,l)))}if(!(0,i.Z)(n))return n;if(r)return null;return}(B);if(c)if("number"==typeof K){var G=performance.now()/1e3;f.setLastPosition(K,G)}else{var W=fe(t,x);if(void 0!==W){var H=W[0],j=W[1];f.setLastPosition(H,j)}}else"number"==typeof K&&f.setLastPosition(K)}},h=e.length-1;h>=0;h--)v();if(t.isDynamic&&!f.lastPositionIsKnown()){var T=fe(t,0);if(void 0!==T){var E=T[0],w=T[1];f.setLastPosition(E,w)}}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(),0!==t.length);)i=t[t.length-1];t.push(r)}return t}(l)}function fe(e,t){if((0,i.Z)(e.clockOffset)){var n=Date.now()/1e3;if(n>=t)return o.Z.warn("DASH Parser: no clock synchronization mechanism found. Using the system clock instead."),[n-e.availabilityStartTime,performance.now()/1e3]}else{var r=e.clockOffset/1e3-e.availabilityStartTime,a=performance.now()/1e3,s=a+r;if(s>=t)return[s,a]}}function ve(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 pe(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 pe(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 pe(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 he=function e(t,n,r,i,d){void 0===d&&(d=new WeakMap);var c=t.children,p=t.attributes;if(null==n.externalClockOffset){var h="dynamic"===p.type,m=(0,s.Z)(c.utcTimings,(function(e){return"urn:mpeg:dash:utc:direct:2014"===e.schemeIdUri&&null!=e.value})),g=null!=m&&null!=m.value?l(m.value):void 0,y=null==g||isNaN(g)?void 0:g;if(null!=y&&!0!==i)n.externalClockOffset=y;else if(h&&!0!==i){var _=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!=_&&_.length>0)return{type:"needs-clock",value:{url:_,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=[],S=0;S<c.periods.length;S++){var T=c.periods[S].attributes,E=T.xlinkHref,k=T.xlinkActuate;null!=E&&"onLoad"===k&&b.push({index:S,ressource:E})}return 0===b.length?function(e,t,n,r){var i,s,l,d,c,p,h=e.children,m=e.attributes,g="dynamic"===m.type,y=void 0!==t.url?[{url:t.url.substring(0,(0,u.$)(t.url))}]:[],_=Y(y,h.baseURLs),b=function(e,t){return"dynamic"!==e.type?0:null==e.availabilityStartTime?null==t?0:t:e.availabilityStartTime}(m,t.referenceDateTime),S=m.timeShiftBufferDepth,T=t.externalClockOffset,E=t.unsafelyBaseOnPreviousManifest,k=t.externalClockOffset,w=new v({availabilityStartTime:b,isDynamic:g,timeShiftBufferDepth:S,serverTimestampOffset:k}),A={aggressiveMode:t.aggressiveMode,availabilityStartTime:b,baseURLs:_,clockOffset:T,duration:m.duration,isDynamic:g,manifestBoundsCalculator:w,manifestProfiles:e.attributes.profiles,receivedTime:t.manifestReceivedTime,timeShiftBufferDepth:S,unsafelyBaseOnPreviousManifest:E,xlinkInfos:r,xmlNamespaces:e.attributes.namespaces},I=ce(h.periods,A),Z=m.duration,x=null;void 0!==m.minimumUpdatePeriod&&m.minimumUpdatePeriod>=0&&(d=0===m.minimumUpdatePeriod?a.Z.getCurrent().DASH_FALLBACK_LIFETIME_WHEN_MINIMUM_UPDATE_PERIOD_EQUAL_0:m.minimumUpdatePeriod);var R=f(I),M=R.minimumSafePosition,C=R.maximumSafePosition,P=R.maximumUnsafePosition,D=performance.now();if(g){var N;if(void 0!==C)N=C;else if(void 0===k)o.Z.warn("DASH Parser: use system clock to define maximum position"),N=Date.now()/1e3-b;else N=(performance.now()+k)/1e3-b;var O=w.getEstimatedLiveEdge();void 0===O&&(O=void 0!==P?P:N),p={isLinear:!0,maximumSafePosition:N,livePosition:O,time:D},c=M,null!==(x=null!=S?S:null)&&void 0!==c&&O-c>x&&(x=O-c)}else{c=void 0!==M?M:void 0!==(null===(i=I[0])||void 0===i?void 0:i.start)?I[0].start:0;var L=null!=Z?Z:1/0;if(void 0!==I[I.length-1]){var U=I[I.length-1],B=null!==(s=U.end)&&void 0!==s?s:void 0!==U.duration?U.start+U.duration:void 0;void 0!==B&&B<L&&(L=B)}void 0!==C&&C<L&&(L=C),p={isLinear:!1,maximumSafePosition:L,livePosition:void 0,time:D}}var F=!g||void 0===e.attributes.minimumUpdatePeriod&&(void 0!==(null===(l=I[I.length-1])||void 0===l?void 0:l.end)||void 0!==e.attributes.duration),V={availabilityStartTime:b,clockOffset:t.externalClockOffset,isDynamic:g,isLive:g,isLastPeriodKnown:F,periods:I,publishTime:m.publishTime,suggestedPresentationDelay:m.suggestedPresentationDelay,transportType:"dash",timeBounds:{minimumSafePosition:c,timeshiftDepth:x,maximumTimeData:p},lifetime:d,uris:null==t.url?h.locations:[t.url].concat(h.locations)};return{type:"done",value:{parsed:V,warnings:n}}}(t,n,r,d):{type:"needs-xlinks",value:{xlinksUrls:b.map((function(e){return e.ressource})),continue:function(a){if(a.length!==b.length)throw new Error("DASH parser: wrong number of loaded ressources.");for(var o=a.length-1;o>=0;o--){var s,u=b[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=ve(f);!(g=y()).done;){var _=g.value;d.set(_,{receivedTime:p,sendingTime:h,url:m})}(s=c.periods).splice.apply(s,[u,1].concat(f))}return e(t,n,r,i,d)}}}};function me(e){var t=e.textContent,n=[];return null===t||0===t.length?[void 0,n]:[{value:t},n]}function ge(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 ye=n(7326),_e=n(4578),be=n(2146),Se=n(9689),Te=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,Ee=/([0-9]+)-([0-9]+)/;function ke(e,t){return"true"===e?[!0,null]:"false"===e?[!1,null]:[!1,new De("`"+t+'` property is not a boolean value but "'+e+'"')]}function we(e,t){var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ae(e,t){if("INF"===e)return[1/0,null];var n=parseFloat(e);return isNaN(n)?[null,new De("`"+t+'` property is not an integer value but "'+e+'"')]:[n,null]}function Ie(e,t){if("true"===e)return[!0,null];if("false"===e)return[!1,null];var n=parseInt(e,10);return isNaN(n)?[null,new De("`"+t+'` property is not a boolean nor an integer but "'+e+'"')]:[n,null]}function Ze(e,t){var n=Date.parse(e);return isNaN(n)?[null,new De("`"+t+'` is in an invalid date format: "'+e+'"')]:[new Date(Date.parse(e)).getTime()/1e3,null]}function xe(e,t){if(!(0,S.Z)(e))return[0,new De("`"+t+"` property is empty")];var n=Te.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[365*parseFloat((0,S.Z)(n[2])?n[2]:"0")*24*60*60+30*parseFloat((0,S.Z)(n[4])?n[4]:"0")*24*60*60+24*parseFloat((0,S.Z)(n[6])?n[6]:"0")*60*60+60*parseFloat((0,S.Z)(n[8])?n[8]:"0")*60+60*parseFloat((0,S.Z)(n[10])?n[10]:"0")+parseFloat((0,S.Z)(n[12])?n[12]:"0"),null]}function Re(e,t){var n=Ee.exec(e);return null===n?[null,new De("`"+t+'` property has an unrecognized format "'+e+'"')]:[[+n[1],+n[2]],null]}function Me(e,t){try{return[(0,Se.K)(e),null]}catch(n){return[null,new De("`"+t+'` is not a valid base64 string: "'+e+'"')]}}function Ce(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 Pe(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 De=function(e){function t(n){var r;return r=e.call(this)||this,Object.setPrototypeOf((0,ye.Z)(r),t.prototype),r.name="MPDError",r.message=n,r}return(0,_e.Z)(t,e),t}((0,be.Z)(Error));function Ne(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=Me(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,g.nr)(r.value.replace(/-/g,""))}}return t}(e)},r]}function Oe(e){for(var t={},n=[],r=Pe(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:Re,dashName:"range"});break;case"sourceURL":t.media=a.value}}return[t,n]}function Le(e){for(var t={},n=[],r=Pe(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=Oe(o),u=s[0],l=s[1];t.initialization=u,n=n.concat(l)}}for(var d=0;d<e.attributes.length;d++){var c=e.attributes[d];switch(c.name){case"timescale":r(c.value,{asKey:"timescale",parser:we,dashName:"timescale"});break;case"presentationTimeOffset":r(c.value,{asKey:"presentationTimeOffset",parser:Ae,dashName:"presentationTimeOffset"});break;case"indexRange":r(c.value,{asKey:"indexRange",parser:Re,dashName:"indexRange"});break;case"indexRangeExact":r(c.value,{asKey:"indexRangeExact",parser:ke,dashName:"indexRangeExact"});break;case"availabilityTimeOffset":r(c.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(c.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"});break;case"duration":r(c.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"startNumber":r(c.value,{asKey:"startNumber",parser:we,dashName:"startNumber"});break;case"endNumber":r(c.value,{asKey:"endNumber",parser:we,dashName:"endNumber"})}}return[t,n]}function Ue(e){for(var t={},n=[],r=Pe(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:Re,dashName:"indexRange"});break;case"index":t.index=a.value;break;case"mediaRange":r(a.value,{asKey:"mediaRange",parser:Re,dashName:"mediaRange"})}}return[t,n]}function Be(e){for(var t=Le(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=Ue(s),l=u[0],d=u[1];i.push(l),r=r.concat(d)}}return[(0,I.Z)(n,{list:i}),r]}function Fe(e){var t=null;return function(){if(null===t){var n=e.getElementsByTagName("S");return t=n,n}return t}}function Ve(e){for(var t,n=Le(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=Fe(o))}for(var s=(0,I.Z)({},r,{duration:r.duration,timelineParser:t}),u=Pe(s,i),l=0;l<e.attributes.length;l++){var d=e.attributes[l];switch(d.nodeName){case"initialization":null==s.initialization&&(s.initialization={media:d.value});break;case"index":s.index=d.value;break;case"availabilityTimeOffset":u(d.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":u(d.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"});break;case"media":s.media=d.value;break;case"bitstreamSwitching":u(d.value,{asKey:"bitstreamSwitching",parser:ke,dashName:"bitstreamSwitching"})}}return[s,i]}function ze(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=me(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(Ce(a));break;case"SegmentBase":var l=Le(a),d=l[0],c=l[1];t.segmentBase=d,c.length>0&&(r=r.concat(c));break;case"SegmentList":var f=Be(a),v=f[0],p=f[1];r=r.concat(p),t.segmentList=v;break;case"SegmentTemplate":var h=Ve(a),m=h[0],g=h[1];r=r.concat(g),t.segmentTemplate=m;break;case"ContentProtection":var y=Ne(a),_=y[0],b=y[1];b.length>0&&(r=r.concat(b)),void 0!==_&&n.push(_);break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ce(a)]:t.supplementalProperties.push(Ce(a))}}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=Pe(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:we,dashName:"bandwidth"});break;case"codecs":t.codecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ke,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:we,dashName:"height"});break;case"id":t.id=a.value;break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Ae,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Ae,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:we,dashName:"qualityRanking"});break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"segmentProfiles":t.segmentProfiles=a.value;break;case"width":r(a.value,{asKey:"width",parser:we,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"})}}return void 0===t.bitrate&&n.push(new De("No bitrate found on a Representation")),[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ke(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=[Ce(a)]:t.accessibilities.push(Ce(a));break;case"BaseURL":var o=me(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=ge(a);break;case"EssentialProperty":null==t.essentialProperties?t.essentialProperties=[Ce(a)]:t.essentialProperties.push(Ce(a));break;case"InbandEventStream":void 0===t.inbandEventStreams&&(t.inbandEventStreams=[]),t.inbandEventStreams.push(Ce(a));break;case"Label":var l=a.textContent;null!=l&&(t.label=l);break;case"Representation":var d=ze(a),c=d[0],f=d[1];t.representations.push(c),f.length>0&&(r=r.concat(f));break;case"Role":null==t.roles?t.roles=[Ce(a)]:t.roles.push(Ce(a));break;case"SupplementalProperty":null==t.supplementalProperties?t.supplementalProperties=[Ce(a)]:t.supplementalProperties.push(Ce(a));break;case"SegmentBase":var v=Le(a),p=v[0],h=v[1];t.segmentBase=p,h.length>0&&(r=r.concat(h));break;case"SegmentList":var m=Be(a),g=m[0],y=m[1];t.segmentList=g,y.length>0&&(r=r.concat(y));break;case"SegmentTemplate":var _=Ve(a),b=_[0],S=_[1];t.segmentTemplate=b,S.length>0&&(r=r.concat(S));break;case"ContentProtection":var T=Ne(a),E=T[0],k=T[1];k.length>0&&(r=r.concat(k)),void 0!==E&&n.push(E)}}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=Pe(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:we,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:we,dashName:"minBandwidth"});break;case"maxBandwidth":r(a.value,{asKey:"maxBitrate",parser:we,dashName:"maxBandwidth"});break;case"minWidth":r(a.value,{asKey:"minWidth",parser:we,dashName:"minWidth"});break;case"maxWidth":r(a.value,{asKey:"maxWidth",parser:we,dashName:"maxWidth"});break;case"minHeight":r(a.value,{asKey:"minHeight",parser:we,dashName:"minHeight"});break;case"maxHeight":r(a.value,{asKey:"maxHeight",parser:we,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:we,dashName:"selectionPriority"});break;case"segmentAlignment":r(a.value,{asKey:"segmentAlignment",parser:Ie,dashName:"segmentAlignment"});break;case"subsegmentAlignment":r(a.value,{asKey:"subsegmentAlignment",parser:Ie,dashName:"subsegmentAlignment"});break;case"bitstreamSwitching":r(a.value,{asKey:"bitstreamSwitching",parser:ke,dashName:"bitstreamSwitching"});break;case"audioSamplingRate":t.audioSamplingRate=a.value;break;case"codecs":t.codecs=a.value;break;case"scte214:supplementalCodecs":t.supplementalCodecs=a.value;break;case"codingDependency":r(a.value,{asKey:"codingDependency",parser:ke,dashName:"codingDependency"});break;case"frameRate":t.frameRate=a.value;break;case"height":r(a.value,{asKey:"height",parser:we,dashName:"height"});break;case"maxPlayoutRate":r(a.value,{asKey:"maxPlayoutRate",parser:Ae,dashName:"maxPlayoutRate"});break;case"maximumSAPPeriod":r(a.value,{asKey:"maximumSAPPeriod",parser:Ae,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:we,dashName:"width"});break;case"availabilityTimeOffset":r(a.value,{asKey:"availabilityTimeOffset",parser:Ae,dashName:"availabilityTimeOffset"});break;case"availabilityTimeComplete":r(a.value,{asKey:"availabilityTimeComplete",parser:ke,dashName:"availabilityTimeComplete"})}}return[t,n]}(e),a=i[0],o=i[1];return[{children:n,attributes:a},r.concat(o)]}function Ge(e){for(var t={children:{events:[]},attributes:{}},n=[],r=Pe(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:we,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=We(s),l=u[0],d=u[1];t.children.events.push(l),d.length>0&&(n=n.concat(d))}}return[t,n]}function We(e){for(var t={eventStreamData:e},n=[],r=Pe(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:we,dashName:"presentationTime"});break;case"duration":r(a.value,{asKey:"duration",parser:we,dashName:"duration"});break;case"id":t.id=a.value}}return[t,n]}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=me(s),l=u[0],d=u[1];void 0!==l&&n.push(l),i=i.concat(d);break;case"AdaptationSet":var c=Ke(s),f=c[0],v=c[1];r.push(f),i=i.concat(v);break;case"EventStream":var p=Ge(s),h=p[0],m=p[1];a.push(h),i=i.concat(m);break;case"SegmentTemplate":var g=Ve(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=Pe(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:ke,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 je(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=me(s),l=u[0],d=u[1];void 0!==l&&t.push(l),a=a.concat(d);break;case"Location":n.push(null===s.textContent?"":s.textContent);break;case"Period":var c=He(s),f=c[0],v=c[1];r.push(f),a=a.concat(v);break;case"UTCTiming":var p=Ce(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=Pe(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:Ze,dashName:"availabilityStartTime"});break;case"availabilityEndTime":r(a.value,{asKey:"availabilityEndTime",parser:Ze,dashName:"availabilityEndTime"});break;case"publishTime":r(a.value,{asKey:"publishTime",parser:Ze,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 qe=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=je(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 d="<root>"+o.data+"</root>",c=(new DOMParser).parseFromString(d,"text/xml");if(null==c||0===c.children.length)throw new Error("DASH parser: Invalid external ressources");for(var f=c.children[0].children,v=[],p=[],h=0;h<f.length;h++)if(f[h].nodeType===Node.ELEMENT_NODE){var m=He(f[h]),g=m[0],y=m[1];p.push.apply(p,y),v.push(g)}r.push({url:l,receivedTime:s,sendingTime:u,parsed:v,warnings:p})}var _=t.value.continue(r);return e(_)}}};(0,r.Z)(t)}(he(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 d=r[u+1];if(void 0===d)return null;var c=d.start;return i>=a(l,d,n)&&i<c?s(c,e):null}},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 d=n-u;return e.splice.apply(e,[u,d].concat(t)),!1}if(l<o){var c=e[u];if(c.start+c.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===c.repeatCount||c.repeatCount<=0)return c.repeatCount<0&&(c.repeatCount=Math.floor((o-c.start)/c.duration)-1),e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;if(c.start+c.duration*(c.repeatCount+1)<=o)return e.splice.apply(e,[u+1,n-(u+1)].concat(t)),!1;var f=(o-c.start)/c.duration-1;if(f%1==0&&c.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=c.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 d,c,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(;d=f.exec(e),c=v.exec(e),null!==d||null!==c;){if(null===d||null===c||d.index>=c.index)throw new Error("parse error");var b=e.slice(d.index,c.index),S=u.exec(b);if(!Array.isArray(S))throw new Error("parse error (sync time attribute)");var T=+S[1];if(isNaN(T))throw new Error("parse error (sync time attribute NaN)");E(b.split("\n"),T/1e3)}return p;function E(e,n){for(var o=e.length;--o>=0;){var u=s.exec(e[o]);if(Array.isArray(u)){var l=u[1],d=u[2];if(g===l)if(" "===d)p[p.length-1].end=n;else{var c=document.createElement("DIV");c.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=d.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),c.appendChild(f),p.push({element:c,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 d(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,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=d(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(;c=v.exec(e),f=p.exec(e),null!==c||null!==f;){if(null===c||null===f||c.index>=f.index)throw new Error("parse error");var b=e.slice(c.index,f.index),S=l.exec(b);if(null===S)throw new Error("parse error (sync time attribute)");var T=+S[1];if(isNaN(T))throw new Error("parse error (sync time attribute NaN)");E(b.split("\n"),T/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 E(e,n){for(var r,i,s=e.length;--s>=0;)if(null!==(r=u.exec(e[s]))){var l=r,d=l[1],c=l[2];y===d&&(" "===c?h[h.length-1].end=n:h.push({text:(i=c,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 d=o(l);null!=d&&s.push(d)}}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 d=e(a);d.style.fontWeight="bold",r.appendChild(d)}else if("I"===a.nodeName){var c=e(a);c.style.fontStyle="italic",r.appendChild(c)}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,d=e.split(/\r\n|\n|\r/),c=(0,i.Z)(d),f=[],v=0;v<c.length;v++){var p=(0,a.Z)(c[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),d=i(a);return void 0===l||void 0===d?null:{start:l+t,end:d+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={},l=e.slice(),d=function(){var e=t[c];if(void 0!==e){var s,d;if(e.nodeType===Node.ELEMENT_NODE)for(var f=e,v=0;v<=f.attributes.length-1;v++){var p=f.attributes[v],h=p.name;if("style"===h)s=p.value;else if("region"===h)d=p.value;else{var m=h.substring(4);if((0,i.Z)(l,m)&&(u[m]=p.value,l.splice(v,1),0===l.length))return{v:u}}}if((0,a.Z)(s)){var g=(0,r.Z)(n,(function(e){return e.id===s}));if(void 0!==g)for(var y=0;y<=l.length-1;y++){var _=l[y];if(!(0,a.Z)(u[_])&&(0,a.Z)(g.style[_])){if(u[_]=g.style[_],l.splice(y,1),0===l.length)return{v:u};y--}}}if((0,a.Z)(d)){var b=(0,r.Z)(o,(function(e){return e.id===d}));if(void 0!==b)for(var S=0;S<=l.length-1;S++){var T=l[S];if(!(0,a.Z)(u[T])&&(0,a.Z)(b.style[T])){if(u[T]=b.style[T],l.splice(S,1),0===l.length)return{v:u};S--}}}}},c=0;c<=t.length-1;c++)if(s=d())return s.v;return u}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,o+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 k}});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),d=n(8026),c=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 d=m(o[0]),c=o[1];e.style.textShadow=h(d,c)}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 S=t.textDecoration;if((0,l.Z)(S))switch(S){case"noUnderline":case"noLineThrough":case"noOverline":e.style.textDecoration="none";break;case"lineThrough":e.style.textDecoration="line-through";break;default:e.style.textDecoration=S}var T=t.fontFamily;if((0,l.Z)(T))switch(T){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=T}var E=t.fontStyle;(0,l.Z)(E)&&(e.style.fontStyle=E);var k=t.fontWeight;(0,l.Z)(k)&&(e.style.fontWeight=k);var w=t.fontSize;(0,l.Z)(w)?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,w):(u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1"));var A=t.direction;(0,l.Z)(A)&&(e.style.direction=A);var I=t.unicodeBidi;if((0,l.Z)(I))switch(I){case"bidiOverride":e.style.unicodeBidi="bidi-override";break;case"embed":e.style.unicodeBidi="embed";break;default:e.style.unicodeBidi="normal"}var Z=t.visibility;(0,l.Z)(Z)&&(e.style.visibility=Z),"none"===t.display&&(e.style.display="none");var x=t.wrapOption;e.style.whiteSpace="noWrap"===x?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 d=p.eT.exec(n[3]);if(null!==d)if("px"===d[2]||"%"===d[2]||"em"===d[2]){var c=d[1]+d[2];e.style.paddingLeft=c}else"c"===d[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-padding-left",d[1])):v.Z.warn("TTML Parser: unhandled padding unit:",d[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 d=t.opacity;(0,l.Z)(d)&&(e.style.opacity=d);var c=t.visibility;(0,l.Z)(c)&&(e.style.visibility=c),"none"===t.display&&(e.style.display="none")}function b(e,t){e.style.margin="0px",u(e,"proportional-style"),e.setAttribute("data-proportional-font-size","1");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(),r=n.split(" ");if("auto"!==n){var i=p.eT.exec(r[0]);null!==i&&("px"===i[2]||"%"===i[2]||"em"===i[2]?e.style.lineHeight=i[1]+i[2]:"c"===i[2]?(u(e,"proportional-style"),e.setAttribute("data-proportional-line-height",i[1])):v.Z.warn("TTML Parser: unhandled lineHeight unit:",i[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 S(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 T(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,c.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,c.U)(["backgroundColor"],a,n,t).backgroundColor;(0,l.Z)(h)?i.backgroundColor=h:delete i.backgroundColor;var m=S(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,T=(0,d.Z)({},i,(0,c.U)(g,[p],n,t));u.push.apply(u,e(p,T,[p].concat(a),b))}}return u}(e,(0,d.Z)({},r),[],i)}(e,n,r,i,s),T=0;T<y.length;T++)h.appendChild(y[T]);return v.appendChild(h),v}function E(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 d=n.cellResolution,c=(0,s.Z)(t,n);return{start:c.start+u,end:c.end+u,element:T(t,r,i,a,o,{cellResolution:d,shouldTrimWhiteSpace:l})}}var k=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=E(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),d={left:"start",center:"center",right:"end",start:"start",end:"end"},c={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 d=u.trim();u=d=d.replace(/\s+/g," ")}i+=u.replace(/&|\u0026/g,"&").replace(/<|\u003C/g,"<").replace(/>|\u2265/g,">").replace(/\u200E/g,"‎").replace(/\u200F/g,"‏").replace(/\u00A0/g," ")}else if((0,l.OE)(s))i+="\n";else if((0,l.jg)(s)&&s.nodeType===Node.ELEMENT_NODE&&s.childNodes.length>0){var c=s.getAttribute("xml:space");i+=n(s,(0,o.Z)(c)?"default"===c: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=c[a];e.positionAlign=void 0===s?"":s;var l=d[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),d=n(7714);var c=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,c.H)(p),m=(0,c.vU)(p),g=(0,c.DM)(p),y=(0,c.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"),d={columns:32,rows:15};if(null!==l){var c=s.exec(l);if(null===c||c.length<3)o.Z.warn("TTML Parser: Invalid cellResolution");else{var f=parseInt(c[1],10),v=parseInt(c[2],10);isNaN(f)||isNaN(v)?o.Z.warn("TTML Parser: Invalid cellResolution"):d={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 S=/^(\d+) (\d+)$/g.exec(a);null!==S&&(g=p*(Number(S[1])/Number(S[2])))}return{cellResolution:d,tickRate:b,frameRate:g,subFrameRate:y,spaceStyle:_}}(p),b=[],S=0;S<=m.length-1;S++){var T=m[S];if(T instanceof Element){var E=T.getAttribute("xml:id");if(null!==E){var k=T.getAttribute("style"),w=null===k?[]:k.split(" ");b.push({id:E,style:(0,u.b)(T),extendsStyles:w})}}}!function(e){var t=[];function n(r,i){t.push(i);for(var s=function(){var i=r.extendsStyles[u],s=(0,l.Z)(e,(function(e){return e.id===i}));if(s<0)o.Z.warn("TTML Parser: unknown style inheritance: "+i);else{var c=e[s];(0,d.Z)(t,s)?o.Z.warn("TTML Parser: infinite style inheritance loop avoided"):n(c,s),r.style=(0,a.Z)({},c.style,r.style)}},u=0;u<r.extendsStyles.length;u++)s();r.extendsStyles.length=0}for(var r=0;r<e.length;r++)n(e[r],r),t.length=0}(b);for(var A=[],I=function(){var e=g[Z];if(e instanceof Element){var t=e.getAttribute("xml:id");if(null!==t){var n=(0,u.b)(e),o=e.getAttribute("style");if((0,i.Z)(o)){var s=(0,r.Z)(b,(function(e){return e.id===o}));void 0!==s&&(n=(0,a.Z)({},s.style,n))}A.push({id:t,style:n,extendsStyles:[]})}}},Z=0;Z<=g.length-1;Z++)I();for(var x=(0,u.U)(f,null!==h?[h]:[],b,A),R="default"===(null!==h?h.getAttribute("xml:space"):void 0)||"default"===_.spaceStyle,M=0;M<y.length;M++){var C=y[M];if(C instanceof Element){var P=(0,c.jF)(C),D=(0,a.Z)({},x,(0,u.U)(f,[C].concat(P),b,A)),N=C.getAttribute("xml:space"),O=(0,i.Z)(N)?"default"===N:R,L={paragraph:C,timeOffset:t,idStyles:b,regionStyles:A,body:h,paragraphStyle:D,ttParams:_,shouldTrimWhiteSpace:O};null!==L&&n.push(L)}}}return n}},5336:function(e,t,n){"use strict";n.d(t,{Dq:function(){return c},Du:function(){return s},GK:function(){return v},KO:function(){return i},YU:function(){return f},_0:function(){return l},eT:function(){return d},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)%$/,d=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/,c=/^#([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 d(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 d},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 I}});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=function(r){var o=e[r];if(Array.isArray(/::cue {/.exec(o)))for(o=e[++r];(0,i.Z)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)n+=o,o=e[++r];else{for(var s=[],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);(0,i.Z)(o)&&Array.isArray(u);)s.push(u[1]),o=e[++r],u=/::cue\(\.?(.*?)\)(?:,| {)/.exec(o);for(var l="";(0,i.Z)(o)&&!Array.isArray(/}/.exec(o))&&0!==o.length;)l+=o,o=e[++r];s.forEach((function(e){void 0===t[e]?t[e]=l:t[e]+=l}))}a=r},a=1;a<e.length;a++)r(a)})),{classes:t,global:n}}var l=n(7714);function d(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 c=e.nodeName.toLowerCase().split("."),f=[];if(c.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=d(e.childNodes[m],t);n.appendChild(g)}}else{n=document.createElement("span");for(var y=0;y<e.childNodes.length;y++){var _=d(e.childNodes[y],t);n.appendChild(_)}}return n}var c=n(1679);var f,v,p,h=function(e){if(!(void 0!==e&&0!==(0,c.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: "+E(e.size)+"%;left: "+t.position+"%;top: "+(null!==n.position?n.position+"%":"auto")+";text-align: "+T(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=w(e.position);if(null!==n)return n;var r=T(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?T(e.align):v.CENTER]},_=function(e){return{position:b(e.line),offset:S(e.line)}},b=function(e){return w(e)},S=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]},T=function(e){switch(e){case"left":case"start":return"left";case"right":case"end":return"right";default:return"center"}},E=function(e){return k(e,100)},k=function(e,t){var n=w(e);return null!==n?n:t},w=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 c=document.createElement("p"),f=function(e){var t=document.createAttribute("style");return t.value=h(e),t}(a);c.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(d(r[a],t));return i}(s.join("\n"),g).forEach((function(e){v.appendChild(e)})),u.appendChild(c),c.appendChild(v),{start:n,end:r,element:u}}var I=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),d=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),c=(0,r.Z)(n,l),f=u(d),v=0;v<c.length;v++){var p=(0,o.Z)(c[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 c}});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 d=n(7253);var c=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,c,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,c=void 0,f=void 0,u=(s=g).start,c=s.end,f=s.payload.join("\n"),(0,d.Z)(u,c,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 ce}});var r=n(7874),i=n(8791),a=n(5861),o=n(4687),s=n.n(o),u=n(4597),l=n(9829);function d(e,t){return null===e?null:null===t.url?e.baseUrl:(0,l.Z)(e.baseUrl,t.url)}function c(e,t,n,r,i){return f.apply(this,arguments)}function f(){return(f=(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 v(e,t){var n,i=t.segment,a=t.period,o=e.data,s=e.isChunked;if(t.segment.isInit)return{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:void 0};if(s)throw new Error("Image data should not be downloaded in chunks");var u=null!==(n=i.timestampOffset)&&void 0!==n?n:0;return null===o||null===r.Z.imageParser?{segmentType:"media",chunkData:null,chunkSize:0,chunkInfos:{duration:i.duration,time:i.time},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}:{segmentType:"media",chunkData:{data:r.Z.imageParser(new Uint8Array(o)).thumbs,start:0,end:Number.MAX_VALUE,timescale:1,type:"bif"},chunkSize:void 0,chunkInfos:{time:0,duration:Number.MAX_VALUE},chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}var p=n(6872),h=n(8750),m=n(3887),g=n(1989),y=n(8026),_=n(3635);function b(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,d){var c,f=a.responseData,v=o.externalClockOffset,b=null!==(c=a.url)&&void 0!==c?c:o.originalUrl,S=null!=i?i:v,T={aggressiveMode:!0===t,unsafelyBaseOnPreviousManifest:o.unsafeMode?o.previousManifest:null,url:b,referenceDateTime:n,externalClockOffset:S},E=r.Z.dashParsers;if(null===E.wasm||"uninitialized"===E.wasm.status||"failure"===E.wasm.status)return m.Z.debug("DASH: WASM MPD Parser not initialized. Running JS one."),w();var k=function(e){if(e instanceof ArrayBuffer)return e;if("string"==typeof e)return(0,_.tG)(e).buffer;if(e instanceof Document)return(0,_.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}(k)?"initialized"===E.wasm.status?(m.Z.debug("DASH: Running WASM MPD Parser."),A(E.wasm.runWasmParser(k,T))):(m.Z.debug("DASH: Awaiting WASM initialization before parsing the MPD."),E.wasm.waitForInitialization().catch((function(){})).then((function(){return null===E.wasm||"initialized"!==E.wasm.status?(m.Z.warn("DASH: WASM MPD parser initialization failed. Running JS parser instead"),w()):(m.Z.debug("DASH: Running WASM MPD Parser."),A(E.wasm.runWasmParser(k,T)))}))):(m.Z.info("DASH: MPD doesn't seem to be UTF-8-encoded. Running JS parser instead of the WASM one."),w());function w(){if(null===E.js)throw new Error("No MPD parser is imported");var e=function(e){if(e instanceof ArrayBuffer)return(new DOMParser).parseFromString((0,_.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(E.js(e,T))}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 g.ZP(t.value.parsed,e),url:b};var n=t.value,r=n.urls.map((function(e){return d((function(){var t=p.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,y.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,y.Z)(e,{responseData:{success:!0,data:e.responseData}})}),(function(e){var t=(0,h.Z)(e,{defaultCode:"PIPELINE_PARSE_ERROR",defaultReason:"An unknown error occured when parsing ressources."});return(0,y.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 S=n(7839),T=n(9105),E=n(5992),k=n(1946),w="function"==typeof Headers?Headers:null,A="function"==typeof AbortController?AbortController:null;function I(){return"function"==typeof window.fetch&&!(0,k.Z)(A)&&!(0,k.Z)(w)}var Z=n(8806),x=n(281);function R(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 M=n(288),C=n(4460);function P(e){return function(t,n,r,i,a){return new Promise((function(s,u){var l=new M.ZP,d=l.linkToSignal(i);function c(){l.signal.deregister(u),d()}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(c(),!l.isUsed()){if("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"===R(n.adaptation.type,n.representation)&&(0,C.Z)(new Uint8Array(e),n.segment.isInit)}}}var D=n(6968);function N(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,x.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,x.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,x.Z)(t.range)},responseType:"arraybuffer",timeout:n.timeout,cancelSignal:r,onProgress:i.onProgress}),o=(0,u.ZP)({url:e,headers:{Range:(0,x.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,D.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 O=n(8766);function L(e,t,n,r,i){var o=t.segment,u=void 0!==o.range?{Range:(0,x.Z)(o.range)}:void 0,l=null;return function(e){var t;if(!(0,k.Z)(e.headers))if((0,k.Z)(w))t=e.headers;else{t=new w;for(var n=Object.keys(e.headers),r=0;r<n.length;r++){var i=n[r];t.append(i,e.headers[i])}}m.Z.debug("Fetch: Called with URL",e.url);var o,u=null,l=!1,d=performance.now(),c=(0,k.Z)(A)?null:new A;function f(){(0,k.Z)(c)?m.Z.warn("Fetch: AbortController API not available."):c.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)(c)?null:c.signal,fetch(e.url,p).then((function(t){if((0,k.Z)(o)||clearTimeout(o),t.status>=300)throw m.Z.warn("Fetch: Request HTTP Error",t.status,t.url),new T.Z(t.url,t.status,E.br.ERROR_HTTP_CODE);if((0,k.Z)(t.body))throw new T.Z(t.url,t.status,E.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 c.apply(this,arguments)}function c(){return(c=(0,a.Z)(s().mark((function n(){var a,o,c,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(),c={url:t.url,currentTime:o,duration:o-d,sendingTime:d,chunkSize:a.value.byteLength,chunk:a.value.buffer,size:u,totalSize:r},e.onData(c),n.abrupt("return",l());case 11:if(!a.done){n.next=16;break}return v(),f=performance.now(),p=f-d,n.abrupt("return",{requestDuration:p,receivedTime:f,sendingTime:d,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 m.Z.warn("Fetch: Request timeouted."),new T.Z(e.url,0,E.br.TIMEOUT);if(t instanceof T.Z)throw t;throw m.Z.warn("Fetch: Request Error",t instanceof Error?t.toString():""),new T.Z(e.url,0,E.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,O.Z)(r,1836019558);if(i<0)return[n,r];var a=t+i+(0,D.pX)(e,i+t);if(a>e.length)return[n,r];var o=(0,O.Z)(r,1835295092);if(o<0)return[n,r];var s=t+o+(0,D.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,D.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 N(e,t.segment,r,a,i);var o=R(t.adaptation.type,t.representation);if(n&&("mp4"===o||void 0===o)){if(I())return L(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,x.Z)(s.range)}:void 0,timeout:r.timeout,cancelSignal:a,onProgress:i.onProgress}).then((function(e){return{resultType:"segment-loaded",resultData:e}}))}var B=n(6490),F=n(4644),V=408125543,z=357149030,K=2807729,G=17545,W=475249515,H=187,j=179,q=183,Y=241;function X(e,t,n,r){for(var i=r[0],a=r[1],o=i;o<a;){var s=ee(n,o);if(null==s)return null;var u=s.value,l=o+s.length,d=te(n,l);if(null==d)return null;var c=l+d.length,f=c+d.value;if(u===e)return[c,f];if(t.length>0)for(var v=0;v<t.length;v++){if(u===t[v])return X(e,t.slice(v+1,t.length),n,[c,f])}o=f}return null}function Q(e,t){var n=X(K,[V,z],e,[t,e.length]);if(null==n)return null;var r=n[1]-n[0];return 1e9/ne(e,n[0],r)}function $(e,t){var n=X(G,[V,z],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 ee(e,t){var n=J(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.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 te(e,t){var n=J(e,t);if(null==n)return m.Z.warn("webm: unrepresentable length"),null;if(t+n>e.length)return m.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 ne(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 re=n(7403);function ie(e,t,n,r){var i=(0,F.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,F.MM)(e);if(o<0&&(void 0!==s&&(s+=o),o=0),t||!n.complete)return void 0===s&&m.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 ae(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,_.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 oe(e){var t=e.__priv_patchLastSegmentInSidx;return function(e,n,r){var i,a,o=n.period,s=n.adaptation,u=n.representation,l=n.segment,d=n.manifest,c=e.data,f=e.isChunked,v=[o.start,o.end];if(null===c)return l.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=c instanceof Uint8Array?c:new Uint8Array(c),h=R(s.type,u),m="mp4"===h||void 0===h,g=!1;if(m){var y,_=(0,B.Z)(p);l.isInit&&(y=null!==(i=(0,F.R0)(p))&&void 0!==i?i:void 0),(_.length>0||void 0!==y)&&(g=u._addProtectionData("cenc",y,_))}if(!l.isInit){var b=m?ie(p,f,l,r):null,S=null!==(a=l.timestampOffset)&&void 0!==a?a:0;if(m){var T=(0,F.s9)(p);if(void 0!==T){var E=ae(T.filter((function(e){return void 0!==l.privateInfos&&void 0!==l.privateInfos.isEMSGWhitelisted&&l.privateInfos.isEMSGWhitelisted(e)})),d.publishTime);if(void 0!==E){var w=E.needsManifestRefresh,A=E.inbandEvents;return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:S,appendWindow:v,inbandEvents:A,protectionDataUpdate:g,needsManifestRefresh:w}}}}return{segmentType:"media",chunkData:p,chunkSize:p.length,chunkInfos:b,chunkOffset:S,protectionDataUpdate:g,appendWindow:v}}var I=l.indexRange,Z=null;if("webm"===h)Z=function(e,t){var n=X(V,[],e,[t,e.length]);if(null==n)return null;var r=n[0],i=n[1],a=Q(e,r);if(null==a)return null;var o=$(e,r);if(null==o)return null;var s=X(W,[],e,[r,i]);if(null==s)return null;for(var u=[],l=s[0];l<s[1];){var d=X(H,[],e,[l,s[1]]);if(null==d)break;var c=X(j,[],e,[d[0],d[1]]);if(null==c)return null;var f=ne(e,c[0],c[1]-c[0]),v=X(Y,[q],e,[d[0],d[1]]);if(null==v)return null;var p=ne(e,v[0],v[1]-v[0])+r;u.push({time:f,rangeStart:p}),l=d[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&&(Z=(0,F.Wf)(p,Array.isArray(I)?I[0]:0),!0===t&&null!==Z&&Z.length>0)){var x=Z[Z.length-1];Array.isArray(x.range)&&(x.range[1]=1/0)}u.index instanceof re.Z&&null!==Z&&Z.length>0&&u.index.initializeIndex(Z);var M=m?(0,F.LD)(p):"webm"===h?Q(p,0):void 0,C=(0,k.Z)(M)?void 0:M;return{segmentType:"init",initializationData:p,initializationDataSize:p.length,protectionDataUpdate:g,initTimescale:C}}}var se=n(6807);function ue(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):m.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),d=function(e){var t=(0,se.Le)(e);return null===t?"":(0,_.uR)(t)}(t);return{data:d,type:l,language:s.language,start:i,end:a}}function le(e,t,n){var r,i,a=e.segment,o=e.adaptation,s=e.representation;if(a.isInit)return null;n?m.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 de(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,l=e.data,d=e.isChunked;if(null===l)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 c=R(o.type,s);if("webm"===c)throw new Error("Text tracks with a WEBM container are not yet handled.");return"mp4"===c?function(e,t,n,r,i){var a,o=n.period,s=n.representation,u=n.segment,l=u.isInit,d=u.indexRange,c="string"==typeof e?(0,_.tG)(e):e instanceof Uint8Array?e:new Uint8Array(e);if(l){var f=(0,F.Wf)(c,Array.isArray(d)?d[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,F.LD)(c);return s.index instanceof re.Z&&null!==f&&f.length>0&&s.index.initializeIndex(f),{segmentType:"init",initializationData:null,initializationDataSize:0,protectionDataUpdate:!1,initTimescale:p}}var h=ie(c,t,u,r),m=ue(n,c,h,t),g=null!==(a=u.timestampOffset)&&void 0!==a?a:0;return{segmentType:"media",chunkData:m,chunkSize:c.length,chunkInfos:h,chunkOffset:g,protectionDataUpdate:!1,appendWindow:[o.start,o.end]}}(l,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,_.uR)(l),i=l.length}else r=e;return{segmentType:"media",chunkData:le(n,r,t),chunkSize:i,chunkInfos:null,chunkOffset:u,protectionDataUpdate:!1,appendWindow:[a.start,a.end]}}(l,d,n)}}var ce=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=b(e),a=function(e){var t=e.lowLatencyMode,n=e.segmentLoader;return!0!==e.checkMediaSegmentIntegrity?r:P(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 d=!1,c=n(u,{reject:function(e){var t,n,r;if(!d&&!a.isCancelled()){d=!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 S.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){d||a.isCancelled()||(d=!0,a.deregister(f),e({resultType:"segment-loaded",resultData:{responseData:t.data,size:t.size,requestDuration:t.duration}}))},progress:function(e){d||a.isCancelled()||o.onProgress({duration:e.duration,size:e.size,totalSize:e.totalSize})},fallback:function(){d||a.isCancelled()||(d=!0,a.deregister(f),U(s,r,t,i,o,a).then(e,l))}});function f(e){d||(d=!0,"function"==typeof c&&c(),l(e))}a.register(f)}))}}(e),o=oe(e),s=function(e){var t=e.lowLatencyMode;return!0!==e.checkMediaSegmentIntegrity?n:P(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 N(f,l,r,i,a);var v=R(o.type,s),p="mp4"===v||void 0===v;if(t&&p){if(I())return L(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,x.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,x.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:de(e)},image:{loadSegment:c,parseSegment:v}}}},2339:function(e,t,n){"use strict";n.d(t,{Z:function(){return me}});var r=n(5861),i=n(4687),a=n.n(i),o=n(7874),s=n(3887),u=n(1989),l=n(6807),d=n(9362),c=n(811),f=n(8232),v=n(3911),p=n(5505);function h(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 m(e,t){return e.replace(/\{start time\}/g,String(t))}function g(e,t,n){var r=t-e;return r>0?Math.floor(r/n):0}function y(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 _=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,d=this._isAggressiveMode,c=[],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],_=h.duration,b=h.start,S=y(h,s[p+1]),T=g(b,i,_),E=b+T*_,k=d?0:_;E<a&&T<=S&&(null==v||E+k<=v);){var w=E,A=null!=n?n+T:void 0,I={id:String(E),isInit:!1,time:w/u,end:(w+_)/u,duration:_/u,timescale:1,number:A,url:m(l,w),complete:!0,privateInfos:{smoothMediaSegment:{time:w,duration:_}}};c.push(I),E=b+ ++T*_}if(E>=a)return c;null!=n&&(n+=S+1)}return c},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,c.Z)(e<=t),this.isStillAwaitingFutureSegments())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();for(var t=this._index,n=t.timeline,r=t.timescale,i=0;i<n.length;i++){var a=n[i],o=a.start/r;if(o>e.time)return!1;if(o===e.time)return!0;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},t.canBeOutOfSyncError=function(e){return!!this._isLive&&(e instanceof d.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 d=t[l],c=(0,v.jH)(d,null);if(c===u)return void(this._index.timeline=this._index.timeline.concat(t.slice(l+1)));if(c>u){if(d.duration!==o.duration)return;var f=u-d.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%d.duration!=0)return;var p=f/d.duration-1,h=d.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,p.Z)(this._index.timeline,e._index.timeline),this._initialScaledLastPosition=e._initialScaledLastPosition,this._indexValidityTime=e._indexValidityTime,this._scaledLiveGap=e._scaledLiveGap},t.isStillAwaitingFutureSegments=function(){return this._isLive},t.isInitialized=function(){return!0},t.addNewSegments=function(e,t){this._refreshTimeline();for(var n=0;n<e.length;n++)h(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}(),b=n(8999),S=n(7714),T=n(6968),E=n(6923),k=n(8026),w=n(9829),A=n(3635),I=n(2689),Z={};function x(e){if(null!=Z[e])return Z[e];var t=(0,A.tG)(e);return Z[e]=t,t}function R(e,t){var n=t.length+8;return n<=I.s?(0,T.zo)((0,T.kh)(n),x(e),t):(0,T.zo)((0,T.kh)(1),x(e),(0,T.el)(n+8),t)}function M(e,t){return R(e,T.zo.apply(void 0,t))}function C(e){var t=[];e.periods.forEach((function(n){var r=n.id;if((0,S.Z)(t,r)){s.Z.warn("Two periods with the same ID found. Updating.");var i=r+"-dup";n.id=i,C(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,S.Z)(o,n)){s.Z.warn("Two adaptations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,C(e),o.push(r)}else o.push(n);var i=[];t.representations.forEach((function(t){var n=t.id;if((0,S.Z)(i,n)){s.Z.warn("Two representations with the same ID found. Updating.",n);var r=n+"-dup";t.id=r,C(e),i.push(r)}else i.push(n)}))}))}))}))}var P=n(9689);function D(e){return[{systemId:"edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",privateData:(0,T.zo)([8,1,18,16],e)}]}function N(e,t){if(void 0===t&&(t=D),null===e.firstElementChild||"ProtectionHeader"!==e.firstElementChild.nodeName)throw new Error("Protection should have ProtectionHeader child");var n=e.firstElementChild,r=(0,P.K)(null===n.textContent?"":n.textContent),i=function(e){var t=(0,T.qb)(e,8),n=(0,A.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,A.wO)((0,P.K)(i));return(0,A.ci)(a).toLowerCase()}(r),a=(0,A.nr)(i),o=n.getAttribute("SystemID");return{keyId:a,keySystems:[{systemId:(null!==o?o:"").toLowerCase().replace(/\{|\}/g,""),privateData:r}].concat(t(a))}}function O(e,t,n){for(var r=e.firstElementChild,i=n;null!==r;)i=t(i,r.nodeName,r),r=r.nextElementSibling;return i}var L={audio:"audio/mp4",video:"video/mp4",text:"application/ttml+xml"},U={AACL:"audio/mp4",AVC1:"video/mp4",H264:"video/mp4",TTML:"application/ttml+xml+mp4",DFXP:"application/ttml+xml+mp4"};var B=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=O(e,(function(e,t,n){return"CustomAttributes"===t&&e.push.apply(e,O(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"),d=r("PacketSize"),c=r("SamplingRate"),f=r("Bitrate"),v=void 0===f||isNaN(parseInt(f,10))?0:parseInt(f,10);if(void 0!==l&&void 0===U[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,E.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?U[l]:l,packetSize:void 0!==d?parseInt(d,10):d,samplingRate:void 0!==c?parseInt(c,10):c};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===U[m]||void 0===h)return s.Z.warn("Smooth parser: Unsupported video codec. Ignoring quality level."),null;var S=function(e){var t=/00000001\d7([0-9a-fA-F]{6})/.exec(e);return null!==t&&(0,E.Z)(t[1])?"avc1."+t[1]:"avc1.4D401E"}(h);return{bitrate:b,customAttributes:n,mimeType:void 0!==m?U[m]:m,codecPrivateData:h,codecs:S,width:void 0!==g?parseInt(g,10):void 0,height:void 0!==y?parseInt(y,10):void 0};case"text":var T=r("CodecPrivateData"),k=r("FourCC"),w=r("Bitrate");return{bitrate:void 0===w||isNaN(parseInt(w,10))?0:parseInt(w,10),customAttributes:n,mimeType:void 0!==k?U[k]:k,codecPrivateData:null!=T?T:""};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,d=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,S.Z)(b.r,h)||s.Z.warn("Smooth Parser: Unrecognized adaptation type:",h);var m=h,g=r.getAttribute("Subtype"),y=r.getAttribute("Language"),w=r.getAttribute("Url"),I=null===w?"":w;var Z,x=O(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:[]}),M=x.qualityLevels,C=x.cNodes,P={timeline:(Z=C,Z.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 d=Z[n+1];if(void 0===d)return e;var c=d.getAttribute("t"),f=(0,E.Z)(c)?+c: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,c.Z)(0!==M.length,"Adaptation should have at least one playable representation.");var D=m+((0,E.Z)(y)?"_"+y:""),N=M.map((function(t){var n,r,i,a,s={timeline:P.timeline,timescale:P.timescale,media:(n=I,r=t.bitrate,i=t.customAttributes,n.replace(/\{bitrate\}/g,String(r)).replace(/{CustomAttributes}/g,i.length>0?i[0]:""))},c=(0,E.Z)(t.mimeType)?t.mimeType:L[m],v=t.codecs,p=D+"_"+(null!=m?m+"-":"")+(null!=c?c+"-":"")+(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,b=new _(s,{aggressiveMode:y,isLive:f,manifestReceivedTime:d,segmentPrivateInfos:g,timeShiftBufferDepth:l}),S=(0,k.Z)({},t,{index:b,cdnMetadata:[{baseUrl:o}],mimeType:c,codecs:v,id:p});if(h.length>0||void 0!==a){var w=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 R("pssh",(0,T.zo)([n,0,0,0],(0,A.nr)(e),(0,T.kh)(t.length),t))}(r,n);return{systemId:r,data:i}}));if(w.length>0){var Z=[{type:"cenc",values:w}];S.contentProtections={keyIds:h,initData:Z}}else S.contentProtections={keyIds:h,initData:[]}}return S}));if("ADVT"===g)return null;var U={id:D,type:m,representations:N,language:null==y?void 0:y};return"text"===m&&"DESC"===g&&(U.closedCaption=!0),U}return function(n,r,a){var s="";if(void 0!==r){var u=(0,w.$)(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 d=l.getAttribute("MajorVersion"),c=l.getAttribute("MinorVersion");if(null===d||null===c||!/^[2]-[0-2]$/.test(d+"-"+c))throw new Error("Version should be 2.0, 2.1 or 2.2");var f,v,p=l.getAttribute("Timescale"),h=(0,E.Z)(p)?isNaN(+p)?1e7:+p:1e7,m=O(l,(function(t,n,r){switch(n){case"Protection":t.protections.push(N(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 S,T,k,A,I,Z,x,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,P=void 0!==R.video?R.video[0]:void 0,D=void 0!==R.audio?R.audio[0]:void 0;if(void 0!==P||void 0!==D){var L=[],U=[];if(void 0!==P){var B=P.representations[0];if(void 0!==B){var F=B.index.getFirstAvailablePosition(),V=B.index.getLastAvailablePosition();null!=F&&L.push(F),null!=V&&U.push(V)}}if(void 0!==D){var z=D.representations[0];if(void 0!==z){var K=z.index.getFirstAvailablePosition(),G=z.index.getLastAvailablePosition();null!=K&&L.push(K),null!=G&&U.push(G)}}L.length>0&&(I=Math.max.apply(Math,L)),U.length>0&&(Z=Math.min.apply(Math,U),x=Math.max.apply(Math,U))}var W=l.getAttribute("Duration"),H=null!==W&&0!=+W?+W/h:void 0;if(_){S=e.suggestedPresentationDelay,T=t,k=null!=I?I:T;var j=x;void 0===j&&(j=Date.now()/1e3-T);var q=Z;void 0===q&&(q=j),A={isLinear:!0,maximumSafePosition:q,livePosition:j,time:performance.now()},M=null!=v?v:null}else{k=null!=I?I:0,A={isLinear:!1,maximumSafePosition:void 0!==Z?Z:void 0!==H?k+H:1/0,livePosition:void 0,time:performance.now()}}var Y=_?0:k,X=_?void 0:A.maximumSafePosition,Q={availabilityStartTime:void 0===T?0:T,clockOffset:i,isLive:_,isDynamic:_,isLastPeriodKnown:!0,timeBounds:{minimumSafePosition:k,timeshiftDepth:M,maximumTimeData:A},periods:[{adaptations:R,duration:void 0!==X?X-Y:H,end:X,id:"gen-smooth-period-0",start:Y}],suggestedPresentationDelay:S,transportType:"smooth",uris:null==r?[]:[r]};return C(Q),Q}},F=B,V=n(4597),z=n(8806),K=n(4460),G=n(8791),W=n(4644),H=n(2297);function j(e,t,n,r,i){var a,o,u,d=[];if(i){var c=(0,l.XA)(e);null!==c?(u=function(e){var t=(0,H.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,T.pV)(t,16*a+5),o=(0,T.pV)(t,16*a+5+8)):(s=(0,T.pX)(t,8*a+5),o=(0,T.pX)(t,8*a+5+4)),n.push({time:s,duration:o})}return n}(c),o=function(e){var t=(0,H.nR)(e,1830656773,1121273062,2162299933,2952222642);if(void 0!==t)return{duration:(0,T.pV)(t,12),time:(0,T.pV)(t,4)}}(c)):s.Z.warn("smooth: could not find traf atom")}if(void 0!==u)for(var f=0;f<u.length;f++)d.push({time:u[f].time,duration:u[f].duration,timescale:n});if(void 0!==o)return{nextSegments:d,chunkInfos:{time:o.time/n,duration:o.duration/n},scaledSegmentTime:o.time};if(t||!r.complete)return{nextSegments:d,chunkInfos:null,scaledSegmentTime:void 0};var v=r.duration*n,p=Math.min(.9*n,v/4),h=(0,W.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:d,chunkInfos:void 0!==h&&Math.abs(h-v)<=p?{time:r.time,duration:h/n}:{time:r.time,duration:r.duration},scaledSegmentTime:m}}var q=n(3666);function Y(e,t){return R("schm",(0,T.zo)(4,(0,A.tG)(e),(0,T.kh)(t)))}function X(e){return R("frma",(0,A.tG)(e))}function Q(e){var t=[7,[e.length]];return R("stsd",T.zo.apply(void 0,t.concat(e)))}function $(e,t,n){return R("tenc",(0,T.zo)(6,[e,t],n))}function J(e,t,n,r,i){var a=[e,t,n];return void 0!==i&&a.push(R("senc",i),function(e){if(0===e.length)return R("saiz",new Uint8Array(0));var t=(0,T.pX)(e,0),n=(0,T.pX)(e,4),r=new Uint8Array(n+9);r.set((0,T.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,T.zK)(e,s))+2):(i=0,a=0),r[o]=6*i+8+a,o++;return R("saiz",r)}(i),function(e,t,n,r){return R("saio",(0,T.zo)(4,[0,0,0,1],(0,T.kh)(e.length+t.length+n.length+r.length+8+8+8+8)))}(r,e,t,n)),M("traf",a)}function ee(e,t){var n=(0,H.Qy)(e,1836019558);if(null===n)throw new Error("Smooth: Invalid ISOBMFF given");var r=e.subarray(n[1],n[2]),i=(0,H.iz)(r,1835427940),a=(0,H.t_)(r,1953653094);if(null===a||null===i)throw new Error("Smooth: Invalid ISOBMFF given");var o=(0,H.Qy)(a,1952868452),s=(0,H.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 d=function(e){return R("tfdt",(0,T.zo)([1,0,0,0],(0,T.el)(e)))}(t),c=function(e,t){var n=(1&e[t+3])>0;if(n)return e;var r=new Uint8Array(e.length+4);return r.set(e.subarray(0,t+8),0),r[t+3]=1|r[t+3],r.set([0,0,0,0],t+8),r.set(e.subarray(t+8,e.length),t+12),(0,W.J6)(r)}(l,s[1]-s[0]),f=J(u,d,c,i,(0,H.nR)(a,2721664850,1520127764,2722393154,2086964724)),v=M("moof",[i,f]),p=(0,H.Qy)(v,1836019558),h=(0,H.Qy)(f,1953653094),m=(0,H.Qy)(c,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+d.length+(m[1]-m[0])+8,y=n[2]-n[0],_=v.length-y,b=(0,H.Qy)(e,1835295092);if(null===b)throw new Error("Smooth: Invalid ISOBMFF given");if(!q.YM&&(0===_||_<=-8)){var S=b[1];return v.set((0,T.kh)(S),g),e.set(v,n[0]),_<=-8&&e.set(R("free",new Uint8Array(-_-8)),v.length),e}var E=b[1]+_;v.set((0,T.kh)(E),g);var k=new Uint8Array(e.length+_),w=e.subarray(0,n[0]),A=e.subarray(n[2],e.length);return k.set(w,0),k.set(v,w.length),k.set(A,w.length+v.length),k}var te=n(7839),ne=n(281);function re(e,t,n,r,i,a){var o,s,u,l=M("stbl",[n,R("stts",new Uint8Array(8)),R("stsc",new Uint8Array(8)),R("stsz",new Uint8Array(12)),R("stco",new Uint8Array(8))]),d=function(e){return R("dref",(0,T.zo)(7,[1],e))}(R("url ",new Uint8Array([0,0,0,1]))),c=M("dinf",[d]),f=M("minf",[r,c,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 R("hdlr",(0,T.zo)(8,(0,A.tG)(t),12,(0,A.tG)(n),1))}(t),p=function(e){return R("mdhd",(0,T.zo)(12,(0,T.kh)(e),8))}(e),h=M("mdia",[p,v,f]),m=function(e,t,n){return R("tkhd",(0,T.zo)((0,T.kh)(7),8,(0,T.kh)(n),20,[1,0,0,0],[0,1,0,0],12,[0,1,0,0],12,[64,0,0,0],(0,T.XT)(e),2,(0,T.XT)(t),2))}(i,a,1),g=M("trak",[m,h]),y=M("mvex",[(o=1,R("trex",(0,T.zo)(4,(0,T.kh)(o),[0,0,0,1],12)))]),_=function(e,t){return R("mvhd",(0,T.zo)(12,(0,T.kh)(e),4,[0,1],2,[1,0],10,[0,1],14,[0,1],14,[64,0,0,0],26,(0,T.XT)(t+1)))}(e,1),b=function(e,t,n){return M("moov",[e,t,n])}(_,y,g),S=(s="isom",u=["isom","iso2","iso6","avc1","dash"],R("ftyp",T.zo.apply(void 0,[(0,A.tG)(s),[0,0,0,1]].concat(u.map(A.tG)))));return(0,T.zo)(S,b)}function ie(e,t,n,r,i,a,o,s){var u=o.split("00000001"),l=u[1],d=u[2];if(void 0===l||void 0===d)throw new Error("Smooth: unsupported codec private data.");var c,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 R("avcC",(0,T.zo)([1,i,a,o,252|r,225],(0,T.XT)(e.length),e,[1],(0,T.XT)(t.length),t))}((0,A.nr)(l),(0,A.nr)(d),a);if(void 0===s){var p=function(e,t,n,r,i,a,o){return R("avc1",(0,T.zo)(6,(0,T.XT)(1),16,(0,T.XT)(e),(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),6,[0,1,i.length],(0,A.tG)(i),31-i.length,(0,T.XT)(a),[255,255],o))}(t,n,r,i,"AVC Coding",24,v);c=Q([p])}else{var h=M("schi",[$(1,8,s)]),m=Y("cenc",65536),g=function(e,t,n,r,i,a,o,s){return R("encv",(0,T.zo)(6,(0,T.XT)(1),16,(0,T.XT)(e),(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),6,[0,1,i.length],(0,A.tG)(i),31-i.length,(0,T.XT)(a),[255,255],o,s))}(t,n,r,i,"AVC Coding",24,v,M("sinf",[X("avc1"),m,h]));c=Q([g])}return re(e,"video",c,((f=new Uint8Array(12))[3]=1,R("vmhd",f)),t,n)}var ae=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function oe(e,t,n,r,i,a,o){var s,u,l,d=function(e,t){return R("esds",(0,T.zo)(4,[3,25],(0,T.XT)(e),[0,4,17,64,21],11,[5,2],(0,A.nr)(t),[6,1,2]))}(1,0===a.length?(s=i,u=t,l=((l=((l=(63&2)<<4)|31&ae.indexOf(s))<<4)|31&u)<<3,(0,A.ci)((0,T.XT)(l))):a),c=function(){if(void 0===o){var e=function(e,t,n,r,i,a){return R("mp4a",(0,T.zo)(6,(0,T.XT)(e),8,(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),(0,T.XT)(i),2,a))}(1,t,n,r,i,d);return Q([e])}var a=M("schi",[$(1,8,o)]),s=Y("cenc",65536),u=M("sinf",[X("mp4a"),s,a]),l=function(e,t,n,r,i,a,o){return R("enca",(0,T.zo)(6,(0,T.XT)(e),8,(0,T.XT)(t),(0,T.XT)(n),2,(0,T.XT)(r),(0,T.XT)(i),2,a,o))}(1,t,n,r,i,d,u);return Q([l])}();return re(e,"audio",c,R("smhd",new Uint8Array(8)),0,0)}var se=/(\.isml?)(\?token=\S+)?$/,ue=/\?token=(\S+)/;function le(e,t){return(0,E.Z)(t)?e.replace(ue,"?token="+t):e.replace(ue,"")}function de(e){return"string"==typeof e.mimeType&&e.mimeType.indexOf("mp4")>=0}function ce(e,t){return null===e?null:null===t.url?e.baseUrl:(0,w.Z)(e.baseUrl,t.url)}function fe(e,t,n,r,i,a){var o,s=t.segment.range;return Array.isArray(s)&&(o={Range:(0,ne.Z)(s)}),(0,V.ZP)({url:e,responseType:"arraybuffer",headers:o,timeout:r.timeout,cancelSignal:i,onProgress:n.onProgress}).then((function(e){if(!de(t.representation)||!0!==a)return{resultType:"segment-loaded",resultData:e};var n=new Uint8Array(e.responseData);return(0,K.Z)(n,t.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},e),{responseData:n})}}))}var ve=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,d=r.adaptation,c=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(d.type){case"video":var y=c.width,_=void 0===y?0:y,b=c.height;f=ie(h,_,void 0===b?0:b,72,72,4,p,g.keyId);break;case"audio":var S=v.channels,T=void 0===S?0:S,E=v.bitsPerSample,k=void 0===E?0:E,w=v.packetSize,A=void 0===w?0:w,I=v.samplingRate;f=oe(h,T,k,A,void 0===I?0:I,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 Z={adaptation:d,manifest:u,period:l,representation:c,segment:s,transport:"smooth",timeout:i.timeout,url:e};return"function"!=typeof n?fe(e,r,o,i,a,t):new Promise((function(s,u){var l=!1,d=n(Z,{reject:function(e){var t,n,r;if(!l&&!a.isCancelled()){l=!0,a.deregister(c);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 te.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(c),de(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,K.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(c),fe(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 c(e){l||((l=!0)||"function"!=typeof d||d(),u(e))}a.register(c)}))}},pe=/\.wsx?(\?token=\S+)?/;function he(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 _&&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 me=function(e){var t=F(e),n=ve(e),i={customManifestLoader:e.manifestLoader},d={loadSegment:function(e,t,r,i,a){var o=ce(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 d=u instanceof Uint8Array?u:new Uint8Array(u);if(a.isInit){var c=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:c,protectionDataUpdate:!1}}var f=void 0!==n?j(d,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=ee(d,f.scaledSegmentTime);return v.length>0&&he(o,v,a),{segmentType:"media",chunkData:h,chunkInfos:p,chunkOffset:0,chunkSize:h.length,protectionDataUpdate:!1,appendWindow:[void 0,void 0]}}},c={loadSegment:function(t,n,r,i,a){var o=n.segment,s=n.representation,u=ce(t,o);return o.isInit||null===u?Promise.resolve({resultType:"segment-created",resultData:null}):de(s)?(0,V.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,K.Z)(r,n.segment.isInit),{resultType:"segment-loaded",resultData:Object.assign(Object.assign({},t),{responseData:r})}})):(0,V.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,d=t.representation,c=t.segment,f=u.language,v=de(d),p=d.mimeType,h=void 0===p?"":p,m=d.codec,g=void 0===m?"":m,y=e.data,_=e.isChunked;if(c.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,S,T,E,k=null;if(v){var w;i=(w="string"==typeof y?(0,A.tG)(y):y instanceof Uint8Array?y:new Uint8Array(y)).length;var I=void 0!==n?j(w,_,n,c,o.isLive):null;a=null==I?void 0:I.nextSegments,null===(k=null!==(r=null==I?void 0:I.chunkInfos)&&void 0!==r?r:null)?_?s.Z.warn("Smooth: Unavailable time data for current text track."):(b=c.time,S=c.end):(b=k.time,S=void 0!==k.duration?k.time+k.duration:c.end);var Z=g.toLowerCase();if("application/ttml+xml+mp4"===h||"stpp"===Z||"stpp.ttml.im1t"===Z)E="ttml";else{if("wvtt"!==Z)throw new Error("could not find a text-track parser for the type "+h);E="vtt"}var x=(0,l.Le)(w);T=null===x?"":(0,A.uR)(x)}else{var R;if(b=c.time,S=c.end,"string"!=typeof y){var M=y instanceof Uint8Array?y:new Uint8Array(y);i=M.length,R=(0,A.uR)(M)}else R=y;switch(h){case"application/x-sami":case"application/smil":E="sami";break;case"application/ttml+xml":E="ttml";break;case"text/vtt":E="vtt"}if(void 0===E){if("srt"!==g.toLowerCase())throw new Error("could not find a text-track parser for the type "+h);E="srt"}T=R}return null!==k&&Array.isArray(a)&&a.length>0&&he(u,a,c),{segmentType:"media",chunkData:{type:E,data:T,start:b,end:S,language:f},chunkSize:i,chunkInfos:k,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;pe.test(e)?((0,z.Z)("Giving WSX URL to loadVideo is deprecated. You should only give Manifest URLs."),n=(0,V.ZP)({url:le(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=ue.exec(e);if(null!==t){var n=t[1];if(void 0!==n)return n}return""}(e);return n.then((function(e){return le(function(e){return se.test(e)?((0,z.Z)("Giving a isml URL to loadVideo is deprecated. Please give the Manifest URL directly"),e.replace(se,"$1/manifest$2")):e}(e),r)}))},loadManifest:(0,G.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,d=t(l,a,o);return{manifest:new u.ZP(d,{representationFilter:e.representationFilter,supplementaryImageTracks:e.supplementaryImageTracks,supplementaryTextTracks:e.supplementaryTextTracks}),url:a}}},audio:d,video:d,text:c,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=ce(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,V.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,d=e(n,{reject:function(e){var t,n,r;if(!l&&!i.isCancelled()){l=!0,i.deregister(c);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.",d=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(d)}},resolve:function(e){if(!l&&!i.isCancelled()){l=!0,i.deregister(c);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(c),t(n,r,i).then(o,s))}},{timeout:r.timeout});function c(e){l||(l=!0,"function"==typeof d&&d(),s(e))}i.register(c)}))}}(n,o)}},4791:function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)return!1;if(e===t)return!0;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),d=0,c=0;d<u;d+=4,c+=3)a=o(n.charCodeAt(d))<<18|o(n.charCodeAt(d+1))<<12|o(n.charCodeAt(d+2))<<6|o(n.charCodeAt(d+3)),l[c]=a>>16,l[c+1]=a>>8&255,l[c+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 d(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 c(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])}n.d(t,{O_:function(){return v},QI:function(){return a},XT:function(){return u},dN:function(){return f},el:function(){return d},kh:function(){return l},pV:function(){return s},pX:function(){return o},qb:function(){return c},zK:function(){return i},zo:function(){return r}})},7864:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(7733);function i(e,t){return(0,r.Z)(t,(function(t){var n=setTimeout((function(){return t()}),e);return function(){return clearTimeout(n)}}))}},7733:function(e,t,n){"use strict";function r(e,t){var n;return new Promise((function(r,i){if(null!==e.cancellationError)return i(e.cancellationError);var a=!1;function o(e){void 0!==n&&n(),i(e)}n=t((function(t){e.deregister(o),a=!0,r(t)}),(function(t){e.deregister(o),a=!0,i(t)})),a||e.register(o)}))}n.d(t,{Z:function(){return r}})},1959:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3887),i=n(1946),a=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,i.Z)(e))this._listeners={};else{var n=this._listeners[e];if(Array.isArray(n))if((0,i.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){r.Z.error("EventEmitter: listener error",e instanceof Error?e:null)}}))},e}()},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 i}});var r=.3;function i(e){return e*((2*Math.random()-1)*r+1)}},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 d},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 d=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 s},DD:function(){return m},F_:function(){return p},JN:function(){return c},L7:function(){return g},Ti:function(){return u},XS:function(){return v},at:function(){return h},kR:function(){return y},rx:function(){return f},tn:function(){return b},uH:function(){return S}});var r=1/60;function i(e,t){return Math.abs(e-t)<r}function a(e,t){return{start:Math.min(e.start,t.start),end:Math.max(e.end,t.end)}}function o(e,t){return e.end<=t.start}function s(e,t){for(var n=0;n<e.length;n++)if(u(e[n],t))return!0;return!1}function u(e,t){var n=e.start,r=e.end;return n<=t&&t<r}function l(e,t){return u(e,t.start)||e.start<t.end&&t.end<e.end||u(t,e.start)}function d(e,t){return i(t.start,e.end)||i(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 f(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 v(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 p(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 h(e,t){var n=f(e,t);return null!==n?n.end-n.start:0}function m(e,t){var n=f(e,t);return null!==n?t-n.start:0}function g(e,t){var n=f(e,t);return null!==n?n.end-t:1/0}function y(e,t){if(t.start===t.end)return e;for(var n=t,r=0;r<e.length;r++){var i=e[r],s=l(n,i),u=d(n,i);if(s||u)n=a(n,i),e.splice(r--,1);else if(0===r){if(o(n,e[0]))break}else if(o(e[r-1],n)&&o(n,i))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(d(n,r)){var i=a(n,r);e.splice(--t,2,i)}}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 _(e,t){for(var n=[],r=0;r<t.length;r++)l(e,t[r])&&n.push(t[r]);return n}function b(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=_(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 S(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=[],o=_(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,d=0;d<a.length;d++)a[d].start>l&&n.push({start:l,end:a[d].start}),l=a[d].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 u}});var r=n(5138),i=n(8894);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}var s=function(){function e(e,t){var n=this;this._value=e,this._listeners=[],this._isFinished=!1,this._onFinishCbs=[],void 0!==t&&(this._deregisterCancellation=t.register((function(){return n.finish()})))}var t=e.prototype;return t.getValue=function(){return this._value},t.setValue=function(e){if(!this._isFinished&&(this._value=e,0!==this._listeners.length))for(var t,n=a(this._listeners.slice());!(t=n()).done;){var r=t.value;try{r.hasBeenCleared||r.trigger(e,r.complete)}catch(e){}}},t.setValueIfChanged=function(e){e!==this._value&&this.setValue(e)},t.onUpdate=function(e,t){var n=this,r=function e(){if(void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.deregister(e),!i.hasBeenCleared){i.hasBeenCleared=!0;var r=n._listeners.indexOf(i);r>=0&&n._listeners.splice(r,1)}},i={trigger:e,complete:r,hasBeenCleared:!1};this._listeners.push(i),!0===(null==t?void 0:t.emitCurrentValue)&&e(this._value,r),this._isFinished||i.hasBeenCleared?r():void 0!==(null==t?void 0:t.clearSignal)&&t.clearSignal.register(r)},t.waitUntilDefined=function(e,t){var n=this;this.onUpdate((function(t,r){void 0!==t&&(r(),e(n._value))}),{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:!0})},t._onFinished=function(e,t){var n=this;if(t.isCancelled())return i.Z;var a=function(){var e=(0,r.Z)(n._onFinishCbs,(function(e){return e.trigger===o}));e>=0&&(n._onFinishCbs[e].hasBeenCleared=!0,n._onFinishCbs.splice(e,1))},o=function(){a(),e()},s=t.register(a);return this._onFinishCbs.push({trigger:o,hasBeenCleared:!1}),s},t.finish=function(){void 0!==this._deregisterCancellation&&this._deregisterCancellation(),this._isFinished=!0;for(var e,t=a(this._listeners.slice());!(e=t()).done;){var n=e.value;try{n.hasBeenCleared||(n.complete(),n.hasBeenCleared=!0)}catch(e){}}if(this._listeners.length=0,this._onFinishCbs.length>0){for(var r,i=a(this._onFinishCbs.slice());!(r=i()).done;){var o=r.value;try{o.hasBeenCleared||(o.trigger(),o.hasBeenCleared=!0)}catch(e){}}this._onFinishCbs.length=0}},e}();function u(e,t,n){var r=new s(t(e.getValue()),n);return e.onUpdate((function(e){r.setValue(t(e))}),{clearSignal:n}),e._onFinished((function(){r.finish()}),n),r}t.Z=s},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,d=t.url,c=t.headers,f=t.responseType,v=t.timeout,p=new XMLHttpRequest;if(p.open("GET",d,!0),void 0!==v&&(p.timeout=v,s=window.setTimeout((function(){_(),o(new r.Z(d,p.status,"TIMEOUT",p))}),v+3e3)),p.responseType=f,"document"===p.responseType&&p.overrideMimeType("text/xml"),!(0,a.Z)(c)){var h=c;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(d,p.status,"ERROR_EVENT",p))},p.ontimeout=function(){_(),o(new r.Z(d,p.status,"TIMEOUT",p))},void 0!==u&&(p.onprogress=function(e){var t=performance.now();u({url:d,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,c=p.responseType,f=(0,i.Z)(p.responseURL)?p.responseURL:d;if(t="json"===c?"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(d,p.status,"PARSE_ERROR",p));n({status:l,url:f,responseType:c,sendingTime:g,receivedTime:s,requestDuration:s-g,size:u,responseData:t})}else o(new r.Z(d,p.status,"ERROR_HTTP_CODE",p))},p.send())}))}},9829:function(e,t,n){"use strict";n.d(t,{$:function(){return o},Z:function(){return a}});var r=/^(?:[a-z]+:)?\/\//i,i=/\/\.{1,2}\//;function a(){var e=arguments.length;if(0===e)return"";for(var t="",n=0;n<e;n++){var a=n<0||arguments.length<=n?void 0:arguments[n];"string"==typeof a&&""!==a&&(r.test(a)?t=a:("/"===a[0]&&(a=a.substring(1)),"/"===t[t.length-1]&&(t=t.substring(0,t.length-1)),t=t+"/"+a))}return function(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("/")}(t)}function o(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?o(e.substring(0,i)):t+1}},5440:function(e,t,n){"use strict";function r(e){return new Promise((function(t){setTimeout(t,e)}))}n.d(t,{Z:function(){return r}})},3146:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(3274),i=n(7714),a=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.toArray=function(){return this._array.slice()},t.findFirst=function(e){return(0,r.Z)(this._array,e)},t.has=function(e){return(0,i.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}()},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 c},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 d=parseInt(i.substring(u+1,u+6),16);n+=String.fromCharCode(d),l=!0,u+=5}else if(u<=s-3&&a.test(i[u+1])&&a.test(i[u+2])){var c=parseInt(i.substring(u+1,u+3),16);n+=String.fromCharCode(c),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 d(e,t){var n=e.toString(16);return n.length>=t?n:new Array(t-n.length+1).join("0")+n}function c(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"+d(l,4):"%"+d(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],d=new Uint8Array(16);return d[0]=a,d[1]=r,d[2]=n,d[3]=t,d[4]=s,d[5]=o,d[6]=l,d[7]=u,d.set(e.subarray(8,16),8),d}function h(e,t){for(var n=t;n<e.length;){if(0===e[n])break;n+=1}return{end:n+1,string:c(e.subarray(t,n))}}},288:function(e,t,n){"use strict";n.d(t,{FU:function(){return c},XG:function(){return d},ZP:function(){return l}});var r=n(7326),i=n(4578),a=n(2146),o=n(3887),s=n(811),u=n(8894),l=function(){function e(){var e,t=(e=u.Z,[function(t){e(t)},function(t){e=t}]),n=t[0],r=t[1];this._isUsed=!1,this._trigger=n,this.signal=new d(r)}var t=e.prototype;return t.isUsed=function(){return this._isUsed},t.linkToSignal=function(e){var t=this,n=e.register((function(){t.cancel()}));return this.signal.register(n),n},t.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}(),d=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;)try{var n=t._listeners.pop();null==n||n(e)}catch(e){o.Z.error("Error while calling clean up listener",e instanceof Error?e.toString():"Unknown error")}}))}var t=e.prototype;return t.isCancelled=function(){return this._isCancelled},t.register=function(e){var t=this;return this._isCancelled?((0,s.Z)(null!==this.cancellationError),e(this.cancellationError),u.Z):(this._listeners.push(e),function(){return t.deregister(e)})},t.deregister=function(e){for(var t=this._listeners.length-1;t>=0;t--)this._listeners[t]===e&&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}()},7061:function(e,t,n){var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new P(r||[]);return s(a,"_invoke",{value:x(e,n,o)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=v;var h="suspendedStart",m="suspendedYield",g="executing",y="completed",_={};function b(){}function S(){}function T(){}var E={};f(E,l,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(D([])));w&&w!==a&&o.call(w,l)&&(E=w);var A=T.prototype=b.prototype=Object.create(E);function I(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function Z(e,t){function n(i,a,s,u){var l=p(e[i],e,a);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==r(c)&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(c).then((function(e){d.value=e,s(d)}),(function(e){return n("throw",e,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value: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 x(e,n,r){var i=h;return function(a,o){if(i===g)throw new Error("Generator is already running");if(i===y){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=R(s,r);if(u){if(u===_)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=g;var l=p(e,n,r);if("normal"===l.type){if(i=r.done?y:m,l.arg===_)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=y,r.method="throw",r.arg=l.arg)}}}function R(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var a=p(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,_;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function M(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return S.prototype=T,s(A,"constructor",{value:T,configurable:!0}),s(T,"constructor",{value:S,configurable:!0}),S.displayName=f(T,c,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,f(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},n.awrap=function(e){return{__await:e}},I(Z.prototype),f(Z.prototype,d,(function(){return this})),n.AsyncIterator=Z,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new Z(v(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},I(A),f(A,c,"Generator"),f(A,l,(function(){return this})),f(A,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},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 n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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&&o.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 a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,_):this.complete(a)},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),_},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),C(n),_}},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;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},n}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}})},1656:function(e,t,n){"use strict";function r(e){return r="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},r(e)}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}function a(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,i(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n.d(t,{Z:function(){return o}})},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 o}});var i=n(9611);function a(e,t,n){return a=function(){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}}()?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},a.apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return o=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,o)}function o(){return a(e,arguments,r(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(o,e)},o(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 be}});var e=n(1656),t=n(4578),i=n(3038);function a(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 o(){if(s()){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 s(){var e=document;return null!=e.fullscreenElement||null!=e.mozFullScreenElement||null!=e.webkitFullscreenElement||null!=e.msFullscreenElement}var u=n(3666),l=n(3887);function d(){if(!u.vU)return!0;var e=function(){if(!u.vU)return l.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 c=n(6872),f=n(8750),v=n(3714),p=n(5992),h=n(1946),m=n(7273);var g=n(7874),y=n(4791),_=n(7714),b=n(811),S=n(1959),T=n(908),E=n(8026),k=n(2829),w=n(5095),A=n(288),I=n(8806),Z=n(5861),x=n(4687),R=n.n(x),M=n(5440),C=n(770);function P(e){return D.apply(this,arguments)}function D(){return(D=(0,Z.Z)(R().mark((function e(t){var n,r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=C.Z.getState(t))){e.next=3;break}return e.abrupt("return",void 0);case 3:return l.Z.info("DRM: Disposing of the current MediaKeys"),r=n.loadedSessionsStore,C.Z.clearState(t),e.next=8,r.closeAllSessions();case 8:return e.abrupt("return",Promise.race([n.emeImplementation.setMediaKeys(t,null).catch((function(e){l.Z.error("DRM: Could not reset MediaKeys",e instanceof Error?e:"Unknown Error")})),(0,M.Z)(1e3)]));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var N=n(245);function O(e){if(l.Z.info("DRM: Clearing-up DRM session."),u.fq)return l.Z.info("DRM: disposing current MediaKeys."),P(e);var t=C.Z.getState(e);return null!==t&&!0===t.keySystemOptions.closeSessionsOnStop?(l.Z.info("DRM: closing all current sessions."),t.loadedSessionsStore.closeAllSessions()):(l.Z.info("DRM: Nothing to clear. Returning right away. No state =",null===t),Promise.resolve())}var L=n(5553);function U(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 B(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 B(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 B(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=n(8894),V=["canplay","ended","play","pause","seeking","seeked","loadedmetadata","ratechange"],z=function(){function e(e,t){this._internalSeeksIncoming=[],this._mediaElement=e,this._withMediaSource=t.withMediaSource,this._lowLatencyMode=t.lowLatencyMode,this._canceller=new A.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),l.Z.info("API: Seeking internally",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 F.Z;this._observationRef.onUpdate(e,{clearSignal:null==t?void 0:t.clearSignal,emitCurrentValue:null==t?void 0:t.includeLastObservation})},t.deriveReadOnlyObserver=function(e){return W(this,e,this._canceller.signal)},t._createSharedReference=function(){var e,t=this;if(void 0!==this._observationRef)return this._observationRef;var n=c.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=G(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=c.Z.getCurrent().REBUFFERING_GAP,u=t.event,l=t.position,d=t.bufferGap,f=t.currentRange,v=t.duration,p=t.paused,h=t.readyState,m=t.ended,g=e.rebuffering,y=e.event,_=e.position,b=function(e,t,n,r,i){var a=c.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,f,m,v,o),S=h>=1&&"loadedmetadata"!==u&&null===g&&!(b||m),T=null,E=o?s.LOW_LATENCY:s.DEFAULT;if(a){if(S)d===1/0?(r=!0,T=l):void 0===d?h<3&&(r=!0,T=void 0):d<=E&&(r=!0,T=l+d);else if(null!==g){var k=K(g,o);!0!==r&&null!==g&&h>1&&(b||m||void 0!==d&&isFinite(d)&&d>k)||void 0===d&&h>=3?i=!0:void 0===d?T=void 0:d===1/0?T=l:d<=k&&(T=l+d)}}else S&&(!p&&"timeupdate"===u&&"timeupdate"===y&&l===_||"seeking"===u&&(d===1/0||void 0===d&&h<3))?r=!0:null!==g&&("seeking"!==u&&l!==_||"canplay"===u||void 0===d&&h>=3||void 0!==d&&d<1/0&&(d>K(g,o)||b||m))&&(i=!0);if(!0===i)return null;var w;if(!0===r||null!==g)return w="seeking"===u||null!==g&&"seeking"===g.reason||t.seeking?"seeking":1===h?"not-ready":"buffering",null!==g&&g.reason===w?{reason:g.reason,timestamp:g.timestamp,position:T}:{reason:w,timestamp:performance.now(),position:T};return null}(a,o,{lowLatencyMode:t._lowLatencyMode,withMediaSource:t._withMediaSource}),d=function(e,t){var n=c.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),f=(0,E.Z)({},{rebuffering:u,freezing:d,pendingInternalSeek:s},o);return l.Z.hasLevel("DEBUG")&&l.Z.debug("API: current media element state tick","event",f.event,"position",f.position,"seeking",f.seeking,"internalSeek",f.pendingInternalSeek,"rebuffering",null!==f.rebuffering,"freezing",null!==f.freezing,"ended",f.ended,"paused",f.paused,"playbackRate",f.playbackRate,"readyState",f.readyState),f},s=new w.Z(o("init"),this._canceller.signal),u=function(t){var n=o(t);l.Z.hasLevel("DEBUG")&&l.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 d=n.length-Math.floor(l.length/2);r=" ".repeat(d)+"^"+t}if(i<e.length-1){var c=e.start(i+1),f=" ~"+(c-o).toFixed(2)+"~ ";if(n+=f,0===r.length&&t<c){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)},d=this._lowLatencyMode?i:this._withMediaSource?r:a,f=setInterval(p,d),v=V.map((function(e){function n(){clearInterval(f),f=setInterval(p,d),u(e)}return t._mediaElement.addEventListener(e,n),function(){t._mediaElement.removeEventListener(e,n)}}));return this._canceller.signal.register((function(){clearInterval(f),v.forEach((function(e){return e()})),s.finish()})),s;function p(){u("timeupdate")}},t._generateInitialObservation=function(){return(0,E.Z)(G(this._mediaElement,"init",this._withMediaSource),{rebuffering:null,freezing:null,pendingInternalSeek:null})},e}();function K(e,t){if(null===e)return 0;var n=t?"LOW_LATENCY":"DEFAULT",r=c.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 G(e,t,n){var r,i,a=e.buffered,o=e.currentTime,s=e.duration,u=e.ended,l=e.paused,d=e.playbackRate,c=e.readyState,f=e.seeking;return!n&&0===a.length&&c>=3?(r=void 0,i=void 0):i=null!==(r=(0,k.rx)(a,o))?r.end-o:1/0,{bufferGap:i,buffered:a,currentRange:r,position:o,duration:s,ended:u,paused:l,playbackRate:d,readyState:c,seeking:f,event:t}}function W(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 W(this,e,n)}}}var H=n(3274),j=n(7829),q=n(3146);function Y(e){return e.map((function(e){return null===e?e:{normalized:void 0===e.language?void 0:(0,j.ZP)(e.language),audioDescription:e.audioDescription,codec:e.codec}}))}function X(e){return e.map((function(e){return null===e?e:{normalized:(0,j.ZP)(e.language),forced:e.forced,closedCaption:e.closedCaption}}))}var Q=function(){function e(e){this._periods=new q.Z((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=ie(this._periods,t),i=t.getSupportedAdaptations(e);if(void 0!==r){if(void 0!==r[e])return void l.Z.warn("TrackChoiceManager: "+e+" already added for period",t.start);r[e]={adaptations:i,adaptationRef:n}}else{var a;this._periods.add(((a={period:t})[e]={adaptations:i,adaptationRef: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)):l.Z.warn("TrackChoiceManager: "+e+" already removed for period",t.start)}else l.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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.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.adaptationRef.setValue(null);else if(void 0!==i&&(0,_.Z)(r,i))n.adaptationRef.setValue(i);else{var a=J(r,Y(this._preferredAudioTracks));this._audioChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.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.adaptationRef.setValue(null);else if(void 0!==i&&(0,_.Z)(r,i))n.adaptationRef.setValue(i);else{var a=te(r,X(this._preferredTextTracks),this._audioChoiceMemory.get(e));this._textChoiceMemory.set(e,a),n.adaptationRef.setValue(a)}},t.setInitialVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.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,_.Z)(i,a.baseAdaptation))r=a.baseAdaptation;else{r=re(i,this._preferredVideoTracks)}if(null===r)return this._videoChoiceMemory.set(e,null),void n.adaptationRef.setValue(null);var o=ae(r,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:r,adaptation:o}),n.adaptationRef.setValue(o)},t.setAudioTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.audio:null;if((0,h.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,H.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.adaptationRef.setValue(i))},t.setTextTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.text:null;if((0,h.Z)(r))throw new Error("TrackChoiceManager: Given Period not found.");var i=(0,H.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.adaptationRef.setValue(i))},t.setVideoTrackByID=function(e,t){var n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.Z)(r))throw new Error("LanguageManager: Given Period not found.");var i=(0,H.Z)(r.adaptations,(function(e){return e.id===t}));if(void 0===i)throw new Error("Video Track not found.");var a=ae(i,this.trickModeTrackEnabled);this._videoChoiceMemory.set(e,{baseAdaptation:i,adaptation:a}),r.adaptationRef.setValue(a)},t.disableTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))throw new Error("TrackChoiceManager: Given Period not found.");null!==this._textChoiceMemory.get(e)&&(this._textChoiceMemory.set(e,null),n.adaptationRef.setValue(null))},t.disableVideoTrack=function(e){var t=ie(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.adaptationRef.setValue(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=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.Z)(n))return null;var r=this._audioChoiceMemory.get(e);return(0,h.Z)(r)?null:r.toAudioTrack()},t.getChosenTextTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))return null;var r=this._textChoiceMemory.get(e);return(0,h.Z)(r)?null:r.toTextTrack()},t.getChosenVideoTrack=function(e){var t=ie(this._periods,e),n=void 0!==t?t.video:null;if((0,h.Z)(n))return null;var r=this._videoChoiceMemory.get(e);return(0,h.Z)(r)?null:r.adaptation.toVideoTrack()},t.getAvailableAudioTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.audio:null;if((0,h.Z)(n))return[];var r=this._audioChoiceMemory.get(e),i=(0,h.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.Z)(e.toAudioTrack(),{active:t})}))},t.getAvailableTextTracks=function(e){var t=ie(this._periods,e),n=void 0!==t?t.text:null;if((0,h.Z)(n))return[];var r=this._textChoiceMemory.get(e),i=(0,h.Z)(r)?null:r.id;return n.adaptations.map((function(e){var t=null!==i&&i===e.id;return(0,E.Z)(e.toTextTrack(),{active:t})}))},t.getAvailableVideoTracks=function(e){var t,n=ie(this._periods,e),r=void 0!==n?n.video:null;if((0,h.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=null!==a&&a===e.id,n=e.toVideoTrack(),r=void 0!==n.trickModeTracks?n.trickModeTracks.map((function(e){var t=null!==a&&a===e.id;return(0,E.Z)(e,{active:t})})):[],i=(0,E.Z)(n,{active:t});return void 0!==r&&(i.trickModeTracks=r),i}))},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=Y(this._preferredAudioTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.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,_.Z)(s,u))n(r+1);else{var l=J(s,t);e._audioChoiceMemory.set(a,l),o.adaptationRef.setValue(l),n(0)}}}}(0)},t._resetChosenTextTracks=function(){var e=this,t=X(this._preferredTextTracks);!function n(r){if(!(r>=e._periods.length())){var i=e._periods.get(r);if((0,h.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,_.Z)(s,u))n(r+1);else{var l=te(s,t,e._audioChoiceMemory.get(a));e._textChoiceMemory.set(a,l),o.adaptationRef.setValue(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,h.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,_.Z)(s,u.baseAdaptation)){var l=ae(u.baseAdaptation,e.trickModeTrackEnabled);return l.id===u.adaptation.id?void n(r+1):(e._videoChoiceMemory.set(a,{baseAdaptation:u.baseAdaptation,adaptation:l}),o.adaptationRef.setValue(l),n(0))}var d=re(s,t);if(null===d)return e._videoChoiceMemory.set(a,null),o.adaptationRef.setValue(null),n(0);var c=ae(d,e.trickModeTrackEnabled);return e._videoChoiceMemory.set(a,{baseAdaptation:d,adaptation:c}),o.adaptationRef.setValue(c),n(0)}n(r+1)}}}(0)},e}();function $(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 J(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),a=(0,H.Z)(e,i);if(void 0!==a)return a}return e[0]}function ee(e){return function(t){var n;return(null!==(n=t.normalizedLanguage)&&void 0!==n?n:"")===e.normalized&&(e.closedCaption?!0===t.isClosedCaption:!0!==t.isClosedCaption)&&(!0===e.forced?!0===t.isForcedSubtitles:!0!==t.isForcedSubtitles)}}function te(e,t,n){var r;if(0===e.length)return null;for(var i=0;i<t.length;i++){var a=t[i];if(null===a)return null;var o=ee(a),s=(0,H.Z)(e,o);if(void 0!==s)return s}var u=e.filter((function(e){return!0===e.isForcedSubtitles}));if(u.length>0){if(null!=n){var l=(0,H.Z)(u,(function(e){return e.normalizedLanguage===n.normalizedLanguage}));if(void 0!==l)return l}return null!==(r=(0,H.Z)(u,(function(e){return void 0===e.normalizedLanguage})))&&void 0!==r?r:null}return null}function ne(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 re(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=ne(r),a=(0,H.Z)(e,i);if(void 0!==a)return a}return e[0]}function ie(e,t){for(var n=0;n<e.length();n++){var r=e.get(n);if(r.period.id===t.id)return r}}function ae(e,t){var n;return t&&void 0!==(null===(n=e.trickModeTracks)||void 0===n?void 0:n[0])?e.trickModeTracks[0]:e}function oe(e,t){var n=c.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"}function se(e){return"LOADING"!==e&&"RELOADING"!==e&&"STOPPED"!==e}function ue(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 le(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 le(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 le(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 de=(0,T.Z)(),ce=i.XR,fe=i.w0,ve=i.it,pe=i.O0,he=i.zU,me=i.kJ,ge=i.Q4,ye=function(n){function r(e){var t,r,i;void 0===e&&(e={}),t=n.call(this)||this;var a=function(e){var t,n,r,i,a,o,s,u,l,d,f,v,p,m,g,y,_=c.Z.getCurrent(),b=_.DEFAULT_INITIAL_BITRATES,S=_.DEFAULT_LIMIT_VIDEO_WIDTH,T=_.DEFAULT_MIN_BITRATES,E=_.DEFAULT_MAX_BITRATES,k=_.DEFAULT_MAX_BUFFER_AHEAD,w=_.DEFAULT_MAX_BUFFER_BEHIND,A=_.DEFAULT_MAX_VIDEO_BUFFER_SIZE,Z=_.DEFAULT_STOP_AT_END,x=_.DEFAULT_THROTTLE_WHEN_HIDDEN,R=_.DEFAULT_THROTTLE_VIDEO_BITRATE_WHEN_HIDDEN,M=_.DEFAULT_WANTED_BUFFER_AHEAD;if((0,h.Z)(e.maxBufferAhead))t=k;else if(t=Number(e.maxBufferAhead),isNaN(t))throw new Error("Invalid maxBufferAhead parameter. Should be a number.");if((0,h.Z)(e.maxBufferBehind))n=w;else if(n=Number(e.maxBufferBehind),isNaN(n))throw new Error("Invalid maxBufferBehind parameter. Should be a number.");if((0,h.Z)(e.wantedBufferAhead))r=M;else if(r=Number(e.wantedBufferAhead),isNaN(r))throw new Error("Invalid wantedBufferAhead parameter. Should be a number.");if((0,h.Z)(e.maxVideoBufferSize))i=A;else if(i=Number(e.maxVideoBufferSize),isNaN(i))throw new Error("Invalid maxVideoBufferSize parameter. Should be a number.");var C=(0,h.Z)(e.limitVideoWidth)?S:!!e.limitVideoWidth;if((0,h.Z)(e.throttleWhenHidden)?a=x:((0,I.Z)("`throttleWhenHidden` API is deprecated. Consider using `throttleVideoBitrateWhenHidden` instead."),a=!!e.throttleWhenHidden),o=!a&&((0,h.Z)(e.throttleVideoBitrateWhenHidden)?R:!!e.throttleVideoBitrateWhenHidden),void 0!==e.preferredTextTracks?Array.isArray(e.preferredTextTracks)?u=e.preferredTextTracks:((0,I.Z)("Invalid `preferredTextTracks` option, it should be an Array"),u=[]):u=[],void 0!==e.preferredAudioTracks?Array.isArray(e.preferredAudioTracks)?s=e.preferredAudioTracks:((0,I.Z)("Invalid `preferredAudioTracks` option, it should be an Array"),s=[]):s=[],void 0!==e.preferredVideoTracks?Array.isArray(e.preferredVideoTracks)?l=e.preferredVideoTracks:((0,I.Z)("Invalid `preferredVideoTracks` option, it should be an Array"),l=[]):l=[],(0,h.Z)(e.videoElement))d=document.createElement("video");else{if(!(e.videoElement instanceof HTMLMediaElement))throw new Error("Invalid videoElement parameter. Should be a HTMLMediaElement.");d=e.videoElement}if((0,h.Z)(e.initialVideoBitrate))f=b.video;else if(f=Number(e.initialVideoBitrate),isNaN(f))throw new Error("Invalid initialVideoBitrate parameter. Should be a number.");if((0,h.Z)(e.initialAudioBitrate))v=b.audio;else if(v=Number(e.initialAudioBitrate),isNaN(v))throw new Error("Invalid initialAudioBitrate parameter. Should be a number.");if((0,h.Z)(e.minVideoBitrate))m=T.video;else if(m=Number(e.minVideoBitrate),isNaN(m))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if((0,h.Z)(e.minAudioBitrate))p=T.audio;else if(p=Number(e.minAudioBitrate),isNaN(p))throw new Error("Invalid minAudioBitrate parameter. Should be a number.");if((0,h.Z)(e.maxVideoBitrate))y=E.video;else{if(y=Number(e.maxVideoBitrate),isNaN(y))throw new Error("Invalid maxVideoBitrate parameter. Should be a number.");if(m>y)throw new Error('Invalid maxVideoBitrate parameter. Its value, "'+y+'", is inferior to the set minVideoBitrate, "'+m+'"')}if((0,h.Z)(e.maxAudioBitrate))g=E.audio;else{if(g=Number(e.maxAudioBitrate),isNaN(g))throw new Error("Invalid maxAudioBitrate parameter. Should be a number.");if(p>g)throw new Error('Invalid maxAudioBitrate parameter. Its value, "'+g+'", is inferior to the set minAudioBitrate, "'+p+'"')}return{maxBufferAhead:t,maxBufferBehind:n,limitVideoWidth:C,videoElement:d,wantedBufferAhead:r,maxVideoBufferSize:i,throttleWhenHidden:a,throttleVideoBitrateWhenHidden:o,preferredAudioTracks:s,preferredTextTracks:u,preferredVideoTracks:l,initialAudioBitrate:v,initialVideoBitrate:f,minAudioBitrate:p,minVideoBitrate:m,maxAudioBitrate:g,maxVideoBitrate:y,stopAtEnd:(0,h.Z)(e.stopAtEnd)?Z:!!e.stopAtEnd}}(e),o=a.initialAudioBitrate,s=a.initialVideoBitrate,u=a.limitVideoWidth,d=a.minAudioBitrate,f=a.minVideoBitrate,v=a.maxAudioBitrate,p=a.maxBufferAhead,m=a.maxBufferBehind,g=a.maxVideoBitrate,y=a.preferredAudioTracks,_=a.preferredTextTracks,b=a.preferredVideoTracks,S=a.throttleWhenHidden,T=a.throttleVideoBitrateWhenHidden,E=a.videoElement,k=a.wantedBufferAhead,Z=a.maxVideoBufferSize,x=a.stopAtEnd,R=c.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;E.preload="auto",t.version="3.33.1",t.log=l.Z,t.state="STOPPED",t.videoElement=E;var M=new A.ZP;t._destroyCanceller=M,t._priv_pictureInPictureRef=fe(E,M.signal),he(E,(function(){t.trigger("fullscreenChange",t.isFullscreen())}),M.signal);for(var C=[],P=0;P<(null===(r=E.textTracks)||void 0===r?void 0:r.length);P++){var D=null===(i=E.textTracks)||void 0===i?void 0:i[P];(0,h.Z)(D)||C.push(D)}var N=function(e){for(var n=e.target,r=[],i=0;i<n.length;i++){var a=n[i];r.push(a)}var o=C;if(C=r,o.length===r.length){for(var s=0;s<o.length;s++)if(o[s]!==r[s])return void t._priv_onNativeTextTracksNext(r)}else t._priv_onNativeTextTracksNext(r)};return(0,h.Z)(E.textTracks)||(me(E.textTracks,N,M.signal),ge(E.textTracks,N,M.signal)),t._priv_speed=new w.Z(E.playbackRate,t._destroyCanceller.signal),t._priv_preferTrickModeTracks=!1,t._priv_contentLock=new w.Z(!1,t._destroyCanceller.signal),t._priv_bufferOptions={wantedBufferAhead:new w.Z(k,t._destroyCanceller.signal),maxBufferAhead:new w.Z(p,t._destroyCanceller.signal),maxBufferBehind:new w.Z(m,t._destroyCanceller.signal),maxVideoBufferSize:new w.Z(Z,t._destroyCanceller.signal)},t._priv_bitrateInfos={lastBitrates:{audio:o,video:s},minAutoBitrates:{audio:new w.Z(d,t._destroyCanceller.signal),video:new w.Z(f,t._destroyCanceller.signal)},maxAutoBitrates:{audio:new w.Z(v,t._destroyCanceller.signal),video:new w.Z(g,t._destroyCanceller.signal)},manualBitrates:{audio:new w.Z(-1,t._destroyCanceller.signal),video:new w.Z(-1,t._destroyCanceller.signal)}},t._priv_throttleWhenHidden=S,t._priv_throttleVideoBitrateWhenHidden=T,t._priv_limitVideoWidth=u,t._priv_mutedMemory=R,t._priv_currentError=null,t._priv_contentInfos=null,t._priv_contentEventsMemory={},t._priv_stopAtEnd=x,t._priv_setPlayerState("STOPPED"),t._priv_preferredAudioTracks=y,t._priv_preferredTextTracks=_,t._priv_preferredVideoTracks=b,t._priv_reloadingMetadata={},t._priv_lastAutoPlay=!1,t}(0,t.Z)(r,n),r.addFeatures=function(e){!function(e){for(var t=0;t<e.length;t++){var n=e[t];if("function"==typeof n)n(m.Z);else{if((0,h.Z)(n)||"function"!=typeof n._addFeature)throw new Error("Unrecognized feature");n._addFeature(m.Z)}}}(e)};var i=r.prototype;return i.addEventListener=function(e,t){return n.prototype.addEventListener.call(this,e,t)},i.stop=function(){null!==this._priv_contentInfos&&this._priv_contentInfos.currentContentCanceller.cancel(),this._priv_cleanUpCurrentContentState(),"STOPPED"!==this.state&&this._priv_setPlayerState("STOPPED")},i.dispose=function(){this.stop(),null!==this.videoElement&&P(this.videoElement).catch((function(e){var t=e instanceof Error?e.message:"Unknown error";l.Z.error("API: Could not dispose decryption resources: "+t)})),this._destroyCanceller.cancel(),this._priv_reloadingMetadata={},this.videoElement=null},i.loadVideo=function(e){var t=function(e){var t,n,r,i,a,o,s,u,d,f,v,p,m,g,y,b=c.Z.getCurrent(),S=b.DEFAULT_AUDIO_TRACK_SWITCHING_MODE,T=b.DEFAULT_AUTO_PLAY,k=b.DEFAULT_CODEC_SWITCHING_BEHAVIOR,w=b.DEFAULT_ENABLE_FAST_SWITCHING,A=b.DEFAULT_MANUAL_BITRATE_SWITCHING_MODE,Z=b.DEFAULT_SHOW_NATIVE_SUBTITLE,x=b.DEFAULT_TEXT_TRACK_MODE;if((0,h.Z)(e))throw new Error("No option set on loadVideo");if((0,h.Z)(e.url)){if((0,h.Z)(null===(t=e.transportOptions)||void 0===t?void 0:t.initialManifest)&&(0,h.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 f=String(e.url);if((0,h.Z)(e.transport))throw new Error("No transport set on loadVideo");v=String(e.transport),(0,h.Z)(null===(r=e.transportOptions)||void 0===r?void 0:r.aggressiveMode)||(0,I.Z)("`transportOptions.aggressiveMode` is deprecated and won't be present in the next major version. Please open an issue if you still need this.");var R=(0,h.Z)(e.autoPlay)?T:!!e.autoPlay;if((0,h.Z)(e.keySystems))p=[];else for(var M,C=U(p=Array.isArray(e.keySystems)?e.keySystems:[e.keySystems]);!(M=C()).done;){var P=M.value;if("string"!=typeof P.type||"function"!=typeof P.getLicense)throw new Error("Invalid key system given: Missing type string or getLicense callback");(0,h.Z)(P.onKeyStatusesChange)||(0,I.Z)("`keySystems[].onKeyStatusesChange` is deprecated and won't be present in the next major version. Please open an issue if you still need this."),(0,h.Z)(P.throwOnLicenseExpiration)||(0,I.Z)("`keySystems[].throwOnLicenseExpiration` is deprecated and won't be present in the next major version. Please open an issue if you still need this.")}var D=void 0!==e.lowLatencyMode&&!!e.lowLatencyMode,N="object"==typeof e.transportOptions&&null!==e.transportOptions?e.transportOptions:{},O=null===(i=e.transportOptions)||void 0===i?void 0:i.initialManifest,B=null!==(o=null===(a=e.transportOptions)||void 0===a?void 0:a.minimumManifestUpdateInterval)&&void 0!==o?o:0,F=(0,h.Z)(e.audioTrackSwitchingMode)?S:e.audioTrackSwitchingMode;(0,_.Z)(["seamless","direct","reload"],F)||(l.Z.warn("The `audioTrackSwitchingMode` loadVideo option must match one of the following strategy name:\n- `seamless`\n- `direct`\n- `reload`\nIf badly set, "+S+" strategy will be used as default"),F=S);var V=(0,h.Z)(e.onCodecSwitch)?k:e.onCodecSwitch;(0,_.Z)(["continue","reload"],V)||(l.Z.warn("The `onCodecSwitch` loadVideo option must match one of the following string:\n- `continue`\n- `reload`\nIf badly set, "+k+" will be used as default"),V=k);var z=(0,E.Z)({},N,{supplementaryImageTracks:[],supplementaryTextTracks:[],lowLatencyMode:D});if(delete z.initialManifest,delete z.minimumManifestUpdateInterval,void 0!==e.supplementaryTextTracks){(0,I.Z)("The `supplementaryTextTracks` loadVideo option is deprecated.\nPlease use the `TextTrackRenderer` tool instead.");for(var K,G=Array.isArray(e.supplementaryTextTracks)?e.supplementaryTextTracks:[e.supplementaryTextTracks],W=U(G);!(K=W()).done;){var H=K.value;if("string"!=typeof H.language||"string"!=typeof H.mimeType||"string"!=typeof H.url)throw new Error("Invalid supplementary text track given. Missing either language, mimetype or url")}z.supplementaryTextTracks=G}if(void 0!==e.supplementaryImageTracks){(0,I.Z)("The `supplementaryImageTracks` loadVideo option is deprecated.\nPlease use the `parseBifThumbnails` tool instead.");for(var j,q=Array.isArray(e.supplementaryImageTracks)?e.supplementaryImageTracks:[e.supplementaryImageTracks],Y=U(q);!(j=Y()).done;){var X=j.value;if("string"!=typeof X.mimeType||"string"!=typeof X.url)throw new Error("Invalid supplementary image track given. Missing either mimetype or url")}z.supplementaryImageTracks=q}if((0,h.Z)(null===(s=e.transportOptions)||void 0===s?void 0:s.manifestUpdateUrl)||(0,I.Z)("`manifestUpdateUrl` API is deprecated, please open an issue if you still rely on this."),(0,h.Z)(e.textTrackMode))m=x;else{if("native"!==e.textTrackMode&&"html"!==e.textTrackMode)throw new Error("Invalid textTrackMode.");m=e.textTrackMode}(0,h.Z)(e.defaultAudioTrack)||(0,I.Z)("The `defaultAudioTrack` loadVideo option is deprecated.\nPlease use the `preferredAudioTracks` constructor option or the`setPreferredAudioTracks` method instead");var Q=(0,L.iH)(e.defaultAudioTrack);(0,h.Z)(e.defaultTextTrack)||(0,I.Z)("The `defaultTextTrack` loadVideo option is deprecated.\nPlease use the `preferredTextTracks` constructor option or the`setPreferredTextTracks` method instead");var $=(0,L.Y1)(e.defaultTextTrack),J=!Z;(0,h.Z)(e.hideNativeSubtitle)||((0,I.Z)("The `hideNativeSubtitle` loadVideo option is deprecated"),J=!!e.hideNativeSubtitle);var ee=null!==(u=e.manualBitrateSwitchingMode)&&void 0!==u?u:A,te=(0,h.Z)(e.enableFastSwitching)?w:e.enableFastSwitching;if("html"===m){if((0,h.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.");g=e.textTrackElement}else(0,h.Z)(e.textTrackElement)||l.Z.warn('API: You have set a textTrackElement without being in an "html" textTrackMode. It will be ignored.');if(!(0,h.Z)(e.startAt))if("wallClockTime"in e.startAt&&e.startAt.wallClockTime instanceof Date){var ne=e.startAt.wallClockTime.getTime()/1e3;y=(0,E.Z)({},e.startAt,{wallClockTime:ne})}else y=e.startAt;return{autoPlay:R,defaultAudioTrack:Q,defaultTextTrack:$,enableFastSwitching:te,hideNativeSubtitle:J,keySystems:p,initialManifest:O,lowLatencyMode:D,manualBitrateSwitchingMode:ee,audioTrackSwitchingMode:F,minimumManifestUpdateInterval:B,networkConfig:null!==(d=e.networkConfig)&&void 0!==d?d:{},onCodecSwitch:V,startAt:y,textTrackElement:g,textTrackMode:m,transport:v,transportOptions:z,url:f}}(e);l.Z.info("API: Calling loadvideo",t.url,t.transport),this._priv_reloadingMetadata={options:t},this._priv_initializeContentPlayback(t),this._priv_lastAutoPlay=t.autoPlay},i.reload=function(e){var t,n,r,i,a,o,s=this._priv_reloadingMetadata,u=s.options,l=s.manifest,d=s.reloadPosition,c=s.reloadInPause;if(void 0===u)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.");if(!Array.isArray(null==e?void 0:e.keySystems)&&void 0!==(null==e?void 0:e.keySystems))throw new Error("API: reload - Invalid 'keySystems' option format.");if(void 0!==(null==e?void 0:e.autoPlay)&&"boolean"!=typeof e.autoPlay)throw new Error("API: reload - Invalid 'autoPlay' option format.")}(e),void 0!==(null===(t=null==e?void 0:e.reloadAt)||void 0===t?void 0:t.position))i={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===d)throw new Error("Can't reload to a relative position when previous content was not loaded.");i={position:e.reloadAt.relative+d}}else void 0!==d&&(i={position:d});void 0!==(null==e?void 0:e.autoPlay)?a=e.autoPlay:void 0!==c&&(a=!c),void 0!==(null==e?void 0:e.keySystems)?o=e.keySystems:void 0!==(null===(r=this._priv_reloadingMetadata.options)||void 0===r?void 0:r.keySystems)&&(o=this._priv_reloadingMetadata.options.keySystems);var f=Object.assign(Object.assign({},u),{initialManifest:l});void 0!==i&&(f.startAt=i),void 0!==a&&(f.autoPlay=a),void 0!==o&&(f.keySystems=o),this._priv_initializeContentPlayback(f)},i.createDebugElement=function(e){if(null===g.Z.createDebugElement)throw new Error("Feature `DEBUG_ELEMENT` not added to the RxPlayer");var t=new A.ZP;return g.Z.createDebugElement(e,this,t.signal),{dispose:function(){t.cancel()}}},i._priv_initializeContentPlayback=function(e){var t=this,n=e.autoPlay,r=e.audioTrackSwitchingMode,i=e.defaultAudioTrack,a=e.defaultTextTrack,o=e.enableFastSwitching,s=e.initialManifest,u=e.keySystems,c=e.lowLatencyMode,v=e.manualBitrateSwitchingMode,p=e.minimumManifestUpdateInterval,m=e.networkConfig,y=e.onCodecSwitch,b=e.startAt,S=e.transport,T=e.transportOptions,k=e.url;if(null===this.videoElement)throw new Error("the attached video element is disposed");var I,Z="directfile"===S,x=new A.ZP,R=this.videoElement,M=null;if(Z){if(null===g.Z.directfile)throw this.stop(),this._priv_currentError=null,new Error("DirectFile feature not activated in your build.");if((0,h.Z)(k))throw new Error("No URL for a DirectFile content");if(M=this._priv_initializeMediaElementTrackChoiceManager(i,a,x.signal),x.isUsed())return;I=new g.Z.directfile.initDirectFile({autoPlay:n,keySystems:u,speed:this._priv_speed,startAt:b,url:k})}else{var C=g.Z.transports[S];if("function"!=typeof C)throw this.stop(),this._priv_currentError=null,new Error('transport "'+S+'" not supported');if(null===g.Z.mediaSourceInit)throw new Error("MediaSource streaming not supported");var P=C(T),D=m.offlineRetry,N=m.segmentRetry,O=m.manifestRetry,L=m.manifestRequestTimeout,U=m.segmentRequestTimeout,B={lowLatencyMode:c,maxRetryRegular:O,maxRetryOffline:D,requestTimeout:L,minimumManifestUpdateInterval:p,initialManifest:s},F=d(),V={throttle:{},throttleBitrate:{},limitWidth:{}};this._priv_throttleWhenHidden&&(F?V.throttle={video:(0,w.l)(ce(x.signal),(function(e){return e?1/0:0}),x.signal)}:l.Z.warn("API: Can't apply throttleWhenHidden because browser can't be trusted for visibility.")),this._priv_throttleVideoBitrateWhenHidden&&(F?V.throttleBitrate={video:(0,w.l)(ve(this._priv_pictureInPictureRef,x.signal),(function(e){return e?1/0:0}),x.signal)}:l.Z.warn("API: Can't apply throttleVideoBitrateWhenHidden because browser can't be trusted for visibility.")),this._priv_limitVideoWidth&&(F?V.limitWidth={video:pe(R,this._priv_pictureInPictureRef,x.signal)}:l.Z.warn("API: Can't apply limitVideoWidth because browser can't be trusted for video size."));var K={initialBitrates:this._priv_bitrateInfos.lastBitrates,lowLatencyMode:c,manualBitrates:this._priv_bitrateInfos.manualBitrates,minAutoBitrates:this._priv_bitrateInfos.minAutoBitrates,maxAutoBitrates:this._priv_bitrateInfos.maxAutoBitrates,throttlers:V},G="native"===e.textTrackMode?{textTrackMode:"native",hideNativeSubtitle:e.hideNativeSubtitle}:{textTrackMode:"html",textTrackElement:e.textTrackElement},W=(0,E.Z)({audioTrackSwitchingMode:r,enableFastSwitching:o,manualBitrateSwitchingMode:v,onCodecSwitch:y},this._priv_bufferOptions),H={lowLatencyMode:c,maxRetryRegular:N,requestTimeout:U,maxRetryOffline:D};I=new g.Z.mediaSourceInit({adaptiveOptions:K,autoPlay:n,bufferOptions:W,keySystems:u,lowLatencyMode:c,manifestRequestSettings:B,transport:P,segmentRequestOptions:H,speed:this._priv_speed,startAt:b,textTrackOptions:G,url:k})}var j={contentId:de(),originalUrl:k,currentContentCanceller:x,initializer:I,isDirectFile:Z,segmentBuffersStore:null,thumbnails:null,manifest:null,currentPeriod:null,activeAdaptations:null,activeRepresentations:null,initialAudioTrack:i,initialTextTrack:a,trackChoiceManager:null,mediaElementTrackChoiceManager:M};I.addEventListener("error",(function(e){var n=(0,f.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error stopped content playback."});n.fatal=!0,j.currentContentCanceller.cancel(),t._priv_cleanUpCurrentContentState(),t._priv_currentError=n,l.Z.error("API: The player stopped because of an error",e instanceof Error?e:""),t._priv_setPlayerState("STOPPED"),t._priv_currentError===n&&t.trigger("error",n)})),I.addEventListener("warning",(function(e){var n=(0,f.Z)(e,{defaultCode:"NONE",defaultReason:"An unknown error happened."});l.Z.warn("API: Sending warning:",n),t.trigger("warning",n)})),I.addEventListener("reloadingMediaSource",(function(e){j.segmentBuffersStore=null,null!==j.trackChoiceManager&&j.trackChoiceManager.resetPeriods(),t._priv_lastAutoPlay=e.autoPlay})),I.addEventListener("inbandEvents",(function(e){return t.trigger("inbandEvents",e)})),I.addEventListener("streamEvent",(function(e){return t.trigger("streamEvent",e)})),I.addEventListener("streamEventSkip",(function(e){return t.trigger("streamEventSkip",e)})),I.addEventListener("decipherabilityUpdate",(function(e){return t.trigger("decipherabilityUpdate",e)})),I.addEventListener("activePeriodChanged",(function(e){return t._priv_onActivePeriodChanged(j,e)})),I.addEventListener("periodStreamReady",(function(e){return t._priv_onPeriodStreamReady(j,e)})),I.addEventListener("periodStreamCleared",(function(e){return t._priv_onPeriodStreamCleared(j,e)})),I.addEventListener("representationChange",(function(e){return t._priv_onRepresentationChange(j,e)})),I.addEventListener("adaptationChange",(function(e){return t._priv_onAdaptationChange(j,e)})),I.addEventListener("bitrateEstimationChange",(function(e){return t._priv_onBitrateEstimationChange(e)})),I.addEventListener("manifestReady",(function(e){return t._priv_onManifestReady(j,e)})),I.addEventListener("loaded",(function(e){j.segmentBuffersStore=e.segmentBuffersStore})),I.addEventListener("addedSegment",(function(e){var n=e.content,r=e.segmentData;if("image"===n.adaptation.type&&!(0,h.Z)(r)&&"bif"===r.type){var i=r.data;j.thumbnails=i,t.trigger("imageTrackUpdate",{data:j.thumbnails})}})),I.prepare(),this.stop();var q=new z(R,{withMediaSource:!Z,lowLatencyMode:c});x.signal.register((function(){q.stop()}));var Y=function(e,t,n,r){var i=new w.Z("LOADING",r);e.addEventListener("loaded",(function(){if("LOADING"===i.getValue()){if(i.setValue("LOADED"),!r.isCancelled()){var e=oe(t,null);"PAUSED"!==e&&i.setValue(e)}}else i.setValueIfChanged(oe(t,null))}),r),e.addEventListener("reloadingMediaSource",(function(){se(i.getValue())&&i.setValueIfChanged("RELOADING")}),r);var a=null;return e.addEventListener("stalled",(function(e){e!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,e)),a=e)}),r),e.addEventListener("unstalled",(function(){null!==a&&(se(i.getValue())&&i.setValueIfChanged(oe(t,null)),a=null)}),r),n.listen((function(e){se(i.getValue())&&(0,_.Z)(["seeking","ended","play","pause"],e.event)&&i.setValueIfChanged(oe(t,a))}),{clearSignal:r}),i}(I,R,q,x.signal);x.signal.register((function(){I.dispose()}));var X=function(e){switch(e){case"STOPPED":case"RELOADING":case"LOADING":break;case"ENDED":t._priv_reloadingMetadata.reloadInPause=!0,t._priv_reloadingMetadata.reloadPosition=q.getReference().getValue().position;break;default:var n=q.getReference().getValue();t._priv_reloadingMetadata.reloadInPause=n.paused,t._priv_reloadingMetadata.reloadPosition=n.position}},Q=null,$=function(e){null!==Q&&(Q.cancel(),Q=null),Y.onUpdate((function(n,r){var i,a,o,s;se(n)&&(r(),null!==Q&&Q.cancel(),(Q=new A.ZP).linkToSignal(x.signal),e!==!R.paused&&(R.paused?t.trigger("pause",null):t.trigger("play",null)),i=R,a=function(){return t.trigger("play",null)},o=function(){return t.trigger("pause",null)},(s=x.signal).isCancelled()||null===i||(i.addEventListener("play",a),i.addEventListener("pause",o),s.register((function(){i.removeEventListener("play",a),i.removeEventListener("pause",o)}))))}),{emitCurrentValue:!1,clearSignal:x.signal})};$(n),I.addEventListener("reloadingMediaSource",(function(e){$(e.autoPlay)}));var J=null;Y.onUpdate((function(e){X(e),t._priv_setPlayerState(e),x.isUsed()||(null!==J?se(t.state)||(J.cancel(),J=null):se(t.state)&&((J=new A.ZP).linkToSignal(x.signal),function(e,t,n,r,i){if(!i.isCancelled()&&null!==e){var a=t.getReference().getValue().seeking;a&&(n(),i.isCancelled())||t.listen((function(e){"seeking"===e.event?(a=!0,n()):a&&"seeked"===e.event&&(a=!1,r())}),{includeLastObservation:!0,clearSignal:i})}}(R,q,(function(){return t.trigger("seeking",null)}),(function(){return t.trigger("seeked",null)}),J.signal)),"ENDED"===t.state&&t._priv_stopAtEnd&&t.stop())}),{emitCurrentValue:!0,clearSignal:x.signal}),q.listen((function(e){X(t.state),t._priv_triggerPositionUpdate(j,e)}),{clearSignal:x.signal}),this._priv_currentError=null,this._priv_contentInfos=j,x.signal.register((function(){I.removeEventListener()})),this._priv_contentLock.onUpdate((function(e,t){e||(t(),I.start(R,q))}),{emitCurrentValue:!0,clearSignal:x.signal})},i.getError=function(){return this._priv_currentError},i.getManifest=function(){return(0,I.Z)("getManifest is deprecated. Please open an issue if you used this API."),null===this._priv_contentInfos?null:this._priv_contentInfos.manifest},i.getCurrentAdaptations=function(){if((0,I.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,h.Z)(n[t.id])?null:n[t.id]},i.getCurrentRepresentations=function(){return(0,I.Z)("getCurrentRepresentations is deprecated. Please open an issue if you used this API."),this._priv_getCurrentRepresentations()},i.getVideoElement=function(){return this.videoElement},i.getNativeTextTrack=function(){if((0,I.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},i.getPlayerState=function(){return this.state},i.isContentLoaded=function(){return!(0,_.Z)(["LOADING","RELOADING","STOPPED"],this.state)},i.isBuffering=function(){return(0,_.Z)(["BUFFERING","SEEKING","LOADING","RELOADING"],this.state)},i.isPaused=function(){return!this.videoElement||((0,_.Z)(["LOADING","RELOADING"],this.state)?!this._priv_lastAutoPlay:this.videoElement.paused)},i.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},i.areTrickModeTracksEnabled=function(){return this._priv_preferTrickModeTracks},i.getUrl=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest,r=e.originalUrl;return t?r:null!==n?n.getUrl():void 0}},i.updateContentUrls=function(e,t){if(null===this._priv_contentInfos)throw new Error("No content loaded");var n=!0===(null==t?void 0:t.refresh);this._priv_contentInfos.initializer.updateContentUrls(e,n)},i.getVideoDuration=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.duration},i.getVideoBufferGap=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.L7)(e.buffered,e.currentTime)},i.getVideoLoadedTime=function(){if((0,I.Z)("`getVideoLoadedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.at)(e.buffered,e.currentTime)},i.getVideoPlayedTime=function(){if((0,I.Z)("`getVideoPlayedTime` is deprecated and won't be present in the next major version"),null===this.videoElement)throw new Error("Disposed player");var e=this.videoElement;return(0,k.DD)(e.buffered,e.currentTime)},i.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=a(this.videoElement);return(null!=r?r:0)+this.videoElement.currentTime}return null!==n?this.videoElement.currentTime+(void 0!==n.availabilityStartTime?n.availabilityStartTime:0):0},i.getPosition=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.currentTime},i.getLastStoredContentPosition=function(){return this._priv_reloadingMetadata.reloadPosition},i.getPlaybackRate=function(){return this._priv_speed.getValue()},i.setPlaybackRate=function(e,t){var n;e!==this._priv_speed.getValue()&&this._priv_speed.setValue(e);var r=null==t?void 0:t.preferTrickModeTracks;if("boolean"==typeof r){this._priv_preferTrickModeTracks=r;var i=null===(n=this._priv_contentInfos)||void 0===n?void 0:n.trackChoiceManager;(0,h.Z)(i)||(r&&!i.isTrickModeEnabled()?i.enableVideoTrickModeTracks():!r&&i.isTrickModeEnabled()&&i.disableVideoTrickModeTracks())}},i.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,h.Z)(r.video)?[]:r.video.getAvailableBitrates()},i.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,h.Z)(r.audio)?[]:r.audio.getAvailableBitrates()},i.getManualAudioBitrate=function(){return this._priv_bitrateInfos.manualBitrates.audio.getValue()},i.getManualVideoBitrate=function(){return this._priv_bitrateInfos.manualBitrates.video.getValue()},i.getVideoBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.Z)(e.video))return e.video.bitrate},i.getAudioBitrate=function(){var e=this._priv_getCurrentRepresentations();if(null!==e&&!(0,h.Z)(e.audio))return e.audio.bitrate},i.getMinVideoBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.video.getValue()},i.getMinAudioBitrate=function(){return this._priv_bitrateInfos.minAutoBitrates.audio.getValue()},i.getMaxVideoBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.video.getValue()},i.getMaxAudioBitrate=function(){return this._priv_bitrateInfos.maxAutoBitrates.audio.getValue()},i.play=function(){var e=this;if(null===this.videoElement)throw new Error("Disposed player");var t=this.videoElement.play();return(0,h.Z)(t)||"function"!=typeof t.catch?Promise.resolve():t.catch((function(t){if("NotAllowedError"===t.name){var n=new v.Z("MEDIA_ERR_PLAY_NOT_ALLOWED",t.toString());e.trigger("warning",n)}throw t}))},i.pause=function(){if(null===this.videoElement)throw new Error("Disposed player");this.videoElement.pause()},i.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,o=r.manifest;if(!i&&null===o)throw new Error("player: the content did not load yet");if("number"==typeof e)n=e;else if("object"==typeof e){var s=e,u=this.videoElement.currentTime;if((0,h.Z)(s.relative))if((0,h.Z)(s.position)){if((0,h.Z)(s.wallClockTime))throw new Error('invalid time object. You must set one of the following properties: "relative", "position" or "wallClockTime"');if(null!==o)n=s.wallClockTime-(null!==(t=o.availabilityStartTime)&&void 0!==t?t:0);else if(i&&null!==this.videoElement){var d=a(this.videoElement);void 0!==d&&(n=s.wallClockTime-d)}void 0===n&&(n=s.wallClockTime)}else n=s.position;else n=u+s.relative}if(void 0===n)throw new Error("invalid time given");return l.Z.info("API: API Seek to",n),this.videoElement.currentTime=n,n},i.isFullscreen=function(){return(0,I.Z)("isFullscreen is deprecated. Fullscreen management should now be managed by the application"),s()},i.setFullscreen=function(e){if(void 0===e&&(e=!0),(0,I.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(!s()){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):o()},i.exitFullscreen=function(){(0,I.Z)("exitFullscreen is deprecated. Fullscreen management should now be managed by the application"),o()},i.getVolume=function(){if(null===this.videoElement)throw new Error("Disposed player");return this.videoElement.volume},i.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))},i.isMute=function(){return 0===this.getVolume()},i.mute=function(){this._priv_mutedMemory=this.getVolume(),this.setVolume(0)},i.unMute=function(){var e=c.Z.getCurrent().DEFAULT_UNMUTED_VOLUME;0===this.getVolume()&&this.setVolume(0===this._priv_mutedMemory?e:this._priv_mutedMemory)},i.setVideoBitrate=function(e){this._priv_bitrateInfos.manualBitrates.video.setValue(e)},i.setAudioBitrate=function(e){this._priv_bitrateInfos.manualBitrates.audio.setValue(e)},i.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)},i.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)},i.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)},i.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)},i.setMaxBufferBehind=function(e){this._priv_bufferOptions.maxBufferBehind.setValue(e)},i.setMaxBufferAhead=function(e){this._priv_bufferOptions.maxBufferAhead.setValue(e)},i.setWantedBufferAhead=function(e){this._priv_bufferOptions.wantedBufferAhead.setValue(e)},i.setMaxVideoBufferSize=function(e){this._priv_bufferOptions.maxVideoBufferSize.setValue(e)},i.getMaxBufferBehind=function(){return this._priv_bufferOptions.maxBufferBehind.getValue()},i.getMaxBufferAhead=function(){return this._priv_bufferOptions.maxBufferAhead.getValue()},i.getWantedBufferAhead=function(){return this._priv_bufferOptions.wantedBufferAhead.getValue()},i.getMaxVideoBufferSize=function(){return this._priv_bufferOptions.maxVideoBufferSize.getValue()},i.getCurrentKeySystem=function(){if((0,I.Z)("`getCurrentKeySystem` is deprecated.Please use the `getKeySystemConfiguration` method instead."),null===this.videoElement)throw new Error("Disposed player");return(0,N.M)(this.videoElement)},i.getKeySystemConfiguration=function(){if(null===this.videoElement)throw new Error("Disposed player");var e=(0,N.Z)(this.videoElement);return null===e?null:{keySystem:e[0],configuration:e[1]}},i.getAvailableAudioTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableAudioTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableAudioTracks(n)},i.getAvailableTextTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableTextTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableTextTracks(n)},i.getAvailableVideoTracks=function(){var e;if(null===this._priv_contentInfos)return[];var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;return r?null!==(e=null==a?void 0:a.getAvailableVideoTracks())&&void 0!==e?e:[]:null===i||null===n?[]:i.getAvailableVideoTracks(n)},i.getAudioTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenAudioTrack()}if(null!==r&&null!==t)return r.getChosenAudioTrack(t)}},i.getTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenTextTrack()}if(null!==r&&null!==t)return r.getChosenTextTrack(t)}},i.getVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n){if(null===i)return;return i.getChosenVideoTrack()}if(null!==r&&null!==t)return r.getChosenVideoTrack(t)}},i.setAudioTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setAudioTrackById(e))}catch(e){throw new Error("player: unknown audio track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setAudioTrackByID(n,e)}catch(e){throw new Error("player: unknown audio track")}},i.setTextTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setTextTrackById(e))}catch(e){throw new Error("player: unknown text track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setTextTrackByID(n,e)}catch(e){throw new Error("player: unknown text track")}},i.disableTextTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n)null==i||i.disableTextTrack();else if(null!==r&&null!==t)return r.disableTextTrack(t)}},i.setVideoTrack=function(e){if(null===this._priv_contentInfos)throw new Error("No content loaded");var t=this._priv_contentInfos,n=t.currentPeriod,r=t.isDirectFile,i=t.trackChoiceManager,a=t.mediaElementTrackChoiceManager;if(r)try{return void(null==a||a.setVideoTrackById(e))}catch(e){throw new Error("player: unknown video track")}if(null===i||null===n)throw new Error("No compatible content launched.");try{i.setVideoTrackByID(n,e)}catch(e){throw new Error("player: unknown video track")}},i.disableVideoTrack=function(){if(null!==this._priv_contentInfos){var e=this._priv_contentInfos,t=e.currentPeriod,n=e.isDirectFile,r=e.trackChoiceManager,i=e.mediaElementTrackChoiceManager;if(n&&null!==i)return i.disableVideoTrack();if(null!==r&&null!==t)return r.disableVideoTrack(t)}},i.getPreferredAudioTracks=function(){return this._priv_preferredAudioTracks},i.getPreferredTextTracks=function(){return this._priv_preferredTextTracks},i.getPreferredVideoTracks=function(){return this._priv_preferredVideoTracks},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredAudioTracks(e,t):null==n||n.trackChoiceManager.setPreferredAudioTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredTextTracks(e,t):null==n||n.trackChoiceManager.setPreferredTextTracks(e,t)},i.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;var n=this._priv_contentInfos;(0,h.Z)(null==n?void 0:n.trackChoiceManager)?(0,h.Z)(null==n?void 0:n.mediaElementTrackChoiceManager)||null==n||n.mediaElementTrackChoiceManager.setPreferredVideoTracks(e,t):null==n||n.trackChoiceManager.setPreferredVideoTracks(e,t)},i.getImageTrackData=function(){return(0,I.Z)("`getImageTrackData` is deprecated.Please use the `parseBifThumbnails` tool instead."),null===this._priv_contentInfos?null:this._priv_contentInfos.thumbnails},i.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},i.getLivePosition=function(){if(null===this._priv_contentInfos)return null;var e=this._priv_contentInfos,t=e.isDirectFile,n=e.manifest;return t?void 0:!0!==(null==n?void 0:n.isLive)?null:n.getLivePosition()},i.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},i.__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.synchronizeInventory(!0),t.value.getInventory()):null},i._priv_cleanUpCurrentContentState=function(){var e,t,n=this;l.Z.debug("Locking `contentLock` to clean-up the current content."),this._priv_contentLock.setValue(!0),null===(t=null===(e=this._priv_contentInfos)||void 0===e?void 0:e.mediaElementTrackChoiceManager)||void 0===t||t.dispose(),this._priv_contentInfos=null,this._priv_contentEventsMemory={};var r=function(){null!==n.videoElement&&(l.Z.debug("Unlocking `contentLock`. Next content can begin."),n._priv_contentLock.setValue(!1))};(0,h.Z)(this.videoElement)?r():O(this.videoElement).then((function(){l.Z.debug("API: DRM session cleaned-up with success!"),r()}),(function(e){l.Z.error("API: An error arised when trying to clean-up the DRM session:"+(e instanceof Error?e.toString():"Unknown Error")),r()}))},i._priv_onManifestReady=function(e,t){var n,r=this;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.manifest=t;var i=e.currentContentCanceller.signal;this._priv_reloadingMetadata.manifest=t;var a=e.initialAudioTrack,o=e.initialTextTrack;e.trackChoiceManager=new Q({preferTrickModeTracks:this._priv_preferTrickModeTracks});var s=void 0===a?this._priv_preferredAudioTracks:[a];e.trackChoiceManager.setPreferredAudioTracks(s,!0);var u=void 0===o?this._priv_preferredTextTracks:[o];e.trackChoiceManager.setPreferredTextTracks(u,!0),e.trackChoiceManager.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),t.addEventListener("manifestUpdate",(function(t){var n,a,o;null!==e.trackChoiceManager&&e.trackChoiceManager.update();var s=null!==(a=null===(n=r._priv_contentInfos)||void 0===n?void 0:n.currentPeriod)&&void 0!==a?a:void 0,u=null===(o=r._priv_contentInfos)||void 0===o?void 0:o.trackChoiceManager;if(void 0!==s&&!(0,h.Z)(u))for(var l,d=ue(t.updatedPeriods);!(l=d()).done;){var c=l.value;if(c.period.id===s.id&&(c.result.addedAdaptations.length>0||c.result.removedAdaptations.length>0)){var f=u.getAvailableAudioTracks(s);r._priv_triggerEventIfNotStopped("availableAudioTracksChange",null!=f?f:[],i);var v=u.getAvailableTextTracks(s);r._priv_triggerEventIfNotStopped("availableTextTracksChange",null!=v?v:[],i);var p=u.getAvailableVideoTracks(s);r._priv_triggerEventIfNotStopped("availableVideoTracksChange",null!=p?p:[],i)}return}}),e.currentContentCanceller.signal)}},i._priv_onActivePeriodChanged=function(e,t){var n,r,i,a,o,s,u,l,d=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){e.currentPeriod=d;var c=e.currentContentCanceller.signal;this._priv_contentEventsMemory.periodChange!==d&&(this._priv_contentEventsMemory.periodChange=d,this._priv_triggerEventIfNotStopped("periodChange",d,c)),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",this.getAvailableAudioTracks(),c),this._priv_triggerEventIfNotStopped("availableTextTracksChange",this.getAvailableTextTracks(),c),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",this.getAvailableVideoTracks(),c);var f=null===(r=this._priv_contentInfos)||void 0===r?void 0:r.trackChoiceManager;if((0,h.Z)(f))this._priv_triggerEventIfNotStopped("audioTrackChange",null,c),this._priv_triggerEventIfNotStopped("textTrackChange",null,c),this._priv_triggerEventIfNotStopped("videoTrackChange",null,c);else{var v=f.getChosenAudioTrack(d);this._priv_triggerEventIfNotStopped("audioTrackChange",v,c);var p=f.getChosenTextTrack(d);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);var m=f.getChosenVideoTrack(d);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c)}if(this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",this.getAvailableAudioBitrates(),c),!e.currentContentCanceller.isUsed()&&(this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",this.getAvailableVideoBitrates(),c),!e.currentContentCanceller.isUsed())){var g=null!==(o=null===(a=null===(i=this._priv_getCurrentRepresentations())||void 0===i?void 0:i.audio)||void 0===a?void 0:a.bitrate)&&void 0!==o?o:-1;if(this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",g,c),!e.currentContentCanceller.isUsed()){var y=null!==(l=null===(u=null===(s=this._priv_getCurrentRepresentations())||void 0===s?void 0:s.video)||void 0===u?void 0:u.bitrate)&&void 0!==l?l:-1;this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",y,c)}}}},i._priv_onPeriodStreamReady=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=t.adaptationRef,o=e.trackChoiceManager;switch(r){case"video":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new video period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialVideoTrack(i));break;case"audio":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialAudioTrack(i));break;case"text":(0,h.Z)(o)?(l.Z.error("API: TrackChoiceManager not instanciated for a new "+r+" period"),a.setValue(null)):(o.addPeriod(r,i,a),o.setInitialTextTrack(i));break;default:var s=i.adaptations[r];!(0,h.Z)(s)&&s.length>0?a.setValue(s[0]):a.setValue(null)}}},i._priv_onPeriodStreamCleared=function(e,t){var n;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var r=t.type,i=t.period,a=e.trackChoiceManager;switch(r){case"audio":case"text":case"video":(0,h.Z)(a)||a.removePeriod(r,i)}var o=e.activeAdaptations,s=e.activeRepresentations;if(!(0,h.Z)(o)&&!(0,h.Z)(o[i.id])){var u=o[i.id];delete u[r],0===Object.keys(u).length&&delete o[i.id]}if(!(0,h.Z)(s)&&!(0,h.Z)(s[i.id])){var l=s[i.id];delete l[r],0===Object.keys(l).length&&delete s[i.id]}}},i._priv_onAdaptationChange=function(e,t){var n,r=t.type,i=t.adaptation,a=t.period;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeAdaptations&&(e.activeAdaptations={});var o,s=e.activeAdaptations,u=e.currentPeriod,l=s[a.id];if((0,h.Z)(l))s[a.id]=((o={})[r]=i,o);else l[r]=i;var d=e.trackChoiceManager,c=e.currentContentCanceller.signal;if(null!==d&&null!==u&&!(0,h.Z)(a)&&a.id===u.id)switch(r){case"audio":var f=d.getChosenAudioTrack(u);this._priv_triggerEventIfNotStopped("audioTrackChange",f,c);var v=this.getAvailableAudioBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableAudioBitratesChange",v,c);break;case"text":var p=d.getChosenTextTrack(u);this._priv_triggerEventIfNotStopped("textTrackChange",p,c);break;case"video":var m=d.getChosenVideoTrack(u);this._priv_triggerEventIfNotStopped("videoTrackChange",m,c);var g=this.getAvailableVideoBitrates();this._priv_triggerAvailableBitratesChangeEvent("availableVideoBitratesChange",g,c)}}},i._priv_onRepresentationChange=function(e,t){var n,r,i=t.type,a=t.period,o=t.representation;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){null===e.activeRepresentations&&(e.activeRepresentations={});var s,u=e.activeRepresentations,l=e.currentPeriod,d=u[a.id];if((0,h.Z)(d))u[a.id]=((s={})[i]=o,s);else d[i]=o;var c=null!==(r=null==o?void 0:o.bitrate)&&void 0!==r?r:-1;if(!(0,h.Z)(a)&&null!==l&&l.id===a.id){var f=this._priv_contentInfos.currentContentCanceller.signal;"video"===i?this._priv_triggerCurrentBitrateChangeEvent("videoBitrateChange",c,f):"audio"===i&&this._priv_triggerCurrentBitrateChangeEvent("audioBitrateChange",c,f)}}},i._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})},i._priv_onNativeTextTracksNext=function(e){this.trigger("nativeTextTracksChange",e)},i._priv_setPlayerState=function(e){this.state!==e&&(this.state=e,l.Z.info("API: playerStateChange event",e),this.trigger("playerStateChange",e))},i._priv_triggerPositionUpdate=function(e,t){var n,r;if(e.contentId===(null===(n=this._priv_contentInfos)||void 0===n?void 0:n.contentId)){var i=e.isDirectFile,o=e.manifest;if((i||null!==o)&&!(0,h.Z)(t)){var s=null!==o?o.getMaximumSafePosition():void 0,u={position:t.position,duration:t.duration,playbackRate:t.playbackRate,maximumBufferTime:s,bufferGap:void 0!==t.bufferGap&&isFinite(t.bufferGap)?t.bufferGap:0};if(null!==o&&o.isLive&&t.position>0){var l=null!==(r=o.availabilityStartTime)&&void 0!==r?r:0;u.wallClockTime=t.position+l;var d=o.getLivePosition();void 0!==d&&(u.liveGap=d-t.position)}else if(i&&null!==this.videoElement){var c=a(this.videoElement);void 0!==c&&(u.wallClockTime=c+t.position)}this.trigger("positionUpdate",u)}}},i._priv_triggerAvailableBitratesChangeEvent=function(e,t,n){var r=this._priv_contentEventsMemory[e];n.isCancelled()||void 0!==r&&(0,y.Z)(t,r)||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._priv_triggerCurrentBitrateChangeEvent=function(e,t,n){n.isCancelled()||t===this._priv_contentEventsMemory[e]||(this._priv_contentEventsMemory[e]=t,this.trigger(e,t))},i._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,h.Z)(n[t.id])?null:n[t.id]},i._priv_triggerEventIfNotStopped=function(e,t,n){n.isCancelled()||this.trigger(e,t)},i._priv_initializeMediaElementTrackChoiceManager=function(e,t,n){var r,i,a,o=this;(0,b.Z)(null!==g.Z.directfile,"Initializing `MediaElementTrackChoiceManager` without Directfile feature"),(0,b.Z)(null!==this.videoElement,"Initializing `MediaElementTrackChoiceManager` on a disposed RxPlayer");var s=new g.Z.directfile.mediaElementTrackChoiceManager(this.videoElement),u=void 0===e?this._priv_preferredAudioTracks:[e];s.setPreferredAudioTracks(u,!0);var l=void 0===t?this._priv_preferredTextTracks:[t];return s.setPreferredTextTracks(l,!0),s.setPreferredVideoTracks(this._priv_preferredVideoTracks,!0),this._priv_triggerEventIfNotStopped("availableAudioTracksChange",s.getAvailableAudioTracks(),n),this._priv_triggerEventIfNotStopped("availableVideoTracksChange",s.getAvailableVideoTracks(),n),this._priv_triggerEventIfNotStopped("availableTextTracksChange",s.getAvailableTextTracks(),n),this._priv_triggerEventIfNotStopped("audioTrackChange",null!==(r=s.getChosenAudioTrack())&&void 0!==r?r:null,n),this._priv_triggerEventIfNotStopped("textTrackChange",null!==(i=s.getChosenTextTrack())&&void 0!==i?i:null,n),this._priv_triggerEventIfNotStopped("videoTrackChange",null!==(a=s.getChosenVideoTrack())&&void 0!==a?a:null,n),s.addEventListener("availableVideoTracksChange",(function(e){return o.trigger("availableVideoTracksChange",e)})),s.addEventListener("availableAudioTracksChange",(function(e){return o.trigger("availableAudioTracksChange",e)})),s.addEventListener("availableTextTracksChange",(function(e){return o.trigger("availableTextTracksChange",e)})),s.addEventListener("audioTrackChange",(function(e){return o.trigger("audioTrackChange",e)})),s.addEventListener("videoTrackChange",(function(e){return o.trigger("videoTrackChange",e)})),s.addEventListener("textTrackChange",(function(e){return o.trigger("textTrackChange",e)})),s},(0,e.Z)(r,null,[{key:"ErrorTypes",get:function(){return p.ZB}},{key:"ErrorCodes",get:function(){return p.SM}},{key:"LogLevel",get:function(){return l.Z.getLevel()},set:function(e){l.Z.setLevel(e)}}]),r}(S.Z);ye.version="3.33.1";var _e=ye;!function(){m.Z.mediaSourceInit=n(7117).Z,m.Z.decrypt=n(3380).ZP,m.Z.imageBuffer=n(7127).Z,m.Z.imageParser=n(3203).Z,m.Z.transports.smooth=n(2339).Z,m.Z.transports.dash=n(85).Z,m.Z.dashParsers.js=n(1707).Z,m.Z.nativeTextTracksBuffer=n(9059).Z,m.Z.nativeTextTracksParsers.vtt=n(9405).Z,m.Z.nativeTextTracksParsers.ttml=n(1570).Z,m.Z.nativeTextTracksParsers.sami=n(1812).Z,m.Z.nativeTextTracksParsers.srt=n(8057).Z,m.Z.htmlTextTracksBuffer=n(5192).Z,m.Z.htmlTextTracksParsers.sami=n(5734).Z,m.Z.htmlTextTracksParsers.ttml=n(7439).Z,m.Z.htmlTextTracksParsers.srt=n(8675).Z,m.Z.htmlTextTracksParsers.vtt=n(4099).Z;var e=n(9372).Z,t=n(6796).Z;m.Z.directfile={initDirectFile:e,mediaElementTrackChoiceManager:t}}(),"boolean"==typeof __RX_PLAYER_DEBUG_MODE__&&__RX_PLAYER_DEBUG_MODE__&&l.Z.setLevel("DEBUG");var be=_e}(),r=r.default}()}));
|